query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
e4ae4d7629ecb28c4566254448c1283f
This function is called whenever next or back is clicked It checks wheither their is a saved awnser and loads it. If there was no saved awnsers it unchecks all checkboxes.
[ { "docid": "8c19c48efbdb86ebf57b0f2a3c6f5d91", "score": "0.542287", "text": "function loadAnswer() {\n\n if (currentQuestion != -1 && currentQuestion < 5) {\n console.log(\"Loading Quesiton#\" + (currentQuestion + 1) + \"From \" + JSON.stringify(MCQMemory[currentQuestion]));\n checkboxes[0].checked = MCQMemory[currentQuestion].checkbox1\n checkboxes[1].checked = MCQMemory[currentQuestion].checkbox2\n checkboxes[2].checked = MCQMemory[currentQuestion].checkbox3\n checkboxes[3].checked = MCQMemory[currentQuestion].checkbox4\n\n }\n else if (currentQuestion >= 5 && currentQuestion < 8) {\n console.log(\"Loading Quesiton#\" + (currentQuestion + 1) + \"From \" + JSON.stringify(MCQMemory[currentQuestion]));\n checkboxes[0].checked = MCQMemory[currentQuestion].checkbox1\n checkboxes[1].checked = MCQMemory[currentQuestion].checkbox2\n checkboxes[2].checked = MCQMemory[currentQuestion].checkbox3\n checkboxes[3].checked = MCQMemory[currentQuestion].checkbox4\n\n\n\n }\n }", "title": "" } ]
[ { "docid": "0c12163da09435c366bd3304d1d564a6", "score": "0.6081659", "text": "function validatePage() {\n\t\tenableNextButton( false );\n\t\t$checkboxes.each( function() {\n\t\t\tif ( this.checked ) {\n\t\t\t\tenableNextButton( true );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} );\n\t}", "title": "" }, { "docid": "9fc55be0d596883a3fd9ea59e049d17f", "score": "0.59672695", "text": "function onCheckSaved(response){\n if(connection_status == \"connected\"){\n if(response.hasOwnProperty(\"results\") && response.results != \"error\"){\n if(response.results.length > 0){\n page_status == \"already_saved\";\n var page = response.results[0];\n dom.save_button_txt.html(\"Saved to Bookmarks\")\n dom.save_button.on(\"click\", openFrontEnd);\n if(page.notes.trim() == \"\"){\n dom.review.notes_section.hide();\n } else {\n page.notes_section.show();\n dom.review.notes.html(page.notes);\n }\n switchArea(\"review\");\n }\n }\n }\n}", "title": "" }, { "docid": "cb22f2d869d11834f5d84cafa047ea7c", "score": "0.5934779", "text": "function doBack() {\n if (currentStep > 1) {\n var cyvtype = di_jq('#cyvType').val();\n var backCt = 1;\n if (cyvtype == 'Spreadsheet' || cyvtype == 'SDMX-ML') backCt = 2;\n useMapserverChkbxChecked = false;\n di_jq('#NextBttn').val(\"Next\");\n setDataStep(currentStep - backCt);\n }\n}", "title": "" }, { "docid": "26e5b5f0ed345fd01b60bdd64edd5461", "score": "0.5932336", "text": "function load() {\n const Allchecked = JSON.parse(localStorage.getItem('profileCheck', 'emailCheck'));\n if(emailChecked === true && profileChecked === true) {\n document.getElementById('profileCheck').checked = checkedBoth();\n document.getElementById('emailCheck').checked = checkedBoth();\n } else if(emailChecked === true) {\n document.getElementById('emailCheck').checked = emailChecked;\n } else if(profileChecked === true) {\n document.getElementById('profileCheck').checked = profileChecked;\n }\n \n}", "title": "" }, { "docid": "91d43fb50827444bfca97300ca6d63f1", "score": "0.5917565", "text": "function restore_options() {\n var enableInfiniteScroll = localStorage[\"enable_infinite_scroll\"];\n var enableTabs = localStorage[\"enable_tabs\"];\n var enableFocus = localStorage[\"enable_focus\"];\n var enablePing = localStorage[\"enable_ping\"];\n var enableLinks = localStorage[\"enable_links\"];\n\n $(\"#enableInfiniteScroll\").attr(\"checked\", enableInfiniteScroll == \"true\");\n $(\"#enableTabs\").attr(\"checked\", enableTabs == \"true\");\n $(\"#enableFocus\").attr(\"checked\", enableFocus == \"true\");\n $(\"#enablePing\").attr(\"checked\", enablePing == \"true\");\n $(\"#enableLinks\").attr(\"checked\", enableLinks == \"true\");\n}", "title": "" }, { "docid": "060e0cb80c86ad4d5f9a76ed3c127b65", "score": "0.586938", "text": "function restoreOptions() {\n var i, len, elements, elem, config;\n config = JSON.parse(localStorage.config);\n elements = mainview.querySelectorAll('input[type=checkbox]');\n for (i = 0, len = elements.length ; i < len ; i += 1) {\n elem = elements[i];\n elem.checked = config[elem.name];\n }\n }", "title": "" }, { "docid": "be764becfa782816b0d262296f92fef2", "score": "0.58406186", "text": "function init() {\n parseLocalStorage();\n $('autoRedirect').checked = optAutoRedirect;\n $('preferDanforth').checked = optPreferDanforth;\n //$('usageOptOut').checked = optUsageOptOut;\n}", "title": "" }, { "docid": "d5048adbdf97f9a7d6c3a11c863bf472", "score": "0.58128077", "text": "function saveCheckboxState() {\n var checkbox = document.getElementById(\"readCheckbox\");\n var postId = getPageUrl(); // Use the current page URL as the unique identifier for each post\n\n if (checkbox.checked) {\n localStorage.setItem(postId, \"1\");\n } else {\n localStorage.removeItem(postId);\n }\n}", "title": "" }, { "docid": "1e08a64689f576f0123b507cb87757d1", "score": "0.5798861", "text": "function loadCheckData() {\n const checkedTabs = JSON.parse(localStorage.getItem(\"checked tab\"));\n if (checkedTabs) {\n const checkedTabsPosition = checkedTabs.map((tab) => tab.position);\n checkedTabsPosition.forEach((position) => {\n checkBoxes[position].checked = \"true\";\n });\n }\n}", "title": "" }, { "docid": "2ca019e8a8bfffd9491a035b0444a4b4", "score": "0.5795561", "text": "function loadCheck() {\n // initialize arrays and remove previous buttons\n labels = [];\n buttonsArray = [];\n removeShortcuts();\n\n //check for new labels and build new buttons\n let checkForLabels = setInterval(function () {\n findLabels();\n buildButtons();\n\n // once labels are found, stop looking until loadCheck is called again\n if (buttonsArray.length > 0) {\n clearInterval(checkForLabels);\n }\n }, 1000);\n}", "title": "" }, { "docid": "a63af1ba2acc47d1bafaeec45a60a1df", "score": "0.57919306", "text": "function saveLogin() {\n var remeberCheck = document.getElementById('remeber-me');\n localStorage.login = true;\n if (remeberCheck.checked) {\n localStorage.saved = true;\n } else {\n localStorage.saved = false;\n }\n}", "title": "" }, { "docid": "0433eb188f0703782146a5973e7a60d6", "score": "0.5776515", "text": "function localStorageLoad() {\r\n try {\r\n if (typeof(Storage) === 'undefined') {\r\n return false;\r\n }\r\n var tmp = localStorage.getItem(localStorageKey);\r\n if (tmp) {\r\n localStorageObj = JSON.parse(tmp);\r\n }\r\n //Checkboxes\r\n for (var p in localStorageObj.checkboxes) {\r\n if (localStorageObj.checkboxes[p] === true) {\r\n $('#' + p).trigger(\"click\");\r\n }\r\n }\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n}", "title": "" }, { "docid": "0470c85b84e9ebeb83b4762c96372d21", "score": "0.5772232", "text": "function restore_options() { // on new page load\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get({\n math: true,\n cs: true,\n chem: true,\n drawing: true,\n econ: true,\n cb: true\n }, function(items) {\n document.getElementById('math').checked = items.math;\n document.getElementById('cs').checked = items.cs;\n document.getElementById('chem').checked = items.chem;\n document.getElementById('drawing').checked = items.drawing;\n document.getElementById('econ').checked = items.econ;\n document.getElementById('cb').checked = items.cb;\n });\n}", "title": "" }, { "docid": "844595ca26eee1c46c031a31859958cd", "score": "0.57440454", "text": "function checkBackButton() {\n\t\tvar value = getCookieValue(\"value\");\n\t\tif(value == 1) {\n\t\t\t document.cookie = \"value=0;\";\n\t\t\t window.location.reload(true);\n\t\t}\n\t}", "title": "" }, { "docid": "eadf1a38f5d344489085699a1583cd99", "score": "0.5742078", "text": "static updateNavBtnState() {\n if(collectedData.hasNext() && !collectedData.hasPrev()) {\n $(\"#next\").prop(\"disabled\", false);\n $(\"#prev, #finish\").prop(\"disabled\", true);\n } else if (collectedData.hasPrev() && !collectedData.hasNext()) {\n $(\"#prev, #finish\").prop(\"disabled\", false);\n $(\"#next\").prop(\"disabled\", true);\n } else if (!collectedData.hasPrev() && !collectedData.hasNext()) {\n $(\"#next, #prev\").prop(\"disabled\", true);\n $(\"finish\").prop(\"disabled\", false);\n } else {\n $(\"#prev, #next\").prop(\"disabled\", false);\n $(\"#next\").prop(\"disabled\", false);\n }\n\n }", "title": "" }, { "docid": "14a82358fdcd7a28bf443b964b4a97bc", "score": "0.57366276", "text": "function backButtonHandler() {\n switch(currentState) {\n case \"SelectAnomalyTypes\":\n saveAnomalyTypesForm()\n basicInputs = getBasicInputs()\n loadEnvironmentBuilderPage(basicInputs.name, basicInputs.height, basicInputs.width)\n break;\n case \"SelectElementTypes\":\n if (checkCustomInputs()) {\n saveElementTypesForm()\n loadAnomalySelectionForm()\n }\n break;\n case \"SelectTerrainModificationTypes\":\n if (checkCustomInputs()) {\n saveTerrainModificationTypesForm()\n loadElementSelectionForm()\n }\n break;\n case \"ElementSeedForm\":\n if (checkCustomInputs()) {\n saveElementSeedForm()\n loadPreviousElementSeedForm()\n }\n break;\n case \"TerrainModificationForm\":\n if (checkCustomInputs()) {\n saveTerrainModificationForm()\n loadPreviousTerrainModificationForm()\n }\n break;\n case \"AnomalyForm\":\n if (checkCustomInputs()) {\n saveAnomalyForm()\n loadPreviousAnomalyForm()\n }\n break;\n case \"ReviewForm\":\n document.getElementById(\"next-button\").innerText = \"Next\"\n loadPreviousAnomalyForm()\n }\n}", "title": "" }, { "docid": "c2edc01a931caec27bcc1bb9b960896c", "score": "0.57301915", "text": "function getChecklistState(){ \n \n var pageID= addID();\n\n\tif (checklist.all== \"[object]\") {\n\toTD=checklist.all.tags(\"INPUT\");\n\tiTD= oTD.length;\n\t\t}\n\telse\n\t\t{\n\t\tprinting = \"TRUE\";\n\t\tisPersistent = false;\n\t\treturn;\n\t\t}\n\n\tif (iTD == 0){\n\t\tprinting = \"TRUE\";\n\t\tisPersistent = false;\n\t\treturn;\n\t\t}\n\t\n// routine added to fix a bug in the ocx 06/14/99\t\n lct = document.location + \".\";\n\t xax = 10;\n\t xax = lct.indexOf(\"mk:@MSITStore\");\n\t if (xax != -1) {\n\t \tlct = \"ms-its:\" + lct.substring(14,lct.length-1);\n\t\tisPersistent = false;\n\t\tdocument.location.replace(lct);\n\t\tisPersistent = true;\n\t\t// alert(\"after reload : \" + document.location);\n\t\t}\t \n\t else\n\t \t{ \t \n \tchecklist.load(\"oXMLStore\");\n\t\t}\n// routine added to fix a bug in the ocx 06/14/99\n\n xax = 10;\n\txax = pageID.indexOf(\"~\");\n\tif (xax == -1) {\n \tif (checklist.getAttribute(\"sPersist\"+pageID+\"0\"))\t\n \tfor (i=0; i<iTD; i++){\n\t\n if (oTD[i].type ==\"checkbox\" || oTD[i].type ==\"radio\"){\n\t checkboxValue= checklist.getAttribute(\"sPersist\"+pageID+i);\n\t\t\n\t \tif (checkboxValue==\"yes\") oTD[i].checked=true;\n\t\telse oTD[i].checked=false;\n\t\t}// if\n\t\tif (oTD[i].type ==\"text\") \t\t \n \t oTD[i].value= checklist.getAttribute(\"sPersist\"+pageID+i);\n \t}// for\n\t }\n} // end persistence", "title": "" }, { "docid": "f90dcefbc79cd0b13231448ca21c75c4", "score": "0.57291245", "text": "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get({\n masterbuilder: false,\n resourceIndicator: false,\n upgradeIndicator: false,\n }, function(items) {\n $('#masterbuilder').prop('checked', items.masterbuilder);\n $('#resourceIndicator').prop('checked', items.resourceIndicator);\n $('#upgradeIndicator').prop('checked', items.upgradeIndicator);\n });\n }", "title": "" }, { "docid": "4595712dc46630c08c5a3f2984a6ef58", "score": "0.57256526", "text": "function lastButtonClickEventHandler() {\n if (storeInventoryCurrentPage > 0) {\n storeInventoryCurrentPage--;\n load5Stores();\n }\n updateStoreAvailabilityButtons();\n}", "title": "" }, { "docid": "f93900956072c5a684e85a31b6a43b5b", "score": "0.57180065", "text": "function removefromsaved() {\n var results = U.$(\"mySaved\");\n for (var i = 0; i < results.childNodes.length; i++) {\n if (!results.childNodes[i].childNodes[2].checked) {\n var removeCheck = results.childNodes[i].id;\n results.removeChild(results.childNodes[i]);\n if (results.childNodes.length === 0) {\n var notText = document.createElement(\"p\");\n notText.id = \"noText\";\n notText.innerText = \"No Articles Saved\";\n results.appendChild(notText);\n defaultStore();\n }\n var topList = U.$(\"results\");\n for (var j = 0; j < topList.childNodes.length; j++) {\n if (topList.childNodes[i].id === removeCheck) {\n topList.childNodes[i].childNodes[2].checked = false;\n }\n }\n }\n }\n var data = []\n for (var i = 0; i < results.childNodes.length; i++) {\n data[i] = localStorage.getItem(results.childNodes[i].id);\n }\n localStorage.setItem(\"savedList\", data);\n}", "title": "" }, { "docid": "f9b1fa207a86aa66a7fb0d3baabf2cb5", "score": "0.5714993", "text": "function setButtons() {\n //check to see that it exists\n if (checkeds[qcount - 1] != 0) {\n $('#c' + checkeds[qcount - 1]).prop('checked', true);\n } else {\n //If not, make them all unchecked\n for (i = 0; i < obj.questions[qcount - 1].c.length; i++) {\n $('#c' + (i + 1)).prop('checked', false);\n }\n }\n }", "title": "" }, { "docid": "c133cc58af5026ce0b7c4cf9f8151050", "score": "0.5711552", "text": "function saveChecker() {\n\tif (localStorage[\"todo0\"]) {\n\t\tsavedPresent = true;\n\t} else {\n\t\tsavedPresent = false;\n\t}\n}", "title": "" }, { "docid": "4a199727a03c5df69459a58d615576bf", "score": "0.5700719", "text": "function load(){\n\t\tsettings_link = addSettingsLink();\n\t\tcreateCheckboxes();\n\t\tloadSettings();\n\t}", "title": "" }, { "docid": "a3bcb7d9c71e49437bc1b0ff8f895037", "score": "0.5696288", "text": "function backBtnPressed() {\n handleSaveNoteClick(true); //saving the edited data\n return true; //prevents the original back action\n }", "title": "" }, { "docid": "0b8b7e8373f47cd3c6fc7abe4f3423b8", "score": "0.5694738", "text": "function enableRestoreButton()\r\n{\r\n if (ChkBoxSigText.state.checked)\r\n {\r\n\t\tButton.setState({disabled:false});\r\n }\r\n else\r\n {\r\n\t\tButton.setState({disabled:true});\r\n }\r\n}", "title": "" }, { "docid": "97b1cc903d8d323fb1cd784dbc7a0c33", "score": "0.5689", "text": "function checkTheBoxes() {\n if ((myStorage.getItem(\"checkedBoxes\") != null) || (JSON.parse(myStorage.getItem(\"checkedBoxes\")).length != 0)) {\n var allCheckboxes = document.querySelectorAll('input.filters');\n var previouslyCheckedBoxes = JSON.parse(myStorage.getItem(\"checkedBoxes\"));\n\n for (var i = 0; i < allCheckboxes.length; i++) {\n if (previouslyCheckedBoxes.indexOf(allCheckboxes[i].name) !== -1) { // if box was previously checked\n document.getElementsByName(allCheckboxes[i].name)[0].checked = true; // checks them\n }\n }\n }\n}", "title": "" }, { "docid": "9aeef30c7848dcda4b04a73f13e065d5", "score": "0.5683596", "text": "function savedMe() {//.............................................Runs code that any save input needs\n btnPressS = true;\n optionsAreDown();\n toggleVisibility();\n hyperacusis();\n}", "title": "" }, { "docid": "224c6dc4c3eba16d4d5e891344418f38", "score": "0.56773615", "text": "function backbutton() {\n\tbackstep(), $(\"#interviewBookingContainer\").load(\"interviewRole\")\n}", "title": "" }, { "docid": "2cfdb7424896db99a448236df5cadf24", "score": "0.56697106", "text": "function saveSettings() {\n localStorage.isClick = $(\"#click\").prop(\"checked\");\n localStorage.isPunch = $(\"#punch\").prop(\"checked\");\n localStorage.isHit = $(\"#hit\").prop(\"checked\");\n localStorage.isCash = $(\"#money\").prop(\"checked\");\n localStorage.isWin = $(\"#win\").prop(\"checked\");\n localStorage.isLose = $(\"#lose\").prop(\"checked\");\n readSettings();\n}", "title": "" }, { "docid": "e945236e7e7e4c2361b346e787274822", "score": "0.56672436", "text": "function checksavesend()\n{\n \n if (checkallfilled())\n {\n if (checkallvalid())\n {\n storedata();\n window.location.href='summary.html'\n }\n \n }\n}", "title": "" }, { "docid": "3855bcb0bc1b5bfd5b621f7409e4703c", "score": "0.5640925", "text": "function validatePage() {\n\t\tenableNextButton( false );\n\t\t$radios.each( function() {\n\t\t\tif ( this.checked ) {\n\t\t\t\tenableNextButton( true );\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} );\n\t}", "title": "" }, { "docid": "13061140943ac4353ec81f8abbfb55a4", "score": "0.56133795", "text": "function OnClickSaveCheckboxState(Sender) {\n var ini = new TIniFile(Script.Path + \"settings.ini\");\n ini.WriteBool(\"Settings\", \"checkbox\" + _t(Sender.Tag), Sender.Checked);\n delete ini;\n}", "title": "" }, { "docid": "1d7d1dc19e351906eb2df8043e754f99", "score": "0.5611625", "text": "function cargarFiltradoPrevio () {\n\n const filtrados = JSON.parse(localStorage.getItem('filtrados'));\n \n if ( filtrados != null && filtrados != '' && filtrados != [] ) {\n \n crearTablaDePropiedadesMascota(filtrados);\n settearCheckboxes( filtrados[0] );\n\n cargarMaximo();\n cargarMinimo();\n cargarPorc_Vac();\n cargarPromedio();\n\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "e454d6fd3a5871db268be9ee7a73dae0", "score": "0.55919695", "text": "function refreshCheckboxUI() {\n var all_checked = checkboxes.filter(':checked').length === checkboxes.length;\n var none_checked = checkboxes.filter(':checked').length === 0;\n\n $('button.psap-move-checked').prop('disabled', none_checked);\n if (all_checked) {\n $('.psap-check-all').prop('disabled', true);\n $('.psap-uncheck-all').prop('disabled', false);\n } else if (none_checked) {\n $('.psap-check-all').prop('disabled', false);\n $('.psap-uncheck-all').prop('disabled', true);\n } else {\n $('.psap-check-all').prop('disabled', false);\n $('.psap-uncheck-all').prop('disabled', false);\n }\n }", "title": "" }, { "docid": "876395cdbe90db0cc17c66f478d2ea3e", "score": "0.5579735", "text": "function checkboxClicked() {\n let targetId = $(this).attr(\"id\");\n if (localStorage.getItem(\"wordaySchedulerStorageObject\") === null) {\n wordaySchedulerStorageObject = {\n items: []\n };\n\n localStorage.setItem(\"wordaySchedulerStorageObject\", JSON.stringify(wordaySchedulerStorageObject));\n $(\"#\" + targetId).prop(\"checked\", false);\n return;\n }\n\n //Get and Parse object from LocalStorage\n wordaySchedulerStorageObject = JSON.parse(localStorage.getItem(\"wordaySchedulerStorageObject\"));\n let index = wordaySchedulerStorageObject.items.findIndex(e => e.id === targetId.replace(\"Check-\", \"\"));\n if (index !== -1) {\n wordaySchedulerStorageObject.items[index].isComplete=$(this).prop(\"checked\");\n }\n else {\n $(this).prop(\"checked\", false);\n }\n localStorage.setItem(\"wordaySchedulerStorageObject\", JSON.stringify(wordaySchedulerStorageObject));\n \n if ($(this).prop(\"checked\")) {\n $(\"#\" + targetId.replace(\"Check-\", \"Input-\")).css(\"text-decoration\", \"line-through\");\n }\n else {\n $(\"#\" + targetId.replace(\"Check-\", \"Input-\")).css(\"text-decoration\", \"none\");\n }\n}", "title": "" }, { "docid": "7c7b7d6a0e0a63f4c60c7417ea4420be", "score": "0.557288", "text": "function checkenable(){\r\n allclicked=true;\r\n $(\".not-clicked\").each(function(i, val){\r\n allclicked=false;\r\n });\r\n if(allclicked){\r\n $('#next').removeAttr('disabled');\r\n }\r\n }", "title": "" }, { "docid": "997105edbaae1251c797a6da31c8bed2", "score": "0.5566979", "text": "function restore_options() {\r\n // Default tab option is Adjacent (0, 1: end, 2: active)\r\n // Use default value true for all activate options.\r\n chrome.storage.local.get({\r\n tabOption: 0,\r\n activateButtonNew: true,\r\n activatePageNew: true,\r\n activateArchiveNew: true,\r\n activateSearchNew: true\r\n }, function(items) {\r\n switch (items.tabOption) {\r\n case 1:\r\n document.getElementById('tabEnd').checked = true;\r\n break;\r\n case 2:\r\n document.getElementById('tabAct').checked = true;\r\n break;\r\n default:\r\n document.getElementById('tabAdj').checked = true;\r\n }\r\n document.getElementById('cbButtonNew').checked = items.activateButtonNew;\r\n document.getElementById('cbPageNew').checked = items.activatePageNew;\r\n document.getElementById('cbArchiveNew').checked = items.activateArchiveNew;\r\n document.getElementById('cbSearchNew').checked = items.activateSearchNew;\r\n });\r\n}", "title": "" }, { "docid": "c751b7d81904376e912f97304a4ce121", "score": "0.5566168", "text": "markAndLoadFavoritesOnPageLoad() {\n setTimeout(() => {\n for (let story of this.favorites) {\n try {\n const associatedCheckbox = $(`#button${story.storyId}`).eq(0);\n associatedCheckbox[0].checked = true;\n } catch(err) {\n console.log(err);\n };\n };\n },100);\n }", "title": "" }, { "docid": "fa1faca1630469e04564fd1352c18c08", "score": "0.55601776", "text": "function logsArchiveCheckBoxClick(){\n\t\tif(readLogsArchiveCheckBox()){\n\t\t\tdocument.getElementById(\"refresh\").checked = false;\n\t\t\t//document.getElementById(\"refresh\").disabled = true;\n\t\t\tdocument.getElementById(\"datefield\").disabled = false;\n\t\t\tdocument.getElementById(\"submit\").disabled = false;\n\t\t}\n\t\telse if(!readLogsArchiveCheckBox()){\n\t\t\t//fetchLoglist(null);\n\t\t\tdocument.getElementById(\"refresh\").disabled = false;\n\t\t\tdocument.getElementById(\"refresh\").checked = true;\n\t\t\tdocument.getElementById(\"datefield\").value = \"\";\n\t\t\tdocument.getElementById(\"datefield\").disabled = true;\n\t\t\tdocument.getElementById(\"submit\").disabled = true;\n\t\t\tfetchLoglist(null);\n\t\t}\n\t}", "title": "" }, { "docid": "4e237bbb3c46a80d8f2ca7623f60d0f9", "score": "0.55597943", "text": "function first_load_setup() {\n $('show_tss_locus').checked = false;\n $('show_strand').checked = false;\n $('show_histone').checked = false;\n $('show_correlation').checked = false;\n $('show_re_score').checked = false;\n $('show_best_re').checked = false;\n $('show_tss_score').checked = false;\n $('show_best_tss').checked = false;\n $('show_loci_per_tss').checked = false;\n //$('show_num_tsses').checked = false;\n $('show_tsses_per_gene').checked = false;\n //$('show_num_genes').checked = false;\n}", "title": "" }, { "docid": "6433baffa6e71ddf60345bdfe97b4356", "score": "0.5556128", "text": "function setSavedView(myBool){\n if(myBool){\n clearSearch();\n }\n savedViewBool = myBool;\n showAllRadio.checked = !myBool;\n savedOnlyRadio.checked = myBool;\n if(!searchViewBool){\n checkForSaved();\n }\n $('.navbar-collapse').collapse('hide');\n $(\"#searchText\").blur();\n setTimeout(()=>{showAllRadio.checked = !myBool;savedOnlyRadio.checked = myBool;},50);\n}", "title": "" }, { "docid": "f908ceb108373831c571f39c61bf242a", "score": "0.55502176", "text": "function goBack() {\n\t\t\tvar $spliceEnd = _userChoices.length-1;\n\n\t\t\tif($spliceEnd > 0) {\n\t\t\t\ttoggleButtons(true);\n\n\t\t\t\t$deletedSelection = $('#' + _userChoices[_userChoices.length-1]);\n\t\t\t\ttoggleNodeOpacity($deletedSelection, false);\n\n\t\t\t\t_userChoices = _userChoices.slice(0,$spliceEnd);\t\t\t\t\n\t\t\t\tnextSection();\n\n\t\t\t\t//if(CONSOLE_ACTIVE==true)console.log($spliceEnd+' stored choices remain for deletion')\n\t\t\t\t//if(CONSOLE_ACTIVE==true)console.log('Stored data remaining: '+_userChoices.length)\n\t\t\t\t//if(CONSOLE_ACTIVE==true)console.log('Removed end index from user choices array')\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "318af45cf775bb6fb65df0ee14a06580", "score": "0.5541759", "text": "function loadSavedFalcon() {\n\tcopyContenidoIntegradoSaved();\n\t\n\tinitSavedFalcon();\n\t\n\tintegratedPaymentValidation = validateSavedPaymentFalconDesktop;\n\tintegratedPostValidationAction = submitEncryptedFormDesktop;\n}", "title": "" }, { "docid": "d6d978c30f8d463643861a6dd18f0d78", "score": "0.5535467", "text": "function checkButtons() {\n //Whenever button pressed check which radio button is pressed,\n //store it, then set all the buttons to which one is checked for\n //the next / prev question\n for (i = 0; i < obj.questions[qcount - 1].c.length; i++) {\n if ($('#c' + (i + 1)).prop('checked')) {\n checkeds[qcount - 1] = (i + 1);\n return true\n }\n }\n return false;\n }", "title": "" }, { "docid": "9d7643089a79f783bf18c9aef93c8e16", "score": "0.5532818", "text": "function saveOptions(e) {\n var input = this.querySelector('input'), config;\n config = JSON.parse(localStorage.config);\n config[input.name] = input.checked;\n localStorage.config = JSON.stringify(config);\n }", "title": "" }, { "docid": "20e5fd5a66a53a95eabee268d4d812d7", "score": "0.5502642", "text": "function updateStoreAvailabilityButtons() {\n logger.info('updateStoreAvailabilityButtons called');\n var maxPageNum = Math.floor(Alloy.Collections.allStores.length / 5);\n if (Alloy.Collections.allStores.length % 5 == 0) {\n maxPageNum--;\n }\n $.next_btn.setEnabled(storeInventoryCurrentPage < maxPageNum);\n $.last_btn.setEnabled(storeInventoryCurrentPage > 0);\n}", "title": "" }, { "docid": "a2a6c147d776c1c8a28e5e37d995b840", "score": "0.5500599", "text": "function isProcess(isChecked){\r\n\r\n\t//local Variables\r\n\tvar theObject = getElement(isChecked);\r\n\r\n\tif(theObject.checked)\r\n\t\tparent.location.href = nextPage(isChecked, theObject.checked);\r\n\telse\r\n\t\tparent.location.href = nextPage(isChecked, theObject.checked);\r\n\r\n}//end isProcessFucntion", "title": "" }, { "docid": "f1eaebb783a774a472009bbfe2af8ab9", "score": "0.5492201", "text": "function checkClick() {\n if (disableNextLink === true) {\n return false;\n }\n disableNextLink = false;\n}", "title": "" }, { "docid": "626b74baf2aceccb4522046a89d94ab1", "score": "0.54902256", "text": "function saveSettings(){\n\t\tvar checkboxes = document.querySelectorAll('.accordion-header input[type=\"checkbox\"]');\n\t\tvar toSave = {};\n\t\t[].forEach.call(checkboxes,\tfunction (el) {\n\t\t\tvar id = el.parentNode.id;\n\t\t\tvar checked = el.checked;\n\t\t\ttoSave[id] = checked;\n\t\t});\n\t\t// console.log(\"Saving block preferences\", toSave);\n\t\tlocalStorage['__' + language + '_hidden_blocks'] = JSON.stringify(toSave);\n\t}", "title": "" }, { "docid": "c9b89f5a567453c602bc0965756487a2", "score": "0.54863244", "text": "function NewLoad(type) {\n var temp = document.getElementById(\"Slot\").value;\n if (!temp) {\n messageMe('No Save On This Slot\\nPlease Choose Another One!!!');\n return;\n } else {\n var obj = JSON.parse(localStorage.getItem(temp));\n }\n if (type === \"Auto\") {\n document.getElementById(\"SlotName\").value = obj.Name;\n document.getElementById('ABBetSize').value = obj.BS;\n document.getElementById('ABBetFormat').value = obj.BF;\n document.getElementById('ABFinalBetStop').checked = obj.LBS;\n document.getElementById('ABOdd').value = obj.Odd;\n temp = document.getElementById('R2bbCheckWin');\n if (!obj.R2bbCheckW) { // FIXME: Fix It Fast\n temp.checked = false;\n showHide(temp, 'R2bbWin', 'TextOnWin');\n document.getElementById('R2bbWin').value = obj.R2bbW;\n }\n temp = document.getElementById('R2bbCheckLosse');\n if (!obj.R2bbCheckL) { // FIXME: Fix It Fast\n temp.checked = false;\n showHide(temp, 'R2bbLoss', 'TextOnLosse');\n document.getElementById('R2bbLoss').value = obj.R2bbL;\n }\n document.getElementById('ABHighLow').value = ABHL[obj.FB];\n document.getElementById('ABChange').value = obj.Swap;\n temp = document.getElementById('ABChange').value;\n if (temp === \"Repeat\") {\n showSwapO(document.getElementById('ABChange').value);\n document.getElementById('SwapRepeatW').value = obj.SwapW;\n document.getElementById('SwapRepeatL').value = obj.SwapL;\n }\n if (temp === \"Patern\") {\n showSwapO(temp);\n document.getElementById('SwapPatern').value = obj.Patern;\n }\n document.getElementById('MaxPayIn').value = obj.MaxB;\n document.getElementById('StopAfter').checked = obj.MaxBS;\n document.getElementById('Reset2BB').checked = obj.MaxBR;\n document.getElementById('MultiMax').checked = obj.MaxM;\n document.getElementById('StopMaxBalance').value = obj.MaxBalS;\n document.getElementById('StopMinBalance').value = obj.MinBalS;\n document.getElementById('MultiStop').checked = obj.MultiS;\n document.getElementById('ABBetX').value = obj.X + '|' + obj.Multi;\n document.getElementById('ABMultiSwitch').checked = obj.MultiSW;\n document.getElementById('ABL2C').value = obj.L2C;\n document.getElementById('ReplayProfit').checked = obj.ReplayP;\n document.getElementById('ABRoundVar').value = obj.NBets;\n document.getElementById('ABCrypto').value = obj.Crypto;\n document.getElementById('ABAutoWithdrawVar').value = obj.AW;\n document.getElementById('ABAW100').value = obj.AW100;\n UpdateAddy(obj.Crypto, 'ABAutoWithdrawVar');\n }\n if (type === 'Single') {\n document.getElementById(\"SlotName\").value = obj.Name;\n document.getElementById('BetSizeVar').value = obj.BS;\n document.getElementById('BetFormat').value = obj.BF;\n document.getElementById('FinalBetStopVar').checked = obj.LBS;\n document.getElementById('OddVar').value = obj.Odd;\n document.getElementById('HighLowVar').value = ABHL[obj.FB];\n document.getElementById('ChangeVar').value = obj.Swap;\n document.getElementById('RepeatLosseVar').value = obj.RepL;\n document.getElementById('RepeatWinVar').value = obj.RepW;\n document.getElementById('BetXVar').value = obj.X + '|' + obj.Multi;\n document.getElementById('MultiSwitchVar').checked = obj.MultiSW;\n document.getElementById('T2CVar').value = obj.L2C;\n document.getElementById('BetPatVar').value = obj.HLPat;\n document.getElementById('BetWinVar').value = obj.WinPat;\n document.getElementById('CryptoVar').value = obj.Crypto;\n document.getElementById('AutoWithdrawVar').value = obj.AW;\n document.getElementById('AW100').value = obj.AW100;\n UpdateAddy(obj.Crypto, 'AutoWithdrawVar');\n }\n if (type === 'System') {\n\n }\n}", "title": "" }, { "docid": "b370434cde5f5f0e28f1f7b358e386d6", "score": "0.5483329", "text": "function loadPage(){\nisPersistent= (document.all.item(\"checklist\")!=null) && (isIE5);\n\n setPreviousNext();\n resizeDiv();\n if (isPersistent) getChecklistState();\n addReusableText();\n insertImages();\n}", "title": "" }, { "docid": "6ba8de3b53f26ab97417ea107bbb0ad8", "score": "0.54821265", "text": "function checkstyle() {\r\n if (this.checked === true) {\r\n this.parentNode.className = 'rewardoff';\r\n window.localStorage.setItem(this.id, 'off');\r\n } else {\r\n this.parentNode.className = 'rewardon';\r\n window.localStorage.setItem(this.id, 'on');\r\n }\r\n}", "title": "" }, { "docid": "d989fba5653ac4a2613978c8cbd681d0", "score": "0.5478251", "text": "function loadPreHardResetSave(){\r\n load(localStorage.allTheLevelsSaveBeforeLastHardReset);\r\n}", "title": "" }, { "docid": "4bb96efbe222db63cc375840786ae22e", "score": "0.54749924", "text": "function resumeFunction(buttonList) {\n\tif (!saveOn) {\n\t\tenableButtons(buttonList);\n\t\tresumeRestore();\n\t}\n}", "title": "" }, { "docid": "8cf187e93c60b70bcd2580b8bed29550", "score": "0.5472286", "text": "function restore_options() {\n\tconsole.log(\"restoring...\");\n\tvar y=0\n\ttry {\n\t\twhile((typeof(JSON.parse(localStorage[\"xbmc_ip\"])[y]) == 'object') && (JSON.parse(localStorage[\"xbmc_ip\"])[y].value)){\n\t\t\tif (y>0) {\n\t\t\t\taddElement();\n\t\t\t}\n\n\t\t\tif (localStorage[\"xbmc_name\"]) {\n\t\t\t\t$(\"input#name\" + (y+1)).val(JSON.parse(localStorage[\"xbmc_name\"])[y].value);\n\t\t\t}\n\t\t\tif (localStorage[\"xbmc_ip\"]) {\n\t\t\t\t$(\"input#ip\" + (y+1)).val(JSON.parse(localStorage[\"xbmc_ip\"])[y].value);\n\t\t\t}\n\t\t\tif (localStorage[\"xbmc_user\"]) {\n\t\t\t\t$(\"input#user\" + (y+1)).val(JSON.parse(localStorage[\"xbmc_user\"])[y].value);\n\t\t\t}\n\t\t\tif (localStorage[\"xbmc_pw\"]) {\n\t\t\t\t$(\"input#pw\" + (y+1)).val(JSON.parse(localStorage[\"xbmc_pw\"])[y].value);\n\t\t\t}\n\t\t\ty++;\n\t\t\tlocalStorage[\"xbmc_count\"]=y;\n\t\t}\n\n\t\t//$('input[value=' + localStorage[\"imageNo\"] + ']').prop('checked', true);\n\t\tconsole.log(\"Done!\");\n\t}\n\tcatch(err) {\n\t\tconsole.log(\"No worries, all good!\");\n\t}\n}", "title": "" }, { "docid": "07de83735b25a6af61facb7c7a2c0061", "score": "0.5471222", "text": "function restoreOptions() {\r\n chrome.storage.sync.get(null, function(stored_options) {\r\n for (let checkbox of getAllCheckboxes())\r\n checkbox.checked = !stored_options[\"disable_\" + checkbox.id];\r\n\r\n document.getElementById(\"loading\").style.display = \"none\";\r\n document.getElementById(\"options\").style.display = \"block\";\r\n });\r\n}", "title": "" }, { "docid": "c3846442f989a8ea8cdaef5c1f2e993f", "score": "0.5470113", "text": "function restore_options() {\n var favorite = localStorage[\"favorite_beauty\"];\n if (!favorite) {\n return;\n }\n var select = document.getElementsByName(\"beauty\");\n for (var i = 0; i < select.length; i++) {\n var child = select[i];\n if (child.value == favorite) {\n child.checked = true;\n break;\n }\n }\n}", "title": "" }, { "docid": "85d3ae2e39dab93d372a62a3c3bfb323", "score": "0.5456115", "text": "function addCurrentEventListener() {\n\t// $('#checkAll').click(checkAll);\n\t$('#savePageBtn').click(savePage);\n\t$(\"#deletePageBtn\").click(deletePageBtnClicked);\n\t$(\"#chkAll\").click(chkAllClicked);\n\tinitUpdatePageBtnListener();\n\tinitDeleteSingleBtnListener();\n}", "title": "" }, { "docid": "2340d7422f6f216cb95dfb25c2ecc1cd", "score": "0.5448466", "text": "function unsaveAll(e){\r\n if(currentState == 1) { //Canceling process\r\n showSuccess();\r\n return;\r\n }else if(currentState == 2){ //Finishing up\r\n location.reload();\r\n return;\r\n }\r\n\r\n setUpVisualization(e, null);\r\n}", "title": "" }, { "docid": "70b42d7414abe748112a910d72a8efcd", "score": "0.5445454", "text": "function saveOptions () {\n chrome.storage.local.set({\n showforall: document.getElementById('showforall').checked,\n showontwitter: document.getElementById('showontwitter').checked,\n defaulttwittooltip: document.getElementById('defaulttwittooltip').checked,\n dontdisplay: document.getElementById('dontdisplay').checked,\n autorun: document.getElementById('autorun').checked,\n official: document.getElementById('official').checked,\n fullmode: document.getElementById('fullmode').checked,\n })\n}", "title": "" }, { "docid": "02369f795541c7264d3c7e4929139246", "score": "0.54429495", "text": "function restore_options() {\n\n var tabslimit = localStorage[\"tabslimit\"]; \n\n var checkbox_openvisitedlinks = document.getElementById(\"openvisitedlinks\");\n var input_tabslimit = document.getElementById(\"tabslimit\");\n\n\n\n checkbox_openvisitedlinks.checked = (openvisitedlinks == \"true\");\n\n input_tabslimit.value = tabslimit;\n\n }", "title": "" }, { "docid": "7026b178d116f44bd57994ad1b65648b", "score": "0.54423916", "text": "function save_data() {\n\t\t\t\tvar form = popup.$().find( 'form' );\n\t\t\t\tif ( 0 < popup.$('#csb-more:checked').length ) {\n\t\t\t\t\tjQuery('<input>').attr({\n\t\t\t\t\t\ttype: 'hidden',\n\t\t\t\t\t\tvalue: 'show',\n\t\t\t\t\t\tname: 'advance'\n\t\t\t\t\t}).appendTo(form);\n\t\t\t\t}\n\t\t\t\t// Start loading-animation.\n\t\t\t\tpopup.loading( true );\n\t\t\t\tajax.reset()\n\t\t\t\t\t.data( form )\n\t\t\t\t\t.ondone( handle_done_save )\n\t\t\t\t\t.load_json();\n\t\t\t\treturn false;\n\t\t\t}", "title": "" }, { "docid": "7c32f598e40dea467b71f3b64bef81c5", "score": "0.54340607", "text": "function setupLocalStorage() {\n $('#research_save').on('click', function(event) {\n event.preventDefault();\n saveResearchToLocalStorage();\n }).parent().removeClass('hide');\n $('#research_load').on('click', function(event) {\n event.preventDefault();\n loadResearchFromLocalStorage();\n }).parent().removeClass('hide');\n}", "title": "" }, { "docid": "42cd46cad43608e2fc705222dd0914db", "score": "0.543144", "text": "function load() {\r\n const public = JSON.parse(localStorage.getItem('public'));\r\n const emailNoti = JSON.parse(localStorage.getItem('emailNoti'));\r\n const timezone = localStorage.getItem('timezone');\r\n document.querySelector(\"#public\").checked = public;\r\n document.querySelector(\"#emailNoti\").checked = emailNoti;\r\n document.querySelector(\".timezone\").selectedIndex = timezone;\r\n}", "title": "" }, { "docid": "cffbb8a458c82ded092013b396656ec7", "score": "0.54220957", "text": "function PublicationCurrentAY(){\n\n\t$(\"#publicationAlertDiv\").hide();\n\t\n\tif ($(\"#pub_yes\").is(':checked')) {\n\t\t$(\"#add_publication_div\").show();\n\t}\n\telse if ($(\"#pub_no\").is(':checked')){\n\t\t$('#add_publication_div').hide();\n\t\t$(\"#publicationsTableAlertDiv\").hide();\n\t}\n\tsetPublicationsTableTemplate();\n}", "title": "" }, { "docid": "3b82c0ccc4244be4fcb813c9a9aa6ceb", "score": "0.5420302", "text": "function saveState()\n{\n\treturn;\n}", "title": "" }, { "docid": "3b82c0ccc4244be4fcb813c9a9aa6ceb", "score": "0.5420302", "text": "function saveState()\n{\n\treturn;\n}", "title": "" }, { "docid": "1c683442fed343831a9c4bdd945d60bb", "score": "0.54193044", "text": "function appResume() {\n if (localStorage.getItem('currentPage') === localStorage.getItem('toacliked')) {\n showModal();\n } else {\n $rootScope.AILoading = false;\n $scope.dialogmsg = '';\n $scope.dialogimg = \"\";\n $scope.footerbtn = false;\n $scope.nextPageUrl = '';\n $scope.modalin = false;\n }\n }", "title": "" }, { "docid": "b131116335a7b7eea4c723bbc8ad07c8", "score": "0.5415931", "text": "function detectBackLock() {\n // If first part of the lesson, lock back. Else, unlock it\n if(lessonPart[currentLesson] == 0)\n lockBtn(\"back\");\n else\n unlockBtn(\"back\");\n}", "title": "" }, { "docid": "64bdbf547a6907356dadae38d0ed117a", "score": "0.54142666", "text": "function checkedInterest() {\n var checkedInterest = $('.interest-item').hasClass('interest-active');\n\n if(checkedInterest) {\n $('.btn-step-next').removeClass('btn-step-next-step').removeAttr('disabled');\n } else {\n $('.btn-step-next').addClass('btn-step-next-step').attr(\"disabled\",\"disabled\");\n }\n }", "title": "" }, { "docid": "13d61ec3f07766b99fb04e1287ce5b21", "score": "0.5412553", "text": "function goBack() {\n hideElement(divDonePage);\n showElement(divConfigPage);\n}", "title": "" }, { "docid": "b622f34201db60dc279a6c0e27e450db", "score": "0.5411631", "text": "function refreshSectionCheckmarks(){\n $(\".multidownload_chapter\").each(function(){\n var chapterCheckbox = $(this);\n chapterCheckbox.prop(\"checked\", true);\n\n $(this).parents(\".course-item-list-header\").next(\".course-item-list-section-list\").find(\".multidownload\").each(function(){\n if(!$(this).attr(\"checked\")){\n chapterCheckbox.prop(\"checked\", false);\n return;\n }\n });\n });\n}", "title": "" }, { "docid": "5d5e1671fc67837c052d740fb82a237a", "score": "0.5407404", "text": "function WFS_RestoreAllWorkflows() {\r\n \r\n //Recovering the wfs's IDs from the active Workflow List\r\n var activeWorkflowList = $.cookie(\"WFE_ActiveWorkflowList\");\r\n\r\n if (activeWorkflowList == null) { return; } //No one wf exists\r\n\r\n var ids = activeWorkflowList.split('|');\r\n\r\n spinnerStart(document.getElementById(\"tabs\"));\r\n\r\n for (var i = 0; i < ids.length; i++) {\r\n WFC_LoadXmlDocFromSession(ids[i]); \r\n WFS_RestoreWorkflowEditorButtons(ids[i]);\r\n }\r\n}", "title": "" }, { "docid": "533247e09d53b194a46ecb2d20a756e4", "score": "0.54045784", "text": "function listenCheck () {\n $(\"input[type='checkbox']\").each(function (){\n $(\"#\" + this.id).on(\"change\", function () {\n if ($(\"#\"+this.id).is(\":checked\") ) {\n // add link if checked\n if (downloadLinks.indexOf(this.parentNode.getAttribute('href', 2)) === -1) {\n downloadLinks.push(this.parentNode.getAttribute('href', 2));\n }\n } else {\n // remove link if unchecked\n var remove = downloadLinks.indexOf(this.parentNode.getAttribute('href', 2));\n if (remove > -1) {\n downloadLinks.splice(remove, 1);\n }\n }\n });\n });\n}", "title": "" }, { "docid": "9781a1a6230fb8d5f5891a263851c890", "score": "0.5398387", "text": "function save() {\n window.localStorage.clear()\n if(emailCheck.checked === true && profileCheck.checked === true) {\n localStorage.setItem('emailCheck', emailCheck.checked);\n localStorage.setItem('profileCheck', profileCheck.checked);\n } else if(emailCheck.checked === true) {\n localStorage.setItem('emailCheck', emailCheck.checked);\n } else if(profileCheck.checked === true) {\n localStorage.setItem('profileCheck', profileCheck.checked);\n } else {\n window.localStorage.clear()\n emailCheck.checked = false;\n profileCheck.checked = false;\n }\n timezoneSelect()\n console.log(localStorage);\n}", "title": "" }, { "docid": "1a258db488a659f59f11cbad8df4d711", "score": "0.53967434", "text": "function toggleSaved(){\n if ($active_clause.hasClass('clause-saved') && $active_clause.hasClass('clause-draft')){\n $('.save-clause-draft').closest('li').addClass('disabled');\n $('.save-clause-publish').closest('li').removeClass('disabled');\n } else if ($active_clause.hasClass('clause-saved')){\n $('.save-clause-draft, .save-clause-publish').closest('li').addClass('disabled');\n } else {\n $('.save-clause-draft, .save-clause-publish').closest('li').removeClass('disabled');\n }\n}", "title": "" }, { "docid": "6b2a1cd916d9dda20a0c444d2c9b7b57", "score": "0.53947634", "text": "function nextPageForLabOrders(){\n var odersButton = document.getElementById('orderButton');\n //var selected = odersButton.getAttribute('selected');\n\n if(sessionStorage.getItem('radiology_status') == 'true') {\n ordersPopupModal();\n odersButton.setAttribute('selected','false');\n return;\n } else {\n odersButton.setAttribute('selected','false');\n sessionStorage.setItem('lab_is_set', 'true');\n sessionStorage.orderFlowStatus = true;\n labOrdersContainer('false','true');\n //redirectToLabOrders();\n return;\n }\n \n}", "title": "" }, { "docid": "affdd011b57963bebbb470916a4d44b6", "score": "0.5388783", "text": "function verificarSeleccionChecks(){\n var v_chk_noseleccionados = 0;\n /* ITEMS FOSO */\n var cantidadItemsTAIF = window.sessionStorage.getItem(\"cantidadItemsTablaAIF\");\n var numero_final_item = 148 + parseInt(cantidadItemsTAIF);\n for (var i = 148; i < numero_final_item; i++) {\n if( $('input:radio[name=sele_foso'+i+']:checked').val() == undefined ) {\n v_chk_noseleccionados += 1;\n alert(\"Advertencia:\\n\\nDebe completar todos los campos de la lista Revisión de foso.\");\n mostrarDivFoso();\n $('input:radio[name=sele_foso'+i+']').focus();\n break;\n }\n }\n /* ITEMS POZO */\n var cantidadItemsTAIP = window.sessionStorage.getItem(\"cantidadItemsTablaAIP\");\n var numero_final_item = 83 + parseInt(cantidadItemsTAIP);\n for (var i = 83; i < numero_final_item; i++) {\n if( $('input:radio[name=sele_pozo'+i+']:checked').val() == undefined ) {\n v_chk_noseleccionados += 1;\n alert(\"Advertencia:\\n\\nDebe completar todos los campos de la lista Revisión de Pozo.\");\n mostrarDivPozo();\n $('input:radio[name=sele_pozo'+i+']').focus();\n break;\n }\n }\n /* ITEMS MAQUINAS */\n var cantidadItemsTAIM = window.sessionStorage.getItem(\"cantidadItemsTablaAIM\");\n var numero_final_item = 36 + parseInt(cantidadItemsTAIM);\n for (var i = 36; i < numero_final_item; i++) {\n if( $('input:radio[name=sele_maquinas'+i+']:checked').val() == undefined ) {\n v_chk_noseleccionados += 1;\n alert(\"Advertencia:\\n\\nDebe completar todos los campos de la lista de Cuarto de maquinas y poleas.\");\n mostrarDivMaquinas();\n $('input:radio[name=sele_maquinas'+i+']').focus();\n break;\n }\n }\n /* ITEMS CABINA */\n var cantidadItemsTAIC = window.sessionStorage.getItem(\"cantidadItemsTablaAIC\");\n for (var i = 1; i <= cantidadItemsTAIC; i++) {\n if( $('input:radio[name=sele_cabina'+i+']:checked').val() == undefined ) {\n v_chk_noseleccionados += 1;\n alert(\"Advertencia:\\n\\nDebe completar todos los campos de la lista Cabina.\");\n mostrarDivCabina();\n $('input:radio[name=sele_cabina'+i+']').focus();\n break;\n }\n }\n /* ITEMS ELEMENTOS */\n var cantidadItemsTAIE = window.sessionStorage.getItem(\"cantidadItemsTablaAIE\");\n for (var i = 1; i <= cantidadItemsTAIE; i++) {\n if( $('input:radio[name=sele_element_inspec'+i+']:checked').val() == undefined ) {\n v_chk_noseleccionados += 1;\n alert(\"Advertencia:\\n\\nDebe completar todos los campos de Elementos del inspector.\");\n mostrarDivElementos();\n $('input:radio[name=sele_element_inspec'+i+']').focus();\n break;\n }\n }\n /* ITEMS PROTECCION PERSONAL EMPRESA */\n var cantidadItemsTAIPP = window.sessionStorage.getItem(\"cantidadItemsTablaAIPP\");\n for (var i = 1; i <= cantidadItemsTAIPP; i++) {\n if( $('input:radio[name=sele_protec_person'+i+'_'+i+']:checked').val() == undefined ) {\n v_chk_noseleccionados += 1;\n alert(\"Advertencia:\\n\\nDebe completar todos los campos de Elementos de protección Personal.\");\n mostrarDivProteccion();\n $('input:radio[name=sele_protec_person'+i+'_'+i+']').focus();\n break;\n }\n }\n /* ITEMS PROTECCION PERSONAL INSPECTOR */\n var cantidadItemsTAIPP = window.sessionStorage.getItem(\"cantidadItemsTablaAIPP\");\n for (var i = 1; i <= cantidadItemsTAIPP; i++) {\n if( $('input:radio[name=sele_protec_person'+i+']:checked').val() == undefined ) {\n v_chk_noseleccionados += 1;\n alert(\"Advertencia:\\n\\nDebe completar todos los campos de Elementos de protección Personal.\");\n mostrarDivProteccion();\n $('input:radio[name=sele_protec_person'+i+']').focus();\n break;\n }\n }\n /* ITEMS PRELIMINAR */\n var cantidadItemsTAIPRE = window.sessionStorage.getItem(\"cantidadItemsTablaAIPRE\");\n for (var i = 1; i <= cantidadItemsTAIPRE; i++) {\n if( $('input:radio[name=seleval'+i+']:checked').val() == undefined ) {\n v_chk_noseleccionados += 1;\n alert(\"Advertencia:\\n\\nDebe completar todos los campos de la Evaluación preliminar.\");\n mostrarDivPreliminar();\n $('input:radio[name=seleval'+i+']').focus();\n break;\n }else{\n //alert($('input:radio[name=seleval'+i+']:checked').val());\n }\n }\n if ($('#text_consecutivo').val() == \"\") {\n swal({\n title: 'Oops...',\n type: 'error',\n html: 'No se cargo el consecutivo!',\n showCloseButton: false,\n showCancelButton: false,\n confirmButtonText: '<i class=\"fa fa-thumbs-up\"></i> Recargar',\n allowOutsideClick: false\n }).then(function () {\n window.location.reload();\n })\n }\n //alert(v_chk_noseleccionados);\n return v_chk_noseleccionados;\n}", "title": "" }, { "docid": "585fa4dd35a26365132045a94af90b7b", "score": "0.5387972", "text": "function thisOne(){\n\n\t\t\t// get all the inputs on the page and assign to an array, \"inputs\"\n\t\t\tvar inputs = document.getElementsByTagName('input');\n\t\t\tconsole.log(inputs);\n\n\t\t\t// declare an array, buttons to store all inputs of the 'button' type\n\t\t\tvar buttons = [];\n\n\t\t\t// push all inputs of type 'button' into the button array\n\t\t\tfor(var i=0; i<inputs.length; i++){\n\t\t\t\tif(inputs[i].type == 'button'){\n\t\t\t\t\tconsole.log(inputs[i]);\n\t\t\t\t\tbuttons.push(inputs[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconsole.log(buttons);\n\n\t\t\t// declare an array to collect all those buttons that have not been selected\n\t\t\t// one way or the other. \n\t\t\tvar notSelected = [];\n\n\t\t\tfor(var i=0; i < buttons.length; i++){\n\t\t\t\tvar req = buttons[i].getAttribute('required'); \n\t\t\t\tif(buttons[i].className.indexOf('activate') === -1 && req === ''){\n\t\t\t\t\tconsole.log(buttons[i]);\n\t\t\t\t\tnotSelected.push(buttons[i]);\n\t\t\t\t\tconsole.log(notSelected);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconsole.log(notSelected);\n\n\t\t\t// adds the status of \"check\" to the parentNode which is, in this case, \n\t\t\t// the labels. So the labels will be highlighted in red\n\t\t\tfor(var i=0; i < notSelected.length; i++){\n\t\t\t\tnotSelected[i].parentNode.className += \" check\";\n\t\t\t\tconsole.log(notSelected[i]);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "4f360d92e2eea8cc3b2929177c148cd1", "score": "0.5383831", "text": "function onClickCheckbox() {\n setupButtons();\n}", "title": "" }, { "docid": "6054504255bbeaec6fe8ba704e5de753", "score": "0.5382897", "text": "function changeStoreDetails() {\n var ststore_mainMenu = document.getElementById(\"ststore_mainMenu\");\n var ststore_breadcrumb = document.getElementById(\"ststore_breadcrumb\");\n var ststore_addStore = document.getElementById(\"ststore_addStore\");\n var ststore_addUser = document.getElementById(\"ststore_addUser\");\n var ststore_slideShow = document.getElementById(\"ststore_slideShow\");\n var ststore_instaPhoto = document.getElementById(\"ststore_instaPhoto\");\n var ststore_footer = document.getElementById(\"ststore_footer\");\n\n if (ststore_mainMenu.checked == true && ststore_breadcrumb.checked == true && ststore_addStore.checked == true && ststore_addUser.checked == true && ststore_slideShow.checked == true && ststore_instaPhoto.checked == true && ststore_footer.checked == true) {\n alert(\"Successfully, all checkboxes are checked.\");\n return true;\n } else if (ststore_mainMenu.checked == false && ststore_breadcrumb.checked == false && ststore_addStore.checked == false && ststore_addUser.checked == false && ststore_slideShow.checked == false && ststore_instaPhoto.checked == false && ststore_footer.checked == false) {\n alert(\"You should check at least one of them, it's necessary.\");\n return false;\n } else {\n alert(\"Some checkboxes are not checked, but it's OK.\");\n return true;\n }\n}", "title": "" }, { "docid": "f70dd190b40d82f7a813d4afe37e1791", "score": "0.5378141", "text": "function unsaveSelected(e){\r\n if(currentState == 1) { //Canceling process\r\n showSuccess();\r\n return;\r\n }else if(currentState == 2){ //Finishing up\r\n location.reload();\r\n return;\r\n }\r\n\r\n //Get all selected images\r\n var selected = document.getElementsByClassName(\"selection\");\r\n\r\n //Catch error\r\n if(selected.length == 0){\r\n alert(\"Please make a selection first\");\r\n return;\r\n }\r\n\r\n //Gather every selected item in array\r\n var selection = [];\r\n for(var i = 0; i < selected.length; i++){\r\n selection.push(selected[i].parentNode.parentNode.href);\r\n }\r\n setUpVisualization(e, selection);\r\n}", "title": "" }, { "docid": "0bc399879a8bbcf5692847e394455e43", "score": "0.53670806", "text": "function PresentationCurrentAY(){\n\n\t$(\"#presentationAlertDiv\").hide();\n\t\n\tif ($(\"#pres_yes\").is(':checked')) {\n\t\t$(\"#add_presentation_div\").show();\n\t}\n\telse if ($(\"#pres_no\").is(':checked')){\n\t\t$('#add_presentation_div').hide();\n\t\t$(\"#presentationsTableAlertDiv\").hide();\n\t}\n\tsetPresentationsTableTemplate();\n}", "title": "" }, { "docid": "aa854c52f74e3e60f632d91dc7ff9d31", "score": "0.5365436", "text": "function activate() {\n getChecklist();\n }", "title": "" }, { "docid": "565c7eefd22c5ecebfda318803e612ce", "score": "0.5364438", "text": "function readLogsArchiveCheckBox() {\n\t\tvar check = document.getElementById(\"prevlog\");\n\t\tif (check.checked == true)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "title": "" }, { "docid": "d6825f2a8ee9becb7d319b810ef46d79", "score": "0.53604347", "text": "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\n\t\t\t\tif($(this).hasClass(\"stab\")){\n\t\t\t\t\tself.generateExploreResults(false);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "b428d365f452b8136b23791e99b8cf50", "score": "0.53563637", "text": "function checkedEducation() {\n var checkedEducation = $('.education-item').hasClass('education-active');\n\n if(checkedEducation) {\n $('.btn-step-next').removeClass('btn-step-next-step').removeAttr('disabled');\n } else {\n $('.btn-step-next').addClass('btn-step-next-step').attr(\"disabled\",\"disabled\");\n }\n }", "title": "" }, { "docid": "e8d9896ccfd4384a0f5ea81c5f760366", "score": "0.5356241", "text": "function load(){\n var elements = document.querySelectorAll('[name=' + formName + '] [name]');\n var data = getSavedData();\n\n if(data){\n for(var i in elements){\n var el = elements[i];\n var name = el.name;\n if(data.hasOwnProperty(name)){\n if(el.type === 'checkbox'){\n el.checked = data[name];\n } else if(el.type === 'radio'){\n if(el.value === data[name]){\n el.checked = true;\n }\n } else{\n el.value = data[name];\n }\n }\n }\n }\n }", "title": "" }, { "docid": "5d2a45467fb1170e927e1086dbd689e5", "score": "0.5353809", "text": "function checkBoxes(elem) {\n tempScrollTop = $(window).scrollTop();\n var url = \"http://www.espn.com/espn/rss/\" + elem.id + \"/news\";\n if(elem.checked) {\n urls.push(url);\n }\n else {\n var index = urls.indexOf(url);\n if(index > -1) {\n urls.splice(index, 1);\n }\n }\n init(urls);\n}", "title": "" }, { "docid": "daa6112313bc92cecd9714f7a9fee137", "score": "0.53527796", "text": "setupToggles_() {\n browserProxy.localStorageGet({expert: false})\n .then(({expert}) => state.set(state.State.EXPERT, expert));\n document.querySelectorAll('input').forEach((element) => {\n element.addEventListener(\n 'keypress',\n (event) =>\n util.getShortcutIdentifier(event) === 'Enter' && element.click());\n\n const payload = (element) => ({[element.dataset.key]: element.checked});\n const save = (element) => {\n if (element.dataset.key !== undefined) {\n browserProxy.localStorageSet(payload(element));\n }\n };\n element.addEventListener('change', (event) => {\n if (element.dataset.state !== undefined) {\n state.set(state.assertState(element.dataset.state), element.checked);\n }\n if (event.isTrusted) {\n save(element);\n if (element.type === 'radio' && element.checked) {\n // Handle unchecked grouped sibling radios.\n const grouped =\n `input[type=radio][name=${element.name}]:not(:checked)`;\n document.querySelectorAll(grouped).forEach(\n (radio) =>\n radio.dispatchEvent(new Event('change')) && save(radio));\n }\n }\n });\n if (element.dataset.key !== undefined) {\n // Restore the previously saved state on startup.\n browserProxy.localStorageGet(payload(element))\n .then(\n (values) => util.toggleChecked(\n assertInstanceof(element, HTMLInputElement),\n values[element.dataset.key]));\n }\n });\n }", "title": "" }, { "docid": "5b180cae4cb9da77a0969bb4d0e50fd9", "score": "0.53442335", "text": "function view_page_loaded() {\n if (!$('found_no').checked) {\n $('found_yes').checked = true;\n update_contact();\n }\n}", "title": "" }, { "docid": "54c4161288b6bfb04fd4ff88f8e9c30d", "score": "0.5325201", "text": "function comprobar() {\n //recogemos las opciones de origen disponible en un array\n var opciones = document.getElementsByName('origen');\n\n //recorremos el array para ver cual es el elegido\n for (var i = 0; i < opciones.length; i++) {\n if (opciones[i].checked) {\n var elegido = opciones[i].value;\n\n //guardamos el valor del origen elegido en el localStorage\n localStorage.setItem('origen', elegido);\n\n //bloqueamos el desplegable de mas origenes\n document.getElementById('otro').disabled = true;\n }\n }\n}", "title": "" }, { "docid": "b973a0e94b9efd1099d5acfab04f5764", "score": "0.53229403", "text": "function restore_options() {\n // Use default value howToStart = yes, autosave = true\n chrome.storage.sync.get({\n hotToStart: 'yes',\n autosave: true\n }, function(items) {\n document.getElementById('startUp').value = items.howToStart;\n document.getElementById('autosave').checked = items.autosave;\n });\n}", "title": "" }, { "docid": "21decfa8f9c87605234d305b01c08b0f", "score": "0.5322933", "text": "function OnAndroidBackButton_Click( e )\r\n{\r\n // We can go back only if a saving is not in progress\r\n if( !bIsSavingInProgress )\r\n {\r\n Back() ;\r\n }\r\n}", "title": "" }, { "docid": "8033ac8ed29882ce720d94c77e9ad569", "score": "0.5319523", "text": "function restore_options() {\n var exceedfavorite = localStorage[\"exceedcase_color\"];\n var min15favorite = localStorage[\"min15case_color\"];\n var hour1favorite = localStorage[\"hour1case_color\"];\n var msnfavorite = localStorage[\"msncase_color\"];\n var assignfavorite = localStorage[\"assigncase_color\"];\n var inifavorite = localStorage[\"inicase_color\"];\n if (!exceedfavorite || !min15favorite || !hour1favorite || !msnfavorite || !assignfavorite || !inifavorite) {\n return;\n }\n checkers(\"exceedcase\",exceedfavorite);\n checkers(\"min15case\",min15favorite);\n checkers(\"hour1case\",hour1favorite);\n checkers(\"msncase\",msnfavorite);\n checkers(\"assigncase\",assignfavorite);\n checkers(\"inicase\",inifavorite);\n}", "title": "" }, { "docid": "9cf0385cb576aff9c8074d13e20955c0", "score": "0.53189504", "text": "function nextQuestion() {\n if (checkBox1.checked == true || checkBox2.checked == true || checkBox3.checked == true || checkBox4.checked == true) {\n questionIndex++;\n if (questionIndex >= 5){\n endQuiz();\n }\n checkBox1.checked = false;\n checkBox2.checked = false;\n checkBox3.checked = false;\n checkBox4.checked = false;\n checkBox1.disabled = false;\n checkBox2.disabled = false;\n checkBox3.disabled = false;\n checkBox4.disabled = false;\n }\n}", "title": "" }, { "docid": "d0238461925f40d843dca2b2766acb7e", "score": "0.5316173", "text": "function resetFromCheckBox() {\n clearBoxes()\n resetStar()\n if (checkBoxIrrVerbs.checked === false && checkBoxRegVerbs.checked === false) {\n resetVerbList()\n } else {\n verbListShown = []\n checkIndexUsedArray = []\n if (checkBoxRegVerbs.checked === true) {\n showOnlyRegVerbs()\n } else if (checkBoxIrrVerbs.checked === true) {\n showOnlyIrrVerbs()\n }\n }\n}", "title": "" }, { "docid": "0129d6ddd0e911e66c57a9c7d6731aa3", "score": "0.5314893", "text": "function initializeUI()\n\t{\t\t\n\t//look for a prefs string for this site and pre-load it. Pre-set the checkboxes. \n\tcurSiteRootFolder = site.getLocalRootURL(site.getCurrentSite()); \n\t\n\tif (curSiteRootFolder == null || curSiteRootFolder == \"\")\n\t\t{\n\t\talert(MSG_NoSiteSelected); \n\t\twindow.close();\n\t\treturn; \t\t\n\t\t}\n\t\n\tvar wantXMLFiles = true; \n\tvar changedFilesOnly = true; \n\tvar exportXMLFolder = \"\"; \n\t\t\n\tvar notesFile = MMNotes.open(curSiteRootFolder, true); \n\tif (notesFile)\n\t\t{\n\t\tvar temp = MMNotes.get(notesFile, \"exportXMLFolder\"); \n\t\t\n\t\tif (temp != null && temp != \"\")\n\t\t\texportXMLFolder = temp; \n\t\t\t\n\t\twantXMLFiles = (MMNotes.get(notesFile, \"wantXMLFiles\") != \"FALSE\"); \n\t\tchangedFilesOnly = (MMNotes.get(notesFile, \"changedFilesOnly\") != \"FALSE\"); \n\t\t}\n\tMMNotes.close(notesFile);\t\n\t\n\tfindObject(\"destinationFolder\").value = exportXMLFolder; \n\t\n\tvar xmlBox = findObject(\"wantXMLFiles\");\n\txmlBox.checked = wantXMLFiles; \n\t\n\tvar changedBox = findObject(\"changedFilesOnly\");\n\tchangedBox.checked = changedFilesOnly; \n\t} //initializeUI", "title": "" }, { "docid": "a1c1ef4a9afc492e8a6bc1ac2017331e", "score": "0.53080547", "text": "function checkAnswer() {\n $('#newPageLoader').on('click', '.js-submit-button', event=> {\n event.preventDefault();\n let selectedChoice=$('input[name=answerOption]:checked').val();\n let correctAnswer=`${STORE[questionNumber].answer}`;\n if (selectedChoice === correctAnswer) {\n $('#question_Quiz').hide();\n $('#newPageLoader').html(correctAnswerPage());\n answersCorrectCount++;\n }\n else {\n $('#newPageLoader').html(incorrectAnswerPage());\n }\n });\n}", "title": "" }, { "docid": "6cfe0267f17b72c31c6c8b359abf2cb9", "score": "0.5307097", "text": "function readSettings() {\n if(localStorage.isClick===\"false\") {\n $(\"#click\").prop(\"checked\", false);\n $(\"#buttonSound\").attr(\"src\", \"music/silent.mp3\");\n }\n else {\n $(\"#click\").prop(\"checked\", true);\n $(\"#buttonSound\").attr(\"src\", \"music/button.mp3\");\n }// end if-else\n if(localStorage.isWin===\"false\") {\n $(\"#win\").prop(\"checked\", false);\n $(\"#winSound\").attr(\"src\", \"music/silent.mp3\");\n }\n else {\n $(\"#win\").prop(\"checked\", true);\n $(\"#winSound\").attr(\"src\", \"music/win.mp3\");\n }// end if-else\n if(localStorage.isLose===\"false\") {\n $(\"#lose\").prop(\"checked\", false);\n $(\"#loseSound\").attr(\"src\", \"music/silent.mp3\");\n }\n else {\n $(\"#lose\").prop(\"checked\", true);\n $(\"#loseSound\").attr(\"src\", \"music/lose.mp3\");\n }// end if-else\n if(localStorage.isPunch===\"false\") {\n $(\"#punch\").prop(\"checked\", false);\n $(\"#punchSound\").attr(\"src\", \"music/silent.mp3\");\n }\n else {\n $(\"#punch\").prop(\"checked\", true);\n $(\"#punchSound\").attr(\"src\", \"music/punch.mp3\");\n }// end if-else\n if(localStorage.isHit===\"false\") {\n $(\"#hit\").prop(\"checked\", false);\n $(\"#hitSound\").attr(\"src\", \"music/silent.mp3\");\n }\n else {\n $(\"#hit\").prop(\"checked\", true);\n $(\"#hitSound\").attr(\"src\", \"music/hit.mp3\");\n }// end if-else\n if(localStorage.isCash===\"false\") {\n $(\"#money\").prop(\"checked\", false);\n $(\"#moneySound\").attr(\"src\", \"music/silent.mp3\");\n }\n else {\n $(\"#money\").prop(\"checked\", true);\n $(\"#moneySound\").attr(\"src\", \"music/money.mp3\");\n }// end if-else \n if(localStorage.isSound===\"true\")\n $(\"#turnSound\").text(\"allumer\");\n else \n $(\"#turnSound\").text(\"eteindre\"); \n}// end readSettings", "title": "" } ]
1ce9aac8ccd401e1d6a2cab3dc9605d7
gets right from the instrument which the owner purchased
[ { "docid": "6c4bce436e81d9613246ef511b06b30f", "score": "0.6175571", "text": "async function getRightFromInstrument(instrumentData, rightName) {\n let right = null\n const rights = instrumentData[\"instrument\"][\"rights\"]\n\n for (var i = 0; i < rights.length; i++) {\n if (rights[i][\"right_name\"] === rightName) {\n right = rights[i]\n return right\n }\n }\n return right\n}", "title": "" } ]
[ { "docid": "e0a0ea6fa1f5b2f2aa8b974b0f102e0f", "score": "0.56391037", "text": "getID(){\n return ID_EQUIP_STIR_ROD;\n }", "title": "" }, { "docid": "4db6661c100fbcbdb33b834eae73b08f", "score": "0.55628234", "text": "get legalHold() {\n return this.originalResponse.legalHold;\n }", "title": "" }, { "docid": "77dc8eb02a65f8dbfecabd1e7c0f6c8c", "score": "0.5532379", "text": "get payor () {\n\t\treturn this._payor;\n\t}", "title": "" }, { "docid": "2d939419777bb46cfc431ec56ae5744d", "score": "0.5499186", "text": "function getRawLicense(_) {\n\tvar data = _manageLicenseData(_);\n\tif (data) return data[0];\n\treturn null;\n}", "title": "" }, { "docid": "40ad9bc5370d702d3e6fb67dfc22698f", "score": "0.5490795", "text": "function findOwnerEquipment(owner_id) {\n return db('equipment')\n .select('equipment_id', 'equipment_name', 'equipment_description', 'renter_id', 'owner_id')\n .where('owner_id', owner_id)\n}", "title": "" }, { "docid": "132dfecd93be6a76da27814114084f44", "score": "0.53669274", "text": "get armor() {\n return this._armor;\n }", "title": "" }, { "docid": "804c57be5109f22bd43c909e771baa9b", "score": "0.53069836", "text": "async queryItem(ctx, owner, contentHash) {\n\n //retrive the target item from the ledger\n const itemKey = Item.makeKey([owner, contentHash]);\n const target_item = await ctx.getItem(itemKey);\n\n if (!target_item) {\n throw new Error('This item: ' + itemKey + ' not found.');\n }\n\n console.log(target_item.serialize());\n return target_item;\n\n }", "title": "" }, { "docid": "8675fe80b71f23660871361cc38ec37f", "score": "0.53062236", "text": "function getParty() {\n\treturn UserInfoStore.getUserInfo().partyAct;\n}", "title": "" }, { "docid": "2febdbf0b3460c46372c89c9ef818bb1", "score": "0.5280619", "text": "getWarehouseInventory() {\n return warehouseInventory;\n }", "title": "" }, { "docid": "c27d682476346a05f406920abcc2111f", "score": "0.5252605", "text": "get arousePower() {\n return super.arousePower + this.armor.arousePower\n }", "title": "" }, { "docid": "d3da150f20608b2c4e8f4e6cd6a93fec", "score": "0.52419555", "text": "function getDetails(){\n\t\t// Query the store for the product details\n\t\tinappbilling.getProductDetails(successHandler, errorHandler, [\"gas\",\"infinite_gas\"]);\n\t}", "title": "" }, { "docid": "af416ecc13013f79060c32da5caeb5a2", "score": "0.52311474", "text": "function getvalueof()\n{\nreturn warehouse;\n}", "title": "" }, { "docid": "de7894015aeedf86dad274e4fc1a0631", "score": "0.5192346", "text": "getHand() {\n\n }", "title": "" }, { "docid": "20dc4e0412e5f69ff7be2b5269c08011", "score": "0.5190678", "text": "getLoyaltyRewardid () { return this.loyaltyRewardid; }", "title": "" }, { "docid": "6213fcbfb81c43087f76bf4aa8b91e38", "score": "0.5172675", "text": "function buyIceCreem() {\n return {\n type: BUY_ICECREEM,\n };\n}", "title": "" }, { "docid": "3abeda83f31b052f403c16c5225b7c4e", "score": "0.51709557", "text": "function getItemFromInventory(memberObj, itemName){\n let shopUser = getShopUser(memberObj);\n return shopUser.inventory.find(invItem => {\n return invItem.Item === itemName;\n })\n}", "title": "" }, { "docid": "6791396bf423785e68981ea0d6d15f20", "score": "0.51233435", "text": "get actualArm () {\n\t\treturn this._actualArm;\n\t}", "title": "" }, { "docid": "7e2eefcdc65588767a6c2c83a2b39022", "score": "0.50826246", "text": "function findRenterEquipment(renter_id) {\n return db('equipment')\n .select('equipment_id', 'equipment_name', 'equipment_description', 'owner_id', 'renter_id')\n .where('renter_id', renter_id)\n}", "title": "" }, { "docid": "ef63920583e4297c2b77ec52a0c3d0e9", "score": "0.50815827", "text": "function getTansactionPOOutStorage(names) {\n var tarnid = poRecordTransfrom(poRecordTransfrom(names, 'tranid', '1').id, 'createdfrom', '2').id;\n var recriptId = poRecordTransfrom(tarnid, 'createdfrom', '3').id;\n var rec = record.load({\n type: record.Type.ITEM_FULFILLMENT,\n id: recriptId\n });\n\n return {\n 'Record Data : ': rec,\n 'Inventory details : ': rec.getSublistSubrecord({sublistId: 'item', line: 0, fieldId: 'inventorydetail'})\n }\n }", "title": "" }, { "docid": "1bd2a7833ca8d74693d18ab8a5113081", "score": "0.5044315", "text": "function GetClickedInventory() {\n\t\n\t// Returns the item name based on the position of the mouse\n\tvar Inv = \"\";\n\tif ((MouseX <= 975) && (MouseY >= 601) && (MouseY <= 674)) {\n\n\t\t// Check if the player icon was clicked\n\t\tif ((MouseX >= 1) && (MouseX <= 74))\n\t\t\tInv = \"Player\";\n\t\n\t\t// Check in the regular inventory\n\t\tvar I;\n\t\tif (Inv == \"\")\n\t\t\tfor (I = 0; I < PlayerInventory.length; I++)\t\n\t\t\t\tif ((MouseX >= 1 + (I + 1) * 75) && (MouseX <= 74 + (I + 1) * 75))\n\t\t\t\t\tInv = PlayerInventory[I][PlayerInventoryName];\n\t\t\t\n\t\t// Check in the locked inventory\n\t\tif (Inv == \"\")\n\t\t\tfor (var L = 0; L < PlayerLockedInventory.length; L++)\t\n\t\t\t\tif ((MouseX >= 1 + (I + L + 1) * 75) && (MouseX <= 74 + (I + L + 1) * 75))\n\t\t\t\t\tInv = \"Locked_\" + PlayerLockedInventory[L];\n\n\t}\n\n\t// Returns the inventory found\n\treturn Inv;\n\n}", "title": "" }, { "docid": "938b2f24c470e44899dc2f7cb8036be5", "score": "0.5040639", "text": "function purchaseMoraleIntervention(morale_i, site)\n{\n\tupdate_morale_dictionary(morale_i, site.name);\n\tsite.morale += get_morale_impact(morale_i, site);\n\tif(site.morale > 120)site.morale = 120;\n\tnew_transaction(-morale_i.cost);\n}", "title": "" }, { "docid": "e9a543c6dcbe8edf0bcf16b8002c6a2e", "score": "0.5032205", "text": "function getActiveInventory() {\n return unsafeWindow.g_ActiveInventory;\n }", "title": "" }, { "docid": "b2af2873c4a112ce2da962df5733407c", "score": "0.50084305", "text": "rightArmRot() {\n return this.controller.right.pointer.rotationQuaternion;\n }", "title": "" }, { "docid": "da63adeac7c2b8b6870c04e5b1066a64", "score": "0.5007662", "text": "function getSelectedInstrument(){\n //prompt used\n let selectedInstrument = prompt('What instrument do you play?');\n return selectedInstrument;\n}", "title": "" }, { "docid": "d1e05be23dc81c134f1badad2622b8b3", "score": "0.5004656", "text": "function accessesingData1() {\nreturn store4['Dark Chocolate Crunchies']['cost'];\n}", "title": "" }, { "docid": "7f250292677da6470c890a3a17a3046c", "score": "0.49891576", "text": "get weaponSkill() {\n\n // return the weapon skill\n return this[data].weaponSkill;\n }", "title": "" }, { "docid": "93e431fe3d295392f57334695c52ca7e", "score": "0.49871185", "text": "function accessesingData1() {\n return store4['Dark Chocolate Crunchies']['cost'];\n}", "title": "" }, { "docid": "8219ccb865e5d166a6d5abd26cf938a2", "score": "0.49848765", "text": "get for() {\n return this.i.bu;\n }", "title": "" }, { "docid": "4855235b9bf6410479520fd27d41c384", "score": "0.4977228", "text": "getProductContract() {\n const state = store.getState();\n return state.contracts ? state.contracts.product : undefined;\n }", "title": "" }, { "docid": "9080b616fef0f6e337b1973fe78127c2", "score": "0.49613568", "text": "getTargetOwner() {\n return this.target_owner;\n }", "title": "" }, { "docid": "def237fcbf0d6bb2e2b7bbc216cf1af4", "score": "0.4956487", "text": "baseAmount() {return player.q.energy}", "title": "" }, { "docid": "258f1ad87de86b360e440045ef9549b2", "score": "0.4941869", "text": "getRight() {\n return this.rightId;\n }", "title": "" }, { "docid": "c7b5b771e19b34fd75a793fea635f8ce", "score": "0.49321264", "text": "get AreaRightDetails() { return AreaRightDetails }", "title": "" }, { "docid": "08d1ebe3e13f17d6587292644c142879", "score": "0.49211055", "text": "mfGetItem(){\n return mf.modeGetItem(this);\n }", "title": "" }, { "docid": "30a74adc7acdb9d55350c717e2bfaacc", "score": "0.48963013", "text": "function merchant() {\n var merchant = ddBox.attr(\"value\").match(merchantre);\n return merchant ? merchant[1] : null;\n }", "title": "" }, { "docid": "d776d187badb6a6b3bfe72421347d381", "score": "0.4893741", "text": "getSelectedUnit () {\r\n\t\tconst { selectionIndex } = this.selection;\r\n\t\tconst rawUnit = this.selection.units[selectionIndex];\r\n\r\n\t\tconsole.logger(\"getting selection unit: \", selectionIndex, rawUnit);\r\n\r\n\t\tif (!rawUnit) {\r\n\t\t\tconsole.logger(\"raw selection: \", this.selection.units);\r\n\t\t\tconsole.logger(\"WARNING - unable to find unit at selection index\");\r\n\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tconst { itemId1, itemId2 } = rawUnit;\r\n\t\treturn this.findUnit(itemId1, itemId2) || null;\r\n\t}", "title": "" }, { "docid": "71b81217ff248a3159a8af0d620e6c5e", "score": "0.48875672", "text": "armRot(side) {\n return this.controller[side].pointer.rotationQuaternion;\n }", "title": "" }, { "docid": "73dd2380ba46c51a56fe239732a79c1f", "score": "0.48828423", "text": "function buy(itemIdx, target) {\n let arrayEntities = board[player.position.row][player.position.column];\n target = arrayEntities[arrayEntities.length-2];\n let item = target.items[itemIdx];//before buying it\n \n if(item !== undefined){\n //item.use(target);//no bcz it's not using it...\n if(player.gold>=item.value){//if enough gold\n player.gold -= item.value;\n item = target.items.splice(itemIdx,1)[0];//popItem(itemName, target);\n player.setItems(player.items.concat(item));\n print(\"Purchased \" + item.name, SUCCESS_COLOR);\n print(\"Gold: \" + player.gold, SUCCESS_COLOR);\n }else{ print(\"Not enough gold :( Required:\" + item.value + \" gold: \" + player.gold, ERROR_COLOR);}\n }else{\n print(target.name + \" doesn't have an item with id: '\" + itemIdx + \"'\", ERROR_COLOR);\n }\n}", "title": "" }, { "docid": "0d6e79f4367bd3b54941f22e1c0ffbaa", "score": "0.48656744", "text": "dispense(location) {\n const currentSlot = this.slots[location]\n return currentSlot.quantity > 0 ? currentSlot.item.name : 'empty slot' //const buttercup = new Item(id, 'Buttercup', 9.99)\n //return buttercup\n //return something.getItemFor(id)\n }", "title": "" }, { "docid": "63bd97decc59375a587dada10b5b4ea9", "score": "0.4858842", "text": "function proofData() {\n console.log(data.ProductData[0].Vendor);\n}", "title": "" }, { "docid": "7cf10fe3c0d0404c80ffb617b78c077f", "score": "0.48499092", "text": "owner() {\n return Owners.findOne({ownerId: this._id});\n }", "title": "" }, { "docid": "fc57d0bdba19671d335a6131f57c237a", "score": "0.48476294", "text": "getHandCard() {\n \t\treturn this.mHandCard;\n\t}", "title": "" }, { "docid": "a159c41642ae653de60b5736c5f89144", "score": "0.48405263", "text": "function getImpgaItem(i, inv) {\n return {\n \"num\": i,\n// \"hsn_sc\": inv['HSN/SAC of Supply'],\n \"txval\": inv['Total Taxable Value'],\n \"irt\": inv['IGST Rate'],\n \"iamt\": inv['IGST Amount'],\n \"crt\": inv['CGST Rate'],\n \"camt\": inv['CGST Amount'],\n \"srt\": inv['SGST Rate'],\n \"samt\": inv['SGST Amount'],\n \"csrt\": inv['CESS Rate'],\n \"csamt\": inv['CESS Amount']\n\n };\n }", "title": "" }, { "docid": "b1e5b9ed3eda6aab573779119bab3d44", "score": "0.48217416", "text": "function checkInventory(scannedItem){\n return foods[scannedItem];\n}", "title": "" }, { "docid": "70ede02e84307e9226692e941c80fe9b", "score": "0.4821103", "text": "getInstrument (type){\n switch (type) {\n case this.props.instrumentTypeList.classic_guitar:\n return classic_guitar;\n break;\n case this.props.instrumentTypeList.water_drop:\n return water_drop;\n break;\n }\n }", "title": "" }, { "docid": "571a3da91c8205df952d996a30908702", "score": "0.48090473", "text": "get inventory() { return this._inventory; }", "title": "" }, { "docid": "2c1a33a3f57478d807994334a8e92e91", "score": "0.4803107", "text": "buy(towerIndex) {\n this.spendMoney(this.selection[towerIndex].cost);\n return this.selection[towerIndex];\n }", "title": "" }, { "docid": "5b4130f48349264ee5ad7914ea2795da", "score": "0.47983518", "text": "get purpose(){\r\n return this._purpose;\r\n }", "title": "" }, { "docid": "03318f3b625004e7212e26381e317c86", "score": "0.47983155", "text": "function getTansactionPOInStorage(names) {\n var recriptId = poRecordTransfrom(poRecordTransfrom(names, 'tranid', '1').id, 'createdfrom', '1').id;\n var rec = record.load({\n type: record.Type.ITEM_RECEIPT,\n id: recriptId\n });\n\n return [{\n 'The goods receipt : ': rec,\n 'Inventory details : ': rec.getSublistSubrecord({sublistId: 'item', line: 0, fieldId: 'inventorydetail'})\n }]\n }", "title": "" }, { "docid": "f82c753ee205a14562b6c245a9122444", "score": "0.47854063", "text": "get learnUnitId(){\n return this._learnUnitId;\n }", "title": "" }, { "docid": "a7969cb59e156cb1dd0de72df1261f53", "score": "0.478264", "text": "function getFullLicense(_) {\n\tvar data = _manageLicenseData(_);\n\tif (data) return data;\n\treturn null;\n}", "title": "" }, { "docid": "c98897b9f9456db49ab4abf5c4e3b03f", "score": "0.47814095", "text": "function getRadio(){\n\t\tvar radioInputs = document.forms[0].warranty;\n\t\tfor(var i=0; i<radioInputs.length; i++){\n\t\t\tif(radioInputs[i].checked){\n\t\t\t\twarrantyValue = radioInputs[i].value;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "22875c4a666d126b134f6e332acc6d67", "score": "0.4773952", "text": "function getRefund() {\n\t//First check that the erc20Instance is defined. \n\tif(erc20InstanceDefined()) {\n\t\t//Now check to see whether or not the ICO has ended. The condition will be true if a) the \n\t\t//deadline has passed and the soft cap has not been reached, or b) the owner of the ICO \n\t\t//canceled the token sale. \n\t\ticoInstance.icoHasEnded((error,icoHasEnded)=>{\n\t\t\t//If the ICO has NOT ended then inform the user and exit from the function. \n\t\t\tif(!icoHasEnded) {\n\t\t\t\talert(\"REFUNDS CANNOT BE CLAIMED UNLESS THE ICO HAS BEEN CANCELLED \" +\n\t\t\t\t\t\"OR IF THE DEADLINE HAS PASSED AND THE SOFT CAP HAS NOT BEEN REACHED\"\n\t\t\t\t)\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\t//If the ICO HAS ended, then check to see if the user has invested ETH on the ICO \n\t\t\t\t//smart contract.\n\t\t\t\ticoInstance.investments(web3.eth.accounts[0],(error,investment)=>{\n\t\t\t\t\tif(!error) {\n\t\t\t\t\t\t//If the returned query shows that the investment IS greater than 0, this \n\t\t\t\t\t\t//means that the user's investment is still on the ICO smart contract. \n\t\t\t\t\t\tif(investment > 0) {\n\t\t\t\t\t\t\t//Proceed to giving the user a full refund.\n\t\t\t\t\t\t\ticoInstance.claimRefund({from: web3.eth.accounts[0], gasPrice: 5e10},(error, result)=>{\n\t\t\t\t\t\t\t\tif(!error) {\n\t\t\t\t\t\t\t\t\t$(\"#tx-msg\").html(\"Check the status of your refund \");\n\t\t\t\t\t\t\t\t\t$(\"a.tx-link\").attr(\"href\", \"https://ropsten.etherscan.io/tx/\"+result);\n\t\t\t\t\t\t\t\t\t$(\"#txModal\").modal('show');\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tconsole.error(error);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//If the query shows that the investment is NOT greater than 0, then this\n\t\t\t\t\t\t\t//means that the user never invested anything to the ICO contract, or that \n\t\t\t\t\t\t\t//the user did and already has claimed a refund. In either case the user will \n\t\t\t\t\t\t\t//be alerted and nothing will happen. \n\t\t\t\t\t\t\talert(\"YOU HAVE NO ETH IN THE CONTRACT. \" +\n\t\t\t\t\t\t\t\t\"EITHER YOU INVESTED FROM A DIFFERENT ACCOUNT, \" +\n\t\t\t\t\t\t\t\t\"OR YOU ALREADY CLAIMED A REFUND.\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.error(error);\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\t\t});\n\t}\n}", "title": "" }, { "docid": "66d4a1960c22bd8c2452c3fe0316e4a2", "score": "0.47720382", "text": "baseAmount() {return player.t.energy}", "title": "" }, { "docid": "f77d6f6254b5ff21231b1203c231c411", "score": "0.47665292", "text": "async viewDrugCurrentState(ctx, drugName, serialNo) {\n const productID = ctx.stub.createCompositeKey(\"org.pharma-network.pharmanet.drug\", [drugName, serialNo]);\n let drugDataBuffer = await ctx.stub.getState(productID).catch((err) => console.log(err));\n return JSON.parse(drugDataBuffer.toString());\n }", "title": "" }, { "docid": "9ee67c008d459b2d055740e4ed520fb2", "score": "0.4764706", "text": "get right() {\n return this._right;\n }", "title": "" }, { "docid": "9ee67c008d459b2d055740e4ed520fb2", "score": "0.4764706", "text": "get right() {\n return this._right;\n }", "title": "" }, { "docid": "ef17243323a142d407bf047ed22af259", "score": "0.47589186", "text": "get productCode$() {\n return this.currentProductService.getProduct().pipe(filter(Boolean), map((product) => product.code), tap((_) => this.productReferenceService.cleanReferences()));\n }", "title": "" }, { "docid": "fb1061acc53f36e2314302e9a9d4d8c1", "score": "0.47559786", "text": "function getInsurance(car) {\n\t console.log(\"You have car insurance to feel safety abroad!\");\n\t let insurance = {};\n\t console.log(\"Insurance\", insurance);\n\t \n }", "title": "" }, { "docid": "61ee9f91513381193a24d37b3899adfa", "score": "0.474925", "text": "function getWallet(){\n return ss.getItem('wallet');\n}", "title": "" }, { "docid": "2c70922b847dc687a3a57945c4ce2bf9", "score": "0.47476906", "text": "reward (s) { return this.rewards[s]; }", "title": "" }, { "docid": "0764c55415ff98d0bdf6cdd16d44e9bf", "score": "0.474645", "text": "function getReward(payload, tier) {\n var rtable = payload.data.loot[tier];\n var info = payload.data.calc_info[tier];\n var n = Math.floor(Math.random() * info.num);\n for (var i = 0; i < info.cases.length; i++) {\n var infoCase = info.cases[i];\n if (n >= infoCase.at_least) {\n return rtable[Math.floor(infoCase.lower + Math.random() * infoCase.range)];\n }\n }\n return null;\n}", "title": "" }, { "docid": "c5125856697fc6421eec38619c3921ce", "score": "0.47445673", "text": "function OnRightButtonPressed( nMouseButton )\n{\n\tvar castAbilityIndex = Entities.GetAbility( Players.GetPlayerHeroEntityIndex( Players.GetLocalPlayer() ), 1 );\n\tvar targetIndex = GetMouseCastTarget();\n\tif ( targetIndex === -1 )\n\t{\n\t\tBeginAttackState( 1, castAbilityIndex, -1 );\n\t}\n\telse if ( Entities.IsItemPhysical( targetIndex ) )\n\t{\n\t\tBeginPickUpState( targetIndex );\n\t}\n\telse\n\t{\n\t\tBeginAttackState( 1, castAbilityIndex, targetIndex );\n\t}\n}", "title": "" }, { "docid": "5976a5c6f9c95339727c1a97fa4f741f", "score": "0.47403878", "text": "function checkInventory(scannedItem) {\n return foods[scannedItem];\n }", "title": "" }, { "docid": "f6d58be3d37116189ab93da956b5fb52", "score": "0.47376797", "text": "function getwood() {\n\tvillageData.wood += villageData.woodGetMultiplier\n\tupdateUI()\n}", "title": "" }, { "docid": "c5e62dcf8170cc34fbb8f57bbddf004a", "score": "0.4735602", "text": "function traderWants() {\n\tvar itemNum = Math.floor(Math.random() * items.length);\n\tvar item = items[itemNum];\n\tvar amount = Math.floor((Math.random() * askLimits[item]) + 1) // always at least 1\n\n\treturn {\"item\" : itemNum , \"amount\" : amount};\n}", "title": "" }, { "docid": "c26a742e6838037d51854fe0aac7665a", "score": "0.47329184", "text": "baseAmount() {return tmp.n.dustProduct}", "title": "" }, { "docid": "ac9e1228f8f91196ae931ce5edf0a409", "score": "0.4732751", "text": "getRock() {\n return this.rock;\n }", "title": "" }, { "docid": "f0883609f5ac5329855f6de4f8b01c15", "score": "0.47262412", "text": "get filteredIUsWithMeta() {\n const ius = this.filteredIU\n const { relations } = this.dataStore\n\n if (ius && relations) {\n return addIDRelations({ data: ius, relations, key: 'IUID' })\n }\n\n return null\n }", "title": "" }, { "docid": "479cb8404f3f624e37385253a18448e3", "score": "0.47232768", "text": "function getProduct(item) { return item.product }", "title": "" }, { "docid": "55885235a407b48cc6593a45a2c4922e", "score": "0.47221017", "text": "function checkInventory(scannedItem) {\n // change code below this line\n return foods[scannedItem];\n}", "title": "" }, { "docid": "55885235a407b48cc6593a45a2c4922e", "score": "0.47221017", "text": "function checkInventory(scannedItem) {\n // change code below this line\n return foods[scannedItem];\n}", "title": "" }, { "docid": "c1a11d7b2262572ecb67a6c2c0392fbc", "score": "0.47205862", "text": "get owner() { //if we need to retrieve owner value at setter function, we need to declare it in order to access it. \n return this._owner;\n }", "title": "" }, { "docid": "503961ac8a00dc388557742f6f8d8bcd", "score": "0.47187078", "text": "function getImpgItem(i, inv) {\n return {\n \"num\": i,\n// \"hsn_sc\": inv['HSN/SAC of Supply'],\n \"txval\": inv['Total Taxable Value'],\n \"irt\": inv['IGST Rate'],\n \"iamt\": inv['IGST Amount'],\n \"crt\": inv['CGST Rate'],\n \"camt\": inv['CGST Amount'],\n \"srt\": inv['SGST Rate'],\n \"samt\": inv['SGST Amount'],\n \"csrt\": inv['CESS Rate'],\n \"csamt\": inv['CESS Amount']\n\n };\n }", "title": "" }, { "docid": "a00a59d1641fa225d66c12e1cd2805fa", "score": "0.4717434", "text": "function getRandomHandSign() {\n let random = Math.floor(Math.random() * signs.length);\n return signs[random].name;\n}", "title": "" }, { "docid": "f2347b70c070c89490a69add014bfac1", "score": "0.47165665", "text": "function purchaseItem() {\n\n if (stats.gold >= price && inventory.length < 6) {\n\n //deducts gold and adds the item to inventory\n stats.gold -= price;\n inventory.push(inGameShop[ceil(currentItem / 6) - 1][(currentItem - 1) % 6]);\n\n //purchase sound\n if (volumeControl) {\n sound.buyItem.setVolume(0.1);\n sound.buyItem.play();\n }\n\n addStats();\n\n }\n\n //insufficient gold sound\n else if (volumeControl) {\n sound.gameover.setVolume(0.1);\n sound.gameover.play();\n }\n\n}", "title": "" }, { "docid": "4ff83f10094dfa4e21865192ccf05d30", "score": "0.4708296", "text": "function getWare(id) {\r\n currentWare = id;\r\n}", "title": "" }, { "docid": "cc259fd6438e7a96620a8e11a88e8b0c", "score": "0.47057495", "text": "function purchaseIt(item) {\n item.purchase();\n purchased.push(item);\n}", "title": "" }, { "docid": "0ffd1fe57f5afcfa151e91c0cb597833", "score": "0.47046515", "text": "leftArmRot() {\n return this.controller.left.pointer.rotationQuaternion;\n }", "title": "" }, { "docid": "296f3c5043fabd2a57b1f12d14a038e5", "score": "0.4700959", "text": "async getShipmentDetails(ctx, buyerCRN, drugName) {\n const shipmentCompositeKeyID = ctx.stub.createCompositeKey(\"org.pharma-network.pharmanet.shipment\", [\n buyerCRN,\n drugName,\n ]);\n\n let shipmentDetailsBuffer = await ctx.stub.getState(shipmentCompositeKeyID).catch((err) => console.log(err));\n let shipmentJSONData = JSON.parse(shipmentDetailsBuffer.toString());\n return shipmentJSONData;\n }", "title": "" }, { "docid": "4c880ee67d7ebe2a5e91f373a4d70792", "score": "0.4697357", "text": "getOutboundInventory() {\n return outboundInventory;\n\n }", "title": "" }, { "docid": "1b757682cb41ead76a8418d5b48e5c68", "score": "0.46936762", "text": "function mechcrunch_total_armor(mech){\n return mech.armor[\"head\"] + \n mech.armor[\"center-torso\"] + \n mech.armor[\"left-torso\"] + \n mech.armor[\"right-torso\"] + \n mech.armor[\"left-leg\"] + \n mech.armor[\"right-leg\"] + \n mech.armor[\"left-arm\"] + \n mech.armor[\"right-arm\"] + \n mech.armor[\"center-torso-rear\"] + \n mech.armor[\"left-torso-rear\"] + \n mech.armor[\"right-torso-rear\"];\n}", "title": "" }, { "docid": "a79c1decaabcf062473cd5e1f5b7b298", "score": "0.46907258", "text": "function yi(t, e) {\n var n = d(t), r = d(n.qi), i = n.dh.get(e);\n return i ? Promise.resolve(i.target) : n.persistence.runTransaction(\"Get target data\", \"readonly\", (function(t) {\n return r.Me(t, e).next((function(t) {\n return t ? t.target : null;\n }));\n }));\n}", "title": "" }, { "docid": "dfac1a8502d040f1ac0f17bbd901bc8d", "score": "0.46869072", "text": "getItem() {\n return this.main;\n }", "title": "" }, { "docid": "b3b87e2ea6a0671a8f263fcb3f6b2a3c", "score": "0.4684351", "text": "borrowAsset() {\n const keys = Object.keys(this.pool);\n const type = keys[keys.length * Math.random() << 0]; \n\n if(this.pool[type].length > 0) {\n return this.pool[type].shift();\n }\n \n return null;\n }", "title": "" }, { "docid": "537818d98f1a1591c462f8da4553efa8", "score": "0.468256", "text": "getLootName(item) {\n if(game.user.isGM || item.data.identified) {\n return item.name;\n }\n return LootSheetActions.getItemName(item);\n }", "title": "" }, { "docid": "a003fff6efebba2289914ac3f96ec571", "score": "0.46788335", "text": "getProductTransactionContract() {\n const state = store.getState();\n return state.contracts ? state.contracts.productTransaction : undefined;\n }", "title": "" }, { "docid": "ff65278fc51b8c3d6ec97f56d325091d", "score": "0.46773827", "text": "getEnchant(id) {\n let enchant = EnchantMap.filter(function (e) {\n return e.id == this.props.item.enchant;\n }.bind(this));\n\n if (enchant.length != 0) {\n return enchant[0];\n }\n else {\n return {\n stats: {},\n icon: '',\n name: `Enchant not implemented. (${id})`,\n slot: '',\n spell_id: 0\n };\n }\n }", "title": "" }, { "docid": "df06c363e68e01368e2867d2810bb738", "score": "0.46716934", "text": "returnTechnology() {\n return this.tech;\n }", "title": "" }, { "docid": "9b0e0120d21eb26da95e2a03c8391d19", "score": "0.4665385", "text": "function pickUpItem(hero, weapon) {\n hero.inventory.push(weapon)\n console.log(weapon)\n displayStats()\n}", "title": "" }, { "docid": "2472cc65530da8d14020db2cc91e3146", "score": "0.46626562", "text": "getCoin() {\n var callback = ((coin) => {\n if (coin._id === this.props.coin) {\n return coin;\n }\n });\n\n var ret = this.props.cap.filter(callback.bind(this));\n return ret[0];\n }", "title": "" }, { "docid": "f2fa80baf479b92dbe0aa20a9e42a0ff", "score": "0.46626452", "text": "get item() {\r\n return this.i.item;\r\n }", "title": "" }, { "docid": "f2fa80baf479b92dbe0aa20a9e42a0ff", "score": "0.46626452", "text": "get item() {\r\n return this.i.item;\r\n }", "title": "" }, { "docid": "198cac97a3b7caf928e02f4e73a10d97", "score": "0.4659882", "text": "function getDamage_arquero() {\n\n\n\n let damage_arquero = (base_damage + (3* Stats.arquero.agilidad));\n// 55 + 3* 10\n return damage_arquero;\n\n}", "title": "" }, { "docid": "38f5681a7a73f768da3cc057862f9108", "score": "0.46596986", "text": "get party () {\n\t\treturn this._party;\n\t}", "title": "" }, { "docid": "531f4897bd8dd117059d9dbf575c0542", "score": "0.46593896", "text": "function booksInstore(){\n return booksForRent;\n}", "title": "" }, { "docid": "c34dc5e08b4d1c4566e0993c87fea3f7", "score": "0.46588904", "text": "get RightKnee() {}", "title": "" }, { "docid": "2cc51241fcb4590a21f05d342f346252", "score": "0.4639621", "text": "function acquireItem(item) {\n\titemObj = items[item];\n\tif(itemObj.weight + player.weight.now > player.weight.max) return;\n\tif(player.primary === 'None' && itemObj.type === 'weapon') player.primary = item;\n\telse if (player.secondary === 'None' && itemObj.type === 'weapon') player.secondary = item;\n\telse inventory.push(item);\n\n\t$('#info').append(`<span style=\"color: navy\">Acquired</span> ${itemLink(item)}<br><br>`);\n\tdisplayInventory();\n}", "title": "" }, { "docid": "7c127028f727b8f7a7688a40ca62150e", "score": "0.46386525", "text": "function successfulPurchase(evt){\n\n/*\t\n EVT PARAMS:\n state[int]: The current state of the transaction; either Ti.Storekit.TRANSACTION_STATE_FAILED, Ti.Storekit.TRANSACTION_STATE_PURCHASED, Ti.Storekit.PURCHASING, or Ti.Storekit.TRANSACTION_STATE_RESTORED.\n quantity[int]: The number of items purchased or requested to purchase.\n productIdentifier[string]: The product's identifier in the in-app store.\n date[date]: Transaction date.\n identifier[string]: The transaction identifier\n receipt[object]: A blob of type \"text/json\" which contains the receipt information for the purchase.\n*/\n\n\t\n var product = evt || {};\n\n if(product.productIdentifier){\n\n // If we are removing ads: \n\n if(product.productIdentifier === 'removeAds'){\n\n gP.setAndSavePersistentData('adsActive',false);\n\n args.refreshAdsButton();\n\n alert('Ads removed');\n\n } else {\t\n\n // If we are purchasing an item from database:\n\n Ti.API.info('Marking as purchased: ' + product.productIdentifier);\n\n var model = col.find(function(model) { return model.get('StoreRef') == product.productIdentifier; });\n\n if(model){\n\n model.buy({\n success:function(e){\n Ti.API.info('Saved in locas database');\n }\n });\n\n };\n\n args.refreshAmount();\n\n col.trigger(\"sync\");\n\n\n\n };\n\n var model = col.find(function(model) { return model.get('StoreRef') == product.productIdentifier; });\n/*\n Alloy.Globals.tracker.trackTransactionItem({\n transactionId: evt.identifier,\n name: evt.identifier,\n sku: model.ItemID,\n category: \"In-APP\",\n price: model.Cost,\n quantity: 1, // Need to implement;\n currency: \"EUR\"\n });\n*/\n };\n\n\n}", "title": "" }, { "docid": "2277dca2a5370a3ac6d0c5e087fb1042", "score": "0.46324897", "text": "getRewardAllocation() {\n return rewardPoolSeat.getCurrentAllocation();\n }", "title": "" } ]
a32b392a7cf3de34b9c0c06c6f1349b3
External dependencies WordPress dependencies Internal dependencies
[ { "docid": "bd8525586cd749da45aa6649c6927213", "score": "0.0", "text": "function FormToggle(_ref) {\n\tvar className = _ref.className,\n\t checked = _ref.checked,\n\t id = _ref.id,\n\t _ref$onChange = _ref.onChange,\n\t onChange = _ref$onChange === undefined ? __WEBPACK_IMPORTED_MODULE_2_lodash_noop___default.a : _ref$onChange,\n\t _ref$showHint = _ref.showHint,\n\t showHint = _ref$showHint === undefined ? true : _ref$showHint,\n\t props = __WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_objectWithoutProperties___default()(_ref, ['className', 'checked', 'id', 'onChange', 'showHint']);\n\n\tvar wrapperClasses = __WEBPACK_IMPORTED_MODULE_3_classnames___default()('components-form-toggle', className, { 'is-checked': checked });\n\n\treturn wp.element.createElement(\n\t\t'span',\n\t\t{ className: wrapperClasses },\n\t\twp.element.createElement('input', __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({\n\t\t\tclassName: 'components-form-toggle__input',\n\t\t\tid: id,\n\t\t\ttype: 'checkbox',\n\t\t\tchecked: checked,\n\t\t\tonChange: onChange\n\t\t}, props)),\n\t\twp.element.createElement('span', { className: 'components-form-toggle__track' }),\n\t\twp.element.createElement('span', { className: 'components-form-toggle__thumb' }),\n\t\tshowHint && wp.element.createElement(\n\t\t\t'span',\n\t\t\t{ className: 'components-form-toggle__hint', 'aria-hidden': true },\n\t\t\tchecked ? Object(__WEBPACK_IMPORTED_MODULE_4__wordpress_i18n__[\"a\" /* __ */])('On') : Object(__WEBPACK_IMPORTED_MODULE_4__wordpress_i18n__[\"a\" /* __ */])('Off')\n\t\t)\n\t);\n}", "title": "" } ]
[ { "docid": "4ae5817a17b1c0f0dc596dc204c915ab", "score": "0.648939", "text": "function dependOn() {\n 'use strict';\n return [\n require(\"util\"),\n require(\"proxy\"),\n require(\"analytics\")\n ];\n}", "title": "" }, { "docid": "58dc1410daabdcafc90c2cc469d28d5c", "score": "0.6417739", "text": "collectDependencies() {}", "title": "" }, { "docid": "61b2a1a9e5e30282db5da410872d4695", "score": "0.600068", "text": "loadAllDependencyVersions() {\n const npmConfigAllFeatures = getNpmDependencies(\n this.props.featureConfig,\n _.keys(this.props.featureConfig.features)\n );\n const allDependencies = _.concat(\n npmConfigAllFeatures.dependencies,\n npmConfigAllFeatures.devDependencies\n );\n _.forEach(allDependencies, (dependency) => npmVersionPromise(dependency));\n }", "title": "" }, { "docid": "4690466c596d2f387156a861f3c21f63", "score": "0.5919509", "text": "function _checkDependencies() {\n let modules = [];\n if (config.queue.enable) {\n if (!sails.hooks.cron) {\n modules.push('sails-hook-cron');\n }\n if (!sails.hooks.queues) {\n modules.push('sails-hook-custom-queues');\n }\n }\n if (modules.length) {\n throw new Error('To use hook `sails-hook-elasticsearch`, you need to install the following modules: ' + modules.join(', '));\n }\n }", "title": "" }, { "docid": "4ba8aeb7c40c18f07781e2f5661089d3", "score": "0.58267623", "text": "async installDependencies() {\n }", "title": "" }, { "docid": "1dc933ecab9796d9b496c679b230bc29", "score": "0.579285", "text": "function requireDeps() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad','$q', function ($ocLL, $q) {\n // Creates a promise chain for each argument\n var promise = $q.when(1); // empty promise\n for(var i=0, len=_args.length; i < len; i ++){\n promise = addThen(_args[i]);\n }\n return promise;\n\n // creates promise to chain dynamically\n function addThen(_arg) {\n // also support a function that returns a promise\n if(typeof _arg == 'function')\n return promise.then(_arg);\n else\n return promise.then(function() {\n // if is a module, pass the name. If not, pass the array\n var whatToLoad = getRequired(_arg);\n // simple error check\n if(!whatToLoad) return $.error('Route resolve: Bad resource name [' + _arg + ']');\n // finally, return a promise\n return $ocLL.load( whatToLoad );\n });\n }\n // check and returns required data\n // analyze module items with the form [name: '', files: []]\n // and also simple array of script files (for not angular js)\n function getRequired(name) {\n if (appDependencies.modules)\n for(var m in appDependencies.modules)\n if(appDependencies.modules[m].name && appDependencies.modules[m].name === name)\n return appDependencies.modules[m];\n return appDependencies.scripts && appDependencies.scripts[name];\n }\n\n }]};\n }", "title": "" }, { "docid": "9a04fa603be4e9ccfedc938a3a515e74", "score": "0.5722068", "text": "function dependencies() {\n return src('node_modules/svelte/internal/index.mjs')\n // Svelte internals \n .pipe(rename(function (path) {\n path.dirname = 'svelte'\n path.basename = 'index'\n }))\n .pipe(dest('dist/dependencies'))\n\n // // svelte transitions\n // .pipe(src('node_modules/svelte/transition/index.mjs'))\n // .pipe(rename(function (path) {\n // path.basename = 'transition'\n // }))\n // .pipe(dest('dist/dependencies'))\n\n\n // pagejs client router\n .pipe(src('node_modules/page/page.mjs'))\n .pipe(rename(function (path) {\n path.dirname = 'page'\n path.basename = 'index'\n }))\n .pipe(dest('dist/dependencies'))\n}", "title": "" }, { "docid": "6a7a36f153a004fb2562b83870085ae4", "score": "0.57072145", "text": "function dependenciesLoaded(){\r\n\tinitCAWApp();\r\n}", "title": "" }, { "docid": "04809ad1a33fffe2ff2f69ab9f5efad3", "score": "0.56920093", "text": "dependencies() {\n let dependenciesStream = this.analyzer.dependencies();\n // If we need to include additional dependencies, create a new vinyl\n // source stream and pipe our default dependencyStream through it to\n // combine.\n if (this.config.extraDependencies.length > 0) {\n const includeStream = vinyl_fs_1.src(this.config.extraDependencies, {\n cwdbase: true,\n nodir: true,\n passthrough: true,\n });\n dependenciesStream = dependenciesStream.pipe(includeStream);\n }\n return dependenciesStream;\n }", "title": "" }, { "docid": "d2d951b7870633b6a278f3d523e18b02", "score": "0.56770015", "text": "static get dependencies() {\n return [...super.dependencies, DBUIAutoScrollNative, DBUISlider];\n }", "title": "" }, { "docid": "2b8572f329ea58bf84d4e0a7982638be", "score": "0.5580771", "text": "[_fixDependencies] (pkg) {\n // we need the root package.json because legacy shrinkwraps just\n // have requires:true at the root level, which is even less useful\n // than merging all dep types into one object.\n const root = this.data.packages['']\n pkgMetaKeys.forEach(key => {\n const val = metaFieldFromPkg(pkg, key)\n const k = key.replace(/^_/, '')\n if (val)\n root[k] = val\n })\n\n for (const [loc, meta] of Object.entries(this.data.packages)) {\n if (!meta.requires || !loc)\n continue\n\n // resolve each require to a meta entry\n // if this node isn't optional, but the dep is, then it's an optionalDep\n // likewise for dev deps.\n // This isn't perfect, but it's a pretty good approximation, and at\n // least gets us out of having all 'prod' edges, which throws off the\n // buildIdealTree process\n for (const [name, spec] of Object.entries(meta.requires)) {\n const dep = this[_resolveMetaNode](loc, name)\n // this overwrites the false value set above\n const depType = dep && dep.optional && !meta.optional\n ? 'optionalDependencies'\n : /* istanbul ignore next - dev deps are only for the root level */\n dep && dep.dev && !meta.dev ? 'devDependencies'\n // also land here if the dep just isn't in the tree, which maybe\n // should be an error, since it means that the shrinkwrap is\n // invalid, but we can't do much better without any info.\n : 'dependencies'\n meta[depType] = meta[depType] || {}\n meta[depType][name] = spec\n }\n delete meta.requires\n }\n }", "title": "" }, { "docid": "432328192d6a79e47de1d7bd4805f309", "score": "0.55770457", "text": "depend() {\n let i = this.deps.length;\n while (i--) {\n this.deps[i].depend();\n }\n }", "title": "" }, { "docid": "41df80b6aba9d98c0e445eef14945f73", "score": "0.55378604", "text": "setDependencies() {\n const dependencySorter = new Toposort();\n\n for (const dependency of this.dependencies) {\n this.packageFiles[dependency.packagePath] = {};\n dependencySorter.add(dependency.packagePath, dependency.dependencies);\n\n this.cssDependencies[dependency.packagePath] = dependency.preloadedCss;\n\n this.jsDependencies[dependency.packagePath] = dependency.preloadedJs;\n }\n\n this.sortedDependencies = dependencySorter.sort().reverse();\n }", "title": "" }, { "docid": "bece6d01683f3324628f9055103c5840", "score": "0.55347055", "text": "function getCoalDependencies(){\n\tvar dependencies = coal.settings({\n\t\trun: process.argv,\n smoke: 'Specify needed' + '/' + 'binaries'\n\t});\n\n}", "title": "" }, { "docid": "10b4171ec3a217d17776bb884eab8258", "score": "0.55028933", "text": "dependOn(...dependencies) {\n for (const node of this.nodes) {\n node.dependOn(...dependencies.filter(javascript_1.isDefined));\n }\n }", "title": "" }, { "docid": "9162fbd547c13107f9dbed5ec5712980", "score": "0.54828393", "text": "function hook_install() { }", "title": "" }, { "docid": "000d254bc5abc3d9156e300ee3fa0fd1", "score": "0.54724604", "text": "function preRequires() {\r\n try {\r\n buildHelperCommons.loadDashArgs();\r\n // includeCwdOnModulePath(module, buildHelperCommons.argsMap['verbose']);\r\n } catch (err) {\r\n console.error(err);\r\n process.exit(1);\r\n }\r\n}", "title": "" }, { "docid": "18411533b93c377a3c24d6d2e0a21438", "score": "0.5447864", "text": "getDependencies(route){return this.promisedBuildManifest.then(man=>man[route]&&man[route].map(url=>`${this.assetPrefix}/_next/${encodeURI(url)}`)||[]);}", "title": "" }, { "docid": "67623d2af9037d6ab0ba4beae568e3ee", "score": "0.54199576", "text": "function y(){throw new Error(\"Dynamic requires are not currently supported by rollup-plugin-commonjs\")}", "title": "" }, { "docid": "8ccec1c1cfd890e9f8ddc293c4a7b639", "score": "0.5382", "text": "function upstream_externals(_require) {\n // remember which packages we have seen\n var _seen = {},\n // load the user's package.json\n _user_pkg = _require('./package.json');\n\n\n // check for whether this is the root package\n function _is_user_pkg(pkg) {\n return _user_pkg['name'] === pkg['name'];\n }\n\n\n // use the provided scoped _require and the current nested location\n // in the `node_modules` hierarchy to resolve down to the list of externals\n function _load_externals(pkg_path, pkg) {\n var pkg_externals = [pkg['name']];\n\n try {\n pkg_externals = pkg_externals.concat(_require(\n pkg_path + '/' + pkg['jupyter']['lab']['externals']));\n } catch (err) {\n // not really worth adding any output here... usually, just the name will\n // suffice\n }\n return pkg_externals || [];\n }\n\n\n // return an array of strings, functions or regexen that can be deferenced by\n // webpack `externals` config directive\n // https://webpack.github.io/docs/configuration.html#externals\n function _find_externals(pkg_path) {\n var pkg = _require(pkg_path + '/package.json'),\n lab_config;\n\n // only visit each named package once\n _seen[pkg['name']] = true;\n\n if (!validate_extension(pkg)) {\n if (!_is_user_pkg(pkg)) {\n return [];\n } else {\n throw Error(\n pkg['name'] + ' does not contain a jupyter configuration. ' +\n ' Please see TODO: where?'\n );\n }\n }\n\n console.info(\"Inspecting\", pkg['name'],\n \"for upstream JupyterLab extensions...\");\n\n // ok, actually start building the externals. If it is the user package,\n // it SHOULDN'T be an external, as this is what the user will use for their\n // build... otherwise, load the externals, which is probably\n var externals = _is_user_pkg(pkg) ?\n DEFAULT_EXTERNALS :\n _load_externals(pkg_path, pkg, _require);\n\n // Recurse through the dependencies, and collect anything that has\n // a JupyterLab config\n return Object.keys(pkg['dependencies'])\n .filter(function(key){ return !_seen[key]; })\n .reduce(function(externals, dep_name){\n return externals.concat(\n _find_externals(pkg_path + '/node_modules/' + dep_name));\n }, externals);\n }\n\n return _find_externals(\".\");\n}", "title": "" }, { "docid": "926ade7a38a3a5361878caf6eac4f822", "score": "0.5380975", "text": "dependencies() {\n return ['coffee-loader', 'coffeescript'].concat();\n }", "title": "" }, { "docid": "374cc04670caeab9ba8fe51eec49bd71", "score": "0.53678703", "text": "depend() {\n\t\t\t\tlet i = this.deps.length\n\t\t\t\twhile (i--) {\n\t\t\t\t\tthis.deps[i].depend()\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "6d266d21c599462e45a8edadf01fb72f", "score": "0.53641427", "text": "function cs(){throw new Error(\"Dynamic requires are not currently supported by rollup-plugin-commonjs\")}", "title": "" }, { "docid": "106093674ce998c3371b86f56e9504ae", "score": "0.535159", "text": "function getProdDependencies () {\n return [path.join(JS_PROD_DIR, JS_PROD_LIBS_BUNDLE),\n path.join(JS_PROD_DIR, JS_PROD_APP_BUNDLE),\n path.join(CSS_PROD_DIR, CSS_PROD_BUNDLE),\n path.join(CSS_PROD_DIR, CSS_PROD_LIBS_BUNDLE)]\n}", "title": "" }, { "docid": "c0ce0a860a1f36faeb52541b398daae5", "score": "0.53493553", "text": "getDependencies (route) {\n return this.promisedBuildManifest.then(\n man => (man[route] && man[route].map(url => `/_next/${url}`)) || []\n )\n }", "title": "" }, { "docid": "b53b07924692ff2b00d0386827f2f6a5", "score": "0.53458583", "text": "install() {}", "title": "" }, { "docid": "b53b07924692ff2b00d0386827f2f6a5", "score": "0.53458583", "text": "install() {}", "title": "" }, { "docid": "4cbf89e7fbb9b38abdfe6bd6d68d8888", "score": "0.53321505", "text": "function solveDependencies() {\n if ( i === my.dependencies.length ) { if ( callback ) callback(); return; }\n self.ccm.helper.solveDependency( my.dependencies, i++, solveDependencies );\n }", "title": "" }, { "docid": "9fe225acae28e9b63ae9f4973521f63b", "score": "0.53299546", "text": "getDependencies(route){return this.promisedBuildManifest.then(m=>{var _this$pageRegisterEve;return m[route]?m[route].map(url=>`${this.assetPrefix}/_next/${encodeURI(url)}`):(_this$pageRegisterEve=this.pageRegisterEvents.emit(route,{error:pageLoadError(route)}))!=null?_this$pageRegisterEve:[];});}", "title": "" }, { "docid": "ee502070a62a1d41b7d6becdd5703650", "score": "0.53094435", "text": "function getExternalDeps(params) {\n const { moduleRootDir, depsAlwaysBundled = DEPS_ALWAYS_BUNDLED_UUI, getIsExternalSubFolderBundled = getIsExternalSubFolderBundledUUI } = params;\n const keysExternal = getExternalModuleDependencies({ moduleRootDir, depsAlwaysBundled });\n return (importId) => {\n return keysExternal.some((keyExternal) => {\n return keyExternal === importId || (importId.indexOf(`${keyExternal}/`) === 0 && !getIsExternalSubFolderBundled(importId));\n });\n };\n}", "title": "" }, { "docid": "8fb41597ebd1a26659205dac637c32a3", "score": "0.5305569", "text": "function installDependencies() {\n this.npmInstall(dependencies.dependencies, { 'save': true });\n}", "title": "" }, { "docid": "0780128de88158035d696f3933828644", "score": "0.5297753", "text": "processJsDependencies() {\n const concatenatedJS = this.sortedDependencies.reduce((wholeJS, dependency) => {\n return (this.jsDependencies[dependency] || []).reduce((allJs, jsDep) => {\n return `${allJs}${this.packageFiles[dependency][jsDep]}\\n\\n`;\n }, wholeJS);\n }, '');\n this.javascriptURL = URL.createObjectURL(\n new Blob([concatenatedJS], { type: 'text/javascript' })\n );\n }", "title": "" }, { "docid": "2e7dcfd277b685294054d7b91b12b6e3", "score": "0.5271286", "text": "function addPackageJsonDependencies() {\n return (host, context) => {\n const dependencies = [\n {\n type: helpers_1.NodeDependencyType.Default, version: loadPackageVersionGracefully()\n || '1.4.0', name: '@angular-material-extensions/fab-menu'\n },\n ];\n dependencies.forEach(dependency => {\n helpers_1.addPackageJsonDependency(host, dependency);\n context.logger.log('info', `✅️ Added \"${dependency.name}\" into ${dependency.type}`);\n });\n return host;\n };\n}", "title": "" }, { "docid": "e05cd115a7c1d52e8a536833e43cb104", "score": "0.52565145", "text": "function dependencies(dependencyObject) {\n 'use strict';\n\n function extractSpecificPath(depPath, loadType) {\n if (typeof depPath === 'object') {\n return depPath[loadType];\n }\n\n return depPath;\n }\n\n var depNames, depPaths;\n\n depNames = Object.keys(dependencyObject);\n depPaths = depNames.map(function (depName) {return dependencyObject[depName]; });\n\n function init(root, factory) {\n\n if (typeof module === 'object' && module.exports) {\n // Node/CommonJS\n console.log(\"NODE MODE\");\n factory.apply(root, depPaths.map(function (depPath) {return require(extractSpecificPath(depPath, 'node')); }));\n } else if (typeof define === 'function' && define.amd) {\n // AMD\n console.log(\"AMD MODE\");\n define(depPaths.map(function (depPath) { return extractSpecificPath(depPath, 'browser'); }), factory);\n } else {\n // Browser globals\n console.log(\"GLOBALS MODE\");\n factory.apply(root, depNames.map(function (depName) {return root[depName]; }));\n }\n }\n\n return { init: init };\n}", "title": "" }, { "docid": "8d42ef7420f78779e237445b9d477a2a", "score": "0.5248399", "text": "function addExternalReferences(pkg) {\n let externalReferences = [];\n if (pkg.homepage) {\n externalReferences.push({'reference': {'@type': 'website', url: pkg.homepage}});\n }\n if (pkg.bugs && pkg.bugs.url) {\n externalReferences.push({'reference': {'@type': 'issue-tracker', url: pkg.bugs.url}});\n }\n if (pkg.repository && pkg.repository.url) {\n externalReferences.push({'reference': {'@type': 'vcs', url: pkg.repository.url}});\n }\n return externalReferences;\n}", "title": "" }, { "docid": "962f65700c25c42009ef31d888611268", "score": "0.5231256", "text": "function buildDependencies(dependencies, handlers) {\n if (!dependencies) {\n dependencies = Object.keys(handlers).map((handlerKey) => {\n const handler = handlers[handlerKey];\n return {\n workletHash: handler.__workletHash,\n closure: handler._closure,\n };\n });\n }\n else {\n dependencies.push(buildWorkletsHash(handlers));\n }\n return dependencies;\n}", "title": "" }, { "docid": "74863faefff5ac707669784f73342b8f", "score": "0.52292556", "text": "SystemCheck()\n {\n const dep = require('./package.json').dependencies;\n const opt = require('./package.json').optionalDependencies;\n // Consume to one array\n let installedDeps = [];\n for (const deps in dep) {\n installedDeps.push(deps);\n }\n for (const deps in opt) {\n installedDeps.push(\"[opt]\" + deps);\n }\n Log.Log({Namespace: \"System Check\", Info: `Currently installed Dependencies: ${installedDeps}`});\n // Check if deps are running\n // To be Coded [TODO]\n Log.Log({Namespace: \"System_Check\", Info: \"Completed Check!\"});\n }", "title": "" }, { "docid": "358e8b1a2d2dad3ec0f7c243e4a5ca51", "score": "0.5224151", "text": "function dependents (pkg, cb) {\n loadDependents(function (err, all) {\n if (err) return cb(err);\n cb(null, all[pkg] || []);\n });\n}", "title": "" }, { "docid": "18d7a3af5cb3987de2f0c890d2921b81", "score": "0.521619", "text": "function dependencyHandlers() {\n // use the CommonsChunkPlugin\n return [\n new webpack.optimize.CommonsChunkPlugin({\n name: 'vendor',\n children: true,\n minChunks: 2,\n async: true,\n }),\n ];\n}", "title": "" }, { "docid": "9fb2071e4b3f0691e1d906ee26478b02", "score": "0.51982516", "text": "function f(){throw new Error(\"Dynamic requires are not currently supported by rollup-plugin-commonjs\")}", "title": "" }, { "docid": "c181fb23e77897480ac1606a5afdcd6a", "score": "0.51866454", "text": "collectDependencies(entryPointPath, { dependencies, missing, deepImports }) {\n const resolvedFile = resolveFileWithPostfixes(this.fs, entryPointPath, this.moduleResolver.relativeExtensions);\n if (resolvedFile !== null) {\n const alreadySeen = new Set();\n this.recursivelyCollectDependencies(resolvedFile, dependencies, missing, deepImports, alreadySeen);\n }\n }", "title": "" }, { "docid": "df84402efa2b73451527458165ffa567", "score": "0.5181821", "text": "function resetDependencies() {\n init = false\n ifAsync = __webpack_require__(276)\n fs = __webpack_require__(11)\n execFile = __webpack_require__(98)({bufferStdout: true, bufferStderr: true})\n debug = __webpack_require__(41)('regedit:cscript')\n}", "title": "" }, { "docid": "f594064be25a7fa737260962880204a7", "score": "0.51657814", "text": "function addDependents(manifest){\n for(var capabilityNeeded in manifest.dependencies){\n if(!(capabilityNeeded in dependencyTracker)){\n dependencyTracker[capabilityNeeded] = {}\n }\n dependencyTracker[capabilityNeeded][manifest.name] = manifest.dependencies[capabilityNeeded];\n }\n}", "title": "" }, { "docid": "4bd58c8c38fdf8529d8cb53ea803c23a", "score": "0.5158161", "text": "function addConditionalDependencies(pkgs) {\n function shouldLoadPackageFor(applicationType) {\n var map = (siteModel.rendererModel || window.rendererModel).clientSpecMap;\n\n for (var applicationId in map) {\n if (map.hasOwnProperty(applicationId) && map[applicationId].type === applicationType) {\n return true;\n }\n }\n\n return false;\n }\n\n var isQaAutomation = packagesUtil.isParameterTrue.bind(packagesUtil, 'isqa');\n var isTpaIntegration = packagesUtil.isParameterTrue.bind(packagesUtil, 'isTpaIntegration');\n\n function isWixDomain() {\n return location.hostname === 'www.wix.com';\n }\n function isWixSites() {\n return isWixDomain() || packagesUtil.isParameterTrue('iswixsite');\n }\n\n function isWixCloud() {\n return shouldLoadPackageFor('siteextension');\n }\n\n if (isPreview()) {\n pkgs.push('immutable');\n }\n if (isQaAutomation()) {\n pkgs.push('qaAutomation');\n }\n if (isWixSites()) {\n pkgs.push('wixSites');\n }\n if (isTpaIntegration()) {\n pkgs.push('Q', 'jasminetpa', 'tpaIntegration');\n }\n if (isWixCloud()) {\n pkgs.push('cloud');\n }\n }", "title": "" }, { "docid": "14ecff87fd954bc8ede40c9854f54206", "score": "0.5153329", "text": "function thenCheckDuplicateDeps (idealTree, next) {\n var deps = idealTree.package.dependencies || {}\n var devDeps = idealTree.package.devDependencies || {}\n\n for (var pkg in devDeps) {\n if (pkg in deps) {\n var warnObj = new Error('The package ' + pkg + ' is included as both a dev and production dependency.')\n warnObj.code = 'EDUPLICATEDEP'\n idealTree.warnings.push(warnObj)\n }\n }\n\n next()\n}", "title": "" }, { "docid": "b9b297f3a877393f1f6172b66787d004", "score": "0.51488817", "text": "postInstall() {}", "title": "" }, { "docid": "9069becdfb3061f8d55507873bcd9ceb", "score": "0.51421803", "text": "_addPackageDependencies() {\n\n if (fs.existsSync(this.destinationPath('package.json'))) {\n\n // request the default package file\n let config;\n\n try {\n config = JSON.parse(fs.readFileSync(\n this.destinationPath('package.json')\n ));\n\n } catch (error) {\n\n throw error;\n\n }\n\n // request current addon configuration\n let addonConfig;\n\n try {\n addonConfig = JSON.parse(\n fs.readFileSync(\n this.templatePath('addonConfig.json')\n )\n )\n } catch (err) {\n\n throw err;\n\n }\n\n let requestedLibraries = ['vuejs'];\n\n // declare new package config file\n let newPkgConfig;\n\n try {\n newPkgConfig = util.mergeAddons(addonConfig, requestedLibraries, config);\n\n } catch (error) {\n\n throw error\n\n }\n\n // if content could be added to the new package.json write it\n if (newPkgConfig !== undefined && newPkgConfig !== null) {\n\n fs.writeFileSync(\n this.destinationPath('package.json'),\n JSON.stringify(newPkgConfig, null, 2)\n );\n\n } else {\n\n throw 'Updated package.json file is invalid.';\n\n }\n\n }\n }", "title": "" }, { "docid": "d04b8e54c376329f5d1e4ddc146195f0", "score": "0.5139367", "text": "function getNodeExternals() {\n const dependencies = require('../../package.json').dependencies;\n let externals = {};\n for (const dependency in dependencies) {\n externals[dependency] = dependency;\n }\n return externals;\n}", "title": "" }, { "docid": "2a71302807abb3d2bec1cf7acc1c1cea", "score": "0.51343334", "text": "function getAllDependencies() {\n var _a, _b;\n const packageJSON = project_1.getPackageJson();\n return [\n ...Object.keys((_a = packageJSON.dependencies) !== null && _a !== void 0 ? _a : {}),\n ...Object.keys((_b = packageJSON.devDependencies) !== null && _b !== void 0 ? _b : {}),\n ];\n}", "title": "" }, { "docid": "1109cb6cd4b0e9e7aa77992d17067e97", "score": "0.5130541", "text": "loadDependencies() {\n return this.prepareBoard()\n .then(() => this.prepareUser())\n .then(() => this.prepareProjects());\n }", "title": "" }, { "docid": "44fcf0a063af9d816d40207106bb7273", "score": "0.5127407", "text": "install() {\n this.installDependencies({\n bower: false,\n yarn: false,\n npm: true\n });\n }", "title": "" }, { "docid": "a61f0a6538ac6ac8f49cd33b82291d8d", "score": "0.51195145", "text": "function onInstallRequired() {}", "title": "" }, { "docid": "491c2a991e53c9605c7e322f2aed8628", "score": "0.51173675", "text": "function installMainPeerDependencies(tree) {\n var angularCoreVersion = package_1.getDependencyVersionFromPackageJson(tree, '@angular/core');\n var angularCliVersion = package_1.getDevDependencyVersionFromPackageJson(tree, '@angular/cli');\n var nebularThemeVersion = package_1.getNebularVersion();\n var angularCdkVersion = package_1.getNebularPeerDependencyVersionFromPackageJson('@angular/cdk');\n package_1.addDependencyToPackageJson(tree, '@angular/animations', angularCoreVersion);\n package_1.addDependencyToPackageJson(tree, '@angular/cdk', angularCdkVersion, true);\n package_1.addDependencyToPackageJson(tree, '@nebular/theme', nebularThemeVersion);\n package_1.addDependencyToPackageJson(tree, '@nebular/eva-icons', nebularThemeVersion);\n package_1.addDevDependencyToPackageJson(tree, '@schematics/angular', angularCliVersion);\n}", "title": "" }, { "docid": "9b3e4927a7cddb0ec66d14ca368e55ae", "score": "0.51158106", "text": "prepare() {\n \n let npmjsdeliver='https://cdn.jsdelivr.net/npm/';\n let npmlocal='node_modules/';\n \n this.m_js_files = [];\n this.m_css_files = [];\n this.m_head = document.getElementsByTagName(\"head\")[0];\n // this.m_head = document.head; // IE9+ only\n function endsWith(str, suffix)\n {\n if (str === null || suffix === null)\n return false;\n return str.indexOf(suffix, str.length - suffix.length) !== -1;\n }\n \n var files=this.files;\n this.count=files.length;\n for (var i = 0; i < this.count; ++i)\n {\n if (endsWith(files[i], \".css\"))\n {\n this.m_css_files.push(i+':'+files[i]); //i to keep a link with sources\n /* if(this.mode == 'prod') {\n this.m_css_files.push(npmjsdeliver+files[i]);\n } else {\n this.m_css_files.push(npmlocal+files[i]);\n }*/\n }\n else if (endsWith(files[i], \".js\"))\n {\n this.m_js_files.push(i+':'+files[i]);\n }\n else if (endsWith(files[i], \"@latest\"))\n {\n if(this.mode == 'prod') {\n this.m_js_files.push(i+':'+npmjsdeliver+files[i]);\n }else {\n this.m_js_files.push(i+':'+npmlocal+files[i]);\n }\n }\n else\n ScriptLoader.log('Error unknown filetype \"' + files[i] + '\".');\n \n } \n \n }", "title": "" }, { "docid": "381d2cd1c0b4137012a1f9b4556d0a69", "score": "0.5107376", "text": "async function getThirdPartyPackages() {\n let packages = [];\n let otherPackages = await glob(\"./extra/*\");\n for (let packageDir of otherPackages) {\n let thirdPartyPackage = new LanguagePackage(packageDir)\n let valid = await thirdPartyPackage.valid();\n if (valid) {\n packages.push(thirdPartyPackage)\n }\n }\n return packages;\n}", "title": "" }, { "docid": "acd8e7776d5ee0bcdd17adb1088c9c66", "score": "0.51054955", "text": "processCssDependencies() {\n const concatenatedCSS = this.sortedDependencies.reduce((wholeCSS, dependency) => {\n return (this.cssDependencies[dependency] || []).reduce((allCss, cssDep) => {\n const css = replacePaths(cssDep, this.packageFiles[dependency]);\n // We have completed the path substition, so concatenate the CSS.\n return `${allCss}${css}\\n\\n`;\n }, wholeCSS);\n }, '');\n this.cssURL = URL.createObjectURL(new Blob([concatenatedCSS], { type: 'text/css' }));\n }", "title": "" }, { "docid": "cdbad684e8d4c6520f6afc10ac9624ce", "score": "0.5095662", "text": "static _updateCallbackHooks () {\n let hookIndex = this.callbackHooks.length\n while (hookIndex--) {\n const callbackObj = this.callbackHooks[hookIndex]\n const dependencies = callbackObj.dependencies\n const dependencyKeys = Object.keys(callbackObj.dependencies)\n let index = dependencyKeys.length\n\n // check all dependencies for request fulfillments\n // and inject respective resolved promise objects\n while (index--) {\n const key = dependencyKeys[index]\n const dependency = dependencies[key]\n const requestURI = this.isInRequestQueue(dependency, true)\n // Check if this dependency URI matched with requested\n // URIs and inject the value for that URI's resolved\n // promise\n if (requestURI) {\n const promise = this.apiRecord[requestURI]\n callbackObj.resolvedDependencies[key] = promise\n delete dependencies[key]\n dependencyKeys.splice(index, 1)\n }\n }\n // Run callback if all dependencies were fulfilled and\n // remove it from being tracked\n if (dependencyKeys.length === 0) {\n this._runCallback(callbackObj)\n this.callbackHooks.splice(hookIndex, 1)\n }\n }\n }", "title": "" }, { "docid": "1e403f0bc4ef292767742aed10bf8443", "score": "0.5089856", "text": "function phpLibsBuild(done) {\n gulp.src(root_src_inc)\n .pipe(gulp.dest(build_dir_inc));\n done();\n}", "title": "" }, { "docid": "00dc9d64df7ff7f8e355448d4830d70c", "score": "0.5072216", "text": "function loadDependencies(files, callback){\n // loading CSS files\n //console.log(JSON.stringify(files));\n for (i = 0; i < files.css.length; i++) {\n var cssNode = document.createElement('link');\n cssNode.type = 'text/css';\n cssNode.rel = 'stylesheet';\n cssNode.href = getBaseUrl(files.css[i]);\n cssNode.media = 'screen';\n document.body.appendChild(cssNode);\n }\n \n var count = 0;\n var head = document.getElementsByTagName(\"head\")[0] || document.documentElement;\n // loading Javascript files\n var loadScript = function(loadedFileIndex){\n if (loadedFileIndex < files.js.length) {\n var x = document.createElement(\"script\");\n x.src = getBaseUrl(files.js[loadedFileIndex]);\n x.onload = function(){\n loadScript(loadedFileIndex + 1);\n }\n head.insertBefore(x, head.firstChild);\n }\n else {\n (typeof callback === \"function\") && callback.apply(this);\n }\n }\n loadScript(0);\n }", "title": "" }, { "docid": "5153f51db09408f6ae628bdeac0e87e6", "score": "0.5072052", "text": "function getExternalDeps( nodes ) {\n var res = [];\n var helpersres = [];\n\n if ( nodes && nodes.statements ) {\n res = recursiveVarSearch( nodes.statements, [], undefined, helpersres );\n }\n\n var defaultHelpers = [\"helperMissing\", \"blockHelperMissing\", \"each\", \"if\", \"unless\", \"with\"];\n\n return {\n vars : _(res).chain().unique().map(function(e){\n if ( e === \"\" ) {\n return '.';\n }\n if ( e.length && e[e.length-1] === '.' ) {\n return e.substr(0,e.length-1) + '[]';\n }\n return e;\n }).value(),\n helpers : _(helpersres).chain().unique().map(function(e){\n if ( _(defaultHelpers).contains(e) ) {\n return undefined;\n }\n return e;\n }).compact().value()\n };\n }", "title": "" }, { "docid": "f132bbb4d25c7559a61cab7398908a4c", "score": "0.5070839", "text": "extend(config, { isDev, isClient, isServer }) {\n if (isServer) {\n config.externals = {\n 'firebase-admin': 'commonjs firebase-admin',\n 'firebase/app': 'commonjs firebase/app',\n 'firebase/firestore': 'commonjs firebase/firestore',\n 'firebase/database': 'commonjs firebase/database',\n 'firebase/storage': 'commonjs firebase/storage',\n 'flamelink/app': 'commonjs flamelink/app',\n 'flamelink/cf/content': 'commonjs flamelink/cf/content',\n 'flamelink/cf/storage': 'commonjs flamelink/cf/storage'\n }\n }\n }", "title": "" }, { "docid": "02348ab27077d2bdd83ff0574a24c39c", "score": "0.5062124", "text": "function skip () {\n outdated_( args\n , path.resolve(dir, \"node_modules\", dep)\n , has\n , cb )\n }", "title": "" }, { "docid": "3c5ab9882b4a398e73ea4a71bb854646", "score": "0.5061225", "text": "function AddReferencesForInstaller(oProj)\r\n{\r\n\tvar oProjObject = oProj.Object;\r\n\toProjObject.AddAssemblyReference(\"System.dll\");\r\n\toProjObject.AddAssemblyReference(\"System.Management.dll\");\r\n\toProjObject.AddAssemblyReference(\"System.Configuration.Install.dll\");\r\n}", "title": "" }, { "docid": "30a96946c56110ed2631420f622a26ae", "score": "0.5058632", "text": "static get requires() {\n return {\n 'Smart.Splitter': 'smart.splitter.js'\n }\n }", "title": "" }, { "docid": "af0c69e11bc531719f8650eedfeebc07", "score": "0.50571454", "text": "function modules() {\n // Bootstrap\n var bootstrap = gulp.src(['./node_modules/bootstrap/*scss/*', './node_modules/bootstrap/dist/*js/*'])\n .pipe(gulp.dest('./app/build/vendor/bootstrap'));\n // jQuery\n var jquery = gulp.src([\n './node_modules/jquery/dist/*',\n '!./node_modules/jquery/dist/core.js',\n ])\n .pipe(gulp.dest('./app/build/vendor/jquery'));\n\n var masonry = gulp.src([\n './node_modules/masonry-layout/dist/*',\n ])\n .pipe(gulp.dest('./app/build/vendor/masonry'));\n\n var owlCarousel = gulp.src([\n './node_modules/owl.carousel/dist/**/*',\n ])\n .pipe(gulp.dest('./app/build/vendor/owlcarousel'));\n\n var select2 = gulp.src([\n './node_modules/@ttskch/select2-bootstrap4-theme/dist/*',\n './node_modules/select2/dist/js/*',\n './node_modules/select2/dist/css/*',\n ])\n .pipe(gulp.dest('./app/build/vendor/select2'));\n\n var fontawesome = gulp.src([\n './node_modules/@fortawesome/fontawesome-free/*css/all.min.css',\n './node_modules/@fortawesome/fontawesome-free/*webfonts/*',\n ])\n .pipe(gulp.dest('./app/build/vendor/fontawesome'));\n\n var gsap = gulp.src([\n './node_modules/gsap/dist/*',\n ])\n .pipe(gulp.dest('./app/build/vendor/gsap'));\n\n return merge(bootstrap, jquery, masonry, owlCarousel, select2,fontawesome, gsap);\n}", "title": "" }, { "docid": "a2311779233f346669557e453aff7747", "score": "0.5047657", "text": "function installDevDependencies() {\n this.npmInstall(dependencies.devDependencies, { 'save-dev': true });\n}", "title": "" }, { "docid": "457d09d3aa9ad6a13062121fa5d1b20b", "score": "0.50328016", "text": "function cleanForIncludeOnly(project, deps, overrided) {\n // log('overrided', overrided)\n deps[project.name] = undefined;\n if (project.packageJson.data.tnp &&\n project.packageJson.data.tnp.overrided &&\n tnp_core_1._.isArray(project.packageJson.data.tnp.overrided.includeOnly) &&\n project.packageJson.data.tnp.overrided.includeOnly.length > 0) {\n var onlyAllowed_1 = project.packageJson.data.tnp.overrided.includeOnly;\n onlyAllowed_1 = onlyAllowed_1.concat(abstract_1.Project.Tnp.packageJson.data.tnp.core.dependencies.always);\n Object.keys(deps).forEach(function (depName) {\n if (!onlyAllowed_1.includes(depName)) {\n deps[depName] = undefined;\n }\n });\n return;\n }\n if (project.packageJson.data.tnp &&\n project.packageJson.data.tnp.overrided &&\n tnp_core_1._.isArray(project.packageJson.data.tnp.overrided.ignoreDepsPattern)) {\n var patterns = project.packageJson.data.tnp.overrided.ignoreDepsPattern;\n patterns.forEach(function (p) {\n Object.keys(deps).forEach(function (depName) {\n tnp_helpers_1.Helpers.log(\"check patter: \" + p + \" agains \" + depName);\n var patternRegex = (new RegExp(tnp_helpers_1.Helpers.escapeStringForRegEx(p)));\n if (patternRegex.test(depName) && !overrided[depName]) {\n deps[depName] = undefined;\n }\n });\n });\n }\n}", "title": "" }, { "docid": "fe78a17f9e3c7e4e0dfb22399145d768", "score": "0.5031689", "text": "_step1() {\n\t\tthis.emit(\"step1\");\n\t\treturn fs.readFile(this.resolve(\"package.json\"), {\n\t\t\tencoding: \"utf-8\"\n\t\t}).catch(e => {\n\t\t\tif (e.code !== \"ENOENT\" && e.code !== \"ENOTDIR\") throw e;\n\t\t}).then((src) => {\n\t\t\tlet data = src ? JSON.parse(src) : {};\n\t\t\tlet plugins = flatten([\n\t\t\t\t\"./\",\n\t\t\t\tdata.dependencies ? Object.keys(data.dependencies) : [],\n\t\t\t\tdata.devDependencies ? Object.keys(data.devDependencies) : []\n\t\t\t]);\n\n\t\t\treturn this.depend(plugins);\n\t\t});\n\t}", "title": "" }, { "docid": "ba4a1692b909fa87949cac529dc64340", "score": "0.50289756", "text": "function dependenciesVersion (shrinkwrapOne, shrinkwrapTwo, modulesToValidate) {\n var allDependenciesOne = alldeps(shrinkwrapOne);\n var allDependenciesTwo = alldeps(shrinkwrapTwo);\n\n return modulesToValidate.reduce(function (depWithDiffVer, mod) {\n var verDepFromOne = Object.keys(allDependenciesOne[mod])[0];\n var verDepFromTwo = Object.keys(allDependenciesTwo[mod])[0];\n\n if (verDepFromOne !== verDepFromTwo) {\n depWithDiffVer.push(mod);\n }\n\n return depWithDiffVer;\n }, []);\n}", "title": "" }, { "docid": "be04864d89e3aa9b54d863250710697d", "score": "0.50271225", "text": "function dependencies(pkg) {\n return Object.keys(pkg.dependencies)\n}", "title": "" }, { "docid": "3bcccfc9fb6f50fb033496da29e8b0cb", "score": "0.50265783", "text": "extend (config, ctx) {\n// config.externals={'jquery':'$'}\n }", "title": "" }, { "docid": "c120439c67395ca1a3cf817a3b04529b", "score": "0.50232995", "text": "addDependencies(mod, project) {\n\t\tmod.dependencies(project).forEach(dependency =>\n\t\t\tthis.addModule_noCatch(dependency, project)\n\t\t)\n\t}", "title": "" }, { "docid": "15f9f5b86132fdb3a1c58ece4c93ad97", "score": "0.5021683", "text": "overrideDependencies(dependencyPolicy) {\n return this.envs.override({\n getDependencies: async () => {\n const reactDeps = await this.reactEnv.getDependencies();\n return (0, _mergeDeepLeft().default)(dependencyPolicy, reactDeps);\n }\n });\n }", "title": "" }, { "docid": "d8d5685d684461f53d4f803d64067e0f", "score": "0.5021474", "text": "function onLoad() {\r\n dependencyModule = resolve(name, module.uri);\r\n if (dependencyModule.deps.length === 0) {\r\n ready(dependencyModule)\r\n } else {\r\n dependencyModule.fetch()\r\n }\r\n }", "title": "" }, { "docid": "f370e9f00557b91f108374187a774add", "score": "0.50185925", "text": "_installComponentDeps() {\n let _this = this,\n components = _this.S.state.getComponents();\n components.forEach(function(component) {\n SCli.log(`Installing ${component.runtime} dependencies for component: ${component.name}`);\n if (component.runtime === 'nodejs') {\n SUtils.npmInstall(path.join(_this.S.config.projectPath, component.name));\n } else if (component.runtime === 'python2.7') {\n SUtils.pipPrefixInstall(\n path.join(_this.S.config.projectPath, component.name, 'requirements.txt'),\n path.join(_this.S.config.projectPath, component.name, 'vendored')\n );\n }\n return BbPromise.resolve();\n\n });\n }", "title": "" }, { "docid": "68a7d513aeb80d243f2d0f851c6a2d9c", "score": "0.50156146", "text": "function addLibraries(callback) {\n var jqueryLoaded = false;\n var underscoreLoaded = false;\n var jquery = document.createElement(\"script\");\n jquery.setAttribute(\"src\", \"http://cdnjs.cloudflare.com/ajax/libs/zepto/1.0rc1/zepto.min.js\");\n jquery.addEventListener('load', function() {\n jqueryLoaded = true;\n console.log('jquery loaded');\n if (underscoreLoaded) {\n go();\n }\n }, false);\n var underscore = document.createElement(\"script\");\n underscore.setAttribute(\"src\", statsServer + \"/assets/js/underscore-min.js\");\n underscore.addEventListener('load', function() {\n underscoreLoaded = true;\n console.log('underscore loaded');\n if (jqueryLoaded) {\n go();\n }\n }, false);\n function go() {\n var script = document.createElement(\"script\");\n script.textContent = \"(\" + callback.toString() + \")();\";\n document.body.appendChild(script);\n }\n document.body.appendChild(jquery);\n document.body.appendChild(underscore);\n }", "title": "" }, { "docid": "81d648b659d595b45408453ee2507600", "score": "0.5014017", "text": "get BuildScriptsOnly() {}", "title": "" }, { "docid": "2e028156ea9f2ad0631e7955ad97ffcf", "score": "0.5013081", "text": "defineServerSide() {\n\t\tvar _this = this;\n\t\tif(Meteor.isServer) {\n\t\t\tCrawler.prototype.NPM = new Object();\n\t\t\t_this.NPM['cheerio'] = Npm.require('cheerio');\n\t\t\t_this.NPM['chalk'] = Npm.require('chalk');\n\t\t\t_this.NPM['future'] = Npm.require('fibers/future');\n\t\t}\n\t}", "title": "" }, { "docid": "1c6d79eee19ee8170c8ae163a38a13e6", "score": "0.50125283", "text": "function getAndTravelCoreDeps(options) {\n var project = abstract_1.Project.Tnp;\n if (tnp_core_1._.isUndefined(options)) {\n options = {};\n }\n var updateFn = options.updateFn, type = options.type;\n var constantTnpDeps = {};\n // if (project?.packageJson?.data?.tnp?.core?.dependencies) { // TODO QUICK FIX\n var core = project.packageJson.data.tnp.core.dependencies;\n travelObject(core.common, constantTnpDeps, void 0, updateFn);\n if (tnp_core_1._.isString(type)) {\n travelObject(core.onlyFor[type], constantTnpDeps, core.onlyFor, updateFn);\n }\n else {\n Object.keys(core.onlyFor).forEach(function (libType) {\n travelObject(core.onlyFor[libType], constantTnpDeps, void 0, updateFn);\n });\n }\n // }\n return constantTnpDeps;\n}", "title": "" }, { "docid": "f6ea5397cc618fd6fbfe05a717d09c17", "score": "0.5008342", "text": "_importOtherDependancies() {\n if (!document.getElementById(Config.WidgetStyleElmId)) {\n const style = document.createElement(\"style\");\n style.innerHTML = CSS;\n style.id = Config.WidgetStyleElmId;\n document.head.appendChild(style);\n }\n }", "title": "" }, { "docid": "a6b2183a8613b3ec3cf3374092bd82a1", "score": "0.5004411", "text": "function duplicatedDependencies (shrinkwrap, modulesToValidate) {\n shrinkwrap = shrinkwrap || require('./npm-shrinkwrap.json');\n var all = alldeps(shrinkwrap);\n\n modulesToValidate = modulesToValidate || Object.keys(all);\n\n return modulesToValidate.reduce(function (duplicatedMods, mod) {\n if (all[mod] === undefined) {\n console.error('!!! ERROR !!!');\n console.error('Trying to get all dependencies from ', mod, ' but it does not exist.');\n console.error('!!! ERROR !!!');\n }\n var modVersions = Object.keys(all[mod]);\n if (modVersions.length > 1) {\n var invalidMod = { name: mod, versions: [] };\n\n modVersions.forEach(function (modVersion) {\n invalidMod.versions.push({version: modVersion, from: all[mod][modVersion]});\n });\n duplicatedMods.push(invalidMod);\n }\n return duplicatedMods;\n }, []);\n}", "title": "" }, { "docid": "38af691309cafcc19a0506ac2e5545ed", "score": "0.49945113", "text": "function copyPlaygroundDeps() {\n const playgroundDeps = [\n './node_modules/@blockly/dev-tools/dist/index.js',\n './node_modules/@blockly/theme-modern/dist/index.js',\n './node_modules/@blockly/block-test/dist/index.js',\n ];\n return gulp.src(playgroundDeps, {base: '.'}).pipe(gulp.dest(demoStaticTmpDir));\n}", "title": "" }, { "docid": "f8ca64113ec6b8c42c5fea9734335462", "score": "0.49899983", "text": "static initialize() {\r\n this.registerPlugins(Imported);\r\n this._checkRequirements();\r\n }", "title": "" }, { "docid": "4b50ee31d065757da8e21d13d4730bcd", "score": "0.49653298", "text": "initPublishedPackages() {\n this.addonNames.forEach((name) => {\n if (!(name in this.packages)) {\n const basePath = `${this.projectRootPath}/node_modules/${name}`;\n const packageJson = `${basePath}/package.json`;\n const pkg = require(packageJson);\n const main = pkg.main || 'src/index.js';\n const modulePath = path.dirname(require.resolve(`${basePath}/${main}`));\n this.packages[name] = {\n name,\n isAddon: true,\n modulePath,\n packageJson,\n };\n }\n });\n }", "title": "" }, { "docid": "3e7d3bfe92296a03604b07c45a87f6f6", "score": "0.49547568", "text": "function installDependencies(conf) {\r\n var deps = conf.dependencies;\r\n // install each dependent\r\n Object.keys(deps).forEach(function (dep) {\r\n var version = deps[dep];\r\n version = (version == '*') ? 'master' : version;\r\n if (!exists(path.join(comps, repoDir(dep)))) {\r\n install(conf, dep, version);\r\n }\r\n });\r\n}", "title": "" }, { "docid": "a40b546dfe4a577e03bdcfd84f9ef5c9", "score": "0.49529713", "text": "async __initializeNonCrpResources() {\n if (!this.__loaded) {\n import('./blog-lazy-load.js').then(async () => {\n this.__loadServiceWorker();\n BlogPwa.__loadAnalytics();\n this.__loaded = true;\n });\n }\n }", "title": "" }, { "docid": "88cb3d2d0dab2d1c49e921955619d5f7", "score": "0.49458086", "text": "function dependsOn(mod) {\n mod = getModule(mod);\n return mod.dependsOn;\n}", "title": "" }, { "docid": "dbf2e5e95f29e794076c58f816130e8f", "score": "0.4934418", "text": "install() {\n }", "title": "" }, { "docid": "51772527765c99956ba4e90162507a2f", "score": "0.4933078", "text": "function dependenciesFromGlobalMetadata(type,outputCtx,reflector){var e_1,_a;// Use the `CompileReflector` to look up references to some well-known Angular types. These will\n// be compared with the token to statically determine whether the token has significance to\n// Angular, and set the correct `R3ResolvedDependencyType` as a result.\nvar elementRef=reflector.resolveExternalReference(Identifiers.ElementRef);var templateRef=reflector.resolveExternalReference(Identifiers.TemplateRef);var viewContainerRef=reflector.resolveExternalReference(Identifiers.ViewContainerRef);var injectorRef=reflector.resolveExternalReference(Identifiers.Injector);// Iterate through the type's DI dependencies and produce `R3DependencyMetadata` for each of them.\nvar deps=[];try{for(var _b=__values(type.diDeps),_c=_b.next();!_c.done;_c=_b.next()){var dependency=_c.value;if(dependency.token){var tokenRef=tokenReference(dependency.token);var resolved=R3ResolvedDependencyType.Token;if(tokenRef===elementRef){resolved=R3ResolvedDependencyType.ElementRef;}else if(tokenRef===templateRef){resolved=R3ResolvedDependencyType.TemplateRef;}else if(tokenRef===viewContainerRef){resolved=R3ResolvedDependencyType.ViewContainerRef;}else if(tokenRef===injectorRef){resolved=R3ResolvedDependencyType.Injector;}else if(dependency.isAttribute){resolved=R3ResolvedDependencyType.Attribute;}// In the case of most dependencies, the token will be a reference to a type. Sometimes,\n// however, it can be a string, in the case of older Angular code or @Attribute injection.\nvar token=tokenRef instanceof StaticSymbol?outputCtx.importExpr(tokenRef):literal(tokenRef);// Construct the dependency.\ndeps.push({token:token,resolved:resolved,host:!!dependency.isHost,optional:!!dependency.isOptional,self:!!dependency.isSelf,skipSelf:!!dependency.isSkipSelf});}else{unsupported('dependency without a token');}}}catch(e_1_1){e_1={error:e_1_1};}finally{try{if(_c&&!_c.done&&(_a=_b.return))_a.call(_b);}finally{if(e_1)throw e_1.error;}}return deps;}", "title": "" }, { "docid": "83615499a944fe8f123636431af4f22a", "score": "0.4928392", "text": "function dependenciesFromGlobalMetadata(type,outputCtx,reflector){// Use the `CompileReflector` to look up references to some well-known Angular types. These will\n// be compared with the token to statically determine whether the token has significance to\n// Angular, and set the correct `R3ResolvedDependencyType` as a result.\nconst elementRef=reflector.resolveExternalReference(Identifiers.ElementRef);const templateRef=reflector.resolveExternalReference(Identifiers.TemplateRef);const viewContainerRef=reflector.resolveExternalReference(Identifiers.ViewContainerRef);const injectorRef=reflector.resolveExternalReference(Identifiers.Injector);// Iterate through the type's DI dependencies and produce `R3DependencyMetadata` for each of them.\nconst deps=[];for(let dependency of type.diDeps){if(dependency.token){const tokenRef=tokenReference(dependency.token);let resolved=R3ResolvedDependencyType.Token;if(tokenRef===elementRef){resolved=R3ResolvedDependencyType.ElementRef;}else if(tokenRef===templateRef){resolved=R3ResolvedDependencyType.TemplateRef;}else if(tokenRef===viewContainerRef){resolved=R3ResolvedDependencyType.ViewContainerRef;}else if(tokenRef===injectorRef){resolved=R3ResolvedDependencyType.Injector;}else if(dependency.isAttribute){resolved=R3ResolvedDependencyType.Attribute;}// In the case of most dependencies, the token will be a reference to a type. Sometimes,\n// however, it can be a string, in the case of older Angular code or @Attribute injection.\nconst token=tokenRef instanceof StaticSymbol?outputCtx.importExpr(tokenRef):literal(tokenRef);// Construct the dependency.\ndeps.push({token,resolved,host:!!dependency.isHost,optional:!!dependency.isOptional,self:!!dependency.isSelf,skipSelf:!!dependency.isSkipSelf});}else{unsupported('dependency without a token');}}return deps;}", "title": "" }, { "docid": "d0d3d3a069b4a075e6dfa953006f2044", "score": "0.49096727", "text": "function initRequires() {\n logger = logger || require(rootPrefix + '/lib/logger/custom_console_logger');\n moUtils = moUtils || require(rootPrefix + '/module_overrides/common/utils');\n SignRawTx = SignRawTx || require(rootPrefix + '/module_overrides/common/sign_raw_tx');\n}", "title": "" }, { "docid": "8dc1d7a6e305752eb76a0cc568158064", "score": "0.4905933", "text": "function ensureDependenciesPresent() {\n\t _ensureMocha();\n\t _checkChai();\n\t}", "title": "" }, { "docid": "87e52b3a7b676c2db766a151597ec8c4", "score": "0.4905354", "text": "function validateDependencies() {\n\n for(var id in plugins) {\n\n var plugin = plugins[id];\n\n // Check each plugin method.\n utils.PLUGIN_METHODS.forEach(function(method) {\n\n if (method in plugin.methods) {\n\n var params = plugin.methods[method];\n\n var absentParams = params.filter(function(param) {\n // TODO: move to config.\n\n if (DEFAULT_PARAMS.indexOf(param) > -1) {\n return false;\n } else if (method === 'prepareLink' && POST_PLUGIN_DEFAULT_PARAMS.indexOf(param) > -1) {\n return false;\n }\n return !(param in providedParamsDict);\n });\n\n if (absentParams.length > 0) {\n console.warn('No matching getData for params: \"' + absentParams.join(', ') + '\" in plugin \"' + id + '\"');\n }\n }\n });\n }\n }", "title": "" }, { "docid": "7fe1749ebb7ed6fd0c21c6e9070d9cd4", "score": "0.49051112", "text": "function checkDependencies(dependencies) {\n\n\t\tdependencies = JSON.parse(dependencies);\n\t\tif(!dependencies || !Array.isArray(dependencies)) return false;\n\n\t\tvar len = dependencies.length,\n\t\t\tprevVal,\n\t\t\tpassed,\n\t\t\tcheck,\n\t\t\tvalue,\n\t\t\tpath,\n\t\t\tleg,\n\t\t\tkey,\n\t\t\tj;\n\n\t\tfor(var i = 0; i < len; i++) {\n\n\t\t\tcheck = dependencies[i];\n\t\t\tif(!HelpGuide.verifyObject(check)) {\n\n\t\t\t\t// do special stuff like show add layer menu, etc.\n\t\t\t\tprevVal = activateHints(dependencies[i]);\n\n\t\t\t}\n\t\t\t// check dependent options\n\t\t\telse {\n\n\t\t\t\t// a dependency can have its own dependency\n\t\t\t\t// for cases when one of the dependencies is a wildcard\n\t\t\t\tif(check.dependency && check.dependency !== prevVal) continue;\n\n\t\t\t\tpath = check.path.split('.');\n\t\t\t\tvalue = RVS.SLIDER;\n\t\t\t\tleg = path.length;\n\t\t\t\tpassed = false;\n\n\n\t\t\t\t// get the revbuilder value\n\t\t\t\tfor(j = 0; j < leg; j++) {\n\n\t\t\t\t\tkey = sanitizeKey(path[j]);\n\n\n\t\t\t\t\tif(!value.hasOwnProperty(key)) return true;\n\t\t\t\t\tvalue = value[key];\n\n\t\t\t\t}\n\n\t\t\t\tvalue = checkBoolean(value);\n\t\t\t\tprevVal = value;\n\n\t\t\t\tif(typeof check.value === 'string' && check.value.search('::') !== -1) {\n\n\t\t\t\t\tvar vals = check.value.split('::');\n\t\t\t\t\tleg = vals.length;\n\n\t\t\t\t\tfor(j = 0; j < leg; j++) {\n\n\t\t\t\t\t\tif(vals[j] === value) {\n\n\t\t\t\t\t\t\tpassed = true;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse {\n\n\t\t\t\t\tif(check.value === value) passed = true;\n\n\n\t\t\t\t}\n\n\t\t\t\tif(!passed) {\n\n\t\t\t\t\t// dependency failed, highlight the dependent option\n\t\t\t\t\tif(check.target) wildcard = \"[value='\" + check.target + \"']\";\n\n\t\t\t\t\t// jQuery('#revhelp_' + check.option).click();\n\t\t\t\t\tonOptionClick.call(HelpGuide.allHelpPaths.find('#revhelp_' + check.option));\n\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "title": "" }, { "docid": "2fa9b16ca15966cde7bdd1732a56f1b4", "score": "0.49002862", "text": "function _default(loader, files) {\n files.forEach(file => loader.addDependency(file));\n}", "title": "" }, { "docid": "b4d63fe46e3fa838ca865406f039c520", "score": "0.48885325", "text": "postInstall() {\n }", "title": "" }, { "docid": "bcace3928494bad9bf2807136a96a1f5", "score": "0.48852152", "text": "promiseForDeps (dependencyURIs, load) {\n this.console.log(` checking dependencies (${dependencyURIs.length})...`)\n return load(dependencyURIs)\n .then(p => (this.console.log(` ${dependencyURIs.length} dependencies loaded.`), p))\n }", "title": "" }, { "docid": "8ee13479bbc8a7a9747a6cb62de6acbd", "score": "0.48841977", "text": "function requireRemaining() {\n // Setup PrefixFree\n require(['lib/prefixfree/prefixfree.js']);\n\n // Setup KaTeX\n require(['https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.8.3/katex.min.js', 'lib/katex/autoload.js'], function(_katex, renderMathInElement) {\n // HACK: Set katex to _katex to define katex\n katex = _katex;\n renderMathInElement(document.body, { delimiters: [\n {left: \"$$\", right: \"$$\", display: true},\n {left: \"$\", right: \"$\", display: false}\n ]});\n });\n\n // Setup Highlight.js\n require(['https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js'], function(hljs) {\n hljs.initHighlighting();\n });\n\n // Setup Hypothesis\n require(['https://hypothes.is/embed.js']);\n}", "title": "" }, { "docid": "76453c0cb4ba0ccc26badb82e6e83b8c", "score": "0.488074", "text": "function processDependencies(_dependencies) {\n const dependencies = extractFragmentSpecs(_dependencies)\n return dependencies.reduce((acc, component) => {\n // Add the main fragment if one is provided\n if (component.fragment) {\n acc.push(component.fragment)\n }\n\n // Recursively iterate through dependencies and collect all fragments\n if (component.dependencies) {\n acc.push(...processDependencies(component.dependencies))\n }\n\n // Dedupe the array before returning\n return [...new Set(acc)]\n }, [])\n}", "title": "" }, { "docid": "043c6a7aa4cfc0492600daa8862c90a6", "score": "0.48783037", "text": "function markDependants() {\n $.each(function(i, item) {\n $.each(item.deps, function(i, mod) {\n if (!namedRunners.hasOwnProperty(mod)) {\n throw new Error('Can\\'t find depended runner: ' + mod);\n }\n namedRunners[mod].dependants.push(item);\n });\n });\n}", "title": "" }, { "docid": "83fae8b699ef9c8ba668c32a68af52a0", "score": "0.48782253", "text": "function addStrongDependencies(dependency) {\n\t\t\t\tif (stronglyDependsOn[module.id][dependency.id]) return;\n\n\t\t\t\tstronglyDependsOn[module.id][dependency.id] = true;\n\t\t\t\tstrongDeps[dependency.id].forEach(addStrongDependencies);\n\t\t\t}", "title": "" } ]
2f7aedc7e750d89b7fe12d23d97a5de8
Draw my Object Components
[ { "docid": "628ed5c0f2b3dcbd4090b2c1c28e269a", "score": "0.0", "text": "function chargeWallpaper() {\n fondo.cargaOK = true;\n draw();\n}", "title": "" } ]
[ { "docid": "8663cf792a9293d9f7c18ae3376f7443", "score": "0.77050555", "text": "function drawComponents(){\n\t\taddBackground();\n\t\trenderClazzes(clazzes,0, \"node\");\n\t\taddInterfaces();\n\t\taddPackageMarker(clazzes);\n\t}", "title": "" }, { "docid": "6bbe9ad1b5a943e6cc13238a1f9ecc61", "score": "0.7131351", "text": "function drawObjects() {\n let objectColor = color(150, 155, 100);\n let objectBorderColor = color(255, 255, 0);\n fill(objectColor);\n stroke(objectBorderColor);\n strokeWeight(1);\n\n for(i = 0; i < objects.length; ++i) {\n let o = objects[i];\n beginShape(TRIANGLES);\n for(j = 0; j < o.vertices.length; ++j) {\n let v = o.vertices[j];\n vertex(v.x, v.y);\n }\n endShape(CLOSE);\n }\n}", "title": "" }, { "docid": "1b1a88ddd2abcdef2fbd006191260994", "score": "0.7046344", "text": "function drawObjects() {\n\t\t// Y - Axis\n\t\tglnv.mvPushMatrix();\n\t\tglnv.putArrow(prg,\n\t\t\tprg.arrows[\"red\"][\"v\"], prg.arrows[\"red\"][\"n\"], \n\t\t\tprg.arrows[\"red\"][\"c\"], prg.arrows[\"red\"][\"i\"], prg.attLocation, prg.attStride);\n\t\tglnv.mvPopMatrix();\n\n\t\t// Z - Axis\n\t\tglnv.mvPushMatrix();\n\t\tm.rotate(glnv.mMatrix, glnv.degToRad(90), [1, 0, 0], glnv.mMatrix);\n\t\tglnv.putArrow(prg,\n\t\t\tprg.arrows[\"green\"][\"v\"], prg.arrows[\"green\"][\"n\"], \n\t\t\tprg.arrows[\"green\"][\"c\"], prg.arrows[\"green\"][\"i\"], prg.attLocation, prg.attStride);\n\t\tglnv.mvPopMatrix();\n\n\t\t// rotate arrow\n\t\tif (g.rinfo['rot'] != undefined) {\n\t\tglnv.mvPushMatrix();\n\t\tfor (var i = 0; i< g.rinfo['rot'].length; i++) \n\t\t\tm.rotate(glnv.mMatrix, glnv.degToRad(g.rinfo['rot'][i][0]), \n\t\t\t\t[g.rinfo['rot'][i][1], g.rinfo['rot'][i][2], g.rinfo['rot'][i][3]], glnv.mMatrix);\n\t\tm.rotate(glnv.mMatrix, glnv.degToRad(-90), [0, 0, 1], glnv.mMatrix);\n\t\tm.scale(glnv.mMatrix, [0.5, 1.5, 0.5], glnv.mMatrix);\n\t\tglnv.putArrow(prg,\n\t\t\tprg.arrows[\"green\"][\"v\"], prg.arrows[\"green\"][\"n\"], \n\t\t\tprg.arrows[\"green\"][\"c\"], prg.arrows[\"green\"][\"i\"], prg.attLocation, prg.attStride);\n\t\tglnv.mvPopMatrix();\n\t\t}\n\n\t\t// X - Axis\n\t\tglnv.drawFlows(prg, undefined, g.drawinfo_flows, arrow_default_pos, arrow_delta);\n\t}", "title": "" }, { "docid": "1780535bfce5a7216840cde953f88cb1", "score": "0.7042177", "text": "function render() {\n Dibujante.canvas.getContext('2d').fillStyle = '#f9fafc';\n Dibujante.canvas.getContext('2d').fillRect(0, 0, Dibujante.canvas.width, Dibujante.canvas.height);\n Dibujante.canvas.getContext('2d').fillStyle = COLOR;\n\n //Renderizar objetos\n }", "title": "" }, { "docid": "453444a856417d49c892d0f86f92d453", "score": "0.70344067", "text": "function drawobject(obj){\n\t\t\tswitch(obj.type){\n\t\t\t\tcase 'line' : { drawline(obj.startpoint,obj.endpoint); break; }\n\t\t\t\tcase 'rectangle' : { drawrectangle(obj.startpoint,obj.endpoint); break; }\n\t\t\t\tcase 'freeline' : { drawfreeline(obj); break; }\n\t\t\t\tcase 'circle' : { drawcircle(obj.center,obj.r); break;}\n\n\t\t\t\tdefault : break;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "ea8f2bc257921d0df945ee8d623c5fc3", "score": "0.69016576", "text": "function drawObjects() {\n\n\t\t// Draw Lines\n\t\t$.each(g.sdn_objs, function(k,v) {\n\t\t\tif (k == 'linkList') {\n\t\t\t\t$.each(v, function(key,val) {\n\t\t\t\t\tdrawCylinders(val['src'], val['dst'], val['rot'], val['color']); });\n\t\t\t} else { }\n\t\t});\n\n\t\tif (g.other_objs[\"links\"] != undefined) {\n\t\t\tfor (var i=0; i<g.other_objs[\"links\"].length; i++) {\n\t\t\t\tvar objinfo = g.other_objs[\"links\"][i];\n\t\t\t\tdrawCylinders(objinfo['src'], objinfo['dst'], \n\t\t\t\t\tobjinfo['rot'], objinfo['color']);\n\t\t\t}\n\t\t}\n\n\t\t// change shader program\n\t\tgl.useProgram(texprg);\n\n\t\tvar result_intersect = {tmin: 1.0e30, touch_flag: -1};\n\n\t\t// Draw Objcts\n\t\tvar addedObj = {};\n\t\t$.each(g.sdn_objs, function(k,v) {\n\t\t\tif (k == 'objList') {\n\t\t\t$.each(v, function(key,val) {\n\t\t\t\t// 同じ名前のObjectは登録しない\n\t\t\t\tif (val['name'] != 'unknown') {\n\t\t\t\t\tif (addedObj[val['name']] == undefined) {\n\t\t\t\t\t\taddedObj[val['name']] = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tglnv.mvPushMatrix();\n\t\t\t\t// Switch\n\t\t\t\tif (val['texture'] == 1) {\n\t \t\t\tm.translate(glnv.mMatrix, val['pos'], glnv.mMatrix);\n\t\t\t\t\tglnv.mvPushMatrix();\n\t\t\t\t\tm.scale(glnv.mMatrix, [1.0, 1.1, 1.0], glnv.mMatrix);\n\t \t\t\tm.rotate(glnv.mMatrix, glnv.degToRad(g.switch_rotate_param*10), \n\t\t\t\t\t\t[0, 1, 0], glnv.mMatrix);\n\t\t\t\t\tdrawCube(1, 0.0);\n\t\t\t\t\tif (g.drawObjLabelsFlag) \n\t\t\t\t\t\tglnv.putStr(texprg, val['name'], 0.15, [0.0, 0.38, 0.0], 0.52, \"green\");\n\t\t\t\t\tglnv.mvPopMatrix();\n\t\t\t\t// Controller\n\t\t\t\t} else if (val['texture']==0) {\n\t \t\t m.translate(glnv.mMatrix, val['pos'], glnv.mMatrix);\n\t\t\t\t\tglnv.mvPushMatrix();\n\t\t\t\t\tm.scale(glnv.mMatrix, [1.2, 1.6, 1.2], glnv.mMatrix);\n\t \t\t\tm.rotate(glnv.mMatrix, glnv.degToRad(g.controller_rotate_param*10), \n\t\t\t\t\t\t[0, 1, 0], glnv.mMatrix);\n\t\t\t\t\tdrawCube(0, 0.0);\n\t\t\t\t\tif (g.drawObjLabelsFlag) \n\t\t\t\t\t\tglnv.putStr(texprg, val['name'], 0.15, [0.0, 0.35, 0.0], 0.52, \"green\");\n\t\t\t\t\tglnv.mvPopMatrix();\n\t\t\t\t// Host\n\t\t\t\t} else if (val['texture']==2) {\n\t \t\t m.translate(glnv.mMatrix, val['origin'], glnv.mMatrix);\n\t \t\t m.translate(glnv.mMatrix, val['pos'], glnv.mMatrix);\n\t\t\t\t\tglnv.mvPushMatrix();\n\t\t\t\t\tm.scale(glnv.mMatrix, [0.6, 0.6, 0.6], glnv.mMatrix);\n\t \t\t\tm.rotate(glnv.mMatrix, glnv.degToRad(g.host_rotate_param*10), \n\t\t\t\t\t\t[0, 1, 0], glnv.mMatrix);\n\t\t\t\t\tdrawCube(2, 90.0);\n\t\t\t\t\tif (g.drawObjLabelsFlag) \n\t\t\t\t\t\tglnv.putStr(texprg, val['name'], 0.15, [0.0, 0.95, 0.0], 0.52, \"green\");\n\t\t\t\t\tglnv.mvPopMatrix();\n\t\t\t\t// Others\n\t\t\t\t} else {\n\t\t\t\t}\n\t\t\t\tif (g.check_intersect == 1) \n\t\t\t\t\tresult_intersect = glnv.intersect(key, result_intersect);\n\t\t\t\tglnv.mvPopMatrix();\n\t\t\t});\n\t\t} else {\n\t\t}\n\t\t});\n\n\t\tif (g.other_objs[\"objs\"] != undefined) {\n\t\tfor (var i=0; i<g.other_objs[\"objs\"].length; i++) {\n\t\t\tvar objinfo = g.other_objs[\"objs\"][i];\n\t\t\tglnv.mvPushMatrix();\n\t\t\tif (objinfo['origin'] != undefined) {\n\t\t\t\tm.translate(glnv.mMatrix, objinfo['origin'], glnv.mMatrix);\n\t\t\t} else {\n\t\t\t\tm.translate(glnv.mMatrix, [0.0, 0.0, 0.0], glnv.mMatrix);\n\t\t\t}\n\t\t\tm.translate(glnv.mMatrix, objinfo['pos'], glnv.mMatrix);\n\t\t\tm.scale(glnv.mMatrix, objinfo['scale'], glnv.mMatrix);\n\t\t\tm.rotate(glnv.mMatrix, glnv.degToRad(g.switch_rotate_param*10), \n\t\t\t\t[0, 1, 0], glnv.mMatrix);\n\t\t\tdrawCube(objinfo['texture_id'], 0.0);\n\t\t\tglnv.mvPopMatrix();\n\t\t}\n\t\t}\n\n\t\tif (g.check_intersect == 1) { \n\t\t\tg.check_intersect = 0;\n\t\t\tif (result_intersect.touch_flag != -1) {\n\t\t\t\t$(\"#objinfo\").text(\"Device Infomation: \");\n\t\t\t\t// common\n\t\t\t\tvar key = result_intersect.touch_flag;\n\t\t\t\tg.selected_obj = key;\n\t\t\t\t$(\"#objinfo\").append(\"<br>obj id :&nbsp;&nbsp;\"\t+ key);\n\t\t\t\t$(\"#objinfo\").append(\"<br>name :&nbsp;&nbsp;\"\t+ \n\t\t\t\t\tg.sdn_objs['objList'][key]['name']);\n\t\t\t\t// Host or Gateway\n\t\t\t\tif (g.sdn_objs['objList'][key]['texture']==2) {\n\t\t\t\t$(\"#objinfo\").append(\"<br>ip addr :&nbsp;&nbsp;\" + \n\t\t\t\t\tg.sdn_objs['objList'][key]['otherinfo']['ipaddr']);\n\t\t\t\t$(\"#objinfo\").append(\"<br>hw addr :&nbsp;&nbsp;\" + \n\t\t\t\t\tg.sdn_objs['objList'][key]['otherinfo']['hwaddr']);\n\t\t\t\t$(\"#objinfo\").append(\"<br>swdpid :&nbsp;&nbsp;\" + \n\t\t\t\t\tg.sdn_objs['objList'][key]['otherinfo']['swdpid']);\n\t\t\t\t$(\"#objinfo\").append(\"<br>swport :&nbsp;&nbsp;\" + \n\t\t\t\t\tg.sdn_objs['objList'][key]['otherinfo']['swport']);\n\t\t\t\t}\n\t\t\t\t// Switch\n\t\t\t\tif ('dpid' in g.sdn_objs['objList'][key]['otherinfo']) \n\t\t\t\t\t$(\"#objinfo\").append(\"<br>dpid :&nbsp;&nbsp;\" + \n\t\t\t\t\tg.sdn_objs['objList'][key]['otherinfo']['dpid']);\n\t\t\t\tfor (var i=0; i<3; i++) {\n\t\t\t\t\tg.intersect_pos[i] = \n\t\t\t\t\t\t-g.sdn_objs['objList'][key]['origin'][i]\n\t\t\t\t\t\t-g.sdn_objs['objList'][key]['pos'][i];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tg.selected_obj = -1;\n\t\t\t}\n\t\t\tg.intersect_index = result_intersect.touch_flag;\n\t\t}\n\n\t\tif (g.intersect_index != -1) drawIntersectObject();\n\n\t\tgl.useProgram(prg);\n\t\tif (g.drawFlowLabelsFlag) {\n\t\tglnv.drawFlows(prg, texprg, g.drawinfo_gwflows, g.arrow_default_pos, g.arrow_delta);\n\t\tglnv.drawFlows(prg, texprg, g.drawinfo_flows, g.arrow_default_pos, g.arrow_delta);\n\t\t} else {\n\t\tglnv.drawFlows(prg, undefined, g.drawinfo_gwflows, g.arrow_default_pos, g.arrow_delta);\n\t\tglnv.drawFlows(prg, undefined, g.drawinfo_flows, g.arrow_default_pos, g.arrow_delta);\n\t\t}\n\t}", "title": "" }, { "docid": "b93740654b428d919c8aea934ab893b8", "score": "0.68865454", "text": "function drawObjects() {\n house.draw(); // Draw house\n \n // Draw lines\n for(let i = 0; i < lines.length; i++) {\n lines[i].draw();\n }\n \n // Draw balls\n for(let i = 0; i < balls.length; i++) {\n balls[i].draw();\n }\n} // End of drawObjects", "title": "" }, { "docid": "fd1ba20566c4dd2d0efe04d59e6e28a4", "score": "0.6865642", "text": "create_object_view(){\n\n if(Config.log) console.log(\"Drawn \", this.object_to_draw.length, \" object.\");\n for(let i = 0; i < this.object_to_draw.length; i++){\n\n const object = this.object_to_draw[i];\n if( !object.drawable ) continue;\n this.environment.mesh.add(object.mesh);\n\n\n }\n\n this.object_to_draw = [];\n\n }", "title": "" }, { "docid": "9e8deb5e4ed6f9f3f408ea602c2a8f76", "score": "0.68195087", "text": "draw() {\n const drawer = this[DRAWER] || (this[DRAWER] = new Draw(this[CONTAINER]));\n // draw under layers first\n // IDEA: add some optimization options here for purely static layers\n // we shouldn't need to re-draw every item individually if they\n // haven't changed at all\n drawer.removeCanvases(this[ROOMS].length * 2);\n for(let i = this[ROOMS].length - 1; i >= 0; --i) {\n drawer.view(this[VIEWS][i]);\n for(let obj of this[OBJECTS][i]) {\n obj instanceof Drawable && obj.draw(drawer.object(obj));\n }\n this[ROOMS][i] && this[ROOMS][i].draw(drawer);\n drawer.render(i);\n // draw GUI\n drawer.view(new Rectangle(0, 0, ...this.size));\n for(let obj of this[OBJECTS][i]) {\n obj instanceof Drawable && obj.drawGUI(drawer.object(obj));\n }\n this[ROOMS][i] && this[ROOMS][i].drawGUI(drawer);\n drawer.render(this[ROOMS].length + i);\n }\n }", "title": "" }, { "docid": "069dc245b8c443f0f40a6b9c5f8117f2", "score": "0.67956936", "text": "function drawObjects()\n\t{\n\t\t// Get the objects to prepare for drawing.\n\t\t_this.gameObjectHandler.drawAll(_this.isTransitioning(), _this.imageLoader, _this.renderer, GameEngineConstants.showHitBoxes);\n\t\t\n\t\tcurrentGameStateMethod();\n\t\t\n\t\t_this.renderer.drawFullQueue(_this.imageLoader);\n\t}", "title": "" }, { "docid": "bb17ccce9769a0217bfb92137d741cc9", "score": "0.67865074", "text": "function drawObjects() {\n // Draw and update balls\n for (var i = 0; i < nBalls; i++) balls[i].draw();\n for (var j = 0; j < nBalls; j++) balls[j].update();\n for (var k = 0; k < nBalls; k++) balls[k].bounce();\n\n //Draw and update squares\n for (var l = 0; l < squares.length; l++) squares[l].draw();\n for (var m = 0; m < squares.length; m++) squares[m].update();\n for (var n = 0; n < squares.length; n++) squares[n].bounce();\n\n //Draw and update probiotic triangle\n tri.draw();\n tri.update();\n\n //Draw and update wiggly worm joints\n for (var o = 0; o < nJoints; o++) joints[o].draw();\n\n // Recenter first joint at the mouse\n joints[0].update(mouseX, mouseY);\n\n // Recenter each following joint at preceding joint\n for (var p = 1; p < nJoints; p++)\n joints[p].update(joints[p - 1].x, joints[p - 1].y);\n}", "title": "" }, { "docid": "f5a0cf0750b2e7a20c82726caba1f2e4", "score": "0.67852795", "text": "function render() {\n\t\tgame.context.globalAlpha = 1.0;\n\n\t\t// Render polys\n\t\tif (scene.polys.length > 0) {\n\t\t\tscene.polys.forEach(function(poly) {\n\t\t\t\tvar polyStyle;\n\t\t\t\tif (poly.selected)\n\t\t\t\t\t polyStyle = { outlineColor: '#dd2', helperColor: '#dd4', closeOutline: true };\n\t\t\t\t else if (mode == MODE_EDIT)\n\t\t\t\t\t polyStyle = { outlineColor: '#d2d', helperColor: '#d4d', closeOutline: true };\n\t\t\t\telse\n\t\t\t\t\tpolyStyle = { outlineColor: '#22d', helperColor: '#44d', closeOutline: true };\n\n\t\t\t\tdrawPoly(poly.points, polyStyle);\n\t\t\t});\n\t\t}\n\n\t\t// Render Edit-Poly\n\t\tif (curPoly.points.length > 0)\n\t\t\tdrawPoly(curPoly.points, { outlineColor: '#f00', helperColor: '#f00', closeOutline: false });\n\n\t\t// Render selected Object helper\n\t\tvar ctx = game.context;\n\t\tif (selectedObject != null) {\n\t\t\tvar body = selectedObject.sprite.body;\n\t\t\tvar sprite = selectedObject.sprite;\n\n\t\t\tctx.save();\n\t\t\tctx.translate(body.x, body.y);\n\t\t\tctx.rotate(body.angle * Math.PI/180);\n\n\t\t\t// draw OBB\n\t\t\tctx.strokeStyle = \"#f33\";\n\t\t\tctx.lineWidth = 2;\n\t\t\tctx.strokeRect(-sprite.width * 0.5, -sprite.height * 0.5, sprite.width, sprite.height);\n\n\t\t\t// draw rotation drag point\n\t\t\tctx.fillStyle = (rotatePointHovered ? \"#66f\" : \"#00f\");\n\t\t\tdrawDragpoint(0, -sprite.height * 0.5);\n\n\t\t\t// draw scale drag box\n\t\t\tctx.fillStyle = (scalePointHovered ? \"#afa\" : \"#0f0\");\n\t\t\tdrawDragpoint(sprite.width * 0.5, sprite.height * 0.5);\n\n\t\t\tgame.debug.text(\"angle = \" + body.angle, 10, 30);\n\n\t\t\tctx.restore();\n\t\t}\n\n\n\t\tgame.debug.text(\"mode = \" + getModeName(mode), 10, 15);\n\t}", "title": "" }, { "docid": "c024f950238d67a344aea0bc4a518d77", "score": "0.6781634", "text": "function render(){\n\t// Draw methods\n}", "title": "" }, { "docid": "5514bc0d13449f1160b4b80145a19a31", "score": "0.6775694", "text": "draw() {\n let xOffset = this.bob.getNextX();\n\n this.drawBody(xOffset);\n this.drawHead(xOffset);\n this.drawFace(xOffset);\n this.drawCrown(xOffset);\n this.drawMoustache(xOffset);\n }", "title": "" }, { "docid": "9acc518ed1ed25965c0b0b356b051cdb", "score": "0.6722491", "text": "render() {\n // Render dot\n fill(this.strength);\n noStroke();\n ellipse(this.x, this.y, this.size, this.size);\n\n // Render lines\n noFill();\n stroke(this.strength, 0.5);\n for (let i = 1; i <= 3; i++) {\n const nextEntity = this.getNext(i);\n line(this.x, this.y, nextEntity.x, nextEntity.y);\n }\n }", "title": "" }, { "docid": "d457bb1355f0bc6cb266a797a98a1cb5", "score": "0.6695041", "text": "function drawObjects() {\n objects.forEach(collection => {\n collection.forEach(element => {\n element.draw();\n });\n })\n}", "title": "" }, { "docid": "618baef550ac2fd1472861cc7017996d", "score": "0.6682623", "text": "function draw(ctx, obj) {\n ctx.fillStyle = obj.color\n ctx.fillRect(obj.x, obj.y, obj.width, obj.height)\n}", "title": "" }, { "docid": "683082022a01e5c6d3bfa92dd7f10e47", "score": "0.66776824", "text": "display(){\r\n ctx.beginPath();\r\n ctx.moveTo(this.x, this.y);\r\n ctx.lineTo(this.x + this.acc_x*100, this.y + this.acc_y*100);\r\n ctx.strokeStyle = \"green\";\r\n ctx.stroke();\r\n ctx.closePath();\r\n ctx.beginPath();\r\n ctx.moveTo(this.x, this.y);\r\n ctx.lineTo(this.x + this.vel_x*10, this.y + this.vel_y*10);\r\n ctx.strokeStyle = \"blue\";\r\n ctx.stroke();\r\n ctx.closePath();\r\n }", "title": "" }, { "docid": "96abfc30267516e161bdc6cbd889d887", "score": "0.66700864", "text": "draw(){\n //take away the border using stroke\n noStroke()\n fill('rgba(246, 36, 89, 0.5)')\n circle(this.pos.x, this.pos.y, this.size);\n }", "title": "" }, { "docid": "19c4f547006b76cf26698dfb55b9766c", "score": "0.664728", "text": "draw() {\n // this calls PNGRoom.draw()\n super.draw();\n\n }", "title": "" }, { "docid": "25bc1ab3c96c433866c5d5ea31b1c78b", "score": "0.66291463", "text": "async draw() {\r\n try {\r\n await super.removeChildren().forEach((c) => c.destroy({ children: true }));\r\n await super.draw();\r\n this.objects = this.addChild(new PIXI.Container());\r\n\r\n let objectData = canvas.scene.getFlag(TP.MODULENAME, \"routes\");;\r\n for (let data of objectData) {\r\n let obj = await this.drawObject(data);\r\n this.objects.addChild(obj.drawing);\r\n }\r\n } catch (error) { }\r\n }", "title": "" }, { "docid": "19e0a8933ede99714d4b54b6a534eef1", "score": "0.66232765", "text": "render() {\n this._renderObjects();\n }", "title": "" }, { "docid": "71cac4d0c5e71e95ee030e2c90a7b171", "score": "0.6575689", "text": "draw() {\n const { ctx } = this.world;\n const x0 = this.position.x - this.world.axis.position.x;\n const y0 = this.position.y - this.world.axis.position.y;\n ctx.beginPath();\n ctx.lineWidth = 3;\n ctx.fillStyle = this.color.BACKGROUND;\n ctx.strokeStyle = this.color.BORDER;\n ctx.rect(x0, y0, this.width, this.height);\n ctx.stroke();\n ctx.fill();\n ctx.closePath();\n ctx.lineWidth = 1;\n if (this.debug) {\n ctx.beginPath();\n ctx.strokeStyle = constants.COLORS.RED;\n ctx.rect(\n x0 + this.padding.left,\n y0 + this.padding.top,\n this.width - this.padding.left - this.padding.right,\n this.height - this.padding.top - this.padding.bottom\n );\n ctx.stroke();\n ctx.closePath();\n }\n if (this.title !== \"\") {\n ctx.beginPath();\n this.font.toCtx(ctx);\n ctx.fillText(this.title, x0 + this.width / 2, y0 + this.padding.top);\n ctx.closePath();\n }\n for (let i = 0; i < this.elements.length; i++) {\n ctx.save();\n ctx.translate(\n x0 + this.padding.left + this.elements[i].position.x,\n y0 + this.padding.top + this.elements[i].position.y\n );\n if (this.debug && utils.isFunction(this.elements[i].debug))\n this.elements[i].debug();\n if (this.elements[i].display)\n this.elements[i].draw(ctx, this.display.debug);\n ctx.restore();\n }\n }", "title": "" }, { "docid": "f0e76f5055de4c0420781eb54e957ee8", "score": "0.6572426", "text": "function drawComponent() {\n performConstruct();\n setAxisData();\n drawFrameWork();\n crateChartBaseLine(seriesGroup, 0, xAxis, yAxis);\n drawLineSeries();\n positionBaseLineBubble();\n\n prepChartMarkUtil();\n prepTips();\n prepInteractivePart();\n }", "title": "" }, { "docid": "892e313cdbded5b75168ebcd6d26db80", "score": "0.65526944", "text": "display() {\n if (this.type === 0) {//truck\n fill(this.c);\n rect(this.x, this.y, VHEIGHT * 2, VHEIGHT);\n rect(this.x + VHEIGHT * 2, this.y, VHEIGHT / 2, VHEIGHT);\n }\n if (this.type === 1) {//car\n fill(this.c);\n ellipse(this.x + VHEIGHT*2, this.y+ VHEIGHT/2, VHEIGHT, VHEIGHT);\n rect(this.x, this.y, VHEIGHT * 2, VHEIGHT);\n }\n }", "title": "" }, { "docid": "cc892da2d2eff680211c08d293f25769", "score": "0.6530944", "text": "function drawObjects(gs, ctx){\n\t// Draw buildings\n\tfor (var i = 0; i < gs.buildingList.length; i++){\n\t\tgs.buildingList[i].draw(gs, ctx);\n\t}\n\t// Draw food\n\tgs.food.draw(gs, ctx);\n}", "title": "" }, { "docid": "c4702fa7ed7bb25d30cc8cac70628535", "score": "0.6514542", "text": "draw()\n {\n switch(this.id)\n {\n case(\"source\"):\n fill(0,0,255);\n break;\n case(\"target\"):\n fill(255,0,0);\n break;\n case(\"wall\"):\n fill(17,17,17);\n break;\n case(\"blank\"):\n fill(255,255,255);\n break;\n case(\"frontier\"):\n fill(0,255,0);\n break;\n case(\"path\"):\n fill(255,247,0);\n break;\n case(\"debug\"):\n fill(255,255,0);\n break;\n default:\n noFill();\n }\n\n rect(this.drawX + this.offset, this.drawY + this.offset, this.size - this.offset*2, this.size - this.offset*2, 5);\n }", "title": "" }, { "docid": "2a14fb201f01874ae7d331b5c791a7c4", "score": "0.65065235", "text": "display()\n{\nvar ball_position = this.body.position \nfill(\"brown\")\n//stroke(\"ehite\")\n//strokeWeight(4)\n// to maintain the order of the naural properties\nrect(ball_position.x,ball_position.y,this.w,this.h)\n}", "title": "" }, { "docid": "489c000cebf71b835b3ba693168b0bc4", "score": "0.6492516", "text": "display(){\r\nvar pos = this.body.position\r\npush()\r\n//giving the chance to the player to provide the x and y coardinates to the object\r\ntranslate(pos.x, pos.y)\r\nfill(\"yellow\")\r\n//maintaining the order of writing the natural properties\r\nrect(200, 200, this.width, this.height)\r\npop()\r\n}", "title": "" }, { "docid": "79904e442ad878ffc7acde9bbe1b7768", "score": "0.64820397", "text": "draw () {\n for (let i = 0; i < this.pos.length; i++) {\n context.fillStyle=this.color;\n context.fillRect(offset + fieldSize * this.pos[i], offset + fieldSize * this.pos[i+1], fieldVisibleSize, fieldVisibleSize);\n i = i+1\n }\n }", "title": "" }, { "docid": "c2ea800ee9f48b2945fddf434e8ac87b", "score": "0.64786065", "text": "display(){\n this.createLines();\n //this.createaPointsFromCoords();\n //this.createPointsFromPos(100,300);\n this.drawLines();\n \n this.drawPoints();\n this.updatePoints();\n //this.drawAxes();\n this.drawOrigin();\n}", "title": "" }, { "docid": "371758a2455abc7d605a62651166fe7b", "score": "0.6468803", "text": "function renderOverlays(){\n for(var i = 0; i<10; i++){\n if(overlayArray[i].rendered==1){\n switch(overlayArray[i].type){\n case 0:\n console.log(\"border\");\n var bord = new border(); //gotta name it something different cuz fuck javascript\n bord.index = i;\n bord.render();\n //Going to be handled withing object border() instead\n /*ctx.beginPath();\n ctx.lineWidth= borderWidth;\n ctx.strokeStyle = overlayArray[i].colorOneH;\n ctx.rect(0,0,canvas.width,canvas.height);\n ctx.stroke();*/\n break;\n case 1:\n console.log(\"cross\");\n var crss = new cross();\n crss.index = i;\n crss.render();\n //Going to be handled withing object cross() instead\n /*ctx.strokeStyle = overlayArray[i].colorOneH; //change to object color\n ctx.beginPath();\n ctx.lineWidth = crossWidth;\n ctx.moveTo(0,(canvas.height/2)+crossVerOff);\n ctx.lineTo(canvas.width, (canvas.height/2)+crossVerOff);\n ctx.moveTo((canvas.width/2)+crossHorOff, 0);\n ctx.lineTo((canvas.width/2)+crossHorOff, canvas.height);\n ctx.stroke();*/\n break;\n case 2:\n console.log(\"canton\");\n var cant = new canton();\n cant.index = i;\n cant.render();\n //Going to be handled withing object canton() instead\n /*ctx.fillStyle = overlayArray[i].colorOneH;\n ctx.fillRect = (0, 0, (canvas.width/2) * (cantonXScale/10), (canvas.height/2) * (cantonYScale/10));*/\n break;\n }\n }\n }\n}", "title": "" }, { "docid": "9d75c5bda79a6aa342da234e97eb144f", "score": "0.64680207", "text": "draw() {\n ctxt.beginPath();\n ctxt.arc(\n this.x, this.y, this.radius, 0, Math.PI * 2,\n false);\n ctxt.fillStyle = this.color;\n ctxt.fill();\n }", "title": "" }, { "docid": "07fea015d76ceee6a4994f18003144da", "score": "0.64633685", "text": "render()\n {\n // default object render\n drawTile(this.pos, this.drawSize || this.size, this.tileIndex, this.tileSize, this.color, this.angle, this.mirror, this.additiveColor);\n }", "title": "" }, { "docid": "e604f8c08f63e97ea2bcdaad2270beba", "score": "0.6452232", "text": "render()\r\n {\r\n // render circle\r\n noFill();\r\n strokeWeight(3);\r\n stroke(...H_GENERATOR_COLOR);\r\n ellipse(this.center.x, this.center.y, this.radius * 2, this.radius * 2);\r\n\r\n // render generator point\r\n fill(...H_POINT_COLOR);\r\n strokeWeight(2);\r\n stroke(...H_POINT_COLOR);\r\n const polar = this.toPolar();\r\n ellipse(polar.x, polar.y, 10, 10);\r\n\r\n // render table lines\r\n drawingContext.setLineDash([5, 5]);\r\n line(polar.x, polar.y, polar.x, CANVAS_SIZE);\r\n drawingContext.setLineDash([]);\r\n }", "title": "" }, { "docid": "87103fa6ecae752e0c3818e9aa20e657", "score": "0.645203", "text": "function drawObject(svg, cls, o) {\n var cardinal_tension;\n var stroke_color;\n for(var layer in o) {\n //default checks\n if(layer == \"bounding_box\") continue;\n cardinal_tension = (typeof o[layer].cardinal_tension == 'undefined') ? 0.5 : o[layer].cardinal_tension;\n stroke_color = (typeof o[layer].stroke_color == 'undefined') ? '#000000' : o[layer].stroke_color;\n\n //processing\n if(typeof o[layer].fill_colors != 'undefined')\n drawArea(svg, cls, o[layer].paths, o[layer].fill_colors, 0, cardinal_tension);\n if(typeof o[layer].stroke_sizes != 'undefined')\n drawCurvedPaths(svg, cls, o[layer].paths, stroke_color, o[layer].stroke_sizes, cardinal_tension);\n }//*/\n\n //drawArea(svg, cls, o.area, o.area.colors, 0, 0.5); // To align with the default values of the other two\n //drawCurvedPaths(svg, cls, o.outline, o.outline.colors, o.outline.strokes);\n //drawCurvedPaths(svg, cls, o.faded, o.faded.colors, o.faded.strokes);\n \n // for debug purposes\n //drawCurvedPaths(svg, cls, [o.bounding_box], 'red', 2, 0);\n}", "title": "" }, { "docid": "0143f7cbe375f3a7b71e0cc85ecda999", "score": "0.64465135", "text": "draw() {\n //body\n ctx.beginPath();\n ctx.rect(this.x, this.y, this.width, this.height);\n ctx.fillStyle = this.bodycolour;\n ctx.fill();\n\n //roof\n ctx.beginPath();\n ctx.rect(this.x + 10, this.y - 15, this.width - 20, this.height);\n ctx.fillStyle = this.bodycolour;\n ctx.fill();\n\n //windows\n ctx.beginPath();\n ctx.rect(this.x + 14, this.y - 10, 22, 20);\n ctx.fillStyle = this.windowcolour;\n ctx.fill();\n ctx.beginPath();\n ctx.rect(this.x + 44, this.y - 10, 22, 20);\n ctx.fillStyle = this.windowcolour;\n ctx.fill();\n\n //wheels\n ctx.beginPath();\n ctx.fillStyle = 'black';\n ctx.arc(this.x + 15, this.y + 30, 10, 0, 2 * Math.PI);\n ctx.fill();\n ctx.beginPath();\n ctx.fillStyle = 'black';\n ctx.arc(this.x + 65, this.y + 30, 10, 0, 2 * Math.PI);\n ctx.fill();\n\n //number\n ctx.font = \"bold 30px Arial\";\n ctx.fillStyle = \"white\";\n ctx.textAlign = \"center\";\n ctx.fillText(this.number, this.x + this.width / 2, this.y + this.height / 2 + 10);\n ctx.fillStyle = \"black\";\n ctx.strokeText(this.number, this.x + this.width / 2, this.y + this.height / 2 + 10);\n }", "title": "" }, { "docid": "ac11da497a84bdee2c94b84631d56c6e", "score": "0.6438645", "text": "draw () {\t\t\n\t\tthis._size_elements ()\n\t\tthis._draw_board ()\n\t}", "title": "" }, { "docid": "75157bef80ce160cc40bd874f15db9b9", "score": "0.6433608", "text": "display(){\n if(this.isclicked){\n fill(66, 244, 155);\n }else{\n fill(this.shade);\n }\n if(this.over){\n fill(255, 199, 225);\n }\n ellipse(this.x, this.y, this.w, this.h);\n }", "title": "" }, { "docid": "d9458a08e0ca262c37a1cbdface5d433", "score": "0.64319336", "text": "draw() {\n\t\tctx.beginPath();\n\t\tctx.arc(this.x,this.y,this.size,0,Math.PI * 2, false);\n\t\tctx.fillStyle = 'rgb(80, 83, 85)';\n\t\tctx.fill();\n\t}", "title": "" }, { "docid": "59bfc2f8246ee56a6f3472c153afd3d4", "score": "0.6430985", "text": "display() {\n stroke(255);\n fill(200);\n rect(this.x, this.y, this.w, this.w);\n }", "title": "" }, { "docid": "a674d5de892c858845d8f3f8aca7456d", "score": "0.64227957", "text": "draw(context) {\n // console.log(`drawing entity with id of ${this.id}`);\n context.strokeStyle='black';\n context.fillStyle=this.fill_color;\n context.beginPath();\n context.arc(this.x, this.y, this.r, 0, Math.PI*2);\n context.fill();\n context.lineWidth=2;\n context.stroke();\n context.closePath(); \n }", "title": "" }, { "docid": "061daf3854583076db2ee45e1e8b4377", "score": "0.6421615", "text": "repaint () {\n if (this.picked_object != undefined) {\n if (this.picked_object.parent.name == 'lines') {\n this.redrawArc(this.picked_object);\n } else if (this.picked_object.parent.name == 'spheres') {\n this.redrawSphere( ((this.picked_object /*: any */) /*: THREE.Mesh */) );\n }\n }\n }", "title": "" }, { "docid": "fc45cfd1421f6490f31dcab79ed7669d", "score": "0.6416999", "text": "render() {\n super.render();\n fill('white');\n circle(this.x, this.y, this.rad);\n }", "title": "" }, { "docid": "04615562ead4e91fc4787529b57fb5ee", "score": "0.6416173", "text": "draw() {\r\n fill(38, 33, this.groundColor);\r\n strokeWeight(0);\r\n rect(0, 590, this.width, this.height);\r\n }", "title": "" }, { "docid": "eb5b15705ff51f0820988ef4c496e811", "score": "0.6415459", "text": "display() {\n beginShape();\n \n for (const particle of this.particles) {\n particle.display();\n vertex(particle.location.x, particle.location.y);\n }\n \n strokeWeight(2);\n stroke(255, 153, 0, 60);\n noFill();\n \n endShape(CLOSE);\n }", "title": "" }, { "docid": "e359d67588eb94c1edd3fca5ced7d6d0", "score": "0.6414654", "text": "draw(){\n\t\tthis.drawObject(this.meshes.plane, () => {\n\t\t\tthis.fragment.draw && this.fragment.draw(this.ctx, this.shaderProgram);\n\t\t\tthis.vertex.draw && this.vertex.draw(this.ctx, this.shaderProgram);\n\t\t});\n\t\tthis.transform();\n\t}", "title": "" }, { "docid": "9793d40c26056e0fc502ab383de7310a", "score": "0.64020276", "text": "display() {\n\t\tthis.drawElements(this.primitiveType);\n\t\tthis.displayTop();\n\t}", "title": "" }, { "docid": "70de28615e4ed48bc3543c6e74fc0531", "score": "0.6398876", "text": "render()\r\n {\r\n // render circle\r\n noFill();\r\n strokeWeight(3);\r\n stroke(...V_GENERATOR_COLOR);\r\n ellipse(this.center.x, this.center.y, this.radius * 2, this.radius * 2);\r\n\r\n // render generator point\r\n fill(...V_POINT_COLOR);\r\n strokeWeight(2);\r\n stroke(...V_POINT_COLOR);\r\n const polar = this.toPolar();\r\n ellipse(polar.x, polar.y, 10, 10);\r\n\r\n // render table lines\r\n drawingContext.setLineDash([5, 5]);\r\n line(polar.x, polar.y, CANVAS_SIZE, polar.y);\r\n drawingContext.setLineDash([]);\r\n }", "title": "" }, { "docid": "4209b7a5e1f80ae1e457fba3984596e3", "score": "0.63937765", "text": "draw() {\n super.draw();\n this.command.context.chain.push();\n\n this.command.context.chain.strokeWeight(1);\n let p5Colour = p5Instance.color(255, 255, 255, 255);\n this.command.context.chain.stroke(p5Colour);\n this.command.context.chain.circle(\n this.command.context.chain.mouseX,\n this.command.context.chain.mouseY,\n this.command.thickness,\n );\n\n this.command.context.chain.pop();\n }", "title": "" }, { "docid": "c416ddbf7e8621b2d8f38c1d663da0c7", "score": "0.6389063", "text": "draw() {\n ctxt.beginPath();\n ctxt.arc(\n this.x, this.y, this.radius, 0, Math.PI * 2,\n false);\n ctxt.fillStyle = this.color;\n ctxt.fill();\n }", "title": "" }, { "docid": "37aa30535fb3f165cf0601d6c93b9107", "score": "0.63830924", "text": "draw() {\n var ctx = this.ctx; // Make sure canvas is the correct size\n\n this.resize(); // Reset drawn objects list\n\n this._drawnElements = []; // Draw the entire GUI\n\n ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n this.model.activeTimeline.guiElement.draw(); // Draw current popup menu\n\n if (this._popupMenu) {\n this._popupMenu.draw();\n } // Draw tooltips\n\n\n this._mouseHoverTargets.forEach(target => {\n if (target.tooltip) {\n target.tooltip.draw(target.localTranslation.x, target.localTranslation.y);\n }\n });\n }", "title": "" }, { "docid": "d6460a49fc0a5fd09f648f152fb1fc4d", "score": "0.6377384", "text": "function draw() {\n background(0);\n\n//OBJECT PARAMETERS////////////////////////////////////////////////////////////////////\n let config = {\n x: 250,\n y: 250,\n width: 200,\n height: 200,\n fillColor: {\n r: 255,\n g: 255,\n b: 0,\n },\n mode: CENTER\n }\n\n drawFancyRect(config);\n\n\n//CONSTANTS////////////////////////////////////////////////////////////////////\n// circleAlpha = map(mouseX, 0, width, 10, 100);\n// circleSizeIncrease = map(mouseY, 0, height, 10, 100);\n//\n// for (let i = 0; i < NUM_CIRCLES; i++) {\n// push();\n// fill(255, circleAlpha);\n// ellipse(width/2, height/2, i * circleSizeIncrease);\n// pop();\n// }\n} // draw end", "title": "" }, { "docid": "1a14e082d1473c88ecc85271fba8260d", "score": "0.6375035", "text": "draw() {\n\t\tctx.save();\n\t\tctx.beginPath();\n\t\tctx.fillStyle = this.color;\n\t\tctx.arc(this.x, this.y, this.size, 0, Math.PI * 2, true);\n\t\tctx.closePath();\n\t\tctx.fill();\n\t\tctx.restore();\n\t}", "title": "" }, { "docid": "484041b0a540e0f4d42ad51c68e362cc", "score": "0.6372405", "text": "function drawCircle(object) {\n ctx.fillStyle = object.drawColor;\n ctx.beginPath();\n ctx.arc(object.position.x, object.position.y, objectSize, 0, Math.PI * 2);\n ctx.closePath();\n ctx.fill();\n }", "title": "" }, { "docid": "5b7f0bdfd1fb80ad8a57ba2f4f279bb8", "score": "0.6366206", "text": "draw() {\n this.position.drawCircle('LimeGreen');\n }", "title": "" }, { "docid": "fb5f6e71fe4e673fc15fbdf2c3b48cb8", "score": "0.63614863", "text": "_draw() {\n this._drawSpeedbar();\n this._drawVario();\n }", "title": "" }, { "docid": "202ffaac51aa61aae55ba8442472e4e6", "score": "0.63540214", "text": "function render()\n {\n map.drawBaseLayerSection( ctx, map.x, map.y, size.w, size.h, 0, 0, size.w, size.h );\n map.drawObjectsAnimated( ctx, map.x, map.y, size.w, size.h );\n \n player.render();\n \n enimy.render( map );\n \n enimy2.render( map );\n \n map.drawMiddleLayerSection( ctx, map.x, map.y, size.w, size.h, 0, 0, size.w, size.h );\n \n GUI.drawGUI( ctx );\n }", "title": "" }, { "docid": "f66af5c7114b18d0a8f90cbfa960bb99", "score": "0.6352361", "text": "function finalDraw() {\n\t Registry.getComponentMethod('shapes', 'draw')(gd);\n\t Registry.getComponentMethod('images', 'draw')(gd);\n\t Registry.getComponentMethod('annotations', 'draw')(gd);\n\t Registry.getComponentMethod('legend', 'draw')(gd);\n\t Registry.getComponentMethod('rangeslider', 'draw')(gd);\n\t Registry.getComponentMethod('rangeselector', 'draw')(gd);\n\t Registry.getComponentMethod('updatemenus', 'draw')(gd);\n\t Registry.getComponentMethod('sliders', 'draw')(gd);\n\t }", "title": "" }, { "docid": "70383669e84b1560e1459e93523b3603", "score": "0.63496697", "text": "show() {\n\t\tctx.strokeStyle = this.hit ? \"red\" : \"white\";\n\t\tctx.scale(space.scale.x,space.scale.y);\n\t\tctx.translate(this.pos.x,this.pos.y);\n\t\t// ctx.rotate(this.angle+Math.PI/2);\n\t\tctx.beginPath();\n\t\t//ctx.arc(0,0,this.r,0,2*Math.PI);\n\t\tctx.moveTo(this.vertices[0][0],this.vertices[0][1]);\n\t\tfor(let i=1; i<this.vertices.length; i++) {\n\t\t\tctx.lineTo(this.vertices[i][0],this.vertices[i][1]);\n\t\t}\n\t\tctx.lineTo(this.vertices[0][0],this.vertices[0][1]);\n\t\tctx.stroke();\n\t\tctx.closePath();\n\t\tctx.translate(-this.pos.x,-this.pos.y);\n\t\tctx.setTransform(1,0,0,1,0,0);\n\t}", "title": "" }, { "docid": "bc1794675b0d394fca55c5e224be933a", "score": "0.6344914", "text": "draw(){//draw method calls the circle method of the box object\n this.position.drawEllipse('Yellow');\n }", "title": "" }, { "docid": "b58ee4627f193048c19a200c3c3c6ede", "score": "0.63397145", "text": "paintPlayer(){\n\t\tctx.beginPath();\n\t\tctx.rect(this.x, this.y, this.height, this.width);\n\t\tctx.fillStyle = \"#990000\";\n\t\tctx.fill();\n\t\tctx.closePath();\n\t}", "title": "" }, { "docid": "0794bb970ff77c51e2d286ac60175d78", "score": "0.6339084", "text": "display() {\n stroke(walkerColour); // stroke(rgb) - Sets the color used to draw lines and borders around shapes\n point(this.x,this.y); // point(x, y, [z]) - Draws a point in space at the dimension of one pixel\n }", "title": "" }, { "docid": "d6c7d9fc2612a3c03ad8dfd93372ece4", "score": "0.6337786", "text": "function ObjectOrientedRenderer3(){}", "title": "" }, { "docid": "d6c7d9fc2612a3c03ad8dfd93372ece4", "score": "0.6337786", "text": "function ObjectOrientedRenderer3(){}", "title": "" }, { "docid": "d6c7d9fc2612a3c03ad8dfd93372ece4", "score": "0.6337786", "text": "function ObjectOrientedRenderer3(){}", "title": "" }, { "docid": "d6c7d9fc2612a3c03ad8dfd93372ece4", "score": "0.6337786", "text": "function ObjectOrientedRenderer3(){}", "title": "" }, { "docid": "9a8746dfb450920ac3c5b2d1808da6ce", "score": "0.633068", "text": "draw() { }", "title": "" }, { "docid": "46b01db94c22d6815390d493c0460d18", "score": "0.63229513", "text": "draw() {\n\t\tctx.save();\n\t\tctx.beginPath();\n\t\tctx.fillStyle = this.color;\n\t\tctx.arc(this.x, this.y, this.size, 0, Math.PI * 2, true);\n\t\tctx.fill();\n\t\tctx.restore();\n\t}", "title": "" }, { "docid": "9c5633b2c04af9cdf258ef3e9f5fea6e", "score": "0.6320717", "text": "function doFrame() {\n updateAllObject2d();\n drawAllObject();\n}", "title": "" }, { "docid": "dfe2c454038ba40d7336c359b24b4186", "score": "0.6315206", "text": "function drawIt ( ) {\n // parts\n let rotationStream = [ ];\n const numberOfParts = parts.length - 1;\n for ( let i = 0; i < numberOfParts; i++ ) {\n addToPart ( rotationStream, parts[ i ].balls );\n // rotate the part for the shifted angles\n parts[ i ].pitch += parts[ i ].deltaPitch;\n parts[ i ].roll += parts[ i ].deltaRoll;\n parts[ i ].yaw += parts[ i ].deltaYaw;\n initYaw ( parts[ i ].yaw );\n yawPart ( rotationStream );\n initPitchRoll ( parts[ i ].roll, parts[ i ].pitch );\n pitchRollPart ( rotationStream );\n }\n\n addToPart ( rotationStream, parts[ numberOfParts ].balls );\n let ballShadow = [ ];\n addToPart ( ballShadow, rotationStream );\n addToPart ( rotationStream, outerBlock );\n // copy the shadow before the final rotation\n shadowPart ( ballShadow );\n\n // rotate the whole thing\n initRotate3d ( alpha, beta, 0 );\n rotatePart ( rotationStream );\n rotatePart ( ballShadow );\n \n // draw everything\n drawPart ( rotationStream );\n ctx.globalAlpha = 0.2;\n drawPart ( ballShadow );\n ctx.globalAlpha = 1.0;\n }", "title": "" }, { "docid": "64ca7a9f02d02c9a6b758e246c6184bd", "score": "0.63116086", "text": "draw() {\n\t\t// Draw point \n\t\tcontext.beginPath();\n\t\tcontext.arc(this.posX, this.posY, this.radius, Math.PI*2, false);\n\t\tcontext.fill();\n\t\t// Node name \n\t\tthis.setLetterPos();\n\t\tcontext.font = \"bold 12px Georgia\";\n\t\tcontext.fillText(this.node.letter, this.letterX, this.letterY);\n\t}", "title": "" }, { "docid": "d427866d98e8e7b3df6cf99044ba6537", "score": "0.63055295", "text": "draw() {\n Aufgabe06.crc2.beginPath();\n Aufgabe06.crc2.arc(this.x, this.y, 2, 0, 2 * Math.PI);\n Aufgabe06.crc2.fillStyle = this.color;\n Aufgabe06.crc2.fill();\n }", "title": "" }, { "docid": "0a38809027a2ae38a2ec5f692a7559e9", "score": "0.6301292", "text": "function drawDome() {\n\tg_modelMatrix.translate(0, CAR_HEIGHT, 0);\n\tg_modelMatrix.scale(1, 0.45, 1);\n\tdrawObj(NUM_CAR_V, NUM_DOME_V);\n}", "title": "" }, { "docid": "0bed1d54130fbfe21a7c190d34982133", "score": "0.6300804", "text": "draw()\n {\n this.ctx.beginPath();\n this.ctx.rect(this.x, this.y, this.width, this.height);\n for (var key in this.styleOptions.boxStyles[this.style])\n {\n this.ctx[key] = this.styleOptions.boxStyles[this.style][key];\n }\n this.ctx.lineWidth=1+(this.ratio*this.styleOptions.votingStyle[\"maxWidth\"]);\n this.ctx.stroke();\n for (var key in this.styleOptions.textStyles[this.style])\n {\n this.ctx[key] = this.styleOptions.textStyles[this.style][key];\n }\n var [x, y] = this.getLabelPos();\n this.ctx.fillText(this.label, x, y);\n var [x, y] = this.getPercentagePos();\n this.ctx.fillText(this.formatPercentage(), x, y);\n }", "title": "" }, { "docid": "27ea141208f1d6d2a142ce094c6e5cb2", "score": "0.6297839", "text": "show() {\n stroke(this.color);\n strokeWeight(this.r);\n rect(this.pos.x, this.pos.y,1,1);\n }", "title": "" }, { "docid": "e7337356da5ee5d101079a4ab15b5d3a", "score": "0.6297518", "text": "draw() {\n this.checkContext();\n this.setRendered();\n\n const tick_context = this.getTickContext();\n const next_context = _tickcontext__WEBPACK_IMPORTED_MODULE_2__[\"TickContext\"].getNextContext(tick_context);\n\n const begin_x = this.getAbsoluteX();\n const end_x = next_context ? next_context.getX() : this.stave.x + this.stave.width;\n const y = this.stave.getYForLine(this.line + (-3)) + 1;\n\n L(\n 'Drawing ',\n this.decrescendo ? 'decrescendo ' : 'crescendo ',\n this.height,\n 'x',\n begin_x - end_x\n );\n\n renderHairpin(this.context, {\n begin_x: begin_x - this.render_options.extend_left,\n end_x: end_x + this.render_options.extend_right,\n y: y + this.render_options.y_shift,\n height: this.height,\n reverse: this.decrescendo,\n });\n }", "title": "" }, { "docid": "a7d5c1a4f8ddeb4ecbf096efd6f12b37", "score": "0.6294538", "text": "function drawObject(object) {\n\n\n var objectSize = 30;\n\n if (onTablet() || onSmartphone()) {\n objectSize = 15;\n }\n\n graph.strokeStyle = object.stroke;\n if(object.type == \"life\") {\n graph.fillStyle = \"#33ff33\";\n } else if(object.type == \"mine\") {\n graph.fillStyle = \"#FF3030\";\n } else {\n graph.fillStyle = \"#060202\";\n }\n \n graph.lineWidth = object.strokeWidth;\n\n drawCircle(object.x - player.x + screenWidth / 2 + 100, object.y - player.y + screenHeight / 2 + 100, objectSize, objectSize);\n \n /* var objectSize = 60;\n\n if (onTablet() || onSmartphone()) {\n objectSize = 30;\n }\n\n imageRepository.objectImg.src = object.imageUrl;\n\n graph.globalAlpha = 1;\n\n graph.drawImage(imageRepository.objectImg, object.x - player.x + screenWidth / 2,\n object.y - player.y + screenHeight / 2, objectSize, objectSize);*/\n\n}", "title": "" }, { "docid": "5d25c748d42fe2e8e333dab8bed97c62", "score": "0.62920755", "text": "draw() {\n this.checkContext();\n this.setRendered();\n if (this.unbeamable) return;\n\n if (!this.postFormatted) {\n this.postFormat();\n }\n\n this.drawStems();\n this.applyStyle();\n this.drawBeamLines();\n this.restoreStyle();\n }", "title": "" }, { "docid": "1936b5bd082d3f25ab3b063af939489a", "score": "0.629171", "text": "draw(){\n //console.log('draw'); // Objects can be rewritten like this inside objects\n }", "title": "" }, { "docid": "afe138bb06d1b7bcfe7a7d64aa7bba62", "score": "0.62821335", "text": "function createObject() {\n\tcontext.fillStyle = \"red\";\n\tcontext.fillRect(object.x, object.y, box, box);\n}", "title": "" }, { "docid": "89f8703a5ec06e325c677b563fddf304", "score": "0.62817633", "text": "draw() {\n\t\tthis.wrap.draw();\n\t\tctx.fillStyle = palette.background;\n\t\tctx.globalAlpha = .3;\n\t\tctx.fillRect(0, 0, WIDTH, HEIGHT);\n\t\tctx.globalAlpha = .7;\n\t\tctx.fillRect(this.x, this.y, this.width, this.height);\n\t\tctx.globalAlpha = 1;\n\t\tthis.tabs.draw();\n\t\tctx.fillStyle = palette.normal;\n\t\tdrawTextInRect(lg(this.wrap.level.lModeName), this.x, this.y, this.width, 60);\n\t\tdrawParagraphInRect(this.text, this.x, this.y+140, this.width, this.height-200, 24);\n\t\tif (Array.isArray(this.hints)) {\n\t\t\tthis.prevHintButton.draw();\n\t\t\tthis.nextHintButton.draw();\n\t\t\tctx.fillStyle = palette.normal;\n\t\t\tdrawTextInRect((this.hintIndices[this.tabIndex]+1)+\"/\"+this.hints.length, this.prevHintButton.x+this.prevHintButton.width, this.prevHintButton.y, this.nextHintButton.x-this.prevHintButton.x-this.prevHintButton.width, this.prevHintButton.height);\n\t\t}\n\t\tthis.wrap.menuButton.draw();\n\t}", "title": "" }, { "docid": "c20daaa21335cf5e6f3e21458da3b24c", "score": "0.62801945", "text": "render() {\n\t\tpush();\n\n\t stroke(255, 200);\n\t fill(255, 100);\n\t translate(this.position.x, this.position.y);\n\t rotate(this.velocity.heading());\n\t rectMode(CENTER);\n\t rect(0, 0, 25, 5);\n\n\t pop();\n\t}", "title": "" }, { "docid": "674fee03d1959313d6bb5babb14c4e6a", "score": "0.6275333", "text": "function draw_boxes(objects) {\n\n //clear the previous drawings\n draw_ctx.clearRect(0, 0, draw_canvas.width, draw_canvas.height);\n\n //filter out objects that contain a class_name and then draw boxes and labels on each\n objects.filter(object => object.class_name).forEach(object => {\n\n let rect = draw_canvas.getBoundingClientRect(), // abs. size of element\n scaleX = draw_canvas.width / rect.width, // relationship bitmap vs. element for X\n scaleY = draw_canvas.height / rect.height; // relationship bitmap vs. element for Y\n\n let x = 2 * object.x;\n let y = 2 * object.y;\n let width = 2 * (object.width);\n let height = 2 * (object.height);\n\n //flip the x axis if local video is mirrored\n if (mirror) {\n x = draw_canvas.width - (x + width)\n }\n draw_ctx.font = \"20px Verdana\";\n draw_ctx.fillText(object.class_name + \" - \" + Math.round(object.score * 100) + \"%\", x + 5, y - 30)\n\n if (client.recognize_cbox && 'rec_score' in object) {\n draw_ctx.font = \"15px Verdana\";\n draw_ctx.fillStyle = \"#00ff00\";\n draw_ctx.fillText(object.id, x - 5, y - 10);\n draw_ctx.fillText(\"score: \" + object.rec_score.toFixed(2), x + 5, y + 20)\n draw_ctx.fillText(\"margin: \" + object.rec_margin.toFixed(2), x + 5, y + 40)\n\n }\n draw_ctx.strokeRect(x, y, width, height);\n // Now draw landmarks\n landmarks = object.landmarks\n landmarks.forEach(landmark => {\n let x = 2 * landmark.x - 5;\n let y = 2 * landmark.y - 5;\n //flip the x axis if local video is mirrored\n if (mirror) {\n x = draw_canvas.width - (x + 10)\n }\n draw_ctx.strokeRect(x, y, 10, 10);\n });\n\n });\n }", "title": "" }, { "docid": "c9d980c77f25b184070f370e0491e60f", "score": "0.62753105", "text": "function draw(){\n\tclearScreen(buffer_canvas_ctx, '#9CC5C9');\n\t// use double buffering technique to remove flickr :)\n\tvar context = buffer_canvas_ctx;\n\tfor(var i = 0, l = game_objects.length; i < l; i++){\n\t\tvar obj = game_objects[i];\n\t\tif(typeof obj.draw == 'function' && obj.visible){\n\t\t\tcontext.save();\n\t\t\t!isNaN(obj.x) && !isNaN(obj.y) && context.translate(obj.x, obj.y); \n\t\t\t!isNaN(obj.scale_x) && !isNaN(obj.scale_y) && context.scale(obj.scale_x, obj.scale_y); \n\t\t\t!isNaN(obj.rotation) && context.rotate(obj.rotation * pi_by_180); \n\t\t\t!isNaN(obj.alpha) && (context.globalAlpha = obj.alpha); \n\t\t\tobj.draw(context);\n\t\t\tcontext.restore();\n\t\t}\n\t}\n\tclearScreen(ctx);\n\tctx.drawImage(buffer_canvas, 0, 0);\n}", "title": "" }, { "docid": "c5d3eb424f64fd38fe2694efb9204845", "score": "0.6265125", "text": "draw() {\r\n this.context.fillStyle = 'black';\r\n this.context.fillRect(this.x, this.y, this.width, this.height);\r\n }", "title": "" }, { "docid": "2a02297e323e6ff9c317e77fbe2e034f", "score": "0.62632227", "text": "draw() {\n if (!!this._id) {\n Communication.send(this._navi.iFrame, this._navi.targetHost, {\n command: 'drawObject',\n args: {\n type: this._type,\n object: {\n id: this._id,\n points: this._points,\n opacity: this._opacity,\n color: this._color,\n events: this._events\n }\n }\n });\n } else {\n throw new Error('INArea is not created yet, use ready() method before executing draw(), or remove()');\n }\n }", "title": "" }, { "docid": "c68988265775098bb057358a6ad147d5", "score": "0.62630594", "text": "function finalDraw() {\n Registry.getComponentMethod('shapes', 'draw')(gd);\n Registry.getComponentMethod('images', 'draw')(gd);\n Registry.getComponentMethod('annotations', 'draw')(gd);\n Registry.getComponentMethod('legend', 'draw')(gd);\n Registry.getComponentMethod('rangeslider', 'draw')(gd);\n Registry.getComponentMethod('rangeselector', 'draw')(gd);\n Registry.getComponentMethod('updatemenus', 'draw')(gd);\n Registry.getComponentMethod('sliders', 'draw')(gd);\n }", "title": "" }, { "docid": "530cf4d040da4abcdb9a3c2c286224c4", "score": "0.62616885", "text": "draw() {\n }", "title": "" }, { "docid": "511165bd636f9778a6f8629f0449deec", "score": "0.6260932", "text": "draw() {\r\n ctx.beginPath();\r\n ctx.arc(this.x, this.y, this.size, 0, Math.PI*2, false);\r\n ctx.fillStyle = '#BD4B4B';\r\n ctx.fill(); \r\n }", "title": "" }, { "docid": "039fa524f8dc918d6180fb34388f1c91", "score": "0.62608737", "text": "display() {\n p5.noStroke();\n p5.fill(this.backgroundColor);\n p5.rect(this.x, this.y, this.width, this.height);\n }", "title": "" }, { "docid": "a6064472a6027819adfd03fabddfc4f8", "score": "0.62594295", "text": "render() {\n\t\tthis.ctx.clearRect(0, 0, 512, 384);\n\n\t\tthis.ctx.save();\n\t\tthis.ctx.beginPath();\n\t\tthis.ctx.strokeStyle = \"#000000\";\n\t\tthis.ctx.lineWidth = 18;\n\t\tlet tpos1 = this.WtSPoint(this.bounds[0]);\n\t\tlet tpos2 = this.WtSPoint(this.bounds[1]);\n\n\t\t// Background and setting\n\t\t// Road\n\t\tthis.ctx.fillStyle = \"#707070\";\n\t\tthis.ctx.fillRect(tpos1.x - 512, tpos1.y - 128, 2048, 128);\n\t\t// Grass\n\t\tthis.ctx.fillStyle = \"#37a967\";\n\t\tthis.ctx.fillRect(tpos1.x - 512, tpos1.y, 2048, 2048);\n\t\t// Floorboards\n\t\tthis.ctx.fillStyle = \"#a67c28\";\n\t\tthis.ctx.fillRect(tpos1.x, tpos1.y, tpos2.x - tpos1.x, tpos2.y - tpos1.y);\n\t\t// Walls\n\t\tthis.ctx.strokeRect(tpos1.x, tpos1.y, tpos2.x - tpos1.x, tpos2.y - tpos1.y)\n\n\t\tthis.ctx.restore();\n\n\t\t// Render all entities\n\t\tfor (let e of this.entities) {\n\t\t\te.draw(this.ctx);\n\t\t}\n\n\t\t// Draws the info box if player is on top of something\n\t\tif (this.player.targetEntity != null) {\n\t\t\tthis.ctx.save();\n\t\t\tthis.ctx.beginPath();\n\t\t\tthis.ctx.fillStyle = \"hsla(0deg, 0%, 0%, 0.5)\"\n\t\t\tthis.ctx.fillRect(20, 20, 350, 125);\n\n\t\t\tthis.ctx.fillStyle = \"#ffffff\"\n this.ctx.font = \"18pt Courier new\";\n \n\t\t\tlet text = String(this.player.targetEntity.getInteractText());\n let words = text.split(' ');\n\t\t\tlet rowNumber = 0;\n\t\t\twhile ( words.length > 0){\n let currentLine = '';\n \n const MAX_LINE_LENGTH = 22;\n \n while (words.length > 0){\n \n if (currentLine.length + words[0].length <= MAX_LINE_LENGTH){\n currentLine += words.shift() + \" \";\n }\n else{\n break;\n }\n\n }\n this.ctx.fillText(currentLine, 40, 50 + rowNumber * 22, 300);\n rowNumber++;\n\t\t\t}\n\n\t\t\t// this.ctx.fillText(this.player.targetEntity.getInteractText(), 40, 50, 432);\n\n\t\t\tthis.ctx.restore();\n\t\t}\n\n\t}", "title": "" }, { "docid": "7f584314a32c7f8136d83fef1178e2f0", "score": "0.62532985", "text": "draw() {\n\n }", "title": "" }, { "docid": "7f584314a32c7f8136d83fef1178e2f0", "score": "0.62532985", "text": "draw() {\n\n }", "title": "" }, { "docid": "695d037105cb65f8b981c45a10b3e9d0", "score": "0.6240839", "text": "display() {\n push();\n rectMode(CENTER);\n noStroke();\n fill(this.fill);\n translate(this.x, this.y);\n rotate(this.theta * 2); // horizontal\n rect(0, 0, this.width, this.height);\n rotate(this.theta * 5 / 4); // slash\n rect(0, 0, this.width, this.height);\n rotate(this.theta / 4); // slash\n rect(0, 0, this.width, this.height);\n rotate(this.theta / 4); // slash\n rect(0, 0, this.width, this.height);\n pop();\n }", "title": "" }, { "docid": "7d0310e945cb2dc32a0428c2be1ceee5", "score": "0.6240292", "text": "display()\n {\n\t\t\n\t image(this.geoBoy, this.x,this.y);\n\t\t\n\t\t// tetsing part (forget this part)\n\t\t//push();\n\t\t//fill(255,0,0);\n\t\t//ellipse(this.x+32, this.y+32, 5, 5);\n\t\t//pop();\n\t\t\n \n }", "title": "" }, { "docid": "8163806043129f24aeb8433400c202ae", "score": "0.62371904", "text": "draw() {\n var pixelBoundX = this.boundX * this.size;\n var pixelBoundY = this.boundY * this.size;\n // Background color\n this.__ctx.fillStyle = this.backgroundColor;\n this.__ctx.fillRect(0, 0, pixelBoundX, pixelBoundY);\n // Draw Grid\n this.__ctx.lineWidth = 2;\n //this.__ctx.setLineDash([7]);\n this.__ctx.strokeStyle = this.gridLineColor;\n for (var x = 0; x < pixelBoundX; x += this.size) {\n this.__ctx.beginPath();\n this.__ctx.moveTo(x, 0);\n this.__ctx.lineTo(x, pixelBoundY);\n this.__ctx.stroke();\n }\n for (var y = 0; y < pixelBoundY; y += this.size) {\n this.__ctx.beginPath();\n this.__ctx.moveTo(0, y);\n this.__ctx.lineTo(pixelBoundX, y);\n this.__ctx.stroke();\n }\n this.__ctx.setLineDash([]);\n // Draw Elevators\n this.elevators.forEach(function (elevator) {\n elevator.draw(this.size);\n }, this);\n // Draw Rooms\n this.rooms.forEach(function (room) {\n room.draw();\n }, this);\n this.rooms.forEach(function (room) {\n room.secondDraw();\n }, this);\n // Banner\n this.drawBanner();\n }", "title": "" }, { "docid": "03eae0f0a3fc8c918d8719a34422698e", "score": "0.6234758", "text": "function draw() {\r\n\r\n background(230);\r\n //Add code for displaying text here!\r\n image(boy ,200,340,200,300);\r\n \r\n\r\n treeObj.display();\r\n mango1.display();\r\n mango.display();\r\n\r\n stone.display();\r\n\r\n groundObject.display();\r\n}", "title": "" }, { "docid": "ba108ee889ebfe13e16932488e3a2444", "score": "0.6230044", "text": "drawPhysicalObject() {\n let objectWidth = this._x2 - this._x1;\n let objectHeight = this._y2 - this._y1;\n let objectColour = \"\";\n\n // object visual based on single section of image. jQuery needed for Firefox's\n // sake.\n let objectImage = document.createElement(\"div\");\n objectImage.id = this.name;\n\n $(objectImage).css(\"width\", objectWidth);\n $(objectImage).css(\"height\", objectHeight);\n $(objectImage).css(\"position\", \"absolute\");\n $(objectImage).css(\"left\", this.x1);\n $(objectImage).css(\"top\", this.y1);\n\n if (this.pixelType === SOLID) {\n objectImage.style.background = \"url('img/barrier1.jpg') \" + -this.x1 + \"px \" + -this.y1 + \"px\";\n } else if (this.pixelType === GOAL) {\n objectImage.style.background = \"url('img/gamebg.png') \" + -this.x1 + \"px \" + -this.y1 + \"px\";\n } else if (this.pixelType === AIR) {\n objectImage.style.background = \"url('img/gamebg.png') \" + -this.x1 + \"px \" + -this.y1 + \"px\";\n } else if (this.pixelType === RIGHT_ANSWER) {\n objectImage.style.background = \"url('img/gamebg.png') \" + -this.x1 + \"px \" + -this.y1 + \"px\";\n //objectImage.style.backgroundColor = \"rgba(0,127,255,0.5)\";\n } else if (this.pixelType === WRONG) {\n objectImage.style.background = \"url('img/gamebg.png') \" + -this.x1 + \"px \" + -this.y1 + \"px\";\n //objectImage.style.backgroundColor = \"rgba(0,127,255,0.5)\";\n }\n document.getElementById(\"game_window\").appendChild(objectImage);\n }", "title": "" }, { "docid": "9fda7458d563d55d18cf62c9ae80d697", "score": "0.6230001", "text": "display(){\n\t\tfill(0, 0, 0, 0);\n\t\tstroke(200);\n\t\tellipse(this.Location.x, this.Location.y, 5, 5);\n\t}", "title": "" }, { "docid": "f99bf2802b258e4f50d73a522bc86a20", "score": "0.6229581", "text": "draw() {\n const _wasDrawn = this.drawn;\n this.drawRect();\n if (!_wasDrawn) {\n this.firstDraw();\n if (this.isString(this.componentName)) {\n this.drawMarkup();\n }\n if (this.isArray(this.options.classNames)) {\n this.options.classNames.forEach(_className => {\n this.setCSSClass(_className);\n });\n }\n this.options.style && this.setStyles(this.options.style);\n this.options.html && this.setHTML(this.options.html);\n // Extended draw for components to define / extend.\n // This is preferred over drawSubviews, when defining\n // parts of a complex component.\n if (this.isFunction(this.extDraw)) {\n this.extDraw();\n }\n // Extended draw for the purpose of drawing sub-views.\n this.drawSubviews();\n // if options contain a sub-views function, call it with the name-space of self\n if (this.isFunction(this.options.subviews)) {\n this.options.subviews.call(this, this);\n }\n // for external testing purposes, a custom className can be defined:\n if (this.options.testClassName) {\n ELEM.addClassName(this.elemId, this.options.testClassName);\n }\n if (this.isntNullOrUndefined(this.options.tabIndex)) {\n this.setTabIndex(this.options.tabIndex);\n }\n if (!this.isHidden) {\n this.show();\n }\n if (this.options.focusOnCreate === true && !BROWSER_TYPE.mobile) {\n this.timeouts.push(setTimeout(() => {this.setFocus();}, 300));\n }\n }\n this.refresh();\n return this;\n }", "title": "" } ]
f27fae8130c9c2450894cab70e3dcbdd
Returns an array of objects with the column names as keys.
[ { "docid": "bc65b070dbfff0e0d5353702a130da25", "score": "0.0", "text": "function toObjectArray(origArray) {\n\n var newArray = [];\n for (var index = 1; index < origArray.length; index++) {\n newArray.push(_.object(origArray[0], origArray[index]));\n }\n\n return newArray;\n\n}", "title": "" } ]
[ { "docid": "c3c41e185c782a117a4540b4d83773a7", "score": "0.7561171", "text": "getColumnNames() {\n let columnArr = [];\n Object.keys(this.tableData[0]).map(key => {\n let colConfig = {};\n colConfig.id = key;\n colConfig.title = key;\n columnArr.push(colConfig);\n });\n return columnArr;\n }", "title": "" }, { "docid": "e6ed036243a2cc9e51f385330ab434df", "score": "0.66654235", "text": "function getDSColObjs(columns){\n let colObjs = columns.map(function(column,i){\n return {\n dscl_id : i + 1 ,//column id\n dscl_nm : column, //column name\n dscl_is : false, //is selected\n dscl_an : \"\" //alternate names\n };\n });\n\n return colObjs;\n}", "title": "" }, { "docid": "b04e7e2d201a708899369888d675f0c6", "score": "0.6598208", "text": "function Columns() {\n\treturn colNames;\n}", "title": "" }, { "docid": "491b1a2ba2e6e47f1805d4fb9e188f40", "score": "0.6451614", "text": "listValues() {\n const values = [];\n\n Object.keys(this.values).forEach(column => {\n values.push({ column, value: this.values[column] });\n });\n\n return values;\n }", "title": "" }, { "docid": "6efe4bac00515f730c26f1035a396f89", "score": "0.6259357", "text": "function toObjects(df) {\n return _.map(df.rows, row => _.zipObject(df.header, row))\n}", "title": "" }, { "docid": "e6f006559c319b6326c0f001bb34c833", "score": "0.6154448", "text": "function get_columns(data, attrs) {\r\n\treturn data.map(row => attrs.reduce((acc, v) => ({ ...acc, [v]: row[v] }), {}));\r\n}", "title": "" }, { "docid": "1c030ba6b2c9441cb940c2d29b88fd15", "score": "0.60891265", "text": "function getColumnNames()\r\n{\r\n\tvar $table \t\t\t\t= $(\"#ObjectCustDetailsGrid_Id_\" + custScrPageRef);\r\n\tvar rowIds\t\t\t\t= $table.jqGrid('getDataIDs');\r\n\tvar myArr\t\t\t\t= [];\r\n\tfor(var i = 0 ; i < rowIds.length ; i++)\r\n\t{\r\n\t\tvar selectedRowObject = $table.jqGrid('getRowData',rowIds[i]);\r\n\t\tif(selectedRowObject[\"columnNameComboDesc\"] != null && selectedRowObject[\"columnNameComboDesc\"]!='' )\r\n\t\t{\r\n\t\t\tmyArr.push(selectedRowObject[\"columnNameComboDesc\"]);\r\n\t\t}\r\n\t}\r\n\treturn myArr;\r\n}", "title": "" }, { "docid": "6410e819ed04741e6e8ad20e2fd31439", "score": "0.5977464", "text": "function _rowsFromSqlDataObject(object) {\n let data = {};\n let i = 0;\n\n for (let valueArray of object.values) {\n data[i] = {};\n let j = 0;\n for (let column of object.columns) {\n Object.assign(data[i], {[column]: valueArray[j]});\n j++;\n }\n i++;\n }\n\n return data;\n}", "title": "" }, { "docid": "837f7b8d7c3a09b31e52809177a5c99c", "score": "0.59666383", "text": "function getKeys(keyColumns, dataRow)\n{\n var keys = [];\n for (var i = 0; i < keyColumns.length; i++)\n {\n var v = dataRow[keyColumns[i]];\n keys[keys.length] = v;\n }\n return keys;\n}", "title": "" }, { "docid": "1b8a7e32892f8347181776149ee2267f", "score": "0.595889", "text": "function findAllColumnNames(rows) {\n const columnNames = []\n\n for (let i = 0; i < rows.length; i++) {\n for (let key in rows[i]) {\n if (columnNames.includes(key)) {\n continue\n }\n\n columnNames.push(key)\n }\n }\n\n return columnNames\n}", "title": "" }, { "docid": "0d4a143b8e0e429cda61cc9306a1e552", "score": "0.59459585", "text": "function inferColumns(rows) {\n\t\t var columnSet = Object.create(null),\n\t\t columns = [];\n\n\t\t rows.forEach(function(row) {\n\t\t for (var column in row) {\n\t\t if (!(column in columnSet)) {\n\t\t columns.push(columnSet[column] = column);\n\t\t }\n\t\t }\n\t\t });\n\n\t\t return columns;\n\t\t }", "title": "" }, { "docid": "037dc4a1ac93625fb0dbc6c82419f766", "score": "0.5932512", "text": "_toArray(obj) {\n if (obj == null) {\n return [];\n }\n return Object.keys(obj).map(function(key) {\n return obj[key];\n });\n }", "title": "" }, { "docid": "037dc4a1ac93625fb0dbc6c82419f766", "score": "0.5932512", "text": "_toArray(obj) {\n if (obj == null) {\n return [];\n }\n return Object.keys(obj).map(function(key) {\n return obj[key];\n });\n }", "title": "" }, { "docid": "e2b2823ec74f707f8dc36a1d40ea626d", "score": "0.59261477", "text": "_toArray(obj) {\n if (obj == null) {\n return [];\n }\n\n return Object.keys(obj).map(function (key) {\n return obj[key];\n });\n }", "title": "" }, { "docid": "ad78203c3f7a65dffea968c9f6df3db9", "score": "0.59256357", "text": "function inferColumns(rows){var columnSet=Object.create(null),columns=[];rows.forEach(function(row){for(var column in row){if(!(column in columnSet)){columns.push(columnSet[column]=column)}}});return columns}", "title": "" }, { "docid": "a18b9b4011f0ae13e5f1f0d55f8ab088", "score": "0.59241676", "text": "_toArray(obj) {\n if (obj == null) {\n return [];\n }\n return Object.keys(obj).map(function (key) {\n return obj[key];\n });\n }", "title": "" }, { "docid": "a18b9b4011f0ae13e5f1f0d55f8ab088", "score": "0.59241676", "text": "_toArray(obj) {\n if (obj == null) {\n return [];\n }\n return Object.keys(obj).map(function (key) {\n return obj[key];\n });\n }", "title": "" }, { "docid": "56a9a9751436ffae289c872584af5b37", "score": "0.5898664", "text": "function converToObject(columns) {\n var tables = {};\n\n columns.forEach(column => {\n if (!tables[column[2]]) { //Si no se encuentra dentro de nuestro objeto lo agregamos al objeto\n tables[column[2]] = []; //Hacemos un array con el nombre de la tabla en la columas\n }\n tables[column[2]].push([column[3],column[4]]);\n });\n console.log(tables);\n return tables; //Regresamos el objeto\n}", "title": "" }, { "docid": "dd080679970a4aa10602b86e758dd364", "score": "0.589236", "text": "function columnsToObjects(ids, names, codes){\n var categories = []\n for(var i=0; i<ids.length;i++){\n var category = {};\n category.id = ids[i];\n category.name = names[i];\n category.code = codes[i];\n categories.push(category);\n }\n showCategories(categories);\n}", "title": "" }, { "docid": "c33c11f0539470234d26409f3b548409", "score": "0.58894646", "text": "function gettingCollumNames(obj){ \r\n var array = [];\r\n if(typeof obj != \"undefined\" && obj != null && obj.length > 0){\r\n array = Object.keys(obj[0]);\r\n } \r\n return array;\r\n }", "title": "" }, { "docid": "47c454a87113076c74991e1d2fde6434", "score": "0.58891577", "text": "function inferColumns(rows) {\n\t var columnSet = Object.create(null),\n\t columns = [];\n\t\n\t rows.forEach(function(row) {\n\t for (var column in row) {\n\t if (!(column in columnSet)) {\n\t columns.push(columnSet[column] = column);\n\t }\n\t }\n\t });\n\t\n\t return columns;\n\t }", "title": "" }, { "docid": "929e6525465a24dde65f33c9a1bb3cb7", "score": "0.58825785", "text": "function getColumnHeaderArray () {\n\tvar initial_row = 0;\n\tvar cellIndex;\n\tvar colHeaderArray = [];\n\tfor (var C = range.s.c; C <= range.e.c; ++C) {\n\t\tvar cell_address = {c:C,r:initial_row};\n\t\tvar cell_ref = XLSX.utils.encode_cell(cell_address);\n\t\tvar cell_object = workSheet[cell_ref];\n\t\tcolHeaderArray.push(cell_object.v);\n\t}\n\treturn colHeaderArray;\n}", "title": "" }, { "docid": "d4c7764545bbc9bd96c4d9e8bc28e062", "score": "0.5878323", "text": "function fromObjects(objects, header) {\n return _.map(objects, o => {\n return _.map(header, col => o[col])\n })\n}", "title": "" }, { "docid": "2d276b1a8a3f58ed3435a2f11b860c5c", "score": "0.5869814", "text": "function objToArrayOfObj(data) {\n\tvar results = [];\n\tfor(key in data) {\n\t\tif(data.hasOwnProperty(key)) {\n\t\t\tdata[key].DT_RowId = key;\n\t\t\tresults.push(data[key]);\n\t\t}\n\t}\n\treturn results;\n}", "title": "" }, { "docid": "2a2eba430dfdb56f143fe19dd5ef33af", "score": "0.58536166", "text": "function inferColumns(rows) {\n\t var columnSet = Object.create(null),\n\t columns = [];\n\n\t rows.forEach(function(row) {\n\t for (var column in row) {\n\t if (!(column in columnSet)) {\n\t columns.push(columnSet[column] = column);\n\t }\n\t }\n\t });\n\n\t return columns;\n\t }", "title": "" }, { "docid": "ceb9fd876115acbec1431b64939b3139", "score": "0.5834755", "text": "function getHeaders() {\r\n\t\t\t\tvar colHeaders = [];\r\n\t\t\t\tfor (var i = 0; i < table.cols.headers.length; i++)\r\n\t\t\t\t\tcolHeaders.push({\r\n\t\t\t\t\t\t\"sTitle\": table.cols.headers.name[i],\r\n\t\t\t\t\t\t\"aTargets\": [i]\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\treturn colHeaders;\r\n\t\t\t}", "title": "" }, { "docid": "7a22387ef399acef9af6dbbbb0003e93", "score": "0.5819752", "text": "getDataArray(keys) {\n \treturn keys.map(name => {\n \t\treturn { name: name, y: this.data[name] };\n \t})\n }", "title": "" }, { "docid": "64b4466bafc43db9e7247a624d2f5674", "score": "0.57528627", "text": "function inferColumns(rows) {\n\t var columnSet = Object.create(null),\n\t columns = [];\n\t\n\t rows.forEach(function(row) {\n\t for (var column in row) {\n\t if (!(column in columnSet)) {\n\t columns.push(columnSet[column] = column);\n\t }\n\t }\n\t });\n\t\n\t return columns;\n\t}", "title": "" }, { "docid": "64b4466bafc43db9e7247a624d2f5674", "score": "0.57528627", "text": "function inferColumns(rows) {\n\t var columnSet = Object.create(null),\n\t columns = [];\n\t\n\t rows.forEach(function(row) {\n\t for (var column in row) {\n\t if (!(column in columnSet)) {\n\t columns.push(columnSet[column] = column);\n\t }\n\t }\n\t });\n\t\n\t return columns;\n\t}", "title": "" }, { "docid": "a515f1472c5e5dbf5959a4cb0180289d", "score": "0.57442117", "text": "async _getFields() {\n\n\t\tlet rows;\n\n\t\ttry {\n\t\t\t[rows] = await this.knex.raw(`SHOW COLUMNS FROM ${this.table};`);\n\t\t} catch(error) {\n\t\t\tthrow new QueryBuilderError('Can\\'t get Table information from Database', QueryBuilderError.codes.INVALID_TABLE);\n\t\t}\n\n\t\tconst fields = {};\n\n\t\t// If Rows format is an array (no post-process in Knex Config, by Default)\n\t\tif(Array.isArray(rows)) {\n\t\t\tfor(const field of rows)\n\t\t\t\tfields[field.Field] = field;\n\t\t} else {\n\t\t\t// If Rows format is an Object (post-process in Knex Config)\n\t\t\tObject.entries(rows).forEach(([field, value]) => {\n\t\t\t\tfields[rows[field].Field] = value;\n\t\t\t});\n\t\t}\n\n\t\treturn fields;\n\t}", "title": "" }, { "docid": "bec5387cff889eadd72d3bdeb687d8c8", "score": "0.5736477", "text": "getColumns() {\n return ['title', 'key', 'guid'];\n }", "title": "" }, { "docid": "68ec0a9938b4293e59243fd8fe33b0f4", "score": "0.5736204", "text": "function inferColumns(rows) {\n\t var columnSet = Object.create(null),\n\t columns = [];\n\n\t rows.forEach(function(row) {\n\t for (var column in row) {\n\t if (!(column in columnSet)) {\n\t columns.push(columnSet[column] = column);\n\t }\n\t }\n\t });\n\n\t return columns;\n\t}", "title": "" }, { "docid": "68ec0a9938b4293e59243fd8fe33b0f4", "score": "0.5736204", "text": "function inferColumns(rows) {\n\t var columnSet = Object.create(null),\n\t columns = [];\n\n\t rows.forEach(function(row) {\n\t for (var column in row) {\n\t if (!(column in columnSet)) {\n\t columns.push(columnSet[column] = column);\n\t }\n\t }\n\t });\n\n\t return columns;\n\t}", "title": "" }, { "docid": "68ec0a9938b4293e59243fd8fe33b0f4", "score": "0.5736204", "text": "function inferColumns(rows) {\n\t var columnSet = Object.create(null),\n\t columns = [];\n\n\t rows.forEach(function(row) {\n\t for (var column in row) {\n\t if (!(column in columnSet)) {\n\t columns.push(columnSet[column] = column);\n\t }\n\t }\n\t });\n\n\t return columns;\n\t}", "title": "" }, { "docid": "68ec0a9938b4293e59243fd8fe33b0f4", "score": "0.5736204", "text": "function inferColumns(rows) {\n\t var columnSet = Object.create(null),\n\t columns = [];\n\n\t rows.forEach(function(row) {\n\t for (var column in row) {\n\t if (!(column in columnSet)) {\n\t columns.push(columnSet[column] = column);\n\t }\n\t }\n\t });\n\n\t return columns;\n\t}", "title": "" }, { "docid": "68ec0a9938b4293e59243fd8fe33b0f4", "score": "0.5736204", "text": "function inferColumns(rows) {\n\t var columnSet = Object.create(null),\n\t columns = [];\n\n\t rows.forEach(function(row) {\n\t for (var column in row) {\n\t if (!(column in columnSet)) {\n\t columns.push(columnSet[column] = column);\n\t }\n\t }\n\t });\n\n\t return columns;\n\t}", "title": "" }, { "docid": "b93aa85764180d3e1390606a8b0ab095", "score": "0.573158", "text": "function addAllColumnHeadersJson(arr, table) {\n var columnSet = [],\n tr = trAJAX.cloneNode(false);\n for (var i = 0, l = arr.length; i < l; i++) {\n for (var key in arr[i]) {\n if (arr[i].hasOwnProperty(key) && columnSet.indexOf(key) === -1) {\n columnSet.push(key);\n var th = thAJAX.cloneNode(false);\n th.appendChild(document.createTextNode(key));\n tr.appendChild(th);\n }\n }\n }\n table.appendChild(tr);\n return columnSet;\n}", "title": "" }, { "docid": "c33daeafe9b1672c384ff1a60ca197bc", "score": "0.5721844", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null), columns = [];\n rows.forEach(function (row) {\n for (var column in row) {\n if (!((column in columnSet))) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n return columns;\n }", "title": "" }, { "docid": "e64235f4276254ec8bf9ffb694998acd", "score": "0.57003266", "text": "keys(){\n var keys = [];\n for(var i = 0; i<this.data.length; i++){\n if(this.data[i] != undefined){\n if(this.data[i].length>1){\n for(var j = 0; j<this.data[i].length; j++){\n keys.push(this.data[i][j][0])\n }\n }else{\n keys.push(this.data[i][0][0]);\n }\n }\n }\n return keys;\n }", "title": "" }, { "docid": "723be2bf2051b58f646b831297e46ccf", "score": "0.5698867", "text": "function ds_cols(ds) {\n //Object.keys(data1[0]).filter(function (k) { return k != \"State\" })\n return Object.keys(ds[0])\n}", "title": "" }, { "docid": "ad52184430b8d96abe83926613dec949", "score": "0.5697577", "text": "keys() {\n const keysArray = [];\n for (let i = 0; i < this.data.length; i++) {\n if(this.data[i]) {\n keysArray.push(this.data[i][0][0])\n }\n }\n return keysArray\n }", "title": "" }, { "docid": "8646d67eb11c251201a031ca76d38554", "score": "0.5695569", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n }", "title": "" }, { "docid": "8646d67eb11c251201a031ca76d38554", "score": "0.5695569", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n }", "title": "" }, { "docid": "8646d67eb11c251201a031ca76d38554", "score": "0.5695569", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n }", "title": "" }, { "docid": "8646d67eb11c251201a031ca76d38554", "score": "0.5695569", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n }", "title": "" }, { "docid": "8646d67eb11c251201a031ca76d38554", "score": "0.5695569", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n }", "title": "" }, { "docid": "8646d67eb11c251201a031ca76d38554", "score": "0.5695569", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n }", "title": "" }, { "docid": "61b00f62bb20ce8cc9a11e6a22aafcda", "score": "0.5691594", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function (row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n }", "title": "" }, { "docid": "d27f277b851bd3670b521fae567a6447", "score": "0.56866217", "text": "function getData() {\r\n\t\t\t\tif (typeof(table.rawData) != 'undefined')\r\n\t\t\t\t\treturn table.rawData;\r\n\r\n\t\t\t\tvar result = [];\r\n\r\n\t\t\t\tfor (var i = 0; i < table.rows.length; i++) {\r\n\t\t\t\t\tvar nkey = table.rows.keys && table.rows.keys[i] || i;\r\n\t\t\t\t\tvar row = [];\r\n\r\n\t\t\t\t\tfor (var j = 0; j < table.cols.length; j++) {\r\n\t\t\t\t\t\tvar mkey = table.cols.keys && table.cols.keys[j] || j;\r\n\t\t\t\t\t\trow.push(table.data[mkey][nkey]);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresult.push(row);\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn result;\t\r\n\t\t\t}", "title": "" }, { "docid": "8f8790a17cc226b405f1d7b58ddb4478", "score": "0.56810606", "text": "function getCabecera(conn, results) {\r\n let cabecera = results.resultSet.metaData;\r\n //console.log(cabecera.length)\r\n arrayHeader = cabecera.map(item => {\r\n return { header: item.name, key: item.name };\r\n });\r\n //console.log(arrayHeader);\r\n}", "title": "" }, { "docid": "9c8b4a04efa1068e133e8ed331a72e52", "score": "0.5665721", "text": "function colToRows(x) {\n var colnames = d3.keys(x);\n if (colnames.length === 0)\n return [];\n\n var newdata = [];\n for (var i=0; i < x[colnames[0]].length; i++) {\n var row = {};\n for (var j=0; j < colnames.length; j++) {\n var colname = colnames[j];\n row[colname] = x[colname][i];\n }\n newdata[i] = row;\n }\n\n return newdata;\n }", "title": "" }, { "docid": "312fdcb93c36f79c99f33552bbda74a0", "score": "0.5644842", "text": "function pivot_object(obj, key_column_name, value_column_name) {\n /* \n This function pivots a key-value object into an array that can be\n made into a table, by introducing column names for the key and value\n\n e.g. pivot_object({\"michael\": 10, \"edith\": 7}, \"name\", \"age\")\n returns [{\"name\": \"michael\", \"age\": 10}, {\"name\": \"edith\", \"age\": 7}]\n */\n\n let obj_pivoted = [];\n let obj_keys = Object.keys(obj);\n\n for (let len=obj_keys.length, i=0; i<len; i++) {\n obj_pivoted.push({\n [key_column_name]: obj_keys[i],\n [value_column_name]: obj[obj_keys[i]]\n });\n }\n return obj_pivoted;\n}", "title": "" }, { "docid": "4385352291ba176b3729207f47ad581c", "score": "0.56364787", "text": "function to_array(obj) {\n return Object.keys(obj).map(function (key) {\n return obj[key];\n });\n}", "title": "" }, { "docid": "d9aa3bfe91ea39b139857c1a0ff8eac1", "score": "0.56346005", "text": "function makeObject(row,headers){var ret={};headers=headers||[];if(typeof headers==='undefined'){for(var j=0;j<row.length;j++){headers[j.toString()]=j;}}for(var i=0;i<headers.length;i++){var key=headers[i];var val=row[i];ret[key]=val;}return ret;}", "title": "" }, { "docid": "37a04d45a9fe68162a4e131b8cc691ee", "score": "0.56241816", "text": "function get_data_(sheet, column_names) {\n var data = [];\n var max_row = sheet.getLastRow();\n for (var row_num = 2; row_num <= max_row; row_num++) { // indexed from 1, skip header row\n var row = sheet.getRange(row_num + \":\" + row_num).getValues();\n var row_data = {};\n for (var column_index = 0; column_index < column_names.length; column_index++) {\n var column_name = column_names[column_index];\n if ( column_name != \"\" ){\n row_data[column_name] = row[0][column_index];\n }\n };\n data.push(row_data);\n };\n return data;\n}", "title": "" }, { "docid": "240e7cb1bd6edb20037bd681a0f592f7", "score": "0.56013024", "text": "function getColumns() {\n\n //Since columnmap is an '@' property in this example (to demonstrate we can do that)\n //we need to convert it to an object.\n //Can use $scope.$eval or $parse service ($parse is in another example)\n //See https://docs.angularjs.org/guide/expression\n vm.columnmap = $scope.$eval(vm.columnmap);\n\n if (vm.columnmap) {\n //Use columnmap to handle displaying columns\n vm.columnmap.forEach(function(map) {\n if (!map.hidden) {\n for (var prop in map) {\n if (prop !== 'hidden') pushColumns(prop, map[prop]);\n }\n }\n });\n }\n else {\n //No column map so default to raw properties\n for (var prop in vm.datasource[0]) {\n pushColumns(prop, prop);\n }\n }\n }", "title": "" }, { "docid": "b5d83efeee257e49e839f2c1eab425d1", "score": "0.56009024", "text": "function keys() {\n return new lift_1.ArrayOps(Object.keys(this.value()));\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" }, { "docid": "fb5b5c1d81687f6550106bcee39ab5f5", "score": "0.5595539", "text": "function inferColumns(rows) {\n var columnSet = Object.create(null),\n columns = [];\n\n rows.forEach(function(row) {\n for (var column in row) {\n if (!(column in columnSet)) {\n columns.push(columnSet[column] = column);\n }\n }\n });\n\n return columns;\n}", "title": "" } ]
15ab3e8d4a19bb0e19a9cd779ca2d9e8
Parses successfully if the given rule does not match the input at the current location
[ { "docid": "05e5c860497575b70d31fc3218be3d68", "score": "0.0", "text": "function not(rule) {\n return new Not(RuleTypeToRule(rule));\n }", "title": "" } ]
[ { "docid": "7e21c4ab7c96b6a77656054e25642037", "score": "0.6255743", "text": "function\trule()\n{\n\t/*\n\t *\tPARSING\n\t */\n}", "title": "" }, { "docid": "0f90d7b39584f113a42d6e98fd5653e6", "score": "0.6216977", "text": "function unsuccessful(state) {\n // Fall back to the parent rule until you get to an optional or list rule or\n // until the entire stack of rules is empty.\n while (state.rule && !(Array.isArray(state.rule) && state.rule[state.step].ofRule)) {\n popRule(state);\n }\n\n // If there is still a rule, it must be an optional or list rule.\n // Consider this rule a success so that we may move past it.\n if (state.rule) {\n advanceRule(state, false);\n }\n}", "title": "" }, { "docid": "0f90d7b39584f113a42d6e98fd5653e6", "score": "0.6216977", "text": "function unsuccessful(state) {\n // Fall back to the parent rule until you get to an optional or list rule or\n // until the entire stack of rules is empty.\n while (state.rule && !(Array.isArray(state.rule) && state.rule[state.step].ofRule)) {\n popRule(state);\n }\n\n // If there is still a rule, it must be an optional or list rule.\n // Consider this rule a success so that we may move past it.\n if (state.rule) {\n advanceRule(state, false);\n }\n}", "title": "" }, { "docid": "0b9ad53c64ad94c580ac9c2c27157642", "score": "0.59880584", "text": "function checkRule(x)\n{\n\tvar s, r ;\n\ts = maxArgumentsToString(arguments, true);\n\t//s2 = maxArgumentsToString(arguments, true);\n\t//post(s, \"\\n\");\n\toutlet(MESSAGE_OUTLET, s.concat(\" is a correct rule\"));\n\tmyCurrentExpression = new FR(s);\n\tr = myCurrentExpression.FR_SplitInitialStatement()\n\t//myCurrentExpression.FR_displayRuleElements();\n}", "title": "" }, { "docid": "dc1f44f2c58093c8f033eb1ebfd0b111", "score": "0.5973743", "text": "function check(lex, rule) {\n\tvar match = rule[0].exec(lex.remaining);\n\tif (match !== null) {\n\t\t// advance the index\n\t\tvar advancement = match[0].length;\n\n\t\tvar result = rule[1](match[0], lex, function (modification) {\n\t\t\tmatch[0] = modification;\n\t\t}, function (increment) {\n\t\t\tadvancement += increment;\n\t\t});\n\t\tif (result !== false) {\n\t\t\tif (result instanceof Array) {\n\t\t\t\t// multiple tokens returned\n\t\t\t\tfor (var i = 0, len = result.length; i < len; i++) {\n\t\t\t\t\tlex.literals.push(false);\n\t\t\t\t\tlex.tokens.push(result[i]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (WHITESPACE.indexOf(result) > -1) {\n\t\t\t\t\tlex.literals.push(false);\n\t\t\t\t} else {\n\t\t\t\t\tlex.literals.push(match[0]);\n\t\t\t\t}\n\t\t\t\tlex.tokens.push(result);\n\t\t\t}\n\t\t}\n\t\treturn advancement;\n\t} else {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "ab7a11c76fdc04285a906c15720aee18", "score": "0.5964957", "text": "function validate(inputElement, rule) {\n var errorMessage;\n var errorElement = getParentElement(inputElement,option.formSelector).querySelector(option.errorSelector)\n \n //lay ra cac rules của selector\n var rules = selectorRules[rule.selector];\n \n //lặp qua từng rule và kiểm tra\n // nếu có lỗi, thì dừng việc kiểm tra\n for (var i = 0; i < rules.length; i++) {\n errorMessage = rules[i](inputElement.value)\n if (errorMessage) break;\n }\n if (errorMessage) {\n errorElement.innerText = errorMessage\n getParentElement(inputElement,option.formSelector).classList.add('invalid')\n } else {\n errorElement.innerText = ''\n getParentElement(inputElement,option.formSelector).classList.remove('invalid')\n \n }\n return !errorMessage;\n }", "title": "" }, { "docid": "198765171ef5a2cbe11290b8f50c1fe1", "score": "0.5711679", "text": "function parse_string(string, rules) {\n var pos = 0;\n var max_streak = 0;\n var most_likely_error = {};\n \n function visit_rule_opt(rule, reject_ast, attempt)\n {\n // Keep track of what we've read; this is also what we'll return\n var ast = reject_ast;\n \n function backtrack(errtxt, heuristic) // Backtracking might happen. Oh noes.\n {\n if (pos >= max_streak && errtxt != undefined && errtxt) {\n if (pos > max_streak)\n most_likely_error = {};\n if (most_likely_error[errtxt] == undefined)\n most_likely_error[errtxt] = 0;\n most_likely_error[errtxt] = Math.max(most_likely_error[errtxt], heuristic);\n max_streak = pos;\n }\n \n // Start throwing away stuff we parsed until we're out of options.\n while (ast.length)\n {\n var olditem = ast[ast.length - 1];\n \n if (olditem == undefined)\n throw \"a fit\";\n \n // We can't do anything else to regular tokens. Drop them until we reach something that can be reinterpreted.\n if (olditem.type != \"rule\") {\n ast.pop();\n continue;\n }\n \n // Otherwise, we're at a rule. Try to re-read it.\n var different_ast = visit_rule(olditem.name, rules[olditem.name], olditem);\n \n // If that succeeded, yay! Read the rest of this rule.\n if (different_ast != null) {\n ast[ast.length - 1] = different_ast; // Keep the new interpretation\n return true; // Continue parsing from here\n }\n \n // Otherwise, if we couldn't do anything more from this token...\n ast.pop(); // Just throw it away and backtrack some more.\n }\n \n // The only way that loop terminated is if we threw out everything...\n return false; // Give up; retrying the whole rule from scratch won't help.\n }\n \n // If we have been down this road before, but yielded nothing useful\n if (ast.length) // This means we read an ast correctly, but it was junk, anyway. Backtrack.\n if (!backtrack(\"Extra symbols at end of input\", 10)) // If we fail to backtrack\n return null; // Give up. Our caller will backtrack.\n \n \n // An item is either a \"<rule>\", a regular \"token\", or \" \" (meaning any amount of whitespace). \n for (var i = ast.length; i < rule.length; ++i)\n {\n var item = rule[i];\n // Stash our position in case backtracking is required\n var spos = pos;\n // Check if our item is itself a rule.\n if (item in rules)\n {\n // Save ourselves some work, yeah?\n if (attempt) {\n if (i < attempt.length && attempt[i].pos == pos && attempt[i].type == \"rule\" && attempt[i].name == item) {\n ast[i] = attempt[i];\n pos = attempt[i].epos;\n continue;\n }\n // We couldn't use our previous attempt this time; get rid of it.\n attempt = null;\n }\n \n // Parse the rule.\n var stree = visit_rule(item, rules[item], (i < ast.length)? ast[i] : null);\n \n if (stree == null) { // We've hit a wall; backtrack.\n if (!backtrack(\"Expected \" + item, i)) // If we couldn't backtrack, then abort; this rule is a dud.\n return null; // Our caller will take care of incrementing the rule option.\n i = ast.length - 1;\n continue;\n }\n // We successfully parsed our sub-rule. Add it to our AST, and hope we're where we're supposed to be.\n ast[i] = stree;\n continue;\n }\n else if (item == \" \") {\n // Skip any and all whitespace, not just one space (\\s*).\n var spos = pos;\n while (/\\s/.test(string[pos])) ++pos;\n ast[i] = { type: \"white\", pos: spos, epos: pos, name: \" \" };\n continue; // Move on to the next item in this rule\n }\n else {\n if (string.substr(pos, item.length) != item) { // If the expected token isn't encountered, we've made a mistake.\n if (!backtrack(\"Expected `\" + item + \"'\", i)) // If we couldn't backtrack, then abort; this rule is a dud.\n return null; // Our caller will take care of incrementing the rule option.\n i = ast.length - 1;\n continue;\n }\n \n // Keep valid with our previous attempt\n if (attempt) {\n if (i < attempt.length && attempt[i].pos == pos && attempt[i].type == \"token\" && attempt[i].name == item) {\n ast[i] = attempt[i];\n pos = attempt[i].epos;\n continue;\n }\n attempt = null;\n }\n \n // We successfully read a token! Skip it, push it.\n pos += item.length;\n ast[i] = { type: \"token\", name: item, pos: spos, epos: pos }\n }\n }\n return ast;\n }\n \n var tolerance = 64;\n var worthless_nests = 0;\n var last_position = 0;\n \n /**\n * Attempt to parse an entire compound rule.\n * @param rule_name The name of the rule. This is used in error reporting and optimization.\n * @param whole_rule The actual content of the rule; this is an array of different possible rule branches.\n * The branches are themselves arrays. An example would be [[\"<A>\"], [\"<A>\", \"+\", \"<A>\"]].\n * @param reject_ast An AST which was previously parsed but was incorrect, and so requires backtracking.\n * @return Returns the most immediate AST after any backtracking from the given reject AST. If no further\n * valid ASTs could be formed, the return value is null.\n **/\n function visit_rule(rule_name, whole_rule, reject_ast) {\n var ast = reject_ast;\n var nonnullsub = null;\n var offset = 0;\n \n if (pos > last_position) { last_position = pos; worthless_nests = 0; }\n if (++worthless_nests >= tolerance) { --worthless_nests; return null; }\n \n if (ast != null) {\n nonnullsub = ast.ast;\n pos = ast.pos;\n if (ast.type != \"rule\" || ast.ind == undefined) {\n if (worthless_nests > 0) --worthless_nests;\n return null;\n }\n // Attempt to get a new AST from the same rule we used last time.\n var different_ast = visit_rule_opt(whole_rule[ast.ind], ast.ast, null);\n // If we successfully obtained a new AST, use it.\n if (different_ast != null) {\n if (worthless_nests > 0) --worthless_nests;\n return { ind: ast.ind, type: \"rule\", name: rule_name, ast: different_ast, pos: ast.pos, epos: pos };\n }\n // At this point, we've failed to reinterpret this path of our rule. Continue on to new paths.\n offset = ast.ind + 1; // If we've exhausted this rule, the next loop will break and null will be returned.\n }\n \n // Loop through each option in this rule, attempting to parse by it.\n for (var i = offset; i < whole_rule.length; ++i) {\n var rule = whole_rule[i];\n var spos = pos;\n var ap = visit_rule_opt(rule, [], nonnullsub);\n if (ap != null) {\n if (worthless_nests > 0) --worthless_nests;\n return ({ ind: i, type: \"rule\", name: rule_name, ast: ap, pos: spos, epos: pos });\n }\n pos = spos;\n }\n \n if (worthless_nests > 0) --worthless_nests;\n return null;\n }\n \n sqwat = 0;\n brute_rule = [];\n for (var r in rules)\n brute_rule.push([r]);\n var res = visit_rule(\"<>\", brute_rule, null);\n while (pos < string.length) {\n if (res == null) break;\n res = visit_rule(\"<>\", brute_rule, res);\n }\n \n if (!res) {\n if (most_likely_error) {\n var encompassed = string.substr(0, max_streak);\n var line = (encompassed.match(/(\\r\\n|\\n|\\r)/g) || []).length + 1;\n var errpos = max_streak - Math.max(encompassed.lastIndexOf(\"\\n\"), encompassed.lastIndexOf(\"\\r\"));\n var ec = 0;\n var the_most_likely_error = \"[No error text]\";\n for (err in most_likely_error)\n if (most_likely_error[err] > ec) {\n the_most_likely_error = err;\n ec = most_likely_error[err];\n } else if (most_likely_error[err] == ec)\n the_most_likely_error += \" OR \" + err;\n res = { type: \"error\", error: the_most_likely_error, line: line, position: errpos }\n console.log(most_likely_error);\n }\n }\n \n return res;\n}", "title": "" }, { "docid": "b2845a68ba29a256fe1c75691c29d001", "score": "0.56627566", "text": "parseRule(rule) {\n\n //Ensure object\n if (typeof rule !== 'object') {\n throw new Error(`Invalid rule: ${rule}`);\n }\n\n //Extract data\n let {field, validator, type, message, arg, args} = rule;\n\n //Must have field\n if (typeof field === 'undefined') {\n throw new Error('Missing field for validation rule');\n }\n\n //Must have validator\n if (typeof validator === 'undefined') {\n throw new Error(`Missing validator for ${field} validation`);\n }\n\n //String? Assume validation function with no options\n if (typeof validator === 'string') {\n if (typeof validators[validator] === 'undefined') {\n throw new Error(`Unknown validator: ${validator}`);\n }\n validator = validators[validator];\n }\n\n //Invalid validator?\n if (typeof validator !== 'function') {\n throw new Error(`Invalid validator for '${field}' validation`);\n }\n\n //No type? Use validator function name\n if (!type) {\n type = validator.name;\n }\n\n //Single argument? Convert to array\n if (typeof arg !== 'undefined') {\n args = [arg];\n }\n\n //Ensure array\n if (!Array.isArray(args)) {\n args = [];\n }\n\n //Return parsed\n return {field, validator, args, type, message};\n }", "title": "" }, { "docid": "744a4f3b441845ac8cf42dfb57a69aee", "score": "0.56145555", "text": "function checkAtrule(_i) {\n var start = _i,\n l;\n\n if (tokens[start].atrule_l !== undefined) return tokens[start].atrule_l;\n\n if (l = checkAtruler(_i)) tokens[_i].atrule_type = 1;\n else if (l = checkAtruleb(_i)) tokens[_i].atrule_type = 2;\n else if (l = checkAtrules(_i)) tokens[_i].atrule_type = 3;\n else return fail(tokens[start]);\n\n tokens[start].atrule_l = l;\n\n return l;\n }", "title": "" }, { "docid": "96e4247331432fc0829dd4727028e3bc", "score": "0.55949765", "text": "function testParse(rule, assert, text, shouldPass) { \n if (shouldPass == undefined) shouldPass = true;\n let result = myna.failed;\n let err = undefined; \n try { \n let node = myna.parse(rule, text);\n if (node)\n result = node.end; \n }\n catch (e) {\n if (e.type !== 'ParserError') {\n throw e;\n }\n err = e;\n }\n\n let testResult = {\n name : rule.toString() + ' with input \"' + text + '\"',\n description : result + \"/\" + text.length,\n negative : !shouldPass,\n success : (result == text.length) ^ !shouldPass,\n error : err,\n ruleDescr : rule.type + \": \" + rule.toString(),\n rule : rule \n };\n \n if (!testResult.success)\n console.log(testResult);\n\n assert.ok(testResult.success, testResult.name + (shouldPass ? \"\" : \" should fail\"));\n }", "title": "" }, { "docid": "6fac28df244ed8ea91cf21f4b5d5d63f", "score": "0.55745125", "text": "function addRule(x)\n{\n\tvar i, j, n, s, isAlreadyAdded, x, y, c_result;\n\ts = maxArgumentsToString(arguments, true);\n\tif (s != \"\")\n\t{\n\t\t//MODIFICATION APRIL 30TH 2008//\n\t\t//WE CHECK IF THE RULE IS NOT ALREADY ADDED//\n\t\tisAlreadyAdded = false;\n\t\tn = myRules.length;\n\t\ti = 0;\n\t\tif (n > 0)\n\t\t{\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif (myRules[i].FR_IsDifferentRule(s) == false)\n\t\t\t\t{\n\t\t\t\t\tisAlreadyAdded = true;\n\t\t\t\t\t//post(\"Indice trouve =\", i, \"\\n\");\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t} while ((i < n) && (isAlreadyAdded == false))\n\t\t}\n\t\t\n/*\t\tfor (i = 0; i < n; i++)\n\t\t{\n\t\t\tif (myRules[i].FR_IsDifferentRule(s) == false)\n\t\t\t{\n\t\t\t\tisAlreadyAdded = true;\n\t\t\t}\n\t\t}\n*/\n\t\tif (isAlreadyAdded == false)\n\t\t{\n\t\t\tvar r = new FR(s);\n\t\t\t//r.FR_displayRuleElements();\n\t\t\tc_result = r.FR_SplitInitialStatement();\n\t\t\t//post(\"c_result = \", c_result, \"\\n\");\n\t\t\tif (c_result > IS_NONE)\n\t\t\t{\n\t\t\t\tmyRules.push(r);\n\t\t\t\t//MODIFICATION APRIL 29TH 2008//\n\t\t\t\t//AS SOON AS A RULE IS ADDED, NODES GET CURRENT VALUES FROM LV AND FSS//\n\t\t\t\tn = myRules.length;\n\t\t\t\tfor (j = 0; j < myFSSNames.length; j++)\n\t\t\t\t{\n\t\t\t\t\tfor (i = 0; i < myFSSNames[j].length; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//post(myFSSNames.length, myFSSNames[j].length, \"\\n\");\n\t\t\t\t\t\t//post(myLVNames[j], myFSSNames[j][i], myFSSIntersectionValues[j][i], \"\\n\");\n\t\t\t\t\t\t//myRules[n-1].FR_setLeafValue(myLVNames[j], myFSSNames[j][i], myFSSIntersectionValues[j][i]);\n\t\t\t\t\t\tx = myLV[j].LV_GetCurrentDataValue();\n\t\t\t\t\t\ty = myLV[j].modellingFSS[i].FSS_GetMembershipValue(x);\n\t\t\t\t\t\t//post(myLVNames[j], \" \", myFSSNames[j][i], \" \", y);\n\t\t\t\t\t\tmyRules[n-1].FR_setLeafValue(myLVNames[j], myFSSNames[j][i], y);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//post(\"Fuzzy rule => \", s ,\" taken into account\\n\");\n\t\t\t\toutlet(MESSAGE_OUTLET, \"Fuzzy rule => \", s ,\" taken into account\");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//post(\"Fuzzy rule => \", s ,\" already added\\n\");\n\t\t\toutlet(MESSAGE_OUTLET, \"Fuzzy rule => \", s ,\" already added\");\n\t\t}\n\t\t//post(\"Boucles terminées\\n\");\n\t\tcomputeImpactOfInputLV();\n\t\tcomputeImpactOfOutputFSS();\n\t}\n}", "title": "" }, { "docid": "bf9ecd3737c7d3ed03c00d24e3dd152a", "score": "0.5539411", "text": "check(rule) {\n if (rule.selector.includes(this.name)) {\n return !!rule.selector.match(this.regexp())\n }\n\n return false\n }", "title": "" }, { "docid": "6be6e0d84a4c83284e8f7def37ab4731", "score": "0.54726416", "text": "function applyDisallowedRule( rule, element, status ) {\n\t\t// This rule doesn't match this element - skip it.\n\t\tif ( rule.match && !rule.match( element ) )\n\t\t\treturn;\n\n\t\t// No properties - it's an element only rule so it disallows entire element.\n\t\t// Early return is handled in filterElement.\n\t\tif ( rule.noProperties )\n\t\t\treturn false;\n\n\t\t// Apply rule to attributes, styles and classes. Switch hadInvalid* to true if method returned true.\n\t\tstatus.hadInvalidAttribute = applyDisallowedRuleToHash( rule.attributes, element.attributes ) || status.hadInvalidAttribute;\n\t\tstatus.hadInvalidStyle = applyDisallowedRuleToHash( rule.styles, element.styles ) || status.hadInvalidStyle;\n\t\tstatus.hadInvalidClass = applyDisallowedRuleToArray( rule.classes, element.classes ) || status.hadInvalidClass;\n\t}", "title": "" }, { "docid": "3760102ed20cb925e858fb7a5d77f084", "score": "0.5470082", "text": "function visit_rule(rule_name, whole_rule, reject_ast) {\n var ast = reject_ast;\n var nonnullsub = null;\n var offset = 0;\n \n if (pos > last_position) { last_position = pos; worthless_nests = 0; }\n if (++worthless_nests >= tolerance) { --worthless_nests; return null; }\n \n if (ast != null) {\n nonnullsub = ast.ast;\n pos = ast.pos;\n if (ast.type != \"rule\" || ast.ind == undefined) {\n if (worthless_nests > 0) --worthless_nests;\n return null;\n }\n // Attempt to get a new AST from the same rule we used last time.\n var different_ast = visit_rule_opt(whole_rule[ast.ind], ast.ast, null);\n // If we successfully obtained a new AST, use it.\n if (different_ast != null) {\n if (worthless_nests > 0) --worthless_nests;\n return { ind: ast.ind, type: \"rule\", name: rule_name, ast: different_ast, pos: ast.pos, epos: pos };\n }\n // At this point, we've failed to reinterpret this path of our rule. Continue on to new paths.\n offset = ast.ind + 1; // If we've exhausted this rule, the next loop will break and null will be returned.\n }\n \n // Loop through each option in this rule, attempting to parse by it.\n for (var i = offset; i < whole_rule.length; ++i) {\n var rule = whole_rule[i];\n var spos = pos;\n var ap = visit_rule_opt(rule, [], nonnullsub);\n if (ap != null) {\n if (worthless_nests > 0) --worthless_nests;\n return ({ ind: i, type: \"rule\", name: rule_name, ast: ap, pos: spos, epos: pos });\n }\n pos = spos;\n }\n \n if (worthless_nests > 0) --worthless_nests;\n return null;\n }", "title": "" }, { "docid": "2a9e6c01015260d8bc107ca39a4afcd9", "score": "0.5349787", "text": "function checkContinue (prop, idx) {\n if (typeof rule[prop] !== 'number') return\n\n // incr: 1 or -1 (positive/negative continue)\n // offset: 0 or 1 (positive/negative continue)\n function setContinue (incr, offset) {\n // j = current index to be checked\n // count = number of indexes to check\n for (\n var j = i + incr, count = 0, m = Math.abs(cont + offset)\n ; count < m\n ; j += incr, count++\n ) {\n // Scan all rules from the current one to the target one\n var _rule = rules[j]\n\n // Jumping to the last rule is valid\n if (j === n && count === m - 1) return\n\n if (j < 0 || j >= n)\n self._error( new Error('Atok#_resolveRules: ' + prop + '() value out of bounds: ' + cont + getErrorData(i)) )\n\n // Only process rules bound to a group below the current one\n // Or at the same level but different\n if (_rule.group > rule.group\n || (_rule.group === rule.group && _rule.groupStart !== rule.groupStart)\n ) {\n // Get to the right group\n while (_rule.group > rule.group + 1) {\n j = incr > 0 ? _rule.groupEnd + 1 : _rule.groupStart - 1\n // Jump to the end of the rules is ignored\n if (j > n) {\n cont = null\n return\n }\n\n _rule = rules[j]\n }\n j = incr > 0 ? _rule.groupEnd : _rule.groupStart\n cont += incr * (_rule.groupEnd - _rule.groupStart)\n }\n }\n }\n\n // Use the backup value\n var cont = rule.props.continue[idx]\n\n // continue(0) and continue(-1) do not need any update\n if (cont > 0)\n // Positive jump\n setContinue(1, 0)\n else if (cont < -1)\n // Negative jump\n setContinue(-1, 1)\n \n // Check the continue boundaries\n var j = i + cont + 1\n // Cannot jump to a rule before the first one or beyond the last one.\n // NB. jumping to a rule right after the last one is accepted since\n // it will simply stop the parsing\n if (j < 0 || j > n)\n self._error( new Error('Atok#_resolveRules: ' + prop + '() value out of bounds: ' + cont + getErrorData(i)) )\n\n // Save the next rule index\n rule[prop] = cont\n }", "title": "" }, { "docid": "0ec186ac2da70c0331814176479251b5", "score": "0.53288317", "text": "function newRuleError(symbol, expected) {\n var source = symbol.source;\n var startI = symbol.offset;\n var endI = symbol.endOffset;\n var match = source.substring(startI, endI);\n var line = source.getLine(startI);\n var term = symbol.terminal;\n var errMsg = '';\n if (term.isLiteral || util.str.trim(match) === '') {\n errMsg = \"syntax error near '\" + term.getName() + \"'\";\n }\n else {\n var errorMatch = match;\n if (errorMatch.indexOf(\"\\n\") !== -1) {\n errorMatch = \"\\n '\" + errorMatch.split(\"\\n\").join(\"\\n \") + \"'\";\n }\n else {\n errorMatch = \"'\" + errorMatch + \"'\";\n }\n errMsg = \"syntax error near \" + term.getName() + \" \" + errorMatch;\n }\n if (expected.length > 0) {\n errMsg += ', expected ';\n if (expected.length > 1) {\n errMsg += expected.slice(0, expected.length - 1).join(', ') + ' or ' + expected[expected.length - 1];\n }\n else {\n errMsg += expected.join(' or ');\n }\n }\n return {\n match: match,\n line: line,\n message: errMsg\n };\n }", "title": "" }, { "docid": "bdceb0723e6708d962e6a8a5337577f0", "score": "0.5297021", "text": "checkRule(rule, data) {\n\n //Get data\n const {field, args, validator, type} = rule;\n const value = data[field];\n\n //Run validator\n return Promise\n .try(() => validator(value, ...args))\n .catch(error => {\n const message = rule.message || error.message;\n throw {field, type, message};\n });\n }", "title": "" }, { "docid": "56cda5bef7d8b6a41acaac5b721111d3", "score": "0.5296775", "text": "check(rule) {\n if (!rule.selector.includes(this.prefixed)) {\n return false\n }\n if (!rule.selector.match(this.regexp)) {\n return false\n }\n if (this.isHack(rule)) {\n return false\n }\n return true\n }", "title": "" }, { "docid": "56cda5bef7d8b6a41acaac5b721111d3", "score": "0.5296775", "text": "check(rule) {\n if (!rule.selector.includes(this.prefixed)) {\n return false\n }\n if (!rule.selector.match(this.regexp)) {\n return false\n }\n if (this.isHack(rule)) {\n return false\n }\n return true\n }", "title": "" }, { "docid": "03a6d1bb112d9e049b4c187e5fc05819", "score": "0.5279722", "text": "check(node, traversalState, content, context) {\n // First, see if we match the selector.\n // If no selector was passed to the constructor, we use a\n // default selector that matches text nodes.\n const selectorMatch = this.selector.match(traversalState);\n\n // If the selector did not match, then we're done\n if (!selectorMatch) {\n return null;\n }\n\n // If the selector matched, then see if the pattern matches\n let patternMatch;\n if (this.pattern) {\n patternMatch = content.match(this.pattern);\n } else {\n // If there is no pattern, then just match all of the content.\n // Use a fake RegExp match object to represent this default match.\n patternMatch = Rule.FakePatternMatch(content, content, 0);\n }\n\n // If there was a pattern and it didn't match, then we're done\n if (!patternMatch) {\n return null;\n }\n\n try {\n // If we get here, then the selector and pattern have matched\n // so now we call the lint function to see if there is lint.\n const error = this.lint(\n traversalState,\n content,\n selectorMatch,\n patternMatch,\n context\n );\n\n if (!error) {\n return null; // No lint; we're done\n } else if (typeof error === \"string\") {\n // If the lint function returned a string we assume it\n // applies to the entire content of the node and return it.\n return {\n rule: this.name,\n severity: this.severity,\n message: error,\n start: 0,\n end: content.length,\n };\n } else {\n // If the lint function returned an object, then we just\n // add the rule name to the message, start and end.\n return {\n rule: this.name,\n severity: this.severity,\n message: error.message,\n start: error.start,\n end: error.end,\n };\n }\n } catch (e) {\n // If the lint function threw an exception we handle that as\n // a special type of lint. We want the user to see the lint\n // warning in this case (even though it is out of their control)\n // so that the bug gets reported. Otherwise we'd never know that\n // a rule was failing.\n return {\n rule: \"lint-rule-failure\",\n message: `Exception in rule ${this.name}: ${e.message}\nStack trace:\n${e.stack}`,\n start: 0,\n end: content.length,\n };\n }\n }", "title": "" }, { "docid": "c91d6bb93634ab747fa294a4d7b98ee4", "score": "0.5276444", "text": "function ruleValidation(ruleName,errorSpanID) {\n\t\t//The following regex finds undersscore(_) and hyphen(-).\t\n\t\tvar specialCharacter = /^[-_]*$/;\n\t\t//The following regex finds characters in the range of 0-9,a-z(lower case) and A-Z(uppercase).\n\t\tvar letter = /^[0-9a-zA-Z-_]+$/;\n\t\tvar maxLengthMessage = getUiProps().MSG0425;\n\t\tvar charMessage = getUiProps().MSG0023; //getUiProps().MSG0005;\n\t\tvar specialCharMessage = getUiProps().MSG0426;\n\t\tvar lenRuleName = (ruleName) ? ruleName.length:0;\n\t\tif (lenRuleName < 1) {\n\t\t\treturn true;\n\t\t}else if((lenRuleName > 128)) {\n\t\t\tdocument.getElementById(errorSpanID).innerHTML = maxLengthMessage;\n\t\t\tcellpopup.showErrorIcon('#txtRuleName');\n\t\t\treturn false;\n\t\t} else if(lenRuleName != 0 && !(ruleName.match(letter))) {\n\t\t\tdocument.getElementById(errorSpanID).innerHTML = charMessage;\n\t\t\tcellpopup.showErrorIcon('#txtRuleName');\n\t\t\treturn false;\n\t\t} else if(lenRuleName != 0 && (specialCharacter.toString().indexOf(ruleName.substring(0, 1)) >= 0)) {\n\t\t\tdocument.getElementById(errorSpanID).innerHTML = specialCharMessage;\n\t\t\tcellpopup.showErrorIcon('#txtRuleName');\n\t\t\treturn false;\n\t\t} else {\n\t\t\tdocument.getElementById(errorSpanID).innerHTML = \"\";\n\t\t\t$(\"#txtRuleNameEdit\").removeClass(\"errorIcon\");\n\t\t\tcellpopup.showValidValueIcon('#txtRuleName');\n\t\t\treturn true;\n\t\t}\n\t\tcellpopup.showValidValueIcon('#txtRuleName');\n\t\treturn true;\n\t}", "title": "" }, { "docid": "30ab629749aae1870348c18c1432f59d", "score": "0.5239187", "text": "function canApplyRule(source, ex) {\n // lexical error\n if (!ex.hash || !ex.hash.loc) {\n return false;\n }\n const text = ex.hash.text;\n const range = ex.hash.loc.range;\n const tokenOffset = range[0];\n\n if (text === ';' && ex.hash.exception instanceof require('./error').InvalidASIError) {\n return -1;\n }\n\n // NOTICE: the end of the input stream of tokens\n if (isEOF(ex)) {\n return tokenOffset;\n }\n // The offending token is }\n if (text === '}') {\n return tokenOffset;\n }\n\n // recover from no LineTerminator exception\n if (ex.hash.exception instanceof require('./error').NoLineTerminatorError) {\n // ++/--\n if (text === '++' || text === '--') {\n return lookBehind(\n source.substring(0, ex.hash.exception.hash.offset + 1), 0, true, false).index;\n }\n return ex.hash.loc.range[1] - 1;\n }\n\n const { index: prevOffset } = lookBehind(source.substring(0, tokenOffset), 0, true, false);\n\n // The previous token is )\n // the inserted semicolon would then be parsed as the terminating semicolon\n // of a do-while statement\n // TODO: only do-while\n if (source[prevOffset] === ')') {\n return prevOffset + 1;\n }\n\n // The offending token is separated from the previous token by at least one LineTerminator.\n if (isLineTerminator(source[prevOffset])) {\n return prevOffset + 1;\n }\n return -1;\n}", "title": "" }, { "docid": "135669febfc1da867e29d28868b4a70b", "score": "0.52173215", "text": "function parse_rule(rule) {\n var res = [], resraw = rule.split(/\\s*\\|\\s*/);\n for (var i = 0; i < resraw.length; ++i) {\n var psh = [], pshraw = resraw[i].split(/(<.*?>)/);\n for (var j = 0; j < pshraw.length; ++j) if (pshraw[j].length > 0) {\n if (pshraw[j][0] != '<') {\n isp = ndecode(pshraw[j]).split(/(\\s+)/);\n for (var k = 0; k < isp.length; ++k) if (isp[k].length > 0)\n psh.push(isp[k].trim().length > 0? isp[k] : \" \");\n }\n else\n psh.push(pshraw[j]);\n }\n res.push(psh);\n }\n return res;\n}", "title": "" }, { "docid": "d71ca4de03d64613f8676565f66f389e", "score": "0.5209657", "text": "function Rule(){}", "title": "" }, { "docid": "1e743b0893e2e3f9c14b0cdf5e26b1c4", "score": "0.5205232", "text": "isRule(rule) {\n let res = false;\n\n try {\n res = (rule instanceof Rule);\n } catch (ignore) {\n // ignore\n }\n\n return res;\n }", "title": "" }, { "docid": "31a3411882bbe089752900fc40edff21", "score": "0.51798207", "text": "function addRules(state, newrules, rules) {\n for (var idx in rules) {\n if (rules.hasOwnProperty(idx)) {\n var rule = rules[idx];\n var include = rule.include;\n if (include) {\n if (typeof (include) !== 'string') {\n __WEBPACK_IMPORTED_MODULE_1__monarchCommon_js__[\"k\" /* throwError */](lexer, 'an \\'include\\' attribute must be a string at: ' + state);\n }\n if (include[0] === '@') {\n include = include.substr(1); // peel off starting @\n }\n if (!json.tokenizer[include]) {\n __WEBPACK_IMPORTED_MODULE_1__monarchCommon_js__[\"k\" /* throwError */](lexer, 'include target \\'' + include + '\\' is not defined at: ' + state);\n }\n addRules(state + '.' + include, newrules, json.tokenizer[include]);\n }\n else {\n var newrule = new Rule(state);\n // Set up new rule attributes\n if (Array.isArray(rule) && rule.length >= 1 && rule.length <= 3) {\n newrule.setRegex(lexerMin, rule[0]);\n if (rule.length >= 3) {\n if (typeof (rule[1]) === 'string') {\n newrule.setAction(lexerMin, { token: rule[1], next: rule[2] });\n }\n else if (typeof (rule[1]) === 'object') {\n var rule1 = rule[1];\n rule1.next = rule[2];\n newrule.setAction(lexerMin, rule1);\n }\n else {\n __WEBPACK_IMPORTED_MODULE_1__monarchCommon_js__[\"k\" /* throwError */](lexer, 'a next state as the last element of a rule can only be given if the action is either an object or a string, at: ' + state);\n }\n }\n else {\n newrule.setAction(lexerMin, rule[1]);\n }\n }\n else {\n if (!rule.regex) {\n __WEBPACK_IMPORTED_MODULE_1__monarchCommon_js__[\"k\" /* throwError */](lexer, 'a rule must either be an array, or an object with a \\'regex\\' or \\'include\\' field at: ' + state);\n }\n if (rule.name) {\n newrule.name = string(rule.name);\n }\n if (rule.matchOnlyAtStart) {\n newrule.matchOnlyAtLineStart = bool(rule.matchOnlyAtLineStart);\n }\n newrule.setRegex(lexerMin, rule.regex);\n newrule.setAction(lexerMin, rule.action);\n }\n newrules.push(newrule);\n }\n }\n }\n }", "title": "" }, { "docid": "ded26526df6c41c5bef95a1fca87eeba", "score": "0.5112305", "text": "function endRule(event) {\n var prop,\n i, len,\n standard,\n needed,\n actual,\n needsStandard = [];\n\n for (prop in properties) {\n if (propertiesToCheck[prop]) {\n needsStandard.push({\n actual: prop,\n needed: propertiesToCheck[prop]\n });\n }\n }\n\n for (i = 0, len = needsStandard.length; i < len; i++) {\n needed = needsStandard[i].needed;\n actual = needsStandard[i].actual;\n\n if (!properties[needed]) {\n reporter.report(\"Missing standard property '\" + needed + \"' to go along with '\" + actual + \"'.\", properties[actual][0].name.line, properties[actual][0].name.col, rule);\n } else {\n //make sure standard property is last\n if (properties[needed][0].pos < properties[actual][0].pos) {\n reporter.report(\"Standard property '\" + needed + \"' should come after vendor-prefixed property '\" + actual + \"'.\", properties[actual][0].name.line, properties[actual][0].name.col, rule);\n }\n }\n }\n\n }", "title": "" }, { "docid": "3e07134387a726e6f94b37f575e30f8b", "score": "0.51044077", "text": "function match ( data, ruleName, args ) {\n\tvar errors = [];\n\n\t// if args is an array we need to make it a nested array\n\tif (Array.isArray(args)) {\n\t\targs = [args];\n\t}\n\n\t// Ensure args is a list, then prepend it with data\n\tif ( !_.isArray(args) ) {\n\t\targs = [args];\n\t}\n\n\t// push data on to front\n\targs.unshift(data);\n\n\t// Lookup rule and determine outcome\n\tvar outcome;\n\tvar rule = rules[ruleName];\n\tif (!rule) {\n\t\tthrow new Error ('Unknown rule: ' + ruleName);\n\t}\n\ttry {\n\t\toutcome = rule.apply(rule, args);\n\t}\n\tcatch (e) {\n\t\toutcome = false;\n\t}\n\n\t// If outcome is false, an error occurred\n\tif (!outcome) return failure(data, ruleName, args);\n\telse return [];\n\n\n\t// On failure-- stop and get out.\n\t// If a cb was specified, call it with a first-arity error object.\n\t// Otherwise, return a list of error objets.\n\tfunction failure() {\n\n\t\t// remove data from the front\n\t\targs.shift();\n\n\t\t// Construct error message\n\t\tvar errMsg = '';\n\t\terrMsg += 'Validation error: \"'+data+'\" ';\n\t\terrMsg += 'Rule \"' + ruleName + '(' + args.join(',') + ')\" failed.';\n\n\t\t// Construct error object\n\t\treturn [{\n\t\t\tdata: data,\n\t\t\tmessage: errMsg,\n\t\t\trule: ruleName,\n\t\t\targs: args\n\t\t}];\n\t}\n}", "title": "" }, { "docid": "b810df28d4a666a900cfa76017a55d53", "score": "0.50958526", "text": "function reportMissingRules(ast) {\r\n var check = visitor.build({\r\n rule_ref: function(node) {\r\n if (!asts.findRule(ast, node.name)) {\r\n throw new GrammarError(\r\n \"Referenced rule \\\"\" + node.name + \"\\\" does not exist.\",\r\n node.location\r\n );\r\n }\r\n }\r\n });\r\n\r\n check(ast);\r\n}", "title": "" }, { "docid": "523cdd8db0db3155334a5cfa2342a89c", "score": "0.50816685", "text": "function advanceRule(state, successful) {\n // If this is advancing successfully and the current state is a list, give\n // it an opportunity to repeat itself.\n if (isList(state)) {\n if (state.rule && state.rule[state.step].separator) {\n var separator = state.rule[state.step].separator;\n state.needsSeperator = !state.needsSeperator;\n // If the separator was optional, then give it an opportunity to repeat.\n if (!state.needsSeperator && separator.ofRule) {\n return;\n }\n }\n // If this was a successful list parse, then allow it to repeat itself.\n if (successful) {\n return;\n }\n }\n\n // Advance the step in the rule. If the rule is completed, pop\n // the rule and advance the parent rule as well (recursively).\n state.needsSeperator = false;\n state.step++;\n\n // While the current rule is completed.\n while (state.rule && !(Array.isArray(state.rule) && state.step < state.rule.length)) {\n popRule(state);\n\n if (state.rule) {\n // Do not advance a List step so it has the opportunity to repeat itself.\n if (isList(state)) {\n if (state.rule && state.rule[state.step].separator) {\n state.needsSeperator = !state.needsSeperator;\n }\n } else {\n state.needsSeperator = false;\n state.step++;\n }\n }\n }\n}", "title": "" }, { "docid": "523cdd8db0db3155334a5cfa2342a89c", "score": "0.50816685", "text": "function advanceRule(state, successful) {\n // If this is advancing successfully and the current state is a list, give\n // it an opportunity to repeat itself.\n if (isList(state)) {\n if (state.rule && state.rule[state.step].separator) {\n var separator = state.rule[state.step].separator;\n state.needsSeperator = !state.needsSeperator;\n // If the separator was optional, then give it an opportunity to repeat.\n if (!state.needsSeperator && separator.ofRule) {\n return;\n }\n }\n // If this was a successful list parse, then allow it to repeat itself.\n if (successful) {\n return;\n }\n }\n\n // Advance the step in the rule. If the rule is completed, pop\n // the rule and advance the parent rule as well (recursively).\n state.needsSeperator = false;\n state.step++;\n\n // While the current rule is completed.\n while (state.rule && !(Array.isArray(state.rule) && state.step < state.rule.length)) {\n popRule(state);\n\n if (state.rule) {\n // Do not advance a List step so it has the opportunity to repeat itself.\n if (isList(state)) {\n if (state.rule && state.rule[state.step].separator) {\n state.needsSeperator = !state.needsSeperator;\n }\n } else {\n state.needsSeperator = false;\n state.step++;\n }\n }\n }\n}", "title": "" }, { "docid": "f727671ee19b090d040211beefbdecdf", "score": "0.50798666", "text": "isValid(name, rule) {\n let params = this.rules[name][rule];\n let param = (params instanceof Array && typeof params[1] === 'string') ? params[0] : params;\n let currentRule = this.rules[name][rule];\n let args = { value: this.inputElement.value, param: param, element: this.inputElement, formElement: this.element };\n this.trigger('validationBegin', args);\n if (currentRule && typeof currentRule[0] === 'function') {\n let fn = currentRule[0];\n return fn.call(this, { element: this.inputElement, value: this.inputElement.value });\n }\n else if (FormValidator_1.isCheckable(this.inputElement)) {\n if (rule !== 'required') {\n return true;\n }\n return selectAll('input[name=' + name + ']:checked', this.element).length > 0;\n }\n else {\n return FormValidator_1.checkValidator[rule](args);\n }\n }", "title": "" }, { "docid": "826558a368c1100edc426b4bd36bd3e5", "score": "0.507209", "text": "validateRules(name) {\n if (!this.rules[name]) {\n return;\n }\n let rules = Object.keys(this.rules[name]);\n this.getInputElement(name);\n this.getErrorElement(name);\n for (let rule of rules) {\n let errorMessage = this.getErrorMessage(this.rules[name][rule], rule);\n let errorRule = { name: name, message: errorMessage };\n let eventArgs = {\n inputName: name,\n element: this.inputElement,\n message: errorMessage\n };\n if (!this.isValid(name, rule) && !this.inputElement.classList.contains(this.ignore)) {\n this.removeErrorRules(name);\n this.errorRules.push(errorRule);\n // Set aria attributes to invalid elements\n this.inputElement.setAttribute('aria-invalid', 'true');\n this.inputElement.setAttribute('aria-describedby', this.inputElement.id + '-info');\n if (!this.infoElement) {\n this.createErrorElement(name, errorRule.message, this.inputElement);\n }\n else {\n this.showMessage(errorRule);\n }\n eventArgs.errorElement = this.infoElement;\n eventArgs.status = 'failure';\n this.inputElement.classList.add(this.errorClass);\n this.inputElement.classList.remove(this.validClass);\n this.trigger('validationComplete', eventArgs);\n // Set aria-required to required rule elements\n if (rule === 'required') {\n this.inputElement.setAttribute('aria-required', 'true');\n }\n break;\n }\n else {\n this.hideMessage(name);\n eventArgs.status = 'success';\n this.trigger('validationComplete', eventArgs);\n }\n }\n }", "title": "" }, { "docid": "9660fd0b81b77edfb955fe3873c7ccd9", "score": "0.5060955", "text": "invalid_input(match, context, nextState) {\n this.stateMachine.previousLine();\n throw new EOFError();\n }", "title": "" }, { "docid": "c7e54f42314afb19b59bb21b33acca12", "score": "0.5057825", "text": "indexOf(rule) {\n return this.rules.indexOf(rule)\n }", "title": "" }, { "docid": "6c68c53ec903a7dafe1415ed30a8b7b8", "score": "0.5048088", "text": "function regexp(rule,value,callback,source,options){var errors=[];var validate=rule.required||!rule.required&&source.hasOwnProperty(rule.field);if(validate){if((0,_util.isEmptyValue)(value)&&!rule.required){return callback();}_rule2[\"default\"].required(rule,value,source,errors,options);if(!(0,_util.isEmptyValue)(value)){_rule2[\"default\"].type(rule,value,source,errors,options);}}callback(errors);}", "title": "" }, { "docid": "a82367058909eb8228744db38bd1b3e2", "score": "0.5039461", "text": "async function parse(result) {\n let rules = null;\n try {\n rules = JSON.parse(result);\n }\n catch (_) {\n throw await setInvalidFileError();\n }\n\n const { popularRules, userRules } = rules;\n if (!Array.isArray(popularRules) || !Array.isArray(userRules)) {\n throw await setInvalidFileError();\n }\n\n const allRules = [...popularRules, ...userRules];\n await Promise.all(\n allRules.map(async (rule) => {\n if (typeof rule !== 'string') {\n throw await setInvalidFileError();\n }\n }),\n );\n\n await clearError();\n\n return rules;\n }", "title": "" }, { "docid": "6731b9fd580709c4d8ec7893e529cf0b", "score": "0.50251347", "text": "function endRule(event) {\n\n var prop, i, len, total;\n\n //check which properties this rule has\n for (prop in mapping) {\n if (mapping.hasOwnProperty(prop)) {\n total = 0;\n\n for (i = 0, len = mapping[prop].length; i < len; i++) {\n total += properties[mapping[prop][i]] ? 1 : 0;\n }\n\n if (total == mapping[prop].length) {\n reporter.report(\"The properties \" + mapping[prop].join(\", \") + \" can be replaced by \" + prop + \".\", event.line, event.col, rule);\n }\n }\n }\n }", "title": "" }, { "docid": "b8e028d12d39aac4b226f2b1068abc38", "score": "0.50231975", "text": "_parseMatchStatement() {\n let smellsLikeMatchStatement = false;\n this._suppressErrors(() => {\n const curTokenIndex = this._tokenIndex;\n this._getKeywordToken(\n 25\n /* Match */\n );\n const expression = this._parseTestOrStarListAsExpression(\n /* allowAssignmentExpression */\n true,\n /* allowMultipleUnpack */\n true,\n 12,\n () => localize_1.Localizer.Diagnostic.expectedReturnExpr()\n );\n smellsLikeMatchStatement = expression.nodeType !== 0 && this._peekToken().type === 10;\n this._tokenIndex = curTokenIndex;\n });\n if (!smellsLikeMatchStatement) {\n return void 0;\n }\n const matchToken = this._getKeywordToken(\n 25\n /* Match */\n );\n const subjectExpression = this._parseTestOrStarListAsExpression(\n /* allowAssignmentExpression */\n true,\n /* allowMultipleUnpack */\n true,\n 12,\n () => localize_1.Localizer.Diagnostic.expectedReturnExpr()\n );\n const matchNode = parseNodes_1.MatchNode.create(matchToken, subjectExpression);\n const nextToken = this._peekToken();\n if (!this._consumeTokenIfType(\n 10\n /* Colon */\n )) {\n this._addError(localize_1.Localizer.Diagnostic.expectedColon(), nextToken);\n if (this._consumeTokensUntilType([\n 2,\n 10\n /* Colon */\n ])) {\n this._getNextToken();\n }\n } else {\n (0, parseNodes_1.extendRange)(matchNode, nextToken);\n if (!this._consumeTokenIfType(\n 2\n /* NewLine */\n )) {\n this._addError(localize_1.Localizer.Diagnostic.expectedNewline(), nextToken);\n } else {\n const possibleIndent = this._peekToken();\n if (!this._consumeTokenIfType(\n 3\n /* Indent */\n )) {\n this._addError(localize_1.Localizer.Diagnostic.expectedIndentedBlock(), this._peekToken());\n } else {\n const indentToken = possibleIndent;\n if (indentToken.isIndentAmbiguous) {\n this._addError(localize_1.Localizer.Diagnostic.inconsistentTabs(), indentToken);\n }\n }\n while (true) {\n const possibleUnexpectedIndent = this._peekToken();\n if (possibleUnexpectedIndent.type === 3) {\n this._getNextToken();\n const indentToken = possibleUnexpectedIndent;\n if (indentToken.isIndentAmbiguous) {\n this._addError(localize_1.Localizer.Diagnostic.inconsistentTabs(), indentToken);\n } else {\n this._addError(localize_1.Localizer.Diagnostic.unexpectedIndent(), possibleUnexpectedIndent);\n }\n }\n const caseStatement = this._parseCaseStatement();\n if (!caseStatement) {\n if (this._consumeTokensUntilType([\n 2,\n 10\n /* Colon */\n ])) {\n this._getNextToken();\n }\n } else {\n caseStatement.parent = matchNode;\n matchNode.cases.push(caseStatement);\n }\n const dedentToken = this._peekToken();\n if (this._consumeTokenIfType(\n 4\n /* Dedent */\n )) {\n if (!dedentToken.matchesIndent) {\n this._addError(localize_1.Localizer.Diagnostic.inconsistentIndent(), dedentToken);\n }\n if (dedentToken.isDedentAmbiguous) {\n this._addError(localize_1.Localizer.Diagnostic.inconsistentTabs(), dedentToken);\n }\n break;\n }\n if (this._peekTokenType() === 1) {\n break;\n }\n }\n }\n if (matchNode.cases.length > 0) {\n (0, parseNodes_1.extendRange)(matchNode, matchNode.cases[matchNode.cases.length - 1]);\n } else {\n this._addError(localize_1.Localizer.Diagnostic.zeroCaseStatementsFound(), matchToken);\n }\n }\n if (this._getLanguageVersion() < pythonVersion_1.PythonVersion.V3_10) {\n this._addError(localize_1.Localizer.Diagnostic.matchIncompatible(), matchToken);\n }\n for (let i = 0; i < matchNode.cases.length - 1; i++) {\n const caseNode = matchNode.cases[i];\n if (!caseNode.guardExpression && caseNode.isIrrefutable) {\n this._addError(localize_1.Localizer.Diagnostic.casePatternIsIrrefutable(), caseNode.pattern);\n }\n }\n return matchNode;\n }", "title": "" }, { "docid": "7375f76f74ddee23fb78c84e99b6c94a", "score": "0.50209165", "text": "addRule(rule) {\n if (rule.prob == 1) {\n this.rules.push(rule);\n }\n else {\n var isExist = false;\n this.rules.forEach(function (element, index, array){\n if (element.lhs == rule.lhs) {\n isExist = true;\n var newRule = { rhs: rule.rhs, prob: rule.prob };\n element.multi.push(newRule);\n\n }\n });\n if (!isExist) {\n this.rules.push(rule);\n }\n }\n }", "title": "" }, { "docid": "b2893a8f391d5e6037145f0bc24de872", "score": "0.5009334", "text": "function isRule(thing) {\n return getIriAll(thing, rdf.type).includes(acp.Rule);\n}", "title": "" }, { "docid": "ff2af3f4bcff4efd3746b436f2366acd", "score": "0.5003381", "text": "function endRule(event){\n var prop,\n i, len,\n standard,\n needed,\n actual,\n needsStandard = [];\n\n for (prop in properties){\n if (propertiesToCheck[prop]){\n needsStandard.push({ actual: prop, needed: propertiesToCheck[prop]});\n }\n }\n\n for (i=0, len=needsStandard.length; i < len; i++){\n needed = needsStandard[i].needed;\n actual = needsStandard[i].actual;\n\n if (!properties[needed]){\n reporter.report(\"Missing standard property '\" + needed + \"' to go along with '\" + actual + \"'.\", properties[actual][0].name.line, properties[actual][0].name.col, rule);\n } else {\n //make sure standard property is last\n if (properties[needed][0].pos < properties[actual][0].pos){\n reporter.report(\"Standard property '\" + needed + \"' should come after vendor-prefixed property '\" + actual + \"'.\", properties[actual][0].name.line, properties[actual][0].name.col, rule);\n }\n }\n }\n\n }", "title": "" }, { "docid": "b6675c1fbb1e3db69bbb5b03449ae8ae", "score": "0.49992353", "text": "function parseRules(rules) {\n var body = 'try{if(0){}';\n for (var rule in rules) {\n var t1 = rule.split(' ');\n var method = t1[0];\n var ruleLoc = parseUrl(t1[1]);\n var targetLoc = parseUrl(rules[rule]);\n var filter = [];\n if (method !== '*') {\n filter.push('option.method==\"' + method + '\"');\n }\n if (ruleLoc.hostname.indexOf('*') !== -1) {\n var reg = ruleLoc.hostname.replace(/\\./g, '\\\\.').replace(/\\*/g, '.+');\n filter.push('/' + reg + '/.test(option.hostname)');\n } else {\n filter.push('option.hostname==\"' + ruleLoc.hostname + '\"');\n }\n if (ruleLoc.port !== '*') {\n filter.push('option.port==' + ruleLoc.port);\n }\n if (ruleLoc.path.indexOf('*') !== -1 || ruleLoc.path.indexOf(')') !== -1) {\n var reg = ruleLoc.path.replace(/\\./g, '\\\\.').replace(/\\//g, '\\\\/').replace(/\\*/g, '.+');\n filter.push('/' + reg + '/.test(option.path)');\n } else {\n filter.push('option.path.indexOf(\"' + ruleLoc.path + '\")!=-1');\n }\n body += 'else if(' + filter.join('&&') + '){option.hostname=\"' + targetLoc.hostname + '\"';\n if (targetLoc.port !== '*') {\n body += ';option.port=' + targetLoc.port;\n }\n if (ruleLoc.path.indexOf(')') !== -1) {\n body += ';option.path=option.path.replace(/' + reg + '/,\"$1\")';\n }\n body += ';option.path=\"' + targetLoc.path + '\"+option.path}\\n';\n }\n body += '}catch(e){console.log(e,option)}finally{return option}';\n return new Function('req', 'option', body);\n}", "title": "" }, { "docid": "28cb0e08d240651cef91ecbdc81f750b", "score": "0.49864715", "text": "function endRule(event) {\n\n var prop, i, len, total;\n\n // check which properties this rule has\n for (prop in mapping) {\n if (mapping.hasOwnProperty(prop)) {\n total = 0;\n\n for (i = 0, len = mapping[prop].length; i < len; i++) {\n total += properties[mapping[prop][i]] ? 1 : 0;\n }\n\n if (total === mapping[prop].length) {\n reporter.report(\"The properties \" + mapping[prop].join(\", \") + \" can be replaced by \" + prop + \".\", event.line, event.col, rule);\n }\n }\n }\n }", "title": "" }, { "docid": "13b8a94b55cdc401a2e3c7860a5bee90", "score": "0.49835876", "text": "function createRule(name, decl, options) {\n\t if (name === void 0) {\n\t name = 'unnamed';\n\t }\n\t\n\t var jss = options.jss;\n\t var declCopy = cloneStyle(decl);\n\t var rule = jss.plugins.onCreateRule(name, declCopy, options);\n\t if (rule) return rule; // It is an at-rule and it has no instance.\n\t\n\t if (name[0] === '@') {\n\t false ? warning(false, \"[JSS] Unknown rule \" + name) : void 0;\n\t }\n\t\n\t return null;\n\t}", "title": "" }, { "docid": "e9c9e384c6f325e87da48cbce8ea8865", "score": "0.49776968", "text": "exitRuleLHS(ctx) {\n\t}", "title": "" }, { "docid": "a8cc84fa361097ccb74cf73a90960bce", "score": "0.49694452", "text": "function createRule(name, decl, options) {\n if (name === void 0) name = 'unnamed';\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n if (name[0] === '@') _tinyWarningDefault.default(false, \"[JSS] Unknown rule \" + name);\n return null;\n}", "title": "" }, { "docid": "6e129c458898d784811ae32cb1e99af6", "score": "0.49569252", "text": "function forEachRule(rule, ruleIndex) {\n // Matches the selectorText with the current\n // selectorText used in the style sheet\n if (rule.selectorText === selectorText) {\n return _this.rule = rule\n }\n }", "title": "" }, { "docid": "1b7a74c093bae7833d8a291dcc869df0", "score": "0.4952977", "text": "function endRule(event){\n\n var prop, i, len, total;\n\n //check which properties this rule has\n for (prop in mapping){\n if (mapping.hasOwnProperty(prop)){\n total=0;\n\n for (i=0, len=mapping[prop].length; i < len; i++){\n total += properties[mapping[prop][i]] ? 1 : 0;\n }\n\n if (total == mapping[prop].length){\n reporter.report(\"The properties \" + mapping[prop].join(\", \") + \" can be replaced by \" + prop + \".\", event.line, event.col, rule);\n }\n }\n }\n }", "title": "" }, { "docid": "93f1cad126c45dfa3335ee20e59cbcda", "score": "0.49389705", "text": "function _customRegex( caller , rules , position ){\n;;; //console.groupCollapsed( \"_customRegex( %o , %o , %s )\" , caller , rules , position );\n var $caller = $( caller );\n customRule = rules[position+1];\n pattern = $.validationEngine.settings.allrules[customRule].regex;\n;;; //console.log( 'customRule = %o' , customRule );\n;;; //console.log( 'RegExp = %o' , pattern );\n if( !pattern.test( $caller.val() ) ){\n;;; //console.log( 'Pattern did not match \"%s\"' , $caller.val() );\n $.validationEngine.isError = true;\n promptText += $.validationEngine.settings.allrules[customRule].alertText+'<br />';\n }else{\n;;; //console.log( 'Pattern matched \"%s\"' , $caller.val() );\n }\n;;; //console.groupEnd();\n }", "title": "" }, { "docid": "f2e792c51361f96b5db85a3931658387", "score": "0.4938952", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n false ? warning(false, \"[JSS] Unknown rule \" + name) : void 0;\n }\n\n return null;\n}", "title": "" }, { "docid": "f2e792c51361f96b5db85a3931658387", "score": "0.4938952", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n false ? warning(false, \"[JSS] Unknown rule \" + name) : void 0;\n }\n\n return null;\n}", "title": "" }, { "docid": "41e0840ebc0c3509634441cb6227487d", "score": "0.49370238", "text": "function createRule(name, decl, options) {\n\t if (name === void 0) {\n\t name = 'unnamed';\n\t }\n\n\t var jss = options.jss;\n\t var declCopy = cloneStyle(decl);\n\t var rule = jss.plugins.onCreateRule(name, declCopy, options);\n\t if (rule) return rule; // It is an at-rule and it has no instance.\n\n\t if (name[0] === '@') {\n\t false ? warning(false, \"[JSS] Unknown rule \" + name) : void 0;\n\t }\n\n\t return null;\n\t}", "title": "" }, { "docid": "f802e250a67c08352f2ef53018ebd6b2", "score": "0.49263796", "text": "function matchAllRules (rules, date, start) {\n var i, len, rule, type;\n\n for (i = 0, len = rules.length; i < len; i++) {\n rule = rules[i];\n type = ruleTypes[rule.measure];\n\n if (type === 'interval') {\n if (!Interval.match(rule.measure, rule.units, start, date)) {\n return false;\n }\n } else if (type === 'calendar') {\n if (!Calendar.match(rule.measure, rule.units, date)) {\n return false;\n }\n } else {\n return false;\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "ce0b10e17bb48f8e37757cb01427ad00", "score": "0.4923784", "text": "function checkRuleset(_i) {\n var start = _i,\n l;\n\n if (tokens[start].ruleset_l !== undefined) return tokens[start].ruleset_l;\n\n while (l = checkSelector(_i)) {\n _i += l;\n }\n\n if (l = checkBlock(_i)) _i += l;\n else return fail(tokens[_i]);\n\n tokens[start].ruleset_l = _i - start;\n\n return _i - start;\n }", "title": "" }, { "docid": "99c4b2e9a8e6c33491075389d5d80b0f", "score": "0.49228814", "text": "function endRule() {\n var prop,\n i,\n len,\n needed,\n actual,\n needsStandard = [];\n\n for (prop in properties) {\n if (propertiesToCheck[prop]) {\n needsStandard.push({\n actual: prop,\n needed: propertiesToCheck[prop]\n });\n }\n }\n\n for (i = 0, len = needsStandard.length; i < len; i++) {\n needed = needsStandard[i].needed;\n actual = needsStandard[i].actual;\n\n if (!properties[needed]) {\n reporter.report(\"Missing standard property '\" + needed + \"' to go along with '\" + actual + \"'.\", properties[actual][0].name.line, properties[actual][0].name.col, rule);\n } else {\n // make sure standard property is last\n if (properties[needed][0].pos < properties[actual][0].pos) {\n reporter.report(\"Standard property '\" + needed + \"' should come after vendor-prefixed property '\" + actual + \"'.\", properties[actual][0].name.line, properties[actual][0].name.col, rule);\n }\n }\n }\n\n }", "title": "" }, { "docid": "46255d8f90f0b9f63876c5db6c14a09d", "score": "0.49040803", "text": "function isLonelyRule(name, parser) {\n let rule = Parser_1.findRuleByName(name, parser);\n return (rule &&\n rule.bnf.length == 1 &&\n rule.bnf[0].length == 1 &&\n (rule.bnf[0][0] instanceof RegExp || rule.bnf[0][0][0] == '\"' || rule.bnf[0][0][0] == \"'\"));\n }", "title": "" }, { "docid": "f9a2885b2b2d3c25eb7cd8af431c98d7", "score": "0.4901991", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n false ? undefined : void 0;\n }\n\n return null;\n}", "title": "" }, { "docid": "f9a2885b2b2d3c25eb7cd8af431c98d7", "score": "0.4901991", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n false ? undefined : void 0;\n }\n\n return null;\n}", "title": "" }, { "docid": "f9a2885b2b2d3c25eb7cd8af431c98d7", "score": "0.4901991", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n false ? undefined : void 0;\n }\n\n return null;\n}", "title": "" }, { "docid": "ad56ade880cb6a1fe2144783048886c3", "score": "0.48996916", "text": "function RuleParser(world)\n{\n\tthis.lexer = new RuleLexer();\n\tthis.ctok = null;\n\tthis.stack = null;\n\tthis.errors = null;\n\tthis.world = world;\n}", "title": "" }, { "docid": "6f1ff2394d531618ac1d2a5d8a354577", "score": "0.48964423", "text": "function createExample() {\r\n\r\n // Take the very first rule in the grammar, and set number of tries to 0.\r\n var curr_str = rules[0][1];\r\n var tries = 0;\r\n var curr_index = 0;\r\n\r\n // While the given string does not fully consist of Terminals, \r\n // and number of tries are less than 20, keep trying.\r\n // The 20 number has been chosen to keep this fast.\r\n // Another reason for limiting the tries is to make sure that\r\n // this naive algorithm actually terminates. Otherwise we can\r\n // run into some pretty nasty cases when a NT can be resolved to itself.\r\n while(isNotResolved(curr_str) && tries <= 20) {\r\n \r\n // If the element at the current index is a Terminal, advance the index.\r\n if (symbol_map.get(curr_str[curr_index]) != 1) {\r\n curr_index++;\r\n }\r\n // Non-Terminal \r\n else {\r\n var flag = 0;\r\n var prev_rule;\r\n\r\n // Iterate over the set of all rules.\r\n for (var rule = 0; rule < rules.length; rule++) {\r\n \r\n // If the rule is a match, check if the LHS is resolvable.\r\n if (rules[rule][0] == curr_str[curr_index]) {\r\n\r\n // If LHS is not resolvable, try to find a resolvable LHS.\r\n // Set flag, which indicates a rule for the current \r\n // Non-Terminal was seen. Store this rule in Previous. \r\n if (isNotResolved(rules[rule][1])) {\r\n flag = 1;\r\n prev_rule = rule;\r\n }\r\n\r\n // If LHS is resolvable, we are done. Advance the index of the \r\n // string and break out of the loop. Unset flag.\r\n else {\r\n flag = 0;\r\n curr_str = [curr_str.slice(0, curr_index), curr_str.slice(curr_index + 1)];\r\n curr_str = curr_str[0] + rules[rule][1] + curr_str[1];\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // If flag is set, no resolvable rule was found. \r\n // Apply the last seen non-resolvable rule.\r\n if (flag === 1) {\r\n curr_str = [curr_str.slice(0, curr_index), curr_str.slice(curr_index + 1)];\r\n curr_str = curr_str[0] + rules[prev_rule][1] + curr_str[1];\r\n }\r\n\r\n // Increment number of tries.\r\n tries++;\r\n }\r\n }\r\n\r\n // If the final string remanining at loop exit was unresolved,\r\n // we were unable to find an example using this algorithm.\r\n if (isNotResolved(curr_str)) {\r\n return \"Sorry, example unavailable.\";\r\n }\r\n \r\n // Example generated! \r\n else {\r\n if (curr_str == \"\") {\r\n curr_str = \"Ɛ\";\r\n }\r\n return curr_str;\r\n }\r\n}", "title": "" }, { "docid": "b1ab61c5d1a3ef7b3bff16208fa1bfa5", "score": "0.48930928", "text": "function applyMatch(rule, message, data) {\n let matcher = rule.match\n let isMatch = (Object.keys(matcher).length > 0)\n\n for(let [ruleKey, ruleValue] of Object.entries(matcher)) {\n let mValue = _.get(message, ruleKey, '')\n isMatch = isMatch && (ruleValue && mValue && (new RegExp(ruleValue).test(mValue)))\n }\n\n return isMatch\n}", "title": "" }, { "docid": "867c88519a18663947f900655ad05965", "score": "0.4886733", "text": "get ruleInput() {\n return this._rule;\n }", "title": "" }, { "docid": "8885ede19adff0d53ac72c096e8689c3", "score": "0.48710686", "text": "function pushRule(rules, state, ruleKind) {\n if (!rules[ruleKind]) {\n throw new TypeError('Unknown rule: ' + ruleKind);\n }\n state.prevState = _extends({}, state);\n state.kind = ruleKind;\n state.name = null;\n state.type = null;\n state.rule = rules[ruleKind];\n state.step = 0;\n state.needsSeperator = false;\n}", "title": "" }, { "docid": "8885ede19adff0d53ac72c096e8689c3", "score": "0.48710686", "text": "function pushRule(rules, state, ruleKind) {\n if (!rules[ruleKind]) {\n throw new TypeError('Unknown rule: ' + ruleKind);\n }\n state.prevState = _extends({}, state);\n state.kind = ruleKind;\n state.name = null;\n state.type = null;\n state.rule = rules[ruleKind];\n state.step = 0;\n state.needsSeperator = false;\n}", "title": "" }, { "docid": "dd52568dc15b94436faa5d609a2c7e9b", "score": "0.48696747", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_6__.default)(false, \"[JSS] Unknown rule \" + name) : 0;\n }\n\n return null;\n}", "title": "" }, { "docid": "dd52568dc15b94436faa5d609a2c7e9b", "score": "0.48696747", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_6__.default)(false, \"[JSS] Unknown rule \" + name) : 0;\n }\n\n return null;\n}", "title": "" }, { "docid": "dd52568dc15b94436faa5d609a2c7e9b", "score": "0.48696747", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_6__.default)(false, \"[JSS] Unknown rule \" + name) : 0;\n }\n\n return null;\n}", "title": "" }, { "docid": "dd52568dc15b94436faa5d609a2c7e9b", "score": "0.48696747", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_6__.default)(false, \"[JSS] Unknown rule \" + name) : 0;\n }\n\n return null;\n}", "title": "" }, { "docid": "dd52568dc15b94436faa5d609a2c7e9b", "score": "0.48696747", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_6__.default)(false, \"[JSS] Unknown rule \" + name) : 0;\n }\n\n return null;\n}", "title": "" }, { "docid": "dd52568dc15b94436faa5d609a2c7e9b", "score": "0.48696747", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_6__.default)(false, \"[JSS] Unknown rule \" + name) : 0;\n }\n\n return null;\n}", "title": "" }, { "docid": "dd52568dc15b94436faa5d609a2c7e9b", "score": "0.48696747", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? (0,tiny_warning__WEBPACK_IMPORTED_MODULE_6__.default)(false, \"[JSS] Unknown rule \" + name) : 0;\n }\n\n return null;\n}", "title": "" }, { "docid": "3c394efa84ba3153c369b3c5583bd021", "score": "0.48692036", "text": "function regexp(rule, value, callback, source, options) {\n\t\t var errors = [];\n\t\t var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n\t\t if (validate) {\n\t\t if ((0, _util.isEmptyValue)(value) && !rule.required) {\n\t\t return callback();\n\t\t }\n\t\t _rule2[\"default\"].required(rule, value, source, errors, options);\n\t\t if (!(0, _util.isEmptyValue)(value)) {\n\t\t _rule2[\"default\"].type(rule, value, source, errors, options);\n\t\t }\n\t\t }\n\t\t callback(errors);\n\t\t}", "title": "" }, { "docid": "ebf95a579bf5bcb9366d801b8358633f", "score": "0.48658973", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "title": "" }, { "docid": "ebf95a579bf5bcb9366d801b8358633f", "score": "0.48658973", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "title": "" }, { "docid": "ebf95a579bf5bcb9366d801b8358633f", "score": "0.48658973", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "title": "" }, { "docid": "ebf95a579bf5bcb9366d801b8358633f", "score": "0.48658973", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "title": "" }, { "docid": "ebf95a579bf5bcb9366d801b8358633f", "score": "0.48658973", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "title": "" }, { "docid": "ebf95a579bf5bcb9366d801b8358633f", "score": "0.48658973", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "title": "" }, { "docid": "ebf95a579bf5bcb9366d801b8358633f", "score": "0.48658973", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "title": "" }, { "docid": "ebf95a579bf5bcb9366d801b8358633f", "score": "0.48658973", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "title": "" }, { "docid": "ebf95a579bf5bcb9366d801b8358633f", "score": "0.48658973", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "title": "" }, { "docid": "ebf95a579bf5bcb9366d801b8358633f", "score": "0.48658973", "text": "function createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n true ? Object(tiny_warning__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(false, \"[JSS] Unknown rule \" + name) : undefined;\n }\n\n return null;\n}", "title": "" }, { "docid": "92363e088d9c2c553039e3a925ff0336", "score": "0.48653942", "text": "removeRule(rule) {\n var array;\n if (rule instanceof HP.StudyMatchingRule) {\n array = this.studyMatchingRules;\n } else if (rule instanceof HP.SeriesMatchingRule) {\n array = this.seriesMatchingRules;\n } else if (rule instanceof HP.ImageMatchingRule) {\n array = this.imageMatchingRules;\n }\n\n removeFromArray(array, rule);\n }", "title": "" }, { "docid": "b87361215420208974094f887aa17c02", "score": "0.48642737", "text": "function Optional(rule) {\n return function($) {\n var $next = rule($);\n if ($next !== $) return $next;\n return {\n capture: $.capture,\n context: $.context,\n pos: $.pos\n }\n }\n }", "title": "" }, { "docid": "1bc5f962914f4fda82321a150f2b1a95", "score": "0.48620376", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (!isEmptyValue(value)) {\n es_rule.type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "1bc5f962914f4fda82321a150f2b1a95", "score": "0.48620376", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (!isEmptyValue(value)) {\n es_rule.type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "1bc5f962914f4fda82321a150f2b1a95", "score": "0.48620376", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (!isEmptyValue(value)) {\n es_rule.type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "1bc5f962914f4fda82321a150f2b1a95", "score": "0.48620376", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (!isEmptyValue(value)) {\n es_rule.type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "1bc5f962914f4fda82321a150f2b1a95", "score": "0.48620376", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (!isEmptyValue(value)) {\n es_rule.type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "1bc5f962914f4fda82321a150f2b1a95", "score": "0.48620376", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (!isEmptyValue(value)) {\n es_rule.type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "1bc5f962914f4fda82321a150f2b1a95", "score": "0.48620376", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n es_rule.required(rule, value, source, errors, options);\n if (!isEmptyValue(value)) {\n es_rule.type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n}", "title": "" }, { "docid": "b53ea05a2f91524dc6627b81efb55aca", "score": "0.48578364", "text": "function Rules() {}", "title": "" }, { "docid": "b940c6ef9ee2f970b16c299e5f152aca", "score": "0.485389", "text": "function isRule(rule) {\n try{\n let id = idFor(rule)\n return id && cache[id]\n }\n catch(e) {\n return false\n }\n}", "title": "" }, { "docid": "23ca5399242bc6c20e9f38767f46c5f3", "score": "0.48518848", "text": "already(rule, prefixeds, prefix) {\n let index = rule.parent.index(rule) - 1\n\n while (index >= 0) {\n let before = rule.parent.nodes[index]\n\n if (before.type !== 'rule') {\n return false\n }\n\n let some = false\n for (let key in prefixeds[this.name]) {\n let prefixed = prefixeds[this.name][key]\n if (before.selector === prefixed) {\n if (prefix === key) {\n return true\n } else {\n some = true\n break\n }\n }\n }\n if (!some) {\n return false\n }\n\n index -= 1\n }\n\n return false\n }", "title": "" }, { "docid": "07c711fac5d5028b184a72de3d8da7e9", "score": "0.48507166", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);\n \n if (validate) {\n if (isEmptyValue(value) && !rule.required) {\n return callback();\n }\n \n rules.required(rule, value, source, errors, options);\n \n if (!isEmptyValue(value)) {\n rules.type(rule, value, source, errors, options);\n }\n }\n \n callback(errors);\n }", "title": "" }, { "docid": "7f047020d6ec22de4eeb46bd7a02c9b3", "score": "0.48502675", "text": "function deleteRuleFromStatement(s)\n{\n\tvar i, n, isAlreadyAdded, ind;\n\tif (s != \"\")\n\t{\n\t\tisAlreadyAdded = false;\n\t\tn = myRules.length;\n\t\ti = 0;\n\t\tif (n > 0)\n\t\t{\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif (myRules[i].FR_IsDifferentRule(s) == false)\n\t\t\t\t{\n\t\t\t\t\tisAlreadyAdded = true;\n\t\t\t\t\tind = i\n\t\t\t\t\t//post(\"Indice trouve =\", i, \"\\n\");\n\t\t\t\t}\n\t\t\t\ti++;\n\t\t\t} while ((i < n) && (isAlreadyAdded == false))\n\t\t}\n\t\t\n\t\tif (isAlreadyAdded == true)\n\t\t{\n\t\t\tdeleteRuleFromNumber(ind);\n\t\t\toutlet(MESSAGE_OUTLET, \"Fuzzy rule => \", s ,\" deleted\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\toutlet(MESSAGE_OUTLET, \"Fuzzy rule => \", s ,\" not found\");\n\t\t}\n\t\n\t\t//post(\"Boucles terminées\\n\");\n\t\tcomputeImpactOfInputLV();\n\t\tcomputeImpactOfOutputFSS();\n\t}\n\telse\n\t{\n\t\toutlet(MESSAGE_OUTLET, \"Fuzzy rule passed is empty !\");\n\t}\n}", "title": "" }, { "docid": "519153cc493c914473e30a59f4df27ff", "score": "0.48499858", "text": "function findRules(lexer, state) {\r\n while(state && state.length > 0) {\r\n var rules = lexer.tokenizer[state];\r\n if(rules) {\r\n return rules;\r\n }\r\n var idx = state.lastIndexOf(\".\");\r\n if(idx < 0) {\r\n state = null;\r\n } else {\r\n // no further parent\r\n state = state.substr(0, idx);\r\n }\r\n }\r\n return null;\r\n }", "title": "" }, { "docid": "1ac69116ede87a071b35a28f1b7fc8d2", "score": "0.4838665", "text": "function r(e,t,n){void 0===e&&(e=\"unnamed\");var r=n.jss,i=o(t),s=r.plugins.onCreateRule(e,i,n);// It is an at-rule and it has no instance.\nreturn s||(\"@\"===e[0]&&\"production\"!==Object({}).NODE_ENV&&Object(g.a)(!1,\"[JSS] Unknown rule \"+e),null)}", "title": "" }, { "docid": "c97dce69ae6cf4758b4c04574a29055b", "score": "0.48337314", "text": "function regexp(rule, value, callback, source, options) {\n var errors = [];\n var validate =\n rule.required ||\n (!rule.required && source.hasOwnProperty(rule.field));\n if (validate) {\n if ((0, _util.isEmptyValue)(value) && !rule.required) {\n return callback();\n }\n _rule2[\"default\"].required(rule, value, source, errors, options);\n if (!(0, _util.isEmptyValue)(value)) {\n _rule2[\"default\"].type(rule, value, source, errors, options);\n }\n }\n callback(errors);\n }", "title": "" } ]
7cd8a2cb16a72b0a923e6dd791be51c7
City list for Js Update 20090520
[ { "docid": "e1951147e5a86089802cd264b7bdb330", "score": "0.0", "text": "function ht_getcookie(name) {\n\tvar cookie_start = document.cookie.indexOf(name);\n\tvar cookie_end = document.cookie.indexOf(\";\", cookie_start);\n\treturn cookie_start == -1 ? '' : unescape(document.cookie.substring(\n\t\t\tcookie_start + name.length + 1,\n\t\t\t(cookie_end > cookie_start ? cookie_end : document.cookie.length)));\n}", "title": "" } ]
[ { "docid": "fe0552423c270303f9ca075e5431db18", "score": "0.7606238", "text": "function listCity(val) {\n prepareOutput('state_id', val, 'city-div', 'city-list');\n}", "title": "" }, { "docid": "4de9899b7faac5fb586f672d4aacc96a", "score": "0.74142706", "text": "function cityList(){\r\n\t\tvar cities = this.responseText.split(\"\\n\");\r\n\t\tfor (var i = 0; i < cities.length; i++){\r\n\t\t\tvar opt = document.createElement(\"option\");\r\n\t\t\topt.innerHTML = cities[i];\r\n\t\t\tdocument.getElementById(\"cities\").appendChild(opt);\r\n\t\t}\r\n\t\tdocument.getElementById(\"citiesinput\").disabled = \"\";\r\n\t\tdocument.getElementById(\"loadingnames\").style.display = \"none\";\r\n\t}", "title": "" }, { "docid": "4f0026da6b301209de2fc36b16aaff0d", "score": "0.72366446", "text": "function getCityList(data)\r\n{\r\n var listItems = '<option value=\\\"\\\">請輸入</option>';\r\n $.each(data.city, function (key, value)\r\n {\r\n listItems += \"<option value=\" + value + \">\" + value + \"</option>\";\r\n });\r\n\r\n $(\"select[desc=city]\", node).html(listItems);\r\n\r\n}", "title": "" }, { "docid": "1124419aa6834bc33eb044c1c0032d59", "score": "0.7200108", "text": "function listCities() {\n $(\"#appendcity\").prepend(\"<ul>\" + query_param + \"</ul>\");\n $(\"#appendcity\").text(\"<ul>\" + query_param + \"</ul>\");\n $(\"#city-list\").append(\"<ul>\" + query_param + \"</ul>\");\n }", "title": "" }, { "docid": "f378d219c1628633455f599b354864f3", "score": "0.71410906", "text": "function getCitysByAjax() {\r\n var letterarray= [\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"W\", \"X\", \"Y\", \"Z\"];\r\n// isHasAndExe($.city,function(){\r\n $.city({\r\n nameAttr: 1,\r\n pyAttr: 3,\r\n matchAttrs: [1, 3],\r\n dataAttrMap: {\r\n id: 0,\r\n name: 1,\r\n fullPy: 2\r\n },\r\n cities: {\r\n //url: WebConfigUrl.letterCityUrl+\"?allCity=0&letter={cityKey}\",\r\n url: \"GetCityListByLetter?allCity=0&letter={cityKey}\",\r\n //url:$(\"#letterCityUrl\").val()+\"?allCity=0&letter={cityKey}\",\r\n dataType: \"json\",\r\n success: function (data){\r\n var lettercitypara= [];\r\n var obj= data.TrainStation.StationList\r\n for(i in obj){\r\n var array=[];\r\n array[0]=obj[i].ID;\r\n array[1]=obj[i].Name;\r\n array[2]=obj[i].QPY;\r\n array[3]=obj[i].JPY;\r\n lettercitypara.push(array);\r\n }\r\n return lettercitypara;\r\n }\r\n },\r\n cityFilter: function (city) {\r\n return city[2] === \"0\";\r\n },\r\n hotCities: {\r\n //url: WebConfigUrl.hotCityUrl,\r\n url: \"GetHotCityListV1\",\r\n //url:$(\"#hotCityUrl\").val(),\r\n dataType: \"json\",\r\n success: function (data){\r\n var hotcitypara=[]\r\n var obj= data.TrainStation.StationList\r\n for(i in obj){\r\n var array=[];\r\n array[0]=obj[i].ID;\r\n array[1]=obj[i].Name;\r\n array[2]=obj[i].QPY;\r\n array[3]=obj[i].JPY;\r\n hotcitypara.push(array);\r\n }\r\n return hotcitypara;\r\n }\r\n },\r\n historyCityName: \"traincityHistoryName\",\r\n historyCityNumber: 6,\r\n fn: function (city) {\r\n $(\"#cityPage\").toggle();\r\n page.close();\r\n $(\"p.t_incity input\", elem).val(city[1]);\r\n $(\".CN\",elem).val(city[1]);\r\n $(\".PY\", elem).val(city[2]);\r\n },\r\n mode: \"asRequired\",\r\n searchObj:{\r\n //url: WebConfigUrl.letterCityUrl+\"?allCity=0\",\r\n url: \"GetCityListByLetter?allCity=0\",\r\n //data: {\r\n // allCity: 0\r\n //},\r\n //url:$(\"#letterCityUrl\").val()+\"?allCity=0\",\r\n //type:'GET', //默认GET\r\n name :'letter', //默认 value\r\n dataType: \"json\",\r\n processFn:function(data){\r\n //demo、用的数据是刚好一样,所以直接return\r\n //异步返回值的处理,处理成指定的类型,要和上面的对应哦,具体可参考demo\r\n //处理完要return 别忘了\r\n if (data.TrainStation) {\r\n document.querySelector(\".search-complete\").style.display = \"block\";\r\n document.querySelector(\".city-wrapper\").style.display = \"none\";\r\n var pycitypara = [];\r\n var obj = data.TrainStation.StationList\r\n for (i in obj) {\r\n var array = [];\r\n array[0] = obj[i].Name;\r\n array[1] = obj[i].Name;\r\n array[2] = obj[i].QPY;\r\n array[3] = obj[i].JPY;\r\n pycitypara.push(array);\r\n }\r\n return pycitypara;\r\n } else {\r\n document.querySelector(\".search-complete\").style.display = \"none\";\r\n document.querySelector(\".city-wrapper\").style.display = \"block\";\r\n }\r\n }\r\n },\r\n letters:letterarray,\r\n loc: {\r\n //url: WebConfigUrl.letterCityUrl+\"?allCity=0&letter={cityName}\",\r\n url: \"GetCityListByLetter?allCity=0&letter={cityName}\",\r\n dataType: \"json\",\r\n success: function (data){\r\n var citypara= [];\r\n var obj= data.TrainStation.StationList\r\n //for(i in obj[0]){\r\n var array=[];\r\n array[0]=obj[0].ID;\r\n array[1]=obj[0].Name;\r\n array[2]=obj[0].QPY;\r\n array[3]=obj[0].JPY;\r\n citypara.push(array);\r\n // }\r\n return citypara;\r\n }\r\n },\r\n hasLocation: 2\r\n });\r\n// })\r\n }", "title": "" }, { "docid": "d773a65c3a0f2d510c02fb636e7d40b8", "score": "0.71188766", "text": "function getCityList() {\n var cities = [];\n\n fetch(api)\n .then(res => res.json())\n .then(data => data.forEach(el => cities.push(el)));\n return cities;\n}", "title": "" }, { "docid": "dbe0b2b850f2e0622b8c2d62bf8a2971", "score": "0.7090916", "text": "function loadAll() {\n var allCities = 'Beijing, Shanghai, Guangzhou, Shenzhen, Dalian, Wuxi';\n\n return allCities.split(/, +/g).map(function(city) {\n return {\n value: city.toLowerCase(),\n display: city\n };\n });\n }", "title": "" }, { "docid": "bc804b78bcdade8c3aff14e3008c82a8", "score": "0.70785004", "text": "async function getCityList() {\n const response = await fetch(`http://api.airvisual.com/v2/cities?state=${state_selected}&country=USA&key=${API_KEY}`)\n const responseData_cities = await response.json()\n\t\tif(!response.ok){\n\t\t\tconsole.log('there is a problem 1')\n\t\t}\n\t\tfor(let i=0;i<responseData_cities.data.length;i++){\n\t\t\tcities_list.push (responseData_cities.data[i].city)\n\t\t }\n}", "title": "" }, { "docid": "abe259d63698c58a4630f2e61063e598", "score": "0.7013115", "text": "function ikariamGetOwnCities(){\r\n\tvar result = [];\r\n\t\r\n\ttry {\r\n\t\tvar tmpElements = document.getElementsByName('cityId');\r\n\t\tvar citySelectElement = tmpElements[0];\r\n\t\tvar cityElements = citySelectElement.childNodes;\r\n\t}\r\n\tcatch(e) {\r\n\t\tsyslog('Error retrieving own cities: \"' + e.description + '\"', 1);\r\n\t\treturn result;\r\n\t}\r\n\r\n\tfor (var i = 0; i < cityElements.length; i++) {\r\n\t\t// elements with no text are ignored\r\n\t\tif(cityElements[i].text) {\r\n\t\t\tvar city = new cityInfo();\r\n\t\t\tcity.island = new islandInfo();\r\n\t\t\tcity.id = cityElements[i].value;\r\n\t\t\tcity.selected = cityElements[i].selected;\r\n\t\t\t// depending on the chosen view mode (coordinates or resources) for\r\n\t\t\t// the city selection\r\n\t\t\tif (cityElements[i].className=='coords'){\r\n\t\t\t\tvar str = cityElements[i].text;\r\n\t\t\t\tcity.name = str.substring(str.indexOf(']')+2, str.length);\r\n\t\t\t\tikariamParseCoordinatesFromString(str, city.island.coords);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tcity.name = cityElements[i].text;\r\n\t\t\t\tikariamParseCoordinatesFromString(cityElements[i].title, city.island.coords);\r\n\t\t\t}\r\n\t\t\tresult.push(city);\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}", "title": "" }, { "docid": "3a811162756cb945e8875350206db358", "score": "0.6920205", "text": "function loadCapitalCityList() {\n $.ajax(allCountriesSett).done(function (APIData) {\n APIData.forEach(function (APIItem) {\n CapitalCityList.push(APIItem.capital);\n\n });\n });\n\n}", "title": "" }, { "docid": "8a2d20de906a66eac51d42172802fe5d", "score": "0.6850411", "text": "function getCities() {\n\n\n parseAppendGeneralJSONData(\"http://doctoory.com/front/api/cities?callback=?\", \"#sel-city\");\n //parseAppendGeneralJSONData(\"cities.json\", \"#sel-city\");\n\n}", "title": "" }, { "docid": "b616bae4a9e3c810d73a92147b8570f6", "score": "0.68458605", "text": "function LoadCityList() {\n var url = \"/AirBnB/citylist\";\n var successCallback = HandleLoadCityListResponse;\n\n // Generate a JS Object representing the JSON request\n var messageBodyJSObj = {\n };\n\n // Turn the generated JS Object into a JSON String to pass to server\n var messageBodyString = JSON.stringify(messageBodyJSObj);\n\n // Execute the HTTP Call\n SendPostAJAXRequest(url, messageBodyString, successCallback);\n }", "title": "" }, { "docid": "1def3c63c9d58e6d5cfc8e83737444b9", "score": "0.6819476", "text": "function Cities(){\n\t\tfor(var i = 0;i<cityLatLong.length;i++){\n\t\t\tcity_arr.push( new City(cityNames[i], citySide[i], latLongToVector3(cityLatLong[i][0],cityLatLong[i][1],radius,0), false, 1000, 0) );\n\t\t}\n\t}", "title": "" }, { "docid": "75562a68ab311c6915ffb795e6db81fb", "score": "0.67839754", "text": "function autoCompleteCity(city){\r\n\t\tlet html ='';\r\n\t\tfor(let i=0;i<city.length;i++){\r\n\t\t\thtml +=`<option value=\"${city[i]}\">`\r\n\t\t}\r\n\t\t//document.getElementById('cities').innerHTML = html;\r\n\t\telement('cities',html);\r\n\t}", "title": "" }, { "docid": "ef9cc3522b213038b23dadfff065200f", "score": "0.67812485", "text": "function getSelectorOfListOfCities_HTML(){\n var result = \"\";\n $.each (countriesVisited, function( i, country ){\n result += \"<li class='dropdown-header'>\" + country.name_ru + \"</li>\";\n\n var citiesList = $.grep (citiesVisited, function( n, i ) {\n return (n.getCountryId() == country.short_name)\n });\n\n $.each (citiesList, function( i, city ){\n result += \"<li><a id='\" + city.city_id + \"' onclick='javascript:getCityPage(this.id)' onmouseover='' style='cursor: pointer;'>&nbsp;&nbsp;&nbsp;&nbsp;\" + city.name_ru + \"</a></li>\";\n });\n });\n return result;\n}", "title": "" }, { "docid": "5ba05951a253d6a64aa57e6759e7ff89", "score": "0.67756873", "text": "function listCities() {\n let cityList = $(\"<li>\").addClass(\"list-group-item\").text(userCity);\n $(\".list\").append(cityList);\n }", "title": "" }, { "docid": "402f3f1838adf51113ad5e56726aa7c7", "score": "0.6738201", "text": "function addCitiesToList() {\n\tconst boxroundSelect = document.querySelector(\".boxround-select\");\n\tboxroundSelect.innerHTML = \"\";\n\tfor (city in citiesGeo){\n\t\tconst optionEl = document.createElement(\"option\");\n\t\toptionEl.value = city;\n\t\toptionEl.innerText = citiesGeo[city][\"name\"];\n\t\tboxroundSelect.appendChild(optionEl);\n\t}\n}", "title": "" }, { "docid": "23f0733df554c9a62094375f252a133e", "score": "0.67285496", "text": "getCities() {\n\t\tfetch('/getcities').then(results =>{\n\t\t\treturn results.json();\n\t\t}).then(data=>{\n\t\t\tlet cities = data.map((city) =>{\n\t\t\t\treturn(\n\t\t\t\t\t{value: city.city_id, label: city.city_name}\n\t\t\t\t)\n\t\t\t})\n\t\t\tthis.setState({cities_list: cities});\n\t\t})\n\t}", "title": "" }, { "docid": "760c296a1ba6654e3dcf50f793fdc462", "score": "0.666456", "text": "function getCityesByStateId(state_id) {\n\t$.ajax(\"/contacts/get_cities_by_state_id/\"+state_id, function(j) {\n\t\tvar options = '<option value=\"\">Escolha a Cidade</option>';\n\t\t$.each(j.response, function(i, item) {\n\t\t\toptions += '<option value=\"' + item.id + '\">' + item.n + '</option>';\n\t\t});\n\t\t$(\"#city_id\").html(options);\n\t});\n}", "title": "" }, { "docid": "67123d239c905c695fe77026aeb93184", "score": "0.6634771", "text": "setCities(state, cities) { // modifie la liste des villes (utile pour ajout / suppression)\n return { ...state, cities }\n }", "title": "" }, { "docid": "f0b27dc5a1eb469e3755eb1e28617326", "score": "0.66269433", "text": "function loadCities() {\n \n cityArray.forEach((city)=> {\n \n let cityName = city.geoloc.city;\n let index = cityArray.indexOf(city)\n \n const cityNode = document.createElement('option');\n cityNode.setAttribute(\"value\", index);\n\n //shows Palo Alto as default\n if(index == 9) {\n cityNode.setAttribute(\"selected\", \"selected\"); \n } \n\n cityNode.innerHTML = cityName;\n\n dropdown = document.getElementById(\"cities\");\n dropdown.appendChild(cityNode);\n valueCity = dropdown.value; // Define first value for selected city \n\n })\n \n }", "title": "" }, { "docid": "61824f6942ea10112c761cbf252521f2", "score": "0.6603979", "text": "function filterCityData( cities ){\n\t\tfor (var i=0; i<cities.length; i++){\n\t\t\tcities[i].value = cities[i].label;\n\t\t}\n\t\treturn cities;\n\t}", "title": "" }, { "docid": "bf79e056f58030d3aef6fe0a897f655c", "score": "0.66002536", "text": "function city(arr) {\n $(\"#city\").empty(); //To reset cities\n $(\"#city\").append(\"<option>กรุณาเลือกสาเหตุย่อย</option>\");\n $(arr).each(function(i) { //to list cities\n $(\"#city\").append(\"<option value=\"+ arr[i].value + \">\" + arr[i].display + \"</option>\")\n });\n }", "title": "" }, { "docid": "538fc46095776ea987c0665a11e0cc87", "score": "0.65913486", "text": "function buildCountryList() {\n\n} // END: buildCountryList", "title": "" }, { "docid": "0825ac49a5dcbf8941bc3580e3abae1c", "score": "0.6570907", "text": "function cityList() {\n let listItem = $(\"<li>\").addClass(\"list-group-item\").text(city);\n $(\".list\").append(listItem);\n }", "title": "" }, { "docid": "2de5c13b0c62884ac73cb7ef6ec35170", "score": "0.6557547", "text": "function getDefaultCityFromCityList(tx)\r\n{\r\n\tunassignedDefaultCity();\r\n\ttx.executeSql(\"SELECT RowId, CityName, Latitude, Longitude, xmlFeedURL, LastVisited, LastUpdated FROM FavoritesCity Where CityName != 'My Location';\", null,\r\n\t\t\tfunction(tx, results) \r\n\t\t\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tfor(var i = 0; i < results.rows.length; i++) {\r\n\t\t\t\tvar row = results.rows.item(i);\r\n\t\t\t\tdefaultCity[0] = row.RowId;\r\n\t\t\t\tdefaultCity[1] = row.CityName;\r\n\t\t\t\tdefaultCity[2] = row.Latitude;\r\n\t\t\t\tdefaultCity[3] = row.Longitude;\r\n\t\t\t\tdefaultCity[4] = row.xmlFeedURL;\r\n\t\t\t\tdefaultCity[5] = row.LastVisited;\r\n\t\t\t\tdefaultCity[6] = row.LastUpdated;\r\n\t\t\t} // for i\r\n\t\t}\r\n\t\tcatch(ex)\r\n\t\t{\r\n\t\t\terrMessage = errMessage + \"\\n getDefaultCityFromCityList() : \" + ex;\r\n\t\t}\r\n\t\t\t}, sqlFail);\r\n}", "title": "" }, { "docid": "4e54b5fae913e0812e74a708a2bf594d", "score": "0.6541542", "text": "function parseCities(cityData){\r\n\r\n\t\t//array destructuring ES6\r\n\t\tlet [...preferred] = cityData.preferred;\r\n\r\n\t\tfor (prefCity of preferred){\r\n\t\t\t$('#cities').append(`<li><a href=\"#\" data-transition=\"slide\">${prefCity.city}, ${prefCity.country}</a></li>`);\r\n\t\t}\r\n\r\n\t}", "title": "" }, { "docid": "5f7b421aeba6331b8edeeba122966d70", "score": "0.6540487", "text": "function DisplayCities(cities) {\n document.getElementById('citydiv').style.visibility = 'visible';\n document.getElementById('citydiv').style.top = '280px';\n document.getElementById('citydiv').style.left = '440px';\n document.getElementById('citydiv').style.zIndex = 2;\n SetupCityList(cities);\n document.getElementById('citytxt').innerHTML = 'We are unable to locate \"' + document.getElementById('txtcity').value + '\" in our shipping database. Please choose a new city from the list or enter the city name below and click the \"Select\" button. Please note that if the city is not in our database, we cannot compute freight charges.';\n document.getElementById('cityprovtxt').innerHTML = 'Cities within \"' + ExpandName(document.getElementById(\"selprovstate\").value) + '\"';\n document.getElementById('txtselectedcity').value = document.getElementById('txtcity').value;\n }", "title": "" }, { "docid": "3dc6cfae30ca8b38d9a87833ec3760a4", "score": "0.65303123", "text": "function addSupportedLocations(data) {\n for (var city in data) {\n var city_html = \"<li role=\\\"presentation\\\"><a class=\\\"location\\\" role=\\\"menuitem\\\" tabindex=\\\"-1\\\">\"\n + city + \"</a></li>\";\n $(\"#dropdownList\").append(city_html);\n }\n}", "title": "" }, { "docid": "befec25b4eedc1471aa66a6f09440cc9", "score": "0.6518656", "text": "function getNumberOfCities () {\n\t\t\treturn _cityList.length;\n\t}", "title": "" }, { "docid": "9d376308de89c0a802c1d75ddb528393", "score": "0.64888376", "text": "function buildCities(cities, filter) {\n var ret = [];\n Object.keys(cities.val()).forEach(function(k) {\n if(filter.indexOf(k) > -1) {\n var c = {};\n c.city = k;\n c.Population_2016 = cities.val()[k].Population_2016;\n c.Population_UK = cities.val()[k].Population_UK;\n c.Population_Non_UK = cities.val()[k][\"Population_Non-UK\"];\n c.Employment_Rate_2017 = cities.val()[k].Employment_Rate_2017;\n c.Average_Weekly_Workplace_Earnings_2017 = cities.val()[k].Average_Weekly_Workplace_Earnings_2017;\n c.Ratio_of_Private_to_Public_Sector_Employment_2016 = cities.val()[k].Ratio_of_Private_to_Public_Sector_Employment_2016;\n c.Housing_Affordability_Ratio_2017 = Math.round(parseFloat(cities.val()[k].Housing_Affordability_Ratio_2017)*100)/100;\n c.Mean_house_price_2017 = Math.round(parseFloat(cities.val()[k].Mean_house_price_2017)*100)/100;\n c.CO2_Emissions_per_Capita_2015_tons = Math.round(parseFloat(cities.val()[k].CO2_Emissions_per_Capita_2015_tons)*100)/100;\n c.Public_libraries = cities.val()[k].Public_libraries;\n c.Ultrafast_Broadband_2017 = cities.val()[k].Ultrafast_Broadband_2017;\n ret.push(c);\n }\n });\n return ret\n}", "title": "" }, { "docid": "de00110697913974d55954c7c2dc571a", "score": "0.64583665", "text": "function buildCitiesSearch(city) {\n var fixCity = city.charAt(0).toUpperCase() + city.slice(1);\n city = fixCity;\n\n if (searchCount === 0 && cities.length != 0) {\n $citiesList.addClass(\"list-group\");\n $(\"#city-list-section\").append($citiesList);\n searchCount++;\n }\n\n itemCount++;\n var $cityListItem = $(\"<li class='search-cities-list'></li>\");\n $cityListItem.addClass(\"list-group-item\");\n $cityListItem.addClass(\"list-group-city-\" + itemCount);\n $cityListItem.text(city);\n $(\".list-group\").prepend($cityListItem);\n\n // Populate the 5-Day Forecast section.\n buildFiveDayString(city);\n}", "title": "" }, { "docid": "d806d2f9f9bbef0945308689a368b14f", "score": "0.6452461", "text": "function populateCities() {\n // ensure container is displayed\n $(\".d-none\").removeClass(\"d-none\");\n // get element that holds list of cities\n var cityListEl = $(\"#prevCitiesList\");\n // remove everything from from the element so it can be repopulated\n cityListEl.empty();\n // create a new element for each city in the list \n // and add it to the list container container\n $.each(cities, function (i, v) {\n var cityEL = $(\"<li>\").addClass(\"nav-item btn-light list-group-item w-100 my-1\").data(\"prevCity\", i).text(cities[i]);\n cityEL.appendTo(cityListEl);\n });\n }", "title": "" }, { "docid": "1f67e83a960a7f51ac030ab5bf3d2dd4", "score": "0.6443933", "text": "function citiesMakeList(cities) {\n // create the list item and add the new city to cities\n //append to front end\n for (var i = 0; i < cities.length; i++) {\n\n var citiesList = $(\"<li>\").addClass(\"list-group-item\").text(cities[i]);\n $(\"#list-of-cities\").append(citiesList);\n }\n}", "title": "" }, { "docid": "7d2e968b9647645d727919320b0e4ffe", "score": "0.64092165", "text": "function populateCityList() {\n cities.forEach(makeWeatherCard);\n}", "title": "" }, { "docid": "3732d1fcc0fa95a2ac114c83294c98e7", "score": "0.6404978", "text": "function initialize() {\n getCities();\n}", "title": "" }, { "docid": "9f675fd138d49db8870244a5afdaa517", "score": "0.64046144", "text": "function ShowCityList(data) {\r\n\r\n $('#cityList li').remove();\r\n // For each data item\r\n $.each(data, function (index, rawSelectedItem) {\r\n \tvar selectedItem = rawSelectedItem.attributes; \r\n $('#cityList').append(PopulateCityItem(selectedItem));\r\n });\r\n\r\n // Apply to view\r\n $('#cityList').listview('refresh');\r\n }", "title": "" }, { "docid": "5605d9c8bfb3f6bd323e1459836c0fe6", "score": "0.6404608", "text": "function getCities(){\n\tvar stateCode = $(\"#states\").find('option:selected').val();\n\t\n\tif(stateCode != null && stateCode != \"-1\"){\n\t\t$.ajax({url : \"getallcities\",\n\t\t\t\t\t\t\tdata : {\n\t\t\t\t\t\t\t\tstateCode : stateCode\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsuccess : function(cityData) {\n\n\t\t\t\t\t\t\t\t$('#cities').find('option').remove();\n\t\t\t\t\t\t\t\t$('#cities').append('<option value=\"\" selected>Select City</option>');\n\t\t\t\t\t\t\t\t$.each(cityData, function(i, val) {\n\t\t\t\t\t\t\t\t\t$('#cities').append('<option value=\"'+val.cityCode+'\">'+ val.cityName + '</option>');\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t// $('#cities').selectpicker('refresh');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t$('#cities').find('option').remove();\n\t\t\t\t$('#cities').append(\n\t\t\t\t\t\t'<option value=\"\" selected>Select City</option>');\n\t\t\t\t// $('#cities').selectpicker('refresh');\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "edfca683fe64abcc5db462c13e67958d", "score": "0.63883513", "text": "function city(weatherData) {\n\tconst CityName = (weatherData.city.name);\n\tconst Split = CityName.split(\" \", 1);\n\ttempElementCity.innerHTML = `${(Split)}`;\n}", "title": "" }, { "docid": "2294cab55997e03de555f1204b64f1fe", "score": "0.63693005", "text": "function changeCities(name) {\n var list = cityStates[name];\n setCityList(list);\n }", "title": "" }, { "docid": "f6633f10b384d03079620969da29c023", "score": "0.6362243", "text": "function loadCities() {\n var cities = JSON.parse(localStorage.getItem(\"cities\")) || [];\n //go through time collection, for every element in time collection find every element to be populated with local stoage data\n //loop through collection\n for (var i = 0; i < cities.length; i++) {\n //grab the city at each index\n var city = cities[i];\n addACityToTheDom(city.name);\n }\n}", "title": "" }, { "docid": "b87a8d311de58beafaee8fd993a9ba67", "score": "0.6358766", "text": "function updateCityList() {\n\t// Clear existing cities (search might not match the same cities)\n\t$(\"#cityList\").empty();\n\t// Get text entered by user, convert to lower case\n\tconst match = $(\"#citySearch\").val().toLowerCase();\n\t\n\t// Loop over all city names (keys) in our object\n\tfor (var cityName in cities) {\n\t\t// By default, always add\n\t\tlet addIt = true;\n\t\t// If the user has typed text, then\n\t\tif (match.length > 0) {\n\t\t\t// do not include cities that do not contain the user's search\n\t\t\t// (only include cities that contain the user's search)\n\t\t\tif (!cityName.toLowerCase().includes(match)) { \n\t\t\t\taddIt = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If we want to add this city\n\t\tif (addIt) {\n\t\t\t// Make a new element for that city\n\t\t\tconst element = makeCity(cityName);\n\t\t\t// Stick it into the #cityList element\n\t\t\t$(\"#cityList\").append(element);\n\t\t}\n\t}\n\t\n\t// After all cities are added,\n\t// bind a click callback to them \n\t$(\".city\").click(cityClicked);\n\t\n}", "title": "" }, { "docid": "ff8ba9f68bf7d8b8ba1471787cfa170f", "score": "0.6329444", "text": "function getSortedCityListAlphabetically (_list) {\n\t\t\treturn _list.sort(function(fObj, sObj) { return fObj.name > sObj.name; })\n\t}", "title": "" }, { "docid": "91b1936aba098a6ee2575454f823e968", "score": "0.6327791", "text": "function initialize(){\n\tcities();\n}", "title": "" }, { "docid": "2715625107cb4a7b765b74c3c2e99443", "score": "0.6318111", "text": "function inputCity(){\n\t\t$(\"#city-type\").val() = {\n \t\tvar NewYork = [\"New York\", \"New York City\", \"NYC\"]\n\t\t\tvar SanFrancisco = [\"San Francisco\", \"SF\", \"Bay Area\"]\n\t\t\tvar LosAngeles = [\"Los Angeles\", \"LA\", \"LAX\"]\n\t\t\tvar Austin = [\"Austin\", \"ATX\"]\n\t\t\tvar Sydney = [\"Sydney\", \"SYD\"]\n \t};\n }", "title": "" }, { "docid": "edad178391b2a00b15136c46fd1afd45", "score": "0.631441", "text": "function displayCities() {\n let searchedCities = JSON.parse(localStorage.getItem(\"searchedCities\"));\n if (!searchedCities) searchedCities = [];\n\n savedCities.empty();\n\n $.each(searchedCities, function (index, city) {\n pastCity = $(\"<li>\");\n pastCity.addClass(\"list-group-item\");\n pastCity.text(city);\n savedCities.append(pastCity);\n if (index === 7) {\n return false;\n }\n })\n}", "title": "" }, { "docid": "09b3b6844d5f569e3c533f83ba0d568e", "score": "0.6303135", "text": "function hdnWeatherJsonpCallback(data) {\n\n cityArray = data.cities;//Global variable to be available to all functions\n console.log(cityArray); \n \n //add cities to dropdown menu \n function loadCities() {\n \n cityArray.forEach((city)=> {\n \n let cityName = city.geoloc.city;\n let index = cityArray.indexOf(city)\n \n const cityNode = document.createElement('option');\n cityNode.setAttribute(\"value\", index);\n\n //shows Palo Alto as default\n if(index == 9) {\n cityNode.setAttribute(\"selected\", \"selected\"); \n } \n\n cityNode.innerHTML = cityName;\n\n dropdown = document.getElementById(\"cities\");\n dropdown.appendChild(cityNode);\n valueCity = dropdown.value; // Define first value for selected city \n\n })\n \n }\n \n loadCities();\n \n displayWeather(cityArray, valueCity);\n \n }", "title": "" }, { "docid": "3290ba2878e144b5ecc73897afe8916f", "score": "0.62844104", "text": "function getCityData(city) {\n var query = getCityQuery(city);\n $.get(query, function(result) {\n var list = result.results.bindings;\n console.log(list)\n });\n\n}", "title": "" }, { "docid": "2146ee72524d80206db4099d7ae6986d", "score": "0.6271242", "text": "function displayCities() {\n\t\tfor (let city of myCities) {\n\t\t\tif (city.active == 1) {\n\t\t\t\tdisplayCity(city);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "ae4efa1a2b1a98fbc6b578d98623dfea", "score": "0.6267528", "text": "function CityObj(city_id) {\n for (var i = 0; i < data.city.length; i++) {\n if (data.city[i].city_id == city_id) {\n this.type = \"city\";\n this.city_id = data.city[i].city_id;\n this.capital = (data.city[i].capital === \"true\") ? true : false;\n this.description = data.city[i].description;\n this.image = data.city[i].image;\n this.lat = data.city[i].lat;\n this.long = data.city[i].long;\n this.city_type = data.city[i].type;\n\n if (data.city[i].lat_2) {\n this.lat_2 = data.city[i].lat_2;\n this.long_2 = data.city[i].long_2;\n }\n\n this.name = (data.city[i].type) ? getCityNameUpdatedEn(data.city[i].name, data.city[i].type) : data.city[i].name;\n this.name_nt = data.city[i].name_nt;\n this.name_ru = (data.city[i].type) ? getCityNameUpdatedRu(data.city[i].name_ru, data.city[i].type) : data.city[i].name_ru;\n this.region_id = data.city[i].region_id;\n\n this.setFullCityName = function () {\n var result;\n if (this.name_nt == \"\") {\n result = this.name_ru + \" - \" + this.name;\n }\n else if (this.name_ru == \"\") {\n result = this.name_nt + \" - \" + this.name;\n }\n else if (this.name == \"\") {\n result = this.name_ru + \" - \" + this.name_nt;\n }\n else {\n result = this.name_ru + \" - \" + this.name_nt + \" - \" + this.name;\n }\n return result;\n }\n this.getCountryId = function () {\n var region;\n for (var j = 0; j < data.area.length; j++) {\n if (data.area[j].region_id == this.region_id)\n {region = data.area[j];}\n }\n if(typeof region == \"undefined\") { return \"\"; }\n var country = $.grep (data.country, function( n, i ){\n return (n.country_id == region.country_id)\n });\n\n return country[0].short_name;\n }\n this.getRegion = function () {\n return new RegionObj(this.region_id);\n }\n break;\n }\n }\n }", "title": "" }, { "docid": "84cc0885893f009c27113f175941b655", "score": "0.6262934", "text": "function addListCity( name ) {\n var newCity = $( \"<li>\" );\n newCity.addClass( \"sidebar_city\" );\n newCity.text( name );\n $( \"#city_search\" ).val( \"\" );\n $( \"#card_list\" ).append( newCity );\n}", "title": "" }, { "docid": "bd77a6eaa1252c30bf8b308e451b8eff", "score": "0.6262712", "text": "function GetCityList(country, searchtext) {\r\n\r\n $.mobile.showPageLoadingMsg(\"a\", \"Loading ...\");\r\n\r\n // var city_list_url_updated = city_list_url + \"?searchText=\" + searchtext + \"&countryCode=\" + country + \"&pageSize=200&pageNum=1\";\r\n var city_list_url_updated = city_list_url + \"?searchText=\" + searchtext + \"&countryCode=\" + country + \"&pageSize=200&pageNum=1\";\r\n $.ajaxExec({\r\n url: city_list_url_updated,\r\n success: function (data) {\r\n // $.log(JSON.stringify(data.data));\r\n ShowCityList(data.data);\r\n\r\n $.mobile.hidePageLoadingMsg();\r\n }\r\n });\r\n }", "title": "" }, { "docid": "eb4fb8e599cff01b23bc3d77fec4e93d", "score": "0.62541664", "text": "function getCity(url) {\n\t$.getJSON(url, function(data, textStatus) {\n\t\t$.each(data.results[0].address_components, function(key, value) {\n\t\t\tif (value.types[0] == \"locality\") {\n\t\t\t\t$('#art_city').val(value.long_name);\n\t\t\t};\n\t\t\tif (value.types[0] == \"country\") {\n\t\t\t\t$('#art_country').val(value.long_name);\n\t\t\t};\n\t\t});\n\t});\n}", "title": "" }, { "docid": "506327610ba3ee3333f5b80d95ee814f", "score": "0.6252117", "text": "function loadCities() {\n // Use CORS\n esriConfig.defaults.io.corsEnabledServers.push(\"https://services1.arcgis.com\");\n // infotemplate - not a required component\n var template = new InfoTemplate(\"${CITY_NAME}\", \"Population: ${POP}\");\n \n url = \"https://services1.arcgis.com/XRQ58kpEa17kSlHX/ArcGIS/rest/services/World_Cities/FeatureServer/0\";\n\n cities = new FeatureLayer(url, {\n mode: FeatureLayer.MODE_SNAPSHOT,\n orderByFields: [\"POP DESC\"],\n outFields: [\"CITY_NAME\", \"POP\"],\n opacity: 0.5,\n infoTemplate: template\n });\n\n // required data for proportional symbols based on city population\n var sizeInfo = {\n field: \"POP\",\n valueUnit: \"unknown\",\n minDataValue: 50000,\n maxDataValue: 1500000,\n minSize: 6,\n maxSize: 25\n };\n\n var marker = new SimpleMarkerSymbol();\n marker.setColor(new Color(\"#00FFFF\"));\n marker.setStyle(SimpleMarkerSymbol.STYLE_CIRCLE);\n var renderer = new esri.renderer.SimpleRenderer(marker);\n cities.setRenderer(renderer);\n\n cities.on(\"load\", function () {\n cities.renderer.setSizeInfo(sizeInfo);\n });\n\n map.addLayer(cities);\n }", "title": "" }, { "docid": "e4bfee66b853a75a4f326fb9da45cb03", "score": "0.62508965", "text": "function showSearchCities() {\n\n let saved = localStorage.getItem(\"cities\");\n if (saved == null) {\n return;\n }\n saved = JSON.parse(saved);\n\n for (var i=0; i<saved.length; i++) {\n $(\".search-city\").prepend($(\"<li></li>\").text(saved[i]));\n }\n}", "title": "" }, { "docid": "30f3d2fc10a16edc1c9e499a8936d6a2", "score": "0.62324923", "text": "function addCity() {\n let city = document.getElementById(\"city_name\");\n city.textContent = apiObj.name + \", \" + apiObj.sys.country;\n }", "title": "" }, { "docid": "1b3b12e46bb908bfa5f7241714291846", "score": "0.6221175", "text": "function createCityList() {\n var cityUl = $('#cityList')\n cityUl.empty()\n for (var i = 0; i < cityArray.length; i++) {\n var city = cityArray[i];\n var liEl = $('<li>').text(city).addClass('list-group-item li-hover border rounded').attr('id', city)\n cityUl.prepend(liEl)\n }\n}", "title": "" }, { "docid": "0e2b1516a664efe79a8381e23d7be4f2", "score": "0.6197485", "text": "function fnLoadCities() {\n $.ajax({\n\n type: \"POST\",\n url: baseURL + \"BusService.asmx/GetSources\",\n data: '',\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n\n success: function (result) {\n if (result.d != '') {\n //parse to json format\n var data = $.parseJSON(result.d);\n\n // data = $.parseJSON(data);\n //declare a variable to get city names \n var cities = '[ ';\n\n //loop cities and add to dropdown\n $(data).each(function (index) {\n\n if ($.trim(cities.toString()) != '[' && (cities.toString().lastIndexOf(',') + 1) != cities.length)\n cities += ', ';\n\n cities += '{ \"label\":\"' + this.name + '\",\"value\":\"' + this.id + '\"}';\n });\n\n cities += ' ]';\n\n\n //set cities variable value to hidden field\n /** hdnSources is required only if text box is used for sources **/\n $('#hdnSources').val(cities);\n //comment this function to set autocomplete to default search\n fnInitializeAutoComplete();\n\n //set auto complete properties to text field\n $(\"#txtSource\").autocomplete({\n selectFirst: true,\n source: $.parseJSON($('#hdnSources').val()),\n minLength: 2,\n maxItemsToShow: 20,\n autoFocus: false,\n select: function (event, ui) {\n //prevent default action\n event.preventDefault();\n // set selected city id to hidden field\n $('#hdnSelectedSource').val(ui.item.value);\n //set selcted city name to text box\n $(this).val(ui.item.label);\n $(\"#txtDestination\").val('');\n $(\"#txtDestination\").focus();\n\n },\n focus: function (event, ui) {\n //prevent default action\n event.preventDefault();\n //set selcted city name to text box\n //$(this).val(ui.item.label);\n },\n change: function (event, ui) {\n //check if entered value is a valid city \n if (ui.item == null) {\n $(\"#txtSource\").val('Enter Source');\n // alert('Please enter valid from city');\n $('#hdnSelectedSource').val('');\n }\n }\n });\n\n //25-Nov-2012 : Show first item by default\n if ($(\"#txtSource\").val() == '') {\n //add cookies\n if ($.cookie('SourceUser') != null && $.cookie('DestinationUser') != null) {\n $(\"#txtSource\").val($.cookie('SourceUser'));\n $(\"#txtDestination\").val($.cookie('DestinationUser'));\n if ($.cookie('SelectedSourceUser') != null && $.cookie('SelectedDestinationUser') != null) {\n $(\"#hdnSelectedSource\").val($.cookie('SelectedSourceUser'));\n $(\"#hdnSelectedDestination\").val($.cookie('SelectedDestinationUser'));\n }\n }\n else {\n $(\"#txtSource\").val('Enter Source');\n //$('#hdnSelectedSource').val(data[1115].id);\n $(\"#txtDestination\").val('Enter Destination');\n //$(\"#hdnSelectedDestination\").val(data[303].id);\n\n }\n\n }\n\n $(\"#txtSource\").focus();\n\n //set cities variable value to hidden field\n /** hdnSources is required only if text box is used for sources **/\n $('#hdnDestinations').val(cities);\n\n $(\"#txtDestination\").autocomplete({\n selectFirst: true,\n source: $.parseJSON($('#hdnDestinations').val()),\n minLength: 2,\n autoFocus: false,\n select: function (event, ui) {\n //pre vent default action\n event.preventDefault();\n // set selected city id to hidden field\n $('#hdnSelectedDestination').val(ui.item.value);\n //set selcted city name to text box\n $(this).val(ui.item.label);\n $('#divDOJ').show();\n },\n focus: function (event, ui) {\n //prevent default action\n event.preventDefault();\n //set selcted city name to text box\n //$(this).val(ui.item.label);\n },\n change: function (event, ui) {\n //check if entered value is a valid city \n if (ui.item == null) {\n $(\"#txtDestination\").val('Enter Destination');\n $('#hdnSelectedDestination').val('');\n }\n }\n });\n }\n },\n error: function (xhr, status, error) {\n //alert('Call to service failed.');\n //alert(xhr.responseText + \" \\n \" + status + \" \\n \" + error);\n }\n });\n}", "title": "" }, { "docid": "69bd4aa8d17467e478c5c814acc2b4a3", "score": "0.6180706", "text": "function processCities(cityInput){\n\t$.getJSON( cityInput, function( data ) {\n\t\tfor(var i = 0; i < data.length; i++) {\n\t \tvar obj = data[i];\n\t \tcodeAddress(obj.name);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "5b2c348ff9fa31b0b8f67f0025a16a60", "score": "0.6172069", "text": "function createCityList() {\n\t$(\"#cityList\").empty();\n\tfor (var i = 0; i < cityName.length; i++) {\n\t\tvar cityLiItem = $(\"<button>\").text(cityName[i]);\n\t\tcityLiItem.addClass(\n\t\t\t\"btn btn-outline-secondary d-flex justify-content-start\"\n\t\t);\n\t\t/* This portion call the makeAjaxCall() function here to make sure all weather data populates for each\n\t\tclicked city value.*/\n\t\tcityLiItem.on(\"click\", function () {\n\t\t\tlastCity = $(this).text();\n\t\t\tmakeAjaxCall();\n\t\t});\n\t\t$(\"#cityList\").append(cityLiItem);\n\t}\n}", "title": "" }, { "docid": "c6e9985ec0741bdb2465c135a33bb5d5", "score": "0.6167981", "text": "function getIndCity(cities){\n for(var i=0;i<cities.length;i++){\n var newAPI = base_path+cities[i]+\".json\";\n getData(newAPI);\n\n }\n}", "title": "" }, { "docid": "bb0dd7e3e1ca99c77c59745ccca12020", "score": "0.6166616", "text": "function requestGetCities() {\n var spinner = dialog.showSpinner();\n var params = {\n has_team: 0,\n type: 'hospital'\n };\n CommonService.getCity(params).then(function (res) {\n dialog.closeSpinner(spinner.id);\n var allCities = [defaultAllCity].concat(res.results);\n StorageConfig.CITY_STORAGE.putItem('hospitalCities', allCities);\n var areaOperateObj = {\n enable: true,\n areas: allCities,\n trackKey: 'city',\n currentArea: StorageConfig.CITY_STORAGE.getItem('hospitalCityCurrent') ? StorageConfig.CITY_STORAGE.getItem('hospitalCityCurrent') : defaultAllCity,\n selectedCall: function (item) {\n selectedCall(item);\n }\n };\n window.headerConfig.areaOperate = areaOperateObj;\n $rootScope.$broadcast('setHeaderConfig', window.headerConfig);\n }, function (res) {\n dialog.closeSpinner(spinner.id);\n dialog.alert(res.errorMsg);\n });\n }", "title": "" }, { "docid": "4d72b266defcb72f02d77f98d63d442f", "score": "0.61644804", "text": "function successCitiesAround(res, cities) {\n\tvar list = null;\t\n\tif (cities != null)\n\t{\n\t\tlist = _.map(cities.list, function(key) {\t\t\t\n\t\t\treturn _.pick(key, 'id', 'name', 'coord'); \n\t\t});\n\t}\n\treturn list;\n}", "title": "" }, { "docid": "2922ea2d4bdc5d2762a87ac3c6f66979", "score": "0.61550236", "text": "get city() {\n return privates.get(this).get(\"[[city]]\");\n }", "title": "" }, { "docid": "42512512e6dee3c2de02195f976cc779", "score": "0.61539555", "text": "renderCitiesList() {\n\t\t//we have the cities updated from the app state \n\t\t// now is time the map over all the elements and \n\t\treturn this.props.cities.map(\n\t\t\t(item) => {\n\t\t\t\treturn (\n\t\t\t\t\t<li \n\t\t\t\t\t\tkey={item.name}\n\t\t\t\t\t\tonClick={ () => this.props.selectedCity(item)} \n\t\t\t\t\t\tclassName=\"list-group-item\" >\n\t\t\t\t\t\t{item.name}\n\t\t\t\t\t</li>\n\t\t\t\t);\n\t\t\t}\n\n\t\t);\n\t}", "title": "" }, { "docid": "73e5d9a4081ff34a37ce14e22e8b7df9", "score": "0.6144408", "text": "function getCities(res, mysql, context, complete){\n\t\tmysql.pool.query(\"SELECT c.id, c.name FROM City c\", function(error, results, fields){\n\t\t\tif(error){\n\t\t\t\tres.write(JSON.stringify(error));\n\t\t\t\tres.end();\n\t\t\t}\n\t\t\tcontext.cities = results;\n\t\t\tcomplete();\n\t\t});\n\t}", "title": "" }, { "docid": "28961a0db85ffdebabf23b8e80c921bc", "score": "0.6138337", "text": "function printCity(i) {\n console.log(\"City: \" + citiesList[i][0]);\n console.log(\"Latitude: \" + getLat(i));\n console.log(\"Longitude: \" + getLong(i) + \"\\n\");\n}", "title": "" }, { "docid": "8d65c57549d7f2824c9d57da1eb35d78", "score": "0.61362267", "text": "function cityDropdown (stateId){\n var select = document.getElementById( 'citiesSelect' );\n $('#citiesSelect')\n .find('option')\n .remove()\n .end()\n .append('<option value=\"\">- Select a City -</option>')\n for ( var x in cities ) {\n if(cities[x].state_id == stateId) {\n var option = document.createElement( 'option' );\n option.value = cities[ x ].county_fips;\n option.text = cities[ x ].city + ', '+ cities[ x ].state_id ;\n select.appendChild( option );\n }\n } // end for loop\n } // end cityDropdown", "title": "" }, { "docid": "8e7013ebc53131195cb1a559a71f905b", "score": "0.6135276", "text": "function citySelect(data, event) {\n var $this = $(event.target),\n $cities = $(\"#tabletki-city\"),\n $regionIndex = $regions.val(),\n citiesArray = [];\n\n $cities.html('<option value=\"all\">Все города</option>');\n if($regionIndex == \"all\") {\n $cities.attr('disabled', true);\n } else {\n $cities.attr('disabled', false);\n $.each(data.response.rests, function(key, val) { // Filling an array of cities without repeats\n if(val.area == $regionIndex && val.town != 0) {\n if( $.inArray(val.town, citiesArray) == -1 ) {\n citiesArray.push(val.town);\n }\n }\n });\n citiesArray.sort();\n $.each(citiesArray, function(index, value){ // Filling Cities Select\n $cities.append('<option value=\"' + value + '\">' + value + '</option>');\n });\n }\n }", "title": "" }, { "docid": "39bea5e300c37c146be51944bc699da3", "score": "0.6098811", "text": "function getAllCities(){ \n vm.Cities.getAll().then(function(res){\n vm.allCities = res.data;\n });\n }", "title": "" }, { "docid": "ecb75249e33a9a18b0ec834d5bbab7cb", "score": "0.6096222", "text": "function placeCities(render) {\n var params = render.params;\n var h = render.h;\n var n = params.ncities;\n for (var i = 0; i < n; i++) {\n placeCity(render);\n }\n}", "title": "" }, { "docid": "68ef27c0444f7859bf146d092cd2c2c9", "score": "0.60952955", "text": "CityList() {\n this.service.getCityCode(this.state_id).subscribe(res => {\n if (res['status'] == '1') {\n console.log(\"api response\", res);\n this.city_Obj = res['data'];\n }\n });\n }", "title": "" }, { "docid": "642e78ee557cd07d73dabae13045d2a2", "score": "0.6090056", "text": "function createListOfVisites(){\n //EXAMPLE: <div class=\"firstcell float_l\">10.июля - 19.июля</div>\n // <div class=\"secondcell float_l\"><a href=\"countries.aspx?country=poland\" id=\"25,52,19.5;Katowice,50.2599736,19.0284561;Wroclaw,51.122489,17.026062;Swidnica,50.8403152,16.4935923;Ksiaz,50.8440566,16.2897844;Opole,50.6780534,17.9175784;\" onmouseover=\"CreateMap(this.id)\" onmouseout=\"CreateMap('none')\">Катовице, Вроцлав, Свидница, Кщёнж, Ополе (Польша)</a></div>\n // <br class=\"clear\">\n var result = \"\";\n var VisitYear;\n var VisitYear_HTML = \"\";\n\n $.each (visitsSorted, function( i, visit ) {\n //This section sets year\n if (visit.start_date.getFullYear() != VisitYear) {\n VisitYear = visit.start_date.getFullYear();\n VisitYear_HTML = \"<div class='visityear clear'>\" + VisitYear + \"</div>\";\n }\n\n //This section is responsible to create date section\n var VisitDate = \"<div class='firstcell float_l'>\" + getVisitDate (visit.start_date, visit.end_date).slice(0, -3) + \"</div>\";\n\n //This section is responsible for displaying list of visited cities and countries\n switch (local[1].type) {\n case \"country\":\n var citiesToReturn = \"\";\n $.each (visit.cities, function( i, city ){\n if (city.country_id == local[1].short_name) {\n citiesToReturn += \"<a id='\" + city.city_id + \"' onclick='javascript:getCityPage(this.id)' onmouseover='' style='cursor: pointer;'>\" +\n getRusLocationName(city.city_id) + \"</a>\" + \", \"\n }\n });\n if (citiesToReturn != \"\") {\n result += VisitYear_HTML;\n result += VisitDate + \"<div class='secondcell float_l'>\" + citiesToReturn.slice(0, -2) + \"</div><br class='clear'>\";\n VisitYear_HTML = \"\";\n }\n break;\n case \"city\":\n var citiesToReturn = \"\";\n var distinctIds = {};\n $.each (visit.cities, function( i, city ){\n if (city.city_id == local[1].city_id) {\n var date = getVisitDate (visit.start_date, visit.end_date, \"year\");\n if (!distinctIds[date]){\n result += date;\n distinctIds[date] = true;\n }\n }\n });\n break;\n default:\n var citiesToReturn = \"\";\n var countriesToReturn = \"\";\n var distinctIds = {};\n\n result += VisitYear_HTML ;\n\n $.each (visit.cities, function( i, city ){\n citiesToReturn += \"<a id='\" + city.city_id + \"' onclick='javascript:getCityPage(this.id)' onmouseover='' style='cursor: pointer;'>\" +\n getRusLocationName(city.city_id) + \"</a>\" + \", \";\n if (!distinctIds[city.country_id]){\n countriesToReturn += \"<a id='\" + city.country_id + \"' onclick='javascript:getCountryPage(this.id)' onmouseover='' style='cursor: pointer;'>\" +\n getRusCountryName(city.country_id) + \"</a>\" + \", \";\n distinctIds[city.country_id] = true;\n }\n });\n result += VisitDate + \"<div class='secondcell float_l'>\" + citiesToReturn.slice(0, -2) + \" (\" + countriesToReturn.slice(0, -2) + \")</div><br class='clear'>\";\n VisitYear_HTML = \"\";\n }\n\n //Can be added to display a city on the map: onmouseover='CreateMap(this.id)' onmouseout=\\\"CreateMap('none')\\\"\n //\"' id='\" + zoomLat + \",\" + zoomLong + \",\" + zoomLvl + \";\" + citiesCoordinates +\n });\n return result;\n}", "title": "" }, { "docid": "bb620b88244b055cc422cfca33ab28fe", "score": "0.60823303", "text": "function initDropList(cityData) {\n\n var uniqueCity = [...new Set(Object.values(cityData['city']))];\n var nbh_name = Object.values(cityData['nbh_name']);\n\n // call function to populate the form dropdown menu options for each filter criteria in alphabetical order\n createDropList(uniqueCity, \"selCity\", \"Select City\", 2);\n createDropList(nbh_name, \"selNeighborhood\", \"Select Neighborhood\", 2);\n\n}//initDropList() function", "title": "" }, { "docid": "39980c1730ec0f5a5075391605291ff5", "score": "0.6065126", "text": "function addCities(response) {\n var cities = response;\n initDropList(cities[0]);\n return cities;\n}//end addCities() function", "title": "" }, { "docid": "5d0a20e4ee6b86b6dc3c36689ffc0fd7", "score": "0.605951", "text": "function ReadAllCities()\n{\n var cityList = [];\n var data = fs.readFileSync(cityFile, \"utf-8\");\n var lines = data.split(\"\\n\");\n\n lines.forEach(line => { var city = BuildCityFromLine(line); if (city) cityList.push(city); });\n return cityList;\n}", "title": "" }, { "docid": "acd79cc0fe17a877bd48bd6672bbd85c", "score": "0.6052944", "text": "function displaySearchHistory(city) {\n for (var i = 0; i < cities.length; i++) {\n $city = $(\"<div>\").addClass(\"card my-1 py-3 px-3 lsDisplay\");\n $city.html(cities[i]);\n $searchItems.append($city);\n }\n}", "title": "" }, { "docid": "a118894a63022c18a5bc29ae69ef1f5f", "score": "0.6046665", "text": "function city(arr){\n $(\"#city_user\").empty();//To reset cities\n $(\"#city_user\").append(\"<option>--Seleccionar ciudad--</option>\");\n $(arr).each(function(i){//to list cities\n $(\"#city_user\").append(\"<option value=\\\"\"+arr[i].value+\"\\\">\"+arr[i].display+\"</option>\")\n });\n}", "title": "" }, { "docid": "0eb8e602d1b80106d777975a2e1a6d6f", "score": "0.6042734", "text": "function getCity(){\n if(citiesGuessedList.length === cityTheme.cityCount()){\n return \"Game End! Refresh/reload Browser\";\n }\n else{\n reset();\n cityDetails = cityTheme.nextCity();\n currentCity = cityDetails[0];\n \n //for loop to check the current city is not in Cities Guessed List\n for(var i=0; i<citiesGuessedList.length; i++){\n if(currentCity === citiesGuessedList[i]){\n cityDetails = cityTheme.nextCity();\n currentCity = cityDetails[0];\n i = 0;\n }\n }//end of for loop\n //to display a city\n \n for(var i=0; i < currentCity.length; i++){\n displayCityLetters = displayCityLetters + \"_\";\n }\n return displayCity(); \n\n }\n}//end of getcity", "title": "" }, { "docid": "19682e984d283da91a1fd5e3976a83a1", "score": "0.60349435", "text": "function locality(){\n Form2.tbxLocation.autoFilter=true;\n Form2.tbxLocation.filterList=[\"Vijayawada\",\"Vellore\",\"Guntur\",\"Gudivada\"];\n Form2.fscSegment.zIndex=\"2\";\n var cityList=[];\n Form2.fscSegment.setVisibility(true);\n Form2.fscTotal.onClick=clicking;\n var city=Form2.tbxLocation.text;\n var name=[{\"lblSegmentData\":\"Vijayawada\"},\n {\"lblSegmentData\":\"Vellore\"},\n {\"lblSegmentData\":\"Guntur\"},\n {\"lblSegmentData\":\"Gudivada\"}];\n kony.print(\"name\");\n Form2.segCity.setData(name);\n Form2.segCity.onRowClick = onRowClicking;\n kony.print(\"segCity\");\n var arrayLength=name[0].length;\n var names=name[0].lblSegmentData;\n kony.print(\"names\"); \n}", "title": "" }, { "docid": "8f211bb24e56e1e708af8e331450dcfb", "score": "0.60317457", "text": "function renderList() {\n \n // Render a new li for each cityName\n for (var i = 0; i < cities.length; i++) {\n var city = cities[i];\n //alert(\"renderList: \" + city);\n \n //create a line item add the cityName and append to the ul parent\n\n $(\"<li>\").text(city).css('text-transform', 'capitalize').addClass(\"list-group-item\").appendTo(\".history\");\n\n\n }\n }", "title": "" }, { "docid": "ac7cb1619725060d4df481488f95cbd5", "score": "0.60201377", "text": "async function loadCitiesList() {\n let cities_ids = []\n await Cities.map((item) => { cities_ids.push(item.id) })\n await API.get('group?id=' + cities_ids + '&units=metric&appid=' + config.openWeatherKey).then(function (response) {\n setCitiesWeather(response.data.list)\n })\n .catch((error) => console.debug(error))\n .then(() => { setloadingCities(false) })\n }", "title": "" }, { "docid": "5b14723b8cca5ab445449bba268dd080", "score": "0.6018565", "text": "function getCities(event) {\r\n\tconst citySelect = document.querySelector(\"select[name=city]\");\r\n\tconst stateInput = document.querySelector(\"input[name=state]\");\r\n\r\n\t// Limpar as opções de cidade porque se não ele só adiciona toda vez que mudar o estado\r\n\t// e vai ficar cidade do estado errado\r\n\tcitySelect.disabled = true;\r\n\tcitySelect.innerHTML = \"<option value>Selecione a cidade</option>\";\r\n\r\n\tconst ufValue = event.target.value;\r\n\r\n\tconst selectedStateIndex = event.target.selectedIndex;\r\n\tstateInput.value = event.target.options[selectedStateIndex].text;\r\n\r\n\tconst url = `https://servicodados.ibge.gov.br/api/v1/localidades/estados/${ufValue}/municipios`;\r\n\r\n\tfetch(url)\r\n\t\t.then((res) => res.json())\r\n\t\t.then((cities) => {\r\n\t\t\tfor (city of cities) {\r\n\t\t\t\tcitySelect.innerHTML += `<option value=\"${city.nome}\">${city.nome}</option>`;\r\n\t\t\t}\r\n\r\n\t\t\tcitySelect.disabled = false;\r\n\t\t});\r\n}", "title": "" }, { "docid": "9cf6652be893fa53486f2eae63cfae8e", "score": "0.6015425", "text": "async getCitites(state){\n //getting the cities from the API\n const url = \"https://www.universal-tutorial.com/api/cities/\" + state \n const response = await fetch(url, {\n headers:{\n 'Authorization':\"Bearer \" + this.state.authToken,\n 'Accept': 'application/json'\n }\n })\n\n //storing the received data as a JSON\n const data = await response.json()\n\n //now we store all the cities in a temporary array\n var cities = []\n for(var x in data){\n var obj = data[x]\n cities.push(obj['city_name'])\n }\n //set the state with the cities that we received\n this.setState({\n cities: cities\n })\n \n }", "title": "" }, { "docid": "016a277c822860dc7645be856c991c56", "score": "0.6007738", "text": "function showCity(stateName) {\r\n // console.log(stateName);\r\n // console.log(data[stateName].districtData);\r\n var dis = document.getElementById(\"city\");\r\n dis.selectedIndex = -1; // everytime new city is selected it should show select city\r\n dis.options.length = 1;// set to one so that the -1 index i.r select city option should not be removed \r\n var jsondistrict = data[stateName].districtData;\r\n var getdistrict = Object.keys(jsondistrict);\r\n // console.log(getdistrict);\r\n for (var i = 0; i < getdistrict.length; i++) {\r\n var opt = document.createElement('option');\r\n opt.value = getdistrict[i];\r\n opt.innerHTML = getdistrict[i];\r\n dis.appendChild(opt);\r\n }\r\n}", "title": "" }, { "docid": "819effc244b940a92eb4ddbcde460802", "score": "0.6001931", "text": "function init() {\n $(\"#city-list\").empty();\n var storedCities = JSON.parse(localStorage.getItem(\"cities\"));\n if (storedCities !== null) {\n cities = storedCities;\n };\n renderCities();\n}", "title": "" }, { "docid": "ab8e9bca9a50bdc4cca8739fe1dfc33c", "score": "0.5997039", "text": "function ChangeCity() {\n cfi.ResetAutoComplete(\"CitySNo\");\n cfi.ResetAutoComplete(\"OfficeSNo\");\n }", "title": "" }, { "docid": "c447808493797d1740c5fec9e416cc09", "score": "0.5985675", "text": "function getLocations(url, cb) {\n return new Promise(resolve => {\n url = \"https://eopyy.gov.gr/api//v1/Customs/CountiesWithCities\"\n getPageOptions(url, function (error, response, body) {\n var obj = JSON.parse(body);\n var locArray = new Array;\n let i = 0;\n var city = null;\n var cityNm = null;\n\n for (let i = 0; i < obj.length; i++) {\n var nomos = obj[i].Name;\n city = obj[i].Cities;\n //dont use value for nomos where nomos is not specified.\n if (nomos != \"ΑΚΑΘΟΡΙΣΤΟΣ ΝΟΜΟΣ\") {\n for (let j = 0; j < city.length; j++) {\n let locationObj = {};\n cityNm = city[j].Name;\n locationObj.nomosName = nomos;\n locationObj.cityName = cityNm;\n locArray.push(locationObj);\n }\n\n }\n }\n resolve(locArray)\n })\n })\n}", "title": "" }, { "docid": "b1daeb4c6bb9ec6f35c329483bbbf570", "score": "0.59823114", "text": "function showCityHistory() {\n var listDiv = $(\"#searchHistoryList\");\n listDiv.empty();\n\n for (var i = 0; i < cityArr.length; i++) {\n listDiv.prepend(\"<li class='nav-item'><div class='card'><div class='card-body'>\" + cityArr[i]);\n }\n }", "title": "" }, { "docid": "dc4aafac0679f161dcb557f9db5e7508", "score": "0.59795785", "text": "setCities(cities) {\n let result = [];\n cities.forEach((city) => {\n result.push(city.city)\n //console.log(this.state)\n });\n return this.setState({ justCities: result })\n }", "title": "" }, { "docid": "d1329ec1085a32899385dd25bb335101", "score": "0.5979495", "text": "function getCities(e) {\n state = e.target.value;\n table.style.display = 'none'; // re-hides the table in the case of a user switching states\n fetch(`${urlBase}cities?state=${state}&country=USA&key=${apiKey}`)\n .then((response) => response.json())\n .then((result) => {\n populateCities(result);\n })\n}", "title": "" }, { "docid": "6c276658e7e7bfe878377f97aff3e4f0", "score": "0.5977129", "text": "function getCountyNames(){\n return [\n \"AlachuaCounty\",\n \"BayCounty\",\n \"BrevardCounty\",\n \"BrowardCounty\",\n \"CharlotteCounty\",\n \"CitrusCounty\",\n \"ClayCounty\",\n \"CollierCounty\",\n \"DeSotoCounty\",\n \"DuvalCounty\",\n \"EscambiaCounty\",\n \"FlaglerCounty\",\n \"HernandoCounty\",\n \"HighlandsCounty\",\n \"HillsboroughCounty\",\n \"IndianRiverCounty\",\n \"JacksonCounty\",\n \"LakeCounty\",\n \"LeeCounty\",\n \"LeonCounty\",\n \"LevyCounty\",\n \"ManateeCounty\",\n \"MarionCounty\",\n \"MartinCounty\",\n \"Miami-DadeCounty\",\n \"MonroeCounty\",\n \"NassauCounty\",\n \"OkaloosaCounty\",\n \"OrangeCounty\",\n \"OsceolaCounty\",\n \"PalmBeachCounty\",\n \"PascoCounty\",\n \"PinellasCounty\",\n \"PolkCounty\",\n \"PutnamCounty\",\n \"SantaRosaCounty\",\n \"SarasotaCounty\",\n \"SeminoleCounty\",\n \"St.JohnsCounty\",\n \"St.LucieCounty\",\n \"VolusiaCounty\"\n\n ];\n\n}", "title": "" }, { "docid": "774e9c578c146aa48dfad4995f8b7d1b", "score": "0.59735554", "text": "function addCityToAllCities(city) {\n\n /*\n * If city doesn't already exist in the list of cities by which we can\n * filter, add it.\n */\n if (allCities.indexOf(city.toLowerCase()) === -1) {\n allCities.push(city.toLowerCase());\n var newCityOption = createCityOption(city);\n var filterCitySelect = document.getElementById('filter-city');\n filterCitySelect.appendChild(newCityOption);\n }\n\n}", "title": "" }, { "docid": "9454ccb502016dcb31d2016d88d2d429", "score": "0.59722686", "text": "function changeCity(obj, cid) {\n\tif (obj.value == '') {\n\t\tjQuery('#' + cid + ' option').remove();\n\t\tjQuery('#' + cid)\n\t\t\t\t.append(\"<option value=''>=\\u8bf7\\u9009\\u62e9=</option>\");\n\t\treturn;\n\t}\n\tjQuery.get(window.ctx + \"/common/changeCity.htm?proId=\" + obj.value, \"\",\n\t\t\tfunction(res) {\n\t\t\t\tif (res == null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tjQuery('#' + cid + ' option').remove();\n\t\t\t\tjQuery('#' + cid)\n\t\t\t\t\t\t.append(\"<option value=''>=\\u8bf7\\u9009\\u62e9=</option>\");\n\t\t\t\tfor (var c in res) {\n\t\t\t\t\tjQuery(\"#\" + cid).append(\"<option value='\"\n\t\t\t\t\t\t\t+ res[c].areacode + \"'>\" + res[c].name\n\t\t\t\t\t\t\t+ \"</option>\");\n\t\t\t\t}\n\t\t\t});\n\treturn false;\n}", "title": "" }, { "docid": "2e93e83c14b92dee780e3fcb327db775", "score": "0.5969959", "text": "function parseCities() {\n getSavedCities();\n citiesList.innerHTML = \"\";\n for (i = 0; i < recentCitiesArr.length; i++) {\n var cityLi = document.createElement(\"li\");\n cityLi.setAttribute(\"class\", \"list-group-item city-button rounded\");\n cityLi.innerHTML = recentCitiesArr[i];\n //add event listener to change city and run api's\n cityLi.addEventListener(\"click\", function (e) {\n e.preventDefault();\n city = this.innerText;\n getWeatherAPI();\n getForecastAPI();\n });\n citiesList.prepend(cityLi);\n };\n}", "title": "" }, { "docid": "d91773dc151680a41046cbded291edd8", "score": "0.59595215", "text": "function getCity(lat , lon) {\n\tvar dataCity = {},\n\t\treverseGeo = 'https://api.mapbox.com/v4/geocode/mapbox.places/' + lon + ',' + lat + '.json.json?access_token=' + App.Modules.config.tokenMap,\n\t\tdataLoc;\n\n\n\t$.ajax({\n\t\turl: reverseGeo,\n\t\ttype: 'GET',\n\t\tasync: false,\n\t\tsuccess: function(data) {\n\t\t\tdataLoc = data;\n\n\t\t\tdataLoc.features[0].context.forEach(function(element, index, array) {\n\t\t\t\tif(element.id.indexOf('place') >= 0) {\n\t\t\t\t\tdataCity.city = element.text;\n\t\t\t\t}\n\n\t\t\t\tif(element.id.indexOf('country') >= 0) dataCity.countryCode = element.short_code.toUpperCase();\n\t\t\t});\n\n\t\t\tif(!!!dataCity.city) {\n\t\t\t\tdataLoc.features.forEach(function(element, index, array) {\n\t\t\t\t\tif(element.id.indexOf('region') >= 0) {\n\t\t\t\t\t\tdataCity.city = element.text;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n\n\n\treturn dataCity;\n}", "title": "" }, { "docid": "4c016bf2821e970c6196689c658de4f3", "score": "0.59538525", "text": "getCityState(results) {\n //assuming locality and admin. are unique\n var arr = [];\n results[0]['address_components'].forEach(function(addComp) {\n if (addComp.types.includes('locality')) {\n arr[0] = addComp['long_name'];\n }\n if (addComp.types.includes('administrative_area_level_1')) {\n arr[1] = addComp['long_name'];\n }\n if (addComp.types.includes('locality')) {\n arr[2] = addComp['short_name'];\n }\n });\n return arr;\n }", "title": "" }, { "docid": "bb94495e7dffc592689ab2ac250b90cd", "score": "0.593356", "text": "function composeCityData(city){\n for(var x in cities_JSON){\n if(x==city){\n return new google.maps.LatLng(cities_JSON[x].latitude,cities_JSON[x].longitude);\n }\n }\n}", "title": "" }, { "docid": "f170209c848d3bd7908c7802276b24cc", "score": "0.59245855", "text": "function makeList() {\n let storageList = JSON.parse(localStorage.getItem(\"displayCity\"));\n document.querySelector(\"#city-history\").innerHTML = \"\";\n for (let i = 0; i < storageList.length; i++) {\n document.querySelector(\"#city-history\").append(storageList[i] + \", \");\n }\n}", "title": "" }, { "docid": "dddd18ccaa9f535bd57a1c3a196bee18", "score": "0.5920464", "text": "function addCities(response) {\n var cities = response; \n initDropList(cities[0]); \n return cities;\n}//end addCities() function", "title": "" }, { "docid": "cbc94cda515d5014cad322300e8aa6d4", "score": "0.5917605", "text": "function getAllServiceAddressCities (){\n\t\t\t\tif(WF_DEBUG)\n\t\t\t\t\tlog.debug({title: \"getAllMyWorkToday getAllServiceAddressCities\", details: {'allSAinvolved': allSAinvolved} });\n\n\t\t\t\t search.create({\n\t\t\t\t \ttype: 'customrecord_service_address',\n\t\t\t\t \tfilters: ['internalId','anyOf',allSAinvolved],\n\t\t\t\t \tcolumns : ['internalId','custrecord_city','custrecord_state','custrecord_sa_municipality']\n\t\t\t\t }).run().each(function(sar){\n\t\t\t\t \tvar xy = sar.getValue('internalId');\n\t\t\t\t \tif(xy !== null) {\n\t\t\t\t \t\tvar nm = newResults['servicesaddresses'][xy];\n\t\t\t\t \t\tnewResults['servicesaddresses'][xy]={\n\t\t\t\t \t\t\t'id'\t\t: xy,\n\t\t\t\t \t\t\t'name'\t\t: nm,\n\t\t\t\t \t\t\t'city'\t\t: sar.getValue('custrecord_city'),\n\t\t\t\t \t\t\t'state'\t\t: sar.getValue('custrecord_state'),\n\t\t\t\t \t\t\t'municipality' : sar.getValue('custrecord_sa_municipality'),\n\t\t\t\t \t\t};\n\t\t\t\t \t\tResults_pusher('cities', sar.getValue('custrecord_city'), sar.getText('custrecord_city') );\n\t\t\t\t \t\tResults_pusher('states', sar.getValue('custrecord_state'), sar.getText('custrecord_state') );\n\t\t\t\t \t\tResults_pusher('municipalities', sar.getValue('custrecord_sa_municipality'), sar.getText('custrecord_sa_municipality') );\n\t\t\t\t \t}\n\t\t\t\t \treturn true;\n\t\t\t\t });\n\t\t\t}", "title": "" } ]
6b68bbe5805b589e8f97564d4adeaf94
(public) returns index of lowest 1bit (or 1 if none)
[ { "docid": "2da32ae586c6008f395644e7d0422a77", "score": "0.8079967", "text": "function bnGetLowestSetBit() {\nfor(var i = 0; i < this.t; ++i)\n if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]);\nif(this.s < 0) return this.t*this.DB;\nreturn -1;\n}", "title": "" } ]
[ { "docid": "1d160737a3b7d1bd0d3cc45c503280b3", "score": "0.8289889", "text": "getLowestSetBit() {\n\t\t// return index of lowest 1-bit in x, x < 2^31\n\t\tconst lbit = x => {\n\t\t\tif (x == 0) return -1;\n\t\t\tvar r = 0;\n\t\t\tif ((x & 0xffff) == 0) {\n\t\t\t\tx >>= 16;\n\t\t\t\tr += 16;\n\t\t\t}\n\t\t\tif ((x & 0xff) == 0) {\n\t\t\t\tx >>= 8;\n\t\t\t\tr += 8;\n\t\t\t}\n\t\t\tif ((x & 0xf) == 0) {\n\t\t\t\tx >>= 4;\n\t\t\t\tr += 4;\n\t\t\t}\n\t\t\tif ((x & 3) == 0) {\n\t\t\t\tx >>= 2;\n\t\t\t\tr += 2;\n\t\t\t}\n\t\t\tif ((x & 1) == 0) ++r;\n\t\t\treturn r;\n\t\t}\n\n\t\tfor (var i = 0; i < this.t; ++i)\n\t\t\tif (this[i] != 0) return i * this.DB + lbit(this[i]);\n\t\tif (this.s < 0) return this.t * this.DB;\n\t\treturn -1;\n\t}", "title": "" }, { "docid": "69af880ed82b1c0ef16c039869192efc", "score": "0.8215089", "text": "function bnGetLowestSetBit(){\nfor(var i=0;i<this.t;++i){\nif(this[i]!=0)return i*this.DB+lbit(this[i]);}\nif(this.s<0)return this.t*this.DB;\nreturn-1;\n}", "title": "" }, { "docid": "41dd516bb456286d73b03f9b5110f39b", "score": "0.81559956", "text": "function bnGetLowestSetBit() {\r\nfor(var i = 0; i < this.t; ++i)\r\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\r\nif(this.s < 0) return this.t*this.DB;\r\nreturn -1;\r\n}", "title": "" }, { "docid": "5bd5937b00141f2fda56dc3fced038b3", "score": "0.8131321", "text": "function bnGetLowestSetBit() {\r\n for (var i = 0; i < this.t; ++i)\r\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\r\n if (this.s < 0) return this.t * this.DB;\r\n return -1;\r\n}", "title": "" }, { "docid": "90683027fa57a891cfed7db15acd51e5", "score": "0.8124347", "text": "function bnGetLowestSetBit() {\n\tfor(var i = 0; i < this.t; ++i)\n\t if(this[i] != 0) return i*this.DB+lbit(this[i]);\n\tif(this.s < 0) return this.t*this.DB;\n\treturn -1;\n }", "title": "" }, { "docid": "6d2ee665f276095d64d4c6eaa6091c11", "score": "0.81230235", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i) if (this[i] != 0) return i * this.DB + lbit(this[i]);\n if (this.s < 0) return this.t * this.DB;\n return -1;\n }", "title": "" }, { "docid": "462acf74223055e0c910a1ba252bdb83", "score": "0.8120284", "text": "function bnGetLowestSetBit() {\n\t\tfor(var i = 0; i < this.t; ++i)\n\t\t if(this[i] != 0) return i*this.DB+lbit(this[i]);\n\t\tif(this.s < 0) return this.t*this.DB;\n\t\treturn -1;\n\t }", "title": "" }, { "docid": "b317e1b9bcd76f42c7e7e42fd1eefd7a", "score": "0.8118487", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i) {\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\n }if (this.s < 0) return this.t * this.DB;\n return -1;\n }", "title": "" }, { "docid": "a8f041193cc17bd631b44d2f014cec77", "score": "0.8117575", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\n if (this.s < 0) return this.t * this.DB;\n return -1;\n}", "title": "" }, { "docid": "a8f041193cc17bd631b44d2f014cec77", "score": "0.8117575", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\n if (this.s < 0) return this.t * this.DB;\n return -1;\n}", "title": "" }, { "docid": "5255ecf3de719a621c608f9e70a584d6", "score": "0.8116526", "text": "function bnGetLowestSetBit() {\r\n for (var i = 0; i < this.t; ++i)\r\n if (this[i] != 0) return i * this.DB + lbit(this[i])\r\n if (this.s < 0) return this.t * this.DB\r\n return -1\r\n }", "title": "" }, { "docid": "982545d8b9f260e3e5cad0f137acdfbd", "score": "0.8101631", "text": "function bnGetLowestSetBit() {\n\t for(var i = 0; i < this.t; ++i)\n\t if(this[i] != 0) return i*this.DB+lbit(this[i]);\n\t if(this.s < 0) return this.t*this.DB;\n\t return -1;\n\t }", "title": "" }, { "docid": "982545d8b9f260e3e5cad0f137acdfbd", "score": "0.8101631", "text": "function bnGetLowestSetBit() {\n\t for(var i = 0; i < this.t; ++i)\n\t if(this[i] != 0) return i*this.DB+lbit(this[i]);\n\t if(this.s < 0) return this.t*this.DB;\n\t return -1;\n\t }", "title": "" }, { "docid": "982545d8b9f260e3e5cad0f137acdfbd", "score": "0.8101631", "text": "function bnGetLowestSetBit() {\n\t for(var i = 0; i < this.t; ++i)\n\t if(this[i] != 0) return i*this.DB+lbit(this[i]);\n\t if(this.s < 0) return this.t*this.DB;\n\t return -1;\n\t }", "title": "" }, { "docid": "982545d8b9f260e3e5cad0f137acdfbd", "score": "0.8101631", "text": "function bnGetLowestSetBit() {\n\t for(var i = 0; i < this.t; ++i)\n\t if(this[i] != 0) return i*this.DB+lbit(this[i]);\n\t if(this.s < 0) return this.t*this.DB;\n\t return -1;\n\t }", "title": "" }, { "docid": "49444376416af610162d526fbd3608a7", "score": "0.81002975", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "title": "" }, { "docid": "49444376416af610162d526fbd3608a7", "score": "0.81002975", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "title": "" }, { "docid": "49444376416af610162d526fbd3608a7", "score": "0.81002975", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "title": "" }, { "docid": "49444376416af610162d526fbd3608a7", "score": "0.81002975", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "title": "" }, { "docid": "49444376416af610162d526fbd3608a7", "score": "0.81002975", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "title": "" }, { "docid": "49444376416af610162d526fbd3608a7", "score": "0.81002975", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "title": "" }, { "docid": "49444376416af610162d526fbd3608a7", "score": "0.81002975", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "title": "" }, { "docid": "49444376416af610162d526fbd3608a7", "score": "0.81002975", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "title": "" }, { "docid": "49444376416af610162d526fbd3608a7", "score": "0.81002975", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "title": "" }, { "docid": "a922663d9b666f2cc92227a98b55eef2", "score": "0.8098758", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i) {\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\n }if (this.s < 0) return this.t * this.DB;\n return -1;\n}", "title": "" }, { "docid": "a922663d9b666f2cc92227a98b55eef2", "score": "0.8098758", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i) {\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\n }if (this.s < 0) return this.t * this.DB;\n return -1;\n}", "title": "" }, { "docid": "194309ecd181f3357830376edd0736eb", "score": "0.8098232", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}", "title": "" }, { "docid": "194309ecd181f3357830376edd0736eb", "score": "0.8098232", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}", "title": "" }, { "docid": "194309ecd181f3357830376edd0736eb", "score": "0.8098232", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}", "title": "" }, { "docid": "194309ecd181f3357830376edd0736eb", "score": "0.8098232", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}", "title": "" }, { "docid": "194309ecd181f3357830376edd0736eb", "score": "0.8098232", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.8085587", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.8085587", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.8085587", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.8085587", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.8085587", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.8085587", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.8085587", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.8085587", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.8085587", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.8085587", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.8085587", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.8085587", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.8085587", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.8085587", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.8085587", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.8085587", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.8085587", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "c84f49aec37dbe3a998ff77f4bfc3324", "score": "0.8072693", "text": "function bnGetLowestSetBit() {\n\t for (var i = 0; i < this.t; ++i)\n\t if (this[i] != 0) return i * this.DB + lbit(this[i]);\n\t if (this.s < 0) return this.t * this.DB;\n\t return -1;\n\t}", "title": "" }, { "docid": "c84f49aec37dbe3a998ff77f4bfc3324", "score": "0.8072693", "text": "function bnGetLowestSetBit() {\n\t for (var i = 0; i < this.t; ++i)\n\t if (this[i] != 0) return i * this.DB + lbit(this[i]);\n\t if (this.s < 0) return this.t * this.DB;\n\t return -1;\n\t}", "title": "" }, { "docid": "e6c3de515a34e9689318ed1ea19d8b14", "score": "0.8048734", "text": "function bnGetLowestSetBit()\n\t {\n\t for (var i = 0; i < this.t; ++i)\n\t if (this[i] != 0) return i * this.DB + lbit(this[i]);\n\t if (this.s < 0) return this.t * this.DB;\n\t return -1;\n\t }", "title": "" }, { "docid": "b7a965bc00c43a4288e801cba62131c3", "score": "0.8042495", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}", "title": "" }, { "docid": "b7a965bc00c43a4288e801cba62131c3", "score": "0.8042495", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}", "title": "" }, { "docid": "b7a965bc00c43a4288e801cba62131c3", "score": "0.8042495", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}", "title": "" }, { "docid": "e9f6ad059dccd161211eb862b66ae41b", "score": "0.73474663", "text": "function FindFirstBitIs1(num) {\n let indexBit = 0 ;\n while ((num & 1) == 0) {\n num >>= 1 ;\n indexBit ++ ;\n }\n return indexBit ;\n }", "title": "" }, { "docid": "1287c08963d35611492236ea867d1ef2", "score": "0.7308405", "text": "function lowestBit(num) {\n return num & -num;\n}", "title": "" }, { "docid": "b6e9c046e65e78405766878a9a94b4f1", "score": "0.67360294", "text": "function lowbits(n) { return n & (width - 1); }", "title": "" }, { "docid": "b6e9c046e65e78405766878a9a94b4f1", "score": "0.67360294", "text": "function lowbits(n) { return n & (width - 1); }", "title": "" }, { "docid": "a9dded801408a36ec933818c1d3f93cd", "score": "0.6733975", "text": "getSingleTrueBit() {\n let index = null;\n const bytes = this.uint8Array;\n // Iterate over each byte of bits\n for (let iByte = 0, byteLen = bytes.length; iByte < byteLen; iByte++) {\n // If it's exactly zero, there won't be any indexes, continue early\n if (bytes[iByte] === 0) {\n continue;\n }\n // Get the precomputed boolean array for this byte\n const booleansInByte = getUint8ByteToBitBooleanArray(bytes[iByte]);\n // For each bit in the byte check participation and add to indexesSelected array\n for (let iBit = 0; iBit < 8; iBit++) {\n if (booleansInByte[iBit] === true) {\n if (index !== null) {\n // ERROR_MORE_THAN_ONE_BIT_SET\n return null;\n }\n index = iByte * 8 + iBit;\n }\n }\n }\n if (index === null) {\n // ERROR_NO_BIT_SET\n return null;\n }\n else {\n return index;\n }\n }", "title": "" }, { "docid": "e057a8f53b01612dd4882533ccfa61f8", "score": "0.66312134", "text": "function indexOfSmallest(array) {\n if (array.length <= 1) {\n return 0;\n } else {\n var tmpIndex = indexOfSmallest(array.slice(1)) + 1;\n if (array[0] < array[tmpIndex] || array[tmpIndex] < 0) {\n return 0;\n } else {\n return tmpIndex;\n }\n }\n}", "title": "" }, { "docid": "00bb9b776f4df4f86d70a89317c2431e", "score": "0.6611355", "text": "function indexOfSmallest(a) {\n var lowest = 0;\n for (var i = 1; i < a.length; i++) {\n if (a[i] < a[lowest]) lowest = i;\n }\n return lowest;\n }", "title": "" }, { "docid": "cf333ccee724a7ee59e25a562b07b1ab", "score": "0.6590582", "text": "function indexOfSmallest(a) {\n var lowest = 0;\n for (var i = 1; i < a.length; i++) {\n if (a[i] < a[lowest]) lowest = i;\n }\n return lowest;\n }", "title": "" }, { "docid": "80a8ea9dd4419479a14c272c1c8c25fe", "score": "0.6586148", "text": "function lowbits(n) {\n return n & (width - 1);\n }", "title": "" }, { "docid": "bc091f5c0729ba842eed01190c7227f9", "score": "0.6573836", "text": "function indexOfSmallest(a) {\r\n var lowest = 0;\r\n for (var i = 1; i < a.length; i++) {\r\n if (a[i] < a[lowest]) lowest = i;\r\n }\r\n return lowest;\r\n }", "title": "" }, { "docid": "4274f388eb8a78e962f6d38e5744d11c", "score": "0.6422122", "text": "function indexOfMin(a) {\n var lowest = 0;\n for (var i = 1; i < a.length; i++) {\n if (a[i] < a[lowest]) lowest = i;\n }\n return lowest;\n}", "title": "" }, { "docid": "9efa6693f47d97daaf0512cb158cd16e", "score": "0.6360362", "text": "function indexOfMin(arr) {\n if (arr.length === 0) {\n return -1;\n }\n\n var min = arr[0];\n var minIndex = 0;\n\n for (var i = 1; i < arr.length; i++) {\n if (arr[i] < min) {\n minIndex = i;\n min = arr[i];\n }\n }\n // When run, will return the index of the lowest number\n return minIndex;\n}", "title": "" }, { "docid": "1a1e582ade13f26990f61f34ff95c7f4", "score": "0.6357477", "text": "function getFirstFilled(arr) {\r\n\tfor (x = 0; x < arr.length; x++) {\r\n\t\tif (arr[x]) {\r\n\t\t\treturn x;\r\n\t\t}\r\n\t}\r\n\treturn -1;\r\n}", "title": "" }, { "docid": "243dc48f0a5ac93b914bb283da054658", "score": "0.6357233", "text": "function getBitIndex(bitIndex) {\n return bitIndex % 8;\n}", "title": "" }, { "docid": "81a81da636307446896cb8b971a31f08", "score": "0.6353289", "text": "function binSearch(arr, value) {\n /* jshint bitwise: false */\n var imin = 0;\n var imax = arr.length - 1;\n while (imin <= imax) {\n var imid = imin + imax >>> 1;\n var val = arr[imid];\n if (val === value) {\n return imid;\n } else if (val < value) {\n imin = imid + 1;\n } else {\n imax = imid - 1;\n }\n }\n // Not found: return -1-insertion point\n return -imin - 1;\n}", "title": "" }, { "docid": "f173ba67871f45287d7c508bccdb076f", "score": "0.6273574", "text": "function indexOfMin(arr) {\n if (arr.length === 0) {\n return -1;\n }\n var min = arr[0];\n var minIndex = 0;\n for (var i = 1; i < arr.length; i++) {\n if (arr[i] < min) {\n minIndex = i;\n min = arr[i];\n }\n }\n return minIndex;\n}", "title": "" }, { "docid": "37a9dc96e3b47db973ffcc71182d386b", "score": "0.6251738", "text": "function closestIntSameBitCount(x) {\n const NUM_UNSIGNED_BITS = 32;\n\n for (var i = 0; i < NUM_UNSIGNED_BITS; i++) {\n if (((x >> i) & 1) != ((x >> (i + 1)) & 1)) {\n x = x ^ ((1 << i) | (1 << (i + 1)));\n return x;\n }\n }\n\n throw 'All bits are 0 or 1';\n}", "title": "" }, { "docid": "b4e5ee683ad144685e1d54b34ecf3323", "score": "0.6240361", "text": "function getFirstIDX(type)\n{\n\tvar idxs = getIDXs(type);\n\tif (idxs.length) { return idxs[0]; }\n\telse { return 0; }\n}", "title": "" }, { "docid": "3044814d2c91339637b316873c817093", "score": "0.6220901", "text": "function lowestIndex(haystack, needle, compare) {\n var low = 0, \n high = haystack.length;\n while (low < high) {\n var mid = Math.floor((low + high) / 2), \n c = compare(haystack[mid], needle);\n if (c < 0) {\n low = mid + 1;} else \n {\n high = mid;}}\n\n\n return low;}", "title": "" }, { "docid": "f3c279da82ae0cb6bd1bcb1d6c6d8e65", "score": "0.6164078", "text": "function sortedBitSearch (arr) {\n \n var firstOne;\n \n function findingFirstOneRecursion (subArray){\n \n const mainRootIndex = (subArray.length /2)\n \n console.log(\"Main Root Index\", mainRootIndex) \n \n while (!firstOne){\n (subArray[mainRootIndex] === 1 ?\n \n arr[mainRootIndex - 1] === 0 ? \n firstOne = arr[mainRootIndex] : findingFirstOneRecursion(subArray.slice(0, mainRootIndex))\n \n :subArray[mainRootIndex] === 0?\n \n arr[mainRootIndex + 1] === 1 ? \n firstOne = arr[mainRootIndex + 1] : findingFirstOneRecursion(subArray.slice(mainRootIndex))\n \n : firstOne = `Error - Current Root: ${mainRootIndex}, Current Array: ${subArray}`\n )\n }\n \n }\n \n findingFirstOneRecursion(arr)\n console.log(\"First One: \",firstOne)\n console.log(\"Count of Ones: \", arr.length - firstOne)\n return arr.length - firstOne\n }", "title": "" }, { "docid": "71a85a22a5ee9602746ba713dd98eb0f", "score": "0.6124679", "text": "function indexOfMin(arr) {\n if (arr.length === 0){\n return -1;\n }\n\n var min = arr[0];\n var minIndex = 0;\n\n for(var i=0; i<arr.length; i++){\n if(arr[i] < min){\n minIndex = i;\n min = arr[i];\n }\n }\n \n return minIndex;\n}", "title": "" }, { "docid": "8260260ad12036df2ccb3b40e040c4b2", "score": "0.6113331", "text": "function startidx(arr, min) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] > min) {\n return i;\n }\n }\n return Number.MAX_VALUE;\n}", "title": "" }, { "docid": "7c900d863ce4c578c7cbe435e1c20b81", "score": "0.6105813", "text": "function magicIndex(array) {\n let low = 0, high = array.length - 1;\n \n while (low < high) {\n let mid = Math.floor((high + low) / 2);\n if (array[mid] === mid){\n return mid;\n } else if (array[mid] < mid) {\n low = mid;\n } else {\n high = mid;\n }\n }\n\n return -1;\n}", "title": "" }, { "docid": "f3be1f5ebe3a81d472730b56d3c33705", "score": "0.6087012", "text": "function minidx(arr) {\n if (!arr.length) {\n return;\n }\n let min = Number.MAX_VALUE;\n let minidx = -1;\n for (let idx = 0; idx < arr.length; idx++) {\n if (!isNaN(arr[idx]) && arr[idx] < min) {\n min = arr[idx];\n minidx = idx;\n }\n }\n return minidx;\n}", "title": "" }, { "docid": "47a71a9456ea1a6343df350e4e107837", "score": "0.6083222", "text": "function IsBit1(num , indexBit) {\n num = num >> indexBit ;\n return (num & 1) ;\n }", "title": "" }, { "docid": "1d6f22b8d6620b346332a8be9692c9fd", "score": "0.6072343", "text": "function getLowerMask(bits) {\n return (1 << bits) - 1;\n}", "title": "" }, { "docid": "04a2278b34af7f3150d42e06e0c1039d", "score": "0.6070804", "text": "function getIndex(bitNumber) {\n return bitNumber >>> 4;\n}", "title": "" }, { "docid": "bae08378b71f03d951770720fe772ccc", "score": "0.6062726", "text": "getLeftIndex(index) {\n\t\treturn 2 * index + 1;\n\t}", "title": "" }, { "docid": "1af8fea71933c93df7b0a3d6031bd5d9", "score": "0.60506517", "text": "function getLowerMask(bits) {\n return (1 << bits) - 1;\n}", "title": "" }, { "docid": "1af8fea71933c93df7b0a3d6031bd5d9", "score": "0.60506517", "text": "function getLowerMask(bits) {\n return (1 << bits) - 1;\n}", "title": "" }, { "docid": "a1379324e0d46a939ac3b34187ef56c8", "score": "0.6027837", "text": "function bitonic(arr) {\n let largestNum = 0;\n let largestNumIndex = 0;\n\n for (let i = 0; i < arr.length; i++){\n if (arr[i] > largestNum) {\n largestNum = arr[i];\n largestNumIndex = i;\n } else {\n break;\n }\n }\n\n return largestNumIndex;\n}", "title": "" }, { "docid": "edc62eb79b3e49df5d827922bd3057d2", "score": "0.6024681", "text": "function minInArray(a)\n\t{\n\t\tvar minIndex=0;\n\t\tfor(var i=0; i < a.length; i++)\n\t\t{\n\t\t\tif(a[i] < a[minIndex])\n\t\t\t\tminIndex=i;\n\t\t}\n\t\t\n\t\treturn minIndex;\n\t}", "title": "" }, { "docid": "f44d9a8520ea96b59e0e89462af60fa8", "score": "0.6000588", "text": "function getbit1(b) {\n let cnt = 0;\n while(b) {\n b &= (b-1);\n cnt++;\n }\n return cnt;\n}", "title": "" }, { "docid": "344bc8fe3dac4dd4a42e4aed9009d5da", "score": "0.59765846", "text": "function bigFirst(val) {\n return -val;\n }", "title": "" }, { "docid": "88d053833a1557ae50c4861e77cc2f6c", "score": "0.59462523", "text": "function tinf_getbit(d){/* check if tag is empty */if(!d.bitcount--){/* load next tag */d.tag=d.source[d.sourceIndex++];d.bitcount=7;}/* shift bit out of tag */var bit=d.tag&1;d.tag>>>=1;return bit;}", "title": "" }, { "docid": "88d053833a1557ae50c4861e77cc2f6c", "score": "0.59462523", "text": "function tinf_getbit(d){/* check if tag is empty */if(!d.bitcount--){/* load next tag */d.tag=d.source[d.sourceIndex++];d.bitcount=7;}/* shift bit out of tag */var bit=d.tag&1;d.tag>>>=1;return bit;}", "title": "" }, { "docid": "66be4b3c5efacf4e9ca375ab82b625db", "score": "0.59367317", "text": "function findLowerBound(target, array) {\r\n let start = 0;\r\n let length = array.length;\r\n while (length > 0) {\r\n // tslint:disable-next-line:no-bitwise\r\n const half = length >> 1;\r\n const middle = start + half;\r\n if (array[middle] <= target) {\r\n length = length - 1 - half;\r\n start = middle + 1;\r\n }\r\n else {\r\n length = half;\r\n }\r\n }\r\n return start - 1;\r\n}", "title": "" }, { "docid": "4132fe16e34bfe0ece415656f1155ad4", "score": "0.5929675", "text": "function tinf_getbit(d) {\n /* check if tag is empty */\n if (!d.bitcount--) {\n /* load next tag */\n d.tag = d.source[d.sourceIndex++];\n d.bitcount = 7;\n }\n\n /* shift bit out of tag */\n var bit = d.tag & 1;\n d.tag >>>= 1;\n\n return bit;\n }", "title": "" } ]
430533df8296284993ae54cd5b8a4f2f
Handle authentication using Firebase and GitHub
[ { "docid": "2025796968152fe0af324079c9f4f9b4", "score": "0.67085266", "text": "function handleAuth(callback) {\n\twindow.addEventListener('DOMContentLoaded', () => {\n\n\t\t// Initialize the FirebaseUI Widget using Firebase.\n\t\tvar ui = new firebaseui.auth.AuthUI(firebase.auth());\n\n\t\tfunction handleSignedInUser(user) {\n\n\t\t\t// Display page content\n\t\t\t$('title').text('IHS Artists Console');\n\t\t\t$('#auth').css('display', 'none');\n\t\t\t$('#console').css('display', 'block');\n\n\t\t\tcallback(user.uid);\n\t\t}\n\n\t\tfunction handleSignedOutUser() {\n\n\t\t\t// Display Sign In UI\n\t\t\t$('title').text('Sign In | IHS Artists Console');\n\t\t\t$('#auth').css('display', 'block');\n\t\t\t$('#console').css('display', 'none');\n\n\t\t\tui.start('#auth-ui', {\n\t\t\t\tcallbacks: {\n\t\t\t\t\tsignInSuccessWithAuthResult: function (authResult) {\n\t\t\t\t\t\t// Save GitHub access token\n\t\t\t\t\t\tfirebase.database().ref('users/' + authResult.user.uid + '/auth/username').set(authResult.additionalUserInfo.username);\n\t\t\t\t\t\tfirebase.database().ref('users/' + authResult.user.uid + '/auth/token').set(authResult.credential.accessToken);\n\t\t\t\t\t\t// Do not redirect.\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t},\n\t\t\t\t\tuiShown: function () {\n\t\t\t\t\t\t$('#auth-loader').css('display', 'none');\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsignInFlow: 'redirect',\n\t\t\t\tsignInOptions: [{\n\t\t\t\t\tprovider: firebase.auth.GithubAuthProvider.PROVIDER_ID,\n\t\t\t\t\tscopes: ['repo']\n\t\t\t\t}]\n\t\t\t});\n\t\t}\n\n\t\tfirebase.auth().onAuthStateChanged(function (user) {\n\t\t\tuser ? handleSignedInUser(user) : handleSignedOutUser();\n\t\t});\n\n\t\t$('#sign-out').click(function () {\n\t\t\tfirebase.auth().signOut();\n\t\t});\n\t});\n}", "title": "" } ]
[ { "docid": "a19975e0ea9a3489a910652ef5c428b9", "score": "0.81193686", "text": "githubLogin(success, error) {\n // Create an instance of the GitHub provider object\n const provider = new firebase.auth.GithubAuthProvider();\n\n // Grant read/write access to profile info\n provider.addScope('user');\n\n // Sign in with redirect\n firebase.auth().signInWithRedirect(provider);\n }", "title": "" }, { "docid": "fe65ab7f25fa929873097abab1613cf1", "score": "0.7819708", "text": "handleGithubAuth() {\n\t\tvar githubProvider = new firebase.auth.GithubAuthProvider();\n\n\t\treturn firebase.auth().signInWithPopup(githubProvider)\n\t\t\t.then(response => {\n\t\t\t\tthis.props.history.push('/chat');\n\t\t\t\treturn response;\n\t\t\t})\n\t\t\t.catch(e => this.handleError(e))\n\t}", "title": "" }, { "docid": "e793ac9581713980e5b054bdbafd2274", "score": "0.77500516", "text": "function handleSignInWithGitHub() {\n auth.signInWithGithub();\n }", "title": "" }, { "docid": "c3722bce894909e59f314f22f71a6a11", "score": "0.75143397", "text": "function loginWithGitHub() {\n console.log(\"Github login button clicked\")\n var provider = new firebase.auth.GithubAuthProvider();\n\n firebase.auth().signInWithPopup(provider).then(function(result) {\n window.location(\"homepage.html\") // make second page put in here\n // This gives you a GitHub Access Token. You can use it to access the GitHub API.\n var token = result.credential.accessToken;\n // The signed-in user info.\n var user = result.user;\n console.log(user)\n // ...\n }).catch(function(error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n console.log(error.message)\n // The email of the user's account used.\n var email = error.email;\n // The firebase.auth.AuthCredential type that was used.\n var credential = error.credential;\n // ...\n });\n}", "title": "" }, { "docid": "f45eb819ed584216a537f365941b3511", "score": "0.7381911", "text": "function loginGithub(){\n var providerGithub = new firebase.auth.GithubAuthProvider();\n firebase.auth().useDeviceLanguage();\n firebase.auth().signInWithPopup(providerGithub).then(function(result) {\n if(result.credential){\n var token = result.credential.accessToken;\n var secret = result.credential.secret;\n // The signed-in user info.\n var user = result.user;\n var userName = user.providerData[0].displayName;\n var avatar = user.photoURL;\n localStorage.setItem('nombre',userName);\n localStorage.setItem('avatar',avatar);\n window.location.href = '../index.html';\n console.log('Estas conectado con GitHub');\n }\n\n }).catch(function(error) {\n console.log('Algo ha pasado: '+error.message);\n });\n}", "title": "" }, { "docid": "0d8f1dca2770a9bedd5e1b96364e8148", "score": "0.73813266", "text": "function initAuth() {\n /*\n var ui = new firebaseui.auth.AuthUI(firebase.auth());\n ui.start('#firebaseui-auth-container', {\n signInOptions: [\n // List of OAuth providers supported.\n firebase.auth.GoogleAuthProvider.PROVIDER_ID,\n firebase.auth.GithubAuthProvider.PROVIDER_ID\n ],\n callbacks: {\n signInSuccessWithAuthResult: function(authResult, redirectUrl) {\n // User successfully signed in.\n // Return type determines whether we continue the redirect automatically\n // or whether we leave that to developer to handle.\n return false;\n },\n },\n // Other config options...\n });\n */\n // Result from Redirect auth flow.\n // [START getidptoken]\n firebase.auth().getRedirectResult().then(function (result) {\n if (result.credential) {\n // This gives you a Google Access Token. You can use it to access the Google API.\n var token = result.credential.accessToken;\n // [START_EXCLUDE]\n //document.getElementById('oauthtoken').textContent = token;\n } else {\n //document.getElementById('oauthtoken').textContent = 'null';\n // [END_EXCLUDE]\n }\n // The signed-in user info.\n var user = result.user;\n\n // If new user, add them to the database\n if (result.additionalUserInfo && result.additionalUserInfo.isNewUser) {\n /*var username = prompt(\"Please enter your username:\", \"Username\");\n user.updateProfile({\n username: username\n })*/\n createUser(user);\n }\n }).catch(function (error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n // The email of the user's account used.\n var email = error.email;\n // The firebase.auth.AuthCredential type that was used.\n var credential = error.credential;\n // [START_EXCLUDE]\n if (errorCode === 'auth/account-exists-with-different-credential') {\n //alert('You have already signed up with a different auth provider for that email.');\n // If you are using multiple auth providers on your app you should handle linking\n // the user's accounts here.\n alert(\"You have already registered with Google. Please sign in with Google to link your GitHub account.\")\n } else {\n console.error(error);\n }\n // [END_EXCLUDE]\n });\n // [END getidptoken]\n // Listening for auth state changes.\n // [START authstatelistener]\n firebase.auth().onAuthStateChanged(function (user) {\n if (user) {\n // User is signed in.\n var displayName = user.displayName;\n var email = user.email;\n var emailVerified = user.emailVerified;\n var photoURL = user.photoURL;\n var isAnonymous = user.isAnonymous;\n var uid = user.uid;\n //console.log(uid);\n //firebase.auth().currentUser.getIdToken(true).then((idToken) => console.log(idToken));\n var providerData = user.providerData;\n // [START_EXCLUDE]\n $('#navbar-user').text(`Logged in as: ${displayName}`).show();\n //$('#sign-in-status').text('Signed in');\n $('#sign-in-google').text('Sign out');\n if (user.providerData.length === 1 && user.providerData[0].providerId === \"google.com\") {\n $(\"#sign-in-github\").text(\"Link GitHub account\");\n } else {\n $('#sign-in-github').hide();\n }\n //$('#account-details').text(JSON.stringify(user, null, ' '));\n // [END_EXCLUDE]\n } else {\n // User is signed out.\n // [START_EXCLUDE]\n $('#navbar-user').empty().hide();\n //$('#sign-in-status').text('Signed out');\n $('#sign-in-google').text('Sign in with Google');\n $('#sign-in-github').text('Sign in with GitHub');\n $('#sign-in-github').show();\n //$('#account-details').text('null');\n //$('#oauthtoken').text('null');\n // [END_EXCLUDE]\n }\n // [START_EXCLUDE]\n $('#sign-in-google').prop('disabled', false);\n $('#sign-in-github').prop('disabled', false);\n // [END_EXCLUDE]\n });\n // [END authstatelistener]\n $('#sign-in-google').on('click', toggleSignInGoogle);\n $('#sign-in-github').on('click', toggleSignInGithub);\n\n}", "title": "" }, { "docid": "008f388616a2dec4df1f33cbcc3c5fea", "score": "0.7210881", "text": "function login() {\n var postsRef = new Firebase(\"https://scorching-heat-6301.firebaseio.com/\");\n postsRef.authWithOAuthPopup(\"github\", function(error, authData) {\n showHomePage();\n var statusbar = document.querySelector(\"#words\");\n statusbar.innerHTML = authData.github.username;\n document.querySelector(\".hideafterlogin\").style.display = \"none\";\n document.querySelector(\".hidetillogin\").style.display = \"inline\";\n }, {\n remember: \"sessionOnly\",\n scope: \"user,gist\"\n });\n}", "title": "" }, { "docid": "ade9ec45897f164d93d436f3043baed5", "score": "0.6998282", "text": "getGithubToken(success, error) {\n firebase\n .auth()\n .getRedirectResult()\n .then(success)\n .catch(error);\n }", "title": "" }, { "docid": "838bd88d609e34dbfcc5a584a23d01e9", "score": "0.6574055", "text": "authenticationAccount() {\n\n\t\tlet email = document.getElementById('email').value;\n\t\tlet password = document.getElementById('password').value;\n\n\t\tfirebase.auth().signInWithEmailAndPassword(email, password)\n\t\t\t.then((userCredential) => {\n\t\t\t\t// Signed in\n\t\t\t\tuser.userCredential = userCredential.user.uid;\n\t\t\t\tdataForm.resetFields(dataForm.form);\n\n\t\t\t\tif (window.origin.includes('github.io')) {\n\t\t\t\t\tlocation.href = `${window.origin}/Taskify/pages/user.html`;\n\t\t\t\t} else {\n\t\t\t\t\tlocation.href = `../pages/user.html`;\n\t\t\t\t}\n\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\talert('User does not exist');\n\t\t\t\tdataForm.resetFields(dataForm.form);\n\t\t\t\tvar errorCode = error.code;\n\t\t\t\tvar errorMessage = error.message;\n\t\t\t});\n\n\t}", "title": "" }, { "docid": "38097876df8fe9d90bd7cd448ffd57ea", "score": "0.6573169", "text": "login() {\n\n const email = this.refs.email.value;\n const pass = this.refs.pass.value;\n const auth = firebase.auth();\n const signin = auth.signInWithEmailAndPassword(email, pass).then(() => {\n browserHistory.push(\"/Donor\")\n console.log('yahoo again')\n }\n );\n }", "title": "" }, { "docid": "e6298878c8dffd6e85f2eef8493aed56", "score": "0.6507044", "text": "login() {\r\n const auth = JSON.parse(readCookie('devreduceauth'));\r\n if (auth) {\r\n this.props.setAuth(auth);\r\n } else {\r\n window.open(`https://github.com/login/oauth/authorize?redirect_uri=https://devreduce.com&client_id=${this.clientId}`, '_self');\r\n }\r\n }", "title": "" }, { "docid": "9e71cede0d73a9bcb426d350e8f77bb7", "score": "0.6487785", "text": "function getAuth( res ) {\n url = 'https://' + path.join( 'api.github.com', 'authorizations' );\n icarus.log.debug( 'Attempting to authenticate with github '.info + 'using basic auth'.em );\n request.post( createAuthRequest( res ), onAuth );\n }", "title": "" }, { "docid": "cbe36962946a72e33bff8dd45193eb30", "score": "0.64710575", "text": "function handleGithubLogging() {\n if(is3rdPartyCookieEnabled) \n {\n auth.signInWithRedirect(new githubAuthProvider());\n } \n else \n {\n requestEnableCookies('Github')\n }\n }", "title": "" }, { "docid": "add600fec6f66414baa89003f948f539", "score": "0.64245987", "text": "function fireAuth(){\n switch (this.id) {\n case 'facebook-button':\n provider = new firebase.auth.FacebookAuthProvider();\n break;\n case 'github-button':\n provider = new firebase.auth.GithubAuthProvider();\n break;\n case 'google-button':\n provider = new firebase.auth.GoogleAuthProvider();\n break;\n case 'twitter-button':\n provider = new firebase.auth.TwitterAuthProvider();\n break;\n } \n authAction();\n }", "title": "" }, { "docid": "c9c78b0aeb9bdfb55f05a85dd092e1df", "score": "0.6382247", "text": "login(args) {\n return (dispatch) => {\n var fb_Main = new Firebase(Config.firebaseUrl());\n fb_Main.authWithOAuthPopup('google', (err, user) => {\n if (err) {\n // something not great happened\n return;\n }\n \n // Call the callback with our user. So, Alt will have a 'login' event,\n // that when happens, passes a user object. Pretty cool.\n dispatch(user);\n });\n }\n }", "title": "" }, { "docid": "d94240300fd20a36799dcf9b6fd6328d", "score": "0.63514054", "text": "function authenticate() {\n return new Promise((resolve, reject) => {\n new Firebase(process.env.FIREBASE_URL).authWithCustomToken(process.env.FIREBASE_SECRET, (error, auth) => {\n if (error) {\n reject(error)\n } else {\n resolve();\n }\n });\n });\n}", "title": "" }, { "docid": "0c29eafb825f3a1fe0032cdea6c1e7a3", "score": "0.6335631", "text": "function fireAuth() {\n switch (this.id) {\n case 'facebook-button':\n provider = new firebase.auth.FacebookAuthProvider();\n break;\n case 'github-button':\n provider = new firebase.auth.GithubAuthProvider();\n break;\n case 'google-button':\n provider = new firebase.auth.GoogleAuthProvider();\n break;\n case 'twitter-button':\n provider = new firebase.auth.TwitterAuthProvider();\n break;\n }\n authAction();\n}", "title": "" }, { "docid": "614c3ffe5b282c36ef882f8418e13e42", "score": "0.63149744", "text": "function githubLogin() {\n var provider = 'github';\n\n OAuth.popup(provider)\n .done(function (result) {\n result.me()\n .done(function (response) {\n // capture the global vars\n alias = response.alias;\n avatar = response.avatar;\n email = response.email;\n // set the cookie\n document.cookie = \"user=\" + alias + \"|\" + avatar + \"|\" + email + \";path='/'\";\n // show the opening scene\n openingScene();\n })\n .fail(function (err) {\n console.log(\"Error logging in to GitHub: \" + err)\n });\n })\n .fail(function (err) {\n console.log(\"Error connecting to OAuth.io: \" + err)\n });\n}", "title": "" }, { "docid": "468540367c5fa4d8ce031faa8e949fd6", "score": "0.628653", "text": "authenticateGitHub() {\n\n octokit.authenticate({\n type: 'token',\n token: process.env.REACT_APP_API_KEY\n })\n }", "title": "" }, { "docid": "0d73107089c36212489cb238f64e4cdd", "score": "0.62807024", "text": "login(provider) {\n return this.ref.authWithOAuthPopup(provider)\n .then((authData) => {\n return authData;\n })\n .catch((err) => err);\n }", "title": "" }, { "docid": "9a70b9516c36539c168b97da01f93a7c", "score": "0.6272829", "text": "login(event) {\n event.preventDefault();\n firebase.auth().signInWithEmailAndPassword(this.state.email, this.state.password).then(()=>{\n alert(\"You have successfully logged in! Click on the arrow below to get started.\");\n });\n \n\n }", "title": "" }, { "docid": "60dcd8d3e78eaf4122add75b07b3a46f", "score": "0.62611645", "text": "authenticate(secret, onAuthenticationSuccessful) {\n const progressDialog = this.authenticatorDialogs.get('progress');\n progressDialog.open();\n const onSuccess = req => {\n progressDialog.close();\n this._saveCredentials(JSON.parse(req.response), secret);\n if (onAuthenticationSuccessful) {\n onAuthenticationSuccessful();\n }\n };\n const onError = req => {\n progressDialog.close();\n this.authenticatorDialogs.setError(req);\n this.authenticatorDialogs.get('error').open();\n this._forgetCredentials();\n };\n http.get('https://api.github.com/user', secret, onSuccess, onError);\n }", "title": "" }, { "docid": "b6fb1504bb1f2a49b7194a3829ae1692", "score": "0.6238824", "text": "function initializeFirebaseAuth() {}", "title": "" }, { "docid": "041881a0826de57cd77c57f7adf4dcec", "score": "0.6231389", "text": "function performLogin() {\n firebase.auth().signInWithRedirect(provider).then(function(result) {\n console.log(result.user);\n }).catch(function(error) {\n console.error(error);\n });\n}", "title": "" }, { "docid": "6e51b9b4452047ca3267efb015bea433", "score": "0.6183301", "text": "function signIn() {\n firebase.auth().signInWithPopup(provider).then(function (result) {\n var token = result.credential.accessToken;\n user = result.user;\n showWelcome();\n\n }).catch(function (error) {\n var errorCode = error.code;\n var errorMessage = error.message;\n var email = error.email;\n var credential = error.credential;\n });\n}", "title": "" }, { "docid": "48b9ec8a967853ff81666dbbccb01fc7", "score": "0.61440367", "text": "function signIn(choice){\n var provider;\n\n switch (choice) {\n case \"google\":\n provider = new firebase.auth.GoogleAuthProvider();\n break;\n case \"facebook\":\n provider = new firebase.auth.FacebookAuthProvider();\n break;\n case \"github\":\n provider = new firebase.auth.GithubAuthProvider();\n break;\n default:\n break;\n }\n \n localStorage.setItem(\"auth\",\"waiting\");\n firebase.auth().signInWithRedirect(provider);\n\n}", "title": "" }, { "docid": "31fe85690c7aa0cb6484f4268ee7dd4d", "score": "0.61357707", "text": "login() {\n this.auth0.authorize();\n }", "title": "" }, { "docid": "31fe85690c7aa0cb6484f4268ee7dd4d", "score": "0.61357707", "text": "login() {\n this.auth0.authorize();\n }", "title": "" }, { "docid": "641d2a62ef3d42783bebc5baabcaf6f8", "score": "0.61012346", "text": "function facebookLogin() {\n var facebookProvider = new firebase.auth.FacebookAuthProvider();\n console.log(\"GOT HERE\");\n userLogin(facebookProvider);\n\n}", "title": "" }, { "docid": "88419f67f34c52d40c764ea9b21dbc17", "score": "0.60808635", "text": "function authMe (event) {\n event.preventDefault();\n var emailLogin = $('#emailLogin').val(),\n passwordLogin = $('#passwordLogin').val(),\n loginObj = {\n email: emailLogin,\n password: passwordLogin\n };\n fb.authWithPassword(loginObj, function(error, authData) {\n if (error) {\n alert('Rejected!! ' + error.code)\n console.log(\"Login Failed!\", error);\n } else {\n //hide the login\n $('#loginForm').toggle();\n //show the add contact button\n $('#addContact').toggle();\n //show the contact list\n $('.tableHeader').toggle();\n $('#target').toggle();\n\n usersFbUrl = FIREBASE_URL + '/users/' + fb.getAuth().uid + '/data';\n\n //get the data already in firebase\n getData();\n\n console.log(\"Authenticated successfully with payload:\", authData);\n }\n });\n}", "title": "" }, { "docid": "25431f2d859f561bc9947994f588b54e", "score": "0.6061894", "text": "function init() {\n _ = window._;\n ExtensionUtils.loadStyleSheet(module, \"github.css\");\n $('body').append($(LOGIN_DIALOG));\n prefs = PreferencesManager.getPreferenceStorage(PREFERENCES_KEY);\n auth = prefs.getValue(\"auth\") || {};\n \n //setup the menu\n menu = Menus.addMenu(\"GitHub\", \"github\", Menus.AFTER, Menus.AppMenuBar.DEBUG_MENU);\n menu.addMenuItem(GITHUB_LOGIN);\n menu.addMenuItem(GITHUB_LOGOUT);\n menu.addMenuDivider();\n menu.addMenuItem(GITHUB_GIST_DOCUMENT);\n menu.addMenuItem(GITHUB_GIST_SELECTION);\n menu.addMenuItem(GITHUB_GIST_IMPORT);\n //setup the context menu\n var c_menu = Menus.getContextMenu(Menus.ContextMenuIds.EDITOR_MENU);\n c_menu.addMenuItem(GITHUB_GIST_SELECTION);\n c_menu.addMenuItem(GITHUB_GIST_DOCUMENT);\n \n if (auth.hasOwnProperty(\"scopes\")) {\n //make sure this auth has the right permissions, if not, we need to modify the authorization\n if (auth.scopes.length === REQUESTED_SCOPES.length && _.intersection(auth.scopes, REQUESTED_SCOPES).length === REQUESTED_SCOPES.length) {\n //TODO: check to make sure this token hasn't been revoked\n ready();\n } else {\n console.log(\"[BRACKETS-GITHUB] Scopes don't match, asking to edit auth\");\n updateAuth();\n }\n }\n }", "title": "" }, { "docid": "696c9d718acc2900ebb578cc8784fcdf", "score": "0.6053447", "text": "tryAuth(){if(this.connected_&&this.authToken_){const token=this.authToken_;const authMethod=isValidFormat(token)?'auth':'gauth';const requestData={cred:token};if(this.authOverride_===null){requestData['noauth']=true;}else if(typeof this.authOverride_==='object'){requestData['authvar']=this.authOverride_;}this.sendRequest(authMethod,requestData,res=>{const status=res[/*status*/'s'];const data=res[/*data*/'d']||'error';if(this.authToken_===token){if(status==='ok'){this.invalidAuthTokenCount_=0;}else{// Triggers reconnect and force refresh for auth token\nthis.onAuthRevoked_(status,data);}}});}}", "title": "" }, { "docid": "2e684addfcad8a508483ad5c2cfb066e", "score": "0.60502607", "text": "signInWithProvider(authProvider) {\n if (!firebase.auth().currentUser) this.signOut();\n\n let provider;\n switch (authProvider) {\n case 'facebook':\n provider = new firebase.auth.FacebookAuthProvider();\n provider.addScope('user_birthday');\n break;\n case 'github':\n provider = new firebase.auth.GithubAuthProvider();\n provider.addScope('repo');\n break;\n case 'google':\n provider = new firebase.auth.GoogleAuthProvider();\n provider.addScope('profile');\n provider.addScope('email');\n break;\n case 'twitter':\n provider = firebase.auth.TwitterAuthProvider();\n provider.addScope('profile');\n provider.addScope('email');\n break;\n default:\n return;\n }\n\n return firebase.auth().signInWithPopup(provider)\n .catch(error => alert(error.message));\n }", "title": "" }, { "docid": "5c68331a21e254df9d7bf3345eb45069", "score": "0.60497504", "text": "handleGoogleAuth() {\n\t\tvar GoogleProvider = new firebase.auth.GoogleAuthProvider();\n\n\t\treturn firebase.auth().signInWithPopup(GoogleProvider)\n\t\t\t.then(response => {\n\t\t\t\tthis.props.history.push('/chat');\n\t\t\t\treturn response;\n\t\t\t})\n\t\t\t.catch(e => this.handleError(e))\n\t}", "title": "" }, { "docid": "0cdddcb9e2f234a6dc72137b2dd090ee", "score": "0.60319036", "text": "function main() {\n firebase.initializeApp(firebaseConstants.FIREBASE_CONFIG);\n firebaseConstants.INITALIZE_SIGN_IN(\n new URL(window.location).searchParams.get('redirect')\n );\n}", "title": "" }, { "docid": "859e4f61a3742413bb7660ccb12b6b4f", "score": "0.60251474", "text": "login(username, password) {\r\n return firebase.auth().signInWithEmailAndPassword(username, password)\r\n }", "title": "" }, { "docid": "b4fbe58a260fe5fb6fc64ba1c40fa2dc", "score": "0.6020546", "text": "function loginviagit() {\n\tpassport.serializeUser(function(user, done) {\n\t\tdone(null, user);\n\t});\n\tpassport.deserializeUser(function(obj, done) {\n\t\tdone(null, obj);\n\t});\n\tpassport.use(new GitHubStrategy({\n\t\tclientID: gitId.CLIENT_ID,\n\t\tclientSecret: gitId.CLIENT_SECRET,\n\t\tcallbackURL: gitId.CALLBACK_URL\n\t}, function(accessToken, refreshToken, profile, done) {\n\t\tlet userInfo = {\n\t\t\tname: profile._json.login,\n\t\t\tuserId: profile.id,\n\t\t\tavatarUrl: profile._json.avatar_url,\n\t\t\tpublicRepos: profile._json.public_repos,\n\t\t\treposUrl: profile._json.repos_url,\n\t\t\tonline: loginconfig.ONLINE\n\t\t}\n\t\t//save login credentials in login collection\n\t\t//function called by login controller\n\t\tloginController.saveLoginCredentials(userInfo, done);\n\t}));\n}", "title": "" }, { "docid": "9b87956146321e446033689b55b9c753", "score": "0.60202926", "text": "function checkAuth(req, res, next) {\n // REMOVED FOR GIT PURPOSES\n}", "title": "" }, { "docid": "ee6fce64519683e324b43e19a285cbe5", "score": "0.6015903", "text": "doesItNeedsAuth(){\n const tokens = config.get(`tokens`)\n if (this._repo.startsWith(`github.com`) && tokens !== null && tokens.github !== undefined)\n return {username: `sailer`, token: tokens.github}\n if (tokens === null) return false\n for (let t in tokens){\n if (this._repo.startsWith(t)) return tokens[t]\n }\n return false\n }", "title": "" }, { "docid": "5ec356f3a6b0fcbaf3a37f3631421f20", "score": "0.60098195", "text": "function loginWithGitHubIfRedirectedByPopup() {\n if (service._isGitHubPopup()) {\n return $window.opener.oAuthCallbackGitHub(service._parseCode(getUrl()), service._parseState(getUrl()));\n }\n }", "title": "" }, { "docid": "87acb1f2944b8ef1815b1594043c9a1a", "score": "0.6006158", "text": "function handleLogIn() {\n\n // get what the user typed\n var email = document.getElementById('email').value;\n var password = document.getElementById('password').value;\n\n // call API function\n firebase.auth().signInWithEmailAndPassword(email, password).catch(function(error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n\n document.getElementById('message-box').innerHTML = errorMessage;\n\n console.log(error);\n });\n}", "title": "" }, { "docid": "6320ef0e2cc26408f1ec475efd0b5d67", "score": "0.59983516", "text": "handleLoginSubmit(event) {\n //console.log(\"login worked\");\n event.preventDefault();\n\n database.ref().push({\n name: this.state.name,\n dateAdded: firebase.database.ServerValue.TIMESTAMP\n });\n\n const promise = auth.signInWithEmailAndPassword(this.state.email, this.state.password);\n promise.then(() => {\n auth.onAuthStateChanged(firebaseUser => {\n if (firebaseUser) {\n console.log(firebaseUser);\n window.location = \"/search\";\n } else {\n console.log(\"not logged in\");\n }\n })\n }\n )\n promise.catch(error => console.log(error.message));\n }", "title": "" }, { "docid": "e73c1f784fa05691382011c11d340283", "score": "0.59876454", "text": "function getClientAuth( res ) {\n url = 'https://' + path.join( 'api.github.com', 'authorizations', 'clients', res.key );\n icarus.log.debug( 'Attempting to authenticate with github '.info + 'using oAuth'.em );\n request.put( createAuthRequest( res ), onAuth );\n }", "title": "" }, { "docid": "f3669bbf6582ae3a07fa1566c874c0dc", "score": "0.59873414", "text": "login(){\n firebase.auth().signInWithEmailAndPassword(this.state.email,\n this.state.password).then((user) => {\n console.log(\"Login user successfully\");\n this.userObject = this.database.ref(user.uid+'/user_data');\n this.listeningDataSourceDB();\n }).catch((err) => {\n alert(err);\n });\n }", "title": "" }, { "docid": "73d57e63e746107358ee33d3314b013b", "score": "0.5970395", "text": "function initAuth() {\n // Initialize Firebase\n var config = {\n apiKey: \"AIzaSyA3qOBZRh0AD_zQzr5vcXS2O9-TjoKrPPc\",\n authDomain: \"bookme-e82d7.firebaseapp.com\",\n databaseURL: \"https://bookme-e82d7.firebaseio.com\",\n projectId: \"bookme-e82d7\",\n storageBucket: \"bookme-e82d7.appspot.com\",\n messagingSenderId: \"597432818735\"\n };\n firebase.initializeApp(config);\n\n // As httpOnly cookies are to be used, do not persist any state client side.\n firebase.auth().setPersistence(firebase.auth.Auth.Persistence.NONE);\n}", "title": "" }, { "docid": "16355e386c48c75455e6f8a0eb765c91", "score": "0.5965837", "text": "async login({ commit }, { email, password }) {\r\n try {\r\n const { data } = await httpf.post('auth', { email, password })\r\n commit('SET_TOKEN', data.token)\r\n commit('SET_USERID', data.user_id)\r\n commit('SET_AUTH', true)\r\n\r\n//localStorage.token = data\r\n } catch (error) {\r\n if (error.response && error.response.status === 401) {\r\n throw new Error('Bad credentials')\r\n }\r\n throw error\r\n }\r\n }", "title": "" }, { "docid": "e5110aee3027553e6f01f81e199b4b73", "score": "0.59652215", "text": "function login_to_firebase() {\n let email = document.getElementById(\"login_email_input\").value;\n let password = document.getElementById(\"login_password_input\").value;\n\n //see https://firebase.google.com/docs/auth/web/password-auth\n firebase.auth().signInWithEmailAndPassword(email, password)\n .catch(\n function login_error(error) {\n alert(error);\n console.log(error);\n }\n );\n // the observer below handles what happens when users sign in our oout\n}", "title": "" }, { "docid": "c1bbcfc3b06bd70fc13ebaf50636c23f", "score": "0.59572536", "text": "authenticate() {\n\n }", "title": "" }, { "docid": "4e40e2421eb735f78bc93b42c92b14d9", "score": "0.5955737", "text": "function handleGmailLogin() {\n if (!firebase.auth().currentUser) {\n var provider = new firebase.auth.GoogleAuthProvider();\n\n firebase.auth().signInWithPopup(provider).then(function (result) {\n // This gives you a Google Access Token. You can use it to access the Google API.\n var token = result.credential.accessToken;\n // The signed-in user info.\n var user = result.user;\n console.log(user);\n // ...\n }).catch(function (error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n // The email of the user's account used.\n var email = error.email;\n // The firebase.auth.AuthCredential type that was used.\n var credential = error.credential;\n // ...\n });\n } else {\n handleSignOut();\n alert(\"Users is already signed out!\")\n }\n}", "title": "" }, { "docid": "eb977b349938d692ab1c347e607bde0d", "score": "0.5921917", "text": "function authenticateUser() {\n return GAuth.login().then(getUserInfoAndToken);\n }", "title": "" }, { "docid": "13350146cea0a9f07f10c860d79ecee3", "score": "0.59174514", "text": "function handleSignIn() {\n var email = document.getElementById('login-form-email').value;\n var password = document.getElementById('login-form-password').value;\n firebase.auth().signInWithEmailAndPassword(email, password).then(function () {\n //only if successfully signed in control flow is here\n window.location.href = 'index.html'\n }).catch(function (error) {\n alert(error.message);\n })\n}", "title": "" }, { "docid": "34fd086deb4958db742b07693472e5a2", "score": "0.5914682", "text": "function authUser() {\n var loginUrl = base_grant_url;\n if (user_continue_url !== \"undefined\") {\n loginUrl += \"?continue_url=\" + user_continue_url;\n }\n console.log(\"Logging in... \", loginUrl);\n // redirect browser to meraki auth URL.\n window.location.href = loginUrl;\n}", "title": "" }, { "docid": "05a1ba34f0b50ab51e88073acd1ad706", "score": "0.5897052", "text": "signIn() {\n const fbProvider = new firebase.auth.GoogleAuthProvider();\n\n firebase.auth().signInWithPopup(fbProvider).then((result) => {\n console.log(\"Signed In\");\n }).catch((error) => {\n console.error(\"Error \" + error.code + \": Could not sign in: \" + error.message);\n });\n }", "title": "" }, { "docid": "f164e6426b87aead1ad4426679e5420b", "score": "0.5893891", "text": "handleFacebookAuth() {\n\t\tvar facebookProvider = new firebase.auth.FacebookAuthProvider();\n\n\t\treturn firebase.auth().signInWithPopup(facebookProvider)\n\t\t\t.then(response => {\n\t\t\t\tthis.props.history.push('/chat');\n\t\t\t\treturn response;\n\t\t\t})\n\t\t\t.catch(e => this.handleError(e))\n\t}", "title": "" }, { "docid": "fbf03f4f94ef2bfd68db42a049bb31f3", "score": "0.58924985", "text": "function logIn(){\n firebase.auth().signInWithPopup(provider).then(function(result) {\n // This gives you a Google Access Token. You can use it to access the Google API.\n var token = result.credential.accessToken;\n // The signed-in user info.\n console.log(result);\n loggedUser = result.user;\n // ...\n }).catch(function(error) {\n console.log(error);\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n // The email of the user's account used.\n var email = error.email;\n // The firebase.auth.AuthCredential type that was used.\n var credential = error.credential;\n });\n}", "title": "" }, { "docid": "c3a3049e7abb41ef424f219afe82879f", "score": "0.58895445", "text": "function LoginFunction(e){\n e.preventDefault(); \n let email = e.currentTarget.loginEmail.value;\n let password = e.currentTarget.loginPassword.value;\n\n firebase\n .auth()\n .signInWithEmailAndPassword(email,password)\n .then(function(response){\n console.log(\"LOGIN RESPONSE\", response); \n setLoggedIn(true); \n })\n .catch(function(error){\n console.log(\"LOGIN ERROR\", error)\n });\n }", "title": "" }, { "docid": "76d5b44362fd92d9a29e51508961b2ea", "score": "0.58746076", "text": "onSignIn() {\n firebase.auth().signInWithEmailAndPassword(this.state.email, this.state.password)\n .catch(err => {\n this.setState({ error: err.message })\n });\n }", "title": "" }, { "docid": "44f9317f6af615618a341a0746b7bcdf", "score": "0.58695304", "text": "function userLogin(provider) {\n\n firebase.auth().signInWithPopup(provider).then(function(result) {\n // This gives you a Google Access Token. You can use it to access the Google API.\n var token = result.credential.accessToken;\n // The signed-in user info.\n var user = result.user;\n console.log(token);\n console.log(user);\n $(location).attr('href', 'index.html');\n // ...\n }).catch(function(error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n // The email of the user's account used.\n var email = error.email;\n // The firebase.auth.AuthCredential type that was used.\n var credential = error.credential;\n // ...\n });\n}", "title": "" }, { "docid": "6d98111ef02070b2210de744802128cf", "score": "0.5863497", "text": "constructor (options, logger = console) { //}, github) {\n if(!options.auth) {\n throw new Error('Incorrect authorization options');\n }\n\n this.__auth = {\n token: options.auth.token,\n username: options.auth.username,\n password: options.auth.password\n };\n\n axios.defaults.headers.common['Accept'] = 'application/vnd.github.v3+json';\n\n this.__authenticate(this.__auth);\n this.__http = axios.create();\n this.__apiBase = 'https://api.github.com';\n\n logger = logger;\n }", "title": "" }, { "docid": "1ebd48d47b627e5b89e7efe7bbff3d8b", "score": "0.5862666", "text": "function validLogin(user, token) {\r\n var url = 'https://'+ GITHUB_USER + ':' + GITHUB_TOKEN + '@api.github.com/';\r\n \r\n return new Promise((resolve, reject) => {\r\n request.get(url, OPTIONS, (error, response) => {\r\n if (error || response.statusCode !== 200 ){\r\n reject();\r\n } else {\r\n resolve();\r\n }\r\n });\r\n });\r\n}", "title": "" }, { "docid": "f023191add95fc69580c2d7bdcaba32f", "score": "0.5844745", "text": "function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { return next(); }\n res.redirect('/auth/github')\n}", "title": "" }, { "docid": "decd1f894d941372690ad319c2c93db4", "score": "0.58432245", "text": "login(email,password,callback=()=>{}) {\n firebase.auth().signInWithEmailAndPassword(email,password)\n .then(() => {\n callback()\n })\n .catch(error => {\n callback(error.message)\n })\n }", "title": "" }, { "docid": "5d5262277796116b9899f01aaa94c22e", "score": "0.5840143", "text": "handleAuthClick() {\n if (this.gapi) {\n this.gapi.auth2.getAuthInstance().signIn();\n }\n else {\n console.log(\"Error: this.gapi not loaded\");\n }\n }", "title": "" }, { "docid": "049f5d54c97daa6b1e201c896536f7ed", "score": "0.5840058", "text": "function loginTwitter(){\n var providerTwitter = new firebase.auth.TwitterAuthProvider();\n firebase.auth().useDeviceLanguage();\n firebase.auth().signInWithPopup(providerTwitter).then(function(result) {\n if(result.credential){\n var token = result.credential.accessToken;\n var secret = result.credential.secret;\n // The signed-in user info.\n var user = result.user;\n var userName = user.displayName;\n var avatar = user.photoURL;\n localStorage.setItem('nombre',userName);\n localStorage.setItem('avatar',avatar);\n window.location.href = '../index.html';\n console.log('Estas conectado con Twitter');\n }\n\n }).catch(function(error) {\n console.log('Algo ha pasado: '+error.message);\n });\n}", "title": "" }, { "docid": "aa589c5323fd3cb2187044121095e162", "score": "0.5829015", "text": "async signGithub(req, res) {\n const users = await User.get()\n const {code} = req.query\n const newUser = await getDataGit(code)\n const user = users.find( user => user.email === newUser.email ? user : undefined)\n\n if(user === undefined) {\n await User.create(newUser)\n const newUsers = await User.get()\n\n newUsers.find( user => {\n if(user.email === newUser.email) {\n const token = gererateToken(user.id)\n return res.redirect(`/authorized?token=${token}`)\n }\n })\n\n }else {\n const token = gererateToken(user.id)\n return res.redirect(`/authorized?token=${token}`)\n }\n }", "title": "" }, { "docid": "b2fdc0b58eb18163f6ce9f3fc47497b1", "score": "0.58233714", "text": "async loginGoogle(idToken, firebaseToken) {\n if (!idToken || !firebaseToken) {\n return new Response(null, 'Invalid idToken or firebaseToken', 400);\n }\n\n let ticket;\n try {\n // TODO: Verify firebase token\n\n // Verify google token\n ticket = await this.googleAuth.verifyIdToken({\n idToken,\n audience: credentials.clientId,\n });\n\n this.logger.info('Logging in with google: ');\n this.logger.info('Google ticket: ', ticket);\n this.logger.info('Firebase token: ', firebaseToken);\n } catch (e) {\n return new Response(null, 'Invalid idToken or firebaseToken', 400);\n }\n\n const { email } = ticket.payload;\n const user = await this._getUser(email);\n\n // user does not exist\n if (user === null) {\n const userInfo = {\n credentials: {\n email,\n idToken: ticket.payload,\n firebaseToken,\n },\n };\n\n return new Response(userInfo, '', 400);\n }\n\n return new Response(user._id, '', 200);\n }", "title": "" }, { "docid": "d1767061e06945a263727138feba8c54", "score": "0.58209175", "text": "async checkAuth(context) {\n if (JwtService.getToken()) {\n try {\n let res = await ApiService.checkAuth(JwtService.getToken());\n context.commit(\"setUser\", res.data);\n } catch (err) {\n context.commit(\"setError\", err.response);\n }\n } else {\n context.commit(\"logOut\");\n }\n }", "title": "" }, { "docid": "d33e8b9cb74e11f75b992ee946a53a2b", "score": "0.58132744", "text": "function loginGmail(){\n // Authentication Google\n var providerGoogle = new firebase.auth.GoogleAuthProvider();\n //Language Settings\n firebase.auth().useDeviceLanguage();\n // Register Popup\n firebase.auth().signInWithPopup(providerGoogle).then(function(result){\n if (result.credential) {\n // User Data\n var user = result.user;\n var userName = user.displayName;\n var avatar = user.photoURL;\n localStorage.setItem('nombre',userName);\n localStorage.setItem('avatar',avatar);\n window.location.href = '../index.html';\n console.log('Estas conectado con google.');\n\n }\n }).catch(function(error) {\n console.log('Ha ocurrido un error:'+error.message);\n });\n\n}", "title": "" }, { "docid": "44c34ec9baf961cf9385069c8a3b6aaf", "score": "0.580464", "text": "async function handleLogin() {\n\n const authResult = await fetch(AUTH_URL,\n {\n method: 'POST',\n body: JSON.stringify({\n 'username': userInput.current.value,\n 'password': passInput.current.value\n }),\n headers: {\n 'Content-Type': 'application/json'\n }\n });\n const authObj = await authResult.json();\n\n if(typeof authObj.token === 'undefined') {\n dispatch(clearToken());\n setMessage('Error authenticating.');\n } else {\n dispatch(setToken(authObj.token));\n // setMessage(authObj.token); \n dispatch(setView(PROFILE));\n }\n }", "title": "" }, { "docid": "fda6b7c831ec9f5e2b194c168008dc93", "score": "0.5804504", "text": "function LoginButton(){\r\n\tvar username = document.getElementById('InputUserName').value;\r\n\tvar pword = document.getElementById('InputPWord').value;\r\n\t\r\n\tcheck = 0\r\n\tfirebase.auth().signInWithEmailAndPassword(username, pword).catch(function(error) {\r\n\t\tconsole.log(error.code);\r\n\t\tconsole.log(error.message);\r\n\t\talert(error.message)\r\n\t\tcheck = 1\r\n\t}).then( function() {\r\n\t\tif(check == 0){\r\n\t\t\tloadProfile();\r\n\t\t\tnavBarSwitch(1);\r\n\t\t\t$.mobile.navigate( \"#profilepage\" ); //From https://api.jquerymobile.com/jQuery.mobile.navigate/\r\n\t\t\tdownloadFlights();\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "52b86d776d1a00d49321e8df1a5ca544", "score": "0.5795423", "text": "login() {\n this.get('auth').login();\n }", "title": "" }, { "docid": "b3c536b96eef02d22a223c463e256458", "score": "0.5789786", "text": "function onLoginResult(authorizations, username, password) {\n var findAuth;\n \n //An array of authorizations is returned, check to see if it contains a valid authorization for github brackets\n if (_.isArray(authorizations)) {\n findAuth = _.find(authorizations, function (nAuth) { return nAuth.note === \"brackets-github\"; });\n if (findAuth !== undefined) {\n setAuth(findAuth);\n }\n }\n \n //no authorization found\n if (findAuth === undefined) {\n GitHub.addAuthorization(username, password, AUTH_NOTE, REQUESTED_SCOPES, setAuth, onError);\n }\n }", "title": "" }, { "docid": "3b41ea488423320cbddcc99a7b1889e4", "score": "0.57879806", "text": "function signIn() {\n firebase.auth().signInWithRedirect(provider).then(function(result) {\n // This gives you a Google Access Token. You can use it to access the Google API.\n var token = result.credential.accessToken;\n // The signed-in user info.\n var user = result.user;\n console.log(\"signed in\");\n // ...\n }).catch(function(error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n // The email of the user's account used.\n var email = error.email;\n // The firebase.auth.AuthCredential type that was used.\n var credential = error.credential;\n console.log(\"error signing in\");\n console.log(errorCode);\n console.log(errorMessage);\n console.log(email);\n console.log(credential);\n // ...\n });\n}", "title": "" }, { "docid": "adc70e0d388409b4c6d9e3e9b202a911", "score": "0.57818866", "text": "handleAuthentication() {\n this.auth0.parseHash((err, authResult) => {\n if (authResult && authResult.accessToken && authResult.idToken) {\n this.setSession(authResult);\n } else if (err) {\n window.location = '/crm';\n console.log(err);\n }\n });\n }", "title": "" }, { "docid": "ff9d68d983b71d5aaa9867c2a0a0dd1a", "score": "0.57791305", "text": "handleSignIn() {\n \n // Sign in the user \n firebase.auth().signInWithEmailAndPassword(this.state.email, this.state.password)\n .catch((err) => {\n this.setState({ errorMessage: err.message });\n });\n }", "title": "" }, { "docid": "724348de8a0eb139428b12028cdb3b2b", "score": "0.57725835", "text": "async handleGoogleLoginSuccess({ tokenId }) {\n // Receives a tokenid from google if login is successful\n Auth.login(tokenId);\n }", "title": "" }, { "docid": "19999d9a7b7857862205970eb8afe882", "score": "0.57686096", "text": "handleAuth() {\n window.gapi.auth2.getAuthInstance().isSignedIn.listen(this.updateSigninStatus)\n let signedIn = window.gapi.auth2.getAuthInstance().isSignedIn.get();\n console.log(\"handleAuth\", signedIn)\n this.updateSigninStatus(signedIn);\n }", "title": "" }, { "docid": "74e0da2f55ab9a441e3d59cc173cb108", "score": "0.5768225", "text": "login(context){\n context.commit('setAuth', {isAuth: true})\n }", "title": "" }, { "docid": "80d67a860d7cc682a6bc73a238e4346e", "score": "0.57668215", "text": "function signIn(){\n \n var email = document.getElementById(\"email\");\n var password = document.getElementById(\"password\");\n \n firebase\n .auth()\n .signInWithEmailAndPassword(email.value, password.value)\n .then((res) => {\n \n window.location = 'blogPage.html';\n \n }\n ).catch(function(error) {\n var errorCode = error.code;\n var errorMessage = error.message;\n alert(errorMessage);\n \n });\n}", "title": "" }, { "docid": "887aeb220b36cb1cd79325a3fc967d10", "score": "0.5760719", "text": "function signIn() {\n // Nos conectamos a Firebase usando el popup de autenticación de Google como proveedor.\n var provider = new firebase.auth.GoogleAuthProvider();\n firebase.auth().signInWithPopup(provider);\n}", "title": "" }, { "docid": "9a37cfbe0c273c3200842cb2037eaa1b", "score": "0.5759536", "text": "[CHECK_AUTH] (context) {\n if (JwtService.getToken()) {\n ApiService.setHeader()\n ApiService\n .get('user')\n .then(({data}) => {\n context.commit(SET_AUTH, data.user)\n })\n .catch((error) => {\n context.commit(PURGE_AUTH)\n router.push({name: 'login'})\n context.commit(SET_ERROR, {'Session expired': error})\n })\n } else {\n context.commit(PURGE_AUTH)\n }\n }", "title": "" }, { "docid": "4843369a91070dccf668542cd0f8da58", "score": "0.5743193", "text": "handleAuthentication() {\n return new Promise((resolve, reject) => {\n webAuth.parseHash((err, authResult) => {\n if (err) {\n reject(err);\n } else {\n this.localLogin(authResult);\n resolve(authResult.idToken);\n }\n });\n });\n }", "title": "" }, { "docid": "1a0a90b2c41cedcdd9806937c6584d05", "score": "0.5741888", "text": "function init() {\n auth(true, function() {});\n}", "title": "" }, { "docid": "9534f0a87249d3bc450b294cb38c81f5", "score": "0.57407194", "text": "login({ commit, dispatch }, payload) {\n auth.post('login', payload)\n .then(res => {\n commit('loginUser', res.data.user)\n router.push({ name: 'Home' })\n })\n .catch(err => {\n console.log(err);\n console.log('INVALID USERNAME OR PASSWORD')\n })\n }", "title": "" }, { "docid": "95320594b4c417c336c39828b6275477", "score": "0.5735248", "text": "onAuthenticate () {}", "title": "" }, { "docid": "f508ad08685bb0891d713345110e21a2", "score": "0.57317847", "text": "function initFirebaseAuth() {\n // Listen to auth state changes.\n firebase.auth().onAuthStateChanged(() => {\n // Initialize current user object\n currentUser = firebase.auth().currentUser;\n initProgressData().then(() => {\n initChatbot();\n })\n });\n}", "title": "" }, { "docid": "7dab93ee51f22229036b5eb0f66341d0", "score": "0.5725729", "text": "login(customState) {\n webAuth.authorize({\n appState: customState\n });\n }", "title": "" }, { "docid": "2c9e6f6781e84c23d5f2de788063da12", "score": "0.5725307", "text": "open(authorization) {\n let url = config.githubOauthUrl + authorization.authorizationCode;\n return this.ajax.request(url)\n .then(result => this.resolveUser(result.token));\n }", "title": "" }, { "docid": "0cac3181e516659b534dba3b63649bf1", "score": "0.57197005", "text": "function googleLogin() {\n //Step 2: Uncomment or reweite line, in this line we are declaring a new instance of firebase's Google auth method into a variable so we dont have a long line of unreadable code. \n //(Step 2) const provider = new firebase.auth.GoogleAuthProvider();\n //Step 3: Uncomment or reweite line, This line calls the firebase auth function as well as 'signInWithPopup' and passes in the Google auth method we stored in a var.\n //(Step 3) firebase.auth().signInWithPopup(provider)\n\n //Some ES16 goodness here\n .then(result => {\n //Actions after Google login\n methodOfLogin = 'Oauth'; \n new Notification(\"Successfully Logged In\");\n var nameLength = firebase.auth().currentUser.displayName.length - 1; //Why -1? .length counts all the characters inclouding the space between the users first and last name.\n //Super simple response using user name length as a var \n if (nameLength >= 15) {\n luck = 'You will be connected to SB BYOD network for the next 10 ms';\n } else if (nameLength <= 15) {\n luck = `that you read this message on ${new Date()}`;\n }\n //Step 4: firebase.auth().currentUser is an object that give us all the information about the current user\n //One important property is labeled as displayName, witch stores the 'display name' or the name of the user.\n // (step 4) userNameDisplay.innerText = firebase.auth().currentUser.displayName; //Replaces login with users name\n document.getElementById('userPhoto').style.display = 'none'; //Hides genric user icon\n document.getElementById('unrestricted').style.display = 'none'; //Removes unrestricted content \n document.getElementById('restricted').style.display = 'block';//Showes generated unrestricted content \n document.getElementById('userPhoto').style.visibility = 'hidden';\n userPhotoDisplay.style.display = 'block'; //Renders user photo\n\n //Step 4: Another property is defined as 'photoURL' \n //This stores PATH <--(Remember its just the path) to the users profile pic they set on the Google platform \n //These images usually load pretty fast because they are uploaded in Googles CDN's\n //Since this give just the path, we will need to change the SRC attribute of a image in our HTML\n //Finish the line below, we have wired it up to the front end so you dont have to worry about it!\n userPhotoDisplay.src = firebase.auth().currentUser.//Type the ending here ; \n\n //Step 4: It isn't a surprise that you can also retrieve the users Email using Google auth...\n // The property 'email' stores the users ... you guessed it ... the users email\n document.getElementById('userEmail').innerText = firebase.auth().currentUser.email; //Gets and prints user email (got from Google)\n document.getElementById('userFortune').innerText = `Your Name has ${nameLength} letters. Our non-existent tensor flow model predicts ${luck}`; //Prints users prediction using their Name (sample function)\n const user = result.user; \n console.log('The following log will show you the properties of the object (firebase.auth().currentUser)');\n console.log(firebase.auth().currentUser);\n })\n}", "title": "" }, { "docid": "ab3c72a40a78233892d2c21bb185504a", "score": "0.57165545", "text": "function googlelogIn() {\n return firebase.auth().signInWithPopup(provider);\n}", "title": "" }, { "docid": "cd96471521048772565dbe19911b272d", "score": "0.57143694", "text": "function handleLoginClick() {\n if (GoogleAuth.isSignedIn.get()) {\n // User is authorized and has clicked 'Sign out' button.\n GoogleAuth.signOut()\n // for now do nothin\n } else {\n // User is not signed in. Start Google auth flow.\n GoogleAuth.signIn()\n }\n}", "title": "" }, { "docid": "af49385120434d947d712fc044e45629", "score": "0.5708985", "text": "authCallback(query) {\n query = qs.parse(query);\n //console.log(query.code)\n xhr({\n url: 'https://gatekept-localhost.herokuapp.com/authenticate/' + query.code,\n json: true\n }, (err, req, body) => {\n console.log(err, body);\n app.me.token = body.token;\n console.log(body.token);\n //this refers to the xhr request, more library magic\n this.redirectTo('/repos');\n })\n }", "title": "" }, { "docid": "5502c9b67b90c6f81440b356410ab8e4", "score": "0.56947577", "text": "function handleAuthClick(event) {\r\n gapi.auth2.getAuthInstance().signIn();\r\n}", "title": "" }, { "docid": "5502c9b67b90c6f81440b356410ab8e4", "score": "0.56947577", "text": "function handleAuthClick(event) {\r\n gapi.auth2.getAuthInstance().signIn();\r\n}", "title": "" }, { "docid": "c280a3fe36aa54d302e9f0032db28d04", "score": "0.56938964", "text": "userSignup () {\n console.log('login pressed')\n if (this.state.username && this.state.password) {\n fetch('https://app-on-my-feet.herokuapp.com/register')\n }\n }", "title": "" }, { "docid": "4fa08678eebb0a4ab7141c42ea3531c5", "score": "0.5693555", "text": "function doAuth() {\n\t\t\ttryAuth(username, password, gotAuthResult);\n\t\t}", "title": "" }, { "docid": "73c5609d65a1f435444132bf7bbf6fb5", "score": "0.5690528", "text": "async logIn (context, authCode) {\n const tokens = await TokenService.getTokens(authCode)\n if (tokens) {\n // Auth successful, set cookies.\n Vue.$cookies.set('id_token', tokens.id_token)\n }\n const idToken = Vue.$cookies.get('id_token')\n const idInformation = await TokenService.getIdInformation(idToken)\n if (idInformation) {\n // All good, log in.\n context.commit('setUser', idInformation)\n context.commit('logIn')\n // Move to home page\n router.push('/')\n } else {\n // Token invalid\n context.dispatch('logOut')\n }\n }", "title": "" }, { "docid": "4679c06984b7007a83a0bfa979e5f39d", "score": "0.56904596", "text": "function logIn(email, password, history){\n console.log(\"Logging in...\");\n const auth = getAuth();\n signInWithEmailAndPassword(auth, email, password) //issue here not reaching this point\n .then((userCredential) => {\n \n // Signed in \n const user = userCredential.user;\n \n history.push('/flashcard');\n \n })\n .catch((error) => {\n \n const errorCode = error.code;\n const errorMessage = error.message;\n });\n}", "title": "" }, { "docid": "dff7fcfb08aeceed53a575a43c0e9545", "score": "0.5688838", "text": "function thirdPartyLogin(provider) {\n var deferred = $.Deferred();\n console.log(\"thirdPartyLogin\");\n\n ref.authWithOAuthPopup(provider, function (err, user) {\n if (err) {\n deferred.reject(err);\n }\n if (user) {\n deferred.resolve(user);\n }\n });\n\n return deferred.promise();\n }", "title": "" }, { "docid": "412f4bd0396035888acd965296af29a5", "score": "0.56853735", "text": "componentDidMount() {\n // Retrieve and parse credentials from localStorage\n const credentials = JSON.parse(localStorage.getItem(\"credentials\"));\n\n // If does not exist, set logged out state\n if (!credentials) {\n return this.setState({ error: null, user: null });\n }\n\n this.props.firebase\n .signInWithCredential(credentials)\n .then(userCredential => {\n // console.log(userCredential);\n // this.props.firebase.auth.currentUser.getIdToken(true).then(function (idToken) {\n // console.log(idToken);\n // });\n this.handleLogin({\n user: userCredential.user,\n credential: credentials\n });\n })\n .catch(error => {\n this.handleLogout(error);\n });\n }", "title": "" } ]
8e376496a8193261553fbca6327faf16
Gets the "kind" of value. (e.g. "String", "Number", etc)
[ { "docid": "b131ee10573f449e6910b46c94e9c463", "score": "0.7577454", "text": "function kindOf(val) {\n if (val === null) {\n return 'Null';\n } else if (val === UNDEF) {\n return 'Undefined';\n } else {\n return _rKind.exec( _toString.call(val) )[1];\n }\n }", "title": "" } ]
[ { "docid": "1c2bdda465fdf77f2d693cf44123622f", "score": "0.78899395", "text": "function kindOf(val) {\n return Object.prototype.toString.call(val).slice(8, -1);\n }", "title": "" }, { "docid": "711e559f089573b4ff6e6dffe4885dfe", "score": "0.7606925", "text": "function kindOf(val) {\n if (val === null) {\n return 'Null';\n } else if (val === UNDEF) {\n return 'Undefined';\n } else {\n return _rKind.exec( _toString.call(val) )[1];\n }\n }", "title": "" }, { "docid": "821f6ea17c110685f675c7c3137d2b1b", "score": "0.7576157", "text": "function kindOf(val) {\n\t if (val === null) {\n\t return 'Null';\n\t } else if (val === UNDEF) {\n\t return 'Undefined';\n\t } else {\n\t return _rKind.exec( _toString.call(val) )[1];\n\t }\n\t }", "title": "" }, { "docid": "22a16e165592c26d6ac907c378e3cd06", "score": "0.7392694", "text": "function getType(value)\n{\n\tvar type = Object.prototype.toString.call(value);\n\treturn type.substring(8,type.length-1);\n}", "title": "" }, { "docid": "4503e3abd4656525e4ce30b375b95d28", "score": "0.726857", "text": "function getType(value) {\n if (value === undefined) {\n return 'undefined';\n } else if (value === null) {\n return 'null';\n } else if (Array.isArray(value)) {\n return 'array';\n } else if (typeof value === 'boolean') {\n return 'boolean';\n } else if (typeof value === 'function') {\n return 'function';\n } else if (typeof value === 'number') {\n return 'number';\n } else if (typeof value === 'string') {\n return 'string';\n } else if (typeof value === 'bigint') {\n return 'bigint';\n } else if (typeof value === 'object') {\n if (value != null) {\n if (value.constructor === RegExp) {\n return 'regexp';\n } else if (value.constructor === Map) {\n return 'map';\n } else if (value.constructor === Set) {\n return 'set';\n } else if (value.constructor === Date) {\n return 'date';\n }\n }\n\n return 'object';\n } else if (typeof value === 'symbol') {\n return 'symbol';\n }\n\n throw new Error(`value of unknown type: ${value}`);\n}", "title": "" }, { "docid": "959bf690e61dad02be8778f45f8a5de6", "score": "0.7185825", "text": "function getType(value) {\r\n return ({}).toString.call(value);\r\n}", "title": "" }, { "docid": "c7d3213eb2c2f9e1519ad4839b7e564f", "score": "0.70411277", "text": "function getType(value) {\n if (value === null) return \"null\";\n var type = typeof value;\n var source;\n if (type === \"object\") {\n source = Object.prototype.toString.call(value);\n return source.substring(8, source.length - 1);\n }\n if (type === \"function\") {\n source = Function.prototype.toString.call(value.constructor);\n var index = source.indexOf(\"(\");\n return source.substring(9, index);\n }\n return type;\n}", "title": "" }, { "docid": "2ede25f3774fece34e63cf86210b47c8", "score": "0.6836086", "text": "function verificaTipo(value) {\n return Object.prototype.toString.call(value)\n}", "title": "" }, { "docid": "4aa24bb9ddcc470796ac766d577e2e13", "score": "0.6794195", "text": "function primitiveType (value) {\n if (value === undefined) {\n return 'undefined';\n }\n if (value === null) {\n return 'null';\n }\n if (Array.isArray(value)) {\n return 'array';\n }\n // TODO: Ensure that the only other possibilities are 'object', 'boolean', 'number', and 'string'\n return typeof value;\n}", "title": "" }, { "docid": "20ea08326e81f14d07519352860d0261", "score": "0.67691433", "text": "function get_type(val) {\n if (typeof val == 'string' ) return 'string';\n else if (typeof val == 'number' ) return 'number';\n else if (typeof val == 'boolean' ) return 'boolean';\n else if (typeof val == 'function') return 'function';\n else if (typeof val == 'date' ) return 'date';\n else if (val === null ) return 'null';\n// TODO: handle create of new object... else if (meta.has(val) ) return meta.get(val).type;\n// TODO: handle file check... else if (val instanceof File ) return 'file';\n// TODO: handle checking if... is reference else if (references.is(val) ) return 'reference';\n else return undefined;\n}", "title": "" }, { "docid": "c377de240d71ce27cb5383307202f157", "score": "0.6757588", "text": "function typeOf (value) {\n\tvar s = typeof value;\n\n\tif (s === 'object') {\n\t\tif (value) {\n\t\t\tswitch (Object.prototype.toString.call(value)) {\n\t\t\tcase '[object Array]':\n\t\t\t\ts = 'array';\n\t\t\t\tbreak;\n\t\t\tcase '[object RegExp]':\n\t\t\t\ts = 'regexp';\n\t\t\t\tbreak;\n\t\t\tcase '[object Arguments]':\n\t\t\t\ts = 'arguments';\n\t\t\t\tbreak;\n\t\t\tcase '[object Date]':\n\t\t\t\ts = 'date';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\ts = 'null';\n\t\t}\n\t}\n\treturn (s);\n}", "title": "" }, { "docid": "a50f01d04fe0472bbd12a85ceb9c452f", "score": "0.67548203", "text": "function datatype(inValue)\n{\n\tif (inValue == undefined)\n\t\treturn 'undefined';\n\telse\n\t{\n\t\tswitch (inValue.constructor)\n\t\t{\n\t\t\t// Javascript types\n\t\t\tcase\tBoolean: return 'boolean';\n\t\t\tcase\tArray: return 'array';\n\t\t\tcase\tString: return 'string';\n\t\t\tcase \tDate: return 'date';\n\t\t\tcase\tNumber: return (inValue == Math.floor(inValue)) ? 'int' : 'float' ;\n\t\t\tcase\tFunction: return 'function';\n\t\t\n\t\t\t// Shared Javascript/HTML types\n\t\t\t// Calling Javascript's new Image() and \n\t\t\t// HTML's document.createElememt('img')\n\t\t\t// both return an HTMLImageElement\n\t\t\tcase\tHTMLImageElement: return 'image';\n\t\t\n\t\t\t// HTML object types\n\t\t\tcase\tHTMLHeadElement: return 'html_head';\n\t\t\tcase\tHTMLBodyElement: return 'html_body';\n\t\t\tcase\tHTMLDivElement: return 'html_div';\n\t\t\tcase\tHTMLSpanElement: return 'html_span';\n\t\t\tcase\tHTMLCanvasElement: return 'html_canvas';\n\t\t\tcase\tHTMLParagraphElement: return 'html_paragraph';\n\t\t\tcase\tHTMLAnchorElement: return 'html_anchor';\n\t\t\tcase\tHTMLLinkElement: return 'html_link';\n\t\t\tcase\tHTMLFormElement: return 'html_form';\n\t\t\tcase\tHTMLIFrameElement: return 'html_iframe';\n\t\t\tcase\tHTMLAreaElement: return 'html_area';\n\t\t\tcase\tHTMLMetaElement: return 'html_meta';\n\t\t\tcase\tHTMLObjectElement: return 'html_object';\n\t\t\tcase\tHTMLSelectElement: return 'html_select';\n\t\t\tcase\tHTMLStyleElement: return 'html_style';\n\t\t\tcase\tHTMLLIElement: return 'html_list_item';\n\t\t\tcase\tHTMLOptionElement: return 'html_option';\n\t\t\tcase\tHTMLTextAreaElement: return 'html_text_area';\n\t\t\tcase\tHTMLScriptElement: return 'html_script';\n\t\t\tcase\tText: return 'html_text';\n\t\t\n\t\t\t// HTML tables\n\t\t\tcase\tHTMLTableElement: return 'html_table';\n\t\t\tcase\tHTMLTableRowElement: return 'html_table_row';\n\t\t\tcase\tHTMLTableCellElement: return 'html_table_cell';\n\t\t\n\t\t\t// HTML input types\n\t\t\tcase\tHTMLButtonElement: return 'html_button';\n\t\t\tcase\tHTMLInputElement: return 'html_' + inValue.type;\n\t\t\n\t\t\t// Opera specific span detector\n\t\t\tcase\tHTMLElement:\n\t\t\t\t{\n\t\t\t\t\tvar type\t= inValue.nodeName.toLowerCase();\n\t\t\t\t\t\n\t\t\t\t\tif (type == 'span')\n\t\t\t\t\t\treturn 'html_span';\n\t\t\t\t\telse\n\t\t\t\t\t\treturn 'opera_unknown_' + type;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\t// If any of inValue's keys map to functions, \n\t\t\t\t// then it is an object. Otherwise it's \n\t\t\t\t// a simple key/value array\n\t\t\t\tfor (var key in inValue)\n\t\t\t\t{\n\t\t\t\t\tif (inValue[key].constructor == Function)\n\t\t\t\t\t\treturn 'object';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn 'dict';\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fc0ce63feba916e3f8c42bfe7496fa25", "score": "0.6748269", "text": "function typeOfValue(x){\n return typeof x;\n}", "title": "" }, { "docid": "daab5cc27fa2ce5c479ab20d9fcad620", "score": "0.67364526", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined'\n if (val === null) return 'null'\n\n const type = typeof val\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function': {\n return type\n }\n default:\n break\n }\n\n if (Array.isArray(val)) return 'array'\n if (isDate(val)) return 'date'\n if (isError(val)) return 'error'\n\n const constructorName = ctorName(val)\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName\n default:\n break\n }\n\n // other\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '')\n }", "title": "" }, { "docid": "d0c7f2e2fc091f5a8b21f8c78c29c8eb", "score": "0.67352104", "text": "function ofType(value) {\n if (util.isString(value)) {\n return 'String';\n } else if (util.isNumber(value)) {\n return 'Number';\n } else if (util.isBuffer(value)) {\n return 'Binary';\n }\n}", "title": "" }, { "docid": "b21f1b835408f7bf5a98804b9a07b470", "score": "0.6693447", "text": "function variableType(value) {\n if (/^\\'?(\\-)?[0-9]+\\'?$/.test(value))\n return 'integer';\n if (/^\\'?(\\-)?[0-9.,]+\\'?$/.test(value))\n return 'float';\n if (/true|false/.test(value))\n return 'boolean';\n if (/^\\'/.test(value))\n return 'string';\n if (/^ARRAY/.test(value))\n return 'array';\n if (/^HASH/.test(value))\n return 'object';\n return 'unknown';\n}", "title": "" }, { "docid": "46ef759cea131ae7933d08af17294051", "score": "0.6692159", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n }", "title": "" }, { "docid": "46ef759cea131ae7933d08af17294051", "score": "0.6692159", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n }", "title": "" }, { "docid": "46ef759cea131ae7933d08af17294051", "score": "0.6692159", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n }", "title": "" }, { "docid": "46ef759cea131ae7933d08af17294051", "score": "0.6692159", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n }", "title": "" }, { "docid": "703e2e427d51a1dcc64172c087ff5643", "score": "0.6682453", "text": "function realType(value){\n\n if(value == null){\n return \"null\"\n }\n\n switch(typeof value){\n case(typeof 0): return \"number\";\n\n case(typeof \"\"): return \"string\";\n\n case(typeof true): return \"boolean\";\n\n case(typeof []): return \"array\";\n\n default: return \"Please use correct type\";\n\n }\n}", "title": "" }, { "docid": "d931a3568f6bcf52e4531968e7b7ff55", "score": "0.66424936", "text": "function Type(v) {\n switch(typeof v) {\n case 'undefined': return 'undefined';\n case 'boolean': return 'boolean';\n case 'number': return 'number';\n case 'string': return 'string';\n default: return v === null ? 'null' : 'object';\n }\n }", "title": "" }, { "docid": "d931a3568f6bcf52e4531968e7b7ff55", "score": "0.66424936", "text": "function Type(v) {\n switch(typeof v) {\n case 'undefined': return 'undefined';\n case 'boolean': return 'boolean';\n case 'number': return 'number';\n case 'string': return 'string';\n default: return v === null ? 'null' : 'object';\n }\n }", "title": "" }, { "docid": "d931a3568f6bcf52e4531968e7b7ff55", "score": "0.66424936", "text": "function Type(v) {\n switch(typeof v) {\n case 'undefined': return 'undefined';\n case 'boolean': return 'boolean';\n case 'number': return 'number';\n case 'string': return 'string';\n default: return v === null ? 'null' : 'object';\n }\n }", "title": "" }, { "docid": "d931a3568f6bcf52e4531968e7b7ff55", "score": "0.66424936", "text": "function Type(v) {\n switch(typeof v) {\n case 'undefined': return 'undefined';\n case 'boolean': return 'boolean';\n case 'number': return 'number';\n case 'string': return 'string';\n default: return v === null ? 'null' : 'object';\n }\n }", "title": "" }, { "docid": "d931a3568f6bcf52e4531968e7b7ff55", "score": "0.66424936", "text": "function Type(v) {\n switch(typeof v) {\n case 'undefined': return 'undefined';\n case 'boolean': return 'boolean';\n case 'number': return 'number';\n case 'string': return 'string';\n default: return v === null ? 'null' : 'object';\n }\n }", "title": "" }, { "docid": "d931a3568f6bcf52e4531968e7b7ff55", "score": "0.66424936", "text": "function Type(v) {\n switch(typeof v) {\n case 'undefined': return 'undefined';\n case 'boolean': return 'boolean';\n case 'number': return 'number';\n case 'string': return 'string';\n default: return v === null ? 'null' : 'object';\n }\n }", "title": "" }, { "docid": "d931a3568f6bcf52e4531968e7b7ff55", "score": "0.66424936", "text": "function Type(v) {\n switch(typeof v) {\n case 'undefined': return 'undefined';\n case 'boolean': return 'boolean';\n case 'number': return 'number';\n case 'string': return 'string';\n default: return v === null ? 'null' : 'object';\n }\n }", "title": "" }, { "docid": "d931a3568f6bcf52e4531968e7b7ff55", "score": "0.66424936", "text": "function Type(v) {\n switch(typeof v) {\n case 'undefined': return 'undefined';\n case 'boolean': return 'boolean';\n case 'number': return 'number';\n case 'string': return 'string';\n default: return v === null ? 'null' : 'object';\n }\n }", "title": "" }, { "docid": "d931a3568f6bcf52e4531968e7b7ff55", "score": "0.66424936", "text": "function Type(v) {\n switch(typeof v) {\n case 'undefined': return 'undefined';\n case 'boolean': return 'boolean';\n case 'number': return 'number';\n case 'string': return 'string';\n default: return v === null ? 'null' : 'object';\n }\n }", "title": "" }, { "docid": "d931a3568f6bcf52e4531968e7b7ff55", "score": "0.66424936", "text": "function Type(v) {\n switch(typeof v) {\n case 'undefined': return 'undefined';\n case 'boolean': return 'boolean';\n case 'number': return 'number';\n case 'string': return 'string';\n default: return v === null ? 'null' : 'object';\n }\n }", "title": "" }, { "docid": "d931a3568f6bcf52e4531968e7b7ff55", "score": "0.66424936", "text": "function Type(v) {\n switch(typeof v) {\n case 'undefined': return 'undefined';\n case 'boolean': return 'boolean';\n case 'number': return 'number';\n case 'string': return 'string';\n default: return v === null ? 'null' : 'object';\n }\n }", "title": "" }, { "docid": "d931a3568f6bcf52e4531968e7b7ff55", "score": "0.66424936", "text": "function Type(v) {\n switch(typeof v) {\n case 'undefined': return 'undefined';\n case 'boolean': return 'boolean';\n case 'number': return 'number';\n case 'string': return 'string';\n default: return v === null ? 'null' : 'object';\n }\n }", "title": "" }, { "docid": "603a24d3cf6667cf1fe7787642157140", "score": "0.66265035", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}", "title": "" }, { "docid": "603a24d3cf6667cf1fe7787642157140", "score": "0.66265035", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}", "title": "" }, { "docid": "603a24d3cf6667cf1fe7787642157140", "score": "0.66265035", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}", "title": "" }, { "docid": "603a24d3cf6667cf1fe7787642157140", "score": "0.66265035", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}", "title": "" }, { "docid": "78271fc410346130e2e98fdacc390f98", "score": "0.6599408", "text": "static getType(value) {\n if (typeof value !== 'undefined' && typeof value.constructor !== 'undefined') {\n return value.constructor.name;\n }\n return typeof value;\n }", "title": "" }, { "docid": "c5233d337c356a36878cf163d0779fa9", "score": "0.6572638", "text": "_type(v) {\n if (typeof v === 'number') {\n return 1;\n }\n\n if (typeof v === 'string') {\n return 2;\n }\n\n if (typeof v === 'boolean') {\n return 8;\n }\n\n if (Array.isArray(v)) {\n return 4;\n }\n\n if (v === null) {\n return 10;\n }\n\n // note that typeof(/x/) === \"object\"\n if (v instanceof RegExp) {\n return 11;\n }\n\n if (typeof v === 'function') {\n return 13;\n }\n\n if (v instanceof Date) {\n return 9;\n }\n\n if (EJSON.isBinary(v)) {\n return 5;\n }\n\n if (v instanceof MongoID.ObjectID) {\n return 7;\n }\n\n if (v instanceof Decimal) {\n return 1;\n }\n\n // object\n return 3;\n\n // XXX support some/all of these:\n // 14, symbol\n // 15, javascript code with scope\n // 16, 18: 32-bit/64-bit integer\n // 17, timestamp\n // 255, minkey\n // 127, maxkey\n }", "title": "" }, { "docid": "7d59c233bbdce37721f49f6c9391cee0", "score": "0.657226", "text": "function realType(value){\n\n if(value == null){\n return 'null';\n }\n\n switch(typeof value){\n case(typeof 0): return 'number';\n\n case(typeof ''): return 'string';\n\n case(typeof true): return 'boolean';\n\n case(typeof []): return 'array';\n\n default: return 'Please use correct type';\n\n }\n}", "title": "" }, { "docid": "0a7be55483cb31ccfb7a2a63ed96d1d9", "score": "0.6528806", "text": "function getType(val) {\n switch (typeof val) {\n case \"number\":\n val = \"number\";\n break;\n case \"string\":\n val = \"string\";\n break;\n case \"function\":\n val = \"function\";\n break;\n case \"boolean\":\n val = \"boolean\";\n break;\n case \"object\":\n val = \"object\";\n break;\n }\n return val;\n}", "title": "" }, { "docid": "3604c364fc0c449c4c0995b376a0f84a", "score": "0.6527994", "text": "function typeOf(value) {\n\t var s = typeof value;\n\t if (s == 'object') {\n\t if (!value) {\n\t return 'null';\n\t } else if (value instanceof Array) {\n\t return 'array';\n\t }\n\t }\n\t return s;\n\t}", "title": "" }, { "docid": "0d5b48bfd209df6d59c58f822d11ad8f", "score": "0.6491608", "text": "function isType(value) {\n return value != null && typeof value === 'object' && typeof value['kind'] === 'string';\n}", "title": "" }, { "docid": "cca8661526a7ed734433364dd9720b7f", "score": "0.6459673", "text": "function Value() { this.type = this.STRING; }", "title": "" }, { "docid": "4a5509eceb144e7baba3333440ee1825", "score": "0.6390466", "text": "function typeOfValue(a) {\n return typeof a\n}", "title": "" }, { "docid": "296059faf948018fa98e805645f70f4c", "score": "0.63812864", "text": "function typeOf(value) {\n // YOUR CODE BELOW HERE //\n /** with this function we want to return the value type as a string\n * to do this we can make an if else if chain including some of our \n * functions we have done earlier in this problem as our conditions.\n * I'll start with is Array\n */\n \n if(isArray(value)){\n return \"array\";\n } else if (isObject(value)){\n //next ill check if the value is an object\n return \"object\";\n } else if (value === true || false){\n //next I check for a boolean\n return \"boolean\"\n } else if (value === null){\n //next I check for a null value\n return \"null\"\n } else if (value instanceof Date){\n return \"date\"\n //next I will check if the input value is a date\n } else {\n return typeof value;\n }\n //lastly I will use the type of operatro to handle everything else.\n //I could have checked for boolean values at this step as well.\n \n \n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "67e4f1a2736c7e15cef16b6388a537b9", "score": "0.63711756", "text": "function typeOf(value) {\n var s = typeof value;\n if (s == 'object') {\n if (!value) {\n return 'null';\n } else if (value instanceof Array) {\n return 'array';\n }\n }\n return s;\n}", "title": "" }, { "docid": "67e4f1a2736c7e15cef16b6388a537b9", "score": "0.63711756", "text": "function typeOf(value) {\n var s = typeof value;\n if (s == 'object') {\n if (!value) {\n return 'null';\n } else if (value instanceof Array) {\n return 'array';\n }\n }\n return s;\n}", "title": "" }, { "docid": "67e4f1a2736c7e15cef16b6388a537b9", "score": "0.63711756", "text": "function typeOf(value) {\n var s = typeof value;\n if (s == 'object') {\n if (!value) {\n return 'null';\n } else if (value instanceof Array) {\n return 'array';\n }\n }\n return s;\n}", "title": "" }, { "docid": "67e4f1a2736c7e15cef16b6388a537b9", "score": "0.63711756", "text": "function typeOf(value) {\n var s = typeof value;\n if (s == 'object') {\n if (!value) {\n return 'null';\n } else if (value instanceof Array) {\n return 'array';\n }\n }\n return s;\n}", "title": "" }, { "docid": "67e4f1a2736c7e15cef16b6388a537b9", "score": "0.63711756", "text": "function typeOf(value) {\n var s = typeof value;\n if (s == 'object') {\n if (!value) {\n return 'null';\n } else if (value instanceof Array) {\n return 'array';\n }\n }\n return s;\n}", "title": "" }, { "docid": "34653ef0f08953204e7515f387ffe419", "score": "0.634766", "text": "function getValueType(dataset, features, fields) {\n\tvar {type} = dataset,\n\t\tvaluetype = _.getIn(features, [fields[0], 'valuetype']);\n\treturn type === 'mutationVector' ? 'mutation' :\n\t\ttype === 'genomicSegment' ? 'segmented' :\n\t\ttype === 'clinicalMatrix' && valuetype === 'category' ? 'coded' :\n\t\t'float';\n}", "title": "" }, { "docid": "59835bd6da675688bde0ed46659ae182", "score": "0.6325171", "text": "function typeOf(value){\n if(Array.isArray(value)){\n return 'array';\n }else if(value === null){\n return 'null';\n }else{\n return typeof value;\n }\n}", "title": "" }, { "docid": "ae01b9316263ab2089c87d0daa4248ca", "score": "0.62892145", "text": "function stringType(value) {\n return toStringFunc.call(value).slice(8, -1);\n }", "title": "" }, { "docid": "44c930ba8f3d88d7c82a69c0903ee796", "score": "0.6288218", "text": "getTypeString() {\n if (typeof this.value === \"bigint\") {\n return this.value.toString() + \"n\";\n }\n return JSON.stringify(this.value);\n }", "title": "" }, { "docid": "ba3a93174775bb26fe46a24e3610bd89", "score": "0.62748784", "text": "function jsontype(type) {\n switch (type) {\n case 'integer':\n case 'float':\n case 'long':\n case 'double':\n case 'byte':\n return 'number';\n case 'string':\n return 'string';\n case 'boolean':\n return 'boolean';\n default:\n return 'undefined';\n }\n}", "title": "" }, { "docid": "f56a6de7db7c14ce2d23e869a7fb2bc8", "score": "0.6269748", "text": "function isKind(val, kind){\n\t return kindOf(val) === kind;\n\t }", "title": "" }, { "docid": "89ea566b4502563a14347f8dc085389e", "score": "0.6264369", "text": "function checkType(value) {\n return typeof value\n}", "title": "" }, { "docid": "f1480961df51a1e383415345215e0513", "score": "0.6263952", "text": "get kind() {\n\t\treturn this.__kind;\n\t}", "title": "" }, { "docid": "f1480961df51a1e383415345215e0513", "score": "0.6263952", "text": "get kind() {\n\t\treturn this.__kind;\n\t}", "title": "" }, { "docid": "f1480961df51a1e383415345215e0513", "score": "0.6263952", "text": "get kind() {\n\t\treturn this.__kind;\n\t}", "title": "" }, { "docid": "92f902564d95abce111196ad7f8c4a6c", "score": "0.62575424", "text": "static getType(val) {\n if (val === undefined) return \"undefined\";\n if (val === null) return \"null\";\n return val.constructor.name;\n }", "title": "" }, { "docid": "e6084aa26ac00f44c00ad211bfa35f73", "score": "0.62574685", "text": "function getValueUsingType(value, type) {\n if (type == 'i') {\n return ~~value;\n } else {\n return value.trim();\n }\n}", "title": "" }, { "docid": "149a21317c45880a879be07089199631", "score": "0.62543744", "text": "function isKind(val, kind){\n return kindOf(val) === kind;\n }", "title": "" }, { "docid": "6ffc3beb55e56fecb7e54185608dd294", "score": "0.624248", "text": "function getTypeKind(node) {\n return node.type.kind;\n}", "title": "" }, { "docid": "25f0d2ee3c0391a37c71a57931105084", "score": "0.6231849", "text": "function getOptionKind(value)\n {\n return _option_kind_;\n }", "title": "" }, { "docid": "d6bb3744a64246351fbd8ebf4b59ad1e", "score": "0.6210736", "text": "toEnumValue(value, datatype) {\n if ('number' == '' + datatype.toLowerCase()) {\n return value\n }\n return '\"' + this.escapeText(value) + '\"'\n }", "title": "" }, { "docid": "c76cbd4df56ca3ab1b8bf90572fa42b2", "score": "0.6206008", "text": "function Type(v) { return v === null ? 'null' : typeof v; }", "title": "" }, { "docid": "3d7e7d2753ce9199f6f5724c1847fb73", "score": "0.61936516", "text": "function isKind(val, kind){\n return kindOf(val) === kind;\n }", "title": "" }, { "docid": "3d7e7d2753ce9199f6f5724c1847fb73", "score": "0.61936516", "text": "function isKind(val, kind){\n return kindOf(val) === kind;\n }", "title": "" }, { "docid": "3d7e7d2753ce9199f6f5724c1847fb73", "score": "0.61936516", "text": "function isKind(val, kind){\n return kindOf(val) === kind;\n }", "title": "" }, { "docid": "3d7e7d2753ce9199f6f5724c1847fb73", "score": "0.61936516", "text": "function isKind(val, kind){\n return kindOf(val) === kind;\n }", "title": "" }, { "docid": "3d7e7d2753ce9199f6f5724c1847fb73", "score": "0.61936516", "text": "function isKind(val, kind){\n return kindOf(val) === kind;\n }", "title": "" }, { "docid": "3d7e7d2753ce9199f6f5724c1847fb73", "score": "0.61936516", "text": "function isKind(val, kind){\n return kindOf(val) === kind;\n }", "title": "" }, { "docid": "aa3e590de343d4715c6c85554492c5ed", "score": "0.6190512", "text": "function get_type(thing){\n if(thing===null) return \"[object Null]\"; // special case\n return Object.prototype.toString.call(thing);\n }", "title": "" }, { "docid": "fbc1cb1b132281727ca93b9efde4e102", "score": "0.6173614", "text": "function GetType(thing) {\n\tif (thing === null) {\n\t\treturn 'null';\n\t}\n\tswitch (typeof thing === 'undefined' ? 'undefined' : _typeof(thing)) {\n\t\tcase 'undefined':\n\t\t\treturn 'undefined';\n\t\tcase 'boolean':\n\t\t\treturn 'boolean';\n\t\tcase 'number':\n\t\t\treturn 'number';\n\t\tcase 'string':\n\t\t\treturn 'string';\n\t\tdefault:\n\t\t\treturn 'object';\n\t}\n}", "title": "" }, { "docid": "6a52f1a29440a13b77a55e0658996ccd", "score": "0.61724615", "text": "getKind()\n {\n \treturn this.getData().kind;\n }", "title": "" }, { "docid": "48d22abd1ab4fce7449c42ee64e607bf", "score": "0.6164857", "text": "function isScalarValue(value) {\n return ['StringValue', 'BooleanValue', 'EnumValue'].indexOf(value.kind) > -1;\n}", "title": "" }, { "docid": "df827db3f42aa5746773c8d5bba91a74", "score": "0.6150019", "text": "vValueAndType(field){\n\n switch(field.type)\n { \n case \"date\": // type === Date\n {\n return Util.isDate(field.value);\n break;\n }\n case \"int\": // type === integer\n {\n return Util.isNumber(field.value);\n break;\n }\n case \"boolean\": // type === boolean\n {\n return Util.isBool(field.value);\n break;\n }\n case \"string\": // type === string\n {\n return true;\n }\n default: // type undefined that not validation\n {\n return false;\n }\n }\n }", "title": "" }, { "docid": "5286e7febdf9eb7cd240bb551b864c23", "score": "0.6123666", "text": "function typeOf(value) {\n // YOUR CODE BELOW HERE //\n /* This function will take an argument and test for its data type. Whatever the given \n * data type is, the function will return that data type as a string. First, we'll create \n * an empty variable to be used as final return statement. Then, we'll create a conditional \n * statement that checks the value of each data type. To be safe, I'll place object at the\n * end since other data types could return 'object*/\n var dataType;\n if (value === null) {\n dataType = 'null';\n } else if (value instanceof Date === true) {\n dataType = 'date';\n } else if (typeof value === 'function') {\n dataType = 'function'; \n } else if (value === undefined) {\n dataType = 'undefined';\n } else if (typeof value === 'string') {\n dataType = 'string';\n } else if (typeof value === 'boolean') {\n dataType = 'boolean';\n } else if (typeof value === 'number') {\n dataType = 'number';\n } else if (Array.isArray(value) === true) {\n dataType = 'array';\n } else if (typeof value == 'object') {\n dataType = 'object';\n }\n \n return dataType;\n \n \n // YOUR CODE ABOVE HERE //\n}", "title": "" }, { "docid": "ce6bf3d7122e14d452c33cda8e7a09e5", "score": "0.6120076", "text": "function typeOf(value) {\r\n\tif (value == null) { return 'null'; }\r\n\tvar v = typeof value;\r\n\tif (v === 'object') { if (Array.isArray(value)) { return 'array'; } }\r\n\tif (v == 'string') { return v; } // Fix? Additional functionality?\r\n\t// Fix. Check for modified 'undefined' object?\r\n\treturn v;\r\n}", "title": "" }, { "docid": "2d490443e1b562800f5a11031a88701c", "score": "0.61036325", "text": "function getType(t) {\n\n switch(t) {\n case 'text': return 'varchar(255)';\n case 'longtext': return 'text';\n case 'integer': return 'integer';\n case 'boolean': return 'boolean';\n case 'float': return 'real';\n case 'date': return 'date';\n case 'time': return 'time';\n case 'url': return 'varchar(255)';\n case 'geoloc': return 'varchar(255)';\n case 'enum': return 'varchar(255)'; // MySQL:enum PgSQL:?\n case 'multi-enum': return 'varchar(255)'; // ?\n case 'range': return 'real';\n case 'ref': return 'varchar(255)';\n default: return 'varchar(255)';\n }\n }", "title": "" }, { "docid": "3c00f74791745a8d626ec422573b1198", "score": "0.6065256", "text": "function determineClassTypeId( value ) {\n switch (value.constructor) {\n // case Array: return T_ARRAY; // also handled above\n // case Object: return T_OBJECT; // handled above\n case ObjectId: return T_OBJECTID;\n case Date: return T_DATE;\n case RegExp: return T_REGEXP;\n case Function: return (value.scope && typeof value.scope === 'object') ? T_SCOPED_CODE : T_FUNCTION;\n case Buffer: return T_BINARY;\n case Number: return ((value >> 0) == value && 1/value != -Infinity) ? T_INT : T_FLOAT;\n case String: return T_STRING;\n case Boolean: return T_BOOLEAN;\n case Timestamp: return T_TIMESTAMP;\n case Long: return T_LONG;\n case Decimal128: return T_DECIMAL128;\n case DbRef: return T_DBREF;\n case MinKey: return T_MINKEY;\n case MaxKey: return T_MAXKEY;\n default:\n return T_OBJECT;\n }\n}", "title": "" }, { "docid": "c5bfdddf1d0df9a109857ebaa2a72d10", "score": "0.60485", "text": "function type(val){\n return Object.prototype.toString.call(val).replace(/^\\[object (.+)\\]$/,\"$1\").toLowerCase();\n}", "title": "" }, { "docid": "2449910642e2d6d55f1794a902537aaf", "score": "0.60248524", "text": "function toRawType (value) {\n const _toString = Object.prototype.toString\n return _toString.call(value).slice(8, -1)\n}", "title": "" }, { "docid": "8ab95fca058e2774ddb4ac634eaf99c2", "score": "0.6016344", "text": "async function getDataOutlineType(value) {\n if (\n typeof value === 'number' ||\n (Array.isArray(value) && value.length && value.length === 1)\n )\n return 'numberString';\n else if (Array.isArray(value) && value.length && typeof value[0] === 'number')\n return 'numberStringArray';\n else return 'paddedString';\n}", "title": "" }, { "docid": "78086f2f91a8bb41e455e636ead79a06", "score": "0.60158634", "text": "function getType(value, getClassName)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar type\t\t= typeof value;\n\t\t\t\t\t\tvar className\t= type.substr(0,1).toUpperCase() + type.substr(1);\n\n\t\t\t\t\t\t//fl.trace('type:' + type)\n\t\t\t\t\t\t//fl.trace('value:' + value)\n\n\t\t\t\t\t\tswitch(type)\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\tcase 'object':\n\t\t\t\t\t\t\t\tif(value == null)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttype\t\t= 'null';\n\t\t\t\t\t\t\t\t\tclassName\t= '';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (value instanceof Array && value.constructor == Array)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttype\t\t= 'array';\n\t\t\t\t\t\t\t\t\tclassName\t= 'Array';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (value instanceof Date)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttype\t\t= 'date';\n\t\t\t\t\t\t\t\t\tclassName\t= 'Date';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (value instanceof RegExp)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttype\t\t= 'regexp';\n\t\t\t\t\t\t\t\t\tclassName\t= 'RegExp';\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\telse if(value.constructor)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tfl.trace(value.toSource())\n\t\t\t\t\t\t\t\t\ttype\t\t= 'class';\n\t\t\t\t\t\t\t\t\tclassName\t= String(value.constructor).match(/function (\\w+)/)[1];\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\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tvar matches = String(value).match(/^\\[(object|class) ([_\\w]+)/);\n\t\t\t\t\t\t\t\t\t//type\t\t= matches[1];\n\t\t\t\t\t\t\t\t\tclassName\t= matches ? matches[2] : 'Unknown';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'undefined':\n\t\t\t\t\t\t\t\tclassName = '';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'xml':\n\t\t\t\t\t\t\t\tclassName = 'XML';\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'function': // loop through properties to see if it's a class\n\t\t\t\t\t\t\t\tif (value instanceof RegExp)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttype\t\t= 'regexp';\n\t\t\t\t\t\t\t\t\tclassName\t= 'RegExp';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tfor(var i in value)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif(i != 'prototype')\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\ttype = 'object';\n\t\t\t\t\t\t\t\t\t\t\tclassName = 'Class';\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\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\tbreak;\n\n\t\t\t\t\t\t\tcase 'string':\n\t\t\t\t\t\t\tcase 'boolean':\n\t\t\t\t\t\t\tcase 'number':\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t//fl.trace('--' + value)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn getClassName ? className : type;\n\t\t\t\t\t}", "title": "" }, { "docid": "5e88537ef20a63e6dec1cb48cb502274", "score": "0.60139465", "text": "showMeWhatYouGot() {\n if (_.isNull(this.value)) {\n return 'null';\n }\n if (_.isObjectLike(this.value)) {\n return _showMeWhatYouGotObject(this.value, this.options);\n }\n if (_.isString(this.value)) {\n return 'string';\n }\n if (_.isNumber(this.value)) {\n return 'number';\n }\n throw new Error(\n `Could not find a type for value ${this.value} in Transform type adapter.`\n );\n }", "title": "" }, { "docid": "7b4db6bbf69adc9f817ce1fa2db48691", "score": "0.60096216", "text": "function Type(x) {\n\t if (x === null)\n\t { return 1 /* Null */; }\n\t switch (typeof x) {\n\t case \"undefined\": return 0 /* Undefined */;\n\t case \"boolean\": return 2 /* Boolean */;\n\t case \"string\": return 3 /* String */;\n\t case \"symbol\": return 4 /* Symbol */;\n\t case \"number\": return 5 /* Number */;\n\t case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n\t default: return 6 /* Object */;\n\t }\n\t }", "title": "" }, { "docid": "7eb6557abb2c51999dd190fea0cd5d75", "score": "0.60077405", "text": "valueOf() {\n return this.presentAs(Dish.typeEnum(\"number\"));\n }", "title": "" }, { "docid": "f21c38da245e2ea58960b7fbfdbf822b", "score": "0.5990648", "text": "function parseType(val) {\n if (val === null)\n return 'null';\n if ((val instanceof RegExp))\n return 'regexp';\n if (Array.isArray(val))\n return 'array';\n return typeof val;\n }", "title": "" }, { "docid": "57a4057aa30c9ec9636cfd084f91be90", "score": "0.59846824", "text": "function typeOf(value) {\n var s = typeof value;\n if (s === 'object') {\n if (value) {\n if (Object.prototype.toString.call(value) == '[object Array]') {\n s = 'array';\n }\n } else {\n s = 'null';\n }\n }\n return s;\n}", "title": "" }, { "docid": "c1edb3064e2d1aa7d06a5ec677727285", "score": "0.5965259", "text": "function serializeValue(value) {\n var type = Object.prototype.toString.call(value);\n // Node.js REPL notation\n if (typeof value === 'string') {\n return value;\n }\n if (type === '[object Object]') {\n return '[Object]';\n }\n if (type === '[object Array]') {\n return '[Array]';\n }\n var normalized = normalizeValue(value);\n return isPrimitive(normalized) ? normalized : type;\n }", "title": "" }, { "docid": "40a5593941eb1880fdd061d547370471", "score": "0.5961313", "text": "function Type(x) {\n if (x === null) return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\":\n return 0 /* Undefined */;\n case \"boolean\":\n return 2 /* Boolean */;\n case \"string\":\n return 3 /* String */;\n case \"symbol\":\n return 4 /* Symbol */;\n case \"number\":\n return 5 /* Number */;\n case \"object\":\n return x === null ? 1 /* Null */ : 6 /* Object */;\n default:\n return 6 /* Object */;\n }\n }", "title": "" }, { "docid": "3ed630955a2066da8c836dfd51220d9d", "score": "0.5955158", "text": "putKind(value)\n {\n \tthis.getData().kind = value;\n }", "title": "" }, { "docid": "2947b143b7fe54d582bf9da5c7b496f8", "score": "0.59528506", "text": "function getWriteKind(value)\n {\n return _write_kind_;\n }", "title": "" } ]
b47427a857cc6ced4f02e931d2df7daf
Attempt to load a script from the configuration module's `scripts/` folder, or a standard Node modules folder.
[ { "docid": "6bf05673afc24a17b72021ab434b6877", "score": "0.7216289", "text": "loadScriptFromModule(context, script) {\n if (script) {\n return script;\n }\n this.debug('Attempting to load script from configuration module or node module');\n const moduleName = this.tool.config.module;\n const fileName = upperFirst_1.default(camelCase_1.default(context.scriptName));\n const resolver = new common_1.PathResolver();\n if (moduleName === '@local') {\n resolver\n .lookupFilePath(`lib/scripts/${fileName}.js`, context.moduleRoot)\n .lookupFilePath(`scripts/${fileName}.js`, context.moduleRoot);\n }\n else {\n resolver\n .lookupNodeModule(`${moduleName}/lib/scripts/${fileName}`)\n .lookupNodeModule(`${moduleName}/scripts/${fileName}`)\n .lookupNodeModule(formatModuleName_1.default('beemo', 'script', context.scriptName, true))\n .lookupNodeModule(formatModuleName_1.default('beemo', 'script', context.scriptName));\n }\n try {\n const { originalPath, resolvedPath } = resolver.resolve();\n script = this.tool.getRegisteredPlugin('script').loader.importModule(resolvedPath);\n script.name = context.scriptName;\n script.moduleName = originalPath.path();\n context.setScript(script, resolvedPath.path());\n }\n catch (error) {\n error.message = this.tool.msg('app:fromModule', { message: error.message });\n this.errors.push(error);\n }\n return script || null;\n }", "title": "" } ]
[ { "docid": "04b1f9899b1d53f5e5070ac7a83d7abd", "score": "0.6564764", "text": "function runScriptViaModuleLoader (script, context) {\n if (!fs.existsSync(script.fullPath)) {\n events.emit('warn', 'Script file does\\'t exist and will be skipped: ' + script.fullPath);\n return Promise.resolve();\n }\n const scriptFn = require(script.fullPath);\n context.scriptLocation = script.fullPath;\n if (script.plugin) {\n context.opts.plugin = script.plugin;\n }\n\n // We can't run script if it is a plain Node script - it will run its commands when we require it.\n // This is not a desired case as we want to pass context, but added for compatibility.\n if (scriptFn instanceof Function) {\n // If hook is async it can return promise instance and we will handle it.\n return Promise.resolve(scriptFn(context));\n } else {\n return Promise.resolve();\n }\n}", "title": "" }, { "docid": "0e1ae566c03121b051ce7c11bb8785c7", "score": "0.6493884", "text": "function script(path) {\n var pre = path.match(/^\\//) ? '' : process.webr.root + '/'\n var fullPath = fs.realpathSync(pre + path)\n if (fullPath in scripts) {\n // don't load script twice in the same context\n // multiple file loading/reporting messes up otherwise\n // TODO: rethink this\n return\n }\n var data = fs.readFileSync(fullPath)\n scripts[fullPath] = data\n scriptEval(data, fullPath)\n }", "title": "" }, { "docid": "37c0f6f04fdc49e3bb6b6c1a3b64b726", "score": "0.6297244", "text": "__getScriptFile (scriptName) {\n let script\n\n try {\n script = require.resolve(`${this.packageName}/src/${scriptName}`, {\n paths: [ appPaths.appDir ]\n })\n }\n catch (e) {\n script = require.resolve(`${this.packageName}/dist/${scriptName}`, {\n paths: [ appPaths.appDir ]\n })\n }\n\n return script\n }", "title": "" }, { "docid": "f74621e79e6543c3b62c2bb4a3860b0e", "score": "0.58978903", "text": "static require(path) {\n if (Util.isCommonJS) {\n return require(path);\n } else if (Util.isWebPack) {\n Util.warn('Util.require may not work with WebPack', path);\n return require(path);\n } else {\n return Util.loadScript(path + '.js');\n }\n }", "title": "" }, { "docid": "f02047ebbc93ef9b5044bbe6f301b4d4", "score": "0.5871388", "text": "function loadReadabilityScript(callback) {\n fs.readFile(__dirname + '/Readability.js', function (err, data) {\n if (err) {\n return callback(err);\n }\n var script = data.toString();\n callback(null, script);\n });\n}", "title": "" }, { "docid": "4b0b1519a2ca2e285f3c95d7d3fee37f", "score": "0.5803404", "text": "function runScript (script, context) {\n let source;\n let relativePath;\n\n if (script.plugin) {\n source = 'plugin ' + script.plugin.id;\n relativePath = path.join('plugins', script.plugin.id, script.path);\n } else {\n source = 'config.xml';\n relativePath = path.normalize(script.path);\n }\n\n events.emit('verbose', 'Executing script found in ' + source + ' for hook \"' + context.hook + '\": ' + relativePath);\n\n const runScriptStrategy = path.extname(script.path).toLowerCase() === '.js'\n ? runScriptViaModuleLoader\n : runScriptViaChildProcessSpawn;\n\n return runScriptStrategy(script, context);\n}", "title": "" }, { "docid": "8ca61425fc74f0cd8b910f9cc036feb7", "score": "0.57542706", "text": "function _tryRequire(appRoot, moduleRoot, module) {\n\tlet lambdaStylePath = path.resolve(appRoot, moduleRoot, module);\n\tif (_canLoadAsFile(lambdaStylePath)) {\n\t\treturn require(lambdaStylePath);\n\t} else {\n\t\t// Why not just require(module)?\n\t\t// Because require() is relative to __dirname, not process.cwd(). And the\n\t\t// runtime implementation is not located in /var/task\n\t\tlet nodeStylePath = require.resolve(module, { paths: [appRoot, moduleRoot] });\n\t\treturn require(nodeStylePath);\n\t}\n}", "title": "" }, { "docid": "ea9a1789fb5721e221dc64631de03d97", "score": "0.5718633", "text": "function _tryRequire(appRoot, moduleRoot, module) {\n\tverbose(\"Try loading as commonjs: \", module, \" with paths: ,\", appRoot, moduleRoot);\n\n\tconst lambdaStylePath = path.resolve(appRoot, moduleRoot, module);\n\n\t// Extensionless files are loaded via require.\n\tconst extensionless = _tryRequireFile(lambdaStylePath);\n\tif (extensionless) {\n\t\treturn extensionless;\n\t}\n\n\t// If package.json type != module, .js files are loaded via require.\n\tconst pjHasModule = _hasPackageJsonTypeModule(lambdaStylePath);\n\tif (!pjHasModule) {\n\t\tconst loaded = _tryRequireFile(lambdaStylePath, \".js\");\n\t\tif (loaded) {\n\t\t\treturn loaded;\n\t\t}\n\t}\n\n\t// If still not loaded, try .js, .mjs, and .cjs in that order.\n\t// Files ending with .js are loaded as ES modules when the nearest parent package.json\n\t// file contains a top-level field \"type\" with a value of \"module\".\n\t// https://nodejs.org/api/packages.html#packages_type\n\tconst loaded =\n\t\t(pjHasModule && _tryAwaitImport(lambdaStylePath, \".js\")) ||\n\t\t_tryAwaitImport(lambdaStylePath, \".mjs\") ||\n\t\t_tryRequireFile(lambdaStylePath, \".cjs\");\n\tif (loaded) {\n\t\treturn loaded;\n\t}\n\n\tverbose(\"Try loading as commonjs: \", module, \" with path(s): \", appRoot, moduleRoot);\n\n\t// Why not just require(module)?\n\t// Because require() is relative to __dirname, not process.cwd(). And the\n\t// runtime implementation is not located in /var/task\n\t// This won't work (yet) for esModules as import.meta.resolve is still experimental\n\t// See: https://nodejs.org/api/esm.html#esm_import_meta_resolve_specifier_parent\n\tconst nodeStylePath = require.resolve(module, { paths: [appRoot, moduleRoot] });\n\n\treturn require(nodeStylePath);\n}", "title": "" }, { "docid": "b0f4eac275d32601a026fc298b927d86", "score": "0.5538667", "text": "function bundleScript () {\n return require('dnode/web').source()\n + ('browser/setup browser/sphere-fns browser/controls')\n .split(/\\s+/).map(function (filename) {\n var file = __dirname + '/lib/' + filename + '.js';\n var src = fs.readFileSync(file).toString()\n .replace(/^(module|exports)\\..*/mg, '')\n .replace(/^var \\S+\\s*=\\s*require\\(.*/mg, '')\n ;\n \n return src;\n }).join('\\n');\n}", "title": "" }, { "docid": "63c729c899c6cf0cae076a6fff19e9b3", "score": "0.5522922", "text": "loadScriptFromTool(context) {\n this.debug('Attempting to load script from tool');\n try {\n const script = this.tool.getPlugin('script', context.scriptName);\n context.setScript(script, script.moduleName);\n return script;\n }\n catch (error) {\n error.message = this.tool.msg('app:fromTool', { message: error.message });\n this.errors.push(error);\n return null;\n }\n }", "title": "" }, { "docid": "8dc3027355269560a4cc842abc04328c", "score": "0.5460417", "text": "function include(scriptFile) {\n debug(`Reading file ${scriptFile}...`);\n // Override the default require() function, to use script directory as base path for resolution\n const scriptDir = path.parse(scriptFile).dir;\n const context = {\n require: (module) => {\n // If gulp, use our instance.\n // This is required to be sure gulp.task() will be register on the right instance\n if (module === 'gulp' && _gulpInst)\n return _gulpInst;\n const absolutePath = require.resolve(module, { paths: [scriptDir] });\n debug(` - resolved module '${module}' => '${absolutePath}'`);\n return require(absolutePath);\n }\n };\n const script = fs.readFileSync(scriptFile, 'utf-8');\n vm.runInContext(script, vm.createContext(context));\n}", "title": "" }, { "docid": "475367a6b4f46bff7acff5e8f4e23df3", "score": "0.5445693", "text": "scriptLoader() {\n return scriptLoader\n }", "title": "" }, { "docid": "722f0879e14e355f83f4f14298c0de2c", "score": "0.5427032", "text": "function myDefaultScripts_js_example() {\n Script.include('remap-urls.js');\n\n var MAPPINGS = {\n // EXAMPLE: use a custom version of \"away.js\"\n 'system/away.js': 'file:///C:/Users/you/Desktop/myaway.js',\n \n // EXAMPLE: effectively disable handControllerPointer.js:\n 'system/controllers/handControllerPointer.js': 'file:///dev/null # handControllerPointer',\n \n // EXAMPLE: test drive dev version of handControllerGrab.js (ie: in master branch on github)\n 'system/controllers/handControllerGrab.js':\n 'https://raw.githubusercontent.com/highfidelity/hifi/master/scripts/system/controllers/handControllerGrab.js',\n };\n remapURL(MAPPINGS);\n\n\n // EXAMPLE: use the Simple Robot as a default avatar for self and others\n // (ie: when avatar is not specified this will be used as a default instead of being_of_light)\n remapURL(\n PathUtils.resourcesPath() + 'meshes/defaultAvatar_full.fst',\n 'http://mpassets.highfidelity.com/1b7e1e7c-6c0b-4f20-9cd0-1d5ccedae620-v1/bb64e937acf86447f6829767e958073c.fst'\n );\n\n // With remappings in place you can now just include the standard defaultScripts.js:\n Script.include('/~/defaultScripts.js');\n}", "title": "" }, { "docid": "d53f45f05ad54b43dc5402a1d06b0d6d", "score": "0.5404952", "text": "function require(input) {\n\tswitch (input) {\n\t\tcase '../../../server.js':\n\t\t\treturn Modules;\n\t\tdefault:\n\t\t\talert('Unknown requirement: ' + input);\n\t}\n}", "title": "" }, { "docid": "5ef78a21e2217b2a8f622478bfd5b33f", "score": "0.5392555", "text": "function loadScript(path, callback) {\r\n var script = document.createElement('script');\r\n script.onload = callback;\r\n script.src = path;\r\n document.head.appendChild(script);\r\n}", "title": "" }, { "docid": "21cc630935e0cbc9d07f36316574f15a", "score": "0.5354851", "text": "function includeServerScripts()\n{\n glob.sync( './_Server/**/*.js' ).forEach( function( file ) \n { require( path.resolve( file ) ); } );\n}", "title": "" }, { "docid": "c22533822cf44bb34b330ce67479df82", "score": "0.534139", "text": "function myRequire(url) {\r\n var ajax = new XMLHttpRequest();\r\n ajax.open('GET', url, false);\r\n ajax.onreadystatechange = function() {\r\n var script = ajax.response || ajax.responseText;\r\n if (ajax.readyState === 4) {\r\n switch(ajax.status) {\r\n case 200:\r\n eval.apply(window, [script]);\r\n console.log(\"script loaded: \", url);\r\n break;\r\n default:\r\n console.log(\"ERROR: script not loaded: \", url);\r\n }\r\n }\r\n };\r\n ajax.send(null);\r\n}", "title": "" }, { "docid": "3b23b79fb308658659cbc2cdc8ebc0ae", "score": "0.53257376", "text": "function scriptDir(loc) { return path.join(__dirname, 'Scripts', loc); }", "title": "" }, { "docid": "5fd7f1520bc0be5ddef35492bc9aad0d", "score": "0.53188777", "text": "require_config(pp, nms){\n let base = (FM.vr.is_a(pp) ? pp : [pp]).join(path.sep);\n try{\n /* loads local files as whole override of configurations.\n * This is just for singleton configuration for each environment.\n */\n let fpath = '';\n if(FM.vr.is_s(nms)){\n this.override_config([base, nms].join(path.sep), nms);\n }else if(nms instanceof RegExp){\n let mtchs = fs.readdirSync(base);\n for(let m of mtchs){\n fpath = [base, m].join(path.sep);\n let cnm = m.replace(/\\.js$/, \"\");\n let knm = null;\n\n if(!fs.lstatSync(fpath).isFile())\n continue;\n\n if(!m.match(nms))\n continue;\n\n /* if, is def configs */\n if(this.config.list.indexOf(cnm) >= 0){\n knm = cnm;\n }\n\n this.override_config(fpath, knm);\n }\n }\n else if(nms instanceof Array){\n for(let any of nms){\n this.require_config([base], any);\n }\n }\n\n return this;\n }catch(e){\n // do something\n }\n }", "title": "" }, { "docid": "126b9f7a5557ff12c3ec61347a8c11f4", "score": "0.52814335", "text": "loadInNode(path) {\n const filePath = require('path').resolve(__dirname, path);\n if ($global.decache) {\n decache(filePath);\n }\n return require(filePath);\n }", "title": "" }, { "docid": "a8ce45ca888da0d67cdd7653ad982b8f", "score": "0.5265315", "text": "function loadModules(modules, loadScriptOptions) {\n if (loadScriptOptions === void 0) { loadScriptOptions = {}; }\n if (!isLoaded()) {\n // script is not yet loaded, is it in the process of loading?\n var script = getScript();\n var src = script && script.getAttribute('src');\n if (!loadScriptOptions.url && src) {\n // script is still loading and user did not specify a URL\n // in this case we want to default to the URL that's being loaded\n // instead of defaulting to the latest 4.x URL\n loadScriptOptions.url = src;\n }\n // attempt to load the script then load the modules\n return loadScript(loadScriptOptions).then(function () { return requireModules(modules); });\n }\n else {\n // script is already loaded, just load the modules\n return requireModules(modules);\n }\n}", "title": "" }, { "docid": "a1914d6cf4f641cb379cf6b2a66e1a58", "score": "0.5261008", "text": "function loadScripts(page) {\n var SynerJ = page.window.SynerJ;\n fs.readFile('public/js/' + page.name + '.s.js', function (err, data) {\n if (!err) {\n eval(data.toString());\n }\n });\n }", "title": "" }, { "docid": "4ec32450cadd288f44a650316ea70009", "score": "0.5230065", "text": "function load_script(lib, success) {\n var head = document.getElementsByTagName(\"head\")[0];\n if (lib.head) {\n // Create a temporary element and insert the `lib.head` string to form a\n // child element.\n var tmpEl = document.createElement(\"div\");\n tmpEl.innerHTML = lib.head;\n // Append the child element to the `<head>`\n head.append(tmpEl.firstElementChild);\n }\n if (lib.url) {\n // Fetch and execute the script in the global context.\n // Then call the `success` callback.\n fetch(lib.url, {\n integrity: lib.integrity,\n referrerPolicy: \"origin\",\n })\n .then(function (response) {\n return response.text();\n })\n .then(function (txt) {\n // Eval in the global scope.\n eval?.(txt);\n })\n .then(function () {\n if (success) {\n success();\n }\n });\n }\n}", "title": "" }, { "docid": "8af5d00563d30f0fc449db51f8e003f8", "score": "0.5226527", "text": "async function load_required_scripts(server_version, container_version) {\n // expecting scripts directories to be in a semver format. e.g. ./upgrade_scripts/5.0.1\n let upgrade_dir_content = [];\n try {\n upgrade_dir_content = fs.readdirSync(upgrade_scripts_dir);\n } catch (err) {\n if (err.code === 'ENOENT') {\n dbg.warn(`upgrade scripts directory \"${upgrade_scripts_dir}\" was not found. treating it as empty`);\n } else {\n throw err;\n }\n }\n // get all dirs for versions newer than server_version\n const newer_versions = upgrade_dir_content.filter(ver =>\n version_compare(ver, server_version) > 0 &&\n version_compare(ver, container_version) <= 0)\n .sort(version_compare);\n dbg.log0(`found the following versions with upgrade scripts which are newer than server version (${server_version}):`, newer_versions);\n // get all scripts under new_versions\n const upgrade_scripts = _.flatMap(newer_versions, ver => {\n const full_path = path.join(upgrade_scripts_dir, ver);\n const scripts = fs.readdirSync(full_path);\n return scripts.map(script => path.join(full_path, script));\n });\n\n // TODO: we might want to filter out scripts that have run in a previous run of upgrade(e.g. in case of a crash)\n // for now assume that any upgrade script can be rerun safely\n\n // for each script load the js file. expecting the export to return an object in the format\n // {\n // description: 'what this upgrade script does'\n // run: run_func,\n // }\n return upgrade_scripts.map(script => ({\n ...require(script), // eslint-disable-line global-require\n file: script\n }));\n}", "title": "" }, { "docid": "3109ade411d784ba2f257c2052cf8cc1", "score": "0.52070993", "text": "loadInBrowser(path, isModule = false) {\n return new Promise((resolve, reject) => {\n window.module = {\n exports: null,\n };\n const script = document.createElement('script');\n script.src = path;\n if (isModule) {\n script.type = 'module';\n }\n script.onload = () => {\n const exported = module.exports;\n delete window.module;\n resolve(exported);\n };\n script.onerror = error => {\n reject(error);\n };\n document.head.appendChild(script);\n });\n }", "title": "" }, { "docid": "97e76c80d2d4308a6cb63ae3df4c778a", "score": "0.51579", "text": "function loadModuleSrc(mod, callback){\r\n var path = mod.i;\r\n var uri = Loader.getURI(path);\r\n\r\n if (!_script_map[uri]) {\r\n _script_map[uri] = true;\r\n \r\n loadScript(uri, callback, mod.isCSS ? 'css' : 'js'); \r\n }\r\n}", "title": "" }, { "docid": "602b67bd2f96a5eef81432d766f76c61", "score": "0.5154447", "text": "function runScript(script) {\n let src = script.getAttribute('src');\n try {\n if (src) {\n loadExternalScript(src);\n }\n if (script['firstChild']) {\n evaluate(script['firstChild'].data);\n }\n }\n catch (e) {\n Components.utils.reportError(e);\n }\n }", "title": "" }, { "docid": "a866fc69f371b899ddcb4fb09d1cdf92", "score": "0.51457804", "text": "function sourceLoader(filename, cb) {\n\n const resolvedfn = 'scripts/' + filename;\n loadFile(resolvedfn, function(status) {\n if (status.fail) {\n cb(status.fail);\n }\n else {\n const data = status.req.responseText;\n cb(null, data);\n }\n })\n\n }", "title": "" }, { "docid": "76e8469b88341b5d72e55e0c682cd5f4", "score": "0.51331073", "text": "function requireModule(partialPath){\n\tvar pathToRequire;\n\tvar nodeRequire = (ourSteal && ourSteal.config(\"nodeRequire\"))\n\t\t|| require;\n\n\tif(partialPath.indexOf(\"dev/dev.js\") !== -1) {\n\t\tpathToRequire = localStealDev;\n\t} else if(partialPath.indexOf(\"stealconfig.js\") !== -1\n\t\t\t&& !fs.existsSync(partialPath)) {\n\t\tpathToRequire = localStealConfig;\n\t} else {\n\t\tpathToRequire = partialPath;\n\t}\n\n\tif(ourSteal) {\n\t\tvar oldSteal = global.steal;\n\t\tglobal.steal = ourSteal;\n\n\t\treturn nodeRequire(pathToRequire);\n\t\tglobal.steal = oldSteal;\n\t} else {\n\t\treturn nodeRequire(pathToRequire);\n\t}\n}", "title": "" }, { "docid": "3ccdab5735491bc70821a1cd385fc2be", "score": "0.5122307", "text": "function load() {\n\n\t\tvar scripts = [],\n\t\t\tscriptsAsync = [],\n\t\t\tscriptsToPreload = 0;\n\n\t\t// Called once synchronous scripts finish loading\n\t\tfunction proceed() {\n\t\t\tif( scriptsAsync.length ) {\n\t\t\t\t// Load asynchronous scripts\n\t\t\t\thead.js.apply( null, scriptsAsync );\n\t\t\t}\n\n\t\t\tstart();\n\t\t}\n\n\t\tfunction loadScript( s ) {\n\t\t\thead.ready( s.src.match( /([\\w\\d_\\-]*)\\.?js$|[^\\\\\\/]*$/i )[0], function() {\n\t\t\t\t// Extension may contain callback functions\n\t\t\t\tif( typeof s.callback === 'function' ) {\n\t\t\t\t\ts.callback.apply( this );\n\t\t\t\t}\n\n\t\t\t\tif( --scriptsToPreload === 0 ) {\n\t\t\t\t\tproceed();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tfor( var i = 0, len = config.dependencies.length; i < len; i++ ) {\n\t\t\tvar s = config.dependencies[i];\n\n\t\t\t// Load if there's no condition or the condition is truthy\n\t\t\tif( !s.condition || s.condition() ) {\n\t\t\t\tif( s.async ) {\n\t\t\t\t\tscriptsAsync.push( s.src );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tscripts.push( s.src );\n\t\t\t\t}\n\n\t\t\t\tloadScript( s );\n\t\t\t}\n\t\t}\n\n\t\tif( scripts.length ) {\n\t\t\tscriptsToPreload = scripts.length;\n\n\t\t\t// Load synchronous scripts\n\t\t\thead.js.apply( null, scripts );\n\t\t}\n\t\telse {\n\t\t\tproceed();\n\t\t}\n\n\t}", "title": "" }, { "docid": "3ccdab5735491bc70821a1cd385fc2be", "score": "0.5122307", "text": "function load() {\n\n\t\tvar scripts = [],\n\t\t\tscriptsAsync = [],\n\t\t\tscriptsToPreload = 0;\n\n\t\t// Called once synchronous scripts finish loading\n\t\tfunction proceed() {\n\t\t\tif( scriptsAsync.length ) {\n\t\t\t\t// Load asynchronous scripts\n\t\t\t\thead.js.apply( null, scriptsAsync );\n\t\t\t}\n\n\t\t\tstart();\n\t\t}\n\n\t\tfunction loadScript( s ) {\n\t\t\thead.ready( s.src.match( /([\\w\\d_\\-]*)\\.?js$|[^\\\\\\/]*$/i )[0], function() {\n\t\t\t\t// Extension may contain callback functions\n\t\t\t\tif( typeof s.callback === 'function' ) {\n\t\t\t\t\ts.callback.apply( this );\n\t\t\t\t}\n\n\t\t\t\tif( --scriptsToPreload === 0 ) {\n\t\t\t\t\tproceed();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tfor( var i = 0, len = config.dependencies.length; i < len; i++ ) {\n\t\t\tvar s = config.dependencies[i];\n\n\t\t\t// Load if there's no condition or the condition is truthy\n\t\t\tif( !s.condition || s.condition() ) {\n\t\t\t\tif( s.async ) {\n\t\t\t\t\tscriptsAsync.push( s.src );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tscripts.push( s.src );\n\t\t\t\t}\n\n\t\t\t\tloadScript( s );\n\t\t\t}\n\t\t}\n\n\t\tif( scripts.length ) {\n\t\t\tscriptsToPreload = scripts.length;\n\n\t\t\t// Load synchronous scripts\n\t\t\thead.js.apply( null, scripts );\n\t\t}\n\t\telse {\n\t\t\tproceed();\n\t\t}\n\n\t}", "title": "" }, { "docid": "064c763836bf883af430913b8f01ad35", "score": "0.51149714", "text": "function setUpEnvironmentWithModule(module) {\r\n const head = document.querySelector('head')\r\n const script = document.createElement('script')\r\n script.type = 'module'\r\n script.src = module\r\n head.appendChild(script)\r\n}", "title": "" }, { "docid": "3cc5303f006a45011894062237ee37cd", "score": "0.5114482", "text": "function run () {\n var file = process.cwd() + '/' + BUILD_SCRIPT;\n\n fs.exists(file, function (exists) {\n if (exists) {\n // run the file\n require(file);\n }\n else {\n // build script not found.\n // try the deprecated script name 'buildify.js'\n file = process.cwd() + '/buildify.js';\n fs.exists(file, function (exists) {\n if (exists) {\n console.log('Warning: Script name \\'buildify.js\\' is deprecated, ' +\n 'use \\'' + BUILD_SCRIPT + '\\' instead.');\n\n // run the file\n require(file);\n }\n else {\n // no luck today\n console.log('Error: Build script \\'' + BUILD_SCRIPT +\n '\\' missing in current directory.');\n }\n });\n }\n });\n}", "title": "" }, { "docid": "731c3f5d349805a9aad13186c308e03c", "score": "0.5113848", "text": "function loadScript(name, sendCommand) {\n let script;\n // todo: how to tie in globals in more performant way? I know there's some array method or something unique to workers\n try {\n script = new Worker(`./scripts/${name}.js`, {});\n } catch (err) {\n console.error(\"Error launching script worker:\", err);\n }\n\n script.on(\"message\", command => {\n // when script sends command, pass to main\n try {\n sendCommand(command);\n } catch (err) {\n console.error(\"Error sending command from script to game:\", err);\n }\n })\n\n function sendTextToScript(text) {\n console.log(\"Forwarding message to script:\", text.substring(0, 15) + \"...\");\n script.postMessage({ event: \"text\", text });\n }\n\n function sendXMLeventToScript(xmlVar, detail, globals) {\n // console.log(\"Forwarding xml event to script:\", xmlVar, detail);\n script.postMessage({ event: \"xml\", xmlVar, detail, globals }); // this should work for now\n }\n\n function sendControlCommandToScript(command) {\n if (command === \"#abort\") {\n console.log('ATTEMPTING TO TERMINATE SCRIPT')\n script.terminate();\n }\n else script.postMessage({ event: \"control\", command })\n }\n\n return { sendTextToScript, sendXMLeventToScript, sendControlCommandToScript }\n}", "title": "" }, { "docid": "bbc41d602c45cb1e9c0bcf959e18ff3a", "score": "0.5109548", "text": "function require(script)\n{\n\tobjc.require_(script);\n}", "title": "" }, { "docid": "f4b19c4c851db2a2b8a6df685a232a05", "score": "0.5062002", "text": "function scriptResolve (param) {\n const verifyResult = verifyScripts(param)\n if (!verifyResult) {\n console.log(`[Error] : invalid script param : ${param}`)\n return\n }\n\n // resolve function map\n const RESOLVE_FUNC_MAP = {\n '-v' : 'version'\n }\n\n const resolveParamFuncName = scripts[RESOLVE_FUNC_MAP[param]]\n\n // call the resolve func.\n resolveParamFuncName()\n}", "title": "" }, { "docid": "1b3bad35fe56e8d7f8bb03d39ee04e2e", "score": "0.50599456", "text": "static getScriptBase() {\n var scriptSrc = JavaPoly.getScriptSrc();\n return scriptSrc.slice(0, scriptSrc.lastIndexOf(\"/\") + 1);\n }", "title": "" }, { "docid": "034605d98be9f8a98c608be4aec45500", "score": "0.50540286", "text": "_nodejsLoadAsFile(filePath) {\n return this._whenFileExists(filePath).then(\n () => filePath,\n () => {\n const jsFilePath = filePath + '.js';\n return this._whenFileExists(jsFilePath).then(\n () => jsFilePath,\n () => {\n const jsonFilePath = filePath + '.json';\n return this._whenFileExists(jsonFilePath).then(\n () => jsonFilePath\n );\n }\n );\n }\n ).then(\n p => p.replace(/\\\\/g, '/'), // normalize path\n () => {\n throw new Error(`cannot load Nodejs file for ${filePath}`)\n }\n );\n }", "title": "" }, { "docid": "891e4eb3e48e0013e923aa9482bc46fd", "score": "0.5044149", "text": "function loadScripts() {\n _getActions();\n _getScripts();\n }", "title": "" }, { "docid": "6a80d77f4f620ccf6080e217040b3eb0", "score": "0.50335735", "text": "function Config (knit) {\n\t\tvar _config = {knit:knit},\n\t\t\t/**-{ Node specific \"find a path to libs\" variables */\n\t\t\t_stack = [],\n\t\t\t_known = (typeof require.main !== 'undefined' && typeof require.main.paths !== 'undefined') ? require.main.paths.slice() : []\n\t\t\t/** }-/\n\t\tif (_known.length>0) {\n\t\t\tconsole.log(_known)\n\t\t}\n\t\t/**/\t\n\t\tthis.add = function (k,v) {\n\t\t\t_config[k]=v\n\t\t\treturn v\n\t\t}\n\t\tthis.get = function (k) {\n\t\t\tvar x = _config[k]\n\t\t\tif (typeof x === 'undefined' && k !== '') {\n\t\t\t\tvar v,m,z,o\n\t\t\t\ttry {\n\t\t\t\t\tv = require(k)\n\t\t\t\t} catch(e) {\n\t\t\t\t\there:\n\t\t\t\t\tfor (var i = 0; i < _known.length; i++) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tz = _stack.length>0 ? '/'+ _stack.join('/node_modules/')+'/node_modules':''\n\t\t\t\t\t\t\tm = _known[i]+z+'/'+k\n\t\t\t\t\t\t\to = _stack.pop()\n\t\t\t\t\t\t\tif (typeof o !== 'undefined' && o !== k) _stack.push(o)\n\t\t\t\t\t\t\t_stack.push(k)\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tv = require(m) // will throw if \n\t\t\t\t\t\t\t_known.push(m+'/node_modules')\n\t\t\t\t\t\t\t_stack.pop()\n\t\t\t\t\t\t\tbreak here;\n\t\t\t\t\t\t} catch(e) {\n\t\t\t\t\t\t\t//console.error(e)\n\t\t\t\t\t\t\t_stack.pop()\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!v) console.warn(\"%s not found\",k)\n\t\t\t\t}\n\t\t\t\tx = this.add(k, v)\n\t\t\t}\n\t\t\tif (x instanceof Binder) return x.get()\n\t\t\telse return x\n\t\t}\n\t\tthis.parse = function (conf) {\n\t\t\tswitch (typeof conf) {\n\t\t\tcase 'string':\n\t\t\t\t// find a file to load js or json\n\t\t\t\tbreak\n\t\t\tcase 'function': \n\t\t\t\tvar that = this\n\t\t\t\tconf(function (k) {\n\t\t\t\t\tswitch (typeof k) {\n\t\t\t\t\tcase 'string':\n\t\t\t\t\t\treturn that.add(k, new Binder(knit))\n\t\t\t\t\tcase 'function':\n\t\t\t\t\t\tvar b = new Binder(knit).is('constructor')\n\t\t\t\t\t\tku.scan_fun(k, function(_0,_1,_2) {\n\t\t\t\t\t\t\tif (_1.length>0) that.add(_1,b.to(k))\n\t\t\t\t\t\t\telse b=undefined\n\t\t\t\t\t\t})\n\t\t\t\t\t\treturn b\n\t\t\t\t\tdefault:\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tbreak\n\t\t\tcase 'object':\t\t\t\n\t\t\t\tfor (var k in conf)\n\t\t\t\t\tthis.add(k, conf[k])\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tthis.toString = function () {\n\t\t\tvar str = '{\\n'\n\t\t\tfor (var u in _config) {\n\t\t\t\tstr += ' ' +u + ': ' + ku.asString(_config[u]) + ',\\n'\n\t\t\t}\n\t\t\tstr.substring(0,str.length-1)\n\t\t\tstr += '}'\n\t\t\treturn str\n\t\t}\n\t}", "title": "" }, { "docid": "e39f6b7c53cca54ee13e0baf324b7eb1", "score": "0.50224787", "text": "function _main(runnerpath, _scriptpath, args, exit, host) {\n return (async () => {\n let realpath, cwd, read;\n if (host === 'deno') {\n realpath = Deno.realpathSync;\n cwd = Deno.cwd;\n const decoder = new TextDecoder('utf-8');\n read = function (p) {\n return decoder.decode(Deno.readFileSync(p));\n }\n } else {\n const fs = await import('fs');\n const path = await import('path');\n realpath = path.resolve;\n cwd = process.cwd;\n read = function (p) {\n return fs.readFileSync(path.normalize(p), 'utf8');\n }\n }\n const scriptpath = realpath(_scriptpath);\n const client = await import(scriptpath);\n const { opts, usage, validate, main } = client;\n opts.unknown = function(o) { if (o.startsWith('-')) { usage(scriptpath); return exit(1); }};\n const processedOpts = parseOptions(args, opts);\n const files = processedOpts._;\n delete processedOpts._;\n if (!validate(processedOpts, files)) {\n usage(scriptpath);\n return exit(1);\n }\n return main(processedOpts, files, {read, exit, realpath, cwd: cwd(), host, script: scriptpath});\n })();\n}", "title": "" }, { "docid": "bb725edf910088c76cf23a258cbad7bb", "score": "0.500327", "text": "function _startup() {\n _loadScriptConfiguration();\n require(_startupScripts, function(startupObjects) {\n each(_deferredScripts, function(name) {\n _downloadScript(name);\n });\n });\n }", "title": "" }, { "docid": "dc8c9a9fb78a91c0b2001973f130c91b", "score": "0.50005627", "text": "function loadScript(path) {\t\n\t\t$.ajax({\n\t\t\turl: path + \".js\",\n\t\t\tcache: false,\n\t\t\ttype: \"GET\",\n\t\t\tdataType: \"script\"\n\t\t});\n\t}", "title": "" }, { "docid": "c1f433e293f5dd43bb33cbcce90b606c", "score": "0.49956802", "text": "pickScript () {\n\n // Search script\n let scripts = this.contents.match (/(<script.*<\\/script>)/gi) || [];\n\n scripts.forEach (sc => {\n\n // <script shared src=\"*.js\">\n if (sc.indexOf (' shared ') >= 0 ||\n\n // <script src=\"*.js\" shared>\n sc.indexOf (' shared>') >= 0 ||\n\n // <script src=\"*.js\" shared=\"true\">\n sc.indexOf ('shared=\"true\"') >= 0 ||\n\n // <script src=\"*.js\" shared='true'>\n sc.indexOf (\"shared='true'\") >= 0 ||\n\n // <script src=\"*.js\" shared=true>\n sc.indexOf ('shared=true') >= 0) {\n\n\n let [, file] = sc.match (/src=(\".*\"|'.*'|[^ >]*)/im) || [, null];\n\n\n if (file) {\n\n // Remove ' & \"\n file = file.replace (/['\"]/ig, '');\n\n let scriptFileName = path.basename (file)\n , mixedFileName = this.name.toLowerCase ().replace(/[\\/ ]/ig, '-') + '-' + scriptFileName\n\n , sharedPublicPath = `.shared/`\n , sharedSystemPath = `src/.shared/`\n\n // Script path relative to public directory\n , filePublicPath = file\n , mixedPublicPath = `${sharedPublicPath}${mixedFileName}`\n\n // Script path relative to parcel - bundler directory\n , fileSystemPath = `src/${filePublicPath}`\n , mixedSystemPath = `src/${mixedPublicPath}`\n\n // Load shared script content\n , code = fs.readFileSync (fileSystemPath, 'utf8')\n\n // new <script> element string\n , nsc = sc\n ;\n\n // check if .shared exists\n if (! fs.existsSync (sharedSystemPath))\n fs.mkdirSync (sharedSystemPath);\n\n // write into new file\n fs.writeFileSync (mixedSystemPath, code.replace (/ \".\\//g, ' \"./../'));\n\n // replace src in <script> tag\n nsc = sc.replace (filePublicPath, mixedPublicPath);\n\n // replace <script> tag in content\n this.contents = this.contents.replace (sc, nsc);\n }\n }\n });\n }", "title": "" }, { "docid": "ecf4495518ea50155e743822f9b55447", "score": "0.49920776", "text": "function loadScript(fileName, callback) {\n let script = document.createElement(\"script\");\n script.type = \"text/javascript\";\n\n // IE detect script done\n if (script.readyState) {\n script.onreadystatechange = function() {\n if (script.readyState == \"loaded\") {\n script.readyState == \"loaded\";\n script.onreadystatechange = null;\n callback();\n }\n }\n }\n // All other browsers detect script done\n else {\n script.onload = function() {\n callback();\n }\n }\n\n script.src = \"scripts/\" + fileName;\n document.getElementsByTagName(\"head\")[0].append(script);\n}", "title": "" }, { "docid": "5b45b0b1f529d48e6e35e6bfca1f21a7", "score": "0.49877664", "text": "function loadApp() {\n const files = glob.sync(path.join(__dirname, 'main-process/*.js'))\n files.forEach((file) => { require(file) })\n}", "title": "" }, { "docid": "546a713773d733cd39bd3489ea9eb741", "score": "0.49856436", "text": "function loadScript(src, loading) {\n let script = document.createElement('script')\n script.src = src\n if (loading == 'async') {\n script.async = true\n }\n if (loading == 'defer') {\n script.defer = true\n }\n document.body.append(script)\n}", "title": "" }, { "docid": "06296c009858174dc96f61a76f8aa056", "score": "0.49835753", "text": "require() {}", "title": "" }, { "docid": "bffe7f429f953289ba560576c4f73c7f", "score": "0.49680516", "text": "function loadScript(options) {\n if (options === void 0) { options = {}; }\n // URL to load\n var version = options.version;\n var url = options.url || getCdnUrl(version);\n return new utils.Promise(function (resolve, reject) {\n var script = getScript();\n if (script) {\n // the API is already loaded or in the process of loading...\n // NOTE: have to test against scr attribute value, not script.src\n // b/c the latter will return the full url for relative paths\n var src = script.getAttribute('src');\n if (src !== url) {\n // potentially trying to load a different version of the API\n reject(new Error(\"The ArcGIS API for JavaScript is already loaded (\" + src + \").\"));\n }\n else {\n if (isLoaded()) {\n // the script has already successfully loaded\n resolve(script);\n }\n else {\n // wait for the script to load and then resolve\n handleScriptLoad(script, resolve, reject);\n }\n }\n }\n else {\n if (isLoaded()) {\n // the API has been loaded by some other means\n // potentially trying to load a different version of the API\n reject(new Error(\"The ArcGIS API for JavaScript is already loaded.\"));\n }\n else {\n // this is the first time attempting to load the API\n var css = options.css;\n if (css) {\n var useVersion = css === true;\n // load the css before loading the script\n loadCss(useVersion ? version : css, options.insertCssBefore);\n }\n if (options.dojoConfig) {\n // set dojo configuration parameters before loading the script\n window['dojoConfig'] = options.dojoConfig;\n }\n // create a script object whose source points to the API\n script = createScript(url);\n // _currentUrl = url;\n // once the script is loaded...\n handleScriptLoad(script, function () {\n // update the status of the script\n script.setAttribute('data-esri-loader', 'loaded');\n // return the script\n resolve(script);\n }, reject);\n // load the script\n document.body.appendChild(script);\n }\n }\n });\n}", "title": "" }, { "docid": "57ed49b533d19245764dc319ae37d76f", "score": "0.4962642", "text": "function requireScript(src) {\n return new Promise(function (resolve, reject) {\n if (src in _importedScript) {\n resolve();\n return;\n }\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = src;\n // 加载失败\n script.onerror = function (err) {\n headElement.removeChild(script);\n reject(new URIError(\"The Script \" + src + \" is no accessible.\"));\n };\n // 加载成功\n if (isImplementedOnload(script)) {\n // Firefox, Safari, Chrome, and Opera\n script.onload = function () {\n _importedScript[src] = true;\n resolve();\n };\n }\n else {\n // IE\n script.onreadystatechange = function () {\n if (script.readyState == 'loaded' || script.readyState == 'complete') {\n script.onreadystatechange = null;\n _importedScript[src] = true;\n resolve();\n }\n };\n }\n headElement.appendChild(script);\n });\n}", "title": "" }, { "docid": "fdbd945f63256174254b51844b97587c", "score": "0.496097", "text": "function initAgainstTheClock() {\n\n // load appropriate script\n $.getScript(\"../../Scripts/Overrides/againstTheClock.min.js\");\n}", "title": "" }, { "docid": "0efe6018a52338c81e9a71c05280bf85", "score": "0.4941169", "text": "function importJS(str){\r\n head = document.getElementsByTagName(\"head\")[0]\r\n var node = document.createElement(\"script\")\r\n node.src=\"JS/\"+str\r\n head.insertBefore(node, head.firstChild)\r\n}", "title": "" }, { "docid": "951f012e4ed5dc33b5c9e22a290ed48a", "score": "0.49384856", "text": "function loadModule(mod) {\n // Check if its already loaded\n if(mod in _modules) {\n console.log(\"This module is already loaded!\");\n return;\n }\n\n // Get absolute path for the module\n var ppath = path.resolve(\"./modules/\"+mod+\".js\");\n // Base config object\n var config = {};\n\n // Check if the file exists\n if (!fs.existsSync(ppath)) {\n console.log(\"That module doesn't exist!\");\n return;\n }\n\n // Being loading\n try{\n // Loads module\n var module = require(ppath);\n // Deletes module script from cache (We don't want it to cache modules!)\n if(require.cache && require.cache[ppath])\n delete require.cache[ppath];\n\n // If the require fails, cancel\n if(!module) {\n console.log(\"Loading module \"+mod+\" failed!\");\n return;\n }\n // If the module script exists (Double check!)\n if(module === _modules[mod])\n return;\n // If the module has defined confugration for it in settings, load that in.\n if(mod in bot.settings.modules)\n config = bot.settings.modules[mod];\n // Initiate loading and save it\n module.load(mod, bot, config);\n module.starttime = Date();\n _modules[mod] = module;\n } catch(err) {\n mylog(\"An error occured while trying to load \"+mod+\"!\");\n console.log(err);\n mylog(\"Please try reloading it.\");\n }\n}", "title": "" }, { "docid": "1ef421495b17e19a989a2fe38401f7de", "score": "0.49346817", "text": "function loadScript() {\n\tvar script = document.createElement('script');\n\tscript.type = 'text/javascript';\n\tscript.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&' +\n\t'callback=initialize&libraries=visualization';\n\tdocument.body.appendChild(script);\n\n\tvar script_cluster = document.createElement('script');\n\tscript_cluster.type = 'text/javascript';\n\tscript_cluster.src = 'https://cdn.rawgit.com/googlemaps/js-marker-clusterer/gh-pages/src/markerclusterer.js';\n\tdocument.body.appendChild(script_cluster);\n}", "title": "" }, { "docid": "9867c907ee91f91a5762efd4ad52cb86", "score": "0.4930254", "text": "function loadUtil(filename) {\n if (!filename) {\n return \"\"\n }\n\n var file = require(obj[filename] + \".js\")\n return file;\n}", "title": "" }, { "docid": "ae48cbf9078f9fb84b7311cf86701829", "score": "0.49235493", "text": "function loadConfiguration(callback) {\n logger.info('Loading config file');\n var path = require('path');\n var configPath = path.join(process.cwd(), 'puerFConfig.js');\n var options = require(configPath);\n runPuerF(options, callback);\n}", "title": "" }, { "docid": "4fa445d586fac1ca54694c8516f6c0b7", "score": "0.4911761", "text": "_loadModules(cmdPath, modules) {\n const stat = fs.lstatSync(cmdPath)\n\n if (stat.isDirectory()) {\n // we have a directory: do a tree walk\n const files = fs.readdirSync(cmdPath);\n\n var f, l = files.length;\n\n for (var i = 0; i < l; i++) {\n f = path.join(cmdPath, files[i]);\n this._loadModules(f, modules);\n }\n } else {\n // we have a file: load it\n if (!(cmdPath.indexOf('index.js') > -1)) {\n modules.push(require(cmdPath)) // eslint-disable-line global-require\n }\n }\n }", "title": "" }, { "docid": "fbbdcb98cb94b8e650e660c0860b7ee2", "score": "0.49055734", "text": "function loadScript (resource) {\n document.write('<script src=\"' + resource + '\"></script>');\n }", "title": "" }, { "docid": "fbbdcb98cb94b8e650e660c0860b7ee2", "score": "0.49055734", "text": "function loadScript (resource) {\n document.write('<script src=\"' + resource + '\"></script>');\n }", "title": "" }, { "docid": "90205f21399c10243a2f1179498350b0", "score": "0.4897948", "text": "function commandLoadConfig() {\r\n CONFIG = require(configFilePath);\r\n logger.log(`config loadded from '${configFilePath}'`);\r\n}", "title": "" }, { "docid": "c8ee68e3cd84a3c4fd62566b6857c238", "score": "0.48930073", "text": "function loadLib() {\n /**\n * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint strict: false */\n/*global Packages: false, process: false, window: false, navigator: false,\n document: false, define: false */\n\n/**\n * A plugin that modifies any /env/ path to be the right path based on\n * the host environment. Right now only works for Node, Rhino and browser.\n */\n(function () {\n var pathRegExp = /(\\/|^)env\\/|\\{env\\}/,\n env = 'unknown';\n\n if (typeof process !== 'undefined' && process.versions && !!process.versions.node) {\n env = 'node';\n } else if (typeof Packages !== 'undefined') {\n env = 'rhino';\n } else if ((typeof navigator !== 'undefined' && typeof document !== 'undefined') ||\n (typeof importScripts !== 'undefined' && typeof self !== 'undefined')) {\n env = 'browser';\n } else if (typeof Components !== 'undefined' && Components.classes && Components.interfaces) {\n env = 'xpconnect';\n }\n\n define('env', {\n get: function () {\n return env;\n },\n\n load: function (name, req, load, config) {\n //Allow override in the config.\n if (config.env) {\n env = config.env;\n }\n\n name = name.replace(pathRegExp, function (match, prefix) {\n if (match.indexOf('{') === -1) {\n return prefix + env + '/';\n } else {\n return env;\n }\n });\n\n req([name], function (mod) {\n load(mod);\n });\n }\n });\n}());\n/**\n * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint plusplus: true */\n/*global define, java */\n\ndefine('lang', function () {\n 'use strict';\n\n var lang, isJavaObj,\n hasOwn = Object.prototype.hasOwnProperty;\n\n function hasProp(obj, prop) {\n return hasOwn.call(obj, prop);\n }\n\n isJavaObj = function () {\n return false;\n };\n\n if (typeof java !== 'undefined' && java.lang && java.lang.Object) {\n isJavaObj = function (obj) {\n return obj instanceof java.lang.Object;\n };\n }\n\n lang = {\n backSlashRegExp: /\\\\/g,\n ostring: Object.prototype.toString,\n\n isArray: Array.isArray || function (it) {\n return lang.ostring.call(it) === \"[object Array]\";\n },\n\n isFunction: function(it) {\n return lang.ostring.call(it) === \"[object Function]\";\n },\n\n isRegExp: function(it) {\n return it && it instanceof RegExp;\n },\n\n hasProp: hasProp,\n\n //returns true if the object does not have an own property prop,\n //or if it does, it is a falsy value.\n falseProp: function (obj, prop) {\n return !hasProp(obj, prop) || !obj[prop];\n },\n\n //gets own property value for given prop on object\n getOwn: function (obj, prop) {\n return hasProp(obj, prop) && obj[prop];\n },\n\n _mixin: function(dest, source, override){\n var name;\n for (name in source) {\n if(source.hasOwnProperty(name) &&\n (override || !dest.hasOwnProperty(name))) {\n dest[name] = source[name];\n }\n }\n\n return dest; // Object\n },\n\n /**\n * mixin({}, obj1, obj2) is allowed. If the last argument is a boolean,\n * then the source objects properties are force copied over to dest.\n */\n mixin: function(dest){\n var parameters = Array.prototype.slice.call(arguments),\n override, i, l;\n\n if (!dest) { dest = {}; }\n\n if (parameters.length > 2 && typeof arguments[parameters.length-1] === 'boolean') {\n override = parameters.pop();\n }\n\n for (i = 1, l = parameters.length; i < l; i++) {\n lang._mixin(dest, parameters[i], override);\n }\n return dest; // Object\n },\n\n /**\n * Does a deep mix of source into dest, where source values override\n * dest values if a winner is needed.\n * @param {Object} dest destination object that receives the mixed\n * values.\n * @param {Object} source source object contributing properties to mix\n * in.\n * @return {[Object]} returns dest object with the modification.\n */\n deepMix: function(dest, source) {\n lang.eachProp(source, function (value, prop) {\n if (typeof value === 'object' && value &&\n !lang.isArray(value) && !lang.isFunction(value) &&\n !(value instanceof RegExp)) {\n\n if (!dest[prop]) {\n dest[prop] = {};\n }\n lang.deepMix(dest[prop], value);\n } else {\n dest[prop] = value;\n }\n });\n return dest;\n },\n\n /**\n * Does a type of deep copy. Do not give it anything fancy, best\n * for basic object copies of objects that also work well as\n * JSON-serialized things, or has properties pointing to functions.\n * For non-array/object values, just returns the same object.\n * @param {Object} obj copy properties from this object\n * @param {Object} [result] optional result object to use\n * @return {Object}\n */\n deeplikeCopy: function (obj) {\n var type, result;\n\n if (lang.isArray(obj)) {\n result = [];\n obj.forEach(function(value) {\n result.push(lang.deeplikeCopy(value));\n });\n return result;\n }\n\n type = typeof obj;\n if (obj === null || obj === undefined || type === 'boolean' ||\n type === 'string' || type === 'number' || lang.isFunction(obj) ||\n lang.isRegExp(obj)|| isJavaObj(obj)) {\n return obj;\n }\n\n //Anything else is an object, hopefully.\n result = {};\n lang.eachProp(obj, function(value, key) {\n result[key] = lang.deeplikeCopy(value);\n });\n return result;\n },\n\n delegate: (function () {\n // boodman/crockford delegation w/ cornford optimization\n function TMP() {}\n return function (obj, props) {\n TMP.prototype = obj;\n var tmp = new TMP();\n TMP.prototype = null;\n if (props) {\n lang.mixin(tmp, props);\n }\n return tmp; // Object\n };\n }()),\n\n /**\n * Helper function for iterating over an array. If the func returns\n * a true value, it will break out of the loop.\n */\n each: function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (func(ary[i], i, ary)) {\n break;\n }\n }\n }\n },\n\n /**\n * Cycles over properties in an object and calls a function for each\n * property value. If the function returns a truthy value, then the\n * iteration is stopped.\n */\n eachProp: function eachProp(obj, func) {\n var prop;\n for (prop in obj) {\n if (hasProp(obj, prop)) {\n if (func(obj[prop], prop)) {\n break;\n }\n }\n }\n },\n\n //Similar to Function.prototype.bind, but the \"this\" object is specified\n //first, since it is easier to read/figure out what \"this\" will be.\n bind: function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n },\n\n //Escapes a content string to be be a string that has characters escaped\n //for inclusion as part of a JS string.\n jsEscape: function (content) {\n return content.replace(/([\"'\\\\])/g, '\\\\$1')\n .replace(/[\\f]/g, \"\\\\f\")\n .replace(/[\\b]/g, \"\\\\b\")\n .replace(/[\\n]/g, \"\\\\n\")\n .replace(/[\\t]/g, \"\\\\t\")\n .replace(/[\\r]/g, \"\\\\r\");\n }\n };\n return lang;\n});\n/**\n * prim 0.0.1 Copyright (c) 2012-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/requirejs/prim for details\n */\n\n/*global setImmediate, process, setTimeout, define, module */\n\n//Set prime.hideResolutionConflict = true to allow \"resolution-races\"\n//in promise-tests to pass.\n//Since the goal of prim is to be a small impl for trusted code, it is\n//more important to normally throw in this case so that we can find\n//logic errors quicker.\n\nvar prim;\n(function () {\n 'use strict';\n var op = Object.prototype,\n hasOwn = op.hasOwnProperty;\n\n function hasProp(obj, prop) {\n return hasOwn.call(obj, prop);\n }\n\n /**\n * Helper function for iterating over an array. If the func returns\n * a true value, it will break out of the loop.\n */\n function each(ary, func) {\n if (ary) {\n var i;\n for (i = 0; i < ary.length; i += 1) {\n if (ary[i]) {\n func(ary[i], i, ary);\n }\n }\n }\n }\n\n function check(p) {\n if (hasProp(p, 'e') || hasProp(p, 'v')) {\n if (!prim.hideResolutionConflict) {\n throw new Error('nope');\n }\n return false;\n }\n return true;\n }\n\n function notify(ary, value) {\n prim.nextTick(function () {\n each(ary, function (item) {\n item(value);\n });\n });\n }\n\n prim = function prim() {\n var p,\n ok = [],\n fail = [];\n\n return (p = {\n callback: function (yes, no) {\n if (no) {\n p.errback(no);\n }\n\n if (hasProp(p, 'v')) {\n prim.nextTick(function () {\n yes(p.v);\n });\n } else {\n ok.push(yes);\n }\n },\n\n errback: function (no) {\n if (hasProp(p, 'e')) {\n prim.nextTick(function () {\n no(p.e);\n });\n } else {\n fail.push(no);\n }\n },\n\n finished: function () {\n return hasProp(p, 'e') || hasProp(p, 'v');\n },\n\n rejected: function () {\n return hasProp(p, 'e');\n },\n\n resolve: function (v) {\n if (check(p)) {\n p.v = v;\n notify(ok, v);\n }\n return p;\n },\n reject: function (e) {\n if (check(p)) {\n p.e = e;\n notify(fail, e);\n }\n return p;\n },\n\n start: function (fn) {\n p.resolve();\n return p.promise.then(fn);\n },\n\n promise: {\n then: function (yes, no) {\n var next = prim();\n\n p.callback(function (v) {\n try {\n if (yes && typeof yes === 'function') {\n v = yes(v);\n }\n\n if (v && v.then) {\n v.then(next.resolve, next.reject);\n } else {\n next.resolve(v);\n }\n } catch (e) {\n next.reject(e);\n }\n }, function (e) {\n var err;\n\n try {\n if (!no || typeof no !== 'function') {\n next.reject(e);\n } else {\n err = no(e);\n\n if (err && err.then) {\n err.then(next.resolve, next.reject);\n } else {\n next.resolve(err);\n }\n }\n } catch (e2) {\n next.reject(e2);\n }\n });\n\n return next.promise;\n },\n\n fail: function (no) {\n return p.promise.then(null, no);\n },\n\n end: function () {\n p.errback(function (e) {\n throw e;\n });\n }\n }\n });\n };\n\n prim.serial = function (ary) {\n var result = prim().resolve().promise;\n each(ary, function (item) {\n result = result.then(function () {\n return item();\n });\n });\n return result;\n };\n\n prim.nextTick = typeof setImmediate === 'function' ? setImmediate :\n (typeof process !== 'undefined' && process.nextTick ?\n process.nextTick : (typeof setTimeout !== 'undefined' ?\n function (fn) {\n setTimeout(fn, 0);\n } : function (fn) {\n fn();\n }));\n\n if (typeof define === 'function' && define.amd) {\n define('prim', function () { return prim; });\n } else if (typeof module !== 'undefined' && module.exports) {\n module.exports = prim;\n }\n}());\nif(env === 'browser') {\n/**\n * @license RequireJS Copyright (c) 2012-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint strict: false */\n/*global define: false, load: false */\n\n//Just a stub for use with uglify's consolidator.js\ndefine('browser/assert', function () {\n return {};\n});\n\n}\n\nif(env === 'node') {\n/**\n * @license RequireJS Copyright (c) 2012-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint strict: false */\n/*global define: false, load: false */\n\n//Needed so that rhino/assert can return a stub for uglify's consolidator.js\ndefine('node/assert', ['assert'], function (assert) {\n return assert;\n});\n\n}\n\nif(env === 'rhino') {\n/**\n * @license RequireJS Copyright (c) 2013-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint strict: false */\n/*global define: false, load: false */\n\n//Just a stub for use with uglify's consolidator.js\ndefine('rhino/assert', function () {\n return {};\n});\n\n}\n\nif(env === 'xpconnect') {\n/**\n * @license RequireJS Copyright (c) 2013-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint strict: false */\n/*global define: false, load: false */\n\n//Just a stub for use with uglify's consolidator.js\ndefine('xpconnect/assert', function () {\n return {};\n});\n\n}\n\nif(env === 'browser') {\n/**\n * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint strict: false */\n/*global define: false, process: false */\n\ndefine('browser/args', function () {\n //Always expect config via an API call\n return [];\n});\n\n}\n\nif(env === 'node') {\n/**\n * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint strict: false */\n/*global define: false, process: false */\n\ndefine('node/args', function () {\n //Do not return the \"node\" or \"r.js\" arguments\n var args = process.argv.slice(2);\n\n //Ignore any command option used for main x.js branching\n if (args[0] && args[0].indexOf('-') === 0) {\n args = args.slice(1);\n }\n\n return args;\n});\n\n}\n\nif(env === 'rhino') {\n/**\n * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint strict: false */\n/*global define: false, process: false */\n\nvar jsLibRhinoArgs = (typeof rhinoArgs !== 'undefined' && rhinoArgs) || [].concat(Array.prototype.slice.call(arguments, 0));\n\ndefine('rhino/args', function () {\n var args = jsLibRhinoArgs;\n\n //Ignore any command option used for main x.js branching\n if (args[0] && args[0].indexOf('-') === 0) {\n args = args.slice(1);\n }\n\n return args;\n});\n\n}\n\nif(env === 'xpconnect') {\n/**\n * @license Copyright (c) 2013-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint strict: false */\n/*global define, xpconnectArgs */\n\nvar jsLibXpConnectArgs = (typeof xpconnectArgs !== 'undefined' && xpconnectArgs) || [].concat(Array.prototype.slice.call(arguments, 0));\n\ndefine('xpconnect/args', function () {\n var args = jsLibXpConnectArgs;\n\n //Ignore any command option used for main x.js branching\n if (args[0] && args[0].indexOf('-') === 0) {\n args = args.slice(1);\n }\n\n return args;\n});\n\n}\n\nif(env === 'browser') {\n/**\n * @license RequireJS Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint strict: false */\n/*global define: false, console: false */\n\ndefine('browser/load', ['./file'], function (file) {\n function load(fileName) {\n eval(file.readFile(fileName));\n }\n\n return load;\n});\n\n}\n\nif(env === 'node') {\n/**\n * @license RequireJS Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint strict: false */\n/*global define: false, console: false */\n\ndefine('node/load', ['fs'], function (fs) {\n function load(fileName) {\n var contents = fs.readFileSync(fileName, 'utf8');\n process.compile(contents, fileName);\n }\n\n return load;\n});\n\n}\n\nif(env === 'rhino') {\n/**\n * @license RequireJS Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint strict: false */\n/*global define: false, load: false */\n\ndefine('rhino/load', function () {\n return load;\n});\n\n}\n\nif(env === 'xpconnect') {\n/**\n * @license RequireJS Copyright (c) 2013-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint strict: false */\n/*global define: false, load: false */\n\ndefine('xpconnect/load', function () {\n return load;\n});\n\n}\n\nif(env === 'browser') {\n/**\n * @license Copyright (c) 2012-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint sloppy: true, nomen: true */\n/*global require, define, console, XMLHttpRequest, requirejs, location */\n\ndefine('browser/file', ['prim'], function (prim) {\n\n var file,\n currDirRegExp = /^\\.(\\/|$)/;\n\n function frontSlash(path) {\n return path.replace(/\\\\/g, '/');\n }\n\n function exists(path) {\n var status, xhr = new XMLHttpRequest();\n\n //Oh yeah, that is right SYNC IO. Behold its glory\n //and horrible blocking behavior.\n xhr.open('HEAD', path, false);\n xhr.send();\n status = xhr.status;\n\n return status === 200 || status === 304;\n }\n\n function mkDir(dir) {\n console.log('mkDir is no-op in browser');\n }\n\n function mkFullDir(dir) {\n console.log('mkFullDir is no-op in browser');\n }\n\n file = {\n backSlashRegExp: /\\\\/g,\n exclusionRegExp: /^\\./,\n getLineSeparator: function () {\n return '/';\n },\n\n exists: function (fileName) {\n return exists(fileName);\n },\n\n parent: function (fileName) {\n var parts = fileName.split('/');\n parts.pop();\n return parts.join('/');\n },\n\n /**\n * Gets the absolute file path as a string, normalized\n * to using front slashes for path separators.\n * @param {String} fileName\n */\n absPath: function (fileName) {\n var dir;\n if (currDirRegExp.test(fileName)) {\n dir = frontSlash(location.href);\n if (dir.indexOf('/') !== -1) {\n dir = dir.split('/');\n\n //Pull off protocol and host, just want\n //to allow paths (other build parts, like\n //require._isSupportedBuildUrl do not support\n //full URLs), but a full path from\n //the root.\n dir.splice(0, 3);\n\n dir.pop();\n dir = '/' + dir.join('/');\n }\n\n fileName = dir + fileName.substring(1);\n }\n\n return fileName;\n },\n\n normalize: function (fileName) {\n return fileName;\n },\n\n isFile: function (path) {\n return true;\n },\n\n isDirectory: function (path) {\n return false;\n },\n\n getFilteredFileList: function (startDir, regExpFilters, makeUnixPaths) {\n console.log('file.getFilteredFileList is no-op in browser');\n },\n\n copyDir: function (srcDir, destDir, regExpFilter, onlyCopyNew) {\n console.log('file.copyDir is no-op in browser');\n\n },\n\n copyFile: function (srcFileName, destFileName, onlyCopyNew) {\n console.log('file.copyFile is no-op in browser');\n },\n\n /**\n * Renames a file. May fail if \"to\" already exists or is on another drive.\n */\n renameFile: function (from, to) {\n console.log('file.renameFile is no-op in browser');\n },\n\n /**\n * Reads a *text* file.\n */\n readFile: function (path, encoding) {\n var xhr = new XMLHttpRequest();\n\n //Oh yeah, that is right SYNC IO. Behold its glory\n //and horrible blocking behavior.\n xhr.open('GET', path, false);\n xhr.send();\n\n return xhr.responseText;\n },\n\n readFileAsync: function (path, encoding) {\n var xhr = new XMLHttpRequest(),\n d = prim();\n\n xhr.open('GET', path, true);\n xhr.send();\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n if (xhr.status > 400) {\n d.reject(new Error('Status: ' + xhr.status + ': ' + xhr.statusText));\n } else {\n d.resolve(xhr.responseText);\n }\n }\n };\n\n return d.promise;\n },\n\n saveUtf8File: function (fileName, fileContents) {\n //summary: saves a *text* file using UTF-8 encoding.\n file.saveFile(fileName, fileContents, \"utf8\");\n },\n\n saveFile: function (fileName, fileContents, encoding) {\n requirejs.browser.saveFile(fileName, fileContents, encoding);\n },\n\n deleteFile: function (fileName) {\n console.log('file.deleteFile is no-op in browser');\n },\n\n /**\n * Deletes any empty directories under the given directory.\n */\n deleteEmptyDirs: function (startDir) {\n console.log('file.deleteEmptyDirs is no-op in browser');\n }\n };\n\n return file;\n\n});\n\n}\n\nif(env === 'node') {\n/**\n * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint plusplus: false, octal:false, strict: false */\n/*global define: false, process: false */\n\ndefine('node/file', ['fs', 'path', 'prim'], function (fs, path, prim) {\n\n var isWindows = process.platform === 'win32',\n windowsDriveRegExp = /^[a-zA-Z]\\:\\/$/,\n file;\n\n function frontSlash(path) {\n return path.replace(/\\\\/g, '/');\n }\n\n function exists(path) {\n if (isWindows && path.charAt(path.length - 1) === '/' &&\n path.charAt(path.length - 2) !== ':') {\n path = path.substring(0, path.length - 1);\n }\n\n try {\n fs.statSync(path);\n return true;\n } catch (e) {\n return false;\n }\n }\n\n function mkDir(dir) {\n if (!exists(dir) && (!isWindows || !windowsDriveRegExp.test(dir))) {\n fs.mkdirSync(dir, 511);\n }\n }\n\n function mkFullDir(dir) {\n var parts = dir.split('/'),\n currDir = '',\n first = true;\n\n parts.forEach(function (part) {\n //First part may be empty string if path starts with a slash.\n currDir += part + '/';\n first = false;\n\n if (part) {\n mkDir(currDir);\n }\n });\n }\n\n file = {\n backSlashRegExp: /\\\\/g,\n exclusionRegExp: /^\\./,\n getLineSeparator: function () {\n return '/';\n },\n\n exists: function (fileName) {\n return exists(fileName);\n },\n\n parent: function (fileName) {\n var parts = fileName.split('/');\n parts.pop();\n return parts.join('/');\n },\n\n /**\n * Gets the absolute file path as a string, normalized\n * to using front slashes for path separators.\n * @param {String} fileName\n */\n absPath: function (fileName) {\n return frontSlash(path.normalize(frontSlash(fs.realpathSync(fileName))));\n },\n\n normalize: function (fileName) {\n return frontSlash(path.normalize(fileName));\n },\n\n isFile: function (path) {\n return fs.statSync(path).isFile();\n },\n\n isDirectory: function (path) {\n return fs.statSync(path).isDirectory();\n },\n\n getFilteredFileList: function (/*String*/startDir, /*RegExp*/regExpFilters, /*boolean?*/makeUnixPaths) {\n //summary: Recurses startDir and finds matches to the files that match regExpFilters.include\n //and do not match regExpFilters.exclude. Or just one regexp can be passed in for regExpFilters,\n //and it will be treated as the \"include\" case.\n //Ignores files/directories that start with a period (.) unless exclusionRegExp\n //is set to another value.\n var files = [], topDir, regExpInclude, regExpExclude, dirFileArray,\n i, stat, filePath, ok, dirFiles, fileName;\n\n topDir = startDir;\n\n regExpInclude = regExpFilters.include || regExpFilters;\n regExpExclude = regExpFilters.exclude || null;\n\n if (file.exists(topDir)) {\n dirFileArray = fs.readdirSync(topDir);\n for (i = 0; i < dirFileArray.length; i++) {\n fileName = dirFileArray[i];\n filePath = path.join(topDir, fileName);\n stat = fs.statSync(filePath);\n if (stat.isFile()) {\n if (makeUnixPaths) {\n //Make sure we have a JS string.\n if (filePath.indexOf(\"/\") === -1) {\n filePath = frontSlash(filePath);\n }\n }\n\n ok = true;\n if (regExpInclude) {\n ok = filePath.match(regExpInclude);\n }\n if (ok && regExpExclude) {\n ok = !filePath.match(regExpExclude);\n }\n\n if (ok && (!file.exclusionRegExp ||\n !file.exclusionRegExp.test(fileName))) {\n files.push(filePath);\n }\n } else if (stat.isDirectory() &&\n (!file.exclusionRegExp || !file.exclusionRegExp.test(fileName))) {\n dirFiles = this.getFilteredFileList(filePath, regExpFilters, makeUnixPaths);\n files.push.apply(files, dirFiles);\n }\n }\n }\n\n return files; //Array\n },\n\n copyDir: function (/*String*/srcDir, /*String*/destDir, /*RegExp?*/regExpFilter, /*boolean?*/onlyCopyNew) {\n //summary: copies files from srcDir to destDir using the regExpFilter to determine if the\n //file should be copied. Returns a list file name strings of the destinations that were copied.\n regExpFilter = regExpFilter || /\\w/;\n\n //Normalize th directory names, but keep front slashes.\n //path module on windows now returns backslashed paths.\n srcDir = frontSlash(path.normalize(srcDir));\n destDir = frontSlash(path.normalize(destDir));\n\n var fileNames = file.getFilteredFileList(srcDir, regExpFilter, true),\n copiedFiles = [], i, srcFileName, destFileName;\n\n for (i = 0; i < fileNames.length; i++) {\n srcFileName = fileNames[i];\n destFileName = srcFileName.replace(srcDir, destDir);\n\n if (file.copyFile(srcFileName, destFileName, onlyCopyNew)) {\n copiedFiles.push(destFileName);\n }\n }\n\n return copiedFiles.length ? copiedFiles : null; //Array or null\n },\n\n copyFile: function (/*String*/srcFileName, /*String*/destFileName, /*boolean?*/onlyCopyNew) {\n //summary: copies srcFileName to destFileName. If onlyCopyNew is set, it only copies the file if\n //srcFileName is newer than destFileName. Returns a boolean indicating if the copy occurred.\n var parentDir;\n\n //logger.trace(\"Src filename: \" + srcFileName);\n //logger.trace(\"Dest filename: \" + destFileName);\n\n //If onlyCopyNew is true, then compare dates and only copy if the src is newer\n //than dest.\n if (onlyCopyNew) {\n if (file.exists(destFileName) && fs.statSync(destFileName).mtime.getTime() >= fs.statSync(srcFileName).mtime.getTime()) {\n return false; //Boolean\n }\n }\n\n //Make sure destination dir exists.\n parentDir = path.dirname(destFileName);\n if (!file.exists(parentDir)) {\n mkFullDir(parentDir);\n }\n\n fs.writeFileSync(destFileName, fs.readFileSync(srcFileName, 'binary'), 'binary');\n\n return true; //Boolean\n },\n\n /**\n * Renames a file. May fail if \"to\" already exists or is on another drive.\n */\n renameFile: function (from, to) {\n return fs.renameSync(from, to);\n },\n\n /**\n * Reads a *text* file.\n */\n readFile: function (/*String*/path, /*String?*/encoding) {\n if (encoding === 'utf-8') {\n encoding = 'utf8';\n }\n if (!encoding) {\n encoding = 'utf8';\n }\n\n var text = fs.readFileSync(path, encoding);\n\n //Hmm, would not expect to get A BOM, but it seems to happen,\n //remove it just in case.\n if (text.indexOf('\\uFEFF') === 0) {\n text = text.substring(1, text.length);\n }\n\n return text;\n },\n\n readFileAsync: function (path, encoding) {\n var d = prim();\n try {\n d.resolve(file.readFile(path, encoding));\n } catch (e) {\n d.reject(e);\n }\n return d.promise;\n },\n\n saveUtf8File: function (/*String*/fileName, /*String*/fileContents) {\n //summary: saves a *text* file using UTF-8 encoding.\n file.saveFile(fileName, fileContents, \"utf8\");\n },\n\n saveFile: function (/*String*/fileName, /*String*/fileContents, /*String?*/encoding) {\n //summary: saves a *text* file.\n var parentDir;\n\n if (encoding === 'utf-8') {\n encoding = 'utf8';\n }\n if (!encoding) {\n encoding = 'utf8';\n }\n\n //Make sure destination directories exist.\n parentDir = path.dirname(fileName);\n if (!file.exists(parentDir)) {\n mkFullDir(parentDir);\n }\n\n fs.writeFileSync(fileName, fileContents, encoding);\n },\n\n deleteFile: function (/*String*/fileName) {\n //summary: deletes a file or directory if it exists.\n var files, i, stat;\n if (file.exists(fileName)) {\n stat = fs.lstatSync(fileName);\n if (stat.isDirectory()) {\n files = fs.readdirSync(fileName);\n for (i = 0; i < files.length; i++) {\n this.deleteFile(path.join(fileName, files[i]));\n }\n fs.rmdirSync(fileName);\n } else {\n fs.unlinkSync(fileName);\n }\n }\n },\n\n\n /**\n * Deletes any empty directories under the given directory.\n */\n deleteEmptyDirs: function (startDir) {\n var dirFileArray, i, fileName, filePath, stat;\n\n if (file.exists(startDir)) {\n dirFileArray = fs.readdirSync(startDir);\n for (i = 0; i < dirFileArray.length; i++) {\n fileName = dirFileArray[i];\n filePath = path.join(startDir, fileName);\n stat = fs.lstatSync(filePath);\n if (stat.isDirectory()) {\n file.deleteEmptyDirs(filePath);\n }\n }\n\n //If directory is now empty, remove it.\n if (fs.readdirSync(startDir).length === 0) {\n file.deleteFile(startDir);\n }\n }\n }\n };\n\n return file;\n\n});\n\n}\n\nif(env === 'rhino') {\n/**\n * @license RequireJS Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n//Helper functions to deal with file I/O.\n\n/*jslint plusplus: false */\n/*global java: false, define: false */\n\ndefine('rhino/file', ['prim'], function (prim) {\n var file = {\n backSlashRegExp: /\\\\/g,\n\n exclusionRegExp: /^\\./,\n\n getLineSeparator: function () {\n return file.lineSeparator;\n },\n\n lineSeparator: java.lang.System.getProperty(\"line.separator\"), //Java String\n\n exists: function (fileName) {\n return (new java.io.File(fileName)).exists();\n },\n\n parent: function (fileName) {\n return file.absPath((new java.io.File(fileName)).getParentFile());\n },\n\n normalize: function (fileName) {\n return file.absPath(fileName);\n },\n\n isFile: function (path) {\n return (new java.io.File(path)).isFile();\n },\n\n isDirectory: function (path) {\n return (new java.io.File(path)).isDirectory();\n },\n\n /**\n * Gets the absolute file path as a string, normalized\n * to using front slashes for path separators.\n * @param {java.io.File||String} file\n */\n absPath: function (fileObj) {\n if (typeof fileObj === \"string\") {\n fileObj = new java.io.File(fileObj);\n }\n return (fileObj.getCanonicalPath() + \"\").replace(file.backSlashRegExp, \"/\");\n },\n\n getFilteredFileList: function (/*String*/startDir, /*RegExp*/regExpFilters, /*boolean?*/makeUnixPaths, /*boolean?*/startDirIsJavaObject) {\n //summary: Recurses startDir and finds matches to the files that match regExpFilters.include\n //and do not match regExpFilters.exclude. Or just one regexp can be passed in for regExpFilters,\n //and it will be treated as the \"include\" case.\n //Ignores files/directories that start with a period (.) unless exclusionRegExp\n //is set to another value.\n var files = [], topDir, regExpInclude, regExpExclude, dirFileArray,\n i, fileObj, filePath, ok, dirFiles;\n\n topDir = startDir;\n if (!startDirIsJavaObject) {\n topDir = new java.io.File(startDir);\n }\n\n regExpInclude = regExpFilters.include || regExpFilters;\n regExpExclude = regExpFilters.exclude || null;\n\n if (topDir.exists()) {\n dirFileArray = topDir.listFiles();\n for (i = 0; i < dirFileArray.length; i++) {\n fileObj = dirFileArray[i];\n if (fileObj.isFile()) {\n filePath = fileObj.getPath();\n if (makeUnixPaths) {\n //Make sure we have a JS string.\n filePath = String(filePath);\n if (filePath.indexOf(\"/\") === -1) {\n filePath = filePath.replace(/\\\\/g, \"/\");\n }\n }\n\n ok = true;\n if (regExpInclude) {\n ok = filePath.match(regExpInclude);\n }\n if (ok && regExpExclude) {\n ok = !filePath.match(regExpExclude);\n }\n\n if (ok && (!file.exclusionRegExp ||\n !file.exclusionRegExp.test(fileObj.getName()))) {\n files.push(filePath);\n }\n } else if (fileObj.isDirectory() &&\n (!file.exclusionRegExp || !file.exclusionRegExp.test(fileObj.getName()))) {\n dirFiles = this.getFilteredFileList(fileObj, regExpFilters, makeUnixPaths, true);\n files.push.apply(files, dirFiles);\n }\n }\n }\n\n return files; //Array\n },\n\n copyDir: function (/*String*/srcDir, /*String*/destDir, /*RegExp?*/regExpFilter, /*boolean?*/onlyCopyNew) {\n //summary: copies files from srcDir to destDir using the regExpFilter to determine if the\n //file should be copied. Returns a list file name strings of the destinations that were copied.\n regExpFilter = regExpFilter || /\\w/;\n\n var fileNames = file.getFilteredFileList(srcDir, regExpFilter, true),\n copiedFiles = [], i, srcFileName, destFileName;\n\n for (i = 0; i < fileNames.length; i++) {\n srcFileName = fileNames[i];\n destFileName = srcFileName.replace(srcDir, destDir);\n\n if (file.copyFile(srcFileName, destFileName, onlyCopyNew)) {\n copiedFiles.push(destFileName);\n }\n }\n\n return copiedFiles.length ? copiedFiles : null; //Array or null\n },\n\n copyFile: function (/*String*/srcFileName, /*String*/destFileName, /*boolean?*/onlyCopyNew) {\n //summary: copies srcFileName to destFileName. If onlyCopyNew is set, it only copies the file if\n //srcFileName is newer than destFileName. Returns a boolean indicating if the copy occurred.\n var destFile = new java.io.File(destFileName), srcFile, parentDir,\n srcChannel, destChannel;\n\n //logger.trace(\"Src filename: \" + srcFileName);\n //logger.trace(\"Dest filename: \" + destFileName);\n\n //If onlyCopyNew is true, then compare dates and only copy if the src is newer\n //than dest.\n if (onlyCopyNew) {\n srcFile = new java.io.File(srcFileName);\n if (destFile.exists() && destFile.lastModified() >= srcFile.lastModified()) {\n return false; //Boolean\n }\n }\n\n //Make sure destination dir exists.\n parentDir = destFile.getParentFile();\n if (!parentDir.exists()) {\n if (!parentDir.mkdirs()) {\n throw \"Could not create directory: \" + parentDir.getCanonicalPath();\n }\n }\n\n //Java's version of copy file.\n srcChannel = new java.io.FileInputStream(srcFileName).getChannel();\n destChannel = new java.io.FileOutputStream(destFileName).getChannel();\n destChannel.transferFrom(srcChannel, 0, srcChannel.size());\n srcChannel.close();\n destChannel.close();\n\n return true; //Boolean\n },\n\n /**\n * Renames a file. May fail if \"to\" already exists or is on another drive.\n */\n renameFile: function (from, to) {\n return (new java.io.File(from)).renameTo((new java.io.File(to)));\n },\n\n readFile: function (/*String*/path, /*String?*/encoding) {\n //A file read function that can deal with BOMs\n encoding = encoding || \"utf-8\";\n var fileObj = new java.io.File(path),\n input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(fileObj), encoding)),\n stringBuffer, line;\n try {\n stringBuffer = new java.lang.StringBuffer();\n line = input.readLine();\n\n // Byte Order Mark (BOM) - The Unicode Standard, version 3.0, page 324\n // http://www.unicode.org/faq/utf_bom.html\n\n // Note that when we use utf-8, the BOM should appear as \"EF BB BF\", but it doesn't due to this bug in the JDK:\n // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4508058\n if (line && line.length() && line.charAt(0) === 0xfeff) {\n // Eat the BOM, since we've already found the encoding on this file,\n // and we plan to concatenating this buffer with others; the BOM should\n // only appear at the top of a file.\n line = line.substring(1);\n }\n while (line !== null) {\n stringBuffer.append(line);\n stringBuffer.append(file.lineSeparator);\n line = input.readLine();\n }\n //Make sure we return a JavaScript string and not a Java string.\n return String(stringBuffer.toString()); //String\n } finally {\n input.close();\n }\n },\n\n readFileAsync: function (path, encoding) {\n var d = prim();\n try {\n d.resolve(file.readFile(path, encoding));\n } catch (e) {\n d.reject(e);\n }\n return d.promise;\n },\n\n saveUtf8File: function (/*String*/fileName, /*String*/fileContents) {\n //summary: saves a file using UTF-8 encoding.\n file.saveFile(fileName, fileContents, \"utf-8\");\n },\n\n saveFile: function (/*String*/fileName, /*String*/fileContents, /*String?*/encoding) {\n //summary: saves a file.\n var outFile = new java.io.File(fileName), outWriter, parentDir, os;\n\n parentDir = outFile.getAbsoluteFile().getParentFile();\n if (!parentDir.exists()) {\n if (!parentDir.mkdirs()) {\n throw \"Could not create directory: \" + parentDir.getAbsolutePath();\n }\n }\n\n if (encoding) {\n outWriter = new java.io.OutputStreamWriter(new java.io.FileOutputStream(outFile), encoding);\n } else {\n outWriter = new java.io.OutputStreamWriter(new java.io.FileOutputStream(outFile));\n }\n\n os = new java.io.BufferedWriter(outWriter);\n try {\n os.write(fileContents);\n } finally {\n os.close();\n }\n },\n\n deleteFile: function (/*String*/fileName) {\n //summary: deletes a file or directory if it exists.\n var fileObj = new java.io.File(fileName), files, i;\n if (fileObj.exists()) {\n if (fileObj.isDirectory()) {\n files = fileObj.listFiles();\n for (i = 0; i < files.length; i++) {\n this.deleteFile(files[i]);\n }\n }\n fileObj[\"delete\"]();\n }\n },\n\n /**\n * Deletes any empty directories under the given directory.\n * The startDirIsJavaObject is private to this implementation's\n * recursion needs.\n */\n deleteEmptyDirs: function (startDir, startDirIsJavaObject) {\n var topDir = startDir,\n dirFileArray, i, fileObj;\n\n if (!startDirIsJavaObject) {\n topDir = new java.io.File(startDir);\n }\n\n if (topDir.exists()) {\n dirFileArray = topDir.listFiles();\n for (i = 0; i < dirFileArray.length; i++) {\n fileObj = dirFileArray[i];\n if (fileObj.isDirectory()) {\n file.deleteEmptyDirs(fileObj, true);\n }\n }\n\n //If the directory is empty now, delete it.\n if (topDir.listFiles().length === 0) {\n file.deleteFile(String(topDir.getPath()));\n }\n }\n }\n };\n\n return file;\n});\n\n}\n\nif(env === 'xpconnect') {\n/**\n * @license RequireJS Copyright (c) 2013-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n//Helper functions to deal with file I/O.\n\n/*jslint plusplus: false */\n/*global define, Components, xpcUtil */\n\ndefine('xpconnect/file', ['prim'], function (prim) {\n var file,\n Cc = Components.classes,\n Ci = Components.interfaces,\n //Depends on xpcUtil which is set up in x.js\n xpfile = xpcUtil.xpfile;\n\n function mkFullDir(dirObj) {\n //1 is DIRECTORY_TYPE, 511 is 0777 permissions\n if (!dirObj.exists()) {\n dirObj.create(1, 511);\n }\n }\n\n file = {\n backSlashRegExp: /\\\\/g,\n\n exclusionRegExp: /^\\./,\n\n getLineSeparator: function () {\n return file.lineSeparator;\n },\n\n lineSeparator: ('@mozilla.org/windows-registry-key;1' in Cc) ?\n '\\r\\n' : '\\n',\n\n exists: function (fileName) {\n return xpfile(fileName).exists();\n },\n\n parent: function (fileName) {\n return xpfile(fileName).parent;\n },\n\n normalize: function (fileName) {\n return file.absPath(fileName);\n },\n\n isFile: function (path) {\n return xpfile(path).isFile();\n },\n\n isDirectory: function (path) {\n return xpfile(path).isDirectory();\n },\n\n /**\n * Gets the absolute file path as a string, normalized\n * to using front slashes for path separators.\n * @param {java.io.File||String} file\n */\n absPath: function (fileObj) {\n if (typeof fileObj === \"string\") {\n fileObj = xpfile(fileObj);\n }\n return fileObj.path;\n },\n\n getFilteredFileList: function (/*String*/startDir, /*RegExp*/regExpFilters, /*boolean?*/makeUnixPaths, /*boolean?*/startDirIsObject) {\n //summary: Recurses startDir and finds matches to the files that match regExpFilters.include\n //and do not match regExpFilters.exclude. Or just one regexp can be passed in for regExpFilters,\n //and it will be treated as the \"include\" case.\n //Ignores files/directories that start with a period (.) unless exclusionRegExp\n //is set to another value.\n var files = [], topDir, regExpInclude, regExpExclude, dirFileArray,\n fileObj, filePath, ok, dirFiles;\n\n topDir = startDir;\n if (!startDirIsObject) {\n topDir = xpfile(startDir);\n }\n\n regExpInclude = regExpFilters.include || regExpFilters;\n regExpExclude = regExpFilters.exclude || null;\n\n if (topDir.exists()) {\n dirFileArray = topDir.directoryEntries;\n while (dirFileArray.hasMoreElements()) {\n fileObj = dirFileArray.getNext().QueryInterface(Ci.nsILocalFile);\n if (fileObj.isFile()) {\n filePath = fileObj.path;\n if (makeUnixPaths) {\n if (filePath.indexOf(\"/\") === -1) {\n filePath = filePath.replace(/\\\\/g, \"/\");\n }\n }\n\n ok = true;\n if (regExpInclude) {\n ok = filePath.match(regExpInclude);\n }\n if (ok && regExpExclude) {\n ok = !filePath.match(regExpExclude);\n }\n\n if (ok && (!file.exclusionRegExp ||\n !file.exclusionRegExp.test(fileObj.leafName))) {\n files.push(filePath);\n }\n } else if (fileObj.isDirectory() &&\n (!file.exclusionRegExp || !file.exclusionRegExp.test(fileObj.leafName))) {\n dirFiles = this.getFilteredFileList(fileObj, regExpFilters, makeUnixPaths, true);\n files.push.apply(files, dirFiles);\n }\n }\n }\n\n return files; //Array\n },\n\n copyDir: function (/*String*/srcDir, /*String*/destDir, /*RegExp?*/regExpFilter, /*boolean?*/onlyCopyNew) {\n //summary: copies files from srcDir to destDir using the regExpFilter to determine if the\n //file should be copied. Returns a list file name strings of the destinations that were copied.\n regExpFilter = regExpFilter || /\\w/;\n\n var fileNames = file.getFilteredFileList(srcDir, regExpFilter, true),\n copiedFiles = [], i, srcFileName, destFileName;\n\n for (i = 0; i < fileNames.length; i += 1) {\n srcFileName = fileNames[i];\n destFileName = srcFileName.replace(srcDir, destDir);\n\n if (file.copyFile(srcFileName, destFileName, onlyCopyNew)) {\n copiedFiles.push(destFileName);\n }\n }\n\n return copiedFiles.length ? copiedFiles : null; //Array or null\n },\n\n copyFile: function (/*String*/srcFileName, /*String*/destFileName, /*boolean?*/onlyCopyNew) {\n //summary: copies srcFileName to destFileName. If onlyCopyNew is set, it only copies the file if\n //srcFileName is newer than destFileName. Returns a boolean indicating if the copy occurred.\n var destFile = xpfile(destFileName),\n srcFile = xpfile(srcFileName);\n\n //logger.trace(\"Src filename: \" + srcFileName);\n //logger.trace(\"Dest filename: \" + destFileName);\n\n //If onlyCopyNew is true, then compare dates and only copy if the src is newer\n //than dest.\n if (onlyCopyNew) {\n if (destFile.exists() && destFile.lastModifiedTime >= srcFile.lastModifiedTime) {\n return false; //Boolean\n }\n }\n\n srcFile.copyTo(destFile.parent, destFile.leafName);\n\n return true; //Boolean\n },\n\n /**\n * Renames a file. May fail if \"to\" already exists or is on another drive.\n */\n renameFile: function (from, to) {\n var toFile = xpfile(to);\n return xpfile(from).moveTo(toFile.parent, toFile.leafName);\n },\n\n readFile: xpcUtil.readFile,\n\n readFileAsync: function (path, encoding) {\n var d = prim();\n try {\n d.resolve(file.readFile(path, encoding));\n } catch (e) {\n d.reject(e);\n }\n return d.promise;\n },\n\n saveUtf8File: function (/*String*/fileName, /*String*/fileContents) {\n //summary: saves a file using UTF-8 encoding.\n file.saveFile(fileName, fileContents, \"utf-8\");\n },\n\n saveFile: function (/*String*/fileName, /*String*/fileContents, /*String?*/encoding) {\n var outStream, convertStream,\n fileObj = xpfile(fileName);\n\n mkFullDir(fileObj.parent);\n\n try {\n outStream = Cc['@mozilla.org/network/file-output-stream;1']\n .createInstance(Ci.nsIFileOutputStream);\n //438 is decimal for 0777\n outStream.init(fileObj, 0x02 | 0x08 | 0x20, 511, 0);\n\n convertStream = Cc['@mozilla.org/intl/converter-output-stream;1']\n .createInstance(Ci.nsIConverterOutputStream);\n\n convertStream.init(outStream, encoding, 0, 0);\n convertStream.writeString(fileContents);\n } catch (e) {\n throw new Error((fileObj && fileObj.path || '') + ': ' + e);\n } finally {\n if (convertStream) {\n convertStream.close();\n }\n if (outStream) {\n outStream.close();\n }\n }\n },\n\n deleteFile: function (/*String*/fileName) {\n //summary: deletes a file or directory if it exists.\n var fileObj = xpfile(fileName);\n if (fileObj.exists()) {\n fileObj.remove(true);\n }\n },\n\n /**\n * Deletes any empty directories under the given directory.\n * The startDirIsJavaObject is private to this implementation's\n * recursion needs.\n */\n deleteEmptyDirs: function (startDir, startDirIsObject) {\n var topDir = startDir,\n dirFileArray, fileObj;\n\n if (!startDirIsObject) {\n topDir = xpfile(startDir);\n }\n\n if (topDir.exists()) {\n dirFileArray = topDir.directoryEntries;\n while (dirFileArray.hasMoreElements()) {\n fileObj = dirFileArray.getNext().QueryInterface(Ci.nsILocalFile);\n\n if (fileObj.isDirectory()) {\n file.deleteEmptyDirs(fileObj, true);\n }\n }\n\n //If the directory is empty now, delete it.\n dirFileArray = topDir.directoryEntries;\n if (!dirFileArray.hasMoreElements()) {\n file.deleteFile(topDir.path);\n }\n }\n }\n };\n\n return file;\n});\n\n}\n\nif(env === 'browser') {\n/*global process */\ndefine('browser/quit', function () {\n 'use strict';\n return function (code) {\n };\n});\n}\n\nif(env === 'node') {\n/*global process */\ndefine('node/quit', function () {\n 'use strict';\n return function (code) {\n var draining = 0;\n var exit = function () {\n if (draining === 0) {\n process.exit(code);\n } else {\n draining -= 1;\n }\n };\n if (process.stdout.bufferSize) {\n draining += 1;\n process.stdout.once('drain', exit);\n }\n if (process.stderr.bufferSize) {\n draining += 1;\n process.stderr.once('drain', exit);\n }\n exit();\n };\n});\n\n}\n\nif(env === 'rhino') {\n/*global quit */\ndefine('rhino/quit', function () {\n 'use strict';\n return function (code) {\n return quit(code);\n };\n});\n\n}\n\nif(env === 'xpconnect') {\n/*global quit */\ndefine('xpconnect/quit', function () {\n 'use strict';\n return function (code) {\n return quit(code);\n };\n});\n\n}\n\nif(env === 'browser') {\n/**\n * @license RequireJS Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint strict: false */\n/*global define: false, console: false */\n\ndefine('browser/print', function () {\n function print(msg) {\n console.log(msg);\n }\n\n return print;\n});\n\n}\n\nif(env === 'node') {\n/**\n * @license RequireJS Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint strict: false */\n/*global define: false, console: false */\n\ndefine('node/print', function () {\n function print(msg) {\n console.log(msg);\n }\n\n return print;\n});\n\n}\n\nif(env === 'rhino') {\n/**\n * @license RequireJS Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint strict: false */\n/*global define: false, print: false */\n\ndefine('rhino/print', function () {\n return print;\n});\n\n}\n\nif(env === 'xpconnect') {\n/**\n * @license RequireJS Copyright (c) 2013-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint strict: false */\n/*global define: false, print: false */\n\ndefine('xpconnect/print', function () {\n return print;\n});\n\n}\n/**\n * @license RequireJS Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint nomen: false, strict: false */\n/*global define: false */\n\ndefine('logger', ['env!env/print'], function (print) {\n var logger = {\n TRACE: 0,\n INFO: 1,\n WARN: 2,\n ERROR: 3,\n SILENT: 4,\n level: 0,\n logPrefix: \"\",\n\n logLevel: function( level ) {\n this.level = level;\n },\n\n trace: function (message) {\n if (this.level <= this.TRACE) {\n this._print(message);\n }\n },\n\n info: function (message) {\n if (this.level <= this.INFO) {\n this._print(message);\n }\n },\n\n warn: function (message) {\n if (this.level <= this.WARN) {\n this._print(message);\n }\n },\n\n error: function (message) {\n if (this.level <= this.ERROR) {\n this._print(message);\n }\n },\n\n _print: function (message) {\n this._sysPrint((this.logPrefix ? (this.logPrefix + \" \") : \"\") + message);\n },\n\n _sysPrint: function (message) {\n print(message);\n }\n };\n\n return logger;\n});\n//Just a blank file to use when building the optimizer with the optimizer,\n//so that the build does not attempt to inline some env modules,\n//like Node's fs and path.\n\n/*\n Copyright (C) 2013 Ariya Hidayat <[email protected]>\n Copyright (C) 2013 Thaddee Tyl <[email protected]>\n Copyright (C) 2013 Mathias Bynens <[email protected]>\n Copyright (C) 2012 Ariya Hidayat <[email protected]>\n Copyright (C) 2012 Mathias Bynens <[email protected]>\n Copyright (C) 2012 Joost-Wim Boekesteijn <[email protected]>\n Copyright (C) 2012 Kris Kowal <[email protected]>\n Copyright (C) 2012 Yusuke Suzuki <[email protected]>\n Copyright (C) 2012 Arpad Borsos <[email protected]>\n Copyright (C) 2011 Ariya Hidayat <[email protected]>\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n/*jslint bitwise:true plusplus:true */\n/*global esprima:true, define:true, exports:true, window: true,\nthrowErrorTolerant: true,\nthrowError: true, generateStatement: true, peek: true,\nparseAssignmentExpression: true, parseBlock: true, parseExpression: true,\nparseFunctionDeclaration: true, parseFunctionExpression: true,\nparseFunctionSourceElements: true, parseVariableIdentifier: true,\nparseLeftHandSideExpression: true,\nparseUnaryExpression: true,\nparseStatement: true, parseSourceElement: true */\n\n(function (root, factory) {\n 'use strict';\n\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js,\n // Rhino, and plain browser loading.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('esprima', ['exports'], factory);\n } else if (typeof exports !== 'undefined') {\n factory(exports);\n } else {\n factory((root.esprima = {}));\n }\n}(this, function (exports) {\n 'use strict';\n\n var Token,\n TokenName,\n FnExprTokens,\n Syntax,\n PropertyKind,\n Messages,\n Regex,\n SyntaxTreeDelegate,\n source,\n strict,\n index,\n lineNumber,\n lineStart,\n length,\n delegate,\n lookahead,\n state,\n extra;\n\n Token = {\n BooleanLiteral: 1,\n EOF: 2,\n Identifier: 3,\n Keyword: 4,\n NullLiteral: 5,\n NumericLiteral: 6,\n Punctuator: 7,\n StringLiteral: 8,\n RegularExpression: 9\n };\n\n TokenName = {};\n TokenName[Token.BooleanLiteral] = 'Boolean';\n TokenName[Token.EOF] = '<end>';\n TokenName[Token.Identifier] = 'Identifier';\n TokenName[Token.Keyword] = 'Keyword';\n TokenName[Token.NullLiteral] = 'Null';\n TokenName[Token.NumericLiteral] = 'Numeric';\n TokenName[Token.Punctuator] = 'Punctuator';\n TokenName[Token.StringLiteral] = 'String';\n TokenName[Token.RegularExpression] = 'RegularExpression';\n\n // A function following one of those tokens is an expression.\n FnExprTokens = ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new',\n 'return', 'case', 'delete', 'throw', 'void',\n // assignment operators\n '=', '+=', '-=', '*=', '/=', '%=', '<<=', '>>=', '>>>=',\n '&=', '|=', '^=', ',',\n // binary/unary operators\n '+', '-', '*', '/', '%', '++', '--', '<<', '>>', '>>>', '&',\n '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=',\n '<=', '<', '>', '!=', '!=='];\n\n Syntax = {\n AssignmentExpression: 'AssignmentExpression',\n ArrayExpression: 'ArrayExpression',\n BlockStatement: 'BlockStatement',\n BinaryExpression: 'BinaryExpression',\n BreakStatement: 'BreakStatement',\n CallExpression: 'CallExpression',\n CatchClause: 'CatchClause',\n ConditionalExpression: 'ConditionalExpression',\n ContinueStatement: 'ContinueStatement',\n DoWhileStatement: 'DoWhileStatement',\n DebuggerStatement: 'DebuggerStatement',\n EmptyStatement: 'EmptyStatement',\n ExpressionStatement: 'ExpressionStatement',\n ForStatement: 'ForStatement',\n ForInStatement: 'ForInStatement',\n FunctionDeclaration: 'FunctionDeclaration',\n FunctionExpression: 'FunctionExpression',\n Identifier: 'Identifier',\n IfStatement: 'IfStatement',\n Literal: 'Literal',\n LabeledStatement: 'LabeledStatement',\n LogicalExpression: 'LogicalExpression',\n MemberExpression: 'MemberExpression',\n NewExpression: 'NewExpression',\n ObjectExpression: 'ObjectExpression',\n Program: 'Program',\n Property: 'Property',\n ReturnStatement: 'ReturnStatement',\n SequenceExpression: 'SequenceExpression',\n SwitchStatement: 'SwitchStatement',\n SwitchCase: 'SwitchCase',\n ThisExpression: 'ThisExpression',\n ThrowStatement: 'ThrowStatement',\n TryStatement: 'TryStatement',\n UnaryExpression: 'UnaryExpression',\n UpdateExpression: 'UpdateExpression',\n VariableDeclaration: 'VariableDeclaration',\n VariableDeclarator: 'VariableDeclarator',\n WhileStatement: 'WhileStatement',\n WithStatement: 'WithStatement'\n };\n\n PropertyKind = {\n Data: 1,\n Get: 2,\n Set: 4\n };\n\n // Error messages should be identical to V8.\n Messages = {\n UnexpectedToken: 'Unexpected token %0',\n UnexpectedNumber: 'Unexpected number',\n UnexpectedString: 'Unexpected string',\n UnexpectedIdentifier: 'Unexpected identifier',\n UnexpectedReserved: 'Unexpected reserved word',\n UnexpectedEOS: 'Unexpected end of input',\n NewlineAfterThrow: 'Illegal newline after throw',\n InvalidRegExp: 'Invalid regular expression',\n UnterminatedRegExp: 'Invalid regular expression: missing /',\n InvalidLHSInAssignment: 'Invalid left-hand side in assignment',\n InvalidLHSInForIn: 'Invalid left-hand side in for-in',\n MultipleDefaultsInSwitch: 'More than one default clause in switch statement',\n NoCatchOrFinally: 'Missing catch or finally after try',\n UnknownLabel: 'Undefined label \\'%0\\'',\n Redeclaration: '%0 \\'%1\\' has already been declared',\n IllegalContinue: 'Illegal continue statement',\n IllegalBreak: 'Illegal break statement',\n IllegalReturn: 'Illegal return statement',\n StrictModeWith: 'Strict mode code may not include a with statement',\n StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',\n StrictVarName: 'Variable name may not be eval or arguments in strict mode',\n StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',\n StrictParamDupe: 'Strict mode function may not have duplicate parameter names',\n StrictFunctionName: 'Function name may not be eval or arguments in strict mode',\n StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',\n StrictDelete: 'Delete of an unqualified identifier in strict mode.',\n StrictDuplicateProperty: 'Duplicate data property in object literal not allowed in strict mode',\n AccessorDataProperty: 'Object literal may not have data and accessor property with the same name',\n AccessorGetSet: 'Object literal may not have multiple get/set accessors with the same name',\n StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',\n StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',\n StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',\n StrictReservedWord: 'Use of future reserved word in strict mode'\n };\n\n // See also tools/generate-unicode-regex.py.\n Regex = {\n NonAsciiIdentifierStart: new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]'),\n NonAsciiIdentifierPart: new RegExp('[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0\\u08A2-\\u08AC\\u08E4-\\u08FE\\u0900-\\u0963\\u0966-\\u096F\\u0971-\\u0977\\u0979-\\u097F\\u0981-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C01-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C82\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D02\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1D00-\\u1DE6\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA697\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A\\uAA7B\\uAA80-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE26\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]')\n };\n\n // Ensure the condition is true, otherwise throw an error.\n // This is only to have a better contract semantic, i.e. another safety net\n // to catch a logic error. The condition shall be fulfilled in normal case.\n // Do NOT use this to enforce a certain condition on any user input.\n\n function assert(condition, message) {\n /* istanbul ignore if */\n if (!condition) {\n throw new Error('ASSERT: ' + message);\n }\n }\n\n function isDecimalDigit(ch) {\n return (ch >= 48 && ch <= 57); // 0..9\n }\n\n function isHexDigit(ch) {\n return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;\n }\n\n function isOctalDigit(ch) {\n return '01234567'.indexOf(ch) >= 0;\n }\n\n\n // 7.2 White Space\n\n function isWhiteSpace(ch) {\n return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||\n (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);\n }\n\n // 7.3 Line Terminators\n\n function isLineTerminator(ch) {\n return (ch === 0x0A) || (ch === 0x0D) || (ch === 0x2028) || (ch === 0x2029);\n }\n\n // 7.6 Identifier Names and Identifiers\n\n 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 }\n\n function isIdentifierPart(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 >= 0x30 && ch <= 0x39) || // 0..9\n (ch === 0x5C) || // \\ (backslash)\n ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(String.fromCharCode(ch)));\n }\n\n // 7.6.1.2 Future Reserved Words\n\n function isFutureReservedWord(id) {\n switch (id) {\n case 'class':\n case 'enum':\n case 'export':\n case 'extends':\n case 'import':\n case 'super':\n return true;\n default:\n return false;\n }\n }\n\n function isStrictModeReservedWord(id) {\n switch (id) {\n case 'implements':\n case 'interface':\n case 'package':\n case 'private':\n case 'protected':\n case 'public':\n case 'static':\n case 'yield':\n case 'let':\n return true;\n default:\n return false;\n }\n }\n\n function isRestrictedWord(id) {\n return id === 'eval' || id === 'arguments';\n }\n\n // 7.6.1.1 Keywords\n\n function isKeyword(id) {\n if (strict && isStrictModeReservedWord(id)) {\n return true;\n }\n\n // 'const' is specialized as Keyword in V8.\n // 'yield' and 'let' are for compatiblity with SpiderMonkey and ES.next.\n // Some others are from future reserved words.\n\n switch (id.length) {\n case 2:\n return (id === 'if') || (id === 'in') || (id === 'do');\n case 3:\n return (id === 'var') || (id === 'for') || (id === 'new') ||\n (id === 'try') || (id === 'let');\n case 4:\n return (id === 'this') || (id === 'else') || (id === 'case') ||\n (id === 'void') || (id === 'with') || (id === 'enum');\n case 5:\n return (id === 'while') || (id === 'break') || (id === 'catch') ||\n (id === 'throw') || (id === 'const') || (id === 'yield') ||\n (id === 'class') || (id === 'super');\n case 6:\n return (id === 'return') || (id === 'typeof') || (id === 'delete') ||\n (id === 'switch') || (id === 'export') || (id === 'import');\n case 7:\n return (id === 'default') || (id === 'finally') || (id === 'extends');\n case 8:\n return (id === 'function') || (id === 'continue') || (id === 'debugger');\n case 10:\n return (id === 'instanceof');\n default:\n return false;\n }\n }\n\n // 7.4 Comments\n\n function addComment(type, value, start, end, loc) {\n var comment, attacher;\n\n assert(typeof start === 'number', 'Comment must have valid position');\n\n // Because the way the actual token is scanned, often the comments\n // (if any) are skipped twice during the lexical analysis.\n // Thus, we need to skip adding a comment if the comment array already\n // handled it.\n if (state.lastCommentStart >= start) {\n return;\n }\n state.lastCommentStart = start;\n\n comment = {\n type: type,\n value: value\n };\n if (extra.range) {\n comment.range = [start, end];\n }\n if (extra.loc) {\n comment.loc = loc;\n }\n extra.comments.push(comment);\n if (extra.attachComment) {\n extra.leadingComments.push(comment);\n extra.trailingComments.push(comment);\n }\n }\n\n function skipSingleLineComment(offset) {\n var start, loc, ch, comment;\n\n start = index - offset;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart - offset\n }\n };\n\n while (index < length) {\n ch = source.charCodeAt(index);\n ++index;\n if (isLineTerminator(ch)) {\n if (extra.comments) {\n comment = source.slice(start + offset, index - 1);\n loc.end = {\n line: lineNumber,\n column: index - lineStart - 1\n };\n addComment('Line', comment, start, index - 1, loc);\n }\n if (ch === 13 && source.charCodeAt(index) === 10) {\n ++index;\n }\n ++lineNumber;\n lineStart = index;\n return;\n }\n }\n\n if (extra.comments) {\n comment = source.slice(start + offset, index);\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n addComment('Line', comment, start, index, loc);\n }\n }\n\n function skipMultiLineComment() {\n var start, loc, ch, comment;\n\n if (extra.comments) {\n start = index - 2;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart - 2\n }\n };\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n if (isLineTerminator(ch)) {\n if (ch === 0x0D && source.charCodeAt(index + 1) === 0x0A) {\n ++index;\n }\n ++lineNumber;\n ++index;\n lineStart = index;\n if (index >= length) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n } else if (ch === 0x2A) {\n // Block comment ends with '*/'.\n if (source.charCodeAt(index + 1) === 0x2F) {\n ++index;\n ++index;\n if (extra.comments) {\n comment = source.slice(start + 2, index - 2);\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n addComment('Block', comment, start, index, loc);\n }\n return;\n }\n ++index;\n } else {\n ++index;\n }\n }\n\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n function skipComment() {\n var ch, start;\n\n start = (index === 0);\n while (index < length) {\n ch = source.charCodeAt(index);\n\n if (isWhiteSpace(ch)) {\n ++index;\n } else if (isLineTerminator(ch)) {\n ++index;\n if (ch === 0x0D && source.charCodeAt(index) === 0x0A) {\n ++index;\n }\n ++lineNumber;\n lineStart = index;\n start = true;\n } else if (ch === 0x2F) { // U+002F is '/'\n ch = source.charCodeAt(index + 1);\n if (ch === 0x2F) {\n ++index;\n ++index;\n skipSingleLineComment(2);\n start = true;\n } else if (ch === 0x2A) { // U+002A is '*'\n ++index;\n ++index;\n skipMultiLineComment();\n } else {\n break;\n }\n } else if (start && ch === 0x2D) { // U+002D is '-'\n // U+003E is '>'\n if ((source.charCodeAt(index + 1) === 0x2D) && (source.charCodeAt(index + 2) === 0x3E)) {\n // '-->' is a single-line comment\n index += 3;\n skipSingleLineComment(3);\n } else {\n break;\n }\n } else if (ch === 0x3C) { // U+003C is '<'\n if (source.slice(index + 1, index + 4) === '!--') {\n ++index; // `<`\n ++index; // `!`\n ++index; // `-`\n ++index; // `-`\n skipSingleLineComment(4);\n } else {\n break;\n }\n } else {\n break;\n }\n }\n }\n\n function scanHexEscape(prefix) {\n var i, len, ch, code = 0;\n\n len = (prefix === 'u') ? 4 : 2;\n for (i = 0; i < len; ++i) {\n if (index < length && isHexDigit(source[index])) {\n ch = source[index++];\n code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());\n } else {\n return '';\n }\n }\n return String.fromCharCode(code);\n }\n\n function getEscapedIdentifier() {\n var ch, id;\n\n ch = source.charCodeAt(index++);\n id = String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierStart(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n id = ch;\n }\n\n while (index < length) {\n ch = source.charCodeAt(index);\n if (!isIdentifierPart(ch)) {\n break;\n }\n ++index;\n id += String.fromCharCode(ch);\n\n // '\\u' (U+005C, U+0075) denotes an escaped character.\n if (ch === 0x5C) {\n id = id.substr(0, id.length - 1);\n if (source.charCodeAt(index) !== 0x75) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n ++index;\n ch = scanHexEscape('u');\n if (!ch || ch === '\\\\' || !isIdentifierPart(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n id += ch;\n }\n }\n\n return id;\n }\n\n function getIdentifier() {\n var start, ch;\n\n start = index++;\n while (index < length) {\n ch = source.charCodeAt(index);\n if (ch === 0x5C) {\n // Blackslash (U+005C) marks Unicode escape sequence.\n index = start;\n return getEscapedIdentifier();\n }\n if (isIdentifierPart(ch)) {\n ++index;\n } else {\n break;\n }\n }\n\n return source.slice(start, index);\n }\n\n function scanIdentifier() {\n var start, id, type;\n\n start = index;\n\n // Backslash (U+005C) starts an escaped character.\n id = (source.charCodeAt(index) === 0x5C) ? getEscapedIdentifier() : getIdentifier();\n\n // There is no keyword or literal with only one character.\n // Thus, it must be an identifier.\n if (id.length === 1) {\n type = Token.Identifier;\n } else if (isKeyword(id)) {\n type = Token.Keyword;\n } else if (id === 'null') {\n type = Token.NullLiteral;\n } else if (id === 'true' || id === 'false') {\n type = Token.BooleanLiteral;\n } else {\n type = Token.Identifier;\n }\n\n return {\n type: type,\n value: id,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n\n // 7.7 Punctuators\n\n function scanPunctuator() {\n var start = index,\n code = source.charCodeAt(index),\n code2,\n ch1 = source[index],\n ch2,\n ch3,\n ch4;\n\n switch (code) {\n\n // Check for most common single-character punctuators.\n case 0x2E: // . dot\n case 0x28: // ( open bracket\n case 0x29: // ) close bracket\n case 0x3B: // ; semicolon\n case 0x2C: // , comma\n case 0x7B: // { open curly brace\n case 0x7D: // } close curly brace\n case 0x5B: // [\n case 0x5D: // ]\n case 0x3A: // :\n case 0x3F: // ?\n case 0x7E: // ~\n ++index;\n if (extra.tokenize) {\n if (code === 0x28) {\n extra.openParenToken = extra.tokens.length;\n } else if (code === 0x7B) {\n extra.openCurlyToken = extra.tokens.length;\n }\n }\n return {\n type: Token.Punctuator,\n value: String.fromCharCode(code),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n\n default:\n code2 = source.charCodeAt(index + 1);\n\n // '=' (U+003D) marks an assignment or comparison operator.\n if (code2 === 0x3D) {\n switch (code) {\n case 0x2B: // +\n case 0x2D: // -\n case 0x2F: // /\n case 0x3C: // <\n case 0x3E: // >\n case 0x5E: // ^\n case 0x7C: // |\n case 0x25: // %\n case 0x26: // &\n case 0x2A: // *\n index += 2;\n return {\n type: Token.Punctuator,\n value: String.fromCharCode(code) + String.fromCharCode(code2),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n\n case 0x21: // !\n case 0x3D: // =\n index += 2;\n\n // !== and ===\n if (source.charCodeAt(index) === 0x3D) {\n ++index;\n }\n return {\n type: Token.Punctuator,\n value: source.slice(start, index),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n }\n }\n\n // 4-character punctuator: >>>=\n\n ch4 = source.substr(index, 4);\n\n if (ch4 === '>>>=') {\n index += 4;\n return {\n type: Token.Punctuator,\n value: ch4,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 3-character punctuators: === !== >>> <<= >>=\n\n ch3 = ch4.substr(0, 3);\n\n if (ch3 === '>>>' || ch3 === '<<=' || ch3 === '>>=') {\n index += 3;\n return {\n type: Token.Punctuator,\n value: ch3,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // Other 2-character punctuators: ++ -- << >> && ||\n ch2 = ch3.substr(0, 2);\n\n if ((ch1 === ch2[1] && ('+-<>&|'.indexOf(ch1) >= 0)) || ch2 === '=>') {\n index += 2;\n return {\n type: Token.Punctuator,\n value: ch2,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 1-character punctuators: < > = ! + - * % & | ^ /\n if ('<>=!+-*%&|^/'.indexOf(ch1) >= 0) {\n ++index;\n return {\n type: Token.Punctuator,\n value: ch1,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n // 7.8.3 Numeric Literals\n\n function scanHexLiteral(start) {\n var number = '';\n\n while (index < length) {\n if (!isHexDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n\n if (number.length === 0) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseInt('0x' + number, 16),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function scanOctalLiteral(start) {\n var number = '0' + source[index++];\n while (index < length) {\n if (!isOctalDigit(source[index])) {\n break;\n }\n number += source[index++];\n }\n\n if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseInt(number, 8),\n octal: true,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function scanNumericLiteral() {\n var number, start, ch;\n\n ch = source[index];\n assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'),\n 'Numeric literal must start with a decimal digit or a decimal point');\n\n start = index;\n number = '';\n if (ch !== '.') {\n number = source[index++];\n ch = source[index];\n\n // Hex number starts with '0x'.\n // Octal number starts with '0'.\n if (number === '0') {\n if (ch === 'x' || ch === 'X') {\n ++index;\n return scanHexLiteral(start);\n }\n if (isOctalDigit(ch)) {\n return scanOctalLiteral(start);\n }\n\n // decimal number starts with '0' such as '09' is illegal.\n if (ch && isDecimalDigit(ch.charCodeAt(0))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n }\n\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n\n if (ch === '.') {\n number += source[index++];\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n ch = source[index];\n }\n\n if (ch === 'e' || ch === 'E') {\n number += source[index++];\n\n ch = source[index];\n if (ch === '+' || ch === '-') {\n number += source[index++];\n }\n if (isDecimalDigit(source.charCodeAt(index))) {\n while (isDecimalDigit(source.charCodeAt(index))) {\n number += source[index++];\n }\n } else {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n }\n\n if (isIdentifierStart(source.charCodeAt(index))) {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.NumericLiteral,\n value: parseFloat(number),\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n // 7.8.4 String Literals\n\n function scanStringLiteral() {\n var str = '', quote, start, ch, code, unescaped, restore, octal = false, startLineNumber, startLineStart;\n startLineNumber = lineNumber;\n startLineStart = lineStart;\n\n quote = source[index];\n assert((quote === '\\'' || quote === '\"'),\n 'String literal must starts with a quote');\n\n start = index;\n ++index;\n\n while (index < length) {\n ch = source[index++];\n\n if (ch === quote) {\n quote = '';\n break;\n } else if (ch === '\\\\') {\n ch = source[index++];\n if (!ch || !isLineTerminator(ch.charCodeAt(0))) {\n switch (ch) {\n case 'u':\n case 'x':\n restore = index;\n unescaped = scanHexEscape(ch);\n if (unescaped) {\n str += unescaped;\n } else {\n index = restore;\n str += ch;\n }\n break;\n case 'n':\n str += '\\n';\n break;\n case 'r':\n str += '\\r';\n break;\n case 't':\n str += '\\t';\n break;\n case 'b':\n str += '\\b';\n break;\n case 'f':\n str += '\\f';\n break;\n case 'v':\n str += '\\x0B';\n break;\n\n default:\n if (isOctalDigit(ch)) {\n code = '01234567'.indexOf(ch);\n\n // \\0 is not octal escape sequence\n if (code !== 0) {\n octal = true;\n }\n\n if (index < length && isOctalDigit(source[index])) {\n octal = true;\n code = code * 8 + '01234567'.indexOf(source[index++]);\n\n // 3 digits are only allowed when string starts\n // with 0, 1, 2, 3\n if ('0123'.indexOf(ch) >= 0 &&\n index < length &&\n isOctalDigit(source[index])) {\n code = code * 8 + '01234567'.indexOf(source[index++]);\n }\n }\n str += String.fromCharCode(code);\n } else {\n str += ch;\n }\n break;\n }\n } else {\n ++lineNumber;\n if (ch === '\\r' && source[index] === '\\n') {\n ++index;\n }\n lineStart = index;\n }\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n break;\n } else {\n str += ch;\n }\n }\n\n if (quote !== '') {\n throwError({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n\n return {\n type: Token.StringLiteral,\n value: str,\n octal: octal,\n startLineNumber: startLineNumber,\n startLineStart: startLineStart,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n function testRegExp(pattern, flags) {\n var value;\n try {\n value = new RegExp(pattern, flags);\n } catch (e) {\n throwError({}, Messages.InvalidRegExp);\n }\n return value;\n }\n\n function scanRegExpBody() {\n var ch, str, classMarker, terminated, body;\n\n ch = source[index];\n assert(ch === '/', 'Regular expression literal must start with a slash');\n str = source[index++];\n\n classMarker = false;\n terminated = false;\n while (index < length) {\n ch = source[index++];\n str += ch;\n if (ch === '\\\\') {\n ch = source[index++];\n // ECMA-262 7.8.5\n if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, Messages.UnterminatedRegExp);\n }\n str += ch;\n } else if (isLineTerminator(ch.charCodeAt(0))) {\n throwError({}, Messages.UnterminatedRegExp);\n } else if (classMarker) {\n if (ch === ']') {\n classMarker = false;\n }\n } else {\n if (ch === '/') {\n terminated = true;\n break;\n } else if (ch === '[') {\n classMarker = true;\n }\n }\n }\n\n if (!terminated) {\n throwError({}, Messages.UnterminatedRegExp);\n }\n\n // Exclude leading and trailing slash.\n body = str.substr(1, str.length - 2);\n return {\n value: body,\n literal: str\n };\n }\n\n function scanRegExpFlags() {\n var ch, str, flags, restore;\n\n str = '';\n flags = '';\n while (index < length) {\n ch = source[index];\n if (!isIdentifierPart(ch.charCodeAt(0))) {\n break;\n }\n\n ++index;\n if (ch === '\\\\' && index < length) {\n ch = source[index];\n if (ch === 'u') {\n ++index;\n restore = index;\n ch = scanHexEscape('u');\n if (ch) {\n flags += ch;\n for (str += '\\\\u'; restore < index; ++restore) {\n str += source[restore];\n }\n } else {\n index = restore;\n flags += 'u';\n str += '\\\\u';\n }\n throwErrorTolerant({}, Messages.UnexpectedToken, 'ILLEGAL');\n } else {\n str += '\\\\';\n throwErrorTolerant({}, Messages.UnexpectedToken, 'ILLEGAL');\n }\n } else {\n flags += ch;\n str += ch;\n }\n }\n\n return {\n value: flags,\n literal: str\n };\n }\n\n function scanRegExp() {\n var start, body, flags, pattern, value;\n\n lookahead = null;\n skipComment();\n start = index;\n\n body = scanRegExpBody();\n flags = scanRegExpFlags();\n value = testRegExp(body.value, flags.value);\n\n if (extra.tokenize) {\n return {\n type: Token.RegularExpression,\n value: value,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: start,\n end: index\n };\n }\n\n return {\n literal: body.literal + flags.literal,\n value: value,\n start: start,\n end: index\n };\n }\n\n function collectRegex() {\n var pos, loc, regex, token;\n\n skipComment();\n\n pos = index;\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart\n }\n };\n\n regex = scanRegExp();\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n\n /* istanbul ignore next */\n if (!extra.tokenize) {\n // Pop the previous token, which is likely '/' or '/='\n if (extra.tokens.length > 0) {\n token = extra.tokens[extra.tokens.length - 1];\n if (token.range[0] === pos && token.type === 'Punctuator') {\n if (token.value === '/' || token.value === '/=') {\n extra.tokens.pop();\n }\n }\n }\n\n extra.tokens.push({\n type: 'RegularExpression',\n value: regex.literal,\n range: [pos, index],\n loc: loc\n });\n }\n\n return regex;\n }\n\n function isIdentifierName(token) {\n return token.type === Token.Identifier ||\n token.type === Token.Keyword ||\n token.type === Token.BooleanLiteral ||\n token.type === Token.NullLiteral;\n }\n\n function advanceSlash() {\n var prevToken,\n checkToken;\n // Using the following algorithm:\n // https://github.com/mozilla/sweet.js/wiki/design\n prevToken = extra.tokens[extra.tokens.length - 1];\n if (!prevToken) {\n // Nothing before that: it cannot be a division.\n return collectRegex();\n }\n if (prevToken.type === 'Punctuator') {\n if (prevToken.value === ']') {\n return scanPunctuator();\n }\n if (prevToken.value === ')') {\n checkToken = extra.tokens[extra.openParenToken - 1];\n if (checkToken &&\n checkToken.type === 'Keyword' &&\n (checkToken.value === 'if' ||\n checkToken.value === 'while' ||\n checkToken.value === 'for' ||\n checkToken.value === 'with')) {\n return collectRegex();\n }\n return scanPunctuator();\n }\n if (prevToken.value === '}') {\n // Dividing a function by anything makes little sense,\n // but we have to check for that.\n if (extra.tokens[extra.openCurlyToken - 3] &&\n extra.tokens[extra.openCurlyToken - 3].type === 'Keyword') {\n // Anonymous function.\n checkToken = extra.tokens[extra.openCurlyToken - 4];\n if (!checkToken) {\n return scanPunctuator();\n }\n } else if (extra.tokens[extra.openCurlyToken - 4] &&\n extra.tokens[extra.openCurlyToken - 4].type === 'Keyword') {\n // Named function.\n checkToken = extra.tokens[extra.openCurlyToken - 5];\n if (!checkToken) {\n return collectRegex();\n }\n } else {\n return scanPunctuator();\n }\n // checkToken determines whether the function is\n // a declaration or an expression.\n if (FnExprTokens.indexOf(checkToken.value) >= 0) {\n // It is an expression.\n return scanPunctuator();\n }\n // It is a declaration.\n return collectRegex();\n }\n return collectRegex();\n }\n if (prevToken.type === 'Keyword') {\n return collectRegex();\n }\n return scanPunctuator();\n }\n\n function advance() {\n var ch;\n\n skipComment();\n\n if (index >= length) {\n return {\n type: Token.EOF,\n lineNumber: lineNumber,\n lineStart: lineStart,\n start: index,\n end: index\n };\n }\n\n ch = source.charCodeAt(index);\n\n if (isIdentifierStart(ch)) {\n return scanIdentifier();\n }\n\n // Very common: ( and ) and ;\n if (ch === 0x28 || ch === 0x29 || ch === 0x3B) {\n return scanPunctuator();\n }\n\n // String literal starts with single quote (U+0027) or double quote (U+0022).\n if (ch === 0x27 || ch === 0x22) {\n return scanStringLiteral();\n }\n\n\n // Dot (.) U+002E can also start a floating-point number, hence the need\n // to check the next character.\n if (ch === 0x2E) {\n if (isDecimalDigit(source.charCodeAt(index + 1))) {\n return scanNumericLiteral();\n }\n return scanPunctuator();\n }\n\n if (isDecimalDigit(ch)) {\n return scanNumericLiteral();\n }\n\n // Slash (/) U+002F can also start a regex.\n if (extra.tokenize && ch === 0x2F) {\n return advanceSlash();\n }\n\n return scanPunctuator();\n }\n\n function collectToken() {\n var loc, token, range, value;\n\n skipComment();\n loc = {\n start: {\n line: lineNumber,\n column: index - lineStart\n }\n };\n\n token = advance();\n loc.end = {\n line: lineNumber,\n column: index - lineStart\n };\n\n if (token.type !== Token.EOF) {\n value = source.slice(token.start, token.end);\n extra.tokens.push({\n type: TokenName[token.type],\n value: value,\n range: [token.start, token.end],\n loc: loc\n });\n }\n\n return token;\n }\n\n function lex() {\n var token;\n\n token = lookahead;\n index = token.end;\n lineNumber = token.lineNumber;\n lineStart = token.lineStart;\n\n lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();\n\n index = token.end;\n lineNumber = token.lineNumber;\n lineStart = token.lineStart;\n\n return token;\n }\n\n function peek() {\n var pos, line, start;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();\n index = pos;\n lineNumber = line;\n lineStart = start;\n }\n\n function Position(line, column) {\n this.line = line;\n this.column = column;\n }\n\n function SourceLocation(startLine, startColumn, line, column) {\n this.start = new Position(startLine, startColumn);\n this.end = new Position(line, column);\n }\n\n SyntaxTreeDelegate = {\n\n name: 'SyntaxTree',\n\n processComment: function (node) {\n var lastChild, trailingComments;\n\n if (node.type === Syntax.Program) {\n if (node.body.length > 0) {\n return;\n }\n }\n\n if (extra.trailingComments.length > 0) {\n if (extra.trailingComments[0].range[0] >= node.range[1]) {\n trailingComments = extra.trailingComments;\n extra.trailingComments = [];\n } else {\n extra.trailingComments.length = 0;\n }\n } else {\n if (extra.bottomRightStack.length > 0 &&\n extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments &&\n extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments[0].range[0] >= node.range[1]) {\n trailingComments = extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments;\n delete extra.bottomRightStack[extra.bottomRightStack.length - 1].trailingComments;\n }\n }\n\n // Eating the stack.\n while (extra.bottomRightStack.length > 0 && extra.bottomRightStack[extra.bottomRightStack.length - 1].range[0] >= node.range[0]) {\n lastChild = extra.bottomRightStack.pop();\n }\n\n if (lastChild) {\n if (lastChild.leadingComments && lastChild.leadingComments[lastChild.leadingComments.length - 1].range[1] <= node.range[0]) {\n node.leadingComments = lastChild.leadingComments;\n delete lastChild.leadingComments;\n }\n } else if (extra.leadingComments.length > 0 && extra.leadingComments[extra.leadingComments.length - 1].range[1] <= node.range[0]) {\n node.leadingComments = extra.leadingComments;\n extra.leadingComments = [];\n }\n\n\n if (trailingComments) {\n node.trailingComments = trailingComments;\n }\n\n extra.bottomRightStack.push(node);\n },\n\n markEnd: function (node, startToken) {\n if (extra.range) {\n node.range = [startToken.start, index];\n }\n if (extra.loc) {\n node.loc = new SourceLocation(\n startToken.startLineNumber === undefined ? startToken.lineNumber : startToken.startLineNumber,\n startToken.start - (startToken.startLineStart === undefined ? startToken.lineStart : startToken.startLineStart),\n lineNumber,\n index - lineStart\n );\n this.postProcess(node);\n }\n\n if (extra.attachComment) {\n this.processComment(node);\n }\n return node;\n },\n\n postProcess: function (node) {\n if (extra.source) {\n node.loc.source = extra.source;\n }\n return node;\n },\n\n createArrayExpression: function (elements) {\n return {\n type: Syntax.ArrayExpression,\n elements: elements\n };\n },\n\n createAssignmentExpression: function (operator, left, right) {\n return {\n type: Syntax.AssignmentExpression,\n operator: operator,\n left: left,\n right: right\n };\n },\n\n createBinaryExpression: function (operator, left, right) {\n var type = (operator === '||' || operator === '&&') ? Syntax.LogicalExpression :\n Syntax.BinaryExpression;\n return {\n type: type,\n operator: operator,\n left: left,\n right: right\n };\n },\n\n createBlockStatement: function (body) {\n return {\n type: Syntax.BlockStatement,\n body: body\n };\n },\n\n createBreakStatement: function (label) {\n return {\n type: Syntax.BreakStatement,\n label: label\n };\n },\n\n createCallExpression: function (callee, args) {\n return {\n type: Syntax.CallExpression,\n callee: callee,\n 'arguments': args\n };\n },\n\n createCatchClause: function (param, body) {\n return {\n type: Syntax.CatchClause,\n param: param,\n body: body\n };\n },\n\n createConditionalExpression: function (test, consequent, alternate) {\n return {\n type: Syntax.ConditionalExpression,\n test: test,\n consequent: consequent,\n alternate: alternate\n };\n },\n\n createContinueStatement: function (label) {\n return {\n type: Syntax.ContinueStatement,\n label: label\n };\n },\n\n createDebuggerStatement: function () {\n return {\n type: Syntax.DebuggerStatement\n };\n },\n\n createDoWhileStatement: function (body, test) {\n return {\n type: Syntax.DoWhileStatement,\n body: body,\n test: test\n };\n },\n\n createEmptyStatement: function () {\n return {\n type: Syntax.EmptyStatement\n };\n },\n\n createExpressionStatement: function (expression) {\n return {\n type: Syntax.ExpressionStatement,\n expression: expression\n };\n },\n\n createForStatement: function (init, test, update, body) {\n return {\n type: Syntax.ForStatement,\n init: init,\n test: test,\n update: update,\n body: body\n };\n },\n\n createForInStatement: function (left, right, body) {\n return {\n type: Syntax.ForInStatement,\n left: left,\n right: right,\n body: body,\n each: false\n };\n },\n\n createFunctionDeclaration: function (id, params, defaults, body) {\n return {\n type: Syntax.FunctionDeclaration,\n id: id,\n params: params,\n defaults: defaults,\n body: body,\n rest: null,\n generator: false,\n expression: false\n };\n },\n\n createFunctionExpression: function (id, params, defaults, body) {\n return {\n type: Syntax.FunctionExpression,\n id: id,\n params: params,\n defaults: defaults,\n body: body,\n rest: null,\n generator: false,\n expression: false\n };\n },\n\n createIdentifier: function (name) {\n return {\n type: Syntax.Identifier,\n name: name\n };\n },\n\n createIfStatement: function (test, consequent, alternate) {\n return {\n type: Syntax.IfStatement,\n test: test,\n consequent: consequent,\n alternate: alternate\n };\n },\n\n createLabeledStatement: function (label, body) {\n return {\n type: Syntax.LabeledStatement,\n label: label,\n body: body\n };\n },\n\n createLiteral: function (token) {\n return {\n type: Syntax.Literal,\n value: token.value,\n raw: source.slice(token.start, token.end)\n };\n },\n\n createMemberExpression: function (accessor, object, property) {\n return {\n type: Syntax.MemberExpression,\n computed: accessor === '[',\n object: object,\n property: property\n };\n },\n\n createNewExpression: function (callee, args) {\n return {\n type: Syntax.NewExpression,\n callee: callee,\n 'arguments': args\n };\n },\n\n createObjectExpression: function (properties) {\n return {\n type: Syntax.ObjectExpression,\n properties: properties\n };\n },\n\n createPostfixExpression: function (operator, argument) {\n return {\n type: Syntax.UpdateExpression,\n operator: operator,\n argument: argument,\n prefix: false\n };\n },\n\n createProgram: function (body) {\n return {\n type: Syntax.Program,\n body: body\n };\n },\n\n createProperty: function (kind, key, value) {\n return {\n type: Syntax.Property,\n key: key,\n value: value,\n kind: kind\n };\n },\n\n createReturnStatement: function (argument) {\n return {\n type: Syntax.ReturnStatement,\n argument: argument\n };\n },\n\n createSequenceExpression: function (expressions) {\n return {\n type: Syntax.SequenceExpression,\n expressions: expressions\n };\n },\n\n createSwitchCase: function (test, consequent) {\n return {\n type: Syntax.SwitchCase,\n test: test,\n consequent: consequent\n };\n },\n\n createSwitchStatement: function (discriminant, cases) {\n return {\n type: Syntax.SwitchStatement,\n discriminant: discriminant,\n cases: cases\n };\n },\n\n createThisExpression: function () {\n return {\n type: Syntax.ThisExpression\n };\n },\n\n createThrowStatement: function (argument) {\n return {\n type: Syntax.ThrowStatement,\n argument: argument\n };\n },\n\n createTryStatement: function (block, guardedHandlers, handlers, finalizer) {\n return {\n type: Syntax.TryStatement,\n block: block,\n guardedHandlers: guardedHandlers,\n handlers: handlers,\n finalizer: finalizer\n };\n },\n\n createUnaryExpression: function (operator, argument) {\n if (operator === '++' || operator === '--') {\n return {\n type: Syntax.UpdateExpression,\n operator: operator,\n argument: argument,\n prefix: true\n };\n }\n return {\n type: Syntax.UnaryExpression,\n operator: operator,\n argument: argument,\n prefix: true\n };\n },\n\n createVariableDeclaration: function (declarations, kind) {\n return {\n type: Syntax.VariableDeclaration,\n declarations: declarations,\n kind: kind\n };\n },\n\n createVariableDeclarator: function (id, init) {\n return {\n type: Syntax.VariableDeclarator,\n id: id,\n init: init\n };\n },\n\n createWhileStatement: function (test, body) {\n return {\n type: Syntax.WhileStatement,\n test: test,\n body: body\n };\n },\n\n createWithStatement: function (object, body) {\n return {\n type: Syntax.WithStatement,\n object: object,\n body: body\n };\n }\n };\n\n // Return true if there is a line terminator before the next token.\n\n function peekLineTerminator() {\n var pos, line, start, found;\n\n pos = index;\n line = lineNumber;\n start = lineStart;\n skipComment();\n found = lineNumber !== line;\n index = pos;\n lineNumber = line;\n lineStart = start;\n\n return found;\n }\n\n // Throw an exception\n\n function throwError(token, messageFormat) {\n var error,\n args = Array.prototype.slice.call(arguments, 2),\n msg = messageFormat.replace(\n /%(\\d)/g,\n function (whole, index) {\n assert(index < args.length, 'Message reference must be in range');\n return args[index];\n }\n );\n\n if (typeof token.lineNumber === 'number') {\n error = new Error('Line ' + token.lineNumber + ': ' + msg);\n error.index = token.start;\n error.lineNumber = token.lineNumber;\n error.column = token.start - lineStart + 1;\n } else {\n error = new Error('Line ' + lineNumber + ': ' + msg);\n error.index = index;\n error.lineNumber = lineNumber;\n error.column = index - lineStart + 1;\n }\n\n error.description = msg;\n throw error;\n }\n\n function throwErrorTolerant() {\n try {\n throwError.apply(null, arguments);\n } catch (e) {\n if (extra.errors) {\n extra.errors.push(e);\n } else {\n throw e;\n }\n }\n }\n\n\n // Throw an exception because of the token.\n\n function throwUnexpected(token) {\n if (token.type === Token.EOF) {\n throwError(token, Messages.UnexpectedEOS);\n }\n\n if (token.type === Token.NumericLiteral) {\n throwError(token, Messages.UnexpectedNumber);\n }\n\n if (token.type === Token.StringLiteral) {\n throwError(token, Messages.UnexpectedString);\n }\n\n if (token.type === Token.Identifier) {\n throwError(token, Messages.UnexpectedIdentifier);\n }\n\n if (token.type === Token.Keyword) {\n if (isFutureReservedWord(token.value)) {\n throwError(token, Messages.UnexpectedReserved);\n } else if (strict && isStrictModeReservedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictReservedWord);\n return;\n }\n throwError(token, Messages.UnexpectedToken, token.value);\n }\n\n // BooleanLiteral, NullLiteral, or Punctuator.\n throwError(token, Messages.UnexpectedToken, token.value);\n }\n\n // Expect the next token to match the specified punctuator.\n // If not, an exception will be thrown.\n\n function expect(value) {\n var token = lex();\n if (token.type !== Token.Punctuator || token.value !== value) {\n throwUnexpected(token);\n }\n }\n\n // Expect the next token to match the specified keyword.\n // If not, an exception will be thrown.\n\n function expectKeyword(keyword) {\n var token = lex();\n if (token.type !== Token.Keyword || token.value !== keyword) {\n throwUnexpected(token);\n }\n }\n\n // Return true if the next token matches the specified punctuator.\n\n function match(value) {\n return lookahead.type === Token.Punctuator && lookahead.value === value;\n }\n\n // Return true if the next token matches the specified keyword\n\n function matchKeyword(keyword) {\n return lookahead.type === Token.Keyword && lookahead.value === keyword;\n }\n\n // Return true if the next token is an assignment operator\n\n function matchAssign() {\n var op;\n\n if (lookahead.type !== Token.Punctuator) {\n return false;\n }\n op = lookahead.value;\n return op === '=' ||\n op === '*=' ||\n op === '/=' ||\n op === '%=' ||\n op === '+=' ||\n op === '-=' ||\n op === '<<=' ||\n op === '>>=' ||\n op === '>>>=' ||\n op === '&=' ||\n op === '^=' ||\n op === '|=';\n }\n\n function consumeSemicolon() {\n var line;\n\n // Catch the very common case first: immediately a semicolon (U+003B).\n if (source.charCodeAt(index) === 0x3B || match(';')) {\n lex();\n return;\n }\n\n line = lineNumber;\n skipComment();\n if (lineNumber !== line) {\n return;\n }\n\n if (lookahead.type !== Token.EOF && !match('}')) {\n throwUnexpected(lookahead);\n }\n }\n\n // Return true if provided expression is LeftHandSideExpression\n\n function isLeftHandSide(expr) {\n return expr.type === Syntax.Identifier || expr.type === Syntax.MemberExpression;\n }\n\n // 11.1.4 Array Initialiser\n\n function parseArrayInitialiser() {\n var elements = [], startToken;\n\n startToken = lookahead;\n expect('[');\n\n while (!match(']')) {\n if (match(',')) {\n lex();\n elements.push(null);\n } else {\n elements.push(parseAssignmentExpression());\n\n if (!match(']')) {\n expect(',');\n }\n }\n }\n\n lex();\n\n return delegate.markEnd(delegate.createArrayExpression(elements), startToken);\n }\n\n // 11.1.5 Object Initialiser\n\n function parsePropertyFunction(param, first) {\n var previousStrict, body, startToken;\n\n previousStrict = strict;\n startToken = lookahead;\n body = parseFunctionSourceElements();\n if (first && strict && isRestrictedWord(param[0].name)) {\n throwErrorTolerant(first, Messages.StrictParamName);\n }\n strict = previousStrict;\n return delegate.markEnd(delegate.createFunctionExpression(null, param, [], body), startToken);\n }\n\n function parseObjectPropertyKey() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n // Note: This function is called only from parseObjectProperty(), where\n // EOF and Punctuator tokens are already filtered out.\n\n if (token.type === Token.StringLiteral || token.type === Token.NumericLiteral) {\n if (strict && token.octal) {\n throwErrorTolerant(token, Messages.StrictOctalLiteral);\n }\n return delegate.markEnd(delegate.createLiteral(token), startToken);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseObjectProperty() {\n var token, key, id, value, param, startToken;\n\n token = lookahead;\n startToken = lookahead;\n\n if (token.type === Token.Identifier) {\n\n id = parseObjectPropertyKey();\n\n // Property Assignment: Getter and Setter.\n\n if (token.value === 'get' && !match(':')) {\n key = parseObjectPropertyKey();\n expect('(');\n expect(')');\n value = parsePropertyFunction([]);\n return delegate.markEnd(delegate.createProperty('get', key, value), startToken);\n }\n if (token.value === 'set' && !match(':')) {\n key = parseObjectPropertyKey();\n expect('(');\n token = lookahead;\n if (token.type !== Token.Identifier) {\n expect(')');\n throwErrorTolerant(token, Messages.UnexpectedToken, token.value);\n value = parsePropertyFunction([]);\n } else {\n param = [ parseVariableIdentifier() ];\n expect(')');\n value = parsePropertyFunction(param, token);\n }\n return delegate.markEnd(delegate.createProperty('set', key, value), startToken);\n }\n expect(':');\n value = parseAssignmentExpression();\n return delegate.markEnd(delegate.createProperty('init', id, value), startToken);\n }\n if (token.type === Token.EOF || token.type === Token.Punctuator) {\n throwUnexpected(token);\n } else {\n key = parseObjectPropertyKey();\n expect(':');\n value = parseAssignmentExpression();\n return delegate.markEnd(delegate.createProperty('init', key, value), startToken);\n }\n }\n\n function parseObjectInitialiser() {\n var properties = [], property, name, key, kind, map = {}, toString = String, startToken;\n\n startToken = lookahead;\n\n expect('{');\n\n while (!match('}')) {\n property = parseObjectProperty();\n\n if (property.key.type === Syntax.Identifier) {\n name = property.key.name;\n } else {\n name = toString(property.key.value);\n }\n kind = (property.kind === 'init') ? PropertyKind.Data : (property.kind === 'get') ? PropertyKind.Get : PropertyKind.Set;\n\n key = '$' + name;\n if (Object.prototype.hasOwnProperty.call(map, key)) {\n if (map[key] === PropertyKind.Data) {\n if (strict && kind === PropertyKind.Data) {\n throwErrorTolerant({}, Messages.StrictDuplicateProperty);\n } else if (kind !== PropertyKind.Data) {\n throwErrorTolerant({}, Messages.AccessorDataProperty);\n }\n } else {\n if (kind === PropertyKind.Data) {\n throwErrorTolerant({}, Messages.AccessorDataProperty);\n } else if (map[key] & kind) {\n throwErrorTolerant({}, Messages.AccessorGetSet);\n }\n }\n map[key] |= kind;\n } else {\n map[key] = kind;\n }\n\n properties.push(property);\n\n if (!match('}')) {\n expect(',');\n }\n }\n\n expect('}');\n\n return delegate.markEnd(delegate.createObjectExpression(properties), startToken);\n }\n\n // 11.1.6 The Grouping Operator\n\n function parseGroupExpression() {\n var expr;\n\n expect('(');\n\n expr = parseExpression();\n\n expect(')');\n\n return expr;\n }\n\n\n // 11.1 Primary Expressions\n\n function parsePrimaryExpression() {\n var type, token, expr, startToken;\n\n if (match('(')) {\n return parseGroupExpression();\n }\n\n if (match('[')) {\n return parseArrayInitialiser();\n }\n\n if (match('{')) {\n return parseObjectInitialiser();\n }\n\n type = lookahead.type;\n startToken = lookahead;\n\n if (type === Token.Identifier) {\n expr = delegate.createIdentifier(lex().value);\n } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {\n if (strict && lookahead.octal) {\n throwErrorTolerant(lookahead, Messages.StrictOctalLiteral);\n }\n expr = delegate.createLiteral(lex());\n } else if (type === Token.Keyword) {\n if (matchKeyword('function')) {\n return parseFunctionExpression();\n }\n if (matchKeyword('this')) {\n lex();\n expr = delegate.createThisExpression();\n } else {\n throwUnexpected(lex());\n }\n } else if (type === Token.BooleanLiteral) {\n token = lex();\n token.value = (token.value === 'true');\n expr = delegate.createLiteral(token);\n } else if (type === Token.NullLiteral) {\n token = lex();\n token.value = null;\n expr = delegate.createLiteral(token);\n } else if (match('/') || match('/=')) {\n if (typeof extra.tokens !== 'undefined') {\n expr = delegate.createLiteral(collectRegex());\n } else {\n expr = delegate.createLiteral(scanRegExp());\n }\n peek();\n } else {\n throwUnexpected(lex());\n }\n\n return delegate.markEnd(expr, startToken);\n }\n\n // 11.2 Left-Hand-Side Expressions\n\n function parseArguments() {\n var args = [];\n\n expect('(');\n\n if (!match(')')) {\n while (index < length) {\n args.push(parseAssignmentExpression());\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n\n expect(')');\n\n return args;\n }\n\n function parseNonComputedProperty() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n if (!isIdentifierName(token)) {\n throwUnexpected(token);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseNonComputedMember() {\n expect('.');\n\n return parseNonComputedProperty();\n }\n\n function parseComputedMember() {\n var expr;\n\n expect('[');\n\n expr = parseExpression();\n\n expect(']');\n\n return expr;\n }\n\n function parseNewExpression() {\n var callee, args, startToken;\n\n startToken = lookahead;\n expectKeyword('new');\n callee = parseLeftHandSideExpression();\n args = match('(') ? parseArguments() : [];\n\n return delegate.markEnd(delegate.createNewExpression(callee, args), startToken);\n }\n\n function parseLeftHandSideExpressionAllowCall() {\n var previousAllowIn, expr, args, property, startToken;\n\n startToken = lookahead;\n\n previousAllowIn = state.allowIn;\n state.allowIn = true;\n expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();\n state.allowIn = previousAllowIn;\n\n for (;;) {\n if (match('.')) {\n property = parseNonComputedMember();\n expr = delegate.createMemberExpression('.', expr, property);\n } else if (match('(')) {\n args = parseArguments();\n expr = delegate.createCallExpression(expr, args);\n } else if (match('[')) {\n property = parseComputedMember();\n expr = delegate.createMemberExpression('[', expr, property);\n } else {\n break;\n }\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n function parseLeftHandSideExpression() {\n var previousAllowIn, expr, property, startToken;\n\n startToken = lookahead;\n\n previousAllowIn = state.allowIn;\n expr = matchKeyword('new') ? parseNewExpression() : parsePrimaryExpression();\n state.allowIn = previousAllowIn;\n\n while (match('.') || match('[')) {\n if (match('[')) {\n property = parseComputedMember();\n expr = delegate.createMemberExpression('[', expr, property);\n } else {\n property = parseNonComputedMember();\n expr = delegate.createMemberExpression('.', expr, property);\n }\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n // 11.3 Postfix Expressions\n\n function parsePostfixExpression() {\n var expr, token, startToken = lookahead;\n\n expr = parseLeftHandSideExpressionAllowCall();\n\n if (lookahead.type === Token.Punctuator) {\n if ((match('++') || match('--')) && !peekLineTerminator()) {\n // 11.3.1, 11.3.2\n if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {\n throwErrorTolerant({}, Messages.StrictLHSPostfix);\n }\n\n if (!isLeftHandSide(expr)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n token = lex();\n expr = delegate.markEnd(delegate.createPostfixExpression(token.value, expr), startToken);\n }\n }\n\n return expr;\n }\n\n // 11.4 Unary Operators\n\n function parseUnaryExpression() {\n var token, expr, startToken;\n\n if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {\n expr = parsePostfixExpression();\n } else if (match('++') || match('--')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n // 11.4.4, 11.4.5\n if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {\n throwErrorTolerant({}, Messages.StrictLHSPrefix);\n }\n\n if (!isLeftHandSide(expr)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n } else if (match('+') || match('-') || match('~') || match('!')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {\n startToken = lookahead;\n token = lex();\n expr = parseUnaryExpression();\n expr = delegate.createUnaryExpression(token.value, expr);\n expr = delegate.markEnd(expr, startToken);\n if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) {\n throwErrorTolerant({}, Messages.StrictDelete);\n }\n } else {\n expr = parsePostfixExpression();\n }\n\n return expr;\n }\n\n function binaryPrecedence(token, allowIn) {\n var prec = 0;\n\n if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {\n return 0;\n }\n\n switch (token.value) {\n case '||':\n prec = 1;\n break;\n\n case '&&':\n prec = 2;\n break;\n\n case '|':\n prec = 3;\n break;\n\n case '^':\n prec = 4;\n break;\n\n case '&':\n prec = 5;\n break;\n\n case '==':\n case '!=':\n case '===':\n case '!==':\n prec = 6;\n break;\n\n case '<':\n case '>':\n case '<=':\n case '>=':\n case 'instanceof':\n prec = 7;\n break;\n\n case 'in':\n prec = allowIn ? 7 : 0;\n break;\n\n case '<<':\n case '>>':\n case '>>>':\n prec = 8;\n break;\n\n case '+':\n case '-':\n prec = 9;\n break;\n\n case '*':\n case '/':\n case '%':\n prec = 11;\n break;\n\n default:\n break;\n }\n\n return prec;\n }\n\n // 11.5 Multiplicative Operators\n // 11.6 Additive Operators\n // 11.7 Bitwise Shift Operators\n // 11.8 Relational Operators\n // 11.9 Equality Operators\n // 11.10 Binary Bitwise Operators\n // 11.11 Binary Logical Operators\n\n function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers[markers.length - 1];\n delegate.markEnd(expr, marker);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n delegate.markEnd(expr, marker);\n }\n\n return expr;\n }\n\n\n // 11.12 Conditional Operator\n\n function parseConditionalExpression() {\n var expr, previousAllowIn, consequent, alternate, startToken;\n\n startToken = lookahead;\n\n expr = parseBinaryExpression();\n\n if (match('?')) {\n lex();\n previousAllowIn = state.allowIn;\n state.allowIn = true;\n consequent = parseAssignmentExpression();\n state.allowIn = previousAllowIn;\n expect(':');\n alternate = parseAssignmentExpression();\n\n expr = delegate.createConditionalExpression(expr, consequent, alternate);\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n // 11.13 Assignment Operators\n\n function parseAssignmentExpression() {\n var token, left, right, node, startToken;\n\n token = lookahead;\n startToken = lookahead;\n\n node = left = parseConditionalExpression();\n\n if (matchAssign()) {\n // LeftHandSideExpression\n if (!isLeftHandSide(left)) {\n throwErrorTolerant({}, Messages.InvalidLHSInAssignment);\n }\n\n // 11.13.1\n if (strict && left.type === Syntax.Identifier && isRestrictedWord(left.name)) {\n throwErrorTolerant(token, Messages.StrictLHSAssignment);\n }\n\n token = lex();\n right = parseAssignmentExpression();\n node = delegate.markEnd(delegate.createAssignmentExpression(token.value, left, right), startToken);\n }\n\n return node;\n }\n\n // 11.14 Comma Operator\n\n function parseExpression() {\n var expr, startToken = lookahead;\n\n expr = parseAssignmentExpression();\n\n if (match(',')) {\n expr = delegate.createSequenceExpression([ expr ]);\n\n while (index < length) {\n if (!match(',')) {\n break;\n }\n lex();\n expr.expressions.push(parseAssignmentExpression());\n }\n\n delegate.markEnd(expr, startToken);\n }\n\n return expr;\n }\n\n // 12.1 Block\n\n function parseStatementList() {\n var list = [],\n statement;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n statement = parseSourceElement();\n if (typeof statement === 'undefined') {\n break;\n }\n list.push(statement);\n }\n\n return list;\n }\n\n function parseBlock() {\n var block, startToken;\n\n startToken = lookahead;\n expect('{');\n\n block = parseStatementList();\n\n expect('}');\n\n return delegate.markEnd(delegate.createBlockStatement(block), startToken);\n }\n\n // 12.2 Variable Statement\n\n function parseVariableIdentifier() {\n var token, startToken;\n\n startToken = lookahead;\n token = lex();\n\n if (token.type !== Token.Identifier) {\n throwUnexpected(token);\n }\n\n return delegate.markEnd(delegate.createIdentifier(token.value), startToken);\n }\n\n function parseVariableDeclaration(kind) {\n var init = null, id, startToken;\n\n startToken = lookahead;\n id = parseVariableIdentifier();\n\n // 12.2.1\n if (strict && isRestrictedWord(id.name)) {\n throwErrorTolerant({}, Messages.StrictVarName);\n }\n\n if (kind === 'const') {\n expect('=');\n init = parseAssignmentExpression();\n } else if (match('=')) {\n lex();\n init = parseAssignmentExpression();\n }\n\n return delegate.markEnd(delegate.createVariableDeclarator(id, init), startToken);\n }\n\n function parseVariableDeclarationList(kind) {\n var list = [];\n\n do {\n list.push(parseVariableDeclaration(kind));\n if (!match(',')) {\n break;\n }\n lex();\n } while (index < length);\n\n return list;\n }\n\n function parseVariableStatement() {\n var declarations;\n\n expectKeyword('var');\n\n declarations = parseVariableDeclarationList();\n\n consumeSemicolon();\n\n return delegate.createVariableDeclaration(declarations, 'var');\n }\n\n // kind may be `const` or `let`\n // Both are experimental and not in the specification yet.\n // see http://wiki.ecmascript.org/doku.php?id=harmony:const\n // and http://wiki.ecmascript.org/doku.php?id=harmony:let\n function parseConstLetDeclaration(kind) {\n var declarations, startToken;\n\n startToken = lookahead;\n\n expectKeyword(kind);\n\n declarations = parseVariableDeclarationList(kind);\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, kind), startToken);\n }\n\n // 12.3 Empty Statement\n\n function parseEmptyStatement() {\n expect(';');\n return delegate.createEmptyStatement();\n }\n\n // 12.4 Expression Statement\n\n function parseExpressionStatement() {\n var expr = parseExpression();\n consumeSemicolon();\n return delegate.createExpressionStatement(expr);\n }\n\n // 12.5 If statement\n\n function parseIfStatement() {\n var test, consequent, alternate;\n\n expectKeyword('if');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n consequent = parseStatement();\n\n if (matchKeyword('else')) {\n lex();\n alternate = parseStatement();\n } else {\n alternate = null;\n }\n\n return delegate.createIfStatement(test, consequent, alternate);\n }\n\n // 12.6 Iteration Statements\n\n function parseDoWhileStatement() {\n var body, test, oldInIteration;\n\n expectKeyword('do');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n expectKeyword('while');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n if (match(';')) {\n lex();\n }\n\n return delegate.createDoWhileStatement(body, test);\n }\n\n function parseWhileStatement() {\n var test, body, oldInIteration;\n\n expectKeyword('while');\n\n expect('(');\n\n test = parseExpression();\n\n expect(')');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n return delegate.createWhileStatement(test, body);\n }\n\n function parseForVariableDeclaration() {\n var token, declarations, startToken;\n\n startToken = lookahead;\n token = lex();\n declarations = parseVariableDeclarationList();\n\n return delegate.markEnd(delegate.createVariableDeclaration(declarations, token.value), startToken);\n }\n\n function parseForStatement() {\n var init, test, update, left, right, body, oldInIteration;\n\n init = test = update = null;\n\n expectKeyword('for');\n\n expect('(');\n\n if (match(';')) {\n lex();\n } else {\n if (matchKeyword('var') || matchKeyword('let')) {\n state.allowIn = false;\n init = parseForVariableDeclaration();\n state.allowIn = true;\n\n if (init.declarations.length === 1 && matchKeyword('in')) {\n lex();\n left = init;\n right = parseExpression();\n init = null;\n }\n } else {\n state.allowIn = false;\n init = parseExpression();\n state.allowIn = true;\n\n if (matchKeyword('in')) {\n // LeftHandSideExpression\n if (!isLeftHandSide(init)) {\n throwErrorTolerant({}, Messages.InvalidLHSInForIn);\n }\n\n lex();\n left = init;\n right = parseExpression();\n init = null;\n }\n }\n\n if (typeof left === 'undefined') {\n expect(';');\n }\n }\n\n if (typeof left === 'undefined') {\n\n if (!match(';')) {\n test = parseExpression();\n }\n expect(';');\n\n if (!match(')')) {\n update = parseExpression();\n }\n }\n\n expect(')');\n\n oldInIteration = state.inIteration;\n state.inIteration = true;\n\n body = parseStatement();\n\n state.inIteration = oldInIteration;\n\n return (typeof left === 'undefined') ?\n delegate.createForStatement(init, test, update, body) :\n delegate.createForInStatement(left, right, body);\n }\n\n // 12.7 The continue statement\n\n function parseContinueStatement() {\n var label = null, key;\n\n expectKeyword('continue');\n\n // Optimize the most common form: 'continue;'.\n if (source.charCodeAt(index) === 0x3B) {\n lex();\n\n if (!state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(null);\n }\n\n if (peekLineTerminator()) {\n if (!state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(null);\n }\n\n if (lookahead.type === Token.Identifier) {\n label = parseVariableIdentifier();\n\n key = '$' + label.name;\n if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.UnknownLabel, label.name);\n }\n }\n\n consumeSemicolon();\n\n if (label === null && !state.inIteration) {\n throwError({}, Messages.IllegalContinue);\n }\n\n return delegate.createContinueStatement(label);\n }\n\n // 12.8 The break statement\n\n function parseBreakStatement() {\n var label = null, key;\n\n expectKeyword('break');\n\n // Catch the very common case first: immediately a semicolon (U+003B).\n if (source.charCodeAt(index) === 0x3B) {\n lex();\n\n if (!(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(null);\n }\n\n if (peekLineTerminator()) {\n if (!(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(null);\n }\n\n if (lookahead.type === Token.Identifier) {\n label = parseVariableIdentifier();\n\n key = '$' + label.name;\n if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.UnknownLabel, label.name);\n }\n }\n\n consumeSemicolon();\n\n if (label === null && !(state.inIteration || state.inSwitch)) {\n throwError({}, Messages.IllegalBreak);\n }\n\n return delegate.createBreakStatement(label);\n }\n\n // 12.9 The return statement\n\n function parseReturnStatement() {\n var argument = null;\n\n expectKeyword('return');\n\n if (!state.inFunctionBody) {\n throwErrorTolerant({}, Messages.IllegalReturn);\n }\n\n // 'return' followed by a space and an identifier is very common.\n if (source.charCodeAt(index) === 0x20) {\n if (isIdentifierStart(source.charCodeAt(index + 1))) {\n argument = parseExpression();\n consumeSemicolon();\n return delegate.createReturnStatement(argument);\n }\n }\n\n if (peekLineTerminator()) {\n return delegate.createReturnStatement(null);\n }\n\n if (!match(';')) {\n if (!match('}') && lookahead.type !== Token.EOF) {\n argument = parseExpression();\n }\n }\n\n consumeSemicolon();\n\n return delegate.createReturnStatement(argument);\n }\n\n // 12.10 The with statement\n\n function parseWithStatement() {\n var object, body;\n\n if (strict) {\n // TODO(ikarienator): Should we update the test cases instead?\n skipComment();\n throwErrorTolerant({}, Messages.StrictModeWith);\n }\n\n expectKeyword('with');\n\n expect('(');\n\n object = parseExpression();\n\n expect(')');\n\n body = parseStatement();\n\n return delegate.createWithStatement(object, body);\n }\n\n // 12.10 The swith statement\n\n function parseSwitchCase() {\n var test, consequent = [], statement, startToken;\n\n startToken = lookahead;\n if (matchKeyword('default')) {\n lex();\n test = null;\n } else {\n expectKeyword('case');\n test = parseExpression();\n }\n expect(':');\n\n while (index < length) {\n if (match('}') || matchKeyword('default') || matchKeyword('case')) {\n break;\n }\n statement = parseStatement();\n consequent.push(statement);\n }\n\n return delegate.markEnd(delegate.createSwitchCase(test, consequent), startToken);\n }\n\n function parseSwitchStatement() {\n var discriminant, cases, clause, oldInSwitch, defaultFound;\n\n expectKeyword('switch');\n\n expect('(');\n\n discriminant = parseExpression();\n\n expect(')');\n\n expect('{');\n\n cases = [];\n\n if (match('}')) {\n lex();\n return delegate.createSwitchStatement(discriminant, cases);\n }\n\n oldInSwitch = state.inSwitch;\n state.inSwitch = true;\n defaultFound = false;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n clause = parseSwitchCase();\n if (clause.test === null) {\n if (defaultFound) {\n throwError({}, Messages.MultipleDefaultsInSwitch);\n }\n defaultFound = true;\n }\n cases.push(clause);\n }\n\n state.inSwitch = oldInSwitch;\n\n expect('}');\n\n return delegate.createSwitchStatement(discriminant, cases);\n }\n\n // 12.13 The throw statement\n\n function parseThrowStatement() {\n var argument;\n\n expectKeyword('throw');\n\n if (peekLineTerminator()) {\n throwError({}, Messages.NewlineAfterThrow);\n }\n\n argument = parseExpression();\n\n consumeSemicolon();\n\n return delegate.createThrowStatement(argument);\n }\n\n // 12.14 The try statement\n\n function parseCatchClause() {\n var param, body, startToken;\n\n startToken = lookahead;\n expectKeyword('catch');\n\n expect('(');\n if (match(')')) {\n throwUnexpected(lookahead);\n }\n\n param = parseVariableIdentifier();\n // 12.14.1\n if (strict && isRestrictedWord(param.name)) {\n throwErrorTolerant({}, Messages.StrictCatchVariable);\n }\n\n expect(')');\n body = parseBlock();\n return delegate.markEnd(delegate.createCatchClause(param, body), startToken);\n }\n\n function parseTryStatement() {\n var block, handlers = [], finalizer = null;\n\n expectKeyword('try');\n\n block = parseBlock();\n\n if (matchKeyword('catch')) {\n handlers.push(parseCatchClause());\n }\n\n if (matchKeyword('finally')) {\n lex();\n finalizer = parseBlock();\n }\n\n if (handlers.length === 0 && !finalizer) {\n throwError({}, Messages.NoCatchOrFinally);\n }\n\n return delegate.createTryStatement(block, [], handlers, finalizer);\n }\n\n // 12.15 The debugger statement\n\n function parseDebuggerStatement() {\n expectKeyword('debugger');\n\n consumeSemicolon();\n\n return delegate.createDebuggerStatement();\n }\n\n // 12 Statements\n\n function parseStatement() {\n var type = lookahead.type,\n expr,\n labeledBody,\n key,\n startToken;\n\n if (type === Token.EOF) {\n throwUnexpected(lookahead);\n }\n\n if (type === Token.Punctuator && lookahead.value === '{') {\n return parseBlock();\n }\n\n startToken = lookahead;\n\n if (type === Token.Punctuator) {\n switch (lookahead.value) {\n case ';':\n return delegate.markEnd(parseEmptyStatement(), startToken);\n case '(':\n return delegate.markEnd(parseExpressionStatement(), startToken);\n default:\n break;\n }\n }\n\n if (type === Token.Keyword) {\n switch (lookahead.value) {\n case 'break':\n return delegate.markEnd(parseBreakStatement(), startToken);\n case 'continue':\n return delegate.markEnd(parseContinueStatement(), startToken);\n case 'debugger':\n return delegate.markEnd(parseDebuggerStatement(), startToken);\n case 'do':\n return delegate.markEnd(parseDoWhileStatement(), startToken);\n case 'for':\n return delegate.markEnd(parseForStatement(), startToken);\n case 'function':\n return delegate.markEnd(parseFunctionDeclaration(), startToken);\n case 'if':\n return delegate.markEnd(parseIfStatement(), startToken);\n case 'return':\n return delegate.markEnd(parseReturnStatement(), startToken);\n case 'switch':\n return delegate.markEnd(parseSwitchStatement(), startToken);\n case 'throw':\n return delegate.markEnd(parseThrowStatement(), startToken);\n case 'try':\n return delegate.markEnd(parseTryStatement(), startToken);\n case 'var':\n return delegate.markEnd(parseVariableStatement(), startToken);\n case 'while':\n return delegate.markEnd(parseWhileStatement(), startToken);\n case 'with':\n return delegate.markEnd(parseWithStatement(), startToken);\n default:\n break;\n }\n }\n\n expr = parseExpression();\n\n // 12.12 Labelled Statements\n if ((expr.type === Syntax.Identifier) && match(':')) {\n lex();\n\n key = '$' + expr.name;\n if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) {\n throwError({}, Messages.Redeclaration, 'Label', expr.name);\n }\n\n state.labelSet[key] = true;\n labeledBody = parseStatement();\n delete state.labelSet[key];\n return delegate.markEnd(delegate.createLabeledStatement(expr, labeledBody), startToken);\n }\n\n consumeSemicolon();\n\n return delegate.markEnd(delegate.createExpressionStatement(expr), startToken);\n }\n\n // 13 Function Definition\n\n function parseFunctionSourceElements() {\n var sourceElement, sourceElements = [], token, directive, firstRestricted,\n oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, startToken;\n\n startToken = lookahead;\n expect('{');\n\n while (index < length) {\n if (lookahead.type !== Token.StringLiteral) {\n break;\n }\n token = lookahead;\n\n sourceElement = parseSourceElement();\n sourceElements.push(sourceElement);\n if (sourceElement.expression.type !== Syntax.Literal) {\n // this is not directive\n break;\n }\n directive = source.slice(token.start + 1, token.end - 1);\n if (directive === 'use strict') {\n strict = true;\n if (firstRestricted) {\n throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);\n }\n } else {\n if (!firstRestricted && token.octal) {\n firstRestricted = token;\n }\n }\n }\n\n oldLabelSet = state.labelSet;\n oldInIteration = state.inIteration;\n oldInSwitch = state.inSwitch;\n oldInFunctionBody = state.inFunctionBody;\n\n state.labelSet = {};\n state.inIteration = false;\n state.inSwitch = false;\n state.inFunctionBody = true;\n\n while (index < length) {\n if (match('}')) {\n break;\n }\n sourceElement = parseSourceElement();\n if (typeof sourceElement === 'undefined') {\n break;\n }\n sourceElements.push(sourceElement);\n }\n\n expect('}');\n\n state.labelSet = oldLabelSet;\n state.inIteration = oldInIteration;\n state.inSwitch = oldInSwitch;\n state.inFunctionBody = oldInFunctionBody;\n\n return delegate.markEnd(delegate.createBlockStatement(sourceElements), startToken);\n }\n\n function parseParams(firstRestricted) {\n var param, params = [], token, stricted, paramSet, key, message;\n expect('(');\n\n if (!match(')')) {\n paramSet = {};\n while (index < length) {\n token = lookahead;\n param = parseVariableIdentifier();\n key = '$' + token.value;\n if (strict) {\n if (isRestrictedWord(token.value)) {\n stricted = token;\n message = Messages.StrictParamName;\n }\n if (Object.prototype.hasOwnProperty.call(paramSet, key)) {\n stricted = token;\n message = Messages.StrictParamDupe;\n }\n } else if (!firstRestricted) {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictParamName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n } else if (Object.prototype.hasOwnProperty.call(paramSet, key)) {\n firstRestricted = token;\n message = Messages.StrictParamDupe;\n }\n }\n params.push(param);\n paramSet[key] = true;\n if (match(')')) {\n break;\n }\n expect(',');\n }\n }\n\n expect(')');\n\n return {\n params: params,\n stricted: stricted,\n firstRestricted: firstRestricted,\n message: message\n };\n }\n\n function parseFunctionDeclaration() {\n var id, params = [], body, token, stricted, tmp, firstRestricted, message, previousStrict, startToken;\n\n startToken = lookahead;\n\n expectKeyword('function');\n token = lookahead;\n id = parseVariableIdentifier();\n if (strict) {\n if (isRestrictedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictFunctionName);\n }\n } else {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictFunctionName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n }\n }\n\n tmp = parseParams(firstRestricted);\n params = tmp.params;\n stricted = tmp.stricted;\n firstRestricted = tmp.firstRestricted;\n if (tmp.message) {\n message = tmp.message;\n }\n\n previousStrict = strict;\n body = parseFunctionSourceElements();\n if (strict && firstRestricted) {\n throwError(firstRestricted, message);\n }\n if (strict && stricted) {\n throwErrorTolerant(stricted, message);\n }\n strict = previousStrict;\n\n return delegate.markEnd(delegate.createFunctionDeclaration(id, params, [], body), startToken);\n }\n\n function parseFunctionExpression() {\n var token, id = null, stricted, firstRestricted, message, tmp, params = [], body, previousStrict, startToken;\n\n startToken = lookahead;\n expectKeyword('function');\n\n if (!match('(')) {\n token = lookahead;\n id = parseVariableIdentifier();\n if (strict) {\n if (isRestrictedWord(token.value)) {\n throwErrorTolerant(token, Messages.StrictFunctionName);\n }\n } else {\n if (isRestrictedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictFunctionName;\n } else if (isStrictModeReservedWord(token.value)) {\n firstRestricted = token;\n message = Messages.StrictReservedWord;\n }\n }\n }\n\n tmp = parseParams(firstRestricted);\n params = tmp.params;\n stricted = tmp.stricted;\n firstRestricted = tmp.firstRestricted;\n if (tmp.message) {\n message = tmp.message;\n }\n\n previousStrict = strict;\n body = parseFunctionSourceElements();\n if (strict && firstRestricted) {\n throwError(firstRestricted, message);\n }\n if (strict && stricted) {\n throwErrorTolerant(stricted, message);\n }\n strict = previousStrict;\n\n return delegate.markEnd(delegate.createFunctionExpression(id, params, [], body), startToken);\n }\n\n // 14 Program\n\n function parseSourceElement() {\n if (lookahead.type === Token.Keyword) {\n switch (lookahead.value) {\n case 'const':\n case 'let':\n return parseConstLetDeclaration(lookahead.value);\n case 'function':\n return parseFunctionDeclaration();\n default:\n return parseStatement();\n }\n }\n\n if (lookahead.type !== Token.EOF) {\n return parseStatement();\n }\n }\n\n function parseSourceElements() {\n var sourceElement, sourceElements = [], token, directive, firstRestricted;\n\n while (index < length) {\n token = lookahead;\n if (token.type !== Token.StringLiteral) {\n break;\n }\n\n sourceElement = parseSourceElement();\n sourceElements.push(sourceElement);\n if (sourceElement.expression.type !== Syntax.Literal) {\n // this is not directive\n break;\n }\n directive = source.slice(token.start + 1, token.end - 1);\n if (directive === 'use strict') {\n strict = true;\n if (firstRestricted) {\n throwErrorTolerant(firstRestricted, Messages.StrictOctalLiteral);\n }\n } else {\n if (!firstRestricted && token.octal) {\n firstRestricted = token;\n }\n }\n }\n\n while (index < length) {\n sourceElement = parseSourceElement();\n /* istanbul ignore if */\n if (typeof sourceElement === 'undefined') {\n break;\n }\n sourceElements.push(sourceElement);\n }\n return sourceElements;\n }\n\n function parseProgram() {\n var body, startToken;\n\n skipComment();\n peek();\n startToken = lookahead;\n strict = false;\n\n body = parseSourceElements();\n return delegate.markEnd(delegate.createProgram(body), startToken);\n }\n\n function filterTokenLocation() {\n var i, entry, token, tokens = [];\n\n for (i = 0; i < extra.tokens.length; ++i) {\n entry = extra.tokens[i];\n token = {\n type: entry.type,\n value: entry.value\n };\n if (extra.range) {\n token.range = entry.range;\n }\n if (extra.loc) {\n token.loc = entry.loc;\n }\n tokens.push(token);\n }\n\n extra.tokens = tokens;\n }\n\n function tokenize(code, options) {\n var toString,\n token,\n tokens;\n\n toString = String;\n if (typeof code !== 'string' && !(code instanceof String)) {\n code = toString(code);\n }\n\n delegate = SyntaxTreeDelegate;\n source = code;\n index = 0;\n lineNumber = (source.length > 0) ? 1 : 0;\n lineStart = 0;\n length = source.length;\n lookahead = null;\n state = {\n allowIn: true,\n labelSet: {},\n inFunctionBody: false,\n inIteration: false,\n inSwitch: false,\n lastCommentStart: -1\n };\n\n extra = {};\n\n // Options matching.\n options = options || {};\n\n // Of course we collect tokens here.\n options.tokens = true;\n extra.tokens = [];\n extra.tokenize = true;\n // The following two fields are necessary to compute the Regex tokens.\n extra.openParenToken = -1;\n extra.openCurlyToken = -1;\n\n extra.range = (typeof options.range === 'boolean') && options.range;\n extra.loc = (typeof options.loc === 'boolean') && options.loc;\n\n if (typeof options.comment === 'boolean' && options.comment) {\n extra.comments = [];\n }\n if (typeof options.tolerant === 'boolean' && options.tolerant) {\n extra.errors = [];\n }\n\n try {\n peek();\n if (lookahead.type === Token.EOF) {\n return extra.tokens;\n }\n\n token = lex();\n while (lookahead.type !== Token.EOF) {\n try {\n token = lex();\n } catch (lexError) {\n token = lookahead;\n if (extra.errors) {\n extra.errors.push(lexError);\n // We have to break on the first error\n // to avoid infinite loops.\n break;\n } else {\n throw lexError;\n }\n }\n }\n\n filterTokenLocation();\n tokens = extra.tokens;\n if (typeof extra.comments !== 'undefined') {\n tokens.comments = extra.comments;\n }\n if (typeof extra.errors !== 'undefined') {\n tokens.errors = extra.errors;\n }\n } catch (e) {\n throw e;\n } finally {\n extra = {};\n }\n return tokens;\n }\n\n function parse(code, options) {\n var program, toString;\n\n toString = String;\n if (typeof code !== 'string' && !(code instanceof String)) {\n code = toString(code);\n }\n\n delegate = SyntaxTreeDelegate;\n source = code;\n index = 0;\n lineNumber = (source.length > 0) ? 1 : 0;\n lineStart = 0;\n length = source.length;\n lookahead = null;\n state = {\n allowIn: true,\n labelSet: {},\n inFunctionBody: false,\n inIteration: false,\n inSwitch: false,\n lastCommentStart: -1\n };\n\n extra = {};\n if (typeof options !== 'undefined') {\n extra.range = (typeof options.range === 'boolean') && options.range;\n extra.loc = (typeof options.loc === 'boolean') && options.loc;\n extra.attachComment = (typeof options.attachComment === 'boolean') && options.attachComment;\n\n if (extra.loc && options.source !== null && options.source !== undefined) {\n extra.source = toString(options.source);\n }\n\n if (typeof options.tokens === 'boolean' && options.tokens) {\n extra.tokens = [];\n }\n if (typeof options.comment === 'boolean' && options.comment) {\n extra.comments = [];\n }\n if (typeof options.tolerant === 'boolean' && options.tolerant) {\n extra.errors = [];\n }\n if (extra.attachComment) {\n extra.range = true;\n extra.comments = [];\n extra.bottomRightStack = [];\n extra.trailingComments = [];\n extra.leadingComments = [];\n }\n }\n\n try {\n program = parseProgram();\n if (typeof extra.comments !== 'undefined') {\n program.comments = extra.comments;\n }\n if (typeof extra.tokens !== 'undefined') {\n filterTokenLocation();\n program.tokens = extra.tokens;\n }\n if (typeof extra.errors !== 'undefined') {\n program.errors = extra.errors;\n }\n } catch (e) {\n throw e;\n } finally {\n extra = {};\n }\n\n return program;\n }\n\n // Sync with *.json manifests.\n exports.version = '1.2.2';\n\n exports.tokenize = tokenize;\n\n exports.parse = parse;\n\n // Deep copy.\n /* istanbul ignore next */\n exports.Syntax = (function () {\n var name, types = {};\n\n if (typeof Object.create === 'function') {\n types = Object.create(null);\n }\n\n for (name in Syntax) {\n if (Syntax.hasOwnProperty(name)) {\n types[name] = Syntax[name];\n }\n }\n\n if (typeof Object.freeze === 'function') {\n Object.freeze(types);\n }\n\n return types;\n }());\n\n}));\n/* vim: set sw=4 ts=4 et tw=80 : */\n/**\n * @license Copyright (c) 2012-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*global define, Reflect */\n\n/*\n * xpcshell has a smaller stack on linux and windows (1MB vs 9MB on mac),\n * and the recursive nature of esprima can cause it to overflow pretty\n * quickly. So favor it built in Reflect parser:\n * https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API\n */\ndefine('esprimaAdapter', ['./esprima', 'env'], function (esprima, env) {\n if (env.get() === 'xpconnect' && typeof Reflect !== 'undefined') {\n return Reflect;\n } else {\n return esprima;\n }\n});\ndefine('uglifyjs/consolidator', [\"require\", \"exports\", \"module\", \"./parse-js\", \"./process\"], function(require, exports, module) {\n/**\n * @preserve Copyright 2012 Robert Gust-Bardon <http://robert.gust-bardon.org/>.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * * Redistributions of source code must retain the above\n * copyright notice, this list of conditions and the following\n * disclaimer.\n *\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n\n/**\n * @fileoverview Enhances <a href=\"https://github.com/mishoo/UglifyJS/\"\n * >UglifyJS</a> with consolidation of null, Boolean, and String values.\n * <p>Also known as aliasing, this feature has been deprecated in <a href=\n * \"http://closure-compiler.googlecode.com/\">the Closure Compiler</a> since its\n * initial release, where it is unavailable from the <abbr title=\n * \"command line interface\">CLI</a>. The Closure Compiler allows one to log and\n * influence this process. In contrast, this implementation does not introduce\n * any variable declarations in global code and derives String values from\n * identifier names used as property accessors.</p>\n * <p>Consolidating literals may worsen the data compression ratio when an <a\n * href=\"http://tools.ietf.org/html/rfc2616#section-3.5\">encoding\n * transformation</a> is applied. For instance, <a href=\n * \"http://code.jquery.com/jquery-1.7.1.js\">jQuery 1.7.1</a> takes 248235 bytes.\n * Building it with <a href=\"https://github.com/mishoo/UglifyJS/tarball/v1.2.5\">\n * UglifyJS v1.2.5</a> results in 93647 bytes (37.73% of the original) which are\n * then compressed to 33154 bytes (13.36% of the original) using <a href=\n * \"http://linux.die.net/man/1/gzip\">gzip(1)</a>. Building it with the same\n * version of UglifyJS 1.2.5 patched with the implementation of consolidation\n * results in 80784 bytes (a decrease of 12863 bytes, i.e. 13.74%, in comparison\n * to the aforementioned 93647 bytes) which are then compressed to 34013 bytes\n * (an increase of 859 bytes, i.e. 2.59%, in comparison to the aforementioned\n * 33154 bytes).</p>\n * <p>Written in <a href=\"http://es5.github.com/#x4.2.2\">the strict variant</a>\n * of <a href=\"http://es5.github.com/\">ECMA-262 5.1 Edition</a>. Encoded in <a\n * href=\"http://tools.ietf.org/html/rfc3629\">UTF-8</a>. Follows <a href=\n * \"http://google-styleguide.googlecode.com/svn-history/r76/trunk/javascriptguide.xml\"\n * >Revision 2.28 of the Google JavaScript Style Guide</a> (except for the\n * discouraged use of the {@code function} tag and the {@code namespace} tag).\n * 100% typed for the <a href=\n * \"http://closure-compiler.googlecode.com/files/compiler-20120123.tar.gz\"\n * >Closure Compiler Version 1741</a>.</p>\n * <p>Should you find this software useful, please consider <a href=\n * \"https://paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JZLW72X8FD4WG\"\n * >a donation</a>.</p>\n * @author follow.me@RGustBardon (Robert Gust-Bardon)\n * @supported Tested with:\n * <ul>\n * <li><a href=\"http://nodejs.org/dist/v0.6.10/\">Node v0.6.10</a>,</li>\n * <li><a href=\"https://github.com/mishoo/UglifyJS/tarball/v1.2.5\">UglifyJS\n * v1.2.5</a>.</li>\n * </ul>\n */\n\n/*global console:false, exports:true, module:false, require:false */\n/*jshint sub:true */\n/**\n * Consolidates null, Boolean, and String values found inside an <abbr title=\n * \"abstract syntax tree\">AST</abbr>.\n * @param {!TSyntacticCodeUnit} oAbstractSyntaxTree An array-like object\n * representing an <abbr title=\"abstract syntax tree\">AST</abbr>.\n * @return {!TSyntacticCodeUnit} An array-like object representing an <abbr\n * title=\"abstract syntax tree\">AST</abbr> with its null, Boolean, and\n * String values consolidated.\n */\n// TODO(user) Consolidation of mathematical values found in numeric literals.\n// TODO(user) Unconsolidation.\n// TODO(user) Consolidation of ECMA-262 6th Edition programs.\n// TODO(user) Rewrite in ECMA-262 6th Edition.\nexports['ast_consolidate'] = function(oAbstractSyntaxTree) {\n 'use strict';\n /*jshint bitwise:true, curly:true, eqeqeq:true, forin:true, immed:true,\n latedef:true, newcap:true, noarge:true, noempty:true, nonew:true,\n onevar:true, plusplus:true, regexp:true, undef:true, strict:true,\n sub:false, trailing:true */\n\n var _,\n /**\n * A record consisting of data about one or more source elements.\n * @constructor\n * @nosideeffects\n */\n TSourceElementsData = function() {\n /**\n * The category of the elements.\n * @type {number}\n * @see ESourceElementCategories\n */\n this.nCategory = ESourceElementCategories.N_OTHER;\n /**\n * The number of occurrences (within the elements) of each primitive\n * value that could be consolidated.\n * @type {!Array.<!Object.<string, number>>}\n */\n this.aCount = [];\n this.aCount[EPrimaryExpressionCategories.N_IDENTIFIER_NAMES] = {};\n this.aCount[EPrimaryExpressionCategories.N_STRING_LITERALS] = {};\n this.aCount[EPrimaryExpressionCategories.N_NULL_AND_BOOLEAN_LITERALS] =\n {};\n /**\n * Identifier names found within the elements.\n * @type {!Array.<string>}\n */\n this.aIdentifiers = [];\n /**\n * Prefixed representation Strings of each primitive value that could be\n * consolidated within the elements.\n * @type {!Array.<string>}\n */\n this.aPrimitiveValues = [];\n },\n /**\n * A record consisting of data about a primitive value that could be\n * consolidated.\n * @constructor\n * @nosideeffects\n */\n TPrimitiveValue = function() {\n /**\n * The difference in the number of terminal symbols between the original\n * source text and the one with the primitive value consolidated. If the\n * difference is positive, the primitive value is considered worthwhile.\n * @type {number}\n */\n this.nSaving = 0;\n /**\n * An identifier name of the variable that will be declared and assigned\n * the primitive value if the primitive value is consolidated.\n * @type {string}\n */\n this.sName = '';\n },\n /**\n * A record consisting of data on what to consolidate within the range of\n * source elements that is currently being considered.\n * @constructor\n * @nosideeffects\n */\n TSolution = function() {\n /**\n * An object whose keys are prefixed representation Strings of each\n * primitive value that could be consolidated within the elements and\n * whose values are corresponding data about those primitive values.\n * @type {!Object.<string, {nSaving: number, sName: string}>}\n * @see TPrimitiveValue\n */\n this.oPrimitiveValues = {};\n /**\n * The difference in the number of terminal symbols between the original\n * source text and the one with all the worthwhile primitive values\n * consolidated.\n * @type {number}\n * @see TPrimitiveValue#nSaving\n */\n this.nSavings = 0;\n },\n /**\n * The processor of <abbr title=\"abstract syntax tree\">AST</abbr>s found\n * in UglifyJS.\n * @namespace\n * @type {!TProcessor}\n */\n oProcessor = (/** @type {!TProcessor} */ require('./process')),\n /**\n * A record consisting of a number of constants that represent the\n * difference in the number of terminal symbols between a source text with\n * a modified syntactic code unit and the original one.\n * @namespace\n * @type {!Object.<string, number>}\n */\n oWeights = {\n /**\n * The difference in the number of punctuators required by the bracket\n * notation and the dot notation.\n * <p><code>'[]'.length - '.'.length</code></p>\n * @const\n * @type {number}\n */\n N_PROPERTY_ACCESSOR: 1,\n /**\n * The number of punctuators required by a variable declaration with an\n * initialiser.\n * <p><code>':'.length + ';'.length</code></p>\n * @const\n * @type {number}\n */\n N_VARIABLE_DECLARATION: 2,\n /**\n * The number of terminal symbols required to introduce a variable\n * statement (excluding its variable declaration list).\n * <p><code>'var '.length</code></p>\n * @const\n * @type {number}\n */\n N_VARIABLE_STATEMENT_AFFIXATION: 4,\n /**\n * The number of terminal symbols needed to enclose source elements\n * within a function call with no argument values to a function with an\n * empty parameter list.\n * <p><code>'(function(){}());'.length</code></p>\n * @const\n * @type {number}\n */\n N_CLOSURE: 17\n },\n /**\n * Categories of primary expressions from which primitive values that\n * could be consolidated are derivable.\n * @namespace\n * @enum {number}\n */\n EPrimaryExpressionCategories = {\n /**\n * Identifier names used as property accessors.\n * @type {number}\n */\n N_IDENTIFIER_NAMES: 0,\n /**\n * String literals.\n * @type {number}\n */\n N_STRING_LITERALS: 1,\n /**\n * Null and Boolean literals.\n * @type {number}\n */\n N_NULL_AND_BOOLEAN_LITERALS: 2\n },\n /**\n * Prefixes of primitive values that could be consolidated.\n * The String values of the prefixes must have same number of characters.\n * The prefixes must not be used in any properties defined in any version\n * of <a href=\n * \"http://www.ecma-international.org/publications/standards/Ecma-262.htm\"\n * >ECMA-262</a>.\n * @namespace\n * @enum {string}\n */\n EValuePrefixes = {\n /**\n * Identifies String values.\n * @type {string}\n */\n S_STRING: '#S',\n /**\n * Identifies null and Boolean values.\n * @type {string}\n */\n S_SYMBOLIC: '#O'\n },\n /**\n * Categories of source elements in terms of their appropriateness of\n * having their primitive values consolidated.\n * @namespace\n * @enum {number}\n */\n ESourceElementCategories = {\n /**\n * Identifies a source element that includes the <a href=\n * \"http://es5.github.com/#x12.10\">{@code with}</a> statement.\n * @type {number}\n */\n N_WITH: 0,\n /**\n * Identifies a source element that includes the <a href=\n * \"http://es5.github.com/#x15.1.2.1\">{@code eval}</a> identifier name.\n * @type {number}\n */\n N_EVAL: 1,\n /**\n * Identifies a source element that must be excluded from the process\n * unless its whole scope is examined.\n * @type {number}\n */\n N_EXCLUDABLE: 2,\n /**\n * Identifies source elements not posing any problems.\n * @type {number}\n */\n N_OTHER: 3\n },\n /**\n * The list of literals (other than the String ones) whose primitive\n * values can be consolidated.\n * @const\n * @type {!Array.<string>}\n */\n A_OTHER_SUBSTITUTABLE_LITERALS = [\n 'null', // The null literal.\n 'false', // The Boolean literal {@code false}.\n 'true' // The Boolean literal {@code true}.\n ];\n\n (/**\n * Consolidates all worthwhile primitive values in a syntactic code unit.\n * @param {!TSyntacticCodeUnit} oSyntacticCodeUnit An array-like object\n * representing the branch of the abstract syntax tree representing the\n * syntactic code unit along with its scope.\n * @see TPrimitiveValue#nSaving\n */\n function fExamineSyntacticCodeUnit(oSyntacticCodeUnit) {\n var _,\n /**\n * Indicates whether the syntactic code unit represents global code.\n * @type {boolean}\n */\n bIsGlobal = 'toplevel' === oSyntacticCodeUnit[0],\n /**\n * Indicates whether the whole scope is being examined.\n * @type {boolean}\n */\n bIsWhollyExaminable = !bIsGlobal,\n /**\n * An array-like object representing source elements that constitute a\n * syntactic code unit.\n * @type {!TSyntacticCodeUnit}\n */\n oSourceElements,\n /**\n * A record consisting of data about the source element that is\n * currently being examined.\n * @type {!TSourceElementsData}\n */\n oSourceElementData,\n /**\n * The scope of the syntactic code unit.\n * @type {!TScope}\n */\n oScope,\n /**\n * An instance of an object that allows the traversal of an <abbr\n * title=\"abstract syntax tree\">AST</abbr>.\n * @type {!TWalker}\n */\n oWalker,\n /**\n * An object encompassing collections of functions used during the\n * traversal of an <abbr title=\"abstract syntax tree\">AST</abbr>.\n * @namespace\n * @type {!Object.<string, !Object.<string, function(...[*])>>}\n */\n oWalkers = {\n /**\n * A collection of functions used during the surveyance of source\n * elements.\n * @namespace\n * @type {!Object.<string, function(...[*])>}\n */\n oSurveySourceElement: {\n /**#nocode+*/ // JsDoc Toolkit 2.4.0 hides some of the keys.\n /**\n * Classifies the source element as excludable if it does not\n * contain a {@code with} statement or the {@code eval} identifier\n * name. Adds the identifier of the function and its formal\n * parameters to the list of identifier names found.\n * @param {string} sIdentifier The identifier of the function.\n * @param {!Array.<string>} aFormalParameterList Formal parameters.\n * @param {!TSyntacticCodeUnit} oFunctionBody Function code.\n */\n 'defun': function(\n sIdentifier,\n aFormalParameterList,\n oFunctionBody) {\n fClassifyAsExcludable();\n fAddIdentifier(sIdentifier);\n aFormalParameterList.forEach(fAddIdentifier);\n },\n /**\n * Increments the count of the number of occurrences of the String\n * value that is equivalent to the sequence of terminal symbols\n * that constitute the encountered identifier name.\n * @param {!TSyntacticCodeUnit} oExpression The nonterminal\n * MemberExpression.\n * @param {string} sIdentifierName The identifier name used as the\n * property accessor.\n * @return {!Array} The encountered branch of an <abbr title=\n * \"abstract syntax tree\">AST</abbr> with its nonterminal\n * MemberExpression traversed.\n */\n 'dot': function(oExpression, sIdentifierName) {\n fCountPrimaryExpression(\n EPrimaryExpressionCategories.N_IDENTIFIER_NAMES,\n EValuePrefixes.S_STRING + sIdentifierName);\n return ['dot', oWalker.walk(oExpression), sIdentifierName];\n },\n /**\n * Adds the optional identifier of the function and its formal\n * parameters to the list of identifier names found.\n * @param {?string} sIdentifier The optional identifier of the\n * function.\n * @param {!Array.<string>} aFormalParameterList Formal parameters.\n * @param {!TSyntacticCodeUnit} oFunctionBody Function code.\n */\n 'function': function(\n sIdentifier,\n aFormalParameterList,\n oFunctionBody) {\n if ('string' === typeof sIdentifier) {\n fAddIdentifier(sIdentifier);\n }\n aFormalParameterList.forEach(fAddIdentifier);\n },\n /**\n * Either increments the count of the number of occurrences of the\n * encountered null or Boolean value or classifies a source element\n * as containing the {@code eval} identifier name.\n * @param {string} sIdentifier The identifier encountered.\n */\n 'name': function(sIdentifier) {\n if (-1 !== A_OTHER_SUBSTITUTABLE_LITERALS.indexOf(sIdentifier)) {\n fCountPrimaryExpression(\n EPrimaryExpressionCategories.N_NULL_AND_BOOLEAN_LITERALS,\n EValuePrefixes.S_SYMBOLIC + sIdentifier);\n } else {\n if ('eval' === sIdentifier) {\n oSourceElementData.nCategory =\n ESourceElementCategories.N_EVAL;\n }\n fAddIdentifier(sIdentifier);\n }\n },\n /**\n * Classifies the source element as excludable if it does not\n * contain a {@code with} statement or the {@code eval} identifier\n * name.\n * @param {TSyntacticCodeUnit} oExpression The expression whose\n * value is to be returned.\n */\n 'return': function(oExpression) {\n fClassifyAsExcludable();\n },\n /**\n * Increments the count of the number of occurrences of the\n * encountered String value.\n * @param {string} sStringValue The String value of the string\n * literal encountered.\n */\n 'string': function(sStringValue) {\n if (sStringValue.length > 0) {\n fCountPrimaryExpression(\n EPrimaryExpressionCategories.N_STRING_LITERALS,\n EValuePrefixes.S_STRING + sStringValue);\n }\n },\n /**\n * Adds the identifier reserved for an exception to the list of\n * identifier names found.\n * @param {!TSyntacticCodeUnit} oTry A block of code in which an\n * exception can occur.\n * @param {Array} aCatch The identifier reserved for an exception\n * and a block of code to handle the exception.\n * @param {TSyntacticCodeUnit} oFinally An optional block of code\n * to be evaluated regardless of whether an exception occurs.\n */\n 'try': function(oTry, aCatch, oFinally) {\n if (Array.isArray(aCatch)) {\n fAddIdentifier(aCatch[0]);\n }\n },\n /**\n * Classifies the source element as excludable if it does not\n * contain a {@code with} statement or the {@code eval} identifier\n * name. Adds the identifier of each declared variable to the list\n * of identifier names found.\n * @param {!Array.<!Array>} aVariableDeclarationList Variable\n * declarations.\n */\n 'var': function(aVariableDeclarationList) {\n fClassifyAsExcludable();\n aVariableDeclarationList.forEach(fAddVariable);\n },\n /**\n * Classifies a source element as containing the {@code with}\n * statement.\n * @param {!TSyntacticCodeUnit} oExpression An expression whose\n * value is to be converted to a value of type Object and\n * become the binding object of a new object environment\n * record of a new lexical environment in which the statement\n * is to be executed.\n * @param {!TSyntacticCodeUnit} oStatement The statement to be\n * executed in the augmented lexical environment.\n * @return {!Array} An empty array to stop the traversal.\n */\n 'with': function(oExpression, oStatement) {\n oSourceElementData.nCategory = ESourceElementCategories.N_WITH;\n return [];\n }\n /**#nocode-*/ // JsDoc Toolkit 2.4.0 hides some of the keys.\n },\n /**\n * A collection of functions used while looking for nested functions.\n * @namespace\n * @type {!Object.<string, function(...[*])>}\n */\n oExamineFunctions: {\n /**#nocode+*/ // JsDoc Toolkit 2.4.0 hides some of the keys.\n /**\n * Orders an examination of a nested function declaration.\n * @this {!TSyntacticCodeUnit} An array-like object representing\n * the branch of an <abbr title=\"abstract syntax tree\"\n * >AST</abbr> representing the syntactic code unit along with\n * its scope.\n * @return {!Array} An empty array to stop the traversal.\n */\n 'defun': function() {\n fExamineSyntacticCodeUnit(this);\n return [];\n },\n /**\n * Orders an examination of a nested function expression.\n * @this {!TSyntacticCodeUnit} An array-like object representing\n * the branch of an <abbr title=\"abstract syntax tree\"\n * >AST</abbr> representing the syntactic code unit along with\n * its scope.\n * @return {!Array} An empty array to stop the traversal.\n */\n 'function': function() {\n fExamineSyntacticCodeUnit(this);\n return [];\n }\n /**#nocode-*/ // JsDoc Toolkit 2.4.0 hides some of the keys.\n }\n },\n /**\n * Records containing data about source elements.\n * @type {Array.<TSourceElementsData>}\n */\n aSourceElementsData = [],\n /**\n * The index (in the source text order) of the source element\n * immediately following a <a href=\"http://es5.github.com/#x14.1\"\n * >Directive Prologue</a>.\n * @type {number}\n */\n nAfterDirectivePrologue = 0,\n /**\n * The index (in the source text order) of the source element that is\n * currently being considered.\n * @type {number}\n */\n nPosition,\n /**\n * The index (in the source text order) of the source element that is\n * the last element of the range of source elements that is currently\n * being considered.\n * @type {(undefined|number)}\n */\n nTo,\n /**\n * Initiates the traversal of a source element.\n * @param {!TWalker} oWalker An instance of an object that allows the\n * traversal of an abstract syntax tree.\n * @param {!TSyntacticCodeUnit} oSourceElement A source element from\n * which the traversal should commence.\n * @return {function(): !TSyntacticCodeUnit} A function that is able to\n * initiate the traversal from a given source element.\n */\n cContext = function(oWalker, oSourceElement) {\n /**\n * @return {!TSyntacticCodeUnit} A function that is able to\n * initiate the traversal from a given source element.\n */\n var fLambda = function() {\n return oWalker.walk(oSourceElement);\n };\n\n return fLambda;\n },\n /**\n * Classifies the source element as excludable if it does not\n * contain a {@code with} statement or the {@code eval} identifier\n * name.\n */\n fClassifyAsExcludable = function() {\n if (oSourceElementData.nCategory ===\n ESourceElementCategories.N_OTHER) {\n oSourceElementData.nCategory =\n ESourceElementCategories.N_EXCLUDABLE;\n }\n },\n /**\n * Adds an identifier to the list of identifier names found.\n * @param {string} sIdentifier The identifier to be added.\n */\n fAddIdentifier = function(sIdentifier) {\n if (-1 === oSourceElementData.aIdentifiers.indexOf(sIdentifier)) {\n oSourceElementData.aIdentifiers.push(sIdentifier);\n }\n },\n /**\n * Adds the identifier of a variable to the list of identifier names\n * found.\n * @param {!Array} aVariableDeclaration A variable declaration.\n */\n fAddVariable = function(aVariableDeclaration) {\n fAddIdentifier(/** @type {string} */ aVariableDeclaration[0]);\n },\n /**\n * Increments the count of the number of occurrences of the prefixed\n * String representation attributed to the primary expression.\n * @param {number} nCategory The category of the primary expression.\n * @param {string} sName The prefixed String representation attributed\n * to the primary expression.\n */\n fCountPrimaryExpression = function(nCategory, sName) {\n if (!oSourceElementData.aCount[nCategory].hasOwnProperty(sName)) {\n oSourceElementData.aCount[nCategory][sName] = 0;\n if (-1 === oSourceElementData.aPrimitiveValues.indexOf(sName)) {\n oSourceElementData.aPrimitiveValues.push(sName);\n }\n }\n oSourceElementData.aCount[nCategory][sName] += 1;\n },\n /**\n * Consolidates all worthwhile primitive values in a range of source\n * elements.\n * @param {number} nFrom The index (in the source text order) of the\n * source element that is the first element of the range.\n * @param {number} nTo The index (in the source text order) of the\n * source element that is the last element of the range.\n * @param {boolean} bEnclose Indicates whether the range should be\n * enclosed within a function call with no argument values to a\n * function with an empty parameter list if any primitive values\n * are consolidated.\n * @see TPrimitiveValue#nSaving\n */\n fExamineSourceElements = function(nFrom, nTo, bEnclose) {\n var _,\n /**\n * The index of the last mangled name.\n * @type {number}\n */\n nIndex = oScope.cname,\n /**\n * The index of the source element that is currently being\n * considered.\n * @type {number}\n */\n nPosition,\n /**\n * A collection of functions used during the consolidation of\n * primitive values and identifier names used as property\n * accessors.\n * @namespace\n * @type {!Object.<string, function(...[*])>}\n */\n oWalkersTransformers = {\n /**\n * If the String value that is equivalent to the sequence of\n * terminal symbols that constitute the encountered identifier\n * name is worthwhile, a syntactic conversion from the dot\n * notation to the bracket notation ensues with that sequence\n * being substituted by an identifier name to which the value\n * is assigned.\n * Applies to property accessors that use the dot notation.\n * @param {!TSyntacticCodeUnit} oExpression The nonterminal\n * MemberExpression.\n * @param {string} sIdentifierName The identifier name used as\n * the property accessor.\n * @return {!Array} A syntactic code unit that is equivalent to\n * the one encountered.\n * @see TPrimitiveValue#nSaving\n */\n 'dot': function(oExpression, sIdentifierName) {\n /**\n * The prefixed String value that is equivalent to the\n * sequence of terminal symbols that constitute the\n * encountered identifier name.\n * @type {string}\n */\n var sPrefixed = EValuePrefixes.S_STRING + sIdentifierName;\n\n return oSolutionBest.oPrimitiveValues.hasOwnProperty(\n sPrefixed) &&\n oSolutionBest.oPrimitiveValues[sPrefixed].nSaving > 0 ?\n ['sub',\n oWalker.walk(oExpression),\n ['name',\n oSolutionBest.oPrimitiveValues[sPrefixed].sName]] :\n ['dot', oWalker.walk(oExpression), sIdentifierName];\n },\n /**\n * If the encountered identifier is a null or Boolean literal\n * and its value is worthwhile, the identifier is substituted\n * by an identifier name to which that value is assigned.\n * Applies to identifier names.\n * @param {string} sIdentifier The identifier encountered.\n * @return {!Array} A syntactic code unit that is equivalent to\n * the one encountered.\n * @see TPrimitiveValue#nSaving\n */\n 'name': function(sIdentifier) {\n /**\n * The prefixed representation String of the identifier.\n * @type {string}\n */\n var sPrefixed = EValuePrefixes.S_SYMBOLIC + sIdentifier;\n\n return [\n 'name',\n oSolutionBest.oPrimitiveValues.hasOwnProperty(sPrefixed) &&\n oSolutionBest.oPrimitiveValues[sPrefixed].nSaving > 0 ?\n oSolutionBest.oPrimitiveValues[sPrefixed].sName :\n sIdentifier\n ];\n },\n /**\n * If the encountered String value is worthwhile, it is\n * substituted by an identifier name to which that value is\n * assigned.\n * Applies to String values.\n * @param {string} sStringValue The String value of the string\n * literal encountered.\n * @return {!Array} A syntactic code unit that is equivalent to\n * the one encountered.\n * @see TPrimitiveValue#nSaving\n */\n 'string': function(sStringValue) {\n /**\n * The prefixed representation String of the primitive value\n * of the literal.\n * @type {string}\n */\n var sPrefixed =\n EValuePrefixes.S_STRING + sStringValue;\n\n return oSolutionBest.oPrimitiveValues.hasOwnProperty(\n sPrefixed) &&\n oSolutionBest.oPrimitiveValues[sPrefixed].nSaving > 0 ?\n ['name',\n oSolutionBest.oPrimitiveValues[sPrefixed].sName] :\n ['string', sStringValue];\n }\n },\n /**\n * Such data on what to consolidate within the range of source\n * elements that is currently being considered that lead to the\n * greatest known reduction of the number of the terminal symbols\n * in comparison to the original source text.\n * @type {!TSolution}\n */\n oSolutionBest = new TSolution(),\n /**\n * Data representing an ongoing attempt to find a better\n * reduction of the number of the terminal symbols in comparison\n * to the original source text than the best one that is\n * currently known.\n * @type {!TSolution}\n * @see oSolutionBest\n */\n oSolutionCandidate = new TSolution(),\n /**\n * A record consisting of data about the range of source elements\n * that is currently being examined.\n * @type {!TSourceElementsData}\n */\n oSourceElementsData = new TSourceElementsData(),\n /**\n * Variable declarations for each primitive value that is to be\n * consolidated within the elements.\n * @type {!Array.<!Array>}\n */\n aVariableDeclarations = [],\n /**\n * Augments a list with a prefixed representation String.\n * @param {!Array.<string>} aList A list that is to be augmented.\n * @return {function(string)} A function that augments a list\n * with a prefixed representation String.\n */\n cAugmentList = function(aList) {\n /**\n * @param {string} sPrefixed Prefixed representation String of\n * a primitive value that could be consolidated within the\n * elements.\n */\n var fLambda = function(sPrefixed) {\n if (-1 === aList.indexOf(sPrefixed)) {\n aList.push(sPrefixed);\n }\n };\n\n return fLambda;\n },\n /**\n * Adds the number of occurrences of a primitive value of a given\n * category that could be consolidated in the source element with\n * a given index to the count of occurrences of that primitive\n * value within the range of source elements that is currently\n * being considered.\n * @param {number} nPosition The index (in the source text order)\n * of a source element.\n * @param {number} nCategory The category of the primary\n * expression from which the primitive value is derived.\n * @return {function(string)} A function that performs the\n * addition.\n * @see cAddOccurrencesInCategory\n */\n cAddOccurrences = function(nPosition, nCategory) {\n /**\n * @param {string} sPrefixed The prefixed representation String\n * of a primitive value.\n */\n var fLambda = function(sPrefixed) {\n if (!oSourceElementsData.aCount[nCategory].hasOwnProperty(\n sPrefixed)) {\n oSourceElementsData.aCount[nCategory][sPrefixed] = 0;\n }\n oSourceElementsData.aCount[nCategory][sPrefixed] +=\n aSourceElementsData[nPosition].aCount[nCategory][\n sPrefixed];\n };\n\n return fLambda;\n },\n /**\n * Adds the number of occurrences of each primitive value of a\n * given category that could be consolidated in the source\n * element with a given index to the count of occurrences of that\n * primitive values within the range of source elements that is\n * currently being considered.\n * @param {number} nPosition The index (in the source text order)\n * of a source element.\n * @return {function(number)} A function that performs the\n * addition.\n * @see fAddOccurrences\n */\n cAddOccurrencesInCategory = function(nPosition) {\n /**\n * @param {number} nCategory The category of the primary\n * expression from which the primitive value is derived.\n */\n var fLambda = function(nCategory) {\n Object.keys(\n aSourceElementsData[nPosition].aCount[nCategory]\n ).forEach(cAddOccurrences(nPosition, nCategory));\n };\n\n return fLambda;\n },\n /**\n * Adds the number of occurrences of each primitive value that\n * could be consolidated in the source element with a given index\n * to the count of occurrences of that primitive values within\n * the range of source elements that is currently being\n * considered.\n * @param {number} nPosition The index (in the source text order)\n * of a source element.\n */\n fAddOccurrences = function(nPosition) {\n Object.keys(aSourceElementsData[nPosition].aCount).forEach(\n cAddOccurrencesInCategory(nPosition));\n },\n /**\n * Creates a variable declaration for a primitive value if that\n * primitive value is to be consolidated within the elements.\n * @param {string} sPrefixed Prefixed representation String of a\n * primitive value that could be consolidated within the\n * elements.\n * @see aVariableDeclarations\n */\n cAugmentVariableDeclarations = function(sPrefixed) {\n if (oSolutionBest.oPrimitiveValues[sPrefixed].nSaving > 0) {\n aVariableDeclarations.push([\n oSolutionBest.oPrimitiveValues[sPrefixed].sName,\n [0 === sPrefixed.indexOf(EValuePrefixes.S_SYMBOLIC) ?\n 'name' : 'string',\n sPrefixed.substring(EValuePrefixes.S_SYMBOLIC.length)]\n ]);\n }\n },\n /**\n * Sorts primitive values with regard to the difference in the\n * number of terminal symbols between the original source text\n * and the one with those primitive values consolidated.\n * @param {string} sPrefixed0 The prefixed representation String\n * of the first of the two primitive values that are being\n * compared.\n * @param {string} sPrefixed1 The prefixed representation String\n * of the second of the two primitive values that are being\n * compared.\n * @return {number}\n * <dl>\n * <dt>-1</dt>\n * <dd>if the first primitive value must be placed before\n * the other one,</dd>\n * <dt>0</dt>\n * <dd>if the first primitive value may be placed before\n * the other one,</dd>\n * <dt>1</dt>\n * <dd>if the first primitive value must not be placed\n * before the other one.</dd>\n * </dl>\n * @see TSolution.oPrimitiveValues\n */\n cSortPrimitiveValues = function(sPrefixed0, sPrefixed1) {\n /**\n * The difference between:\n * <ol>\n * <li>the difference in the number of terminal symbols\n * between the original source text and the one with the\n * first primitive value consolidated, and</li>\n * <li>the difference in the number of terminal symbols\n * between the original source text and the one with the\n * second primitive value consolidated.</li>\n * </ol>\n * @type {number}\n */\n var nDifference =\n oSolutionCandidate.oPrimitiveValues[sPrefixed0].nSaving -\n oSolutionCandidate.oPrimitiveValues[sPrefixed1].nSaving;\n\n return nDifference > 0 ? -1 : nDifference < 0 ? 1 : 0;\n },\n /**\n * Assigns an identifier name to a primitive value and calculates\n * whether instances of that primitive value are worth\n * consolidating.\n * @param {string} sPrefixed The prefixed representation String\n * of a primitive value that is being evaluated.\n */\n fEvaluatePrimitiveValue = function(sPrefixed) {\n var _,\n /**\n * The index of the last mangled name.\n * @type {number}\n */\n nIndex,\n /**\n * The representation String of the primitive value that is\n * being evaluated.\n * @type {string}\n */\n sName =\n sPrefixed.substring(EValuePrefixes.S_SYMBOLIC.length),\n /**\n * The number of source characters taken up by the\n * representation String of the primitive value that is\n * being evaluated.\n * @type {number}\n */\n nLengthOriginal = sName.length,\n /**\n * The number of source characters taken up by the\n * identifier name that could substitute the primitive\n * value that is being evaluated.\n * substituted.\n * @type {number}\n */\n nLengthSubstitution,\n /**\n * The number of source characters taken up by by the\n * representation String of the primitive value that is\n * being evaluated when it is represented by a string\n * literal.\n * @type {number}\n */\n nLengthString = oProcessor.make_string(sName).length;\n\n oSolutionCandidate.oPrimitiveValues[sPrefixed] =\n new TPrimitiveValue();\n do { // Find an identifier unused in this or any nested scope.\n nIndex = oScope.cname;\n oSolutionCandidate.oPrimitiveValues[sPrefixed].sName =\n oScope.next_mangled();\n } while (-1 !== oSourceElementsData.aIdentifiers.indexOf(\n oSolutionCandidate.oPrimitiveValues[sPrefixed].sName));\n nLengthSubstitution = oSolutionCandidate.oPrimitiveValues[\n sPrefixed].sName.length;\n if (0 === sPrefixed.indexOf(EValuePrefixes.S_SYMBOLIC)) {\n // foo:null, or foo:null;\n oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving -=\n nLengthSubstitution + nLengthOriginal +\n oWeights.N_VARIABLE_DECLARATION;\n // null vs foo\n oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving +=\n oSourceElementsData.aCount[\n EPrimaryExpressionCategories.\n N_NULL_AND_BOOLEAN_LITERALS][sPrefixed] *\n (nLengthOriginal - nLengthSubstitution);\n } else {\n // foo:'fromCharCode';\n oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving -=\n nLengthSubstitution + nLengthString +\n oWeights.N_VARIABLE_DECLARATION;\n // .fromCharCode vs [foo]\n if (oSourceElementsData.aCount[\n EPrimaryExpressionCategories.N_IDENTIFIER_NAMES\n ].hasOwnProperty(sPrefixed)) {\n oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving +=\n oSourceElementsData.aCount[\n EPrimaryExpressionCategories.N_IDENTIFIER_NAMES\n ][sPrefixed] *\n (nLengthOriginal - nLengthSubstitution -\n oWeights.N_PROPERTY_ACCESSOR);\n }\n // 'fromCharCode' vs foo\n if (oSourceElementsData.aCount[\n EPrimaryExpressionCategories.N_STRING_LITERALS\n ].hasOwnProperty(sPrefixed)) {\n oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving +=\n oSourceElementsData.aCount[\n EPrimaryExpressionCategories.N_STRING_LITERALS\n ][sPrefixed] *\n (nLengthString - nLengthSubstitution);\n }\n }\n if (oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving >\n 0) {\n oSolutionCandidate.nSavings +=\n oSolutionCandidate.oPrimitiveValues[sPrefixed].nSaving;\n } else {\n oScope.cname = nIndex; // Free the identifier name.\n }\n },\n /**\n * Adds a variable declaration to an existing variable statement.\n * @param {!Array} aVariableDeclaration A variable declaration\n * with an initialiser.\n */\n cAddVariableDeclaration = function(aVariableDeclaration) {\n (/** @type {!Array} */ oSourceElements[nFrom][1]).unshift(\n aVariableDeclaration);\n };\n\n if (nFrom > nTo) {\n return;\n }\n // If the range is a closure, reuse the closure.\n if (nFrom === nTo &&\n 'stat' === oSourceElements[nFrom][0] &&\n 'call' === oSourceElements[nFrom][1][0] &&\n 'function' === oSourceElements[nFrom][1][1][0]) {\n fExamineSyntacticCodeUnit(oSourceElements[nFrom][1][1]);\n return;\n }\n // Create a list of all derived primitive values within the range.\n for (nPosition = nFrom; nPosition <= nTo; nPosition += 1) {\n aSourceElementsData[nPosition].aPrimitiveValues.forEach(\n cAugmentList(oSourceElementsData.aPrimitiveValues));\n }\n if (0 === oSourceElementsData.aPrimitiveValues.length) {\n return;\n }\n for (nPosition = nFrom; nPosition <= nTo; nPosition += 1) {\n // Add the number of occurrences to the total count.\n fAddOccurrences(nPosition);\n // Add identifiers of this or any nested scope to the list.\n aSourceElementsData[nPosition].aIdentifiers.forEach(\n cAugmentList(oSourceElementsData.aIdentifiers));\n }\n // Distribute identifier names among derived primitive values.\n do { // If there was any progress, find a better distribution.\n oSolutionBest = oSolutionCandidate;\n if (Object.keys(oSolutionCandidate.oPrimitiveValues).length > 0) {\n // Sort primitive values descending by their worthwhileness.\n oSourceElementsData.aPrimitiveValues.sort(cSortPrimitiveValues);\n }\n oSolutionCandidate = new TSolution();\n oSourceElementsData.aPrimitiveValues.forEach(\n fEvaluatePrimitiveValue);\n oScope.cname = nIndex;\n } while (oSolutionCandidate.nSavings > oSolutionBest.nSavings);\n // Take the necessity of adding a variable statement into account.\n if ('var' !== oSourceElements[nFrom][0]) {\n oSolutionBest.nSavings -= oWeights.N_VARIABLE_STATEMENT_AFFIXATION;\n }\n if (bEnclose) {\n // Take the necessity of forming a closure into account.\n oSolutionBest.nSavings -= oWeights.N_CLOSURE;\n }\n if (oSolutionBest.nSavings > 0) {\n // Create variable declarations suitable for UglifyJS.\n Object.keys(oSolutionBest.oPrimitiveValues).forEach(\n cAugmentVariableDeclarations);\n // Rewrite expressions that contain worthwhile primitive values.\n for (nPosition = nFrom; nPosition <= nTo; nPosition += 1) {\n oWalker = oProcessor.ast_walker();\n oSourceElements[nPosition] =\n oWalker.with_walkers(\n oWalkersTransformers,\n cContext(oWalker, oSourceElements[nPosition]));\n }\n if ('var' === oSourceElements[nFrom][0]) { // Reuse the statement.\n (/** @type {!Array.<!Array>} */ aVariableDeclarations.reverse(\n )).forEach(cAddVariableDeclaration);\n } else { // Add a variable statement.\n Array.prototype.splice.call(\n oSourceElements,\n nFrom,\n 0,\n ['var', aVariableDeclarations]);\n nTo += 1;\n }\n if (bEnclose) {\n // Add a closure.\n Array.prototype.splice.call(\n oSourceElements,\n nFrom,\n 0,\n ['stat', ['call', ['function', null, [], []], []]]);\n // Copy source elements into the closure.\n for (nPosition = nTo + 1; nPosition > nFrom; nPosition -= 1) {\n Array.prototype.unshift.call(\n oSourceElements[nFrom][1][1][3],\n oSourceElements[nPosition]);\n }\n // Remove source elements outside the closure.\n Array.prototype.splice.call(\n oSourceElements,\n nFrom + 1,\n nTo - nFrom + 1);\n }\n }\n if (bEnclose) {\n // Restore the availability of identifier names.\n oScope.cname = nIndex;\n }\n };\n\n oSourceElements = (/** @type {!TSyntacticCodeUnit} */\n oSyntacticCodeUnit[bIsGlobal ? 1 : 3]);\n if (0 === oSourceElements.length) {\n return;\n }\n oScope = bIsGlobal ? oSyntacticCodeUnit.scope : oSourceElements.scope;\n // Skip a Directive Prologue.\n while (nAfterDirectivePrologue < oSourceElements.length &&\n 'directive' === oSourceElements[nAfterDirectivePrologue][0]) {\n nAfterDirectivePrologue += 1;\n aSourceElementsData.push(null);\n }\n if (oSourceElements.length === nAfterDirectivePrologue) {\n return;\n }\n for (nPosition = nAfterDirectivePrologue;\n nPosition < oSourceElements.length;\n nPosition += 1) {\n oSourceElementData = new TSourceElementsData();\n oWalker = oProcessor.ast_walker();\n // Classify a source element.\n // Find its derived primitive values and count their occurrences.\n // Find all identifiers used (including nested scopes).\n oWalker.with_walkers(\n oWalkers.oSurveySourceElement,\n cContext(oWalker, oSourceElements[nPosition]));\n // Establish whether the scope is still wholly examinable.\n bIsWhollyExaminable = bIsWhollyExaminable &&\n ESourceElementCategories.N_WITH !== oSourceElementData.nCategory &&\n ESourceElementCategories.N_EVAL !== oSourceElementData.nCategory;\n aSourceElementsData.push(oSourceElementData);\n }\n if (bIsWhollyExaminable) { // Examine the whole scope.\n fExamineSourceElements(\n nAfterDirectivePrologue,\n oSourceElements.length - 1,\n false);\n } else { // Examine unexcluded ranges of source elements.\n for (nPosition = oSourceElements.length - 1;\n nPosition >= nAfterDirectivePrologue;\n nPosition -= 1) {\n oSourceElementData = (/** @type {!TSourceElementsData} */\n aSourceElementsData[nPosition]);\n if (ESourceElementCategories.N_OTHER ===\n oSourceElementData.nCategory) {\n if ('undefined' === typeof nTo) {\n nTo = nPosition; // Indicate the end of a range.\n }\n // Examine the range if it immediately follows a Directive Prologue.\n if (nPosition === nAfterDirectivePrologue) {\n fExamineSourceElements(nPosition, nTo, true);\n }\n } else {\n if ('undefined' !== typeof nTo) {\n // Examine the range that immediately follows this source element.\n fExamineSourceElements(nPosition + 1, nTo, true);\n nTo = void 0; // Obliterate the range.\n }\n // Examine nested functions.\n oWalker = oProcessor.ast_walker();\n oWalker.with_walkers(\n oWalkers.oExamineFunctions,\n cContext(oWalker, oSourceElements[nPosition]));\n }\n }\n }\n }(oAbstractSyntaxTree = oProcessor.ast_add_scope(oAbstractSyntaxTree)));\n return oAbstractSyntaxTree;\n};\n/*jshint sub:false */\n\n/* Local Variables: */\n/* mode: js */\n/* coding: utf-8 */\n/* indent-tabs-mode: nil */\n/* tab-width: 2 */\n/* End: */\n/* vim: set ft=javascript fenc=utf-8 et ts=2 sts=2 sw=2: */\n/* :mode=javascript:noTabs=true:tabSize=2:indentSize=2:deepIndent=true: */\n});\ndefine('uglifyjs/parse-js', [\"exports\"], function(exports) {\n/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n\n This version is suitable for Node.js. With minimal changes (the\n exports stuff) it should work on any JS platform.\n\n This file contains the tokenizer/parser. It is a port to JavaScript\n of parse-js [1], a JavaScript parser library written in Common Lisp\n by Marijn Haverbeke. Thank you Marijn!\n\n [1] http://marijn.haverbeke.nl/parse-js/\n\n Exported functions:\n\n - tokenizer(code) -- returns a function. Call the returned\n function to fetch the next token.\n\n - parse(code) -- returns an AST of the given JavaScript code.\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n <[email protected]>\n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2010 (c) Mihai Bazon <[email protected]>\n Based on parse-js (http://marijn.haverbeke.nl/parse-js/).\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n/* -----[ Tokenizer (constants) ]----- */\n\nvar KEYWORDS = array_to_hash([\n \"break\",\n \"case\",\n \"catch\",\n \"const\",\n \"continue\",\n \"debugger\",\n \"default\",\n \"delete\",\n \"do\",\n \"else\",\n \"finally\",\n \"for\",\n \"function\",\n \"if\",\n \"in\",\n \"instanceof\",\n \"new\",\n \"return\",\n \"switch\",\n \"throw\",\n \"try\",\n \"typeof\",\n \"var\",\n \"void\",\n \"while\",\n \"with\"\n]);\n\nvar RESERVED_WORDS = array_to_hash([\n \"abstract\",\n \"boolean\",\n \"byte\",\n \"char\",\n \"class\",\n \"double\",\n \"enum\",\n \"export\",\n \"extends\",\n \"final\",\n \"float\",\n \"goto\",\n \"implements\",\n \"import\",\n \"int\",\n \"interface\",\n \"long\",\n \"native\",\n \"package\",\n \"private\",\n \"protected\",\n \"public\",\n \"short\",\n \"static\",\n \"super\",\n \"synchronized\",\n \"throws\",\n \"transient\",\n \"volatile\"\n]);\n\nvar KEYWORDS_BEFORE_EXPRESSION = array_to_hash([\n \"return\",\n \"new\",\n \"delete\",\n \"throw\",\n \"else\",\n \"case\"\n]);\n\nvar KEYWORDS_ATOM = array_to_hash([\n \"false\",\n \"null\",\n \"true\",\n \"undefined\"\n]);\n\nvar OPERATOR_CHARS = array_to_hash(characters(\"+-*&%=<>!?|~^\"));\n\nvar RE_HEX_NUMBER = /^0x[0-9a-f]+$/i;\nvar RE_OCT_NUMBER = /^0[0-7]+$/;\nvar RE_DEC_NUMBER = /^\\d*\\.?\\d*(?:e[+-]?\\d*(?:\\d\\.?|\\.?\\d)\\d*)?$/i;\n\nvar OPERATORS = array_to_hash([\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"new\",\n \"void\",\n \"delete\",\n \"++\",\n \"--\",\n \"+\",\n \"-\",\n \"!\",\n \"~\",\n \"&\",\n \"|\",\n \"^\",\n \"*\",\n \"/\",\n \"%\",\n \">>\",\n \"<<\",\n \">>>\",\n \"<\",\n \">\",\n \"<=\",\n \">=\",\n \"==\",\n \"===\",\n \"!=\",\n \"!==\",\n \"?\",\n \"=\",\n \"+=\",\n \"-=\",\n \"/=\",\n \"*=\",\n \"%=\",\n \">>=\",\n \"<<=\",\n \">>>=\",\n \"|=\",\n \"^=\",\n \"&=\",\n \"&&\",\n \"||\"\n]);\n\nvar WHITESPACE_CHARS = array_to_hash(characters(\" \\u00a0\\n\\r\\t\\f\\u000b\\u200b\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\uFEFF\"));\n\nvar PUNC_BEFORE_EXPRESSION = array_to_hash(characters(\"[{(,.;:\"));\n\nvar PUNC_CHARS = array_to_hash(characters(\"[]{}(),;:\"));\n\nvar REGEXP_MODIFIERS = array_to_hash(characters(\"gmsiy\"));\n\n/* -----[ Tokenizer ]----- */\n\nvar UNICODE = { // Unicode 6.1\n letter: new RegExp(\"[\\\\u0041-\\\\u005A\\\\u0061-\\\\u007A\\\\u00AA\\\\u00B5\\\\u00BA\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0370-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u048A-\\\\u0527\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0620-\\\\u064A\\\\u066E\\\\u066F\\\\u0671-\\\\u06D3\\\\u06D5\\\\u06E5\\\\u06E6\\\\u06EE\\\\u06EF\\\\u06FA-\\\\u06FC\\\\u06FF\\\\u0710\\\\u0712-\\\\u072F\\\\u074D-\\\\u07A5\\\\u07B1\\\\u07CA-\\\\u07EA\\\\u07F4\\\\u07F5\\\\u07FA\\\\u0800-\\\\u0815\\\\u081A\\\\u0824\\\\u0828\\\\u0840-\\\\u0858\\\\u08A0\\\\u08A2-\\\\u08AC\\\\u0904-\\\\u0939\\\\u093D\\\\u0950\\\\u0958-\\\\u0961\\\\u0971-\\\\u0977\\\\u0979-\\\\u097F\\\\u0985-\\\\u098C\\\\u098F\\\\u0990\\\\u0993-\\\\u09A8\\\\u09AA-\\\\u09B0\\\\u09B2\\\\u09B6-\\\\u09B9\\\\u09BD\\\\u09CE\\\\u09DC\\\\u09DD\\\\u09DF-\\\\u09E1\\\\u09F0\\\\u09F1\\\\u0A05-\\\\u0A0A\\\\u0A0F\\\\u0A10\\\\u0A13-\\\\u0A28\\\\u0A2A-\\\\u0A30\\\\u0A32\\\\u0A33\\\\u0A35\\\\u0A36\\\\u0A38\\\\u0A39\\\\u0A59-\\\\u0A5C\\\\u0A5E\\\\u0A72-\\\\u0A74\\\\u0A85-\\\\u0A8D\\\\u0A8F-\\\\u0A91\\\\u0A93-\\\\u0AA8\\\\u0AAA-\\\\u0AB0\\\\u0AB2\\\\u0AB3\\\\u0AB5-\\\\u0AB9\\\\u0ABD\\\\u0AD0\\\\u0AE0\\\\u0AE1\\\\u0B05-\\\\u0B0C\\\\u0B0F\\\\u0B10\\\\u0B13-\\\\u0B28\\\\u0B2A-\\\\u0B30\\\\u0B32\\\\u0B33\\\\u0B35-\\\\u0B39\\\\u0B3D\\\\u0B5C\\\\u0B5D\\\\u0B5F-\\\\u0B61\\\\u0B71\\\\u0B83\\\\u0B85-\\\\u0B8A\\\\u0B8E-\\\\u0B90\\\\u0B92-\\\\u0B95\\\\u0B99\\\\u0B9A\\\\u0B9C\\\\u0B9E\\\\u0B9F\\\\u0BA3\\\\u0BA4\\\\u0BA8-\\\\u0BAA\\\\u0BAE-\\\\u0BB9\\\\u0BD0\\\\u0C05-\\\\u0C0C\\\\u0C0E-\\\\u0C10\\\\u0C12-\\\\u0C28\\\\u0C2A-\\\\u0C33\\\\u0C35-\\\\u0C39\\\\u0C3D\\\\u0C58\\\\u0C59\\\\u0C60\\\\u0C61\\\\u0C85-\\\\u0C8C\\\\u0C8E-\\\\u0C90\\\\u0C92-\\\\u0CA8\\\\u0CAA-\\\\u0CB3\\\\u0CB5-\\\\u0CB9\\\\u0CBD\\\\u0CDE\\\\u0CE0\\\\u0CE1\\\\u0CF1\\\\u0CF2\\\\u0D05-\\\\u0D0C\\\\u0D0E-\\\\u0D10\\\\u0D12-\\\\u0D3A\\\\u0D3D\\\\u0D4E\\\\u0D60\\\\u0D61\\\\u0D7A-\\\\u0D7F\\\\u0D85-\\\\u0D96\\\\u0D9A-\\\\u0DB1\\\\u0DB3-\\\\u0DBB\\\\u0DBD\\\\u0DC0-\\\\u0DC6\\\\u0E01-\\\\u0E30\\\\u0E32\\\\u0E33\\\\u0E40-\\\\u0E46\\\\u0E81\\\\u0E82\\\\u0E84\\\\u0E87\\\\u0E88\\\\u0E8A\\\\u0E8D\\\\u0E94-\\\\u0E97\\\\u0E99-\\\\u0E9F\\\\u0EA1-\\\\u0EA3\\\\u0EA5\\\\u0EA7\\\\u0EAA\\\\u0EAB\\\\u0EAD-\\\\u0EB0\\\\u0EB2\\\\u0EB3\\\\u0EBD\\\\u0EC0-\\\\u0EC4\\\\u0EC6\\\\u0EDC-\\\\u0EDF\\\\u0F00\\\\u0F40-\\\\u0F47\\\\u0F49-\\\\u0F6C\\\\u0F88-\\\\u0F8C\\\\u1000-\\\\u102A\\\\u103F\\\\u1050-\\\\u1055\\\\u105A-\\\\u105D\\\\u1061\\\\u1065\\\\u1066\\\\u106E-\\\\u1070\\\\u1075-\\\\u1081\\\\u108E\\\\u10A0-\\\\u10C5\\\\u10C7\\\\u10CD\\\\u10D0-\\\\u10FA\\\\u10FC-\\\\u1248\\\\u124A-\\\\u124D\\\\u1250-\\\\u1256\\\\u1258\\\\u125A-\\\\u125D\\\\u1260-\\\\u1288\\\\u128A-\\\\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u167F\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u16EE-\\\\u16F0\\\\u1700-\\\\u170C\\\\u170E-\\\\u1711\\\\u1720-\\\\u1731\\\\u1740-\\\\u1751\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1780-\\\\u17B3\\\\u17D7\\\\u17DC\\\\u1820-\\\\u1877\\\\u1880-\\\\u18A8\\\\u18AA\\\\u18B0-\\\\u18F5\\\\u1900-\\\\u191C\\\\u1950-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19AB\\\\u19C1-\\\\u19C7\\\\u1A00-\\\\u1A16\\\\u1A20-\\\\u1A54\\\\u1AA7\\\\u1B05-\\\\u1B33\\\\u1B45-\\\\u1B4B\\\\u1B83-\\\\u1BA0\\\\u1BAE\\\\u1BAF\\\\u1BBA-\\\\u1BE5\\\\u1C00-\\\\u1C23\\\\u1C4D-\\\\u1C4F\\\\u1C5A-\\\\u1C7D\\\\u1CE9-\\\\u1CEC\\\\u1CEE-\\\\u1CF1\\\\u1CF5\\\\u1CF6\\\\u1D00-\\\\u1DBF\\\\u1E00-\\\\u1F15\\\\u1F18-\\\\u1F1D\\\\u1F20-\\\\u1F45\\\\u1F48-\\\\u1F4D\\\\u1F50-\\\\u1F57\\\\u1F59\\\\u1F5B\\\\u1F5D\\\\u1F5F-\\\\u1F7D\\\\u1F80-\\\\u1FB4\\\\u1FB6-\\\\u1FBC\\\\u1FBE\\\\u1FC2-\\\\u1FC4\\\\u1FC6-\\\\u1FCC\\\\u1FD0-\\\\u1FD3\\\\u1FD6-\\\\u1FDB\\\\u1FE0-\\\\u1FEC\\\\u1FF2-\\\\u1FF4\\\\u1FF6-\\\\u1FFC\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u2102\\\\u2107\\\\u210A-\\\\u2113\\\\u2115\\\\u2119-\\\\u211D\\\\u2124\\\\u2126\\\\u2128\\\\u212A-\\\\u212D\\\\u212F-\\\\u2139\\\\u213C-\\\\u213F\\\\u2145-\\\\u2149\\\\u214E\\\\u2160-\\\\u2188\\\\u2C00-\\\\u2C2E\\\\u2C30-\\\\u2C5E\\\\u2C60-\\\\u2CE4\\\\u2CEB-\\\\u2CEE\\\\u2CF2\\\\u2CF3\\\\u2D00-\\\\u2D25\\\\u2D27\\\\u2D2D\\\\u2D30-\\\\u2D67\\\\u2D6F\\\\u2D80-\\\\u2D96\\\\u2DA0-\\\\u2DA6\\\\u2DA8-\\\\u2DAE\\\\u2DB0-\\\\u2DB6\\\\u2DB8-\\\\u2DBE\\\\u2DC0-\\\\u2DC6\\\\u2DC8-\\\\u2DCE\\\\u2DD0-\\\\u2DD6\\\\u2DD8-\\\\u2DDE\\\\u2E2F\\\\u3005-\\\\u3007\\\\u3021-\\\\u3029\\\\u3031-\\\\u3035\\\\u3038-\\\\u303C\\\\u3041-\\\\u3096\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31BA\\\\u31F0-\\\\u31FF\\\\u3400-\\\\u4DB5\\\\u4E00-\\\\u9FCC\\\\uA000-\\\\uA48C\\\\uA4D0-\\\\uA4FD\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA61F\\\\uA62A\\\\uA62B\\\\uA640-\\\\uA66E\\\\uA67F-\\\\uA697\\\\uA6A0-\\\\uA6EF\\\\uA717-\\\\uA71F\\\\uA722-\\\\uA788\\\\uA78B-\\\\uA78E\\\\uA790-\\\\uA793\\\\uA7A0-\\\\uA7AA\\\\uA7F8-\\\\uA801\\\\uA803-\\\\uA805\\\\uA807-\\\\uA80A\\\\uA80C-\\\\uA822\\\\uA840-\\\\uA873\\\\uA882-\\\\uA8B3\\\\uA8F2-\\\\uA8F7\\\\uA8FB\\\\uA90A-\\\\uA925\\\\uA930-\\\\uA946\\\\uA960-\\\\uA97C\\\\uA984-\\\\uA9B2\\\\uA9CF\\\\uAA00-\\\\uAA28\\\\uAA40-\\\\uAA42\\\\uAA44-\\\\uAA4B\\\\uAA60-\\\\uAA76\\\\uAA7A\\\\uAA80-\\\\uAAAF\\\\uAAB1\\\\uAAB5\\\\uAAB6\\\\uAAB9-\\\\uAABD\\\\uAAC0\\\\uAAC2\\\\uAADB-\\\\uAADD\\\\uAAE0-\\\\uAAEA\\\\uAAF2-\\\\uAAF4\\\\uAB01-\\\\uAB06\\\\uAB09-\\\\uAB0E\\\\uAB11-\\\\uAB16\\\\uAB20-\\\\uAB26\\\\uAB28-\\\\uAB2E\\\\uABC0-\\\\uABE2\\\\uAC00-\\\\uD7A3\\\\uD7B0-\\\\uD7C6\\\\uD7CB-\\\\uD7FB\\\\uF900-\\\\uFA6D\\\\uFA70-\\\\uFAD9\\\\uFB00-\\\\uFB06\\\\uFB13-\\\\uFB17\\\\uFB1D\\\\uFB1F-\\\\uFB28\\\\uFB2A-\\\\uFB36\\\\uFB38-\\\\uFB3C\\\\uFB3E\\\\uFB40\\\\uFB41\\\\uFB43\\\\uFB44\\\\uFB46-\\\\uFBB1\\\\uFBD3-\\\\uFD3D\\\\uFD50-\\\\uFD8F\\\\uFD92-\\\\uFDC7\\\\uFDF0-\\\\uFDFB\\\\uFE70-\\\\uFE74\\\\uFE76-\\\\uFEFC\\\\uFF21-\\\\uFF3A\\\\uFF41-\\\\uFF5A\\\\uFF66-\\\\uFFBE\\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC]\"),\n combining_mark: new RegExp(\"[\\\\u0300-\\\\u036F\\\\u0483-\\\\u0487\\\\u0591-\\\\u05BD\\\\u05BF\\\\u05C1\\\\u05C2\\\\u05C4\\\\u05C5\\\\u05C7\\\\u0610-\\\\u061A\\\\u064B-\\\\u065F\\\\u0670\\\\u06D6-\\\\u06DC\\\\u06DF-\\\\u06E4\\\\u06E7\\\\u06E8\\\\u06EA-\\\\u06ED\\\\u0711\\\\u0730-\\\\u074A\\\\u07A6-\\\\u07B0\\\\u07EB-\\\\u07F3\\\\u0816-\\\\u0819\\\\u081B-\\\\u0823\\\\u0825-\\\\u0827\\\\u0829-\\\\u082D\\\\u0859-\\\\u085B\\\\u08E4-\\\\u08FE\\\\u0900-\\\\u0903\\\\u093A-\\\\u093C\\\\u093E-\\\\u094F\\\\u0951-\\\\u0957\\\\u0962\\\\u0963\\\\u0981-\\\\u0983\\\\u09BC\\\\u09BE-\\\\u09C4\\\\u09C7\\\\u09C8\\\\u09CB-\\\\u09CD\\\\u09D7\\\\u09E2\\\\u09E3\\\\u0A01-\\\\u0A03\\\\u0A3C\\\\u0A3E-\\\\u0A42\\\\u0A47\\\\u0A48\\\\u0A4B-\\\\u0A4D\\\\u0A51\\\\u0A70\\\\u0A71\\\\u0A75\\\\u0A81-\\\\u0A83\\\\u0ABC\\\\u0ABE-\\\\u0AC5\\\\u0AC7-\\\\u0AC9\\\\u0ACB-\\\\u0ACD\\\\u0AE2\\\\u0AE3\\\\u0B01-\\\\u0B03\\\\u0B3C\\\\u0B3E-\\\\u0B44\\\\u0B47\\\\u0B48\\\\u0B4B-\\\\u0B4D\\\\u0B56\\\\u0B57\\\\u0B62\\\\u0B63\\\\u0B82\\\\u0BBE-\\\\u0BC2\\\\u0BC6-\\\\u0BC8\\\\u0BCA-\\\\u0BCD\\\\u0BD7\\\\u0C01-\\\\u0C03\\\\u0C3E-\\\\u0C44\\\\u0C46-\\\\u0C48\\\\u0C4A-\\\\u0C4D\\\\u0C55\\\\u0C56\\\\u0C62\\\\u0C63\\\\u0C82\\\\u0C83\\\\u0CBC\\\\u0CBE-\\\\u0CC4\\\\u0CC6-\\\\u0CC8\\\\u0CCA-\\\\u0CCD\\\\u0CD5\\\\u0CD6\\\\u0CE2\\\\u0CE3\\\\u0D02\\\\u0D03\\\\u0D3E-\\\\u0D44\\\\u0D46-\\\\u0D48\\\\u0D4A-\\\\u0D4D\\\\u0D57\\\\u0D62\\\\u0D63\\\\u0D82\\\\u0D83\\\\u0DCA\\\\u0DCF-\\\\u0DD4\\\\u0DD6\\\\u0DD8-\\\\u0DDF\\\\u0DF2\\\\u0DF3\\\\u0E31\\\\u0E34-\\\\u0E3A\\\\u0E47-\\\\u0E4E\\\\u0EB1\\\\u0EB4-\\\\u0EB9\\\\u0EBB\\\\u0EBC\\\\u0EC8-\\\\u0ECD\\\\u0F18\\\\u0F19\\\\u0F35\\\\u0F37\\\\u0F39\\\\u0F3E\\\\u0F3F\\\\u0F71-\\\\u0F84\\\\u0F86\\\\u0F87\\\\u0F8D-\\\\u0F97\\\\u0F99-\\\\u0FBC\\\\u0FC6\\\\u102B-\\\\u103E\\\\u1056-\\\\u1059\\\\u105E-\\\\u1060\\\\u1062-\\\\u1064\\\\u1067-\\\\u106D\\\\u1071-\\\\u1074\\\\u1082-\\\\u108D\\\\u108F\\\\u109A-\\\\u109D\\\\u135D-\\\\u135F\\\\u1712-\\\\u1714\\\\u1732-\\\\u1734\\\\u1752\\\\u1753\\\\u1772\\\\u1773\\\\u17B4-\\\\u17D3\\\\u17DD\\\\u180B-\\\\u180D\\\\u18A9\\\\u1920-\\\\u192B\\\\u1930-\\\\u193B\\\\u19B0-\\\\u19C0\\\\u19C8\\\\u19C9\\\\u1A17-\\\\u1A1B\\\\u1A55-\\\\u1A5E\\\\u1A60-\\\\u1A7C\\\\u1A7F\\\\u1B00-\\\\u1B04\\\\u1B34-\\\\u1B44\\\\u1B6B-\\\\u1B73\\\\u1B80-\\\\u1B82\\\\u1BA1-\\\\u1BAD\\\\u1BE6-\\\\u1BF3\\\\u1C24-\\\\u1C37\\\\u1CD0-\\\\u1CD2\\\\u1CD4-\\\\u1CE8\\\\u1CED\\\\u1CF2-\\\\u1CF4\\\\u1DC0-\\\\u1DE6\\\\u1DFC-\\\\u1DFF\\\\u20D0-\\\\u20DC\\\\u20E1\\\\u20E5-\\\\u20F0\\\\u2CEF-\\\\u2CF1\\\\u2D7F\\\\u2DE0-\\\\u2DFF\\\\u302A-\\\\u302F\\\\u3099\\\\u309A\\\\uA66F\\\\uA674-\\\\uA67D\\\\uA69F\\\\uA6F0\\\\uA6F1\\\\uA802\\\\uA806\\\\uA80B\\\\uA823-\\\\uA827\\\\uA880\\\\uA881\\\\uA8B4-\\\\uA8C4\\\\uA8E0-\\\\uA8F1\\\\uA926-\\\\uA92D\\\\uA947-\\\\uA953\\\\uA980-\\\\uA983\\\\uA9B3-\\\\uA9C0\\\\uAA29-\\\\uAA36\\\\uAA43\\\\uAA4C\\\\uAA4D\\\\uAA7B\\\\uAAB0\\\\uAAB2-\\\\uAAB4\\\\uAAB7\\\\uAAB8\\\\uAABE\\\\uAABF\\\\uAAC1\\\\uAAEB-\\\\uAAEF\\\\uAAF5\\\\uAAF6\\\\uABE3-\\\\uABEA\\\\uABEC\\\\uABED\\\\uFB1E\\\\uFE00-\\\\uFE0F\\\\uFE20-\\\\uFE26]\"),\n connector_punctuation: new RegExp(\"[\\\\u005F\\\\u203F\\\\u2040\\\\u2054\\\\uFE33\\\\uFE34\\\\uFE4D-\\\\uFE4F\\\\uFF3F]\"),\n digit: new RegExp(\"[\\\\u0030-\\\\u0039\\\\u0660-\\\\u0669\\\\u06F0-\\\\u06F9\\\\u07C0-\\\\u07C9\\\\u0966-\\\\u096F\\\\u09E6-\\\\u09EF\\\\u0A66-\\\\u0A6F\\\\u0AE6-\\\\u0AEF\\\\u0B66-\\\\u0B6F\\\\u0BE6-\\\\u0BEF\\\\u0C66-\\\\u0C6F\\\\u0CE6-\\\\u0CEF\\\\u0D66-\\\\u0D6F\\\\u0E50-\\\\u0E59\\\\u0ED0-\\\\u0ED9\\\\u0F20-\\\\u0F29\\\\u1040-\\\\u1049\\\\u1090-\\\\u1099\\\\u17E0-\\\\u17E9\\\\u1810-\\\\u1819\\\\u1946-\\\\u194F\\\\u19D0-\\\\u19D9\\\\u1A80-\\\\u1A89\\\\u1A90-\\\\u1A99\\\\u1B50-\\\\u1B59\\\\u1BB0-\\\\u1BB9\\\\u1C40-\\\\u1C49\\\\u1C50-\\\\u1C59\\\\uA620-\\\\uA629\\\\uA8D0-\\\\uA8D9\\\\uA900-\\\\uA909\\\\uA9D0-\\\\uA9D9\\\\uAA50-\\\\uAA59\\\\uABF0-\\\\uABF9\\\\uFF10-\\\\uFF19]\")\n};\n\nfunction is_letter(ch) {\n return UNICODE.letter.test(ch);\n};\n\nfunction is_digit(ch) {\n ch = ch.charCodeAt(0);\n return ch >= 48 && ch <= 57;\n};\n\nfunction is_unicode_digit(ch) {\n return UNICODE.digit.test(ch);\n}\n\nfunction is_alphanumeric_char(ch) {\n return is_digit(ch) || is_letter(ch);\n};\n\nfunction is_unicode_combining_mark(ch) {\n return UNICODE.combining_mark.test(ch);\n};\n\nfunction is_unicode_connector_punctuation(ch) {\n return UNICODE.connector_punctuation.test(ch);\n};\n\nfunction is_identifier_start(ch) {\n return ch == \"$\" || ch == \"_\" || is_letter(ch);\n};\n\nfunction is_identifier_char(ch) {\n return is_identifier_start(ch)\n || is_unicode_combining_mark(ch)\n || is_unicode_digit(ch)\n || is_unicode_connector_punctuation(ch)\n || ch == \"\\u200c\" // zero-width non-joiner <ZWNJ>\n || ch == \"\\u200d\" // zero-width joiner <ZWJ> (in my ECMA-262 PDF, this is also 200c)\n ;\n};\n\nfunction parse_js_number(num) {\n if (RE_HEX_NUMBER.test(num)) {\n return parseInt(num.substr(2), 16);\n } else if (RE_OCT_NUMBER.test(num)) {\n return parseInt(num.substr(1), 8);\n } else if (RE_DEC_NUMBER.test(num)) {\n return parseFloat(num);\n }\n};\n\nfunction JS_Parse_Error(message, line, col, pos) {\n this.message = message;\n this.line = line + 1;\n this.col = col + 1;\n this.pos = pos + 1;\n this.stack = new Error().stack;\n};\n\nJS_Parse_Error.prototype.toString = function() {\n return this.message + \" (line: \" + this.line + \", col: \" + this.col + \", pos: \" + this.pos + \")\" + \"\\n\\n\" + this.stack;\n};\n\nfunction js_error(message, line, col, pos) {\n throw new JS_Parse_Error(message, line, col, pos);\n};\n\nfunction is_token(token, type, val) {\n return token.type == type && (val == null || token.value == val);\n};\n\nvar EX_EOF = {};\n\nfunction tokenizer($TEXT) {\n\n var S = {\n text : $TEXT.replace(/\\r\\n?|[\\n\\u2028\\u2029]/g, \"\\n\").replace(/^\\uFEFF/, ''),\n pos : 0,\n tokpos : 0,\n line : 0,\n tokline : 0,\n col : 0,\n tokcol : 0,\n newline_before : false,\n regex_allowed : false,\n comments_before : []\n };\n\n function peek() { return S.text.charAt(S.pos); };\n\n function next(signal_eof, in_string) {\n var ch = S.text.charAt(S.pos++);\n if (signal_eof && !ch)\n throw EX_EOF;\n if (ch == \"\\n\") {\n S.newline_before = S.newline_before || !in_string;\n ++S.line;\n S.col = 0;\n } else {\n ++S.col;\n }\n return ch;\n };\n\n function eof() {\n return !S.peek();\n };\n\n function find(what, signal_eof) {\n var pos = S.text.indexOf(what, S.pos);\n if (signal_eof && pos == -1) throw EX_EOF;\n return pos;\n };\n\n function start_token() {\n S.tokline = S.line;\n S.tokcol = S.col;\n S.tokpos = S.pos;\n };\n\n function token(type, value, is_comment) {\n S.regex_allowed = ((type == \"operator\" && !HOP(UNARY_POSTFIX, value)) ||\n (type == \"keyword\" && HOP(KEYWORDS_BEFORE_EXPRESSION, value)) ||\n (type == \"punc\" && HOP(PUNC_BEFORE_EXPRESSION, value)));\n var ret = {\n type : type,\n value : value,\n line : S.tokline,\n col : S.tokcol,\n pos : S.tokpos,\n endpos : S.pos,\n nlb : S.newline_before\n };\n if (!is_comment) {\n ret.comments_before = S.comments_before;\n S.comments_before = [];\n // make note of any newlines in the comments that came before\n for (var i = 0, len = ret.comments_before.length; i < len; i++) {\n ret.nlb = ret.nlb || ret.comments_before[i].nlb;\n }\n }\n S.newline_before = false;\n return ret;\n };\n\n function skip_whitespace() {\n while (HOP(WHITESPACE_CHARS, peek()))\n next();\n };\n\n function read_while(pred) {\n var ret = \"\", ch = peek(), i = 0;\n while (ch && pred(ch, i++)) {\n ret += next();\n ch = peek();\n }\n return ret;\n };\n\n function parse_error(err) {\n js_error(err, S.tokline, S.tokcol, S.tokpos);\n };\n\n function read_num(prefix) {\n var has_e = false, after_e = false, has_x = false, has_dot = prefix == \".\";\n var num = read_while(function(ch, i){\n if (ch == \"x\" || ch == \"X\") {\n if (has_x) return false;\n return has_x = true;\n }\n if (!has_x && (ch == \"E\" || ch == \"e\")) {\n if (has_e) return false;\n return has_e = after_e = true;\n }\n if (ch == \"-\") {\n if (after_e || (i == 0 && !prefix)) return true;\n return false;\n }\n if (ch == \"+\") return after_e;\n after_e = false;\n if (ch == \".\") {\n if (!has_dot && !has_x && !has_e)\n return has_dot = true;\n return false;\n }\n return is_alphanumeric_char(ch);\n });\n if (prefix)\n num = prefix + num;\n var valid = parse_js_number(num);\n if (!isNaN(valid)) {\n return token(\"num\", valid);\n } else {\n parse_error(\"Invalid syntax: \" + num);\n }\n };\n\n function read_escaped_char(in_string) {\n var ch = next(true, in_string);\n switch (ch) {\n case \"n\" : return \"\\n\";\n case \"r\" : return \"\\r\";\n case \"t\" : return \"\\t\";\n case \"b\" : return \"\\b\";\n case \"v\" : return \"\\u000b\";\n case \"f\" : return \"\\f\";\n case \"0\" : return \"\\0\";\n case \"x\" : return String.fromCharCode(hex_bytes(2));\n case \"u\" : return String.fromCharCode(hex_bytes(4));\n case \"\\n\": return \"\";\n default : return ch;\n }\n };\n\n function hex_bytes(n) {\n var num = 0;\n for (; n > 0; --n) {\n var digit = parseInt(next(true), 16);\n if (isNaN(digit))\n parse_error(\"Invalid hex-character pattern in string\");\n num = (num << 4) | digit;\n }\n return num;\n };\n\n function read_string() {\n return with_eof_error(\"Unterminated string constant\", function(){\n var quote = next(), ret = \"\";\n for (;;) {\n var ch = next(true);\n if (ch == \"\\\\\") {\n // read OctalEscapeSequence (XXX: deprecated if \"strict mode\")\n // https://github.com/mishoo/UglifyJS/issues/178\n var octal_len = 0, first = null;\n ch = read_while(function(ch){\n if (ch >= \"0\" && ch <= \"7\") {\n if (!first) {\n first = ch;\n return ++octal_len;\n }\n else if (first <= \"3\" && octal_len <= 2) return ++octal_len;\n else if (first >= \"4\" && octal_len <= 1) return ++octal_len;\n }\n return false;\n });\n if (octal_len > 0) ch = String.fromCharCode(parseInt(ch, 8));\n else ch = read_escaped_char(true);\n }\n else if (ch == quote) break;\n else if (ch == \"\\n\") throw EX_EOF;\n ret += ch;\n }\n return token(\"string\", ret);\n });\n };\n\n function read_line_comment() {\n next();\n var i = find(\"\\n\"), ret;\n if (i == -1) {\n ret = S.text.substr(S.pos);\n S.pos = S.text.length;\n } else {\n ret = S.text.substring(S.pos, i);\n S.pos = i;\n }\n return token(\"comment1\", ret, true);\n };\n\n function read_multiline_comment() {\n next();\n return with_eof_error(\"Unterminated multiline comment\", function(){\n var i = find(\"*/\", true),\n text = S.text.substring(S.pos, i);\n S.pos = i + 2;\n S.line += text.split(\"\\n\").length - 1;\n S.newline_before = S.newline_before || text.indexOf(\"\\n\") >= 0;\n\n // https://github.com/mishoo/UglifyJS/issues/#issue/100\n if (/^@cc_on/i.test(text)) {\n warn(\"WARNING: at line \" + S.line);\n warn(\"*** Found \\\"conditional comment\\\": \" + text);\n warn(\"*** UglifyJS DISCARDS ALL COMMENTS. This means your code might no longer work properly in Internet Explorer.\");\n }\n\n return token(\"comment2\", text, true);\n });\n };\n\n function read_name() {\n var backslash = false, name = \"\", ch, escaped = false, hex;\n while ((ch = peek()) != null) {\n if (!backslash) {\n if (ch == \"\\\\\") escaped = backslash = true, next();\n else if (is_identifier_char(ch)) name += next();\n else break;\n }\n else {\n if (ch != \"u\") parse_error(\"Expecting UnicodeEscapeSequence -- uXXXX\");\n ch = read_escaped_char();\n if (!is_identifier_char(ch)) parse_error(\"Unicode char: \" + ch.charCodeAt(0) + \" is not valid in identifier\");\n name += ch;\n backslash = false;\n }\n }\n if (HOP(KEYWORDS, name) && escaped) {\n hex = name.charCodeAt(0).toString(16).toUpperCase();\n name = \"\\\\u\" + \"0000\".substr(hex.length) + hex + name.slice(1);\n }\n return name;\n };\n\n function read_regexp(regexp) {\n return with_eof_error(\"Unterminated regular expression\", function(){\n var prev_backslash = false, ch, in_class = false;\n while ((ch = next(true))) if (prev_backslash) {\n regexp += \"\\\\\" + ch;\n prev_backslash = false;\n } else if (ch == \"[\") {\n in_class = true;\n regexp += ch;\n } else if (ch == \"]\" && in_class) {\n in_class = false;\n regexp += ch;\n } else if (ch == \"/\" && !in_class) {\n break;\n } else if (ch == \"\\\\\") {\n prev_backslash = true;\n } else {\n regexp += ch;\n }\n var mods = read_name();\n return token(\"regexp\", [ regexp, mods ]);\n });\n };\n\n function read_operator(prefix) {\n function grow(op) {\n if (!peek()) return op;\n var bigger = op + peek();\n if (HOP(OPERATORS, bigger)) {\n next();\n return grow(bigger);\n } else {\n return op;\n }\n };\n return token(\"operator\", grow(prefix || next()));\n };\n\n function handle_slash() {\n next();\n var regex_allowed = S.regex_allowed;\n switch (peek()) {\n case \"/\":\n S.comments_before.push(read_line_comment());\n S.regex_allowed = regex_allowed;\n return next_token();\n case \"*\":\n S.comments_before.push(read_multiline_comment());\n S.regex_allowed = regex_allowed;\n return next_token();\n }\n return S.regex_allowed ? read_regexp(\"\") : read_operator(\"/\");\n };\n\n function handle_dot() {\n next();\n return is_digit(peek())\n ? read_num(\".\")\n : token(\"punc\", \".\");\n };\n\n function read_word() {\n var word = read_name();\n return !HOP(KEYWORDS, word)\n ? token(\"name\", word)\n : HOP(OPERATORS, word)\n ? token(\"operator\", word)\n : HOP(KEYWORDS_ATOM, word)\n ? token(\"atom\", word)\n : token(\"keyword\", word);\n };\n\n function with_eof_error(eof_error, cont) {\n try {\n return cont();\n } catch(ex) {\n if (ex === EX_EOF) parse_error(eof_error);\n else throw ex;\n }\n };\n\n function next_token(force_regexp) {\n if (force_regexp != null)\n return read_regexp(force_regexp);\n skip_whitespace();\n start_token();\n var ch = peek();\n if (!ch) return token(\"eof\");\n if (is_digit(ch)) return read_num();\n if (ch == '\"' || ch == \"'\") return read_string();\n if (HOP(PUNC_CHARS, ch)) return token(\"punc\", next());\n if (ch == \".\") return handle_dot();\n if (ch == \"/\") return handle_slash();\n if (HOP(OPERATOR_CHARS, ch)) return read_operator();\n if (ch == \"\\\\\" || is_identifier_start(ch)) return read_word();\n parse_error(\"Unexpected character '\" + ch + \"'\");\n };\n\n next_token.context = function(nc) {\n if (nc) S = nc;\n return S;\n };\n\n return next_token;\n\n};\n\n/* -----[ Parser (constants) ]----- */\n\nvar UNARY_PREFIX = array_to_hash([\n \"typeof\",\n \"void\",\n \"delete\",\n \"--\",\n \"++\",\n \"!\",\n \"~\",\n \"-\",\n \"+\"\n]);\n\nvar UNARY_POSTFIX = array_to_hash([ \"--\", \"++\" ]);\n\nvar ASSIGNMENT = (function(a, ret, i){\n while (i < a.length) {\n ret[a[i]] = a[i].substr(0, a[i].length - 1);\n i++;\n }\n return ret;\n})(\n [\"+=\", \"-=\", \"/=\", \"*=\", \"%=\", \">>=\", \"<<=\", \">>>=\", \"|=\", \"^=\", \"&=\"],\n { \"=\": true },\n 0\n);\n\nvar PRECEDENCE = (function(a, ret){\n for (var i = 0, n = 1; i < a.length; ++i, ++n) {\n var b = a[i];\n for (var j = 0; j < b.length; ++j) {\n ret[b[j]] = n;\n }\n }\n return ret;\n})(\n [\n [\"||\"],\n [\"&&\"],\n [\"|\"],\n [\"^\"],\n [\"&\"],\n [\"==\", \"===\", \"!=\", \"!==\"],\n [\"<\", \">\", \"<=\", \">=\", \"in\", \"instanceof\"],\n [\">>\", \"<<\", \">>>\"],\n [\"+\", \"-\"],\n [\"*\", \"/\", \"%\"]\n ],\n {}\n);\n\nvar STATEMENTS_WITH_LABELS = array_to_hash([ \"for\", \"do\", \"while\", \"switch\" ]);\n\nvar ATOMIC_START_TOKEN = array_to_hash([ \"atom\", \"num\", \"string\", \"regexp\", \"name\" ]);\n\n/* -----[ Parser ]----- */\n\nfunction NodeWithToken(str, start, end) {\n this.name = str;\n this.start = start;\n this.end = end;\n};\n\nNodeWithToken.prototype.toString = function() { return this.name; };\n\nfunction parse($TEXT, exigent_mode, embed_tokens) {\n\n var S = {\n input : typeof $TEXT == \"string\" ? tokenizer($TEXT, true) : $TEXT,\n token : null,\n prev : null,\n peeked : null,\n in_function : 0,\n in_directives : true,\n in_loop : 0,\n labels : []\n };\n\n S.token = next();\n\n function is(type, value) {\n return is_token(S.token, type, value);\n };\n\n function peek() { return S.peeked || (S.peeked = S.input()); };\n\n function next() {\n S.prev = S.token;\n if (S.peeked) {\n S.token = S.peeked;\n S.peeked = null;\n } else {\n S.token = S.input();\n }\n S.in_directives = S.in_directives && (\n S.token.type == \"string\" || is(\"punc\", \";\")\n );\n return S.token;\n };\n\n function prev() {\n return S.prev;\n };\n\n function croak(msg, line, col, pos) {\n var ctx = S.input.context();\n js_error(msg,\n line != null ? line : ctx.tokline,\n col != null ? col : ctx.tokcol,\n pos != null ? pos : ctx.tokpos);\n };\n\n function token_error(token, msg) {\n croak(msg, token.line, token.col);\n };\n\n function unexpected(token) {\n if (token == null)\n token = S.token;\n token_error(token, \"Unexpected token: \" + token.type + \" (\" + token.value + \")\");\n };\n\n function expect_token(type, val) {\n if (is(type, val)) {\n return next();\n }\n token_error(S.token, \"Unexpected token \" + S.token.type + \", expected \" + type);\n };\n\n function expect(punc) { return expect_token(\"punc\", punc); };\n\n function can_insert_semicolon() {\n return !exigent_mode && (\n S.token.nlb || is(\"eof\") || is(\"punc\", \"}\")\n );\n };\n\n function semicolon() {\n if (is(\"punc\", \";\")) next();\n else if (!can_insert_semicolon()) unexpected();\n };\n\n function as() {\n return slice(arguments);\n };\n\n function parenthesised() {\n expect(\"(\");\n var ex = expression();\n expect(\")\");\n return ex;\n };\n\n function add_tokens(str, start, end) {\n return str instanceof NodeWithToken ? str : new NodeWithToken(str, start, end);\n };\n\n function maybe_embed_tokens(parser) {\n if (embed_tokens) return function() {\n var start = S.token;\n var ast = parser.apply(this, arguments);\n ast[0] = add_tokens(ast[0], start, prev());\n return ast;\n };\n else return parser;\n };\n\n var statement = maybe_embed_tokens(function() {\n if (is(\"operator\", \"/\") || is(\"operator\", \"/=\")) {\n S.peeked = null;\n S.token = S.input(S.token.value.substr(1)); // force regexp\n }\n switch (S.token.type) {\n case \"string\":\n var dir = S.in_directives, stat = simple_statement();\n if (dir && stat[1][0] == \"string\" && !is(\"punc\", \",\"))\n return as(\"directive\", stat[1][1]);\n return stat;\n case \"num\":\n case \"regexp\":\n case \"operator\":\n case \"atom\":\n return simple_statement();\n\n case \"name\":\n return is_token(peek(), \"punc\", \":\")\n ? labeled_statement(prog1(S.token.value, next, next))\n : simple_statement();\n\n case \"punc\":\n switch (S.token.value) {\n case \"{\":\n return as(\"block\", block_());\n case \"[\":\n case \"(\":\n return simple_statement();\n case \";\":\n next();\n return as(\"block\");\n default:\n unexpected();\n }\n\n case \"keyword\":\n switch (prog1(S.token.value, next)) {\n case \"break\":\n return break_cont(\"break\");\n\n case \"continue\":\n return break_cont(\"continue\");\n\n case \"debugger\":\n semicolon();\n return as(\"debugger\");\n\n case \"do\":\n return (function(body){\n expect_token(\"keyword\", \"while\");\n return as(\"do\", prog1(parenthesised, semicolon), body);\n })(in_loop(statement));\n\n case \"for\":\n return for_();\n\n case \"function\":\n return function_(true);\n\n case \"if\":\n return if_();\n\n case \"return\":\n if (S.in_function == 0)\n croak(\"'return' outside of function\");\n return as(\"return\",\n is(\"punc\", \";\")\n ? (next(), null)\n : can_insert_semicolon()\n ? null\n : prog1(expression, semicolon));\n\n case \"switch\":\n return as(\"switch\", parenthesised(), switch_block_());\n\n case \"throw\":\n if (S.token.nlb)\n croak(\"Illegal newline after 'throw'\");\n return as(\"throw\", prog1(expression, semicolon));\n\n case \"try\":\n return try_();\n\n case \"var\":\n return prog1(var_, semicolon);\n\n case \"const\":\n return prog1(const_, semicolon);\n\n case \"while\":\n return as(\"while\", parenthesised(), in_loop(statement));\n\n case \"with\":\n return as(\"with\", parenthesised(), statement());\n\n default:\n unexpected();\n }\n }\n });\n\n function labeled_statement(label) {\n S.labels.push(label);\n var start = S.token, stat = statement();\n if (exigent_mode && !HOP(STATEMENTS_WITH_LABELS, stat[0]))\n unexpected(start);\n S.labels.pop();\n return as(\"label\", label, stat);\n };\n\n function simple_statement() {\n return as(\"stat\", prog1(expression, semicolon));\n };\n\n function break_cont(type) {\n var name;\n if (!can_insert_semicolon()) {\n name = is(\"name\") ? S.token.value : null;\n }\n if (name != null) {\n next();\n if (!member(name, S.labels))\n croak(\"Label \" + name + \" without matching loop or statement\");\n }\n else if (S.in_loop == 0)\n croak(type + \" not inside a loop or switch\");\n semicolon();\n return as(type, name);\n };\n\n function for_() {\n expect(\"(\");\n var init = null;\n if (!is(\"punc\", \";\")) {\n init = is(\"keyword\", \"var\")\n ? (next(), var_(true))\n : expression(true, true);\n if (is(\"operator\", \"in\")) {\n if (init[0] == \"var\" && init[1].length > 1)\n croak(\"Only one variable declaration allowed in for..in loop\");\n return for_in(init);\n }\n }\n return regular_for(init);\n };\n\n function regular_for(init) {\n expect(\";\");\n var test = is(\"punc\", \";\") ? null : expression();\n expect(\";\");\n var step = is(\"punc\", \")\") ? null : expression();\n expect(\")\");\n return as(\"for\", init, test, step, in_loop(statement));\n };\n\n function for_in(init) {\n var lhs = init[0] == \"var\" ? as(\"name\", init[1][0]) : init;\n next();\n var obj = expression();\n expect(\")\");\n return as(\"for-in\", init, lhs, obj, in_loop(statement));\n };\n\n var function_ = function(in_statement) {\n var name = is(\"name\") ? prog1(S.token.value, next) : null;\n if (in_statement && !name)\n unexpected();\n expect(\"(\");\n return as(in_statement ? \"defun\" : \"function\",\n name,\n // arguments\n (function(first, a){\n while (!is(\"punc\", \")\")) {\n if (first) first = false; else expect(\",\");\n if (!is(\"name\")) unexpected();\n a.push(S.token.value);\n next();\n }\n next();\n return a;\n })(true, []),\n // body\n (function(){\n ++S.in_function;\n var loop = S.in_loop;\n S.in_directives = true;\n S.in_loop = 0;\n var a = block_();\n --S.in_function;\n S.in_loop = loop;\n return a;\n })());\n };\n\n function if_() {\n var cond = parenthesised(), body = statement(), belse;\n if (is(\"keyword\", \"else\")) {\n next();\n belse = statement();\n }\n return as(\"if\", cond, body, belse);\n };\n\n function block_() {\n expect(\"{\");\n var a = [];\n while (!is(\"punc\", \"}\")) {\n if (is(\"eof\")) unexpected();\n a.push(statement());\n }\n next();\n return a;\n };\n\n var switch_block_ = curry(in_loop, function(){\n expect(\"{\");\n var a = [], cur = null;\n while (!is(\"punc\", \"}\")) {\n if (is(\"eof\")) unexpected();\n if (is(\"keyword\", \"case\")) {\n next();\n cur = [];\n a.push([ expression(), cur ]);\n expect(\":\");\n }\n else if (is(\"keyword\", \"default\")) {\n next();\n expect(\":\");\n cur = [];\n a.push([ null, cur ]);\n }\n else {\n if (!cur) unexpected();\n cur.push(statement());\n }\n }\n next();\n return a;\n });\n\n function try_() {\n var body = block_(), bcatch, bfinally;\n if (is(\"keyword\", \"catch\")) {\n next();\n expect(\"(\");\n if (!is(\"name\"))\n croak(\"Name expected\");\n var name = S.token.value;\n next();\n expect(\")\");\n bcatch = [ name, block_() ];\n }\n if (is(\"keyword\", \"finally\")) {\n next();\n bfinally = block_();\n }\n if (!bcatch && !bfinally)\n croak(\"Missing catch/finally blocks\");\n return as(\"try\", body, bcatch, bfinally);\n };\n\n function vardefs(no_in) {\n var a = [];\n for (;;) {\n if (!is(\"name\"))\n unexpected();\n var name = S.token.value;\n next();\n if (is(\"operator\", \"=\")) {\n next();\n a.push([ name, expression(false, no_in) ]);\n } else {\n a.push([ name ]);\n }\n if (!is(\"punc\", \",\"))\n break;\n next();\n }\n return a;\n };\n\n function var_(no_in) {\n return as(\"var\", vardefs(no_in));\n };\n\n function const_() {\n return as(\"const\", vardefs());\n };\n\n function new_() {\n var newexp = expr_atom(false), args;\n if (is(\"punc\", \"(\")) {\n next();\n args = expr_list(\")\");\n } else {\n args = [];\n }\n return subscripts(as(\"new\", newexp, args), true);\n };\n\n var expr_atom = maybe_embed_tokens(function(allow_calls) {\n if (is(\"operator\", \"new\")) {\n next();\n return new_();\n }\n if (is(\"punc\")) {\n switch (S.token.value) {\n case \"(\":\n next();\n return subscripts(prog1(expression, curry(expect, \")\")), allow_calls);\n case \"[\":\n next();\n return subscripts(array_(), allow_calls);\n case \"{\":\n next();\n return subscripts(object_(), allow_calls);\n }\n unexpected();\n }\n if (is(\"keyword\", \"function\")) {\n next();\n return subscripts(function_(false), allow_calls);\n }\n if (HOP(ATOMIC_START_TOKEN, S.token.type)) {\n var atom = S.token.type == \"regexp\"\n ? as(\"regexp\", S.token.value[0], S.token.value[1])\n : as(S.token.type, S.token.value);\n return subscripts(prog1(atom, next), allow_calls);\n }\n unexpected();\n });\n\n function expr_list(closing, allow_trailing_comma, allow_empty) {\n var first = true, a = [];\n while (!is(\"punc\", closing)) {\n if (first) first = false; else expect(\",\");\n if (allow_trailing_comma && is(\"punc\", closing)) break;\n if (is(\"punc\", \",\") && allow_empty) {\n a.push([ \"atom\", \"undefined\" ]);\n } else {\n a.push(expression(false));\n }\n }\n next();\n return a;\n };\n\n function array_() {\n return as(\"array\", expr_list(\"]\", !exigent_mode, true));\n };\n\n function object_() {\n var first = true, a = [];\n while (!is(\"punc\", \"}\")) {\n if (first) first = false; else expect(\",\");\n if (!exigent_mode && is(\"punc\", \"}\"))\n // allow trailing comma\n break;\n var type = S.token.type;\n var name = as_property_name();\n if (type == \"name\" && (name == \"get\" || name == \"set\") && !is(\"punc\", \":\")) {\n a.push([ as_name(), function_(false), name ]);\n } else {\n expect(\":\");\n a.push([ name, expression(false) ]);\n }\n }\n next();\n return as(\"object\", a);\n };\n\n function as_property_name() {\n switch (S.token.type) {\n case \"num\":\n case \"string\":\n return prog1(S.token.value, next);\n }\n return as_name();\n };\n\n function as_name() {\n switch (S.token.type) {\n case \"name\":\n case \"operator\":\n case \"keyword\":\n case \"atom\":\n return prog1(S.token.value, next);\n default:\n unexpected();\n }\n };\n\n function subscripts(expr, allow_calls) {\n if (is(\"punc\", \".\")) {\n next();\n return subscripts(as(\"dot\", expr, as_name()), allow_calls);\n }\n if (is(\"punc\", \"[\")) {\n next();\n return subscripts(as(\"sub\", expr, prog1(expression, curry(expect, \"]\"))), allow_calls);\n }\n if (allow_calls && is(\"punc\", \"(\")) {\n next();\n return subscripts(as(\"call\", expr, expr_list(\")\")), true);\n }\n return expr;\n };\n\n function maybe_unary(allow_calls) {\n if (is(\"operator\") && HOP(UNARY_PREFIX, S.token.value)) {\n return make_unary(\"unary-prefix\",\n prog1(S.token.value, next),\n maybe_unary(allow_calls));\n }\n var val = expr_atom(allow_calls);\n while (is(\"operator\") && HOP(UNARY_POSTFIX, S.token.value) && !S.token.nlb) {\n val = make_unary(\"unary-postfix\", S.token.value, val);\n next();\n }\n return val;\n };\n\n function make_unary(tag, op, expr) {\n if ((op == \"++\" || op == \"--\") && !is_assignable(expr))\n croak(\"Invalid use of \" + op + \" operator\");\n return as(tag, op, expr);\n };\n\n function expr_op(left, min_prec, no_in) {\n var op = is(\"operator\") ? S.token.value : null;\n if (op && op == \"in\" && no_in) op = null;\n var prec = op != null ? PRECEDENCE[op] : null;\n if (prec != null && prec > min_prec) {\n next();\n var right = expr_op(maybe_unary(true), prec, no_in);\n return expr_op(as(\"binary\", op, left, right), min_prec, no_in);\n }\n return left;\n };\n\n function expr_ops(no_in) {\n return expr_op(maybe_unary(true), 0, no_in);\n };\n\n function maybe_conditional(no_in) {\n var expr = expr_ops(no_in);\n if (is(\"operator\", \"?\")) {\n next();\n var yes = expression(false);\n expect(\":\");\n return as(\"conditional\", expr, yes, expression(false, no_in));\n }\n return expr;\n };\n\n function is_assignable(expr) {\n if (!exigent_mode) return true;\n switch (expr[0]+\"\") {\n case \"dot\":\n case \"sub\":\n case \"new\":\n case \"call\":\n return true;\n case \"name\":\n return expr[1] != \"this\";\n }\n };\n\n function maybe_assign(no_in) {\n var left = maybe_conditional(no_in), val = S.token.value;\n if (is(\"operator\") && HOP(ASSIGNMENT, val)) {\n if (is_assignable(left)) {\n next();\n return as(\"assign\", ASSIGNMENT[val], left, maybe_assign(no_in));\n }\n croak(\"Invalid assignment\");\n }\n return left;\n };\n\n var expression = maybe_embed_tokens(function(commas, no_in) {\n if (arguments.length == 0)\n commas = true;\n var expr = maybe_assign(no_in);\n if (commas && is(\"punc\", \",\")) {\n next();\n return as(\"seq\", expr, expression(true, no_in));\n }\n return expr;\n });\n\n function in_loop(cont) {\n try {\n ++S.in_loop;\n return cont();\n } finally {\n --S.in_loop;\n }\n };\n\n return as(\"toplevel\", (function(a){\n while (!is(\"eof\"))\n a.push(statement());\n return a;\n })([]));\n\n};\n\n/* -----[ Utilities ]----- */\n\nfunction curry(f) {\n var args = slice(arguments, 1);\n return function() { return f.apply(this, args.concat(slice(arguments))); };\n};\n\nfunction prog1(ret) {\n if (ret instanceof Function)\n ret = ret();\n for (var i = 1, n = arguments.length; --n > 0; ++i)\n arguments[i]();\n return ret;\n};\n\nfunction array_to_hash(a) {\n var ret = {};\n for (var i = 0; i < a.length; ++i)\n ret[a[i]] = true;\n return ret;\n};\n\nfunction slice(a, start) {\n return Array.prototype.slice.call(a, start || 0);\n};\n\nfunction characters(str) {\n return str.split(\"\");\n};\n\nfunction member(name, array) {\n for (var i = array.length; --i >= 0;)\n if (array[i] == name)\n return true;\n return false;\n};\n\nfunction HOP(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n};\n\nvar warn = function() {};\n\n/* -----[ Exports ]----- */\n\nexports.tokenizer = tokenizer;\nexports.parse = parse;\nexports.slice = slice;\nexports.curry = curry;\nexports.member = member;\nexports.array_to_hash = array_to_hash;\nexports.PRECEDENCE = PRECEDENCE;\nexports.KEYWORDS_ATOM = KEYWORDS_ATOM;\nexports.RESERVED_WORDS = RESERVED_WORDS;\nexports.KEYWORDS = KEYWORDS;\nexports.ATOMIC_START_TOKEN = ATOMIC_START_TOKEN;\nexports.OPERATORS = OPERATORS;\nexports.is_alphanumeric_char = is_alphanumeric_char;\nexports.is_identifier_start = is_identifier_start;\nexports.is_identifier_char = is_identifier_char;\nexports.set_logger = function(logger) {\n warn = logger;\n};\n\n// Local variables:\n// js-indent-level: 4\n// End:\n});define('uglifyjs/squeeze-more', [\"require\", \"exports\", \"module\", \"./parse-js\", \"./squeeze-more\"], function(require, exports, module) {\nvar jsp = require(\"./parse-js\"),\n pro = require(\"./process\"),\n slice = jsp.slice,\n member = jsp.member,\n curry = jsp.curry,\n MAP = pro.MAP,\n PRECEDENCE = jsp.PRECEDENCE,\n OPERATORS = jsp.OPERATORS;\n\nfunction ast_squeeze_more(ast) {\n var w = pro.ast_walker(), walk = w.walk, scope;\n function with_scope(s, cont) {\n var save = scope, ret;\n scope = s;\n ret = cont();\n scope = save;\n return ret;\n };\n function _lambda(name, args, body) {\n return [ this[0], name, args, with_scope(body.scope, curry(MAP, body, walk)) ];\n };\n return w.with_walkers({\n \"toplevel\": function(body) {\n return [ this[0], with_scope(this.scope, curry(MAP, body, walk)) ];\n },\n \"function\": _lambda,\n \"defun\": _lambda,\n \"new\": function(ctor, args) {\n if (ctor[0] == \"name\") {\n if (ctor[1] == \"Array\" && !scope.has(\"Array\")) {\n if (args.length != 1) {\n return [ \"array\", args ];\n } else {\n return walk([ \"call\", [ \"name\", \"Array\" ], args ]);\n }\n } else if (ctor[1] == \"Object\" && !scope.has(\"Object\")) {\n if (!args.length) {\n return [ \"object\", [] ];\n } else {\n return walk([ \"call\", [ \"name\", \"Object\" ], args ]);\n }\n } else if ((ctor[1] == \"RegExp\" || ctor[1] == \"Function\" || ctor[1] == \"Error\") && !scope.has(ctor[1])) {\n return walk([ \"call\", [ \"name\", ctor[1] ], args]);\n }\n }\n },\n \"call\": function(expr, args) {\n if (expr[0] == \"dot\" && expr[1][0] == \"string\" && args.length == 1\n && (args[0][1] > 0 && expr[2] == \"substring\" || expr[2] == \"substr\")) {\n return [ \"call\", [ \"dot\", expr[1], \"slice\"], args];\n }\n if (expr[0] == \"dot\" && expr[2] == \"toString\" && args.length == 0) {\n // foo.toString() ==> foo+\"\"\n if (expr[1][0] == \"string\") return expr[1];\n return [ \"binary\", \"+\", expr[1], [ \"string\", \"\" ]];\n }\n if (expr[0] == \"name\") {\n if (expr[1] == \"Array\" && args.length != 1 && !scope.has(\"Array\")) {\n return [ \"array\", args ];\n }\n if (expr[1] == \"Object\" && !args.length && !scope.has(\"Object\")) {\n return [ \"object\", [] ];\n }\n if (expr[1] == \"String\" && !scope.has(\"String\")) {\n return [ \"binary\", \"+\", args[0], [ \"string\", \"\" ]];\n }\n }\n }\n }, function() {\n return walk(pro.ast_add_scope(ast));\n });\n};\n\nexports.ast_squeeze_more = ast_squeeze_more;\n\n// Local variables:\n// js-indent-level: 4\n// End:\n});\ndefine('uglifyjs/process', [\"require\", \"exports\", \"module\", \"./parse-js\", \"./squeeze-more\"], function(require, exports, module) {\n/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n\n This version is suitable for Node.js. With minimal changes (the\n exports stuff) it should work on any JS platform.\n\n This file implements some AST processors. They work on data built\n by parse-js.\n\n Exported functions:\n\n - ast_mangle(ast, options) -- mangles the variable/function names\n in the AST. Returns an AST.\n\n - ast_squeeze(ast) -- employs various optimizations to make the\n final generated code even smaller. Returns an AST.\n\n - gen_code(ast, options) -- generates JS code from the AST. Pass\n true (or an object, see the code for some options) as second\n argument to get \"pretty\" (indented) code.\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n <[email protected]>\n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2010 (c) Mihai Bazon <[email protected]>\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\nvar jsp = require(\"./parse-js\"),\n curry = jsp.curry,\n slice = jsp.slice,\n member = jsp.member,\n is_identifier_char = jsp.is_identifier_char,\n PRECEDENCE = jsp.PRECEDENCE,\n OPERATORS = jsp.OPERATORS;\n\n/* -----[ helper for AST traversal ]----- */\n\nfunction ast_walker() {\n function _vardefs(defs) {\n return [ this[0], MAP(defs, function(def){\n var a = [ def[0] ];\n if (def.length > 1)\n a[1] = walk(def[1]);\n return a;\n }) ];\n };\n function _block(statements) {\n var out = [ this[0] ];\n if (statements != null)\n out.push(MAP(statements, walk));\n return out;\n };\n var walkers = {\n \"string\": function(str) {\n return [ this[0], str ];\n },\n \"num\": function(num) {\n return [ this[0], num ];\n },\n \"name\": function(name) {\n return [ this[0], name ];\n },\n \"toplevel\": function(statements) {\n return [ this[0], MAP(statements, walk) ];\n },\n \"block\": _block,\n \"splice\": _block,\n \"var\": _vardefs,\n \"const\": _vardefs,\n \"try\": function(t, c, f) {\n return [\n this[0],\n MAP(t, walk),\n c != null ? [ c[0], MAP(c[1], walk) ] : null,\n f != null ? MAP(f, walk) : null\n ];\n },\n \"throw\": function(expr) {\n return [ this[0], walk(expr) ];\n },\n \"new\": function(ctor, args) {\n return [ this[0], walk(ctor), MAP(args, walk) ];\n },\n \"switch\": function(expr, body) {\n return [ this[0], walk(expr), MAP(body, function(branch){\n return [ branch[0] ? walk(branch[0]) : null,\n MAP(branch[1], walk) ];\n }) ];\n },\n \"break\": function(label) {\n return [ this[0], label ];\n },\n \"continue\": function(label) {\n return [ this[0], label ];\n },\n \"conditional\": function(cond, t, e) {\n return [ this[0], walk(cond), walk(t), walk(e) ];\n },\n \"assign\": function(op, lvalue, rvalue) {\n return [ this[0], op, walk(lvalue), walk(rvalue) ];\n },\n \"dot\": function(expr) {\n return [ this[0], walk(expr) ].concat(slice(arguments, 1));\n },\n \"call\": function(expr, args) {\n return [ this[0], walk(expr), MAP(args, walk) ];\n },\n \"function\": function(name, args, body) {\n return [ this[0], name, args.slice(), MAP(body, walk) ];\n },\n \"debugger\": function() {\n return [ this[0] ];\n },\n \"defun\": function(name, args, body) {\n return [ this[0], name, args.slice(), MAP(body, walk) ];\n },\n \"if\": function(conditional, t, e) {\n return [ this[0], walk(conditional), walk(t), walk(e) ];\n },\n \"for\": function(init, cond, step, block) {\n return [ this[0], walk(init), walk(cond), walk(step), walk(block) ];\n },\n \"for-in\": function(vvar, key, hash, block) {\n return [ this[0], walk(vvar), walk(key), walk(hash), walk(block) ];\n },\n \"while\": function(cond, block) {\n return [ this[0], walk(cond), walk(block) ];\n },\n \"do\": function(cond, block) {\n return [ this[0], walk(cond), walk(block) ];\n },\n \"return\": function(expr) {\n return [ this[0], walk(expr) ];\n },\n \"binary\": function(op, left, right) {\n return [ this[0], op, walk(left), walk(right) ];\n },\n \"unary-prefix\": function(op, expr) {\n return [ this[0], op, walk(expr) ];\n },\n \"unary-postfix\": function(op, expr) {\n return [ this[0], op, walk(expr) ];\n },\n \"sub\": function(expr, subscript) {\n return [ this[0], walk(expr), walk(subscript) ];\n },\n \"object\": function(props) {\n return [ this[0], MAP(props, function(p){\n return p.length == 2\n ? [ p[0], walk(p[1]) ]\n : [ p[0], walk(p[1]), p[2] ]; // get/set-ter\n }) ];\n },\n \"regexp\": function(rx, mods) {\n return [ this[0], rx, mods ];\n },\n \"array\": function(elements) {\n return [ this[0], MAP(elements, walk) ];\n },\n \"stat\": function(stat) {\n return [ this[0], walk(stat) ];\n },\n \"seq\": function() {\n return [ this[0] ].concat(MAP(slice(arguments), walk));\n },\n \"label\": function(name, block) {\n return [ this[0], name, walk(block) ];\n },\n \"with\": function(expr, block) {\n return [ this[0], walk(expr), walk(block) ];\n },\n \"atom\": function(name) {\n return [ this[0], name ];\n },\n \"directive\": function(dir) {\n return [ this[0], dir ];\n }\n };\n\n var user = {};\n var stack = [];\n function walk(ast) {\n if (ast == null)\n return null;\n try {\n stack.push(ast);\n var type = ast[0];\n var gen = user[type];\n if (gen) {\n var ret = gen.apply(ast, ast.slice(1));\n if (ret != null)\n return ret;\n }\n gen = walkers[type];\n return gen.apply(ast, ast.slice(1));\n } finally {\n stack.pop();\n }\n };\n\n function dive(ast) {\n if (ast == null)\n return null;\n try {\n stack.push(ast);\n return walkers[ast[0]].apply(ast, ast.slice(1));\n } finally {\n stack.pop();\n }\n };\n\n function with_walkers(walkers, cont){\n var save = {}, i;\n for (i in walkers) if (HOP(walkers, i)) {\n save[i] = user[i];\n user[i] = walkers[i];\n }\n var ret = cont();\n for (i in save) if (HOP(save, i)) {\n if (!save[i]) delete user[i];\n else user[i] = save[i];\n }\n return ret;\n };\n\n return {\n walk: walk,\n dive: dive,\n with_walkers: with_walkers,\n parent: function() {\n return stack[stack.length - 2]; // last one is current node\n },\n stack: function() {\n return stack;\n }\n };\n};\n\n/* -----[ Scope and mangling ]----- */\n\nfunction Scope(parent) {\n this.names = {}; // names defined in this scope\n this.mangled = {}; // mangled names (orig.name => mangled)\n this.rev_mangled = {}; // reverse lookup (mangled => orig.name)\n this.cname = -1; // current mangled name\n this.refs = {}; // names referenced from this scope\n this.uses_with = false; // will become TRUE if with() is detected in this or any subscopes\n this.uses_eval = false; // will become TRUE if eval() is detected in this or any subscopes\n this.directives = []; // directives activated from this scope\n this.parent = parent; // parent scope\n this.children = []; // sub-scopes\n if (parent) {\n this.level = parent.level + 1;\n parent.children.push(this);\n } else {\n this.level = 0;\n }\n};\n\nfunction base54_digits() {\n if (typeof DIGITS_OVERRIDE_FOR_TESTING != \"undefined\")\n return DIGITS_OVERRIDE_FOR_TESTING;\n else\n return \"etnrisouaflchpdvmgybwESxTNCkLAOM_DPHBjFIqRUzWXV$JKQGYZ0516372984\";\n}\n\nvar base54 = (function(){\n var DIGITS = base54_digits();\n return function(num) {\n var ret = \"\", base = 54;\n do {\n ret += DIGITS.charAt(num % base);\n num = Math.floor(num / base);\n base = 64;\n } while (num > 0);\n return ret;\n };\n})();\n\nScope.prototype = {\n has: function(name) {\n for (var s = this; s; s = s.parent)\n if (HOP(s.names, name))\n return s;\n },\n has_mangled: function(mname) {\n for (var s = this; s; s = s.parent)\n if (HOP(s.rev_mangled, mname))\n return s;\n },\n toJSON: function() {\n return {\n names: this.names,\n uses_eval: this.uses_eval,\n uses_with: this.uses_with\n };\n },\n\n next_mangled: function() {\n // we must be careful that the new mangled name:\n //\n // 1. doesn't shadow a mangled name from a parent\n // scope, unless we don't reference the original\n // name from this scope OR from any sub-scopes!\n // This will get slow.\n //\n // 2. doesn't shadow an original name from a parent\n // scope, in the event that the name is not mangled\n // in the parent scope and we reference that name\n // here OR IN ANY SUBSCOPES!\n //\n // 3. doesn't shadow a name that is referenced but not\n // defined (possibly global defined elsewhere).\n for (;;) {\n var m = base54(++this.cname), prior;\n\n // case 1.\n prior = this.has_mangled(m);\n if (prior && this.refs[prior.rev_mangled[m]] === prior)\n continue;\n\n // case 2.\n prior = this.has(m);\n if (prior && prior !== this && this.refs[m] === prior && !prior.has_mangled(m))\n continue;\n\n // case 3.\n if (HOP(this.refs, m) && this.refs[m] == null)\n continue;\n\n // I got \"do\" once. :-/\n if (!is_identifier(m))\n continue;\n\n return m;\n }\n },\n set_mangle: function(name, m) {\n this.rev_mangled[m] = name;\n return this.mangled[name] = m;\n },\n get_mangled: function(name, newMangle) {\n if (this.uses_eval || this.uses_with) return name; // no mangle if eval or with is in use\n var s = this.has(name);\n if (!s) return name; // not in visible scope, no mangle\n if (HOP(s.mangled, name)) return s.mangled[name]; // already mangled in this scope\n if (!newMangle) return name; // not found and no mangling requested\n return s.set_mangle(name, s.next_mangled());\n },\n references: function(name) {\n return name && !this.parent || this.uses_with || this.uses_eval || this.refs[name];\n },\n define: function(name, type) {\n if (name != null) {\n if (type == \"var\" || !HOP(this.names, name))\n this.names[name] = type || \"var\";\n return name;\n }\n },\n active_directive: function(dir) {\n return member(dir, this.directives) || this.parent && this.parent.active_directive(dir);\n }\n};\n\nfunction ast_add_scope(ast) {\n\n var current_scope = null;\n var w = ast_walker(), walk = w.walk;\n var having_eval = [];\n\n function with_new_scope(cont) {\n current_scope = new Scope(current_scope);\n current_scope.labels = new Scope();\n var ret = current_scope.body = cont();\n ret.scope = current_scope;\n current_scope = current_scope.parent;\n return ret;\n };\n\n function define(name, type) {\n return current_scope.define(name, type);\n };\n\n function reference(name) {\n current_scope.refs[name] = true;\n };\n\n function _lambda(name, args, body) {\n var is_defun = this[0] == \"defun\";\n return [ this[0], is_defun ? define(name, \"defun\") : name, args, with_new_scope(function(){\n if (!is_defun) define(name, \"lambda\");\n MAP(args, function(name){ define(name, \"arg\") });\n return MAP(body, walk);\n })];\n };\n\n function _vardefs(type) {\n return function(defs) {\n MAP(defs, function(d){\n define(d[0], type);\n if (d[1]) reference(d[0]);\n });\n };\n };\n\n function _breacont(label) {\n if (label)\n current_scope.labels.refs[label] = true;\n };\n\n return with_new_scope(function(){\n // process AST\n var ret = w.with_walkers({\n \"function\": _lambda,\n \"defun\": _lambda,\n \"label\": function(name, stat) { current_scope.labels.define(name) },\n \"break\": _breacont,\n \"continue\": _breacont,\n \"with\": function(expr, block) {\n for (var s = current_scope; s; s = s.parent)\n s.uses_with = true;\n },\n \"var\": _vardefs(\"var\"),\n \"const\": _vardefs(\"const\"),\n \"try\": function(t, c, f) {\n if (c != null) return [\n this[0],\n MAP(t, walk),\n [ define(c[0], \"catch\"), MAP(c[1], walk) ],\n f != null ? MAP(f, walk) : null\n ];\n },\n \"name\": function(name) {\n if (name == \"eval\")\n having_eval.push(current_scope);\n reference(name);\n }\n }, function(){\n return walk(ast);\n });\n\n // the reason why we need an additional pass here is\n // that names can be used prior to their definition.\n\n // scopes where eval was detected and their parents\n // are marked with uses_eval, unless they define the\n // \"eval\" name.\n MAP(having_eval, function(scope){\n if (!scope.has(\"eval\")) while (scope) {\n scope.uses_eval = true;\n scope = scope.parent;\n }\n });\n\n // for referenced names it might be useful to know\n // their origin scope. current_scope here is the\n // toplevel one.\n function fixrefs(scope, i) {\n // do children first; order shouldn't matter\n for (i = scope.children.length; --i >= 0;)\n fixrefs(scope.children[i]);\n for (i in scope.refs) if (HOP(scope.refs, i)) {\n // find origin scope and propagate the reference to origin\n for (var origin = scope.has(i), s = scope; s; s = s.parent) {\n s.refs[i] = origin;\n if (s === origin) break;\n }\n }\n };\n fixrefs(current_scope);\n\n return ret;\n });\n\n};\n\n/* -----[ mangle names ]----- */\n\nfunction ast_mangle(ast, options) {\n var w = ast_walker(), walk = w.walk, scope;\n options = defaults(options, {\n mangle : true,\n toplevel : false,\n defines : null,\n except : null,\n no_functions : false\n });\n\n function get_mangled(name, newMangle) {\n if (!options.mangle) return name;\n if (!options.toplevel && !scope.parent) return name; // don't mangle toplevel\n if (options.except && member(name, options.except))\n return name;\n if (options.no_functions && HOP(scope.names, name) &&\n (scope.names[name] == 'defun' || scope.names[name] == 'lambda'))\n return name;\n return scope.get_mangled(name, newMangle);\n };\n\n function get_define(name) {\n if (options.defines) {\n // we always lookup a defined symbol for the current scope FIRST, so declared\n // vars trump a DEFINE symbol, but if no such var is found, then match a DEFINE value\n if (!scope.has(name)) {\n if (HOP(options.defines, name)) {\n return options.defines[name];\n }\n }\n return null;\n }\n };\n\n function _lambda(name, args, body) {\n if (!options.no_functions && options.mangle) {\n var is_defun = this[0] == \"defun\", extra;\n if (name) {\n if (is_defun) name = get_mangled(name);\n else if (body.scope.references(name)) {\n extra = {};\n if (!(scope.uses_eval || scope.uses_with))\n name = extra[name] = scope.next_mangled();\n else\n extra[name] = name;\n }\n else name = null;\n }\n }\n body = with_scope(body.scope, function(){\n args = MAP(args, function(name){ return get_mangled(name) });\n return MAP(body, walk);\n }, extra);\n return [ this[0], name, args, body ];\n };\n\n function with_scope(s, cont, extra) {\n var _scope = scope;\n scope = s;\n if (extra) for (var i in extra) if (HOP(extra, i)) {\n s.set_mangle(i, extra[i]);\n }\n for (var i in s.names) if (HOP(s.names, i)) {\n get_mangled(i, true);\n }\n var ret = cont();\n ret.scope = s;\n scope = _scope;\n return ret;\n };\n\n function _vardefs(defs) {\n return [ this[0], MAP(defs, function(d){\n return [ get_mangled(d[0]), walk(d[1]) ];\n }) ];\n };\n\n function _breacont(label) {\n if (label) return [ this[0], scope.labels.get_mangled(label) ];\n };\n\n return w.with_walkers({\n \"function\": _lambda,\n \"defun\": function() {\n // move function declarations to the top when\n // they are not in some block.\n var ast = _lambda.apply(this, arguments);\n switch (w.parent()[0]) {\n case \"toplevel\":\n case \"function\":\n case \"defun\":\n return MAP.at_top(ast);\n }\n return ast;\n },\n \"label\": function(label, stat) {\n if (scope.labels.refs[label]) return [\n this[0],\n scope.labels.get_mangled(label, true),\n walk(stat)\n ];\n return walk(stat);\n },\n \"break\": _breacont,\n \"continue\": _breacont,\n \"var\": _vardefs,\n \"const\": _vardefs,\n \"name\": function(name) {\n return get_define(name) || [ this[0], get_mangled(name) ];\n },\n \"try\": function(t, c, f) {\n return [ this[0],\n MAP(t, walk),\n c != null ? [ get_mangled(c[0]), MAP(c[1], walk) ] : null,\n f != null ? MAP(f, walk) : null ];\n },\n \"toplevel\": function(body) {\n var self = this;\n return with_scope(self.scope, function(){\n return [ self[0], MAP(body, walk) ];\n });\n },\n \"directive\": function() {\n return MAP.at_top(this);\n }\n }, function() {\n return walk(ast_add_scope(ast));\n });\n};\n\n/* -----[\n - compress foo[\"bar\"] into foo.bar,\n - remove block brackets {} where possible\n - join consecutive var declarations\n - various optimizations for IFs:\n - if (cond) foo(); else bar(); ==> cond?foo():bar();\n - if (cond) foo(); ==> cond&&foo();\n - if (foo) return bar(); else return baz(); ==> return foo?bar():baz(); // also for throw\n - if (foo) return bar(); else something(); ==> {if(foo)return bar();something()}\n ]----- */\n\nvar warn = function(){};\n\nfunction best_of(ast1, ast2) {\n return gen_code(ast1).length > gen_code(ast2[0] == \"stat\" ? ast2[1] : ast2).length ? ast2 : ast1;\n};\n\nfunction last_stat(b) {\n if (b[0] == \"block\" && b[1] && b[1].length > 0)\n return b[1][b[1].length - 1];\n return b;\n}\n\nfunction aborts(t) {\n if (t) switch (last_stat(t)[0]) {\n case \"return\":\n case \"break\":\n case \"continue\":\n case \"throw\":\n return true;\n }\n};\n\nfunction boolean_expr(expr) {\n return ( (expr[0] == \"unary-prefix\"\n && member(expr[1], [ \"!\", \"delete\" ])) ||\n\n (expr[0] == \"binary\"\n && member(expr[1], [ \"in\", \"instanceof\", \"==\", \"!=\", \"===\", \"!==\", \"<\", \"<=\", \">=\", \">\" ])) ||\n\n (expr[0] == \"binary\"\n && member(expr[1], [ \"&&\", \"||\" ])\n && boolean_expr(expr[2])\n && boolean_expr(expr[3])) ||\n\n (expr[0] == \"conditional\"\n && boolean_expr(expr[2])\n && boolean_expr(expr[3])) ||\n\n (expr[0] == \"assign\"\n && expr[1] === true\n && boolean_expr(expr[3])) ||\n\n (expr[0] == \"seq\"\n && boolean_expr(expr[expr.length - 1]))\n );\n};\n\nfunction empty(b) {\n return !b || (b[0] == \"block\" && (!b[1] || b[1].length == 0));\n};\n\nfunction is_string(node) {\n return (node[0] == \"string\" ||\n node[0] == \"unary-prefix\" && node[1] == \"typeof\" ||\n node[0] == \"binary\" && node[1] == \"+\" &&\n (is_string(node[2]) || is_string(node[3])));\n};\n\nvar when_constant = (function(){\n\n var $NOT_CONSTANT = {};\n\n // this can only evaluate constant expressions. If it finds anything\n // not constant, it throws $NOT_CONSTANT.\n function evaluate(expr) {\n switch (expr[0]) {\n case \"string\":\n case \"num\":\n return expr[1];\n case \"name\":\n case \"atom\":\n switch (expr[1]) {\n case \"true\": return true;\n case \"false\": return false;\n case \"null\": return null;\n }\n break;\n case \"unary-prefix\":\n switch (expr[1]) {\n case \"!\": return !evaluate(expr[2]);\n case \"typeof\": return typeof evaluate(expr[2]);\n case \"~\": return ~evaluate(expr[2]);\n case \"-\": return -evaluate(expr[2]);\n case \"+\": return +evaluate(expr[2]);\n }\n break;\n case \"binary\":\n var left = expr[2], right = expr[3];\n switch (expr[1]) {\n case \"&&\" : return evaluate(left) && evaluate(right);\n case \"||\" : return evaluate(left) || evaluate(right);\n case \"|\" : return evaluate(left) | evaluate(right);\n case \"&\" : return evaluate(left) & evaluate(right);\n case \"^\" : return evaluate(left) ^ evaluate(right);\n case \"+\" : return evaluate(left) + evaluate(right);\n case \"*\" : return evaluate(left) * evaluate(right);\n case \"/\" : return evaluate(left) / evaluate(right);\n case \"%\" : return evaluate(left) % evaluate(right);\n case \"-\" : return evaluate(left) - evaluate(right);\n case \"<<\" : return evaluate(left) << evaluate(right);\n case \">>\" : return evaluate(left) >> evaluate(right);\n case \">>>\" : return evaluate(left) >>> evaluate(right);\n case \"==\" : return evaluate(left) == evaluate(right);\n case \"===\" : return evaluate(left) === evaluate(right);\n case \"!=\" : return evaluate(left) != evaluate(right);\n case \"!==\" : return evaluate(left) !== evaluate(right);\n case \"<\" : return evaluate(left) < evaluate(right);\n case \"<=\" : return evaluate(left) <= evaluate(right);\n case \">\" : return evaluate(left) > evaluate(right);\n case \">=\" : return evaluate(left) >= evaluate(right);\n case \"in\" : return evaluate(left) in evaluate(right);\n case \"instanceof\" : return evaluate(left) instanceof evaluate(right);\n }\n }\n throw $NOT_CONSTANT;\n };\n\n return function(expr, yes, no) {\n try {\n var val = evaluate(expr), ast;\n switch (typeof val) {\n case \"string\": ast = [ \"string\", val ]; break;\n case \"number\": ast = [ \"num\", val ]; break;\n case \"boolean\": ast = [ \"name\", String(val) ]; break;\n default:\n if (val === null) { ast = [ \"atom\", \"null\" ]; break; }\n throw new Error(\"Can't handle constant of type: \" + (typeof val));\n }\n return yes.call(expr, ast, val);\n } catch(ex) {\n if (ex === $NOT_CONSTANT) {\n if (expr[0] == \"binary\"\n && (expr[1] == \"===\" || expr[1] == \"!==\")\n && ((is_string(expr[2]) && is_string(expr[3]))\n || (boolean_expr(expr[2]) && boolean_expr(expr[3])))) {\n expr[1] = expr[1].substr(0, 2);\n }\n else if (no && expr[0] == \"binary\"\n && (expr[1] == \"||\" || expr[1] == \"&&\")) {\n // the whole expression is not constant but the lval may be...\n try {\n var lval = evaluate(expr[2]);\n expr = ((expr[1] == \"&&\" && (lval ? expr[3] : lval)) ||\n (expr[1] == \"||\" && (lval ? lval : expr[3])) ||\n expr);\n } catch(ex2) {\n // IGNORE... lval is not constant\n }\n }\n return no ? no.call(expr, expr) : null;\n }\n else throw ex;\n }\n };\n\n})();\n\nfunction warn_unreachable(ast) {\n if (!empty(ast))\n warn(\"Dropping unreachable code: \" + gen_code(ast, true));\n};\n\nfunction prepare_ifs(ast) {\n var w = ast_walker(), walk = w.walk;\n // In this first pass, we rewrite ifs which abort with no else with an\n // if-else. For example:\n //\n // if (x) {\n // blah();\n // return y;\n // }\n // foobar();\n //\n // is rewritten into:\n //\n // if (x) {\n // blah();\n // return y;\n // } else {\n // foobar();\n // }\n function redo_if(statements) {\n statements = MAP(statements, walk);\n\n for (var i = 0; i < statements.length; ++i) {\n var fi = statements[i];\n if (fi[0] != \"if\") continue;\n\n if (fi[3]) continue;\n\n var t = fi[2];\n if (!aborts(t)) continue;\n\n var conditional = walk(fi[1]);\n\n var e_body = redo_if(statements.slice(i + 1));\n var e = e_body.length == 1 ? e_body[0] : [ \"block\", e_body ];\n\n return statements.slice(0, i).concat([ [\n fi[0], // \"if\"\n conditional, // conditional\n t, // then\n e // else\n ] ]);\n }\n\n return statements;\n };\n\n function redo_if_lambda(name, args, body) {\n body = redo_if(body);\n return [ this[0], name, args, body ];\n };\n\n function redo_if_block(statements) {\n return [ this[0], statements != null ? redo_if(statements) : null ];\n };\n\n return w.with_walkers({\n \"defun\": redo_if_lambda,\n \"function\": redo_if_lambda,\n \"block\": redo_if_block,\n \"splice\": redo_if_block,\n \"toplevel\": function(statements) {\n return [ this[0], redo_if(statements) ];\n },\n \"try\": function(t, c, f) {\n return [\n this[0],\n redo_if(t),\n c != null ? [ c[0], redo_if(c[1]) ] : null,\n f != null ? redo_if(f) : null\n ];\n }\n }, function() {\n return walk(ast);\n });\n};\n\nfunction for_side_effects(ast, handler) {\n var w = ast_walker(), walk = w.walk;\n var $stop = {}, $restart = {};\n function stop() { throw $stop };\n function restart() { throw $restart };\n function found(){ return handler.call(this, this, w, stop, restart) };\n function unary(op) {\n if (op == \"++\" || op == \"--\")\n return found.apply(this, arguments);\n };\n function binary(op) {\n if (op == \"&&\" || op == \"||\")\n return found.apply(this, arguments);\n };\n return w.with_walkers({\n \"try\": found,\n \"throw\": found,\n \"return\": found,\n \"new\": found,\n \"switch\": found,\n \"break\": found,\n \"continue\": found,\n \"assign\": found,\n \"call\": found,\n \"if\": found,\n \"for\": found,\n \"for-in\": found,\n \"while\": found,\n \"do\": found,\n \"return\": found,\n \"unary-prefix\": unary,\n \"unary-postfix\": unary,\n \"conditional\": found,\n \"binary\": binary,\n \"defun\": found\n }, function(){\n while (true) try {\n walk(ast);\n break;\n } catch(ex) {\n if (ex === $stop) break;\n if (ex === $restart) continue;\n throw ex;\n }\n });\n};\n\nfunction ast_lift_variables(ast) {\n var w = ast_walker(), walk = w.walk, scope;\n function do_body(body, env) {\n var _scope = scope;\n scope = env;\n body = MAP(body, walk);\n var hash = {}, names = MAP(env.names, function(type, name){\n if (type != \"var\") return MAP.skip;\n if (!env.references(name)) return MAP.skip;\n hash[name] = true;\n return [ name ];\n });\n if (names.length > 0) {\n // looking for assignments to any of these variables.\n // we can save considerable space by moving the definitions\n // in the var declaration.\n for_side_effects([ \"block\", body ], function(ast, walker, stop, restart) {\n if (ast[0] == \"assign\"\n && ast[1] === true\n && ast[2][0] == \"name\"\n && HOP(hash, ast[2][1])) {\n // insert the definition into the var declaration\n for (var i = names.length; --i >= 0;) {\n if (names[i][0] == ast[2][1]) {\n if (names[i][1]) // this name already defined, we must stop\n stop();\n names[i][1] = ast[3]; // definition\n names.push(names.splice(i, 1)[0]);\n break;\n }\n }\n // remove this assignment from the AST.\n var p = walker.parent();\n if (p[0] == \"seq\") {\n var a = p[2];\n a.unshift(0, p.length);\n p.splice.apply(p, a);\n }\n else if (p[0] == \"stat\") {\n p.splice(0, p.length, \"block\"); // empty statement\n }\n else {\n stop();\n }\n restart();\n }\n stop();\n });\n body.unshift([ \"var\", names ]);\n }\n scope = _scope;\n return body;\n };\n function _vardefs(defs) {\n var ret = null;\n for (var i = defs.length; --i >= 0;) {\n var d = defs[i];\n if (!d[1]) continue;\n d = [ \"assign\", true, [ \"name\", d[0] ], d[1] ];\n if (ret == null) ret = d;\n else ret = [ \"seq\", d, ret ];\n }\n if (ret == null && w.parent()[0] != \"for\") {\n if (w.parent()[0] == \"for-in\")\n return [ \"name\", defs[0][0] ];\n return MAP.skip;\n }\n return [ \"stat\", ret ];\n };\n function _toplevel(body) {\n return [ this[0], do_body(body, this.scope) ];\n };\n return w.with_walkers({\n \"function\": function(name, args, body){\n for (var i = args.length; --i >= 0 && !body.scope.references(args[i]);)\n args.pop();\n if (!body.scope.references(name)) name = null;\n return [ this[0], name, args, do_body(body, body.scope) ];\n },\n \"defun\": function(name, args, body){\n if (!scope.references(name)) return MAP.skip;\n for (var i = args.length; --i >= 0 && !body.scope.references(args[i]);)\n args.pop();\n return [ this[0], name, args, do_body(body, body.scope) ];\n },\n \"var\": _vardefs,\n \"toplevel\": _toplevel\n }, function(){\n return walk(ast_add_scope(ast));\n });\n};\n\nfunction ast_squeeze(ast, options) {\n ast = squeeze_1(ast, options);\n ast = squeeze_2(ast, options);\n return ast;\n};\n\nfunction squeeze_1(ast, options) {\n options = defaults(options, {\n make_seqs : true,\n dead_code : true,\n no_warnings : false,\n keep_comps : true,\n unsafe : false\n });\n\n var w = ast_walker(), walk = w.walk, scope;\n\n function negate(c) {\n var not_c = [ \"unary-prefix\", \"!\", c ];\n switch (c[0]) {\n case \"unary-prefix\":\n return c[1] == \"!\" && boolean_expr(c[2]) ? c[2] : not_c;\n case \"seq\":\n c = slice(c);\n c[c.length - 1] = negate(c[c.length - 1]);\n return c;\n case \"conditional\":\n return best_of(not_c, [ \"conditional\", c[1], negate(c[2]), negate(c[3]) ]);\n case \"binary\":\n var op = c[1], left = c[2], right = c[3];\n if (!options.keep_comps) switch (op) {\n case \"<=\" : return [ \"binary\", \">\", left, right ];\n case \"<\" : return [ \"binary\", \">=\", left, right ];\n case \">=\" : return [ \"binary\", \"<\", left, right ];\n case \">\" : return [ \"binary\", \"<=\", left, right ];\n }\n switch (op) {\n case \"==\" : return [ \"binary\", \"!=\", left, right ];\n case \"!=\" : return [ \"binary\", \"==\", left, right ];\n case \"===\" : return [ \"binary\", \"!==\", left, right ];\n case \"!==\" : return [ \"binary\", \"===\", left, right ];\n case \"&&\" : return best_of(not_c, [ \"binary\", \"||\", negate(left), negate(right) ]);\n case \"||\" : return best_of(not_c, [ \"binary\", \"&&\", negate(left), negate(right) ]);\n }\n break;\n }\n return not_c;\n };\n\n function make_conditional(c, t, e) {\n var make_real_conditional = function() {\n if (c[0] == \"unary-prefix\" && c[1] == \"!\") {\n return e ? [ \"conditional\", c[2], e, t ] : [ \"binary\", \"||\", c[2], t ];\n } else {\n return e ? best_of(\n [ \"conditional\", c, t, e ],\n [ \"conditional\", negate(c), e, t ]\n ) : [ \"binary\", \"&&\", c, t ];\n }\n };\n // shortcut the conditional if the expression has a constant value\n return when_constant(c, function(ast, val){\n warn_unreachable(val ? e : t);\n return (val ? t : e);\n }, make_real_conditional);\n };\n\n function rmblock(block) {\n if (block != null && block[0] == \"block\" && block[1]) {\n if (block[1].length == 1)\n block = block[1][0];\n else if (block[1].length == 0)\n block = [ \"block\" ];\n }\n return block;\n };\n\n function _lambda(name, args, body) {\n return [ this[0], name, args, tighten(body, \"lambda\") ];\n };\n\n // this function does a few things:\n // 1. discard useless blocks\n // 2. join consecutive var declarations\n // 3. remove obviously dead code\n // 4. transform consecutive statements using the comma operator\n // 5. if block_type == \"lambda\" and it detects constructs like if(foo) return ... - rewrite like if (!foo) { ... }\n function tighten(statements, block_type) {\n statements = MAP(statements, walk);\n\n statements = statements.reduce(function(a, stat){\n if (stat[0] == \"block\") {\n if (stat[1]) {\n a.push.apply(a, stat[1]);\n }\n } else {\n a.push(stat);\n }\n return a;\n }, []);\n\n statements = (function(a, prev){\n statements.forEach(function(cur){\n if (prev && ((cur[0] == \"var\" && prev[0] == \"var\") ||\n (cur[0] == \"const\" && prev[0] == \"const\"))) {\n prev[1] = prev[1].concat(cur[1]);\n } else {\n a.push(cur);\n prev = cur;\n }\n });\n return a;\n })([]);\n\n if (options.dead_code) statements = (function(a, has_quit){\n statements.forEach(function(st){\n if (has_quit) {\n if (st[0] == \"function\" || st[0] == \"defun\") {\n a.push(st);\n }\n else if (st[0] == \"var\" || st[0] == \"const\") {\n if (!options.no_warnings)\n warn(\"Variables declared in unreachable code\");\n st[1] = MAP(st[1], function(def){\n if (def[1] && !options.no_warnings)\n warn_unreachable([ \"assign\", true, [ \"name\", def[0] ], def[1] ]);\n return [ def[0] ];\n });\n a.push(st);\n }\n else if (!options.no_warnings)\n warn_unreachable(st);\n }\n else {\n a.push(st);\n if (member(st[0], [ \"return\", \"throw\", \"break\", \"continue\" ]))\n has_quit = true;\n }\n });\n return a;\n })([]);\n\n if (options.make_seqs) statements = (function(a, prev) {\n statements.forEach(function(cur){\n if (prev && prev[0] == \"stat\" && cur[0] == \"stat\") {\n prev[1] = [ \"seq\", prev[1], cur[1] ];\n } else {\n a.push(cur);\n prev = cur;\n }\n });\n if (a.length >= 2\n && a[a.length-2][0] == \"stat\"\n && (a[a.length-1][0] == \"return\" || a[a.length-1][0] == \"throw\")\n && a[a.length-1][1])\n {\n a.splice(a.length - 2, 2,\n [ a[a.length-1][0],\n [ \"seq\", a[a.length-2][1], a[a.length-1][1] ]]);\n }\n return a;\n })([]);\n\n // this increases jQuery by 1K. Probably not such a good idea after all..\n // part of this is done in prepare_ifs anyway.\n // if (block_type == \"lambda\") statements = (function(i, a, stat){\n // while (i < statements.length) {\n // stat = statements[i++];\n // if (stat[0] == \"if\" && !stat[3]) {\n // if (stat[2][0] == \"return\" && stat[2][1] == null) {\n // a.push(make_if(negate(stat[1]), [ \"block\", statements.slice(i) ]));\n // break;\n // }\n // var last = last_stat(stat[2]);\n // if (last[0] == \"return\" && last[1] == null) {\n // a.push(make_if(stat[1], [ \"block\", stat[2][1].slice(0, -1) ], [ \"block\", statements.slice(i) ]));\n // break;\n // }\n // }\n // a.push(stat);\n // }\n // return a;\n // })(0, []);\n\n return statements;\n };\n\n function make_if(c, t, e) {\n return when_constant(c, function(ast, val){\n if (val) {\n t = walk(t);\n warn_unreachable(e);\n return t || [ \"block\" ];\n } else {\n e = walk(e);\n warn_unreachable(t);\n return e || [ \"block\" ];\n }\n }, function() {\n return make_real_if(c, t, e);\n });\n };\n\n function abort_else(c, t, e) {\n var ret = [ [ \"if\", negate(c), e ] ];\n if (t[0] == \"block\") {\n if (t[1]) ret = ret.concat(t[1]);\n } else {\n ret.push(t);\n }\n return walk([ \"block\", ret ]);\n };\n\n function make_real_if(c, t, e) {\n c = walk(c);\n t = walk(t);\n e = walk(e);\n\n if (empty(e) && empty(t))\n return [ \"stat\", c ];\n\n if (empty(t)) {\n c = negate(c);\n t = e;\n e = null;\n } else if (empty(e)) {\n e = null;\n } else {\n // if we have both else and then, maybe it makes sense to switch them?\n (function(){\n var a = gen_code(c);\n var n = negate(c);\n var b = gen_code(n);\n if (b.length < a.length) {\n var tmp = t;\n t = e;\n e = tmp;\n c = n;\n }\n })();\n }\n var ret = [ \"if\", c, t, e ];\n if (t[0] == \"if\" && empty(t[3]) && empty(e)) {\n ret = best_of(ret, walk([ \"if\", [ \"binary\", \"&&\", c, t[1] ], t[2] ]));\n }\n else if (t[0] == \"stat\") {\n if (e) {\n if (e[0] == \"stat\")\n ret = best_of(ret, [ \"stat\", make_conditional(c, t[1], e[1]) ]);\n else if (aborts(e))\n ret = abort_else(c, t, e);\n }\n else {\n ret = best_of(ret, [ \"stat\", make_conditional(c, t[1]) ]);\n }\n }\n else if (e && t[0] == e[0] && (t[0] == \"return\" || t[0] == \"throw\") && t[1] && e[1]) {\n ret = best_of(ret, [ t[0], make_conditional(c, t[1], e[1] ) ]);\n }\n else if (e && aborts(t)) {\n ret = [ [ \"if\", c, t ] ];\n if (e[0] == \"block\") {\n if (e[1]) ret = ret.concat(e[1]);\n }\n else {\n ret.push(e);\n }\n ret = walk([ \"block\", ret ]);\n }\n else if (t && aborts(e)) {\n ret = abort_else(c, t, e);\n }\n return ret;\n };\n\n function _do_while(cond, body) {\n return when_constant(cond, function(cond, val){\n if (!val) {\n warn_unreachable(body);\n return [ \"block\" ];\n } else {\n return [ \"for\", null, null, null, walk(body) ];\n }\n });\n };\n\n return w.with_walkers({\n \"sub\": function(expr, subscript) {\n if (subscript[0] == \"string\") {\n var name = subscript[1];\n if (is_identifier(name))\n return [ \"dot\", walk(expr), name ];\n else if (/^[1-9][0-9]*$/.test(name) || name === \"0\")\n return [ \"sub\", walk(expr), [ \"num\", parseInt(name, 10) ] ];\n }\n },\n \"if\": make_if,\n \"toplevel\": function(body) {\n return [ \"toplevel\", tighten(body) ];\n },\n \"switch\": function(expr, body) {\n var last = body.length - 1;\n return [ \"switch\", walk(expr), MAP(body, function(branch, i){\n var block = tighten(branch[1]);\n if (i == last && block.length > 0) {\n var node = block[block.length - 1];\n if (node[0] == \"break\" && !node[1])\n block.pop();\n }\n return [ branch[0] ? walk(branch[0]) : null, block ];\n }) ];\n },\n \"function\": _lambda,\n \"defun\": _lambda,\n \"block\": function(body) {\n if (body) return rmblock([ \"block\", tighten(body) ]);\n },\n \"binary\": function(op, left, right) {\n return when_constant([ \"binary\", op, walk(left), walk(right) ], function yes(c){\n return best_of(walk(c), this);\n }, function no() {\n return function(){\n if(op != \"==\" && op != \"!=\") return;\n var l = walk(left), r = walk(right);\n if(l && l[0] == \"unary-prefix\" && l[1] == \"!\" && l[2][0] == \"num\")\n left = ['num', +!l[2][1]];\n else if (r && r[0] == \"unary-prefix\" && r[1] == \"!\" && r[2][0] == \"num\")\n right = ['num', +!r[2][1]];\n return [\"binary\", op, left, right];\n }() || this;\n });\n },\n \"conditional\": function(c, t, e) {\n return make_conditional(walk(c), walk(t), walk(e));\n },\n \"try\": function(t, c, f) {\n return [\n \"try\",\n tighten(t),\n c != null ? [ c[0], tighten(c[1]) ] : null,\n f != null ? tighten(f) : null\n ];\n },\n \"unary-prefix\": function(op, expr) {\n expr = walk(expr);\n var ret = [ \"unary-prefix\", op, expr ];\n if (op == \"!\")\n ret = best_of(ret, negate(expr));\n return when_constant(ret, function(ast, val){\n return walk(ast); // it's either true or false, so minifies to !0 or !1\n }, function() { return ret });\n },\n \"name\": function(name) {\n switch (name) {\n case \"true\": return [ \"unary-prefix\", \"!\", [ \"num\", 0 ]];\n case \"false\": return [ \"unary-prefix\", \"!\", [ \"num\", 1 ]];\n }\n },\n \"while\": _do_while,\n \"assign\": function(op, lvalue, rvalue) {\n lvalue = walk(lvalue);\n rvalue = walk(rvalue);\n var okOps = [ '+', '-', '/', '*', '%', '>>', '<<', '>>>', '|', '^', '&' ];\n if (op === true && lvalue[0] === \"name\" && rvalue[0] === \"binary\" &&\n ~okOps.indexOf(rvalue[1]) && rvalue[2][0] === \"name\" &&\n rvalue[2][1] === lvalue[1]) {\n return [ this[0], rvalue[1], lvalue, rvalue[3] ]\n }\n return [ this[0], op, lvalue, rvalue ];\n },\n \"call\": function(expr, args) {\n expr = walk(expr);\n if (options.unsafe && expr[0] == \"dot\" && expr[1][0] == \"string\" && expr[2] == \"toString\") {\n return expr[1];\n }\n return [ this[0], expr, MAP(args, walk) ];\n },\n \"num\": function (num) {\n if (!isFinite(num))\n return [ \"binary\", \"/\", num === 1 / 0\n ? [ \"num\", 1 ] : num === -1 / 0\n ? [ \"unary-prefix\", \"-\", [ \"num\", 1 ] ]\n : [ \"num\", 0 ], [ \"num\", 0 ] ];\n\n return [ this[0], num ];\n }\n }, function() {\n return walk(prepare_ifs(walk(prepare_ifs(ast))));\n });\n};\n\nfunction squeeze_2(ast, options) {\n var w = ast_walker(), walk = w.walk, scope;\n function with_scope(s, cont) {\n var save = scope, ret;\n scope = s;\n ret = cont();\n scope = save;\n return ret;\n };\n function lambda(name, args, body) {\n return [ this[0], name, args, with_scope(body.scope, curry(MAP, body, walk)) ];\n };\n return w.with_walkers({\n \"directive\": function(dir) {\n if (scope.active_directive(dir))\n return [ \"block\" ];\n scope.directives.push(dir);\n },\n \"toplevel\": function(body) {\n return [ this[0], with_scope(this.scope, curry(MAP, body, walk)) ];\n },\n \"function\": lambda,\n \"defun\": lambda\n }, function(){\n return walk(ast_add_scope(ast));\n });\n};\n\n/* -----[ re-generate code from the AST ]----- */\n\nvar DOT_CALL_NO_PARENS = jsp.array_to_hash([\n \"name\",\n \"array\",\n \"object\",\n \"string\",\n \"dot\",\n \"sub\",\n \"call\",\n \"regexp\",\n \"defun\"\n]);\n\nfunction make_string(str, ascii_only) {\n var dq = 0, sq = 0;\n str = str.replace(/[\\\\\\b\\f\\n\\r\\t\\x22\\x27\\u2028\\u2029\\0]/g, function(s){\n switch (s) {\n case \"\\\\\": return \"\\\\\\\\\";\n case \"\\b\": return \"\\\\b\";\n case \"\\f\": return \"\\\\f\";\n case \"\\n\": return \"\\\\n\";\n case \"\\r\": return \"\\\\r\";\n case \"\\u2028\": return \"\\\\u2028\";\n case \"\\u2029\": return \"\\\\u2029\";\n case '\"': ++dq; return '\"';\n case \"'\": ++sq; return \"'\";\n case \"\\0\": return \"\\\\0\";\n }\n return s;\n });\n if (ascii_only) str = to_ascii(str);\n if (dq > sq) return \"'\" + str.replace(/\\x27/g, \"\\\\'\") + \"'\";\n else return '\"' + str.replace(/\\x22/g, '\\\\\"') + '\"';\n};\n\nfunction to_ascii(str) {\n return str.replace(/[\\u0080-\\uffff]/g, function(ch) {\n var code = ch.charCodeAt(0).toString(16);\n while (code.length < 4) code = \"0\" + code;\n return \"\\\\u\" + code;\n });\n};\n\nvar SPLICE_NEEDS_BRACKETS = jsp.array_to_hash([ \"if\", \"while\", \"do\", \"for\", \"for-in\", \"with\" ]);\n\nfunction gen_code(ast, options) {\n options = defaults(options, {\n indent_start : 0,\n indent_level : 4,\n quote_keys : false,\n space_colon : false,\n beautify : false,\n ascii_only : false,\n inline_script: false\n });\n var beautify = !!options.beautify;\n var indentation = 0,\n newline = beautify ? \"\\n\" : \"\",\n space = beautify ? \" \" : \"\";\n\n function encode_string(str) {\n var ret = make_string(str, options.ascii_only);\n if (options.inline_script)\n ret = ret.replace(/<\\x2fscript([>\\/\\t\\n\\f\\r ])/gi, \"<\\\\/script$1\");\n return ret;\n };\n\n function make_name(name) {\n name = name.toString();\n if (options.ascii_only)\n name = to_ascii(name);\n return name;\n };\n\n function indent(line) {\n if (line == null)\n line = \"\";\n if (beautify)\n line = repeat_string(\" \", options.indent_start + indentation * options.indent_level) + line;\n return line;\n };\n\n function with_indent(cont, incr) {\n if (incr == null) incr = 1;\n indentation += incr;\n try { return cont.apply(null, slice(arguments, 1)); }\n finally { indentation -= incr; }\n };\n\n function last_char(str) {\n str = str.toString();\n return str.charAt(str.length - 1);\n };\n\n function first_char(str) {\n return str.toString().charAt(0);\n };\n\n function add_spaces(a) {\n if (beautify)\n return a.join(\" \");\n var b = [];\n for (var i = 0; i < a.length; ++i) {\n var next = a[i + 1];\n b.push(a[i]);\n if (next &&\n ((is_identifier_char(last_char(a[i])) && (is_identifier_char(first_char(next))\n || first_char(next) == \"\\\\\")) ||\n (/[\\+\\-]$/.test(a[i].toString()) && /^[\\+\\-]/.test(next.toString()) ||\n last_char(a[i]) == \"/\" && first_char(next) == \"/\"))) {\n b.push(\" \");\n }\n }\n return b.join(\"\");\n };\n\n function add_commas(a) {\n return a.join(\",\" + space);\n };\n\n function parenthesize(expr) {\n var gen = make(expr);\n for (var i = 1; i < arguments.length; ++i) {\n var el = arguments[i];\n if ((el instanceof Function && el(expr)) || expr[0] == el)\n return \"(\" + gen + \")\";\n }\n return gen;\n };\n\n function best_of(a) {\n if (a.length == 1) {\n return a[0];\n }\n if (a.length == 2) {\n var b = a[1];\n a = a[0];\n return a.length <= b.length ? a : b;\n }\n return best_of([ a[0], best_of(a.slice(1)) ]);\n };\n\n function needs_parens(expr) {\n if (expr[0] == \"function\" || expr[0] == \"object\") {\n // dot/call on a literal function requires the\n // function literal itself to be parenthesized\n // only if it's the first \"thing\" in a\n // statement. This means that the parent is\n // \"stat\", but it could also be a \"seq\" and\n // we're the first in this \"seq\" and the\n // parent is \"stat\", and so on. Messy stuff,\n // but it worths the trouble.\n var a = slice(w.stack()), self = a.pop(), p = a.pop();\n while (p) {\n if (p[0] == \"stat\") return true;\n if (((p[0] == \"seq\" || p[0] == \"call\" || p[0] == \"dot\" || p[0] == \"sub\" || p[0] == \"conditional\") && p[1] === self) ||\n ((p[0] == \"binary\" || p[0] == \"assign\" || p[0] == \"unary-postfix\") && p[2] === self)) {\n self = p;\n p = a.pop();\n } else {\n return false;\n }\n }\n }\n return !HOP(DOT_CALL_NO_PARENS, expr[0]);\n };\n\n function make_num(num) {\n var str = num.toString(10), a = [ str.replace(/^0\\./, \".\").replace('e+', 'e') ], m;\n if (Math.floor(num) === num) {\n if (num >= 0) {\n a.push(\"0x\" + num.toString(16).toLowerCase(), // probably pointless\n \"0\" + num.toString(8)); // same.\n } else {\n a.push(\"-0x\" + (-num).toString(16).toLowerCase(), // probably pointless\n \"-0\" + (-num).toString(8)); // same.\n }\n if ((m = /^(.*?)(0+)$/.exec(num))) {\n a.push(m[1] + \"e\" + m[2].length);\n }\n } else if ((m = /^0?\\.(0+)(.*)$/.exec(num))) {\n a.push(m[2] + \"e-\" + (m[1].length + m[2].length),\n str.substr(str.indexOf(\".\")));\n }\n return best_of(a);\n };\n\n var w = ast_walker();\n var make = w.walk;\n return w.with_walkers({\n \"string\": encode_string,\n \"num\": make_num,\n \"name\": make_name,\n \"debugger\": function(){ return \"debugger;\" },\n \"toplevel\": function(statements) {\n return make_block_statements(statements)\n .join(newline + newline);\n },\n \"splice\": function(statements) {\n var parent = w.parent();\n if (HOP(SPLICE_NEEDS_BRACKETS, parent)) {\n // we need block brackets in this case\n return make_block.apply(this, arguments);\n } else {\n return MAP(make_block_statements(statements, true),\n function(line, i) {\n // the first line is already indented\n return i > 0 ? indent(line) : line;\n }).join(newline);\n }\n },\n \"block\": make_block,\n \"var\": function(defs) {\n return \"var \" + add_commas(MAP(defs, make_1vardef)) + \";\";\n },\n \"const\": function(defs) {\n return \"const \" + add_commas(MAP(defs, make_1vardef)) + \";\";\n },\n \"try\": function(tr, ca, fi) {\n var out = [ \"try\", make_block(tr) ];\n if (ca) out.push(\"catch\", \"(\" + ca[0] + \")\", make_block(ca[1]));\n if (fi) out.push(\"finally\", make_block(fi));\n return add_spaces(out);\n },\n \"throw\": function(expr) {\n return add_spaces([ \"throw\", make(expr) ]) + \";\";\n },\n \"new\": function(ctor, args) {\n args = args.length > 0 ? \"(\" + add_commas(MAP(args, function(expr){\n return parenthesize(expr, \"seq\");\n })) + \")\" : \"\";\n return add_spaces([ \"new\", parenthesize(ctor, \"seq\", \"binary\", \"conditional\", \"assign\", function(expr){\n var w = ast_walker(), has_call = {};\n try {\n w.with_walkers({\n \"call\": function() { throw has_call },\n \"function\": function() { return this }\n }, function(){\n w.walk(expr);\n });\n } catch(ex) {\n if (ex === has_call)\n return true;\n throw ex;\n }\n }) + args ]);\n },\n \"switch\": function(expr, body) {\n return add_spaces([ \"switch\", \"(\" + make(expr) + \")\", make_switch_block(body) ]);\n },\n \"break\": function(label) {\n var out = \"break\";\n if (label != null)\n out += \" \" + make_name(label);\n return out + \";\";\n },\n \"continue\": function(label) {\n var out = \"continue\";\n if (label != null)\n out += \" \" + make_name(label);\n return out + \";\";\n },\n \"conditional\": function(co, th, el) {\n return add_spaces([ parenthesize(co, \"assign\", \"seq\", \"conditional\"), \"?\",\n parenthesize(th, \"seq\"), \":\",\n parenthesize(el, \"seq\") ]);\n },\n \"assign\": function(op, lvalue, rvalue) {\n if (op && op !== true) op += \"=\";\n else op = \"=\";\n return add_spaces([ make(lvalue), op, parenthesize(rvalue, \"seq\") ]);\n },\n \"dot\": function(expr) {\n var out = make(expr), i = 1;\n if (expr[0] == \"num\") {\n if (!/[a-f.]/i.test(out))\n out += \".\";\n } else if (expr[0] != \"function\" && needs_parens(expr))\n out = \"(\" + out + \")\";\n while (i < arguments.length)\n out += \".\" + make_name(arguments[i++]);\n return out;\n },\n \"call\": function(func, args) {\n var f = make(func);\n if (f.charAt(0) != \"(\" && needs_parens(func))\n f = \"(\" + f + \")\";\n return f + \"(\" + add_commas(MAP(args, function(expr){\n return parenthesize(expr, \"seq\");\n })) + \")\";\n },\n \"function\": make_function,\n \"defun\": make_function,\n \"if\": function(co, th, el) {\n var out = [ \"if\", \"(\" + make(co) + \")\", el ? make_then(th) : make(th) ];\n if (el) {\n out.push(\"else\", make(el));\n }\n return add_spaces(out);\n },\n \"for\": function(init, cond, step, block) {\n var out = [ \"for\" ];\n init = (init != null ? make(init) : \"\").replace(/;*\\s*$/, \";\" + space);\n cond = (cond != null ? make(cond) : \"\").replace(/;*\\s*$/, \";\" + space);\n step = (step != null ? make(step) : \"\").replace(/;*\\s*$/, \"\");\n var args = init + cond + step;\n if (args == \"; ; \") args = \";;\";\n out.push(\"(\" + args + \")\", make(block));\n return add_spaces(out);\n },\n \"for-in\": function(vvar, key, hash, block) {\n return add_spaces([ \"for\", \"(\" +\n (vvar ? make(vvar).replace(/;+$/, \"\") : make(key)),\n \"in\",\n make(hash) + \")\", make(block) ]);\n },\n \"while\": function(condition, block) {\n return add_spaces([ \"while\", \"(\" + make(condition) + \")\", make(block) ]);\n },\n \"do\": function(condition, block) {\n return add_spaces([ \"do\", make(block), \"while\", \"(\" + make(condition) + \")\" ]) + \";\";\n },\n \"return\": function(expr) {\n var out = [ \"return\" ];\n if (expr != null) out.push(make(expr));\n return add_spaces(out) + \";\";\n },\n \"binary\": function(operator, lvalue, rvalue) {\n var left = make(lvalue), right = make(rvalue);\n // XXX: I'm pretty sure other cases will bite here.\n // we need to be smarter.\n // adding parens all the time is the safest bet.\n if (member(lvalue[0], [ \"assign\", \"conditional\", \"seq\" ]) ||\n lvalue[0] == \"binary\" && PRECEDENCE[operator] > PRECEDENCE[lvalue[1]] ||\n lvalue[0] == \"function\" && needs_parens(this)) {\n left = \"(\" + left + \")\";\n }\n if (member(rvalue[0], [ \"assign\", \"conditional\", \"seq\" ]) ||\n rvalue[0] == \"binary\" && PRECEDENCE[operator] >= PRECEDENCE[rvalue[1]] &&\n !(rvalue[1] == operator && member(operator, [ \"&&\", \"||\", \"*\" ]))) {\n right = \"(\" + right + \")\";\n }\n else if (!beautify && options.inline_script && (operator == \"<\" || operator == \"<<\")\n && rvalue[0] == \"regexp\" && /^script/i.test(rvalue[1])) {\n right = \" \" + right;\n }\n return add_spaces([ left, operator, right ]);\n },\n \"unary-prefix\": function(operator, expr) {\n var val = make(expr);\n if (!(expr[0] == \"num\" || (expr[0] == \"unary-prefix\" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr)))\n val = \"(\" + val + \")\";\n return operator + (jsp.is_alphanumeric_char(operator.charAt(0)) ? \" \" : \"\") + val;\n },\n \"unary-postfix\": function(operator, expr) {\n var val = make(expr);\n if (!(expr[0] == \"num\" || (expr[0] == \"unary-postfix\" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr)))\n val = \"(\" + val + \")\";\n return val + operator;\n },\n \"sub\": function(expr, subscript) {\n var hash = make(expr);\n if (needs_parens(expr))\n hash = \"(\" + hash + \")\";\n return hash + \"[\" + make(subscript) + \"]\";\n },\n \"object\": function(props) {\n var obj_needs_parens = needs_parens(this);\n if (props.length == 0)\n return obj_needs_parens ? \"({})\" : \"{}\";\n var out = \"{\" + newline + with_indent(function(){\n return MAP(props, function(p){\n if (p.length == 3) {\n // getter/setter. The name is in p[0], the arg.list in p[1][2], the\n // body in p[1][3] and type (\"get\" / \"set\") in p[2].\n return indent(make_function(p[0], p[1][2], p[1][3], p[2], true));\n }\n var key = p[0], val = parenthesize(p[1], \"seq\");\n if (options.quote_keys) {\n key = encode_string(key);\n } else if ((typeof key == \"number\" || !beautify && +key + \"\" == key)\n && parseFloat(key) >= 0) {\n key = make_num(+key);\n } else if (!is_identifier(key)) {\n key = encode_string(key);\n }\n return indent(add_spaces(beautify && options.space_colon\n ? [ key, \":\", val ]\n : [ key + \":\", val ]));\n }).join(\",\" + newline);\n }) + newline + indent(\"}\");\n return obj_needs_parens ? \"(\" + out + \")\" : out;\n },\n \"regexp\": function(rx, mods) {\n if (options.ascii_only) rx = to_ascii(rx);\n return \"/\" + rx + \"/\" + mods;\n },\n \"array\": function(elements) {\n if (elements.length == 0) return \"[]\";\n return add_spaces([ \"[\", add_commas(MAP(elements, function(el, i){\n if (!beautify && el[0] == \"atom\" && el[1] == \"undefined\") return i === elements.length - 1 ? \",\" : \"\";\n return parenthesize(el, \"seq\");\n })), \"]\" ]);\n },\n \"stat\": function(stmt) {\n return stmt != null\n ? make(stmt).replace(/;*\\s*$/, \";\")\n : \";\";\n },\n \"seq\": function() {\n return add_commas(MAP(slice(arguments), make));\n },\n \"label\": function(name, block) {\n return add_spaces([ make_name(name), \":\", make(block) ]);\n },\n \"with\": function(expr, block) {\n return add_spaces([ \"with\", \"(\" + make(expr) + \")\", make(block) ]);\n },\n \"atom\": function(name) {\n return make_name(name);\n },\n \"directive\": function(dir) {\n return make_string(dir) + \";\";\n }\n }, function(){ return make(ast) });\n\n // The squeezer replaces \"block\"-s that contain only a single\n // statement with the statement itself; technically, the AST\n // is correct, but this can create problems when we output an\n // IF having an ELSE clause where the THEN clause ends in an\n // IF *without* an ELSE block (then the outer ELSE would refer\n // to the inner IF). This function checks for this case and\n // adds the block brackets if needed.\n function make_then(th) {\n if (th == null) return \";\";\n if (th[0] == \"do\") {\n // https://github.com/mishoo/UglifyJS/issues/#issue/57\n // IE croaks with \"syntax error\" on code like this:\n // if (foo) do ... while(cond); else ...\n // we need block brackets around do/while\n return make_block([ th ]);\n }\n var b = th;\n while (true) {\n var type = b[0];\n if (type == \"if\") {\n if (!b[3])\n // no else, we must add the block\n return make([ \"block\", [ th ]]);\n b = b[3];\n }\n else if (type == \"while\" || type == \"do\") b = b[2];\n else if (type == \"for\" || type == \"for-in\") b = b[4];\n else break;\n }\n return make(th);\n };\n\n function make_function(name, args, body, keyword, no_parens) {\n var out = keyword || \"function\";\n if (name) {\n out += \" \" + make_name(name);\n }\n out += \"(\" + add_commas(MAP(args, make_name)) + \")\";\n out = add_spaces([ out, make_block(body) ]);\n return (!no_parens && needs_parens(this)) ? \"(\" + out + \")\" : out;\n };\n\n function must_has_semicolon(node) {\n switch (node[0]) {\n case \"with\":\n case \"while\":\n return empty(node[2]) || must_has_semicolon(node[2]);\n case \"for\":\n case \"for-in\":\n return empty(node[4]) || must_has_semicolon(node[4]);\n case \"if\":\n if (empty(node[2]) && !node[3]) return true; // `if' with empty `then' and no `else'\n if (node[3]) {\n if (empty(node[3])) return true; // `else' present but empty\n return must_has_semicolon(node[3]); // dive into the `else' branch\n }\n return must_has_semicolon(node[2]); // dive into the `then' branch\n case \"directive\":\n return true;\n }\n };\n\n function make_block_statements(statements, noindent) {\n for (var a = [], last = statements.length - 1, i = 0; i <= last; ++i) {\n var stat = statements[i];\n var code = make(stat);\n if (code != \";\") {\n if (!beautify && i == last && !must_has_semicolon(stat)) {\n code = code.replace(/;+\\s*$/, \"\");\n }\n a.push(code);\n }\n }\n return noindent ? a : MAP(a, indent);\n };\n\n function make_switch_block(body) {\n var n = body.length;\n if (n == 0) return \"{}\";\n return \"{\" + newline + MAP(body, function(branch, i){\n var has_body = branch[1].length > 0, code = with_indent(function(){\n return indent(branch[0]\n ? add_spaces([ \"case\", make(branch[0]) + \":\" ])\n : \"default:\");\n }, 0.5) + (has_body ? newline + with_indent(function(){\n return make_block_statements(branch[1]).join(newline);\n }) : \"\");\n if (!beautify && has_body && i < n - 1)\n code += \";\";\n return code;\n }).join(newline) + newline + indent(\"}\");\n };\n\n function make_block(statements) {\n if (!statements) return \";\";\n if (statements.length == 0) return \"{}\";\n return \"{\" + newline + with_indent(function(){\n return make_block_statements(statements).join(newline);\n }) + newline + indent(\"}\");\n };\n\n function make_1vardef(def) {\n var name = def[0], val = def[1];\n if (val != null)\n name = add_spaces([ make_name(name), \"=\", parenthesize(val, \"seq\") ]);\n return name;\n };\n\n};\n\nfunction split_lines(code, max_line_length) {\n var splits = [ 0 ];\n jsp.parse(function(){\n var next_token = jsp.tokenizer(code);\n var last_split = 0;\n var prev_token;\n function current_length(tok) {\n return tok.pos - last_split;\n };\n function split_here(tok) {\n last_split = tok.pos;\n splits.push(last_split);\n };\n function custom(){\n var tok = next_token.apply(this, arguments);\n out: {\n if (prev_token) {\n if (prev_token.type == \"keyword\") break out;\n }\n if (current_length(tok) > max_line_length) {\n switch (tok.type) {\n case \"keyword\":\n case \"atom\":\n case \"name\":\n case \"punc\":\n split_here(tok);\n break out;\n }\n }\n }\n prev_token = tok;\n return tok;\n };\n custom.context = function() {\n return next_token.context.apply(this, arguments);\n };\n return custom;\n }());\n return splits.map(function(pos, i){\n return code.substring(pos, splits[i + 1] || code.length);\n }).join(\"\\n\");\n};\n\n/* -----[ Utilities ]----- */\n\nfunction repeat_string(str, i) {\n if (i <= 0) return \"\";\n if (i == 1) return str;\n var d = repeat_string(str, i >> 1);\n d += d;\n if (i & 1) d += str;\n return d;\n};\n\nfunction defaults(args, defs) {\n var ret = {};\n if (args === true)\n args = {};\n for (var i in defs) if (HOP(defs, i)) {\n ret[i] = (args && HOP(args, i)) ? args[i] : defs[i];\n }\n return ret;\n};\n\nfunction is_identifier(name) {\n return /^[a-z_$][a-z0-9_$]*$/i.test(name)\n && name != \"this\"\n && !HOP(jsp.KEYWORDS_ATOM, name)\n && !HOP(jsp.RESERVED_WORDS, name)\n && !HOP(jsp.KEYWORDS, name);\n};\n\nfunction HOP(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n};\n\n// some utilities\n\nvar MAP;\n\n(function(){\n MAP = function(a, f, o) {\n var ret = [], top = [], i;\n function doit() {\n var val = f.call(o, a[i], i);\n if (val instanceof AtTop) {\n val = val.v;\n if (val instanceof Splice) {\n top.push.apply(top, val.v);\n } else {\n top.push(val);\n }\n }\n else if (val != skip) {\n if (val instanceof Splice) {\n ret.push.apply(ret, val.v);\n } else {\n ret.push(val);\n }\n }\n };\n if (a instanceof Array) for (i = 0; i < a.length; ++i) doit();\n else for (i in a) if (HOP(a, i)) doit();\n return top.concat(ret);\n };\n MAP.at_top = function(val) { return new AtTop(val) };\n MAP.splice = function(val) { return new Splice(val) };\n var skip = MAP.skip = {};\n function AtTop(val) { this.v = val };\n function Splice(val) { this.v = val };\n})();\n\n/* -----[ Exports ]----- */\n\nexports.ast_walker = ast_walker;\nexports.ast_mangle = ast_mangle;\nexports.ast_squeeze = ast_squeeze;\nexports.ast_lift_variables = ast_lift_variables;\nexports.gen_code = gen_code;\nexports.ast_add_scope = ast_add_scope;\nexports.set_logger = function(logger) { warn = logger };\nexports.make_string = make_string;\nexports.split_lines = split_lines;\nexports.MAP = MAP;\n\n// keep this last!\nexports.ast_squeeze_more = require(\"./squeeze-more\").ast_squeeze_more;\n\n// Local variables:\n// js-indent-level: 4\n// End:\n});\ndefine('uglifyjs/index', [\"require\", \"exports\", \"module\", \"./parse-js\", \"./process\", \"./consolidator\"], function(require, exports, module) {\n//convienence function(src, [options]);\nfunction uglify(orig_code, options){\n options || (options = {});\n var jsp = uglify.parser;\n var pro = uglify.uglify;\n\n var ast = jsp.parse(orig_code, options.strict_semicolons); // parse code and get the initial AST\n ast = pro.ast_mangle(ast, options.mangle_options); // get a new AST with mangled names\n ast = pro.ast_squeeze(ast, options.squeeze_options); // get an AST with compression optimizations\n var final_code = pro.gen_code(ast, options.gen_options); // compressed code here\n return final_code;\n};\n\nuglify.parser = require(\"./parse-js\");\nuglify.uglify = require(\"./process\");\nuglify.consolidator = require(\"./consolidator\");\n\nmodule.exports = uglify\n});/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\ndefine('source-map/array-set', function (require, exports, module) {\n\n var util = require('./util');\n\n /**\n * A data structure which is a combination of an array and a set. Adding a new\n * member is O(1), testing for membership is O(1), and finding the index of an\n * element is O(1). Removing elements from the set is not supported. Only\n * strings are supported for membership.\n */\n function ArraySet() {\n this._array = [];\n this._set = {};\n }\n\n /**\n * Static method for creating ArraySet instances from an existing array.\n */\n ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {\n var set = new ArraySet();\n for (var i = 0, len = aArray.length; i < len; i++) {\n set.add(aArray[i], aAllowDuplicates);\n }\n return set;\n };\n\n /**\n * Add the given string to this set.\n *\n * @param String aStr\n */\n ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {\n var isDuplicate = this.has(aStr);\n var idx = this._array.length;\n if (!isDuplicate || aAllowDuplicates) {\n this._array.push(aStr);\n }\n if (!isDuplicate) {\n this._set[util.toSetString(aStr)] = idx;\n }\n };\n\n /**\n * Is the given string a member of this set?\n *\n * @param String aStr\n */\n ArraySet.prototype.has = function ArraySet_has(aStr) {\n return Object.prototype.hasOwnProperty.call(this._set,\n util.toSetString(aStr));\n };\n\n /**\n * What is the index of the given string in the array?\n *\n * @param String aStr\n */\n ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {\n if (this.has(aStr)) {\n return this._set[util.toSetString(aStr)];\n }\n throw new Error('\"' + aStr + '\" is not in the set.');\n };\n\n /**\n * What is the element at the given index?\n *\n * @param Number aIdx\n */\n ArraySet.prototype.at = function ArraySet_at(aIdx) {\n if (aIdx >= 0 && aIdx < this._array.length) {\n return this._array[aIdx];\n }\n throw new Error('No element indexed by ' + aIdx);\n };\n\n /**\n * Returns the array representation of this set (which has the proper indices\n * indicated by indexOf). Note that this is a copy of the internal array used\n * for storing the members so that no one can mess with internal state.\n */\n ArraySet.prototype.toArray = function ArraySet_toArray() {\n return this._array.slice();\n };\n\n exports.ArraySet = ArraySet;\n\n});\n/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * Based on the Base 64 VLQ implementation in Closure Compiler:\n * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java\n *\n * Copyright 2011 The Closure Compiler Authors. All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are\n * met:\n *\n * * Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * * Redistributions in binary form must reproduce the above\n * copyright notice, this list of conditions and the following\n * disclaimer in the documentation and/or other materials provided\n * with the distribution.\n * * Neither the name of Google Inc. nor the names of its\n * contributors may be used to endorse or promote products derived\n * from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\ndefine('source-map/base64-vlq', function (require, exports, module) {\n\n var base64 = require('./base64');\n\n // A single base 64 digit can contain 6 bits of data. For the base 64 variable\n // length quantities we use in the source map spec, the first bit is the sign,\n // the next four bits are the actual value, and the 6th bit is the\n // continuation bit. The continuation bit tells us whether there are more\n // digits in this value following this digit.\n //\n // Continuation\n // | Sign\n // | |\n // V V\n // 101011\n\n var VLQ_BASE_SHIFT = 5;\n\n // binary: 100000\n var VLQ_BASE = 1 << VLQ_BASE_SHIFT;\n\n // binary: 011111\n var VLQ_BASE_MASK = VLQ_BASE - 1;\n\n // binary: 100000\n var VLQ_CONTINUATION_BIT = VLQ_BASE;\n\n /**\n * Converts from a two-complement value to a value where the sign bit is\n * is placed in the least significant bit. For example, as decimals:\n * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)\n * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)\n */\n function toVLQSigned(aValue) {\n return aValue < 0\n ? ((-aValue) << 1) + 1\n : (aValue << 1) + 0;\n }\n\n /**\n * Converts to a two-complement value from a value where the sign bit is\n * is placed in the least significant bit. For example, as decimals:\n * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1\n * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2\n */\n function fromVLQSigned(aValue) {\n var isNegative = (aValue & 1) === 1;\n var shifted = aValue >> 1;\n return isNegative\n ? -shifted\n : shifted;\n }\n\n /**\n * Returns the base 64 VLQ encoded value.\n */\n exports.encode = function base64VLQ_encode(aValue) {\n var encoded = \"\";\n var digit;\n\n var vlq = toVLQSigned(aValue);\n\n do {\n digit = vlq & VLQ_BASE_MASK;\n vlq >>>= VLQ_BASE_SHIFT;\n if (vlq > 0) {\n // There are still more digits in this value, so we must make sure the\n // continuation bit is marked.\n digit |= VLQ_CONTINUATION_BIT;\n }\n encoded += base64.encode(digit);\n } while (vlq > 0);\n\n return encoded;\n };\n\n /**\n * Decodes the next base 64 VLQ value from the given string and returns the\n * value and the rest of the string.\n */\n exports.decode = function base64VLQ_decode(aStr) {\n var i = 0;\n var strLen = aStr.length;\n var result = 0;\n var shift = 0;\n var continuation, digit;\n\n do {\n if (i >= strLen) {\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n }\n digit = base64.decode(aStr.charAt(i++));\n continuation = !!(digit & VLQ_CONTINUATION_BIT);\n digit &= VLQ_BASE_MASK;\n result = result + (digit << shift);\n shift += VLQ_BASE_SHIFT;\n } while (continuation);\n\n return {\n value: fromVLQSigned(result),\n rest: aStr.slice(i)\n };\n };\n\n});\n/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\ndefine('source-map/base64', function (require, exports, module) {\n\n var charToIntMap = {};\n var intToCharMap = {};\n\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\n .split('')\n .forEach(function (ch, index) {\n charToIntMap[ch] = index;\n intToCharMap[index] = ch;\n });\n\n /**\n * Encode an integer in the range of 0 to 63 to a single base 64 digit.\n */\n exports.encode = function base64_encode(aNumber) {\n if (aNumber in intToCharMap) {\n return intToCharMap[aNumber];\n }\n throw new TypeError(\"Must be between 0 and 63: \" + aNumber);\n };\n\n /**\n * Decode a single base 64 digit to an integer.\n */\n exports.decode = function base64_decode(aChar) {\n if (aChar in charToIntMap) {\n return charToIntMap[aChar];\n }\n throw new TypeError(\"Not a valid base 64 digit: \" + aChar);\n };\n\n});\n/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\ndefine('source-map/binary-search', function (require, exports, module) {\n\n /**\n * Recursive implementation of binary search.\n *\n * @param aLow Indices here and lower do not contain the needle.\n * @param aHigh Indices here and higher do not contain the needle.\n * @param aNeedle The element being searched for.\n * @param aHaystack The non-empty array being searched.\n * @param aCompare Function which takes two elements and returns -1, 0, or 1.\n */\n function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) {\n // This function terminates when one of the following is true:\n //\n // 1. We find the exact element we are looking for.\n //\n // 2. We did not find the exact element, but we can return the next\n // closest element that is less than that element.\n //\n // 3. We did not find the exact element, and there is no next-closest\n // element which is less than the one we are searching for, so we\n // return null.\n var mid = Math.floor((aHigh - aLow) / 2) + aLow;\n var cmp = aCompare(aNeedle, aHaystack[mid], true);\n if (cmp === 0) {\n // Found the element we are looking for.\n return aHaystack[mid];\n }\n else if (cmp > 0) {\n // aHaystack[mid] is greater than our needle.\n if (aHigh - mid > 1) {\n // The element is in the upper half.\n return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare);\n }\n // We did not find an exact match, return the next closest one\n // (termination case 2).\n return aHaystack[mid];\n }\n else {\n // aHaystack[mid] is less than our needle.\n if (mid - aLow > 1) {\n // The element is in the lower half.\n return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare);\n }\n // The exact needle element was not found in this haystack. Determine if\n // we are in termination case (2) or (3) and return the appropriate thing.\n return aLow < 0\n ? null\n : aHaystack[aLow];\n }\n }\n\n /**\n * This is an implementation of binary search which will always try and return\n * the next lowest value checked if there is no exact hit. This is because\n * mappings between original and generated line/col pairs are single points,\n * and there is an implicit region between each of them, so a miss just means\n * that you aren't on the very start of a region.\n *\n * @param aNeedle The element you are looking for.\n * @param aHaystack The array that is being searched.\n * @param aCompare A function which takes the needle and an element in the\n * array and returns -1, 0, or 1 depending on whether the needle is less\n * than, equal to, or greater than the element, respectively.\n */\n exports.search = function search(aNeedle, aHaystack, aCompare) {\n return aHaystack.length > 0\n ? recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare)\n : null;\n };\n\n});\n/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\ndefine('source-map/source-map-consumer', function (require, exports, module) {\n\n var util = require('./util');\n var binarySearch = require('./binary-search');\n var ArraySet = require('./array-set').ArraySet;\n var base64VLQ = require('./base64-vlq');\n\n /**\n * A SourceMapConsumer instance represents a parsed source map which we can\n * query for information about the original file positions by giving it a file\n * position in the generated source.\n *\n * The only parameter is the raw source map (either as a JSON string, or\n * already parsed to an object). According to the spec, source maps have the\n * following attributes:\n *\n * - version: Which version of the source map spec this map is following.\n * - sources: An array of URLs to the original source files.\n * - names: An array of identifiers which can be referrenced by individual mappings.\n * - sourceRoot: Optional. The URL root from which all sources are relative.\n * - sourcesContent: Optional. An array of contents of the original source files.\n * - mappings: A string of base64 VLQs which contain the actual mappings.\n * - file: Optional. The generated file this source map is associated with.\n *\n * Here is an example source map, taken from the source map spec[0]:\n *\n * {\n * version : 3,\n * file: \"out.js\",\n * sourceRoot : \"\",\n * sources: [\"foo.js\", \"bar.js\"],\n * names: [\"src\", \"maps\", \"are\", \"fun\"],\n * mappings: \"AA,AB;;ABCDE;\"\n * }\n *\n * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#\n */\n function SourceMapConsumer(aSourceMap) {\n var sourceMap = aSourceMap;\n if (typeof aSourceMap === 'string') {\n sourceMap = JSON.parse(aSourceMap.replace(/^\\)\\]\\}'/, ''));\n }\n\n var version = util.getArg(sourceMap, 'version');\n var sources = util.getArg(sourceMap, 'sources');\n // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which\n // requires the array) to play nice here.\n var names = util.getArg(sourceMap, 'names', []);\n var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);\n var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);\n var mappings = util.getArg(sourceMap, 'mappings');\n var file = util.getArg(sourceMap, 'file', null);\n\n // Once again, Sass deviates from the spec and supplies the version as a\n // string rather than a number, so we use loose equality checking here.\n if (version != this._version) {\n throw new Error('Unsupported version: ' + version);\n }\n\n // Pass `true` below to allow duplicate names and sources. While source maps\n // are intended to be compressed and deduplicated, the TypeScript compiler\n // sometimes generates source maps with duplicates in them. See Github issue\n // #72 and bugzil.la/889492.\n this._names = ArraySet.fromArray(names, true);\n this._sources = ArraySet.fromArray(sources, true);\n\n this.sourceRoot = sourceRoot;\n this.sourcesContent = sourcesContent;\n this._mappings = mappings;\n this.file = file;\n }\n\n /**\n * Create a SourceMapConsumer from a SourceMapGenerator.\n *\n * @param SourceMapGenerator aSourceMap\n * The source map that will be consumed.\n * @returns SourceMapConsumer\n */\n SourceMapConsumer.fromSourceMap =\n function SourceMapConsumer_fromSourceMap(aSourceMap) {\n var smc = Object.create(SourceMapConsumer.prototype);\n\n smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);\n smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);\n smc.sourceRoot = aSourceMap._sourceRoot;\n smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),\n smc.sourceRoot);\n smc.file = aSourceMap._file;\n\n smc.__generatedMappings = aSourceMap._mappings.slice()\n .sort(util.compareByGeneratedPositions);\n smc.__originalMappings = aSourceMap._mappings.slice()\n .sort(util.compareByOriginalPositions);\n\n return smc;\n };\n\n /**\n * The version of the source mapping spec that we are consuming.\n */\n SourceMapConsumer.prototype._version = 3;\n\n /**\n * The list of original sources.\n */\n Object.defineProperty(SourceMapConsumer.prototype, 'sources', {\n get: function () {\n return this._sources.toArray().map(function (s) {\n return this.sourceRoot ? util.join(this.sourceRoot, s) : s;\n }, this);\n }\n });\n\n // `__generatedMappings` and `__originalMappings` are arrays that hold the\n // parsed mapping coordinates from the source map's \"mappings\" attribute. They\n // are lazily instantiated, accessed via the `_generatedMappings` and\n // `_originalMappings` getters respectively, and we only parse the mappings\n // and create these arrays once queried for a source location. We jump through\n // these hoops because there can be many thousands of mappings, and parsing\n // them is expensive, so we only want to do it if we must.\n //\n // Each object in the arrays is of the form:\n //\n // {\n // generatedLine: The line number in the generated code,\n // generatedColumn: The column number in the generated code,\n // source: The path to the original source file that generated this\n // chunk of code,\n // originalLine: The line number in the original source that\n // corresponds to this chunk of generated code,\n // originalColumn: The column number in the original source that\n // corresponds to this chunk of generated code,\n // name: The name of the original symbol which generated this chunk of\n // code.\n // }\n //\n // All properties except for `generatedLine` and `generatedColumn` can be\n // `null`.\n //\n // `_generatedMappings` is ordered by the generated positions.\n //\n // `_originalMappings` is ordered by the original positions.\n\n SourceMapConsumer.prototype.__generatedMappings = null;\n Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {\n get: function () {\n if (!this.__generatedMappings) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__generatedMappings;\n }\n });\n\n SourceMapConsumer.prototype.__originalMappings = null;\n Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {\n get: function () {\n if (!this.__originalMappings) {\n this.__generatedMappings = [];\n this.__originalMappings = [];\n this._parseMappings(this._mappings, this.sourceRoot);\n }\n\n return this.__originalMappings;\n }\n });\n\n /**\n * Parse the mappings in a string in to a data structure which we can easily\n * query (the ordered arrays in the `this.__generatedMappings` and\n * `this.__originalMappings` properties).\n */\n SourceMapConsumer.prototype._parseMappings =\n function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {\n var generatedLine = 1;\n var previousGeneratedColumn = 0;\n var previousOriginalLine = 0;\n var previousOriginalColumn = 0;\n var previousSource = 0;\n var previousName = 0;\n var mappingSeparator = /^[,;]/;\n var str = aStr;\n var mapping;\n var temp;\n\n while (str.length > 0) {\n if (str.charAt(0) === ';') {\n generatedLine++;\n str = str.slice(1);\n previousGeneratedColumn = 0;\n }\n else if (str.charAt(0) === ',') {\n str = str.slice(1);\n }\n else {\n mapping = {};\n mapping.generatedLine = generatedLine;\n\n // Generated column.\n temp = base64VLQ.decode(str);\n mapping.generatedColumn = previousGeneratedColumn + temp.value;\n previousGeneratedColumn = mapping.generatedColumn;\n str = temp.rest;\n\n if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) {\n // Original source.\n temp = base64VLQ.decode(str);\n mapping.source = this._sources.at(previousSource + temp.value);\n previousSource += temp.value;\n str = temp.rest;\n if (str.length === 0 || mappingSeparator.test(str.charAt(0))) {\n throw new Error('Found a source, but no line and column');\n }\n\n // Original line.\n temp = base64VLQ.decode(str);\n mapping.originalLine = previousOriginalLine + temp.value;\n previousOriginalLine = mapping.originalLine;\n // Lines are stored 0-based\n mapping.originalLine += 1;\n str = temp.rest;\n if (str.length === 0 || mappingSeparator.test(str.charAt(0))) {\n throw new Error('Found a source and line, but no column');\n }\n\n // Original column.\n temp = base64VLQ.decode(str);\n mapping.originalColumn = previousOriginalColumn + temp.value;\n previousOriginalColumn = mapping.originalColumn;\n str = temp.rest;\n\n if (str.length > 0 && !mappingSeparator.test(str.charAt(0))) {\n // Original name.\n temp = base64VLQ.decode(str);\n mapping.name = this._names.at(previousName + temp.value);\n previousName += temp.value;\n str = temp.rest;\n }\n }\n\n this.__generatedMappings.push(mapping);\n if (typeof mapping.originalLine === 'number') {\n this.__originalMappings.push(mapping);\n }\n }\n }\n\n this.__generatedMappings.sort(util.compareByGeneratedPositions);\n this.__originalMappings.sort(util.compareByOriginalPositions);\n };\n\n /**\n * Find the mapping that best matches the hypothetical \"needle\" mapping that\n * we are searching for in the given \"haystack\" of mappings.\n */\n SourceMapConsumer.prototype._findMapping =\n function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,\n aColumnName, aComparator) {\n // To return the position we are searching for, we must first find the\n // mapping for the given position and then return the opposite position it\n // points to. Because the mappings are sorted, we can use binary search to\n // find the best mapping.\n\n if (aNeedle[aLineName] <= 0) {\n throw new TypeError('Line must be greater than or equal to 1, got '\n + aNeedle[aLineName]);\n }\n if (aNeedle[aColumnName] < 0) {\n throw new TypeError('Column must be greater than or equal to 0, got '\n + aNeedle[aColumnName]);\n }\n\n return binarySearch.search(aNeedle, aMappings, aComparator);\n };\n\n /**\n * Returns the original source, line, and column information for the generated\n * source's line and column positions provided. The only argument is an object\n * with the following properties:\n *\n * - line: The line number in the generated source.\n * - column: The column number in the generated source.\n *\n * and an object is returned with the following properties:\n *\n * - source: The original source file, or null.\n * - line: The line number in the original source, or null.\n * - column: The column number in the original source, or null.\n * - name: The original identifier, or null.\n */\n SourceMapConsumer.prototype.originalPositionFor =\n function SourceMapConsumer_originalPositionFor(aArgs) {\n var needle = {\n generatedLine: util.getArg(aArgs, 'line'),\n generatedColumn: util.getArg(aArgs, 'column')\n };\n\n var mapping = this._findMapping(needle,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n util.compareByGeneratedPositions);\n\n if (mapping && mapping.generatedLine === needle.generatedLine) {\n var source = util.getArg(mapping, 'source', null);\n if (source && this.sourceRoot) {\n source = util.join(this.sourceRoot, source);\n }\n return {\n source: source,\n line: util.getArg(mapping, 'originalLine', null),\n column: util.getArg(mapping, 'originalColumn', null),\n name: util.getArg(mapping, 'name', null)\n };\n }\n\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n };\n\n /**\n * Returns the original source content. The only argument is the url of the\n * original source file. Returns null if no original source content is\n * availible.\n */\n SourceMapConsumer.prototype.sourceContentFor =\n function SourceMapConsumer_sourceContentFor(aSource) {\n if (!this.sourcesContent) {\n return null;\n }\n\n if (this.sourceRoot) {\n aSource = util.relative(this.sourceRoot, aSource);\n }\n\n if (this._sources.has(aSource)) {\n return this.sourcesContent[this._sources.indexOf(aSource)];\n }\n\n var url;\n if (this.sourceRoot\n && (url = util.urlParse(this.sourceRoot))) {\n // XXX: file:// URIs and absolute paths lead to unexpected behavior for\n // many users. We can help them out when they expect file:// URIs to\n // behave like it would if they were running a local HTTP server. See\n // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.\n var fileUriAbsPath = aSource.replace(/^file:\\/\\//, \"\");\n if (url.scheme == \"file\"\n && this._sources.has(fileUriAbsPath)) {\n return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]\n }\n\n if ((!url.path || url.path == \"/\")\n && this._sources.has(\"/\" + aSource)) {\n return this.sourcesContent[this._sources.indexOf(\"/\" + aSource)];\n }\n }\n\n throw new Error('\"' + aSource + '\" is not in the SourceMap.');\n };\n\n /**\n * Returns the generated line and column information for the original source,\n * line, and column positions provided. The only argument is an object with\n * the following properties:\n *\n * - source: The filename of the original source.\n * - line: The line number in the original source.\n * - column: The column number in the original source.\n *\n * and an object is returned with the following properties:\n *\n * - line: The line number in the generated source, or null.\n * - column: The column number in the generated source, or null.\n */\n SourceMapConsumer.prototype.generatedPositionFor =\n function SourceMapConsumer_generatedPositionFor(aArgs) {\n var needle = {\n source: util.getArg(aArgs, 'source'),\n originalLine: util.getArg(aArgs, 'line'),\n originalColumn: util.getArg(aArgs, 'column')\n };\n\n if (this.sourceRoot) {\n needle.source = util.relative(this.sourceRoot, needle.source);\n }\n\n var mapping = this._findMapping(needle,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n util.compareByOriginalPositions);\n\n if (mapping) {\n return {\n line: util.getArg(mapping, 'generatedLine', null),\n column: util.getArg(mapping, 'generatedColumn', null)\n };\n }\n\n return {\n line: null,\n column: null\n };\n };\n\n SourceMapConsumer.GENERATED_ORDER = 1;\n SourceMapConsumer.ORIGINAL_ORDER = 2;\n\n /**\n * Iterate over each mapping between an original source/line/column and a\n * generated line/column in this source map.\n *\n * @param Function aCallback\n * The function that is called with each mapping.\n * @param Object aContext\n * Optional. If specified, this object will be the value of `this` every\n * time that `aCallback` is called.\n * @param aOrder\n * Either `SourceMapConsumer.GENERATED_ORDER` or\n * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n * iterate over the mappings sorted by the generated file's line/column\n * order or the original's source/line/column order, respectively. Defaults to\n * `SourceMapConsumer.GENERATED_ORDER`.\n */\n SourceMapConsumer.prototype.eachMapping =\n function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {\n var context = aContext || null;\n var order = aOrder || SourceMapConsumer.GENERATED_ORDER;\n\n var mappings;\n switch (order) {\n case SourceMapConsumer.GENERATED_ORDER:\n mappings = this._generatedMappings;\n break;\n case SourceMapConsumer.ORIGINAL_ORDER:\n mappings = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n\n var sourceRoot = this.sourceRoot;\n mappings.map(function (mapping) {\n var source = mapping.source;\n if (source && sourceRoot) {\n source = util.join(sourceRoot, source);\n }\n return {\n source: source,\n generatedLine: mapping.generatedLine,\n generatedColumn: mapping.generatedColumn,\n originalLine: mapping.originalLine,\n originalColumn: mapping.originalColumn,\n name: mapping.name\n };\n }).forEach(aCallback, context);\n };\n\n exports.SourceMapConsumer = SourceMapConsumer;\n\n});\n/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\ndefine('source-map/source-map-generator', function (require, exports, module) {\n\n var base64VLQ = require('./base64-vlq');\n var util = require('./util');\n var ArraySet = require('./array-set').ArraySet;\n\n /**\n * An instance of the SourceMapGenerator represents a source map which is\n * being built incrementally. You may pass an object with the following\n * properties:\n *\n * - file: The filename of the generated source.\n * - sourceRoot: A root for all relative URLs in this source map.\n */\n function SourceMapGenerator(aArgs) {\n if (!aArgs) {\n aArgs = {};\n }\n this._file = util.getArg(aArgs, 'file', null);\n this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);\n this._sources = new ArraySet();\n this._names = new ArraySet();\n this._mappings = [];\n this._sourcesContents = null;\n }\n\n SourceMapGenerator.prototype._version = 3;\n\n /**\n * Creates a new SourceMapGenerator based on a SourceMapConsumer\n *\n * @param aSourceMapConsumer The SourceMap.\n */\n SourceMapGenerator.fromSourceMap =\n function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {\n var sourceRoot = aSourceMapConsumer.sourceRoot;\n var generator = new SourceMapGenerator({\n file: aSourceMapConsumer.file,\n sourceRoot: sourceRoot\n });\n aSourceMapConsumer.eachMapping(function (mapping) {\n var newMapping = {\n generated: {\n line: mapping.generatedLine,\n column: mapping.generatedColumn\n }\n };\n\n if (mapping.source) {\n newMapping.source = mapping.source;\n if (sourceRoot) {\n newMapping.source = util.relative(sourceRoot, newMapping.source);\n }\n\n newMapping.original = {\n line: mapping.originalLine,\n column: mapping.originalColumn\n };\n\n if (mapping.name) {\n newMapping.name = mapping.name;\n }\n }\n\n generator.addMapping(newMapping);\n });\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content) {\n generator.setSourceContent(sourceFile, content);\n }\n });\n return generator;\n };\n\n /**\n * Add a single mapping from original source line and column to the generated\n * source's line and column for this source map being created. The mapping\n * object should have the following properties:\n *\n * - generated: An object with the generated line and column positions.\n * - original: An object with the original line and column positions.\n * - source: The original source file (relative to the sourceRoot).\n * - name: An optional original token name for this mapping.\n */\n SourceMapGenerator.prototype.addMapping =\n function SourceMapGenerator_addMapping(aArgs) {\n var generated = util.getArg(aArgs, 'generated');\n var original = util.getArg(aArgs, 'original', null);\n var source = util.getArg(aArgs, 'source', null);\n var name = util.getArg(aArgs, 'name', null);\n\n this._validateMapping(generated, original, source, name);\n\n if (source && !this._sources.has(source)) {\n this._sources.add(source);\n }\n\n if (name && !this._names.has(name)) {\n this._names.add(name);\n }\n\n this._mappings.push({\n generatedLine: generated.line,\n generatedColumn: generated.column,\n originalLine: original != null && original.line,\n originalColumn: original != null && original.column,\n source: source,\n name: name\n });\n };\n\n /**\n * Set the source content for a source file.\n */\n SourceMapGenerator.prototype.setSourceContent =\n function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {\n var source = aSourceFile;\n if (this._sourceRoot) {\n source = util.relative(this._sourceRoot, source);\n }\n\n if (aSourceContent !== null) {\n // Add the source content to the _sourcesContents map.\n // Create a new _sourcesContents map if the property is null.\n if (!this._sourcesContents) {\n this._sourcesContents = {};\n }\n this._sourcesContents[util.toSetString(source)] = aSourceContent;\n } else {\n // Remove the source file from the _sourcesContents map.\n // If the _sourcesContents map is empty, set the property to null.\n delete this._sourcesContents[util.toSetString(source)];\n if (Object.keys(this._sourcesContents).length === 0) {\n this._sourcesContents = null;\n }\n }\n };\n\n /**\n * Applies the mappings of a sub-source-map for a specific source file to the\n * source map being generated. Each mapping to the supplied source file is\n * rewritten using the supplied source map. Note: The resolution for the\n * resulting mappings is the minimium of this map and the supplied map.\n *\n * @param aSourceMapConsumer The source map to be applied.\n * @param aSourceFile Optional. The filename of the source file.\n * If omitted, SourceMapConsumer's file property will be used.\n * @param aSourceMapPath Optional. The dirname of the path to the source map\n * to be applied. If relative, it is relative to the SourceMapConsumer.\n * This parameter is needed when the two source maps aren't in the same\n * directory, and the source map to be applied contains relative source\n * paths. If so, those relative source paths need to be rewritten\n * relative to the SourceMapGenerator.\n */\n SourceMapGenerator.prototype.applySourceMap =\n function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {\n // If aSourceFile is omitted, we will use the file property of the SourceMap\n if (!aSourceFile) {\n if (!aSourceMapConsumer.file) {\n throw new Error(\n 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +\n 'or the source map\\'s \"file\" property. Both were omitted.'\n );\n }\n aSourceFile = aSourceMapConsumer.file;\n }\n var sourceRoot = this._sourceRoot;\n // Make \"aSourceFile\" relative if an absolute Url is passed.\n if (sourceRoot) {\n aSourceFile = util.relative(sourceRoot, aSourceFile);\n }\n // Applying the SourceMap can add and remove items from the sources and\n // the names array.\n var newSources = new ArraySet();\n var newNames = new ArraySet();\n\n // Find mappings for the \"aSourceFile\"\n this._mappings.forEach(function (mapping) {\n if (mapping.source === aSourceFile && mapping.originalLine) {\n // Check if it can be mapped by the source map, then update the mapping.\n var original = aSourceMapConsumer.originalPositionFor({\n line: mapping.originalLine,\n column: mapping.originalColumn\n });\n if (original.source !== null) {\n // Copy mapping\n mapping.source = original.source;\n if (aSourceMapPath) {\n mapping.source = util.join(aSourceMapPath, mapping.source)\n }\n if (sourceRoot) {\n mapping.source = util.relative(sourceRoot, mapping.source);\n }\n mapping.originalLine = original.line;\n mapping.originalColumn = original.column;\n if (original.name !== null && mapping.name !== null) {\n // Only use the identifier name if it's an identifier\n // in both SourceMaps\n mapping.name = original.name;\n }\n }\n }\n\n var source = mapping.source;\n if (source && !newSources.has(source)) {\n newSources.add(source);\n }\n\n var name = mapping.name;\n if (name && !newNames.has(name)) {\n newNames.add(name);\n }\n\n }, this);\n this._sources = newSources;\n this._names = newNames;\n\n // Copy sourcesContents of applied map.\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content) {\n if (sourceRoot) {\n sourceFile = util.relative(sourceRoot, sourceFile);\n }\n this.setSourceContent(sourceFile, content);\n }\n }, this);\n };\n\n /**\n * A mapping can have one of the three levels of data:\n *\n * 1. Just the generated position.\n * 2. The Generated position, original position, and original source.\n * 3. Generated and original position, original source, as well as a name\n * token.\n *\n * To maintain consistency, we validate that any new mapping being added falls\n * in to one of these categories.\n */\n SourceMapGenerator.prototype._validateMapping =\n function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,\n aName) {\n if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aGenerated.line > 0 && aGenerated.column >= 0\n && !aOriginal && !aSource && !aName) {\n // Case 1.\n return;\n }\n else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated\n && aOriginal && 'line' in aOriginal && 'column' in aOriginal\n && aGenerated.line > 0 && aGenerated.column >= 0\n && aOriginal.line > 0 && aOriginal.column >= 0\n && aSource) {\n // Cases 2 and 3.\n return;\n }\n else {\n throw new Error('Invalid mapping: ' + JSON.stringify({\n generated: aGenerated,\n source: aSource,\n original: aOriginal,\n name: aName\n }));\n }\n };\n\n /**\n * Serialize the accumulated mappings in to the stream of base 64 VLQs\n * specified by the source map format.\n */\n SourceMapGenerator.prototype._serializeMappings =\n function SourceMapGenerator_serializeMappings() {\n var previousGeneratedColumn = 0;\n var previousGeneratedLine = 1;\n var previousOriginalColumn = 0;\n var previousOriginalLine = 0;\n var previousName = 0;\n var previousSource = 0;\n var result = '';\n var mapping;\n\n // The mappings must be guaranteed to be in sorted order before we start\n // serializing them or else the generated line numbers (which are defined\n // via the ';' separators) will be all messed up. Note: it might be more\n // performant to maintain the sorting as we insert them, rather than as we\n // serialize them, but the big O is the same either way.\n this._mappings.sort(util.compareByGeneratedPositions);\n\n for (var i = 0, len = this._mappings.length; i < len; i++) {\n mapping = this._mappings[i];\n\n if (mapping.generatedLine !== previousGeneratedLine) {\n previousGeneratedColumn = 0;\n while (mapping.generatedLine !== previousGeneratedLine) {\n result += ';';\n previousGeneratedLine++;\n }\n }\n else {\n if (i > 0) {\n if (!util.compareByGeneratedPositions(mapping, this._mappings[i - 1])) {\n continue;\n }\n result += ',';\n }\n }\n\n result += base64VLQ.encode(mapping.generatedColumn\n - previousGeneratedColumn);\n previousGeneratedColumn = mapping.generatedColumn;\n\n if (mapping.source) {\n result += base64VLQ.encode(this._sources.indexOf(mapping.source)\n - previousSource);\n previousSource = this._sources.indexOf(mapping.source);\n\n // lines are stored 0-based in SourceMap spec version 3\n result += base64VLQ.encode(mapping.originalLine - 1\n - previousOriginalLine);\n previousOriginalLine = mapping.originalLine - 1;\n\n result += base64VLQ.encode(mapping.originalColumn\n - previousOriginalColumn);\n previousOriginalColumn = mapping.originalColumn;\n\n if (mapping.name) {\n result += base64VLQ.encode(this._names.indexOf(mapping.name)\n - previousName);\n previousName = this._names.indexOf(mapping.name);\n }\n }\n }\n\n return result;\n };\n\n SourceMapGenerator.prototype._generateSourcesContent =\n function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {\n return aSources.map(function (source) {\n if (!this._sourcesContents) {\n return null;\n }\n if (aSourceRoot) {\n source = util.relative(aSourceRoot, source);\n }\n var key = util.toSetString(source);\n return Object.prototype.hasOwnProperty.call(this._sourcesContents,\n key)\n ? this._sourcesContents[key]\n : null;\n }, this);\n };\n\n /**\n * Externalize the source map.\n */\n SourceMapGenerator.prototype.toJSON =\n function SourceMapGenerator_toJSON() {\n var map = {\n version: this._version,\n file: this._file,\n sources: this._sources.toArray(),\n names: this._names.toArray(),\n mappings: this._serializeMappings()\n };\n if (this._sourceRoot) {\n map.sourceRoot = this._sourceRoot;\n }\n if (this._sourcesContents) {\n map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);\n }\n\n return map;\n };\n\n /**\n * Render the source map being generated to a string.\n */\n SourceMapGenerator.prototype.toString =\n function SourceMapGenerator_toString() {\n return JSON.stringify(this);\n };\n\n exports.SourceMapGenerator = SourceMapGenerator;\n\n});\n/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\ndefine('source-map/source-node', function (require, exports, module) {\n\n var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;\n var util = require('./util');\n\n /**\n * SourceNodes provide a way to abstract over interpolating/concatenating\n * snippets of generated JavaScript source code while maintaining the line and\n * column information associated with the original source code.\n *\n * @param aLine The original line number.\n * @param aColumn The original column number.\n * @param aSource The original source's filename.\n * @param aChunks Optional. An array of strings which are snippets of\n * generated JS, or other SourceNodes.\n * @param aName The original identifier.\n */\n function SourceNode(aLine, aColumn, aSource, aChunks, aName) {\n this.children = [];\n this.sourceContents = {};\n this.line = aLine === undefined ? null : aLine;\n this.column = aColumn === undefined ? null : aColumn;\n this.source = aSource === undefined ? null : aSource;\n this.name = aName === undefined ? null : aName;\n if (aChunks != null) this.add(aChunks);\n }\n\n /**\n * Creates a SourceNode from generated code and a SourceMapConsumer.\n *\n * @param aGeneratedCode The generated code\n * @param aSourceMapConsumer The SourceMap for the generated code\n */\n SourceNode.fromStringWithSourceMap =\n function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer) {\n // The SourceNode we want to fill with the generated code\n // and the SourceMap\n var node = new SourceNode();\n\n // The generated code\n // Processed fragments are removed from this array.\n var remainingLines = aGeneratedCode.split('\\n');\n\n // We need to remember the position of \"remainingLines\"\n var lastGeneratedLine = 1, lastGeneratedColumn = 0;\n\n // The generate SourceNodes we need a code range.\n // To extract it current and last mapping is used.\n // Here we store the last mapping.\n var lastMapping = null;\n\n aSourceMapConsumer.eachMapping(function (mapping) {\n if (lastMapping !== null) {\n // We add the code from \"lastMapping\" to \"mapping\":\n // First check if there is a new line in between.\n if (lastGeneratedLine < mapping.generatedLine) {\n var code = \"\";\n // Associate first line with \"lastMapping\"\n addMappingWithCode(lastMapping, remainingLines.shift() + \"\\n\");\n lastGeneratedLine++;\n lastGeneratedColumn = 0;\n // The remaining code is added without mapping\n } else {\n // There is no new line in between.\n // Associate the code between \"lastGeneratedColumn\" and\n // \"mapping.generatedColumn\" with \"lastMapping\"\n var nextLine = remainingLines[0];\n var code = nextLine.substr(0, mapping.generatedColumn -\n lastGeneratedColumn);\n remainingLines[0] = nextLine.substr(mapping.generatedColumn -\n lastGeneratedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n addMappingWithCode(lastMapping, code);\n // No more remaining code, continue\n lastMapping = mapping;\n return;\n }\n }\n // We add the generated code until the first mapping\n // to the SourceNode without any mapping.\n // Each line is added as separate string.\n while (lastGeneratedLine < mapping.generatedLine) {\n node.add(remainingLines.shift() + \"\\n\");\n lastGeneratedLine++;\n }\n if (lastGeneratedColumn < mapping.generatedColumn) {\n var nextLine = remainingLines[0];\n node.add(nextLine.substr(0, mapping.generatedColumn));\n remainingLines[0] = nextLine.substr(mapping.generatedColumn);\n lastGeneratedColumn = mapping.generatedColumn;\n }\n lastMapping = mapping;\n }, this);\n // We have processed all mappings.\n if (remainingLines.length > 0) {\n if (lastMapping) {\n // Associate the remaining code in the current line with \"lastMapping\"\n var lastLine = remainingLines.shift();\n if (remainingLines.length > 0) lastLine += \"\\n\";\n addMappingWithCode(lastMapping, lastLine);\n }\n // and add the remaining lines without any mapping\n node.add(remainingLines.join(\"\\n\"));\n }\n\n // Copy sourcesContent into SourceNode\n aSourceMapConsumer.sources.forEach(function (sourceFile) {\n var content = aSourceMapConsumer.sourceContentFor(sourceFile);\n if (content) {\n node.setSourceContent(sourceFile, content);\n }\n });\n\n return node;\n\n function addMappingWithCode(mapping, code) {\n if (mapping === null || mapping.source === undefined) {\n node.add(code);\n } else {\n node.add(new SourceNode(mapping.originalLine,\n mapping.originalColumn,\n mapping.source,\n code,\n mapping.name));\n }\n }\n };\n\n /**\n * Add a chunk of generated JS to this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\n SourceNode.prototype.add = function SourceNode_add(aChunk) {\n if (Array.isArray(aChunk)) {\n aChunk.forEach(function (chunk) {\n this.add(chunk);\n }, this);\n }\n else if (aChunk instanceof SourceNode || typeof aChunk === \"string\") {\n if (aChunk) {\n this.children.push(aChunk);\n }\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n };\n\n /**\n * Add a chunk of generated JS to the beginning of this source node.\n *\n * @param aChunk A string snippet of generated JS code, another instance of\n * SourceNode, or an array where each member is one of those things.\n */\n SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {\n if (Array.isArray(aChunk)) {\n for (var i = aChunk.length-1; i >= 0; i--) {\n this.prepend(aChunk[i]);\n }\n }\n else if (aChunk instanceof SourceNode || typeof aChunk === \"string\") {\n this.children.unshift(aChunk);\n }\n else {\n throw new TypeError(\n \"Expected a SourceNode, string, or an array of SourceNodes and strings. Got \" + aChunk\n );\n }\n return this;\n };\n\n /**\n * Walk over the tree of JS snippets in this node and its children. The\n * walking function is called once for each snippet of JS and is passed that\n * snippet and the its original associated source's line/column location.\n *\n * @param aFn The traversal function.\n */\n SourceNode.prototype.walk = function SourceNode_walk(aFn) {\n var chunk;\n for (var i = 0, len = this.children.length; i < len; i++) {\n chunk = this.children[i];\n if (chunk instanceof SourceNode) {\n chunk.walk(aFn);\n }\n else {\n if (chunk !== '') {\n aFn(chunk, { source: this.source,\n line: this.line,\n column: this.column,\n name: this.name });\n }\n }\n }\n };\n\n /**\n * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between\n * each of `this.children`.\n *\n * @param aSep The separator.\n */\n SourceNode.prototype.join = function SourceNode_join(aSep) {\n var newChildren;\n var i;\n var len = this.children.length;\n if (len > 0) {\n newChildren = [];\n for (i = 0; i < len-1; i++) {\n newChildren.push(this.children[i]);\n newChildren.push(aSep);\n }\n newChildren.push(this.children[i]);\n this.children = newChildren;\n }\n return this;\n };\n\n /**\n * Call String.prototype.replace on the very right-most source snippet. Useful\n * for trimming whitespace from the end of a source node, etc.\n *\n * @param aPattern The pattern to replace.\n * @param aReplacement The thing to replace the pattern with.\n */\n SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {\n var lastChild = this.children[this.children.length - 1];\n if (lastChild instanceof SourceNode) {\n lastChild.replaceRight(aPattern, aReplacement);\n }\n else if (typeof lastChild === 'string') {\n this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);\n }\n else {\n this.children.push(''.replace(aPattern, aReplacement));\n }\n return this;\n };\n\n /**\n * Set the source content for a source file. This will be added to the SourceMapGenerator\n * in the sourcesContent field.\n *\n * @param aSourceFile The filename of the source file\n * @param aSourceContent The content of the source file\n */\n SourceNode.prototype.setSourceContent =\n function SourceNode_setSourceContent(aSourceFile, aSourceContent) {\n this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;\n };\n\n /**\n * Walk over the tree of SourceNodes. The walking function is called for each\n * source file content and is passed the filename and source content.\n *\n * @param aFn The traversal function.\n */\n SourceNode.prototype.walkSourceContents =\n function SourceNode_walkSourceContents(aFn) {\n for (var i = 0, len = this.children.length; i < len; i++) {\n if (this.children[i] instanceof SourceNode) {\n this.children[i].walkSourceContents(aFn);\n }\n }\n\n var sources = Object.keys(this.sourceContents);\n for (var i = 0, len = sources.length; i < len; i++) {\n aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);\n }\n };\n\n /**\n * Return the string representation of this source node. Walks over the tree\n * and concatenates all the various snippets together to one string.\n */\n SourceNode.prototype.toString = function SourceNode_toString() {\n var str = \"\";\n this.walk(function (chunk) {\n str += chunk;\n });\n return str;\n };\n\n /**\n * Returns the string representation of this source node along with a source\n * map.\n */\n SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {\n var generated = {\n code: \"\",\n line: 1,\n column: 0\n };\n var map = new SourceMapGenerator(aArgs);\n var sourceMappingActive = false;\n var lastOriginalSource = null;\n var lastOriginalLine = null;\n var lastOriginalColumn = null;\n var lastOriginalName = null;\n this.walk(function (chunk, original) {\n generated.code += chunk;\n if (original.source !== null\n && original.line !== null\n && original.column !== null) {\n if(lastOriginalSource !== original.source\n || lastOriginalLine !== original.line\n || lastOriginalColumn !== original.column\n || lastOriginalName !== original.name) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n lastOriginalSource = original.source;\n lastOriginalLine = original.line;\n lastOriginalColumn = original.column;\n lastOriginalName = original.name;\n sourceMappingActive = true;\n } else if (sourceMappingActive) {\n map.addMapping({\n generated: {\n line: generated.line,\n column: generated.column\n }\n });\n lastOriginalSource = null;\n sourceMappingActive = false;\n }\n chunk.split('').forEach(function (ch, idx, array) {\n if (ch === '\\n') {\n generated.line++;\n generated.column = 0;\n // Mappings end at eol\n if (idx + 1 === array.length) {\n lastOriginalSource = null;\n sourceMappingActive = false;\n } else if (sourceMappingActive) {\n map.addMapping({\n source: original.source,\n original: {\n line: original.line,\n column: original.column\n },\n generated: {\n line: generated.line,\n column: generated.column\n },\n name: original.name\n });\n }\n } else {\n generated.column++;\n }\n });\n });\n this.walkSourceContents(function (sourceFile, sourceContent) {\n map.setSourceContent(sourceFile, sourceContent);\n });\n\n return { code: generated.code, map: map };\n };\n\n exports.SourceNode = SourceNode;\n\n});\n/* -*- Mode: js; js-indent-level: 2; -*- */\n/*\n * Copyright 2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\n\ndefine('source-map/util', function (require, exports, module) {\n\n /**\n * This is a helper function for getting values from parameter/options\n * objects.\n *\n * @param args The object we are extracting values from\n * @param name The name of the property we are getting.\n * @param defaultValue An optional value to return if the property is missing\n * from the object. If this is not specified and the property is missing, an\n * error will be thrown.\n */\n function getArg(aArgs, aName, aDefaultValue) {\n if (aName in aArgs) {\n return aArgs[aName];\n } else if (arguments.length === 3) {\n return aDefaultValue;\n } else {\n throw new Error('\"' + aName + '\" is a required argument.');\n }\n }\n exports.getArg = getArg;\n\n var urlRegexp = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.]*)(?::(\\d+))?(\\S*)$/;\n var dataUrlRegexp = /^data:.+\\,.+$/;\n\n function urlParse(aUrl) {\n var match = aUrl.match(urlRegexp);\n if (!match) {\n return null;\n }\n return {\n scheme: match[1],\n auth: match[2],\n host: match[3],\n port: match[4],\n path: match[5]\n };\n }\n exports.urlParse = urlParse;\n\n function urlGenerate(aParsedUrl) {\n var url = '';\n if (aParsedUrl.scheme) {\n url += aParsedUrl.scheme + ':';\n }\n url += '//';\n if (aParsedUrl.auth) {\n url += aParsedUrl.auth + '@';\n }\n if (aParsedUrl.host) {\n url += aParsedUrl.host;\n }\n if (aParsedUrl.port) {\n url += \":\" + aParsedUrl.port\n }\n if (aParsedUrl.path) {\n url += aParsedUrl.path;\n }\n return url;\n }\n exports.urlGenerate = urlGenerate;\n\n /**\n * Normalizes a path, or the path portion of a URL:\n *\n * - Replaces consequtive slashes with one slash.\n * - Removes unnecessary '.' parts.\n * - Removes unnecessary '<dir>/..' parts.\n *\n * Based on code in the Node.js 'path' core module.\n *\n * @param aPath The path or url to normalize.\n */\n function normalize(aPath) {\n var path = aPath;\n var url = urlParse(aPath);\n if (url) {\n if (!url.path) {\n return aPath;\n }\n path = url.path;\n }\n var isAbsolute = (path.charAt(0) === '/');\n\n var parts = path.split(/\\/+/);\n for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {\n part = parts[i];\n if (part === '.') {\n parts.splice(i, 1);\n } else if (part === '..') {\n up++;\n } else if (up > 0) {\n if (part === '') {\n // The first part is blank if the path is absolute. Trying to go\n // above the root is a no-op. Therefore we can remove all '..' parts\n // directly after the root.\n parts.splice(i + 1, up);\n up = 0;\n } else {\n parts.splice(i, 2);\n up--;\n }\n }\n }\n path = parts.join('/');\n\n if (path === '') {\n path = isAbsolute ? '/' : '.';\n }\n\n if (url) {\n url.path = path;\n return urlGenerate(url);\n }\n return path;\n }\n exports.normalize = normalize;\n\n /**\n * Joins two paths/URLs.\n *\n * @param aRoot The root path or URL.\n * @param aPath The path or URL to be joined with the root.\n *\n * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a\n * scheme-relative URL: Then the scheme of aRoot, if any, is prepended\n * first.\n * - Otherwise aPath is a path. If aRoot is a URL, then its path portion\n * is updated with the result and aRoot is returned. Otherwise the result\n * is returned.\n * - If aPath is absolute, the result is aPath.\n * - Otherwise the two paths are joined with a slash.\n * - Joining for example 'http://' and 'www.example.com' is also supported.\n */\n function join(aRoot, aPath) {\n var aPathUrl = urlParse(aPath);\n var aRootUrl = urlParse(aRoot);\n if (aRootUrl) {\n aRoot = aRootUrl.path || '/';\n }\n\n // `join(foo, '//www.example.org')`\n if (aPathUrl && !aPathUrl.scheme) {\n if (aRootUrl) {\n aPathUrl.scheme = aRootUrl.scheme;\n }\n return urlGenerate(aPathUrl);\n }\n\n if (aPathUrl || aPath.match(dataUrlRegexp)) {\n return aPath;\n }\n\n // `join('http://', 'www.example.com')`\n if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {\n aRootUrl.host = aPath;\n return urlGenerate(aRootUrl);\n }\n\n var joined = aPath.charAt(0) === '/'\n ? aPath\n : normalize(aRoot.replace(/\\/+$/, '') + '/' + aPath);\n\n if (aRootUrl) {\n aRootUrl.path = joined;\n return urlGenerate(aRootUrl);\n }\n return joined;\n }\n exports.join = join;\n\n /**\n * Because behavior goes wacky when you set `__proto__` on objects, we\n * have to prefix all the strings in our set with an arbitrary character.\n *\n * See https://github.com/mozilla/source-map/pull/31 and\n * https://github.com/mozilla/source-map/issues/30\n *\n * @param String aStr\n */\n function toSetString(aStr) {\n return '$' + aStr;\n }\n exports.toSetString = toSetString;\n\n function fromSetString(aStr) {\n return aStr.substr(1);\n }\n exports.fromSetString = fromSetString;\n\n function relative(aRoot, aPath) {\n aRoot = aRoot.replace(/\\/$/, '');\n\n var url = urlParse(aRoot);\n if (aPath.charAt(0) == \"/\" && url && url.path == \"/\") {\n return aPath.slice(1);\n }\n\n return aPath.indexOf(aRoot + '/') === 0\n ? aPath.substr(aRoot.length + 1)\n : aPath;\n }\n exports.relative = relative;\n\n function strcmp(aStr1, aStr2) {\n var s1 = aStr1 || \"\";\n var s2 = aStr2 || \"\";\n return (s1 > s2) - (s1 < s2);\n }\n\n /**\n * Comparator between two mappings where the original positions are compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same original source/line/column, but different generated\n * line and column the same. Useful when searching for a mapping with a\n * stubbed out mapping.\n */\n function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {\n var cmp;\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp || onlyCompareOriginal) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.name, mappingB.name);\n if (cmp) {\n return cmp;\n }\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n return mappingA.generatedColumn - mappingB.generatedColumn;\n };\n exports.compareByOriginalPositions = compareByOriginalPositions;\n\n /**\n * Comparator between two mappings where the generated positions are\n * compared.\n *\n * Optionally pass in `true` as `onlyCompareGenerated` to consider two\n * mappings with the same generated line and column, but different\n * source/name/original line and column the same. Useful when searching for a\n * mapping with a stubbed out mapping.\n */\n function compareByGeneratedPositions(mappingA, mappingB, onlyCompareGenerated) {\n var cmp;\n\n cmp = mappingA.generatedLine - mappingB.generatedLine;\n if (cmp) {\n return cmp;\n }\n\n cmp = mappingA.generatedColumn - mappingB.generatedColumn;\n if (cmp || onlyCompareGenerated) {\n return cmp;\n }\n\n cmp = strcmp(mappingA.source, mappingB.source);\n if (cmp) {\n return cmp;\n }\n\n cmp = mappingA.originalLine - mappingB.originalLine;\n if (cmp) {\n return cmp;\n }\n\n cmp = mappingA.originalColumn - mappingB.originalColumn;\n if (cmp) {\n return cmp;\n }\n\n return strcmp(mappingA.name, mappingB.name);\n };\n exports.compareByGeneratedPositions = compareByGeneratedPositions;\n\n});\ndefine('source-map', function (require, exports, module) {\n\n/*\n * Copyright 2009-2011 Mozilla Foundation and contributors\n * Licensed under the New BSD license. See LICENSE.txt or:\n * http://opensource.org/licenses/BSD-3-Clause\n */\nexports.SourceMapGenerator = require('./source-map/source-map-generator').SourceMapGenerator;\nexports.SourceMapConsumer = require('./source-map/source-map-consumer').SourceMapConsumer;\nexports.SourceNode = require('./source-map/source-node').SourceNode;\n\n});\n\n//Distributed under the BSD license:\n//Copyright 2012 (c) Mihai Bazon <[email protected]>\ndefine('uglifyjs2', ['exports', 'source-map', 'logger', 'env!env/file'], function (exports, MOZ_SourceMap, logger, rjsFile) {\n\n/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n <[email protected]>\n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon <[email protected]>\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\nfunction array_to_hash(a) {\n var ret = Object.create(null);\n for (var i = 0; i < a.length; ++i)\n ret[a[i]] = true;\n return ret;\n};\n\nfunction slice(a, start) {\n return Array.prototype.slice.call(a, start || 0);\n};\n\nfunction characters(str) {\n return str.split(\"\");\n};\n\nfunction member(name, array) {\n for (var i = array.length; --i >= 0;)\n if (array[i] == name)\n return true;\n return false;\n};\n\nfunction find_if(func, array) {\n for (var i = 0, n = array.length; i < n; ++i) {\n if (func(array[i]))\n return array[i];\n }\n};\n\nfunction repeat_string(str, i) {\n if (i <= 0) return \"\";\n if (i == 1) return str;\n var d = repeat_string(str, i >> 1);\n d += d;\n if (i & 1) d += str;\n return d;\n};\n\nfunction DefaultsError(msg, defs) {\n Error.call(this, msg);\n this.msg = msg;\n this.defs = defs;\n};\nDefaultsError.prototype = Object.create(Error.prototype);\nDefaultsError.prototype.constructor = DefaultsError;\n\nDefaultsError.croak = function(msg, defs) {\n throw new DefaultsError(msg, defs);\n};\n\nfunction defaults(args, defs, croak) {\n if (args === true)\n args = {};\n var ret = args || {};\n if (croak) for (var i in ret) if (ret.hasOwnProperty(i) && !defs.hasOwnProperty(i))\n DefaultsError.croak(\"`\" + i + \"` is not a supported option\", defs);\n for (var i in defs) if (defs.hasOwnProperty(i)) {\n ret[i] = (args && args.hasOwnProperty(i)) ? args[i] : defs[i];\n }\n return ret;\n};\n\nfunction merge(obj, ext) {\n for (var i in ext) if (ext.hasOwnProperty(i)) {\n obj[i] = ext[i];\n }\n return obj;\n};\n\nfunction noop() {};\n\nvar MAP = (function(){\n function MAP(a, f, backwards) {\n var ret = [], top = [], i;\n function doit() {\n var val = f(a[i], i);\n var is_last = val instanceof Last;\n if (is_last) val = val.v;\n if (val instanceof AtTop) {\n val = val.v;\n if (val instanceof Splice) {\n top.push.apply(top, backwards ? val.v.slice().reverse() : val.v);\n } else {\n top.push(val);\n }\n }\n else if (val !== skip) {\n if (val instanceof Splice) {\n ret.push.apply(ret, backwards ? val.v.slice().reverse() : val.v);\n } else {\n ret.push(val);\n }\n }\n return is_last;\n };\n if (a instanceof Array) {\n if (backwards) {\n for (i = a.length; --i >= 0;) if (doit()) break;\n ret.reverse();\n top.reverse();\n } else {\n for (i = 0; i < a.length; ++i) if (doit()) break;\n }\n }\n else {\n for (i in a) if (a.hasOwnProperty(i)) if (doit()) break;\n }\n return top.concat(ret);\n };\n MAP.at_top = function(val) { return new AtTop(val) };\n MAP.splice = function(val) { return new Splice(val) };\n MAP.last = function(val) { return new Last(val) };\n var skip = MAP.skip = {};\n function AtTop(val) { this.v = val };\n function Splice(val) { this.v = val };\n function Last(val) { this.v = val };\n return MAP;\n})();\n\nfunction push_uniq(array, el) {\n if (array.indexOf(el) < 0)\n array.push(el);\n};\n\nfunction string_template(text, props) {\n return text.replace(/\\{(.+?)\\}/g, function(str, p){\n return props[p];\n });\n};\n\nfunction remove(array, el) {\n for (var i = array.length; --i >= 0;) {\n if (array[i] === el) array.splice(i, 1);\n }\n};\n\nfunction mergeSort(array, cmp) {\n if (array.length < 2) return array.slice();\n function merge(a, b) {\n var r = [], ai = 0, bi = 0, i = 0;\n while (ai < a.length && bi < b.length) {\n cmp(a[ai], b[bi]) <= 0\n ? r[i++] = a[ai++]\n : r[i++] = b[bi++];\n }\n if (ai < a.length) r.push.apply(r, a.slice(ai));\n if (bi < b.length) r.push.apply(r, b.slice(bi));\n return r;\n };\n function _ms(a) {\n if (a.length <= 1)\n return a;\n var m = Math.floor(a.length / 2), left = a.slice(0, m), right = a.slice(m);\n left = _ms(left);\n right = _ms(right);\n return merge(left, right);\n };\n return _ms(array);\n};\n\nfunction set_difference(a, b) {\n return a.filter(function(el){\n return b.indexOf(el) < 0;\n });\n};\n\nfunction set_intersection(a, b) {\n return a.filter(function(el){\n return b.indexOf(el) >= 0;\n });\n};\n\n// this function is taken from Acorn [1], written by Marijn Haverbeke\n// [1] https://github.com/marijnh/acorn\nfunction makePredicate(words) {\n if (!(words instanceof Array)) words = words.split(\" \");\n var f = \"\", cats = [];\n out: for (var i = 0; i < words.length; ++i) {\n for (var j = 0; j < cats.length; ++j)\n if (cats[j][0].length == words[i].length) {\n cats[j].push(words[i]);\n continue out;\n }\n cats.push([words[i]]);\n }\n function compareTo(arr) {\n if (arr.length == 1) return f += \"return str === \" + JSON.stringify(arr[0]) + \";\";\n f += \"switch(str){\";\n for (var i = 0; i < arr.length; ++i) f += \"case \" + JSON.stringify(arr[i]) + \":\";\n f += \"return true}return false;\";\n }\n // When there are more than three length categories, an outer\n // switch first dispatches on the lengths, to save on comparisons.\n if (cats.length > 3) {\n cats.sort(function(a, b) {return b.length - a.length;});\n f += \"switch(str.length){\";\n for (var i = 0; i < cats.length; ++i) {\n var cat = cats[i];\n f += \"case \" + cat[0].length + \":\";\n compareTo(cat);\n }\n f += \"}\";\n // Otherwise, simply generate a flat `switch` statement.\n } else {\n compareTo(words);\n }\n return new Function(\"str\", f);\n};\n\nfunction all(array, predicate) {\n for (var i = array.length; --i >= 0;)\n if (!predicate(array[i]))\n return false;\n return true;\n};\n\nfunction Dictionary() {\n this._values = Object.create(null);\n this._size = 0;\n};\nDictionary.prototype = {\n set: function(key, val) {\n if (!this.has(key)) ++this._size;\n this._values[\"$\" + key] = val;\n return this;\n },\n add: function(key, val) {\n if (this.has(key)) {\n this.get(key).push(val);\n } else {\n this.set(key, [ val ]);\n }\n return this;\n },\n get: function(key) { return this._values[\"$\" + key] },\n del: function(key) {\n if (this.has(key)) {\n --this._size;\n delete this._values[\"$\" + key];\n }\n return this;\n },\n has: function(key) { return (\"$\" + key) in this._values },\n each: function(f) {\n for (var i in this._values)\n f(this._values[i], i.substr(1));\n },\n size: function() {\n return this._size;\n },\n map: function(f) {\n var ret = [];\n for (var i in this._values)\n ret.push(f(this._values[i], i.substr(1)));\n return ret;\n }\n};\n\n/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n <[email protected]>\n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon <[email protected]>\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\nfunction DEFNODE(type, props, methods, base) {\n if (arguments.length < 4) base = AST_Node;\n if (!props) props = [];\n else props = props.split(/\\s+/);\n var self_props = props;\n if (base && base.PROPS)\n props = props.concat(base.PROPS);\n var code = \"return function AST_\" + type + \"(props){ if (props) { \";\n for (var i = props.length; --i >= 0;) {\n code += \"this.\" + props[i] + \" = props.\" + props[i] + \";\";\n }\n var proto = base && new base;\n if (proto && proto.initialize || (methods && methods.initialize))\n code += \"this.initialize();\";\n code += \"}}\";\n var ctor = new Function(code)();\n if (proto) {\n ctor.prototype = proto;\n ctor.BASE = base;\n }\n if (base) base.SUBCLASSES.push(ctor);\n ctor.prototype.CTOR = ctor;\n ctor.PROPS = props || null;\n ctor.SELF_PROPS = self_props;\n ctor.SUBCLASSES = [];\n if (type) {\n ctor.prototype.TYPE = ctor.TYPE = type;\n }\n if (methods) for (i in methods) if (methods.hasOwnProperty(i)) {\n if (/^\\$/.test(i)) {\n ctor[i.substr(1)] = methods[i];\n } else {\n ctor.prototype[i] = methods[i];\n }\n }\n ctor.DEFMETHOD = function(name, method) {\n this.prototype[name] = method;\n };\n return ctor;\n};\n\nvar AST_Token = DEFNODE(\"Token\", \"type value line col pos endpos nlb comments_before file\", {\n}, null);\n\nvar AST_Node = DEFNODE(\"Node\", \"start end\", {\n clone: function() {\n return new this.CTOR(this);\n },\n $documentation: \"Base class of all AST nodes\",\n $propdoc: {\n start: \"[AST_Token] The first token of this node\",\n end: \"[AST_Token] The last token of this node\"\n },\n _walk: function(visitor) {\n return visitor._visit(this);\n },\n walk: function(visitor) {\n return this._walk(visitor); // not sure the indirection will be any help\n }\n}, null);\n\nAST_Node.warn_function = null;\nAST_Node.warn = function(txt, props) {\n if (AST_Node.warn_function)\n AST_Node.warn_function(string_template(txt, props));\n};\n\n/* -----[ statements ]----- */\n\nvar AST_Statement = DEFNODE(\"Statement\", null, {\n $documentation: \"Base class of all statements\",\n});\n\nvar AST_Debugger = DEFNODE(\"Debugger\", null, {\n $documentation: \"Represents a debugger statement\",\n}, AST_Statement);\n\nvar AST_Directive = DEFNODE(\"Directive\", \"value scope\", {\n $documentation: \"Represents a directive, like \\\"use strict\\\";\",\n $propdoc: {\n value: \"[string] The value of this directive as a plain string (it's not an AST_String!)\",\n scope: \"[AST_Scope/S] The scope that this directive affects\"\n },\n}, AST_Statement);\n\nvar AST_SimpleStatement = DEFNODE(\"SimpleStatement\", \"body\", {\n $documentation: \"A statement consisting of an expression, i.e. a = 1 + 2\",\n $propdoc: {\n body: \"[AST_Node] an expression node (should not be instanceof AST_Statement)\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.body._walk(visitor);\n });\n }\n}, AST_Statement);\n\nfunction walk_body(node, visitor) {\n if (node.body instanceof AST_Statement) {\n node.body._walk(visitor);\n }\n else node.body.forEach(function(stat){\n stat._walk(visitor);\n });\n};\n\nvar AST_Block = DEFNODE(\"Block\", \"body\", {\n $documentation: \"A body of statements (usually bracketed)\",\n $propdoc: {\n body: \"[AST_Statement*] an array of statements\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n walk_body(this, visitor);\n });\n }\n}, AST_Statement);\n\nvar AST_BlockStatement = DEFNODE(\"BlockStatement\", null, {\n $documentation: \"A block statement\",\n}, AST_Block);\n\nvar AST_EmptyStatement = DEFNODE(\"EmptyStatement\", null, {\n $documentation: \"The empty statement (empty block or simply a semicolon)\",\n _walk: function(visitor) {\n return visitor._visit(this);\n }\n}, AST_Statement);\n\nvar AST_StatementWithBody = DEFNODE(\"StatementWithBody\", \"body\", {\n $documentation: \"Base class for all statements that contain one nested body: `For`, `ForIn`, `Do`, `While`, `With`\",\n $propdoc: {\n body: \"[AST_Statement] the body; this should always be present, even if it's an AST_EmptyStatement\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.body._walk(visitor);\n });\n }\n}, AST_Statement);\n\nvar AST_LabeledStatement = DEFNODE(\"LabeledStatement\", \"label\", {\n $documentation: \"Statement with a label\",\n $propdoc: {\n label: \"[AST_Label] a label definition\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.label._walk(visitor);\n this.body._walk(visitor);\n });\n }\n}, AST_StatementWithBody);\n\nvar AST_IterationStatement = DEFNODE(\"IterationStatement\", null, {\n $documentation: \"Internal class. All loops inherit from it.\"\n}, AST_StatementWithBody);\n\nvar AST_DWLoop = DEFNODE(\"DWLoop\", \"condition\", {\n $documentation: \"Base class for do/while statements\",\n $propdoc: {\n condition: \"[AST_Node] the loop condition. Should not be instanceof AST_Statement\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.condition._walk(visitor);\n this.body._walk(visitor);\n });\n }\n}, AST_IterationStatement);\n\nvar AST_Do = DEFNODE(\"Do\", null, {\n $documentation: \"A `do` statement\",\n}, AST_DWLoop);\n\nvar AST_While = DEFNODE(\"While\", null, {\n $documentation: \"A `while` statement\",\n}, AST_DWLoop);\n\nvar AST_For = DEFNODE(\"For\", \"init condition step\", {\n $documentation: \"A `for` statement\",\n $propdoc: {\n init: \"[AST_Node?] the `for` initialization code, or null if empty\",\n condition: \"[AST_Node?] the `for` termination clause, or null if empty\",\n step: \"[AST_Node?] the `for` update clause, or null if empty\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n if (this.init) this.init._walk(visitor);\n if (this.condition) this.condition._walk(visitor);\n if (this.step) this.step._walk(visitor);\n this.body._walk(visitor);\n });\n }\n}, AST_IterationStatement);\n\nvar AST_ForIn = DEFNODE(\"ForIn\", \"init name object\", {\n $documentation: \"A `for ... in` statement\",\n $propdoc: {\n init: \"[AST_Node] the `for/in` initialization code\",\n name: \"[AST_SymbolRef?] the loop variable, only if `init` is AST_Var\",\n object: \"[AST_Node] the object that we're looping through\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.init._walk(visitor);\n this.object._walk(visitor);\n this.body._walk(visitor);\n });\n }\n}, AST_IterationStatement);\n\nvar AST_With = DEFNODE(\"With\", \"expression\", {\n $documentation: \"A `with` statement\",\n $propdoc: {\n expression: \"[AST_Node] the `with` expression\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.expression._walk(visitor);\n this.body._walk(visitor);\n });\n }\n}, AST_StatementWithBody);\n\n/* -----[ scope and functions ]----- */\n\nvar AST_Scope = DEFNODE(\"Scope\", \"directives variables functions uses_with uses_eval parent_scope enclosed cname\", {\n $documentation: \"Base class for all statements introducing a lexical scope\",\n $propdoc: {\n directives: \"[string*/S] an array of directives declared in this scope\",\n variables: \"[Object/S] a map of name -> SymbolDef for all variables/functions defined in this scope\",\n functions: \"[Object/S] like `variables`, but only lists function declarations\",\n uses_with: \"[boolean/S] tells whether this scope uses the `with` statement\",\n uses_eval: \"[boolean/S] tells whether this scope contains a direct call to the global `eval`\",\n parent_scope: \"[AST_Scope?/S] link to the parent scope\",\n enclosed: \"[SymbolDef*/S] a list of all symbol definitions that are accessed from this scope or any subscopes\",\n cname: \"[integer/S] current index for mangling variables (used internally by the mangler)\",\n },\n}, AST_Block);\n\nvar AST_Toplevel = DEFNODE(\"Toplevel\", \"globals\", {\n $documentation: \"The toplevel scope\",\n $propdoc: {\n globals: \"[Object/S] a map of name -> SymbolDef for all undeclared names\",\n },\n wrap_enclose: function(arg_parameter_pairs) {\n var self = this;\n var args = [];\n var parameters = [];\n\n arg_parameter_pairs.forEach(function(pair) {\n var split = pair.split(\":\");\n\n args.push(split[0]);\n parameters.push(split[1]);\n });\n\n var wrapped_tl = \"(function(\" + parameters.join(\",\") + \"){ '$ORIG'; })(\" + args.join(\",\") + \")\";\n wrapped_tl = parse(wrapped_tl);\n wrapped_tl = wrapped_tl.transform(new TreeTransformer(function before(node){\n if (node instanceof AST_Directive && node.value == \"$ORIG\") {\n return MAP.splice(self.body);\n }\n }));\n return wrapped_tl;\n },\n wrap_commonjs: function(name, export_all) {\n var self = this;\n var to_export = [];\n if (export_all) {\n self.figure_out_scope();\n self.walk(new TreeWalker(function(node){\n if (node instanceof AST_SymbolDeclaration && node.definition().global) {\n if (!find_if(function(n){ return n.name == node.name }, to_export))\n to_export.push(node);\n }\n }));\n }\n var wrapped_tl = \"(function(exports, global){ global['\" + name + \"'] = exports; '$ORIG'; '$EXPORTS'; }({}, (function(){return this}())))\";\n wrapped_tl = parse(wrapped_tl);\n wrapped_tl = wrapped_tl.transform(new TreeTransformer(function before(node){\n if (node instanceof AST_SimpleStatement) {\n node = node.body;\n if (node instanceof AST_String) switch (node.getValue()) {\n case \"$ORIG\":\n return MAP.splice(self.body);\n case \"$EXPORTS\":\n var body = [];\n to_export.forEach(function(sym){\n body.push(new AST_SimpleStatement({\n body: new AST_Assign({\n left: new AST_Sub({\n expression: new AST_SymbolRef({ name: \"exports\" }),\n property: new AST_String({ value: sym.name }),\n }),\n operator: \"=\",\n right: new AST_SymbolRef(sym),\n }),\n }));\n });\n return MAP.splice(body);\n }\n }\n }));\n return wrapped_tl;\n }\n}, AST_Scope);\n\nvar AST_Lambda = DEFNODE(\"Lambda\", \"name argnames uses_arguments\", {\n $documentation: \"Base class for functions\",\n $propdoc: {\n name: \"[AST_SymbolDeclaration?] the name of this function\",\n argnames: \"[AST_SymbolFunarg*] array of function arguments\",\n uses_arguments: \"[boolean/S] tells whether this function accesses the arguments array\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n if (this.name) this.name._walk(visitor);\n this.argnames.forEach(function(arg){\n arg._walk(visitor);\n });\n walk_body(this, visitor);\n });\n }\n}, AST_Scope);\n\nvar AST_Accessor = DEFNODE(\"Accessor\", null, {\n $documentation: \"A setter/getter function. The `name` property is always null.\"\n}, AST_Lambda);\n\nvar AST_Function = DEFNODE(\"Function\", null, {\n $documentation: \"A function expression\"\n}, AST_Lambda);\n\nvar AST_Defun = DEFNODE(\"Defun\", null, {\n $documentation: \"A function definition\"\n}, AST_Lambda);\n\n/* -----[ JUMPS ]----- */\n\nvar AST_Jump = DEFNODE(\"Jump\", null, {\n $documentation: \"Base class for “jumps” (for now that's `return`, `throw`, `break` and `continue`)\"\n}, AST_Statement);\n\nvar AST_Exit = DEFNODE(\"Exit\", \"value\", {\n $documentation: \"Base class for “exits” (`return` and `throw`)\",\n $propdoc: {\n value: \"[AST_Node?] the value returned or thrown by this statement; could be null for AST_Return\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, this.value && function(){\n this.value._walk(visitor);\n });\n }\n}, AST_Jump);\n\nvar AST_Return = DEFNODE(\"Return\", null, {\n $documentation: \"A `return` statement\"\n}, AST_Exit);\n\nvar AST_Throw = DEFNODE(\"Throw\", null, {\n $documentation: \"A `throw` statement\"\n}, AST_Exit);\n\nvar AST_LoopControl = DEFNODE(\"LoopControl\", \"label\", {\n $documentation: \"Base class for loop control statements (`break` and `continue`)\",\n $propdoc: {\n label: \"[AST_LabelRef?] the label, or null if none\",\n },\n _walk: function(visitor) {\n return visitor._visit(this, this.label && function(){\n this.label._walk(visitor);\n });\n }\n}, AST_Jump);\n\nvar AST_Break = DEFNODE(\"Break\", null, {\n $documentation: \"A `break` statement\"\n}, AST_LoopControl);\n\nvar AST_Continue = DEFNODE(\"Continue\", null, {\n $documentation: \"A `continue` statement\"\n}, AST_LoopControl);\n\n/* -----[ IF ]----- */\n\nvar AST_If = DEFNODE(\"If\", \"condition alternative\", {\n $documentation: \"A `if` statement\",\n $propdoc: {\n condition: \"[AST_Node] the `if` condition\",\n alternative: \"[AST_Statement?] the `else` part, or null if not present\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.condition._walk(visitor);\n this.body._walk(visitor);\n if (this.alternative) this.alternative._walk(visitor);\n });\n }\n}, AST_StatementWithBody);\n\n/* -----[ SWITCH ]----- */\n\nvar AST_Switch = DEFNODE(\"Switch\", \"expression\", {\n $documentation: \"A `switch` statement\",\n $propdoc: {\n expression: \"[AST_Node] the `switch` “discriminant”\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.expression._walk(visitor);\n walk_body(this, visitor);\n });\n }\n}, AST_Block);\n\nvar AST_SwitchBranch = DEFNODE(\"SwitchBranch\", null, {\n $documentation: \"Base class for `switch` branches\",\n}, AST_Block);\n\nvar AST_Default = DEFNODE(\"Default\", null, {\n $documentation: \"A `default` switch branch\",\n}, AST_SwitchBranch);\n\nvar AST_Case = DEFNODE(\"Case\", \"expression\", {\n $documentation: \"A `case` switch branch\",\n $propdoc: {\n expression: \"[AST_Node] the `case` expression\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.expression._walk(visitor);\n walk_body(this, visitor);\n });\n }\n}, AST_SwitchBranch);\n\n/* -----[ EXCEPTIONS ]----- */\n\nvar AST_Try = DEFNODE(\"Try\", \"bcatch bfinally\", {\n $documentation: \"A `try` statement\",\n $propdoc: {\n bcatch: \"[AST_Catch?] the catch block, or null if not present\",\n bfinally: \"[AST_Finally?] the finally block, or null if not present\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n walk_body(this, visitor);\n if (this.bcatch) this.bcatch._walk(visitor);\n if (this.bfinally) this.bfinally._walk(visitor);\n });\n }\n}, AST_Block);\n\nvar AST_Catch = DEFNODE(\"Catch\", \"argname\", {\n $documentation: \"A `catch` node; only makes sense as part of a `try` statement\",\n $propdoc: {\n argname: \"[AST_SymbolCatch] symbol for the exception\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.argname._walk(visitor);\n walk_body(this, visitor);\n });\n }\n}, AST_Block);\n\nvar AST_Finally = DEFNODE(\"Finally\", null, {\n $documentation: \"A `finally` node; only makes sense as part of a `try` statement\"\n}, AST_Block);\n\n/* -----[ VAR/CONST ]----- */\n\nvar AST_Definitions = DEFNODE(\"Definitions\", \"definitions\", {\n $documentation: \"Base class for `var` or `const` nodes (variable declarations/initializations)\",\n $propdoc: {\n definitions: \"[AST_VarDef*] array of variable definitions\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.definitions.forEach(function(def){\n def._walk(visitor);\n });\n });\n }\n}, AST_Statement);\n\nvar AST_Var = DEFNODE(\"Var\", null, {\n $documentation: \"A `var` statement\"\n}, AST_Definitions);\n\nvar AST_Const = DEFNODE(\"Const\", null, {\n $documentation: \"A `const` statement\"\n}, AST_Definitions);\n\nvar AST_VarDef = DEFNODE(\"VarDef\", \"name value\", {\n $documentation: \"A variable declaration; only appears in a AST_Definitions node\",\n $propdoc: {\n name: \"[AST_SymbolVar|AST_SymbolConst] name of the variable\",\n value: \"[AST_Node?] initializer, or null of there's no initializer\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.name._walk(visitor);\n if (this.value) this.value._walk(visitor);\n });\n }\n});\n\n/* -----[ OTHER ]----- */\n\nvar AST_Call = DEFNODE(\"Call\", \"expression args\", {\n $documentation: \"A function call expression\",\n $propdoc: {\n expression: \"[AST_Node] expression to invoke as function\",\n args: \"[AST_Node*] array of arguments\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.expression._walk(visitor);\n this.args.forEach(function(arg){\n arg._walk(visitor);\n });\n });\n }\n});\n\nvar AST_New = DEFNODE(\"New\", null, {\n $documentation: \"An object instantiation. Derives from a function call since it has exactly the same properties\"\n}, AST_Call);\n\nvar AST_Seq = DEFNODE(\"Seq\", \"car cdr\", {\n $documentation: \"A sequence expression (two comma-separated expressions)\",\n $propdoc: {\n car: \"[AST_Node] first element in sequence\",\n cdr: \"[AST_Node] second element in sequence\"\n },\n $cons: function(x, y) {\n var seq = new AST_Seq(x);\n seq.car = x;\n seq.cdr = y;\n return seq;\n },\n $from_array: function(array) {\n if (array.length == 0) return null;\n if (array.length == 1) return array[0].clone();\n var list = null;\n for (var i = array.length; --i >= 0;) {\n list = AST_Seq.cons(array[i], list);\n }\n var p = list;\n while (p) {\n if (p.cdr && !p.cdr.cdr) {\n p.cdr = p.cdr.car;\n break;\n }\n p = p.cdr;\n }\n return list;\n },\n to_array: function() {\n var p = this, a = [];\n while (p) {\n a.push(p.car);\n if (p.cdr && !(p.cdr instanceof AST_Seq)) {\n a.push(p.cdr);\n break;\n }\n p = p.cdr;\n }\n return a;\n },\n add: function(node) {\n var p = this;\n while (p) {\n if (!(p.cdr instanceof AST_Seq)) {\n var cell = AST_Seq.cons(p.cdr, node);\n return p.cdr = cell;\n }\n p = p.cdr;\n }\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.car._walk(visitor);\n if (this.cdr) this.cdr._walk(visitor);\n });\n }\n});\n\nvar AST_PropAccess = DEFNODE(\"PropAccess\", \"expression property\", {\n $documentation: \"Base class for property access expressions, i.e. `a.foo` or `a[\\\"foo\\\"]`\",\n $propdoc: {\n expression: \"[AST_Node] the “container” expression\",\n property: \"[AST_Node|string] the property to access. For AST_Dot this is always a plain string, while for AST_Sub it's an arbitrary AST_Node\"\n }\n});\n\nvar AST_Dot = DEFNODE(\"Dot\", null, {\n $documentation: \"A dotted property access expression\",\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.expression._walk(visitor);\n });\n }\n}, AST_PropAccess);\n\nvar AST_Sub = DEFNODE(\"Sub\", null, {\n $documentation: \"Index-style property access, i.e. `a[\\\"foo\\\"]`\",\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.expression._walk(visitor);\n this.property._walk(visitor);\n });\n }\n}, AST_PropAccess);\n\nvar AST_Unary = DEFNODE(\"Unary\", \"operator expression\", {\n $documentation: \"Base class for unary expressions\",\n $propdoc: {\n operator: \"[string] the operator\",\n expression: \"[AST_Node] expression that this unary operator applies to\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.expression._walk(visitor);\n });\n }\n});\n\nvar AST_UnaryPrefix = DEFNODE(\"UnaryPrefix\", null, {\n $documentation: \"Unary prefix expression, i.e. `typeof i` or `++i`\"\n}, AST_Unary);\n\nvar AST_UnaryPostfix = DEFNODE(\"UnaryPostfix\", null, {\n $documentation: \"Unary postfix expression, i.e. `i++`\"\n}, AST_Unary);\n\nvar AST_Binary = DEFNODE(\"Binary\", \"left operator right\", {\n $documentation: \"Binary expression, i.e. `a + b`\",\n $propdoc: {\n left: \"[AST_Node] left-hand side expression\",\n operator: \"[string] the operator\",\n right: \"[AST_Node] right-hand side expression\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.left._walk(visitor);\n this.right._walk(visitor);\n });\n }\n});\n\nvar AST_Conditional = DEFNODE(\"Conditional\", \"condition consequent alternative\", {\n $documentation: \"Conditional expression using the ternary operator, i.e. `a ? b : c`\",\n $propdoc: {\n condition: \"[AST_Node]\",\n consequent: \"[AST_Node]\",\n alternative: \"[AST_Node]\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.condition._walk(visitor);\n this.consequent._walk(visitor);\n this.alternative._walk(visitor);\n });\n }\n});\n\nvar AST_Assign = DEFNODE(\"Assign\", null, {\n $documentation: \"An assignment expression — `a = b + 5`\",\n}, AST_Binary);\n\n/* -----[ LITERALS ]----- */\n\nvar AST_Array = DEFNODE(\"Array\", \"elements\", {\n $documentation: \"An array literal\",\n $propdoc: {\n elements: \"[AST_Node*] array of elements\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.elements.forEach(function(el){\n el._walk(visitor);\n });\n });\n }\n});\n\nvar AST_Object = DEFNODE(\"Object\", \"properties\", {\n $documentation: \"An object literal\",\n $propdoc: {\n properties: \"[AST_ObjectProperty*] array of properties\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.properties.forEach(function(prop){\n prop._walk(visitor);\n });\n });\n }\n});\n\nvar AST_ObjectProperty = DEFNODE(\"ObjectProperty\", \"key value\", {\n $documentation: \"Base class for literal object properties\",\n $propdoc: {\n key: \"[string] the property name converted to a string for ObjectKeyVal. For setters and getters this is an arbitrary AST_Node.\",\n value: \"[AST_Node] property value. For setters and getters this is an AST_Function.\"\n },\n _walk: function(visitor) {\n return visitor._visit(this, function(){\n this.value._walk(visitor);\n });\n }\n});\n\nvar AST_ObjectKeyVal = DEFNODE(\"ObjectKeyVal\", null, {\n $documentation: \"A key: value object property\",\n}, AST_ObjectProperty);\n\nvar AST_ObjectSetter = DEFNODE(\"ObjectSetter\", null, {\n $documentation: \"An object setter property\",\n}, AST_ObjectProperty);\n\nvar AST_ObjectGetter = DEFNODE(\"ObjectGetter\", null, {\n $documentation: \"An object getter property\",\n}, AST_ObjectProperty);\n\nvar AST_Symbol = DEFNODE(\"Symbol\", \"scope name thedef\", {\n $propdoc: {\n name: \"[string] name of this symbol\",\n scope: \"[AST_Scope/S] the current scope (not necessarily the definition scope)\",\n thedef: \"[SymbolDef/S] the definition of this symbol\"\n },\n $documentation: \"Base class for all symbols\",\n});\n\nvar AST_SymbolAccessor = DEFNODE(\"SymbolAccessor\", null, {\n $documentation: \"The name of a property accessor (setter/getter function)\"\n}, AST_Symbol);\n\nvar AST_SymbolDeclaration = DEFNODE(\"SymbolDeclaration\", \"init\", {\n $documentation: \"A declaration symbol (symbol in var/const, function name or argument, symbol in catch)\",\n $propdoc: {\n init: \"[AST_Node*/S] array of initializers for this declaration.\"\n }\n}, AST_Symbol);\n\nvar AST_SymbolVar = DEFNODE(\"SymbolVar\", null, {\n $documentation: \"Symbol defining a variable\",\n}, AST_SymbolDeclaration);\n\nvar AST_SymbolConst = DEFNODE(\"SymbolConst\", null, {\n $documentation: \"A constant declaration\"\n}, AST_SymbolDeclaration);\n\nvar AST_SymbolFunarg = DEFNODE(\"SymbolFunarg\", null, {\n $documentation: \"Symbol naming a function argument\",\n}, AST_SymbolVar);\n\nvar AST_SymbolDefun = DEFNODE(\"SymbolDefun\", null, {\n $documentation: \"Symbol defining a function\",\n}, AST_SymbolDeclaration);\n\nvar AST_SymbolLambda = DEFNODE(\"SymbolLambda\", null, {\n $documentation: \"Symbol naming a function expression\",\n}, AST_SymbolDeclaration);\n\nvar AST_SymbolCatch = DEFNODE(\"SymbolCatch\", null, {\n $documentation: \"Symbol naming the exception in catch\",\n}, AST_SymbolDeclaration);\n\nvar AST_Label = DEFNODE(\"Label\", \"references\", {\n $documentation: \"Symbol naming a label (declaration)\",\n $propdoc: {\n references: \"[AST_LoopControl*] a list of nodes referring to this label\"\n },\n initialize: function() {\n this.references = [];\n this.thedef = this;\n }\n}, AST_Symbol);\n\nvar AST_SymbolRef = DEFNODE(\"SymbolRef\", null, {\n $documentation: \"Reference to some symbol (not definition/declaration)\",\n}, AST_Symbol);\n\nvar AST_LabelRef = DEFNODE(\"LabelRef\", null, {\n $documentation: \"Reference to a label symbol\",\n}, AST_Symbol);\n\nvar AST_This = DEFNODE(\"This\", null, {\n $documentation: \"The `this` symbol\",\n}, AST_Symbol);\n\nvar AST_Constant = DEFNODE(\"Constant\", null, {\n $documentation: \"Base class for all constants\",\n getValue: function() {\n return this.value;\n }\n});\n\nvar AST_String = DEFNODE(\"String\", \"value\", {\n $documentation: \"A string literal\",\n $propdoc: {\n value: \"[string] the contents of this string\"\n }\n}, AST_Constant);\n\nvar AST_Number = DEFNODE(\"Number\", \"value\", {\n $documentation: \"A number literal\",\n $propdoc: {\n value: \"[number] the numeric value\"\n }\n}, AST_Constant);\n\nvar AST_RegExp = DEFNODE(\"RegExp\", \"value\", {\n $documentation: \"A regexp literal\",\n $propdoc: {\n value: \"[RegExp] the actual regexp\"\n }\n}, AST_Constant);\n\nvar AST_Atom = DEFNODE(\"Atom\", null, {\n $documentation: \"Base class for atoms\",\n}, AST_Constant);\n\nvar AST_Null = DEFNODE(\"Null\", null, {\n $documentation: \"The `null` atom\",\n value: null\n}, AST_Atom);\n\nvar AST_NaN = DEFNODE(\"NaN\", null, {\n $documentation: \"The impossible value\",\n value: 0/0\n}, AST_Atom);\n\nvar AST_Undefined = DEFNODE(\"Undefined\", null, {\n $documentation: \"The `undefined` value\",\n value: (function(){}())\n}, AST_Atom);\n\nvar AST_Hole = DEFNODE(\"Hole\", null, {\n $documentation: \"A hole in an array\",\n value: (function(){}())\n}, AST_Atom);\n\nvar AST_Infinity = DEFNODE(\"Infinity\", null, {\n $documentation: \"The `Infinity` value\",\n value: 1/0\n}, AST_Atom);\n\nvar AST_Boolean = DEFNODE(\"Boolean\", null, {\n $documentation: \"Base class for booleans\",\n}, AST_Atom);\n\nvar AST_False = DEFNODE(\"False\", null, {\n $documentation: \"The `false` atom\",\n value: false\n}, AST_Boolean);\n\nvar AST_True = DEFNODE(\"True\", null, {\n $documentation: \"The `true` atom\",\n value: true\n}, AST_Boolean);\n\n/* -----[ TreeWalker ]----- */\n\nfunction TreeWalker(callback) {\n this.visit = callback;\n this.stack = [];\n};\nTreeWalker.prototype = {\n _visit: function(node, descend) {\n this.stack.push(node);\n var ret = this.visit(node, descend ? function(){\n descend.call(node);\n } : noop);\n if (!ret && descend) {\n descend.call(node);\n }\n this.stack.pop();\n return ret;\n },\n parent: function(n) {\n return this.stack[this.stack.length - 2 - (n || 0)];\n },\n push: function (node) {\n this.stack.push(node);\n },\n pop: function() {\n return this.stack.pop();\n },\n self: function() {\n return this.stack[this.stack.length - 1];\n },\n find_parent: function(type) {\n var stack = this.stack;\n for (var i = stack.length; --i >= 0;) {\n var x = stack[i];\n if (x instanceof type) return x;\n }\n },\n has_directive: function(type) {\n return this.find_parent(AST_Scope).has_directive(type);\n },\n in_boolean_context: function() {\n var stack = this.stack;\n var i = stack.length, self = stack[--i];\n while (i > 0) {\n var p = stack[--i];\n if ((p instanceof AST_If && p.condition === self) ||\n (p instanceof AST_Conditional && p.condition === self) ||\n (p instanceof AST_DWLoop && p.condition === self) ||\n (p instanceof AST_For && p.condition === self) ||\n (p instanceof AST_UnaryPrefix && p.operator == \"!\" && p.expression === self))\n {\n return true;\n }\n if (!(p instanceof AST_Binary && (p.operator == \"&&\" || p.operator == \"||\")))\n return false;\n self = p;\n }\n },\n loopcontrol_target: function(label) {\n var stack = this.stack;\n if (label) for (var i = stack.length; --i >= 0;) {\n var x = stack[i];\n if (x instanceof AST_LabeledStatement && x.label.name == label.name) {\n return x.body;\n }\n } else for (var i = stack.length; --i >= 0;) {\n var x = stack[i];\n if (x instanceof AST_Switch || x instanceof AST_IterationStatement)\n return x;\n }\n }\n};\n\n/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n <[email protected]>\n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon <[email protected]>\n Parser based on parse-js (http://marijn.haverbeke.nl/parse-js/).\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\nvar KEYWORDS = 'break case catch const continue debugger default delete do else finally for function if in instanceof new return switch throw try typeof var void while with';\nvar KEYWORDS_ATOM = 'false null true';\nvar RESERVED_WORDS = 'abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized this throws transient volatile yield'\n + \" \" + KEYWORDS_ATOM + \" \" + KEYWORDS;\nvar KEYWORDS_BEFORE_EXPRESSION = 'return new delete throw else case';\n\nKEYWORDS = makePredicate(KEYWORDS);\nRESERVED_WORDS = makePredicate(RESERVED_WORDS);\nKEYWORDS_BEFORE_EXPRESSION = makePredicate(KEYWORDS_BEFORE_EXPRESSION);\nKEYWORDS_ATOM = makePredicate(KEYWORDS_ATOM);\n\nvar OPERATOR_CHARS = makePredicate(characters(\"+-*&%=<>!?|~^\"));\n\nvar RE_HEX_NUMBER = /^0x[0-9a-f]+$/i;\nvar RE_OCT_NUMBER = /^0[0-7]+$/;\nvar RE_DEC_NUMBER = /^\\d*\\.?\\d*(?:e[+-]?\\d*(?:\\d\\.?|\\.?\\d)\\d*)?$/i;\n\nvar OPERATORS = makePredicate([\n \"in\",\n \"instanceof\",\n \"typeof\",\n \"new\",\n \"void\",\n \"delete\",\n \"++\",\n \"--\",\n \"+\",\n \"-\",\n \"!\",\n \"~\",\n \"&\",\n \"|\",\n \"^\",\n \"*\",\n \"/\",\n \"%\",\n \">>\",\n \"<<\",\n \">>>\",\n \"<\",\n \">\",\n \"<=\",\n \">=\",\n \"==\",\n \"===\",\n \"!=\",\n \"!==\",\n \"?\",\n \"=\",\n \"+=\",\n \"-=\",\n \"/=\",\n \"*=\",\n \"%=\",\n \">>=\",\n \"<<=\",\n \">>>=\",\n \"|=\",\n \"^=\",\n \"&=\",\n \"&&\",\n \"||\"\n]);\n\nvar WHITESPACE_CHARS = makePredicate(characters(\" \\u00a0\\n\\r\\t\\f\\u000b\\u200b\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\"));\n\nvar PUNC_BEFORE_EXPRESSION = makePredicate(characters(\"[{(,.;:\"));\n\nvar PUNC_CHARS = makePredicate(characters(\"[]{}(),;:\"));\n\nvar REGEXP_MODIFIERS = makePredicate(characters(\"gmsiy\"));\n\n/* -----[ Tokenizer ]----- */\n\n// regexps adapted from http://xregexp.com/plugins/#unicode\nvar UNICODE = {\n letter: new RegExp(\"[\\\\u0041-\\\\u005A\\\\u0061-\\\\u007A\\\\u00AA\\\\u00B5\\\\u00BA\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02C1\\\\u02C6-\\\\u02D1\\\\u02E0-\\\\u02E4\\\\u02EC\\\\u02EE\\\\u0370-\\\\u0374\\\\u0376\\\\u0377\\\\u037A-\\\\u037D\\\\u0386\\\\u0388-\\\\u038A\\\\u038C\\\\u038E-\\\\u03A1\\\\u03A3-\\\\u03F5\\\\u03F7-\\\\u0481\\\\u048A-\\\\u0523\\\\u0531-\\\\u0556\\\\u0559\\\\u0561-\\\\u0587\\\\u05D0-\\\\u05EA\\\\u05F0-\\\\u05F2\\\\u0621-\\\\u064A\\\\u066E\\\\u066F\\\\u0671-\\\\u06D3\\\\u06D5\\\\u06E5\\\\u06E6\\\\u06EE\\\\u06EF\\\\u06FA-\\\\u06FC\\\\u06FF\\\\u0710\\\\u0712-\\\\u072F\\\\u074D-\\\\u07A5\\\\u07B1\\\\u07CA-\\\\u07EA\\\\u07F4\\\\u07F5\\\\u07FA\\\\u0904-\\\\u0939\\\\u093D\\\\u0950\\\\u0958-\\\\u0961\\\\u0971\\\\u0972\\\\u097B-\\\\u097F\\\\u0985-\\\\u098C\\\\u098F\\\\u0990\\\\u0993-\\\\u09A8\\\\u09AA-\\\\u09B0\\\\u09B2\\\\u09B6-\\\\u09B9\\\\u09BD\\\\u09CE\\\\u09DC\\\\u09DD\\\\u09DF-\\\\u09E1\\\\u09F0\\\\u09F1\\\\u0A05-\\\\u0A0A\\\\u0A0F\\\\u0A10\\\\u0A13-\\\\u0A28\\\\u0A2A-\\\\u0A30\\\\u0A32\\\\u0A33\\\\u0A35\\\\u0A36\\\\u0A38\\\\u0A39\\\\u0A59-\\\\u0A5C\\\\u0A5E\\\\u0A72-\\\\u0A74\\\\u0A85-\\\\u0A8D\\\\u0A8F-\\\\u0A91\\\\u0A93-\\\\u0AA8\\\\u0AAA-\\\\u0AB0\\\\u0AB2\\\\u0AB3\\\\u0AB5-\\\\u0AB9\\\\u0ABD\\\\u0AD0\\\\u0AE0\\\\u0AE1\\\\u0B05-\\\\u0B0C\\\\u0B0F\\\\u0B10\\\\u0B13-\\\\u0B28\\\\u0B2A-\\\\u0B30\\\\u0B32\\\\u0B33\\\\u0B35-\\\\u0B39\\\\u0B3D\\\\u0B5C\\\\u0B5D\\\\u0B5F-\\\\u0B61\\\\u0B71\\\\u0B83\\\\u0B85-\\\\u0B8A\\\\u0B8E-\\\\u0B90\\\\u0B92-\\\\u0B95\\\\u0B99\\\\u0B9A\\\\u0B9C\\\\u0B9E\\\\u0B9F\\\\u0BA3\\\\u0BA4\\\\u0BA8-\\\\u0BAA\\\\u0BAE-\\\\u0BB9\\\\u0BD0\\\\u0C05-\\\\u0C0C\\\\u0C0E-\\\\u0C10\\\\u0C12-\\\\u0C28\\\\u0C2A-\\\\u0C33\\\\u0C35-\\\\u0C39\\\\u0C3D\\\\u0C58\\\\u0C59\\\\u0C60\\\\u0C61\\\\u0C85-\\\\u0C8C\\\\u0C8E-\\\\u0C90\\\\u0C92-\\\\u0CA8\\\\u0CAA-\\\\u0CB3\\\\u0CB5-\\\\u0CB9\\\\u0CBD\\\\u0CDE\\\\u0CE0\\\\u0CE1\\\\u0D05-\\\\u0D0C\\\\u0D0E-\\\\u0D10\\\\u0D12-\\\\u0D28\\\\u0D2A-\\\\u0D39\\\\u0D3D\\\\u0D60\\\\u0D61\\\\u0D7A-\\\\u0D7F\\\\u0D85-\\\\u0D96\\\\u0D9A-\\\\u0DB1\\\\u0DB3-\\\\u0DBB\\\\u0DBD\\\\u0DC0-\\\\u0DC6\\\\u0E01-\\\\u0E30\\\\u0E32\\\\u0E33\\\\u0E40-\\\\u0E46\\\\u0E81\\\\u0E82\\\\u0E84\\\\u0E87\\\\u0E88\\\\u0E8A\\\\u0E8D\\\\u0E94-\\\\u0E97\\\\u0E99-\\\\u0E9F\\\\u0EA1-\\\\u0EA3\\\\u0EA5\\\\u0EA7\\\\u0EAA\\\\u0EAB\\\\u0EAD-\\\\u0EB0\\\\u0EB2\\\\u0EB3\\\\u0EBD\\\\u0EC0-\\\\u0EC4\\\\u0EC6\\\\u0EDC\\\\u0EDD\\\\u0F00\\\\u0F40-\\\\u0F47\\\\u0F49-\\\\u0F6C\\\\u0F88-\\\\u0F8B\\\\u1000-\\\\u102A\\\\u103F\\\\u1050-\\\\u1055\\\\u105A-\\\\u105D\\\\u1061\\\\u1065\\\\u1066\\\\u106E-\\\\u1070\\\\u1075-\\\\u1081\\\\u108E\\\\u10A0-\\\\u10C5\\\\u10D0-\\\\u10FA\\\\u10FC\\\\u1100-\\\\u1159\\\\u115F-\\\\u11A2\\\\u11A8-\\\\u11F9\\\\u1200-\\\\u1248\\\\u124A-\\\\u124D\\\\u1250-\\\\u1256\\\\u1258\\\\u125A-\\\\u125D\\\\u1260-\\\\u1288\\\\u128A-\\\\u128D\\\\u1290-\\\\u12B0\\\\u12B2-\\\\u12B5\\\\u12B8-\\\\u12BE\\\\u12C0\\\\u12C2-\\\\u12C5\\\\u12C8-\\\\u12D6\\\\u12D8-\\\\u1310\\\\u1312-\\\\u1315\\\\u1318-\\\\u135A\\\\u1380-\\\\u138F\\\\u13A0-\\\\u13F4\\\\u1401-\\\\u166C\\\\u166F-\\\\u1676\\\\u1681-\\\\u169A\\\\u16A0-\\\\u16EA\\\\u1700-\\\\u170C\\\\u170E-\\\\u1711\\\\u1720-\\\\u1731\\\\u1740-\\\\u1751\\\\u1760-\\\\u176C\\\\u176E-\\\\u1770\\\\u1780-\\\\u17B3\\\\u17D7\\\\u17DC\\\\u1820-\\\\u1877\\\\u1880-\\\\u18A8\\\\u18AA\\\\u1900-\\\\u191C\\\\u1950-\\\\u196D\\\\u1970-\\\\u1974\\\\u1980-\\\\u19A9\\\\u19C1-\\\\u19C7\\\\u1A00-\\\\u1A16\\\\u1B05-\\\\u1B33\\\\u1B45-\\\\u1B4B\\\\u1B83-\\\\u1BA0\\\\u1BAE\\\\u1BAF\\\\u1C00-\\\\u1C23\\\\u1C4D-\\\\u1C4F\\\\u1C5A-\\\\u1C7D\\\\u1D00-\\\\u1DBF\\\\u1E00-\\\\u1F15\\\\u1F18-\\\\u1F1D\\\\u1F20-\\\\u1F45\\\\u1F48-\\\\u1F4D\\\\u1F50-\\\\u1F57\\\\u1F59\\\\u1F5B\\\\u1F5D\\\\u1F5F-\\\\u1F7D\\\\u1F80-\\\\u1FB4\\\\u1FB6-\\\\u1FBC\\\\u1FBE\\\\u1FC2-\\\\u1FC4\\\\u1FC6-\\\\u1FCC\\\\u1FD0-\\\\u1FD3\\\\u1FD6-\\\\u1FDB\\\\u1FE0-\\\\u1FEC\\\\u1FF2-\\\\u1FF4\\\\u1FF6-\\\\u1FFC\\\\u2071\\\\u207F\\\\u2090-\\\\u2094\\\\u2102\\\\u2107\\\\u210A-\\\\u2113\\\\u2115\\\\u2119-\\\\u211D\\\\u2124\\\\u2126\\\\u2128\\\\u212A-\\\\u212D\\\\u212F-\\\\u2139\\\\u213C-\\\\u213F\\\\u2145-\\\\u2149\\\\u214E\\\\u2183\\\\u2184\\\\u2C00-\\\\u2C2E\\\\u2C30-\\\\u2C5E\\\\u2C60-\\\\u2C6F\\\\u2C71-\\\\u2C7D\\\\u2C80-\\\\u2CE4\\\\u2D00-\\\\u2D25\\\\u2D30-\\\\u2D65\\\\u2D6F\\\\u2D80-\\\\u2D96\\\\u2DA0-\\\\u2DA6\\\\u2DA8-\\\\u2DAE\\\\u2DB0-\\\\u2DB6\\\\u2DB8-\\\\u2DBE\\\\u2DC0-\\\\u2DC6\\\\u2DC8-\\\\u2DCE\\\\u2DD0-\\\\u2DD6\\\\u2DD8-\\\\u2DDE\\\\u2E2F\\\\u3005\\\\u3006\\\\u3031-\\\\u3035\\\\u303B\\\\u303C\\\\u3041-\\\\u3096\\\\u309D-\\\\u309F\\\\u30A1-\\\\u30FA\\\\u30FC-\\\\u30FF\\\\u3105-\\\\u312D\\\\u3131-\\\\u318E\\\\u31A0-\\\\u31B7\\\\u31F0-\\\\u31FF\\\\u3400\\\\u4DB5\\\\u4E00\\\\u9FC3\\\\uA000-\\\\uA48C\\\\uA500-\\\\uA60C\\\\uA610-\\\\uA61F\\\\uA62A\\\\uA62B\\\\uA640-\\\\uA65F\\\\uA662-\\\\uA66E\\\\uA67F-\\\\uA697\\\\uA717-\\\\uA71F\\\\uA722-\\\\uA788\\\\uA78B\\\\uA78C\\\\uA7FB-\\\\uA801\\\\uA803-\\\\uA805\\\\uA807-\\\\uA80A\\\\uA80C-\\\\uA822\\\\uA840-\\\\uA873\\\\uA882-\\\\uA8B3\\\\uA90A-\\\\uA925\\\\uA930-\\\\uA946\\\\uAA00-\\\\uAA28\\\\uAA40-\\\\uAA42\\\\uAA44-\\\\uAA4B\\\\uAC00\\\\uD7A3\\\\uF900-\\\\uFA2D\\\\uFA30-\\\\uFA6A\\\\uFA70-\\\\uFAD9\\\\uFB00-\\\\uFB06\\\\uFB13-\\\\uFB17\\\\uFB1D\\\\uFB1F-\\\\uFB28\\\\uFB2A-\\\\uFB36\\\\uFB38-\\\\uFB3C\\\\uFB3E\\\\uFB40\\\\uFB41\\\\uFB43\\\\uFB44\\\\uFB46-\\\\uFBB1\\\\uFBD3-\\\\uFD3D\\\\uFD50-\\\\uFD8F\\\\uFD92-\\\\uFDC7\\\\uFDF0-\\\\uFDFB\\\\uFE70-\\\\uFE74\\\\uFE76-\\\\uFEFC\\\\uFF21-\\\\uFF3A\\\\uFF41-\\\\uFF5A\\\\uFF66-\\\\uFFBE\\\\uFFC2-\\\\uFFC7\\\\uFFCA-\\\\uFFCF\\\\uFFD2-\\\\uFFD7\\\\uFFDA-\\\\uFFDC]\"),\n non_spacing_mark: new RegExp(\"[\\\\u0300-\\\\u036F\\\\u0483-\\\\u0487\\\\u0591-\\\\u05BD\\\\u05BF\\\\u05C1\\\\u05C2\\\\u05C4\\\\u05C5\\\\u05C7\\\\u0610-\\\\u061A\\\\u064B-\\\\u065E\\\\u0670\\\\u06D6-\\\\u06DC\\\\u06DF-\\\\u06E4\\\\u06E7\\\\u06E8\\\\u06EA-\\\\u06ED\\\\u0711\\\\u0730-\\\\u074A\\\\u07A6-\\\\u07B0\\\\u07EB-\\\\u07F3\\\\u0816-\\\\u0819\\\\u081B-\\\\u0823\\\\u0825-\\\\u0827\\\\u0829-\\\\u082D\\\\u0900-\\\\u0902\\\\u093C\\\\u0941-\\\\u0948\\\\u094D\\\\u0951-\\\\u0955\\\\u0962\\\\u0963\\\\u0981\\\\u09BC\\\\u09C1-\\\\u09C4\\\\u09CD\\\\u09E2\\\\u09E3\\\\u0A01\\\\u0A02\\\\u0A3C\\\\u0A41\\\\u0A42\\\\u0A47\\\\u0A48\\\\u0A4B-\\\\u0A4D\\\\u0A51\\\\u0A70\\\\u0A71\\\\u0A75\\\\u0A81\\\\u0A82\\\\u0ABC\\\\u0AC1-\\\\u0AC5\\\\u0AC7\\\\u0AC8\\\\u0ACD\\\\u0AE2\\\\u0AE3\\\\u0B01\\\\u0B3C\\\\u0B3F\\\\u0B41-\\\\u0B44\\\\u0B4D\\\\u0B56\\\\u0B62\\\\u0B63\\\\u0B82\\\\u0BC0\\\\u0BCD\\\\u0C3E-\\\\u0C40\\\\u0C46-\\\\u0C48\\\\u0C4A-\\\\u0C4D\\\\u0C55\\\\u0C56\\\\u0C62\\\\u0C63\\\\u0CBC\\\\u0CBF\\\\u0CC6\\\\u0CCC\\\\u0CCD\\\\u0CE2\\\\u0CE3\\\\u0D41-\\\\u0D44\\\\u0D4D\\\\u0D62\\\\u0D63\\\\u0DCA\\\\u0DD2-\\\\u0DD4\\\\u0DD6\\\\u0E31\\\\u0E34-\\\\u0E3A\\\\u0E47-\\\\u0E4E\\\\u0EB1\\\\u0EB4-\\\\u0EB9\\\\u0EBB\\\\u0EBC\\\\u0EC8-\\\\u0ECD\\\\u0F18\\\\u0F19\\\\u0F35\\\\u0F37\\\\u0F39\\\\u0F71-\\\\u0F7E\\\\u0F80-\\\\u0F84\\\\u0F86\\\\u0F87\\\\u0F90-\\\\u0F97\\\\u0F99-\\\\u0FBC\\\\u0FC6\\\\u102D-\\\\u1030\\\\u1032-\\\\u1037\\\\u1039\\\\u103A\\\\u103D\\\\u103E\\\\u1058\\\\u1059\\\\u105E-\\\\u1060\\\\u1071-\\\\u1074\\\\u1082\\\\u1085\\\\u1086\\\\u108D\\\\u109D\\\\u135F\\\\u1712-\\\\u1714\\\\u1732-\\\\u1734\\\\u1752\\\\u1753\\\\u1772\\\\u1773\\\\u17B7-\\\\u17BD\\\\u17C6\\\\u17C9-\\\\u17D3\\\\u17DD\\\\u180B-\\\\u180D\\\\u18A9\\\\u1920-\\\\u1922\\\\u1927\\\\u1928\\\\u1932\\\\u1939-\\\\u193B\\\\u1A17\\\\u1A18\\\\u1A56\\\\u1A58-\\\\u1A5E\\\\u1A60\\\\u1A62\\\\u1A65-\\\\u1A6C\\\\u1A73-\\\\u1A7C\\\\u1A7F\\\\u1B00-\\\\u1B03\\\\u1B34\\\\u1B36-\\\\u1B3A\\\\u1B3C\\\\u1B42\\\\u1B6B-\\\\u1B73\\\\u1B80\\\\u1B81\\\\u1BA2-\\\\u1BA5\\\\u1BA8\\\\u1BA9\\\\u1C2C-\\\\u1C33\\\\u1C36\\\\u1C37\\\\u1CD0-\\\\u1CD2\\\\u1CD4-\\\\u1CE0\\\\u1CE2-\\\\u1CE8\\\\u1CED\\\\u1DC0-\\\\u1DE6\\\\u1DFD-\\\\u1DFF\\\\u20D0-\\\\u20DC\\\\u20E1\\\\u20E5-\\\\u20F0\\\\u2CEF-\\\\u2CF1\\\\u2DE0-\\\\u2DFF\\\\u302A-\\\\u302F\\\\u3099\\\\u309A\\\\uA66F\\\\uA67C\\\\uA67D\\\\uA6F0\\\\uA6F1\\\\uA802\\\\uA806\\\\uA80B\\\\uA825\\\\uA826\\\\uA8C4\\\\uA8E0-\\\\uA8F1\\\\uA926-\\\\uA92D\\\\uA947-\\\\uA951\\\\uA980-\\\\uA982\\\\uA9B3\\\\uA9B6-\\\\uA9B9\\\\uA9BC\\\\uAA29-\\\\uAA2E\\\\uAA31\\\\uAA32\\\\uAA35\\\\uAA36\\\\uAA43\\\\uAA4C\\\\uAAB0\\\\uAAB2-\\\\uAAB4\\\\uAAB7\\\\uAAB8\\\\uAABE\\\\uAABF\\\\uAAC1\\\\uABE5\\\\uABE8\\\\uABED\\\\uFB1E\\\\uFE00-\\\\uFE0F\\\\uFE20-\\\\uFE26]\"),\n space_combining_mark: new RegExp(\"[\\\\u0903\\\\u093E-\\\\u0940\\\\u0949-\\\\u094C\\\\u094E\\\\u0982\\\\u0983\\\\u09BE-\\\\u09C0\\\\u09C7\\\\u09C8\\\\u09CB\\\\u09CC\\\\u09D7\\\\u0A03\\\\u0A3E-\\\\u0A40\\\\u0A83\\\\u0ABE-\\\\u0AC0\\\\u0AC9\\\\u0ACB\\\\u0ACC\\\\u0B02\\\\u0B03\\\\u0B3E\\\\u0B40\\\\u0B47\\\\u0B48\\\\u0B4B\\\\u0B4C\\\\u0B57\\\\u0BBE\\\\u0BBF\\\\u0BC1\\\\u0BC2\\\\u0BC6-\\\\u0BC8\\\\u0BCA-\\\\u0BCC\\\\u0BD7\\\\u0C01-\\\\u0C03\\\\u0C41-\\\\u0C44\\\\u0C82\\\\u0C83\\\\u0CBE\\\\u0CC0-\\\\u0CC4\\\\u0CC7\\\\u0CC8\\\\u0CCA\\\\u0CCB\\\\u0CD5\\\\u0CD6\\\\u0D02\\\\u0D03\\\\u0D3E-\\\\u0D40\\\\u0D46-\\\\u0D48\\\\u0D4A-\\\\u0D4C\\\\u0D57\\\\u0D82\\\\u0D83\\\\u0DCF-\\\\u0DD1\\\\u0DD8-\\\\u0DDF\\\\u0DF2\\\\u0DF3\\\\u0F3E\\\\u0F3F\\\\u0F7F\\\\u102B\\\\u102C\\\\u1031\\\\u1038\\\\u103B\\\\u103C\\\\u1056\\\\u1057\\\\u1062-\\\\u1064\\\\u1067-\\\\u106D\\\\u1083\\\\u1084\\\\u1087-\\\\u108C\\\\u108F\\\\u109A-\\\\u109C\\\\u17B6\\\\u17BE-\\\\u17C5\\\\u17C7\\\\u17C8\\\\u1923-\\\\u1926\\\\u1929-\\\\u192B\\\\u1930\\\\u1931\\\\u1933-\\\\u1938\\\\u19B0-\\\\u19C0\\\\u19C8\\\\u19C9\\\\u1A19-\\\\u1A1B\\\\u1A55\\\\u1A57\\\\u1A61\\\\u1A63\\\\u1A64\\\\u1A6D-\\\\u1A72\\\\u1B04\\\\u1B35\\\\u1B3B\\\\u1B3D-\\\\u1B41\\\\u1B43\\\\u1B44\\\\u1B82\\\\u1BA1\\\\u1BA6\\\\u1BA7\\\\u1BAA\\\\u1C24-\\\\u1C2B\\\\u1C34\\\\u1C35\\\\u1CE1\\\\u1CF2\\\\uA823\\\\uA824\\\\uA827\\\\uA880\\\\uA881\\\\uA8B4-\\\\uA8C3\\\\uA952\\\\uA953\\\\uA983\\\\uA9B4\\\\uA9B5\\\\uA9BA\\\\uA9BB\\\\uA9BD-\\\\uA9C0\\\\uAA2F\\\\uAA30\\\\uAA33\\\\uAA34\\\\uAA4D\\\\uAA7B\\\\uABE3\\\\uABE4\\\\uABE6\\\\uABE7\\\\uABE9\\\\uABEA\\\\uABEC]\"),\n connector_punctuation: new RegExp(\"[\\\\u005F\\\\u203F\\\\u2040\\\\u2054\\\\uFE33\\\\uFE34\\\\uFE4D-\\\\uFE4F\\\\uFF3F]\")\n};\n\nfunction is_letter(code) {\n return (code >= 97 && code <= 122)\n || (code >= 65 && code <= 90)\n || (code >= 0xaa && UNICODE.letter.test(String.fromCharCode(code)));\n};\n\nfunction is_digit(code) {\n return code >= 48 && code <= 57; //XXX: find out if \"UnicodeDigit\" means something else than 0..9\n};\n\nfunction is_alphanumeric_char(code) {\n return is_digit(code) || is_letter(code);\n};\n\nfunction is_unicode_combining_mark(ch) {\n return UNICODE.non_spacing_mark.test(ch) || UNICODE.space_combining_mark.test(ch);\n};\n\nfunction is_unicode_connector_punctuation(ch) {\n return UNICODE.connector_punctuation.test(ch);\n};\n\nfunction is_identifier(name) {\n return !RESERVED_WORDS(name) && /^[a-z_$][a-z0-9_$]*$/i.test(name);\n};\n\nfunction is_identifier_start(code) {\n return code == 36 || code == 95 || is_letter(code);\n};\n\nfunction is_identifier_char(ch) {\n var code = ch.charCodeAt(0);\n return is_identifier_start(code)\n || is_digit(code)\n || code == 8204 // \\u200c: zero-width non-joiner <ZWNJ>\n || code == 8205 // \\u200d: zero-width joiner <ZWJ> (in my ECMA-262 PDF, this is also 200c)\n || is_unicode_combining_mark(ch)\n || is_unicode_connector_punctuation(ch)\n ;\n};\n\nfunction is_identifier_string(str){\n var i = str.length;\n if (i == 0) return false;\n if (!is_identifier_start(str.charCodeAt(0))) return false;\n while (--i >= 0) {\n if (!is_identifier_char(str.charAt(i)))\n return false;\n }\n return true;\n};\n\nfunction parse_js_number(num) {\n if (RE_HEX_NUMBER.test(num)) {\n return parseInt(num.substr(2), 16);\n } else if (RE_OCT_NUMBER.test(num)) {\n return parseInt(num.substr(1), 8);\n } else if (RE_DEC_NUMBER.test(num)) {\n return parseFloat(num);\n }\n};\n\nfunction JS_Parse_Error(message, line, col, pos) {\n this.message = message;\n this.line = line;\n this.col = col;\n this.pos = pos;\n this.stack = new Error().stack;\n};\n\nJS_Parse_Error.prototype.toString = function() {\n return this.message + \" (line: \" + this.line + \", col: \" + this.col + \", pos: \" + this.pos + \")\" + \"\\n\\n\" + this.stack;\n};\n\nfunction js_error(message, filename, line, col, pos) {\n throw new JS_Parse_Error(message, line, col, pos);\n};\n\nfunction is_token(token, type, val) {\n return token.type == type && (val == null || token.value == val);\n};\n\nvar EX_EOF = {};\n\nfunction tokenizer($TEXT, filename, html5_comments) {\n\n var S = {\n text : $TEXT.replace(/\\r\\n?|[\\n\\u2028\\u2029]/g, \"\\n\").replace(/\\uFEFF/g, ''),\n filename : filename,\n pos : 0,\n tokpos : 0,\n line : 1,\n tokline : 0,\n col : 0,\n tokcol : 0,\n newline_before : false,\n regex_allowed : false,\n comments_before : []\n };\n\n function peek() { return S.text.charAt(S.pos); };\n\n function next(signal_eof, in_string) {\n var ch = S.text.charAt(S.pos++);\n if (signal_eof && !ch)\n throw EX_EOF;\n if (ch == \"\\n\") {\n S.newline_before = S.newline_before || !in_string;\n ++S.line;\n S.col = 0;\n } else {\n ++S.col;\n }\n return ch;\n };\n\n function forward(i) {\n while (i-- > 0) next();\n };\n\n function looking_at(str) {\n return S.text.substr(S.pos, str.length) == str;\n };\n\n function find(what, signal_eof) {\n var pos = S.text.indexOf(what, S.pos);\n if (signal_eof && pos == -1) throw EX_EOF;\n return pos;\n };\n\n function start_token() {\n S.tokline = S.line;\n S.tokcol = S.col;\n S.tokpos = S.pos;\n };\n\n var prev_was_dot = false;\n function token(type, value, is_comment) {\n S.regex_allowed = ((type == \"operator\" && !UNARY_POSTFIX(value)) ||\n (type == \"keyword\" && KEYWORDS_BEFORE_EXPRESSION(value)) ||\n (type == \"punc\" && PUNC_BEFORE_EXPRESSION(value)));\n prev_was_dot = (type == \"punc\" && value == \".\");\n var ret = {\n type : type,\n value : value,\n line : S.tokline,\n col : S.tokcol,\n pos : S.tokpos,\n endpos : S.pos,\n nlb : S.newline_before,\n file : filename\n };\n if (!is_comment) {\n ret.comments_before = S.comments_before;\n S.comments_before = [];\n // make note of any newlines in the comments that came before\n for (var i = 0, len = ret.comments_before.length; i < len; i++) {\n ret.nlb = ret.nlb || ret.comments_before[i].nlb;\n }\n }\n S.newline_before = false;\n return new AST_Token(ret);\n };\n\n function skip_whitespace() {\n while (WHITESPACE_CHARS(peek()))\n next();\n };\n\n function read_while(pred) {\n var ret = \"\", ch, i = 0;\n while ((ch = peek()) && pred(ch, i++))\n ret += next();\n return ret;\n };\n\n function parse_error(err) {\n js_error(err, filename, S.tokline, S.tokcol, S.tokpos);\n };\n\n function read_num(prefix) {\n var has_e = false, after_e = false, has_x = false, has_dot = prefix == \".\";\n var num = read_while(function(ch, i){\n var code = ch.charCodeAt(0);\n switch (code) {\n case 120: case 88: // xX\n return has_x ? false : (has_x = true);\n case 101: case 69: // eE\n return has_x ? true : has_e ? false : (has_e = after_e = true);\n case 45: // -\n return after_e || (i == 0 && !prefix);\n case 43: // +\n return after_e;\n case (after_e = false, 46): // .\n return (!has_dot && !has_x && !has_e) ? (has_dot = true) : false;\n }\n return is_alphanumeric_char(code);\n });\n if (prefix) num = prefix + num;\n var valid = parse_js_number(num);\n if (!isNaN(valid)) {\n return token(\"num\", valid);\n } else {\n parse_error(\"Invalid syntax: \" + num);\n }\n };\n\n function read_escaped_char(in_string) {\n var ch = next(true, in_string);\n switch (ch.charCodeAt(0)) {\n case 110 : return \"\\n\";\n case 114 : return \"\\r\";\n case 116 : return \"\\t\";\n case 98 : return \"\\b\";\n case 118 : return \"\\u000b\"; // \\v\n case 102 : return \"\\f\";\n case 48 : return \"\\0\";\n case 120 : return String.fromCharCode(hex_bytes(2)); // \\x\n case 117 : return String.fromCharCode(hex_bytes(4)); // \\u\n case 10 : return \"\"; // newline\n default : return ch;\n }\n };\n\n function hex_bytes(n) {\n var num = 0;\n for (; n > 0; --n) {\n var digit = parseInt(next(true), 16);\n if (isNaN(digit))\n parse_error(\"Invalid hex-character pattern in string\");\n num = (num << 4) | digit;\n }\n return num;\n };\n\n var read_string = with_eof_error(\"Unterminated string constant\", function(){\n var quote = next(), ret = \"\";\n for (;;) {\n var ch = next(true);\n if (ch == \"\\\\\") {\n // read OctalEscapeSequence (XXX: deprecated if \"strict mode\")\n // https://github.com/mishoo/UglifyJS/issues/178\n var octal_len = 0, first = null;\n ch = read_while(function(ch){\n if (ch >= \"0\" && ch <= \"7\") {\n if (!first) {\n first = ch;\n return ++octal_len;\n }\n else if (first <= \"3\" && octal_len <= 2) return ++octal_len;\n else if (first >= \"4\" && octal_len <= 1) return ++octal_len;\n }\n return false;\n });\n if (octal_len > 0) ch = String.fromCharCode(parseInt(ch, 8));\n else ch = read_escaped_char(true);\n }\n else if (ch == quote) break;\n ret += ch;\n }\n return token(\"string\", ret);\n });\n\n function skip_line_comment(type) {\n var regex_allowed = S.regex_allowed;\n var i = find(\"\\n\"), ret;\n if (i == -1) {\n ret = S.text.substr(S.pos);\n S.pos = S.text.length;\n } else {\n ret = S.text.substring(S.pos, i);\n S.pos = i;\n }\n S.comments_before.push(token(type, ret, true));\n S.regex_allowed = regex_allowed;\n return next_token();\n };\n\n var skip_multiline_comment = with_eof_error(\"Unterminated multiline comment\", function(){\n var regex_allowed = S.regex_allowed;\n var i = find(\"*/\", true);\n var text = S.text.substring(S.pos, i);\n var a = text.split(\"\\n\"), n = a.length;\n // update stream position\n S.pos = i + 2;\n S.line += n - 1;\n if (n > 1) S.col = a[n - 1].length;\n else S.col += a[n - 1].length;\n S.col += 2;\n var nlb = S.newline_before = S.newline_before || text.indexOf(\"\\n\") >= 0;\n S.comments_before.push(token(\"comment2\", text, true));\n S.regex_allowed = regex_allowed;\n S.newline_before = nlb;\n return next_token();\n });\n\n function read_name() {\n var backslash = false, name = \"\", ch, escaped = false, hex;\n while ((ch = peek()) != null) {\n if (!backslash) {\n if (ch == \"\\\\\") escaped = backslash = true, next();\n else if (is_identifier_char(ch)) name += next();\n else break;\n }\n else {\n if (ch != \"u\") parse_error(\"Expecting UnicodeEscapeSequence -- uXXXX\");\n ch = read_escaped_char();\n if (!is_identifier_char(ch)) parse_error(\"Unicode char: \" + ch.charCodeAt(0) + \" is not valid in identifier\");\n name += ch;\n backslash = false;\n }\n }\n if (KEYWORDS(name) && escaped) {\n hex = name.charCodeAt(0).toString(16).toUpperCase();\n name = \"\\\\u\" + \"0000\".substr(hex.length) + hex + name.slice(1);\n }\n return name;\n };\n\n var read_regexp = with_eof_error(\"Unterminated regular expression\", function(regexp){\n var prev_backslash = false, ch, in_class = false;\n while ((ch = next(true))) if (prev_backslash) {\n regexp += \"\\\\\" + ch;\n prev_backslash = false;\n } else if (ch == \"[\") {\n in_class = true;\n regexp += ch;\n } else if (ch == \"]\" && in_class) {\n in_class = false;\n regexp += ch;\n } else if (ch == \"/\" && !in_class) {\n break;\n } else if (ch == \"\\\\\") {\n prev_backslash = true;\n } else {\n regexp += ch;\n }\n var mods = read_name();\n return token(\"regexp\", new RegExp(regexp, mods));\n });\n\n function read_operator(prefix) {\n function grow(op) {\n if (!peek()) return op;\n var bigger = op + peek();\n if (OPERATORS(bigger)) {\n next();\n return grow(bigger);\n } else {\n return op;\n }\n };\n return token(\"operator\", grow(prefix || next()));\n };\n\n function handle_slash() {\n next();\n switch (peek()) {\n case \"/\":\n next();\n return skip_line_comment(\"comment1\");\n case \"*\":\n next();\n return skip_multiline_comment();\n }\n return S.regex_allowed ? read_regexp(\"\") : read_operator(\"/\");\n };\n\n function handle_dot() {\n next();\n return is_digit(peek().charCodeAt(0))\n ? read_num(\".\")\n : token(\"punc\", \".\");\n };\n\n function read_word() {\n var word = read_name();\n if (prev_was_dot) return token(\"name\", word);\n return KEYWORDS_ATOM(word) ? token(\"atom\", word)\n : !KEYWORDS(word) ? token(\"name\", word)\n : OPERATORS(word) ? token(\"operator\", word)\n : token(\"keyword\", word);\n };\n\n function with_eof_error(eof_error, cont) {\n return function(x) {\n try {\n return cont(x);\n } catch(ex) {\n if (ex === EX_EOF) parse_error(eof_error);\n else throw ex;\n }\n };\n };\n\n function next_token(force_regexp) {\n if (force_regexp != null)\n return read_regexp(force_regexp);\n skip_whitespace();\n start_token();\n if (html5_comments) {\n if (looking_at(\"<!--\")) {\n forward(4);\n return skip_line_comment(\"comment3\");\n }\n if (looking_at(\"-->\") && S.newline_before) {\n forward(3);\n return skip_line_comment(\"comment4\");\n }\n }\n var ch = peek();\n if (!ch) return token(\"eof\");\n var code = ch.charCodeAt(0);\n switch (code) {\n case 34: case 39: return read_string();\n case 46: return handle_dot();\n case 47: return handle_slash();\n }\n if (is_digit(code)) return read_num();\n if (PUNC_CHARS(ch)) return token(\"punc\", next());\n if (OPERATOR_CHARS(ch)) return read_operator();\n if (code == 92 || is_identifier_start(code)) return read_word();\n parse_error(\"Unexpected character '\" + ch + \"'\");\n };\n\n next_token.context = function(nc) {\n if (nc) S = nc;\n return S;\n };\n\n return next_token;\n\n};\n\n/* -----[ Parser (constants) ]----- */\n\nvar UNARY_PREFIX = makePredicate([\n \"typeof\",\n \"void\",\n \"delete\",\n \"--\",\n \"++\",\n \"!\",\n \"~\",\n \"-\",\n \"+\"\n]);\n\nvar UNARY_POSTFIX = makePredicate([ \"--\", \"++\" ]);\n\nvar ASSIGNMENT = makePredicate([ \"=\", \"+=\", \"-=\", \"/=\", \"*=\", \"%=\", \">>=\", \"<<=\", \">>>=\", \"|=\", \"^=\", \"&=\" ]);\n\nvar PRECEDENCE = (function(a, ret){\n for (var i = 0; i < a.length; ++i) {\n var b = a[i];\n for (var j = 0; j < b.length; ++j) {\n ret[b[j]] = i + 1;\n }\n }\n return ret;\n})(\n [\n [\"||\"],\n [\"&&\"],\n [\"|\"],\n [\"^\"],\n [\"&\"],\n [\"==\", \"===\", \"!=\", \"!==\"],\n [\"<\", \">\", \"<=\", \">=\", \"in\", \"instanceof\"],\n [\">>\", \"<<\", \">>>\"],\n [\"+\", \"-\"],\n [\"*\", \"/\", \"%\"]\n ],\n {}\n);\n\nvar STATEMENTS_WITH_LABELS = array_to_hash([ \"for\", \"do\", \"while\", \"switch\" ]);\n\nvar ATOMIC_START_TOKEN = array_to_hash([ \"atom\", \"num\", \"string\", \"regexp\", \"name\" ]);\n\n/* -----[ Parser ]----- */\n\nfunction parse($TEXT, options) {\n\n options = defaults(options, {\n strict : false,\n filename : null,\n toplevel : null,\n expression : false,\n html5_comments : true,\n });\n\n var S = {\n input : (typeof $TEXT == \"string\"\n ? tokenizer($TEXT, options.filename,\n options.html5_comments)\n : $TEXT),\n token : null,\n prev : null,\n peeked : null,\n in_function : 0,\n in_directives : true,\n in_loop : 0,\n labels : []\n };\n\n S.token = next();\n\n function is(type, value) {\n return is_token(S.token, type, value);\n };\n\n function peek() { return S.peeked || (S.peeked = S.input()); };\n\n function next() {\n S.prev = S.token;\n if (S.peeked) {\n S.token = S.peeked;\n S.peeked = null;\n } else {\n S.token = S.input();\n }\n S.in_directives = S.in_directives && (\n S.token.type == \"string\" || is(\"punc\", \";\")\n );\n return S.token;\n };\n\n function prev() {\n return S.prev;\n };\n\n function croak(msg, line, col, pos) {\n var ctx = S.input.context();\n js_error(msg,\n ctx.filename,\n line != null ? line : ctx.tokline,\n col != null ? col : ctx.tokcol,\n pos != null ? pos : ctx.tokpos);\n };\n\n function token_error(token, msg) {\n croak(msg, token.line, token.col);\n };\n\n function unexpected(token) {\n if (token == null)\n token = S.token;\n token_error(token, \"Unexpected token: \" + token.type + \" (\" + token.value + \")\");\n };\n\n function expect_token(type, val) {\n if (is(type, val)) {\n return next();\n }\n token_error(S.token, \"Unexpected token \" + S.token.type + \" «\" + S.token.value + \"»\" + \", expected \" + type + \" «\" + val + \"»\");\n };\n\n function expect(punc) { return expect_token(\"punc\", punc); };\n\n function can_insert_semicolon() {\n return !options.strict && (\n S.token.nlb || is(\"eof\") || is(\"punc\", \"}\")\n );\n };\n\n function semicolon() {\n if (is(\"punc\", \";\")) next();\n else if (!can_insert_semicolon()) unexpected();\n };\n\n function parenthesised() {\n expect(\"(\");\n var exp = expression(true);\n expect(\")\");\n return exp;\n };\n\n function embed_tokens(parser) {\n return function() {\n var start = S.token;\n var expr = parser();\n var end = prev();\n expr.start = start;\n expr.end = end;\n return expr;\n };\n };\n\n function handle_regexp() {\n if (is(\"operator\", \"/\") || is(\"operator\", \"/=\")) {\n S.peeked = null;\n S.token = S.input(S.token.value.substr(1)); // force regexp\n }\n };\n\n var statement = embed_tokens(function() {\n var tmp;\n handle_regexp();\n switch (S.token.type) {\n case \"string\":\n var dir = S.in_directives, stat = simple_statement();\n // XXXv2: decide how to fix directives\n if (dir && stat.body instanceof AST_String && !is(\"punc\", \",\"))\n return new AST_Directive({ value: stat.body.value });\n return stat;\n case \"num\":\n case \"regexp\":\n case \"operator\":\n case \"atom\":\n return simple_statement();\n\n case \"name\":\n return is_token(peek(), \"punc\", \":\")\n ? labeled_statement()\n : simple_statement();\n\n case \"punc\":\n switch (S.token.value) {\n case \"{\":\n return new AST_BlockStatement({\n start : S.token,\n body : block_(),\n end : prev()\n });\n case \"[\":\n case \"(\":\n return simple_statement();\n case \";\":\n next();\n return new AST_EmptyStatement();\n default:\n unexpected();\n }\n\n case \"keyword\":\n switch (tmp = S.token.value, next(), tmp) {\n case \"break\":\n return break_cont(AST_Break);\n\n case \"continue\":\n return break_cont(AST_Continue);\n\n case \"debugger\":\n semicolon();\n return new AST_Debugger();\n\n case \"do\":\n return new AST_Do({\n body : in_loop(statement),\n condition : (expect_token(\"keyword\", \"while\"), tmp = parenthesised(), semicolon(), tmp)\n });\n\n case \"while\":\n return new AST_While({\n condition : parenthesised(),\n body : in_loop(statement)\n });\n\n case \"for\":\n return for_();\n\n case \"function\":\n return function_(AST_Defun);\n\n case \"if\":\n return if_();\n\n case \"return\":\n if (S.in_function == 0)\n croak(\"'return' outside of function\");\n return new AST_Return({\n value: ( is(\"punc\", \";\")\n ? (next(), null)\n : can_insert_semicolon()\n ? null\n : (tmp = expression(true), semicolon(), tmp) )\n });\n\n case \"switch\":\n return new AST_Switch({\n expression : parenthesised(),\n body : in_loop(switch_body_)\n });\n\n case \"throw\":\n if (S.token.nlb)\n croak(\"Illegal newline after 'throw'\");\n return new AST_Throw({\n value: (tmp = expression(true), semicolon(), tmp)\n });\n\n case \"try\":\n return try_();\n\n case \"var\":\n return tmp = var_(), semicolon(), tmp;\n\n case \"const\":\n return tmp = const_(), semicolon(), tmp;\n\n case \"with\":\n return new AST_With({\n expression : parenthesised(),\n body : statement()\n });\n\n default:\n unexpected();\n }\n }\n });\n\n function labeled_statement() {\n var label = as_symbol(AST_Label);\n if (find_if(function(l){ return l.name == label.name }, S.labels)) {\n // ECMA-262, 12.12: An ECMAScript program is considered\n // syntactically incorrect if it contains a\n // LabelledStatement that is enclosed by a\n // LabelledStatement with the same Identifier as label.\n croak(\"Label \" + label.name + \" defined twice\");\n }\n expect(\":\");\n S.labels.push(label);\n var stat = statement();\n S.labels.pop();\n if (!(stat instanceof AST_IterationStatement)) {\n // check for `continue` that refers to this label.\n // those should be reported as syntax errors.\n // https://github.com/mishoo/UglifyJS2/issues/287\n label.references.forEach(function(ref){\n if (ref instanceof AST_Continue) {\n ref = ref.label.start;\n croak(\"Continue label `\" + label.name + \"` refers to non-IterationStatement.\",\n ref.line, ref.col, ref.pos);\n }\n });\n }\n return new AST_LabeledStatement({ body: stat, label: label });\n };\n\n function simple_statement(tmp) {\n return new AST_SimpleStatement({ body: (tmp = expression(true), semicolon(), tmp) });\n };\n\n function break_cont(type) {\n var label = null, ldef;\n if (!can_insert_semicolon()) {\n label = as_symbol(AST_LabelRef, true);\n }\n if (label != null) {\n ldef = find_if(function(l){ return l.name == label.name }, S.labels);\n if (!ldef)\n croak(\"Undefined label \" + label.name);\n label.thedef = ldef;\n }\n else if (S.in_loop == 0)\n croak(type.TYPE + \" not inside a loop or switch\");\n semicolon();\n var stat = new type({ label: label });\n if (ldef) ldef.references.push(stat);\n return stat;\n };\n\n function for_() {\n expect(\"(\");\n var init = null;\n if (!is(\"punc\", \";\")) {\n init = is(\"keyword\", \"var\")\n ? (next(), var_(true))\n : expression(true, true);\n if (is(\"operator\", \"in\")) {\n if (init instanceof AST_Var && init.definitions.length > 1)\n croak(\"Only one variable declaration allowed in for..in loop\");\n next();\n return for_in(init);\n }\n }\n return regular_for(init);\n };\n\n function regular_for(init) {\n expect(\";\");\n var test = is(\"punc\", \";\") ? null : expression(true);\n expect(\";\");\n var step = is(\"punc\", \")\") ? null : expression(true);\n expect(\")\");\n return new AST_For({\n init : init,\n condition : test,\n step : step,\n body : in_loop(statement)\n });\n };\n\n function for_in(init) {\n var lhs = init instanceof AST_Var ? init.definitions[0].name : null;\n var obj = expression(true);\n expect(\")\");\n return new AST_ForIn({\n init : init,\n name : lhs,\n object : obj,\n body : in_loop(statement)\n });\n };\n\n var function_ = function(ctor) {\n var in_statement = ctor === AST_Defun;\n var name = is(\"name\") ? as_symbol(in_statement ? AST_SymbolDefun : AST_SymbolLambda) : null;\n if (in_statement && !name)\n unexpected();\n expect(\"(\");\n return new ctor({\n name: name,\n argnames: (function(first, a){\n while (!is(\"punc\", \")\")) {\n if (first) first = false; else expect(\",\");\n a.push(as_symbol(AST_SymbolFunarg));\n }\n next();\n return a;\n })(true, []),\n body: (function(loop, labels){\n ++S.in_function;\n S.in_directives = true;\n S.in_loop = 0;\n S.labels = [];\n var a = block_();\n --S.in_function;\n S.in_loop = loop;\n S.labels = labels;\n return a;\n })(S.in_loop, S.labels)\n });\n };\n\n function if_() {\n var cond = parenthesised(), body = statement(), belse = null;\n if (is(\"keyword\", \"else\")) {\n next();\n belse = statement();\n }\n return new AST_If({\n condition : cond,\n body : body,\n alternative : belse\n });\n };\n\n function block_() {\n expect(\"{\");\n var a = [];\n while (!is(\"punc\", \"}\")) {\n if (is(\"eof\")) unexpected();\n a.push(statement());\n }\n next();\n return a;\n };\n\n function switch_body_() {\n expect(\"{\");\n var a = [], cur = null, branch = null, tmp;\n while (!is(\"punc\", \"}\")) {\n if (is(\"eof\")) unexpected();\n if (is(\"keyword\", \"case\")) {\n if (branch) branch.end = prev();\n cur = [];\n branch = new AST_Case({\n start : (tmp = S.token, next(), tmp),\n expression : expression(true),\n body : cur\n });\n a.push(branch);\n expect(\":\");\n }\n else if (is(\"keyword\", \"default\")) {\n if (branch) branch.end = prev();\n cur = [];\n branch = new AST_Default({\n start : (tmp = S.token, next(), expect(\":\"), tmp),\n body : cur\n });\n a.push(branch);\n }\n else {\n if (!cur) unexpected();\n cur.push(statement());\n }\n }\n if (branch) branch.end = prev();\n next();\n return a;\n };\n\n function try_() {\n var body = block_(), bcatch = null, bfinally = null;\n if (is(\"keyword\", \"catch\")) {\n var start = S.token;\n next();\n expect(\"(\");\n var name = as_symbol(AST_SymbolCatch);\n expect(\")\");\n bcatch = new AST_Catch({\n start : start,\n argname : name,\n body : block_(),\n end : prev()\n });\n }\n if (is(\"keyword\", \"finally\")) {\n var start = S.token;\n next();\n bfinally = new AST_Finally({\n start : start,\n body : block_(),\n end : prev()\n });\n }\n if (!bcatch && !bfinally)\n croak(\"Missing catch/finally blocks\");\n return new AST_Try({\n body : body,\n bcatch : bcatch,\n bfinally : bfinally\n });\n };\n\n function vardefs(no_in, in_const) {\n var a = [];\n for (;;) {\n a.push(new AST_VarDef({\n start : S.token,\n name : as_symbol(in_const ? AST_SymbolConst : AST_SymbolVar),\n value : is(\"operator\", \"=\") ? (next(), expression(false, no_in)) : null,\n end : prev()\n }));\n if (!is(\"punc\", \",\"))\n break;\n next();\n }\n return a;\n };\n\n var var_ = function(no_in) {\n return new AST_Var({\n start : prev(),\n definitions : vardefs(no_in, false),\n end : prev()\n });\n };\n\n var const_ = function() {\n return new AST_Const({\n start : prev(),\n definitions : vardefs(false, true),\n end : prev()\n });\n };\n\n var new_ = function() {\n var start = S.token;\n expect_token(\"operator\", \"new\");\n var newexp = expr_atom(false), args;\n if (is(\"punc\", \"(\")) {\n next();\n args = expr_list(\")\");\n } else {\n args = [];\n }\n return subscripts(new AST_New({\n start : start,\n expression : newexp,\n args : args,\n end : prev()\n }), true);\n };\n\n function as_atom_node() {\n var tok = S.token, ret;\n switch (tok.type) {\n case \"name\":\n case \"keyword\":\n ret = _make_symbol(AST_SymbolRef);\n break;\n case \"num\":\n ret = new AST_Number({ start: tok, end: tok, value: tok.value });\n break;\n case \"string\":\n ret = new AST_String({ start: tok, end: tok, value: tok.value });\n break;\n case \"regexp\":\n ret = new AST_RegExp({ start: tok, end: tok, value: tok.value });\n break;\n case \"atom\":\n switch (tok.value) {\n case \"false\":\n ret = new AST_False({ start: tok, end: tok });\n break;\n case \"true\":\n ret = new AST_True({ start: tok, end: tok });\n break;\n case \"null\":\n ret = new AST_Null({ start: tok, end: tok });\n break;\n }\n break;\n }\n next();\n return ret;\n };\n\n var expr_atom = function(allow_calls) {\n if (is(\"operator\", \"new\")) {\n return new_();\n }\n var start = S.token;\n if (is(\"punc\")) {\n switch (start.value) {\n case \"(\":\n next();\n var ex = expression(true);\n ex.start = start;\n ex.end = S.token;\n expect(\")\");\n return subscripts(ex, allow_calls);\n case \"[\":\n return subscripts(array_(), allow_calls);\n case \"{\":\n return subscripts(object_(), allow_calls);\n }\n unexpected();\n }\n if (is(\"keyword\", \"function\")) {\n next();\n var func = function_(AST_Function);\n func.start = start;\n func.end = prev();\n return subscripts(func, allow_calls);\n }\n if (ATOMIC_START_TOKEN[S.token.type]) {\n return subscripts(as_atom_node(), allow_calls);\n }\n unexpected();\n };\n\n function expr_list(closing, allow_trailing_comma, allow_empty) {\n var first = true, a = [];\n while (!is(\"punc\", closing)) {\n if (first) first = false; else expect(\",\");\n if (allow_trailing_comma && is(\"punc\", closing)) break;\n if (is(\"punc\", \",\") && allow_empty) {\n a.push(new AST_Hole({ start: S.token, end: S.token }));\n } else {\n a.push(expression(false));\n }\n }\n next();\n return a;\n };\n\n var array_ = embed_tokens(function() {\n expect(\"[\");\n return new AST_Array({\n elements: expr_list(\"]\", !options.strict, true)\n });\n });\n\n var object_ = embed_tokens(function() {\n expect(\"{\");\n var first = true, a = [];\n while (!is(\"punc\", \"}\")) {\n if (first) first = false; else expect(\",\");\n if (!options.strict && is(\"punc\", \"}\"))\n // allow trailing comma\n break;\n var start = S.token;\n var type = start.type;\n var name = as_property_name();\n if (type == \"name\" && !is(\"punc\", \":\")) {\n if (name == \"get\") {\n a.push(new AST_ObjectGetter({\n start : start,\n key : as_atom_node(),\n value : function_(AST_Accessor),\n end : prev()\n }));\n continue;\n }\n if (name == \"set\") {\n a.push(new AST_ObjectSetter({\n start : start,\n key : as_atom_node(),\n value : function_(AST_Accessor),\n end : prev()\n }));\n continue;\n }\n }\n expect(\":\");\n a.push(new AST_ObjectKeyVal({\n start : start,\n key : name,\n value : expression(false),\n end : prev()\n }));\n }\n next();\n return new AST_Object({ properties: a });\n });\n\n function as_property_name() {\n var tmp = S.token;\n next();\n switch (tmp.type) {\n case \"num\":\n case \"string\":\n case \"name\":\n case \"operator\":\n case \"keyword\":\n case \"atom\":\n return tmp.value;\n default:\n unexpected();\n }\n };\n\n function as_name() {\n var tmp = S.token;\n next();\n switch (tmp.type) {\n case \"name\":\n case \"operator\":\n case \"keyword\":\n case \"atom\":\n return tmp.value;\n default:\n unexpected();\n }\n };\n\n function _make_symbol(type) {\n var name = S.token.value;\n return new (name == \"this\" ? AST_This : type)({\n name : String(name),\n start : S.token,\n end : S.token\n });\n };\n\n function as_symbol(type, noerror) {\n if (!is(\"name\")) {\n if (!noerror) croak(\"Name expected\");\n return null;\n }\n var sym = _make_symbol(type);\n next();\n return sym;\n };\n\n var subscripts = function(expr, allow_calls) {\n var start = expr.start;\n if (is(\"punc\", \".\")) {\n next();\n return subscripts(new AST_Dot({\n start : start,\n expression : expr,\n property : as_name(),\n end : prev()\n }), allow_calls);\n }\n if (is(\"punc\", \"[\")) {\n next();\n var prop = expression(true);\n expect(\"]\");\n return subscripts(new AST_Sub({\n start : start,\n expression : expr,\n property : prop,\n end : prev()\n }), allow_calls);\n }\n if (allow_calls && is(\"punc\", \"(\")) {\n next();\n return subscripts(new AST_Call({\n start : start,\n expression : expr,\n args : expr_list(\")\"),\n end : prev()\n }), true);\n }\n return expr;\n };\n\n var maybe_unary = function(allow_calls) {\n var start = S.token;\n if (is(\"operator\") && UNARY_PREFIX(start.value)) {\n next();\n handle_regexp();\n var ex = make_unary(AST_UnaryPrefix, start.value, maybe_unary(allow_calls));\n ex.start = start;\n ex.end = prev();\n return ex;\n }\n var val = expr_atom(allow_calls);\n while (is(\"operator\") && UNARY_POSTFIX(S.token.value) && !S.token.nlb) {\n val = make_unary(AST_UnaryPostfix, S.token.value, val);\n val.start = start;\n val.end = S.token;\n next();\n }\n return val;\n };\n\n function make_unary(ctor, op, expr) {\n if ((op == \"++\" || op == \"--\") && !is_assignable(expr))\n croak(\"Invalid use of \" + op + \" operator\");\n return new ctor({ operator: op, expression: expr });\n };\n\n var expr_op = function(left, min_prec, no_in) {\n var op = is(\"operator\") ? S.token.value : null;\n if (op == \"in\" && no_in) op = null;\n var prec = op != null ? PRECEDENCE[op] : null;\n if (prec != null && prec > min_prec) {\n next();\n var right = expr_op(maybe_unary(true), prec, no_in);\n return expr_op(new AST_Binary({\n start : left.start,\n left : left,\n operator : op,\n right : right,\n end : right.end\n }), min_prec, no_in);\n }\n return left;\n };\n\n function expr_ops(no_in) {\n return expr_op(maybe_unary(true), 0, no_in);\n };\n\n var maybe_conditional = function(no_in) {\n var start = S.token;\n var expr = expr_ops(no_in);\n if (is(\"operator\", \"?\")) {\n next();\n var yes = expression(false);\n expect(\":\");\n return new AST_Conditional({\n start : start,\n condition : expr,\n consequent : yes,\n alternative : expression(false, no_in),\n end : prev()\n });\n }\n return expr;\n };\n\n function is_assignable(expr) {\n if (!options.strict) return true;\n if (expr instanceof AST_This) return false;\n return (expr instanceof AST_PropAccess || expr instanceof AST_Symbol);\n };\n\n var maybe_assign = function(no_in) {\n var start = S.token;\n var left = maybe_conditional(no_in), val = S.token.value;\n if (is(\"operator\") && ASSIGNMENT(val)) {\n if (is_assignable(left)) {\n next();\n return new AST_Assign({\n start : start,\n left : left,\n operator : val,\n right : maybe_assign(no_in),\n end : prev()\n });\n }\n croak(\"Invalid assignment\");\n }\n return left;\n };\n\n var expression = function(commas, no_in) {\n var start = S.token;\n var expr = maybe_assign(no_in);\n if (commas && is(\"punc\", \",\")) {\n next();\n return new AST_Seq({\n start : start,\n car : expr,\n cdr : expression(true, no_in),\n end : peek()\n });\n }\n return expr;\n };\n\n function in_loop(cont) {\n ++S.in_loop;\n var ret = cont();\n --S.in_loop;\n return ret;\n };\n\n if (options.expression) {\n return expression(true);\n }\n\n return (function(){\n var start = S.token;\n var body = [];\n while (!is(\"eof\"))\n body.push(statement());\n var end = prev();\n var toplevel = options.toplevel;\n if (toplevel) {\n toplevel.body = toplevel.body.concat(body);\n toplevel.end = end;\n } else {\n toplevel = new AST_Toplevel({ start: start, body: body, end: end });\n }\n return toplevel;\n })();\n\n};\n\n/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n <[email protected]>\n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon <[email protected]>\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\n// Tree transformer helpers.\n\nfunction TreeTransformer(before, after) {\n TreeWalker.call(this);\n this.before = before;\n this.after = after;\n}\nTreeTransformer.prototype = new TreeWalker;\n\n(function(undefined){\n\n function _(node, descend) {\n node.DEFMETHOD(\"transform\", function(tw, in_list){\n var x, y;\n tw.push(this);\n if (tw.before) x = tw.before(this, descend, in_list);\n if (x === undefined) {\n if (!tw.after) {\n x = this;\n descend(x, tw);\n } else {\n tw.stack[tw.stack.length - 1] = x = this.clone();\n descend(x, tw);\n y = tw.after(x, in_list);\n if (y !== undefined) x = y;\n }\n }\n tw.pop();\n return x;\n });\n };\n\n function do_list(list, tw) {\n return MAP(list, function(node){\n return node.transform(tw, true);\n });\n };\n\n _(AST_Node, noop);\n\n _(AST_LabeledStatement, function(self, tw){\n self.label = self.label.transform(tw);\n self.body = self.body.transform(tw);\n });\n\n _(AST_SimpleStatement, function(self, tw){\n self.body = self.body.transform(tw);\n });\n\n _(AST_Block, function(self, tw){\n self.body = do_list(self.body, tw);\n });\n\n _(AST_DWLoop, function(self, tw){\n self.condition = self.condition.transform(tw);\n self.body = self.body.transform(tw);\n });\n\n _(AST_For, function(self, tw){\n if (self.init) self.init = self.init.transform(tw);\n if (self.condition) self.condition = self.condition.transform(tw);\n if (self.step) self.step = self.step.transform(tw);\n self.body = self.body.transform(tw);\n });\n\n _(AST_ForIn, function(self, tw){\n self.init = self.init.transform(tw);\n self.object = self.object.transform(tw);\n self.body = self.body.transform(tw);\n });\n\n _(AST_With, function(self, tw){\n self.expression = self.expression.transform(tw);\n self.body = self.body.transform(tw);\n });\n\n _(AST_Exit, function(self, tw){\n if (self.value) self.value = self.value.transform(tw);\n });\n\n _(AST_LoopControl, function(self, tw){\n if (self.label) self.label = self.label.transform(tw);\n });\n\n _(AST_If, function(self, tw){\n self.condition = self.condition.transform(tw);\n self.body = self.body.transform(tw);\n if (self.alternative) self.alternative = self.alternative.transform(tw);\n });\n\n _(AST_Switch, function(self, tw){\n self.expression = self.expression.transform(tw);\n self.body = do_list(self.body, tw);\n });\n\n _(AST_Case, function(self, tw){\n self.expression = self.expression.transform(tw);\n self.body = do_list(self.body, tw);\n });\n\n _(AST_Try, function(self, tw){\n self.body = do_list(self.body, tw);\n if (self.bcatch) self.bcatch = self.bcatch.transform(tw);\n if (self.bfinally) self.bfinally = self.bfinally.transform(tw);\n });\n\n _(AST_Catch, function(self, tw){\n self.argname = self.argname.transform(tw);\n self.body = do_list(self.body, tw);\n });\n\n _(AST_Definitions, function(self, tw){\n self.definitions = do_list(self.definitions, tw);\n });\n\n _(AST_VarDef, function(self, tw){\n self.name = self.name.transform(tw);\n if (self.value) self.value = self.value.transform(tw);\n });\n\n _(AST_Lambda, function(self, tw){\n if (self.name) self.name = self.name.transform(tw);\n self.argnames = do_list(self.argnames, tw);\n self.body = do_list(self.body, tw);\n });\n\n _(AST_Call, function(self, tw){\n self.expression = self.expression.transform(tw);\n self.args = do_list(self.args, tw);\n });\n\n _(AST_Seq, function(self, tw){\n self.car = self.car.transform(tw);\n self.cdr = self.cdr.transform(tw);\n });\n\n _(AST_Dot, function(self, tw){\n self.expression = self.expression.transform(tw);\n });\n\n _(AST_Sub, function(self, tw){\n self.expression = self.expression.transform(tw);\n self.property = self.property.transform(tw);\n });\n\n _(AST_Unary, function(self, tw){\n self.expression = self.expression.transform(tw);\n });\n\n _(AST_Binary, function(self, tw){\n self.left = self.left.transform(tw);\n self.right = self.right.transform(tw);\n });\n\n _(AST_Conditional, function(self, tw){\n self.condition = self.condition.transform(tw);\n self.consequent = self.consequent.transform(tw);\n self.alternative = self.alternative.transform(tw);\n });\n\n _(AST_Array, function(self, tw){\n self.elements = do_list(self.elements, tw);\n });\n\n _(AST_Object, function(self, tw){\n self.properties = do_list(self.properties, tw);\n });\n\n _(AST_ObjectProperty, function(self, tw){\n self.value = self.value.transform(tw);\n });\n\n})();\n\n/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n <[email protected]>\n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon <[email protected]>\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\nfunction SymbolDef(scope, index, orig) {\n this.name = orig.name;\n this.orig = [ orig ];\n this.scope = scope;\n this.references = [];\n this.global = false;\n this.mangled_name = null;\n this.undeclared = false;\n this.constant = false;\n this.index = index;\n};\n\nSymbolDef.prototype = {\n unmangleable: function(options) {\n return (this.global && !(options && options.toplevel))\n || this.undeclared\n || (!(options && options.eval) && (this.scope.uses_eval || this.scope.uses_with));\n },\n mangle: function(options) {\n if (!this.mangled_name && !this.unmangleable(options)) {\n var s = this.scope;\n if (!options.screw_ie8 && this.orig[0] instanceof AST_SymbolLambda)\n s = s.parent_scope;\n this.mangled_name = s.next_mangled(options, this);\n }\n }\n};\n\nAST_Toplevel.DEFMETHOD(\"figure_out_scope\", function(options){\n options = defaults(options, {\n screw_ie8: false\n });\n\n // pass 1: setup scope chaining and handle definitions\n var self = this;\n var scope = self.parent_scope = null;\n var defun = null;\n var nesting = 0;\n var tw = new TreeWalker(function(node, descend){\n if (options.screw_ie8 && node instanceof AST_Catch) {\n var save_scope = scope;\n scope = new AST_Scope(node);\n scope.init_scope_vars(nesting);\n scope.parent_scope = save_scope;\n descend();\n scope = save_scope;\n return true;\n }\n if (node instanceof AST_Scope) {\n node.init_scope_vars(nesting);\n var save_scope = node.parent_scope = scope;\n var save_defun = defun;\n defun = scope = node;\n ++nesting; descend(); --nesting;\n scope = save_scope;\n defun = save_defun;\n return true; // don't descend again in TreeWalker\n }\n if (node instanceof AST_Directive) {\n node.scope = scope;\n push_uniq(scope.directives, node.value);\n return true;\n }\n if (node instanceof AST_With) {\n for (var s = scope; s; s = s.parent_scope)\n s.uses_with = true;\n return;\n }\n if (node instanceof AST_Symbol) {\n node.scope = scope;\n }\n if (node instanceof AST_SymbolLambda) {\n defun.def_function(node);\n }\n else if (node instanceof AST_SymbolDefun) {\n // Careful here, the scope where this should be defined is\n // the parent scope. The reason is that we enter a new\n // scope when we encounter the AST_Defun node (which is\n // instanceof AST_Scope) but we get to the symbol a bit\n // later.\n (node.scope = defun.parent_scope).def_function(node);\n }\n else if (node instanceof AST_SymbolVar\n || node instanceof AST_SymbolConst) {\n var def = defun.def_variable(node);\n def.constant = node instanceof AST_SymbolConst;\n def.init = tw.parent().value;\n }\n else if (node instanceof AST_SymbolCatch) {\n (options.screw_ie8 ? scope : defun)\n .def_variable(node);\n }\n });\n self.walk(tw);\n\n // pass 2: find back references and eval\n var func = null;\n var globals = self.globals = new Dictionary();\n var tw = new TreeWalker(function(node, descend){\n if (node instanceof AST_Lambda) {\n var prev_func = func;\n func = node;\n descend();\n func = prev_func;\n return true;\n }\n if (node instanceof AST_SymbolRef) {\n var name = node.name;\n var sym = node.scope.find_variable(name);\n if (!sym) {\n var g;\n if (globals.has(name)) {\n g = globals.get(name);\n } else {\n g = new SymbolDef(self, globals.size(), node);\n g.undeclared = true;\n g.global = true;\n globals.set(name, g);\n }\n node.thedef = g;\n if (name == \"eval\" && tw.parent() instanceof AST_Call) {\n for (var s = node.scope; s && !s.uses_eval; s = s.parent_scope)\n s.uses_eval = true;\n }\n if (func && name == \"arguments\") {\n func.uses_arguments = true;\n }\n } else {\n node.thedef = sym;\n }\n node.reference();\n return true;\n }\n });\n self.walk(tw);\n});\n\nAST_Scope.DEFMETHOD(\"init_scope_vars\", function(nesting){\n this.directives = []; // contains the directives defined in this scope, i.e. \"use strict\"\n this.variables = new Dictionary(); // map name to AST_SymbolVar (variables defined in this scope; includes functions)\n this.functions = new Dictionary(); // map name to AST_SymbolDefun (functions defined in this scope)\n this.uses_with = false; // will be set to true if this or some nested scope uses the `with` statement\n this.uses_eval = false; // will be set to true if this or nested scope uses the global `eval`\n this.parent_scope = null; // the parent scope\n this.enclosed = []; // a list of variables from this or outer scope(s) that are referenced from this or inner scopes\n this.cname = -1; // the current index for mangling functions/variables\n this.nesting = nesting; // the nesting level of this scope (0 means toplevel)\n});\n\nAST_Scope.DEFMETHOD(\"strict\", function(){\n return this.has_directive(\"use strict\");\n});\n\nAST_Lambda.DEFMETHOD(\"init_scope_vars\", function(){\n AST_Scope.prototype.init_scope_vars.apply(this, arguments);\n this.uses_arguments = false;\n});\n\nAST_SymbolRef.DEFMETHOD(\"reference\", function() {\n var def = this.definition();\n def.references.push(this);\n var s = this.scope;\n while (s) {\n push_uniq(s.enclosed, def);\n if (s === def.scope) break;\n s = s.parent_scope;\n }\n this.frame = this.scope.nesting - def.scope.nesting;\n});\n\nAST_Scope.DEFMETHOD(\"find_variable\", function(name){\n if (name instanceof AST_Symbol) name = name.name;\n return this.variables.get(name)\n || (this.parent_scope && this.parent_scope.find_variable(name));\n});\n\nAST_Scope.DEFMETHOD(\"has_directive\", function(value){\n return this.parent_scope && this.parent_scope.has_directive(value)\n || (this.directives.indexOf(value) >= 0 ? this : null);\n});\n\nAST_Scope.DEFMETHOD(\"def_function\", function(symbol){\n this.functions.set(symbol.name, this.def_variable(symbol));\n});\n\nAST_Scope.DEFMETHOD(\"def_variable\", function(symbol){\n var def;\n if (!this.variables.has(symbol.name)) {\n def = new SymbolDef(this, this.variables.size(), symbol);\n this.variables.set(symbol.name, def);\n def.global = !this.parent_scope;\n } else {\n def = this.variables.get(symbol.name);\n def.orig.push(symbol);\n }\n return symbol.thedef = def;\n});\n\nAST_Scope.DEFMETHOD(\"next_mangled\", function(options){\n var ext = this.enclosed;\n out: while (true) {\n var m = base54(++this.cname);\n if (!is_identifier(m)) continue; // skip over \"do\"\n\n // https://github.com/mishoo/UglifyJS2/issues/242 -- do not\n // shadow a name excepted from mangling.\n if (options.except.indexOf(m) >= 0) continue;\n\n // we must ensure that the mangled name does not shadow a name\n // from some parent scope that is referenced in this or in\n // inner scopes.\n for (var i = ext.length; --i >= 0;) {\n var sym = ext[i];\n var name = sym.mangled_name || (sym.unmangleable(options) && sym.name);\n if (m == name) continue out;\n }\n return m;\n }\n});\n\nAST_Function.DEFMETHOD(\"next_mangled\", function(options, def){\n // #179, #326\n // in Safari strict mode, something like (function x(x){...}) is a syntax error;\n // a function expression's argument cannot shadow the function expression's name\n\n var tricky_def = def.orig[0] instanceof AST_SymbolFunarg && this.name && this.name.definition();\n while (true) {\n var name = AST_Lambda.prototype.next_mangled.call(this, options, def);\n if (!(tricky_def && tricky_def.mangled_name == name))\n return name;\n }\n});\n\nAST_Scope.DEFMETHOD(\"references\", function(sym){\n if (sym instanceof AST_Symbol) sym = sym.definition();\n return this.enclosed.indexOf(sym) < 0 ? null : sym;\n});\n\nAST_Symbol.DEFMETHOD(\"unmangleable\", function(options){\n return this.definition().unmangleable(options);\n});\n\n// property accessors are not mangleable\nAST_SymbolAccessor.DEFMETHOD(\"unmangleable\", function(){\n return true;\n});\n\n// labels are always mangleable\nAST_Label.DEFMETHOD(\"unmangleable\", function(){\n return false;\n});\n\nAST_Symbol.DEFMETHOD(\"unreferenced\", function(){\n return this.definition().references.length == 0\n && !(this.scope.uses_eval || this.scope.uses_with);\n});\n\nAST_Symbol.DEFMETHOD(\"undeclared\", function(){\n return this.definition().undeclared;\n});\n\nAST_LabelRef.DEFMETHOD(\"undeclared\", function(){\n return false;\n});\n\nAST_Label.DEFMETHOD(\"undeclared\", function(){\n return false;\n});\n\nAST_Symbol.DEFMETHOD(\"definition\", function(){\n return this.thedef;\n});\n\nAST_Symbol.DEFMETHOD(\"global\", function(){\n return this.definition().global;\n});\n\nAST_Toplevel.DEFMETHOD(\"_default_mangler_options\", function(options){\n return defaults(options, {\n except : [],\n eval : false,\n sort : false,\n toplevel : false,\n screw_ie8 : false\n });\n});\n\nAST_Toplevel.DEFMETHOD(\"mangle_names\", function(options){\n options = this._default_mangler_options(options);\n // We only need to mangle declaration nodes. Special logic wired\n // into the code generator will display the mangled name if it's\n // present (and for AST_SymbolRef-s it'll use the mangled name of\n // the AST_SymbolDeclaration that it points to).\n var lname = -1;\n var to_mangle = [];\n var tw = new TreeWalker(function(node, descend){\n if (node instanceof AST_LabeledStatement) {\n // lname is incremented when we get to the AST_Label\n var save_nesting = lname;\n descend();\n lname = save_nesting;\n return true; // don't descend again in TreeWalker\n }\n if (node instanceof AST_Scope) {\n var p = tw.parent(), a = [];\n node.variables.each(function(symbol){\n if (options.except.indexOf(symbol.name) < 0) {\n a.push(symbol);\n }\n });\n if (options.sort) a.sort(function(a, b){\n return b.references.length - a.references.length;\n });\n to_mangle.push.apply(to_mangle, a);\n return;\n }\n if (node instanceof AST_Label) {\n var name;\n do name = base54(++lname); while (!is_identifier(name));\n node.mangled_name = name;\n return true;\n }\n if (options.screw_ie8 && node instanceof AST_SymbolCatch) {\n to_mangle.push(node.definition());\n return;\n }\n });\n this.walk(tw);\n to_mangle.forEach(function(def){ def.mangle(options) });\n});\n\nAST_Toplevel.DEFMETHOD(\"compute_char_frequency\", function(options){\n options = this._default_mangler_options(options);\n var tw = new TreeWalker(function(node){\n if (node instanceof AST_Constant)\n base54.consider(node.print_to_string());\n else if (node instanceof AST_Return)\n base54.consider(\"return\");\n else if (node instanceof AST_Throw)\n base54.consider(\"throw\");\n else if (node instanceof AST_Continue)\n base54.consider(\"continue\");\n else if (node instanceof AST_Break)\n base54.consider(\"break\");\n else if (node instanceof AST_Debugger)\n base54.consider(\"debugger\");\n else if (node instanceof AST_Directive)\n base54.consider(node.value);\n else if (node instanceof AST_While)\n base54.consider(\"while\");\n else if (node instanceof AST_Do)\n base54.consider(\"do while\");\n else if (node instanceof AST_If) {\n base54.consider(\"if\");\n if (node.alternative) base54.consider(\"else\");\n }\n else if (node instanceof AST_Var)\n base54.consider(\"var\");\n else if (node instanceof AST_Const)\n base54.consider(\"const\");\n else if (node instanceof AST_Lambda)\n base54.consider(\"function\");\n else if (node instanceof AST_For)\n base54.consider(\"for\");\n else if (node instanceof AST_ForIn)\n base54.consider(\"for in\");\n else if (node instanceof AST_Switch)\n base54.consider(\"switch\");\n else if (node instanceof AST_Case)\n base54.consider(\"case\");\n else if (node instanceof AST_Default)\n base54.consider(\"default\");\n else if (node instanceof AST_With)\n base54.consider(\"with\");\n else if (node instanceof AST_ObjectSetter)\n base54.consider(\"set\" + node.key);\n else if (node instanceof AST_ObjectGetter)\n base54.consider(\"get\" + node.key);\n else if (node instanceof AST_ObjectKeyVal)\n base54.consider(node.key);\n else if (node instanceof AST_New)\n base54.consider(\"new\");\n else if (node instanceof AST_This)\n base54.consider(\"this\");\n else if (node instanceof AST_Try)\n base54.consider(\"try\");\n else if (node instanceof AST_Catch)\n base54.consider(\"catch\");\n else if (node instanceof AST_Finally)\n base54.consider(\"finally\");\n else if (node instanceof AST_Symbol && node.unmangleable(options))\n base54.consider(node.name);\n else if (node instanceof AST_Unary || node instanceof AST_Binary)\n base54.consider(node.operator);\n else if (node instanceof AST_Dot)\n base54.consider(node.property);\n });\n this.walk(tw);\n base54.sort();\n});\n\nvar base54 = (function() {\n var string = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_0123456789\";\n var chars, frequency;\n function reset() {\n frequency = Object.create(null);\n chars = string.split(\"\").map(function(ch){ return ch.charCodeAt(0) });\n chars.forEach(function(ch){ frequency[ch] = 0 });\n }\n base54.consider = function(str){\n for (var i = str.length; --i >= 0;) {\n var code = str.charCodeAt(i);\n if (code in frequency) ++frequency[code];\n }\n };\n base54.sort = function() {\n chars = mergeSort(chars, function(a, b){\n if (is_digit(a) && !is_digit(b)) return 1;\n if (is_digit(b) && !is_digit(a)) return -1;\n return frequency[b] - frequency[a];\n });\n };\n base54.reset = reset;\n reset();\n base54.get = function(){ return chars };\n base54.freq = function(){ return frequency };\n function base54(num) {\n var ret = \"\", base = 54;\n do {\n ret += String.fromCharCode(chars[num % base]);\n num = Math.floor(num / base);\n base = 64;\n } while (num > 0);\n return ret;\n };\n return base54;\n})();\n\nAST_Toplevel.DEFMETHOD(\"scope_warnings\", function(options){\n options = defaults(options, {\n undeclared : false, // this makes a lot of noise\n unreferenced : true,\n assign_to_global : true,\n func_arguments : true,\n nested_defuns : true,\n eval : true\n });\n var tw = new TreeWalker(function(node){\n if (options.undeclared\n && node instanceof AST_SymbolRef\n && node.undeclared())\n {\n // XXX: this also warns about JS standard names,\n // i.e. Object, Array, parseInt etc. Should add a list of\n // exceptions.\n AST_Node.warn(\"Undeclared symbol: {name} [{file}:{line},{col}]\", {\n name: node.name,\n file: node.start.file,\n line: node.start.line,\n col: node.start.col\n });\n }\n if (options.assign_to_global)\n {\n var sym = null;\n if (node instanceof AST_Assign && node.left instanceof AST_SymbolRef)\n sym = node.left;\n else if (node instanceof AST_ForIn && node.init instanceof AST_SymbolRef)\n sym = node.init;\n if (sym\n && (sym.undeclared()\n || (sym.global() && sym.scope !== sym.definition().scope))) {\n AST_Node.warn(\"{msg}: {name} [{file}:{line},{col}]\", {\n msg: sym.undeclared() ? \"Accidental global?\" : \"Assignment to global\",\n name: sym.name,\n file: sym.start.file,\n line: sym.start.line,\n col: sym.start.col\n });\n }\n }\n if (options.eval\n && node instanceof AST_SymbolRef\n && node.undeclared()\n && node.name == \"eval\") {\n AST_Node.warn(\"Eval is used [{file}:{line},{col}]\", node.start);\n }\n if (options.unreferenced\n && (node instanceof AST_SymbolDeclaration || node instanceof AST_Label)\n && node.unreferenced()) {\n AST_Node.warn(\"{type} {name} is declared but not referenced [{file}:{line},{col}]\", {\n type: node instanceof AST_Label ? \"Label\" : \"Symbol\",\n name: node.name,\n file: node.start.file,\n line: node.start.line,\n col: node.start.col\n });\n }\n if (options.func_arguments\n && node instanceof AST_Lambda\n && node.uses_arguments) {\n AST_Node.warn(\"arguments used in function {name} [{file}:{line},{col}]\", {\n name: node.name ? node.name.name : \"anonymous\",\n file: node.start.file,\n line: node.start.line,\n col: node.start.col\n });\n }\n if (options.nested_defuns\n && node instanceof AST_Defun\n && !(tw.parent() instanceof AST_Scope)) {\n AST_Node.warn(\"Function {name} declared in nested statement \\\"{type}\\\" [{file}:{line},{col}]\", {\n name: node.name.name,\n type: tw.parent().TYPE,\n file: node.start.file,\n line: node.start.line,\n col: node.start.col\n });\n }\n });\n this.walk(tw);\n});\n\n/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n <[email protected]>\n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon <[email protected]>\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\nfunction OutputStream(options) {\n\n options = defaults(options, {\n indent_start : 0,\n indent_level : 4,\n quote_keys : false,\n space_colon : true,\n ascii_only : false,\n unescape_regexps : false,\n inline_script : false,\n width : 80,\n max_line_len : 32000,\n beautify : false,\n source_map : null,\n bracketize : false,\n semicolons : true,\n comments : false,\n preserve_line : false,\n screw_ie8 : false,\n preamble : null,\n }, true);\n\n var indentation = 0;\n var current_col = 0;\n var current_line = 1;\n var current_pos = 0;\n var OUTPUT = \"\";\n\n function to_ascii(str, identifier) {\n return str.replace(/[\\u0080-\\uffff]/g, function(ch) {\n var code = ch.charCodeAt(0).toString(16);\n if (code.length <= 2 && !identifier) {\n while (code.length < 2) code = \"0\" + code;\n return \"\\\\x\" + code;\n } else {\n while (code.length < 4) code = \"0\" + code;\n return \"\\\\u\" + code;\n }\n });\n };\n\n function make_string(str) {\n var dq = 0, sq = 0;\n str = str.replace(/[\\\\\\b\\f\\n\\r\\t\\x22\\x27\\u2028\\u2029\\0]/g, function(s){\n switch (s) {\n case \"\\\\\": return \"\\\\\\\\\";\n case \"\\b\": return \"\\\\b\";\n case \"\\f\": return \"\\\\f\";\n case \"\\n\": return \"\\\\n\";\n case \"\\r\": return \"\\\\r\";\n case \"\\u2028\": return \"\\\\u2028\";\n case \"\\u2029\": return \"\\\\u2029\";\n case '\"': ++dq; return '\"';\n case \"'\": ++sq; return \"'\";\n case \"\\0\": return \"\\\\x00\";\n }\n return s;\n });\n if (options.ascii_only) str = to_ascii(str);\n if (dq > sq) return \"'\" + str.replace(/\\x27/g, \"\\\\'\") + \"'\";\n else return '\"' + str.replace(/\\x22/g, '\\\\\"') + '\"';\n };\n\n function encode_string(str) {\n var ret = make_string(str);\n if (options.inline_script)\n ret = ret.replace(/<\\x2fscript([>\\/\\t\\n\\f\\r ])/gi, \"<\\\\/script$1\");\n return ret;\n };\n\n function make_name(name) {\n name = name.toString();\n if (options.ascii_only)\n name = to_ascii(name, true);\n return name;\n };\n\n function make_indent(back) {\n return repeat_string(\" \", options.indent_start + indentation - back * options.indent_level);\n };\n\n /* -----[ beautification/minification ]----- */\n\n var might_need_space = false;\n var might_need_semicolon = false;\n var last = null;\n\n function last_char() {\n return last.charAt(last.length - 1);\n };\n\n function maybe_newline() {\n if (options.max_line_len && current_col > options.max_line_len)\n print(\"\\n\");\n };\n\n var requireSemicolonChars = makePredicate(\"( [ + * / - , .\");\n\n function print(str) {\n str = String(str);\n var ch = str.charAt(0);\n if (might_need_semicolon) {\n if ((!ch || \";}\".indexOf(ch) < 0) && !/[;]$/.test(last)) {\n if (options.semicolons || requireSemicolonChars(ch)) {\n OUTPUT += \";\";\n current_col++;\n current_pos++;\n } else {\n OUTPUT += \"\\n\";\n current_pos++;\n current_line++;\n current_col = 0;\n }\n if (!options.beautify)\n might_need_space = false;\n }\n might_need_semicolon = false;\n maybe_newline();\n }\n\n if (!options.beautify && options.preserve_line && stack[stack.length - 1]) {\n var target_line = stack[stack.length - 1].start.line;\n while (current_line < target_line) {\n OUTPUT += \"\\n\";\n current_pos++;\n current_line++;\n current_col = 0;\n might_need_space = false;\n }\n }\n\n if (might_need_space) {\n var prev = last_char();\n if ((is_identifier_char(prev)\n && (is_identifier_char(ch) || ch == \"\\\\\"))\n || (/^[\\+\\-\\/]$/.test(ch) && ch == prev))\n {\n OUTPUT += \" \";\n current_col++;\n current_pos++;\n }\n might_need_space = false;\n }\n var a = str.split(/\\r?\\n/), n = a.length - 1;\n current_line += n;\n if (n == 0) {\n current_col += a[n].length;\n } else {\n current_col = a[n].length;\n }\n current_pos += str.length;\n last = str;\n OUTPUT += str;\n };\n\n var space = options.beautify ? function() {\n print(\" \");\n } : function() {\n might_need_space = true;\n };\n\n var indent = options.beautify ? function(half) {\n if (options.beautify) {\n print(make_indent(half ? 0.5 : 0));\n }\n } : noop;\n\n var with_indent = options.beautify ? function(col, cont) {\n if (col === true) col = next_indent();\n var save_indentation = indentation;\n indentation = col;\n var ret = cont();\n indentation = save_indentation;\n return ret;\n } : function(col, cont) { return cont() };\n\n var newline = options.beautify ? function() {\n print(\"\\n\");\n } : noop;\n\n var semicolon = options.beautify ? function() {\n print(\";\");\n } : function() {\n might_need_semicolon = true;\n };\n\n function force_semicolon() {\n might_need_semicolon = false;\n print(\";\");\n };\n\n function next_indent() {\n return indentation + options.indent_level;\n };\n\n function with_block(cont) {\n var ret;\n print(\"{\");\n newline();\n with_indent(next_indent(), function(){\n ret = cont();\n });\n indent();\n print(\"}\");\n return ret;\n };\n\n function with_parens(cont) {\n print(\"(\");\n //XXX: still nice to have that for argument lists\n //var ret = with_indent(current_col, cont);\n var ret = cont();\n print(\")\");\n return ret;\n };\n\n function with_square(cont) {\n print(\"[\");\n //var ret = with_indent(current_col, cont);\n var ret = cont();\n print(\"]\");\n return ret;\n };\n\n function comma() {\n print(\",\");\n space();\n };\n\n function colon() {\n print(\":\");\n if (options.space_colon) space();\n };\n\n var add_mapping = options.source_map ? function(token, name) {\n try {\n if (token) options.source_map.add(\n token.file || \"?\",\n current_line, current_col,\n token.line, token.col,\n (!name && token.type == \"name\") ? token.value : name\n );\n } catch(ex) {\n AST_Node.warn(\"Couldn't figure out mapping for {file}:{line},{col} → {cline},{ccol} [{name}]\", {\n file: token.file,\n line: token.line,\n col: token.col,\n cline: current_line,\n ccol: current_col,\n name: name || \"\"\n })\n }\n } : noop;\n\n function get() {\n return OUTPUT;\n };\n\n if (options.preamble) {\n print(options.preamble.replace(/\\r\\n?|[\\n\\u2028\\u2029]|\\s*$/g, \"\\n\"));\n }\n\n var stack = [];\n return {\n get : get,\n toString : get,\n indent : indent,\n indentation : function() { return indentation },\n current_width : function() { return current_col - indentation },\n should_break : function() { return options.width && this.current_width() >= options.width },\n newline : newline,\n print : print,\n space : space,\n comma : comma,\n colon : colon,\n last : function() { return last },\n semicolon : semicolon,\n force_semicolon : force_semicolon,\n to_ascii : to_ascii,\n print_name : function(name) { print(make_name(name)) },\n print_string : function(str) { print(encode_string(str)) },\n next_indent : next_indent,\n with_indent : with_indent,\n with_block : with_block,\n with_parens : with_parens,\n with_square : with_square,\n add_mapping : add_mapping,\n option : function(opt) { return options[opt] },\n line : function() { return current_line },\n col : function() { return current_col },\n pos : function() { return current_pos },\n push_node : function(node) { stack.push(node) },\n pop_node : function() { return stack.pop() },\n stack : function() { return stack },\n parent : function(n) {\n return stack[stack.length - 2 - (n || 0)];\n }\n };\n\n};\n\n/* -----[ code generators ]----- */\n\n(function(){\n\n /* -----[ utils ]----- */\n\n function DEFPRINT(nodetype, generator) {\n nodetype.DEFMETHOD(\"_codegen\", generator);\n };\n\n AST_Node.DEFMETHOD(\"print\", function(stream, force_parens){\n var self = this, generator = self._codegen;\n function doit() {\n self.add_comments(stream);\n self.add_source_map(stream);\n generator(self, stream);\n }\n stream.push_node(self);\n if (force_parens || self.needs_parens(stream)) {\n stream.with_parens(doit);\n } else {\n doit();\n }\n stream.pop_node();\n });\n\n AST_Node.DEFMETHOD(\"print_to_string\", function(options){\n var s = OutputStream(options);\n this.print(s);\n return s.get();\n });\n\n /* -----[ comments ]----- */\n\n AST_Node.DEFMETHOD(\"add_comments\", function(output){\n var c = output.option(\"comments\"), self = this;\n if (c) {\n var start = self.start;\n if (start && !start._comments_dumped) {\n start._comments_dumped = true;\n var comments = start.comments_before || [];\n\n // XXX: ugly fix for https://github.com/mishoo/UglifyJS2/issues/112\n // and https://github.com/mishoo/UglifyJS2/issues/372\n if (self instanceof AST_Exit && self.value) {\n self.value.walk(new TreeWalker(function(node){\n if (node.start && node.start.comments_before) {\n comments = comments.concat(node.start.comments_before);\n node.start.comments_before = [];\n }\n if (node instanceof AST_Function ||\n node instanceof AST_Array ||\n node instanceof AST_Object)\n {\n return true; // don't go inside.\n }\n }));\n }\n\n if (c.test) {\n comments = comments.filter(function(comment){\n return c.test(comment.value);\n });\n } else if (typeof c == \"function\") {\n comments = comments.filter(function(comment){\n return c(self, comment);\n });\n }\n comments.forEach(function(c){\n if (/comment[134]/.test(c.type)) {\n output.print(\"//\" + c.value + \"\\n\");\n output.indent();\n }\n else if (c.type == \"comment2\") {\n output.print(\"/*\" + c.value + \"*/\");\n if (start.nlb) {\n output.print(\"\\n\");\n output.indent();\n } else {\n output.space();\n }\n }\n });\n }\n }\n });\n\n /* -----[ PARENTHESES ]----- */\n\n function PARENS(nodetype, func) {\n nodetype.DEFMETHOD(\"needs_parens\", func);\n };\n\n PARENS(AST_Node, function(){\n return false;\n });\n\n // a function expression needs parens around it when it's provably\n // the first token to appear in a statement.\n PARENS(AST_Function, function(output){\n return first_in_statement(output);\n });\n\n // same goes for an object literal, because otherwise it would be\n // interpreted as a block of code.\n PARENS(AST_Object, function(output){\n return first_in_statement(output);\n });\n\n PARENS(AST_Unary, function(output){\n var p = output.parent();\n return p instanceof AST_PropAccess && p.expression === this;\n });\n\n PARENS(AST_Seq, function(output){\n var p = output.parent();\n return p instanceof AST_Call // (foo, bar)() or foo(1, (2, 3), 4)\n || p instanceof AST_Unary // !(foo, bar, baz)\n || p instanceof AST_Binary // 1 + (2, 3) + 4 ==> 8\n || p instanceof AST_VarDef // var a = (1, 2), b = a + a; ==> b == 4\n || p instanceof AST_PropAccess // (1, {foo:2}).foo or (1, {foo:2})[\"foo\"] ==> 2\n || p instanceof AST_Array // [ 1, (2, 3), 4 ] ==> [ 1, 3, 4 ]\n || p instanceof AST_ObjectProperty // { foo: (1, 2) }.foo ==> 2\n || p instanceof AST_Conditional /* (false, true) ? (a = 10, b = 20) : (c = 30)\n * ==> 20 (side effect, set a := 10 and b := 20) */\n ;\n });\n\n PARENS(AST_Binary, function(output){\n var p = output.parent();\n // (foo && bar)()\n if (p instanceof AST_Call && p.expression === this)\n return true;\n // typeof (foo && bar)\n if (p instanceof AST_Unary)\n return true;\n // (foo && bar)[\"prop\"], (foo && bar).prop\n if (p instanceof AST_PropAccess && p.expression === this)\n return true;\n // this deals with precedence: 3 * (2 + 1)\n if (p instanceof AST_Binary) {\n var po = p.operator, pp = PRECEDENCE[po];\n var so = this.operator, sp = PRECEDENCE[so];\n if (pp > sp\n || (pp == sp\n && this === p.right)) {\n return true;\n }\n }\n });\n\n PARENS(AST_PropAccess, function(output){\n var p = output.parent();\n if (p instanceof AST_New && p.expression === this) {\n // i.e. new (foo.bar().baz)\n //\n // if there's one call into this subtree, then we need\n // parens around it too, otherwise the call will be\n // interpreted as passing the arguments to the upper New\n // expression.\n try {\n this.walk(new TreeWalker(function(node){\n if (node instanceof AST_Call) throw p;\n }));\n } catch(ex) {\n if (ex !== p) throw ex;\n return true;\n }\n }\n });\n\n PARENS(AST_Call, function(output){\n var p = output.parent(), p1;\n if (p instanceof AST_New && p.expression === this)\n return true;\n\n // workaround for Safari bug.\n // https://bugs.webkit.org/show_bug.cgi?id=123506\n return this.expression instanceof AST_Function\n && p instanceof AST_PropAccess\n && p.expression === this\n && (p1 = output.parent(1)) instanceof AST_Assign\n && p1.left === p;\n });\n\n PARENS(AST_New, function(output){\n var p = output.parent();\n if (no_constructor_parens(this, output)\n && (p instanceof AST_PropAccess // (new Date).getTime(), (new Date)[\"getTime\"]()\n || p instanceof AST_Call && p.expression === this)) // (new foo)(bar)\n return true;\n });\n\n PARENS(AST_Number, function(output){\n var p = output.parent();\n if (this.getValue() < 0 && p instanceof AST_PropAccess && p.expression === this)\n return true;\n });\n\n PARENS(AST_NaN, function(output){\n var p = output.parent();\n if (p instanceof AST_PropAccess && p.expression === this)\n return true;\n });\n\n function assign_and_conditional_paren_rules(output) {\n var p = output.parent();\n // !(a = false) → true\n if (p instanceof AST_Unary)\n return true;\n // 1 + (a = 2) + 3 → 6, side effect setting a = 2\n if (p instanceof AST_Binary && !(p instanceof AST_Assign))\n return true;\n // (a = func)() —or— new (a = Object)()\n if (p instanceof AST_Call && p.expression === this)\n return true;\n // (a = foo) ? bar : baz\n if (p instanceof AST_Conditional && p.condition === this)\n return true;\n // (a = foo)[\"prop\"] —or— (a = foo).prop\n if (p instanceof AST_PropAccess && p.expression === this)\n return true;\n };\n\n PARENS(AST_Assign, assign_and_conditional_paren_rules);\n PARENS(AST_Conditional, assign_and_conditional_paren_rules);\n\n /* -----[ PRINTERS ]----- */\n\n DEFPRINT(AST_Directive, function(self, output){\n output.print_string(self.value);\n output.semicolon();\n });\n DEFPRINT(AST_Debugger, function(self, output){\n output.print(\"debugger\");\n output.semicolon();\n });\n\n /* -----[ statements ]----- */\n\n function display_body(body, is_toplevel, output) {\n var last = body.length - 1;\n body.forEach(function(stmt, i){\n if (!(stmt instanceof AST_EmptyStatement)) {\n output.indent();\n stmt.print(output);\n if (!(i == last && is_toplevel)) {\n output.newline();\n if (is_toplevel) output.newline();\n }\n }\n });\n };\n\n AST_StatementWithBody.DEFMETHOD(\"_do_print_body\", function(output){\n force_statement(this.body, output);\n });\n\n DEFPRINT(AST_Statement, function(self, output){\n self.body.print(output);\n output.semicolon();\n });\n DEFPRINT(AST_Toplevel, function(self, output){\n display_body(self.body, true, output);\n output.print(\"\");\n });\n DEFPRINT(AST_LabeledStatement, function(self, output){\n self.label.print(output);\n output.colon();\n self.body.print(output);\n });\n DEFPRINT(AST_SimpleStatement, function(self, output){\n self.body.print(output);\n output.semicolon();\n });\n function print_bracketed(body, output) {\n if (body.length > 0) output.with_block(function(){\n display_body(body, false, output);\n });\n else output.print(\"{}\");\n };\n DEFPRINT(AST_BlockStatement, function(self, output){\n print_bracketed(self.body, output);\n });\n DEFPRINT(AST_EmptyStatement, function(self, output){\n output.semicolon();\n });\n DEFPRINT(AST_Do, function(self, output){\n output.print(\"do\");\n output.space();\n self._do_print_body(output);\n output.space();\n output.print(\"while\");\n output.space();\n output.with_parens(function(){\n self.condition.print(output);\n });\n output.semicolon();\n });\n DEFPRINT(AST_While, function(self, output){\n output.print(\"while\");\n output.space();\n output.with_parens(function(){\n self.condition.print(output);\n });\n output.space();\n self._do_print_body(output);\n });\n DEFPRINT(AST_For, function(self, output){\n output.print(\"for\");\n output.space();\n output.with_parens(function(){\n if (self.init) {\n if (self.init instanceof AST_Definitions) {\n self.init.print(output);\n } else {\n parenthesize_for_noin(self.init, output, true);\n }\n output.print(\";\");\n output.space();\n } else {\n output.print(\";\");\n }\n if (self.condition) {\n self.condition.print(output);\n output.print(\";\");\n output.space();\n } else {\n output.print(\";\");\n }\n if (self.step) {\n self.step.print(output);\n }\n });\n output.space();\n self._do_print_body(output);\n });\n DEFPRINT(AST_ForIn, function(self, output){\n output.print(\"for\");\n output.space();\n output.with_parens(function(){\n self.init.print(output);\n output.space();\n output.print(\"in\");\n output.space();\n self.object.print(output);\n });\n output.space();\n self._do_print_body(output);\n });\n DEFPRINT(AST_With, function(self, output){\n output.print(\"with\");\n output.space();\n output.with_parens(function(){\n self.expression.print(output);\n });\n output.space();\n self._do_print_body(output);\n });\n\n /* -----[ functions ]----- */\n AST_Lambda.DEFMETHOD(\"_do_print\", function(output, nokeyword){\n var self = this;\n if (!nokeyword) {\n output.print(\"function\");\n }\n if (self.name) {\n output.space();\n self.name.print(output);\n }\n output.with_parens(function(){\n self.argnames.forEach(function(arg, i){\n if (i) output.comma();\n arg.print(output);\n });\n });\n output.space();\n print_bracketed(self.body, output);\n });\n DEFPRINT(AST_Lambda, function(self, output){\n self._do_print(output);\n });\n\n /* -----[ exits ]----- */\n AST_Exit.DEFMETHOD(\"_do_print\", function(output, kind){\n output.print(kind);\n if (this.value) {\n output.space();\n this.value.print(output);\n }\n output.semicolon();\n });\n DEFPRINT(AST_Return, function(self, output){\n self._do_print(output, \"return\");\n });\n DEFPRINT(AST_Throw, function(self, output){\n self._do_print(output, \"throw\");\n });\n\n /* -----[ loop control ]----- */\n AST_LoopControl.DEFMETHOD(\"_do_print\", function(output, kind){\n output.print(kind);\n if (this.label) {\n output.space();\n this.label.print(output);\n }\n output.semicolon();\n });\n DEFPRINT(AST_Break, function(self, output){\n self._do_print(output, \"break\");\n });\n DEFPRINT(AST_Continue, function(self, output){\n self._do_print(output, \"continue\");\n });\n\n /* -----[ if ]----- */\n function make_then(self, output) {\n if (output.option(\"bracketize\")) {\n make_block(self.body, output);\n return;\n }\n // The squeezer replaces \"block\"-s that contain only a single\n // statement with the statement itself; technically, the AST\n // is correct, but this can create problems when we output an\n // IF having an ELSE clause where the THEN clause ends in an\n // IF *without* an ELSE block (then the outer ELSE would refer\n // to the inner IF). This function checks for this case and\n // adds the block brackets if needed.\n if (!self.body)\n return output.force_semicolon();\n if (self.body instanceof AST_Do\n && !output.option(\"screw_ie8\")) {\n // https://github.com/mishoo/UglifyJS/issues/#issue/57 IE\n // croaks with \"syntax error\" on code like this: if (foo)\n // do ... while(cond); else ... we need block brackets\n // around do/while\n make_block(self.body, output);\n return;\n }\n var b = self.body;\n while (true) {\n if (b instanceof AST_If) {\n if (!b.alternative) {\n make_block(self.body, output);\n return;\n }\n b = b.alternative;\n }\n else if (b instanceof AST_StatementWithBody) {\n b = b.body;\n }\n else break;\n }\n force_statement(self.body, output);\n };\n DEFPRINT(AST_If, function(self, output){\n output.print(\"if\");\n output.space();\n output.with_parens(function(){\n self.condition.print(output);\n });\n output.space();\n if (self.alternative) {\n make_then(self, output);\n output.space();\n output.print(\"else\");\n output.space();\n force_statement(self.alternative, output);\n } else {\n self._do_print_body(output);\n }\n });\n\n /* -----[ switch ]----- */\n DEFPRINT(AST_Switch, function(self, output){\n output.print(\"switch\");\n output.space();\n output.with_parens(function(){\n self.expression.print(output);\n });\n output.space();\n if (self.body.length > 0) output.with_block(function(){\n self.body.forEach(function(stmt, i){\n if (i) output.newline();\n output.indent(true);\n stmt.print(output);\n });\n });\n else output.print(\"{}\");\n });\n AST_SwitchBranch.DEFMETHOD(\"_do_print_body\", function(output){\n if (this.body.length > 0) {\n output.newline();\n this.body.forEach(function(stmt){\n output.indent();\n stmt.print(output);\n output.newline();\n });\n }\n });\n DEFPRINT(AST_Default, function(self, output){\n output.print(\"default:\");\n self._do_print_body(output);\n });\n DEFPRINT(AST_Case, function(self, output){\n output.print(\"case\");\n output.space();\n self.expression.print(output);\n output.print(\":\");\n self._do_print_body(output);\n });\n\n /* -----[ exceptions ]----- */\n DEFPRINT(AST_Try, function(self, output){\n output.print(\"try\");\n output.space();\n print_bracketed(self.body, output);\n if (self.bcatch) {\n output.space();\n self.bcatch.print(output);\n }\n if (self.bfinally) {\n output.space();\n self.bfinally.print(output);\n }\n });\n DEFPRINT(AST_Catch, function(self, output){\n output.print(\"catch\");\n output.space();\n output.with_parens(function(){\n self.argname.print(output);\n });\n output.space();\n print_bracketed(self.body, output);\n });\n DEFPRINT(AST_Finally, function(self, output){\n output.print(\"finally\");\n output.space();\n print_bracketed(self.body, output);\n });\n\n /* -----[ var/const ]----- */\n AST_Definitions.DEFMETHOD(\"_do_print\", function(output, kind){\n output.print(kind);\n output.space();\n this.definitions.forEach(function(def, i){\n if (i) output.comma();\n def.print(output);\n });\n var p = output.parent();\n var in_for = p instanceof AST_For || p instanceof AST_ForIn;\n var avoid_semicolon = in_for && p.init === this;\n if (!avoid_semicolon)\n output.semicolon();\n });\n DEFPRINT(AST_Var, function(self, output){\n self._do_print(output, \"var\");\n });\n DEFPRINT(AST_Const, function(self, output){\n self._do_print(output, \"const\");\n });\n\n function parenthesize_for_noin(node, output, noin) {\n if (!noin) node.print(output);\n else try {\n // need to take some precautions here:\n // https://github.com/mishoo/UglifyJS2/issues/60\n node.walk(new TreeWalker(function(node){\n if (node instanceof AST_Binary && node.operator == \"in\")\n throw output;\n }));\n node.print(output);\n } catch(ex) {\n if (ex !== output) throw ex;\n node.print(output, true);\n }\n };\n\n DEFPRINT(AST_VarDef, function(self, output){\n self.name.print(output);\n if (self.value) {\n output.space();\n output.print(\"=\");\n output.space();\n var p = output.parent(1);\n var noin = p instanceof AST_For || p instanceof AST_ForIn;\n parenthesize_for_noin(self.value, output, noin);\n }\n });\n\n /* -----[ other expressions ]----- */\n DEFPRINT(AST_Call, function(self, output){\n self.expression.print(output);\n if (self instanceof AST_New && no_constructor_parens(self, output))\n return;\n output.with_parens(function(){\n self.args.forEach(function(expr, i){\n if (i) output.comma();\n expr.print(output);\n });\n });\n });\n DEFPRINT(AST_New, function(self, output){\n output.print(\"new\");\n output.space();\n AST_Call.prototype._codegen(self, output);\n });\n\n AST_Seq.DEFMETHOD(\"_do_print\", function(output){\n this.car.print(output);\n if (this.cdr) {\n output.comma();\n if (output.should_break()) {\n output.newline();\n output.indent();\n }\n this.cdr.print(output);\n }\n });\n DEFPRINT(AST_Seq, function(self, output){\n self._do_print(output);\n // var p = output.parent();\n // if (p instanceof AST_Statement) {\n // output.with_indent(output.next_indent(), function(){\n // self._do_print(output);\n // });\n // } else {\n // self._do_print(output);\n // }\n });\n DEFPRINT(AST_Dot, function(self, output){\n var expr = self.expression;\n expr.print(output);\n if (expr instanceof AST_Number && expr.getValue() >= 0) {\n if (!/[xa-f.]/i.test(output.last())) {\n output.print(\".\");\n }\n }\n output.print(\".\");\n // the name after dot would be mapped about here.\n output.add_mapping(self.end);\n output.print_name(self.property);\n });\n DEFPRINT(AST_Sub, function(self, output){\n self.expression.print(output);\n output.print(\"[\");\n self.property.print(output);\n output.print(\"]\");\n });\n DEFPRINT(AST_UnaryPrefix, function(self, output){\n var op = self.operator;\n output.print(op);\n if (/^[a-z]/i.test(op))\n output.space();\n self.expression.print(output);\n });\n DEFPRINT(AST_UnaryPostfix, function(self, output){\n self.expression.print(output);\n output.print(self.operator);\n });\n DEFPRINT(AST_Binary, function(self, output){\n self.left.print(output);\n output.space();\n output.print(self.operator);\n if (self.operator == \"<\"\n && self.right instanceof AST_UnaryPrefix\n && self.right.operator == \"!\"\n && self.right.expression instanceof AST_UnaryPrefix\n && self.right.expression.operator == \"--\") {\n // space is mandatory to avoid outputting <!--\n // http://javascript.spec.whatwg.org/#comment-syntax\n output.print(\" \");\n } else {\n // the space is optional depending on \"beautify\"\n output.space();\n }\n self.right.print(output);\n });\n DEFPRINT(AST_Conditional, function(self, output){\n self.condition.print(output);\n output.space();\n output.print(\"?\");\n output.space();\n self.consequent.print(output);\n output.space();\n output.colon();\n self.alternative.print(output);\n });\n\n /* -----[ literals ]----- */\n DEFPRINT(AST_Array, function(self, output){\n output.with_square(function(){\n var a = self.elements, len = a.length;\n if (len > 0) output.space();\n a.forEach(function(exp, i){\n if (i) output.comma();\n exp.print(output);\n // If the final element is a hole, we need to make sure it\n // doesn't look like a trailing comma, by inserting an actual\n // trailing comma.\n if (i === len - 1 && exp instanceof AST_Hole)\n output.comma();\n });\n if (len > 0) output.space();\n });\n });\n DEFPRINT(AST_Object, function(self, output){\n if (self.properties.length > 0) output.with_block(function(){\n self.properties.forEach(function(prop, i){\n if (i) {\n output.print(\",\");\n output.newline();\n }\n output.indent();\n prop.print(output);\n });\n output.newline();\n });\n else output.print(\"{}\");\n });\n DEFPRINT(AST_ObjectKeyVal, function(self, output){\n var key = self.key;\n if (output.option(\"quote_keys\")) {\n output.print_string(key + \"\");\n } else if ((typeof key == \"number\"\n || !output.option(\"beautify\")\n && +key + \"\" == key)\n && parseFloat(key) >= 0) {\n output.print(make_num(key));\n } else if (RESERVED_WORDS(key) ? output.option(\"screw_ie8\") : is_identifier_string(key)) {\n output.print_name(key);\n } else {\n output.print_string(key);\n }\n output.colon();\n self.value.print(output);\n });\n DEFPRINT(AST_ObjectSetter, function(self, output){\n output.print(\"set\");\n output.space();\n self.key.print(output);\n self.value._do_print(output, true);\n });\n DEFPRINT(AST_ObjectGetter, function(self, output){\n output.print(\"get\");\n output.space();\n self.key.print(output);\n self.value._do_print(output, true);\n });\n DEFPRINT(AST_Symbol, function(self, output){\n var def = self.definition();\n output.print_name(def ? def.mangled_name || def.name : self.name);\n });\n DEFPRINT(AST_Undefined, function(self, output){\n output.print(\"void 0\");\n });\n DEFPRINT(AST_Hole, noop);\n DEFPRINT(AST_Infinity, function(self, output){\n output.print(\"1/0\");\n });\n DEFPRINT(AST_NaN, function(self, output){\n output.print(\"0/0\");\n });\n DEFPRINT(AST_This, function(self, output){\n output.print(\"this\");\n });\n DEFPRINT(AST_Constant, function(self, output){\n output.print(self.getValue());\n });\n DEFPRINT(AST_String, function(self, output){\n output.print_string(self.getValue());\n });\n DEFPRINT(AST_Number, function(self, output){\n output.print(make_num(self.getValue()));\n });\n\n function regexp_safe_literal(code) {\n return [\n 0x5c , // \\\n 0x2f , // /\n 0x2e , // .\n 0x2b , // +\n 0x2a , // *\n 0x3f , // ?\n 0x28 , // (\n 0x29 , // )\n 0x5b , // [\n 0x5d , // ]\n 0x7b , // {\n 0x7d , // }\n 0x24 , // $\n 0x5e , // ^\n 0x3a , // :\n 0x7c , // |\n 0x21 , // !\n 0x0a , // \\n\n 0x0d , // \\r\n 0x00 , // \\0\n 0xfeff , // Unicode BOM\n 0x2028 , // unicode \"line separator\"\n 0x2029 , // unicode \"paragraph separator\"\n ].indexOf(code) < 0;\n };\n\n DEFPRINT(AST_RegExp, function(self, output){\n var str = self.getValue().toString();\n if (output.option(\"ascii_only\")) {\n str = output.to_ascii(str);\n } else if (output.option(\"unescape_regexps\")) {\n str = str.split(\"\\\\\\\\\").map(function(str){\n return str.replace(/\\\\u[0-9a-fA-F]{4}|\\\\x[0-9a-fA-F]{2}/g, function(s){\n var code = parseInt(s.substr(2), 16);\n return regexp_safe_literal(code) ? String.fromCharCode(code) : s;\n });\n }).join(\"\\\\\\\\\");\n }\n output.print(str);\n var p = output.parent();\n if (p instanceof AST_Binary && /^in/.test(p.operator) && p.left === self)\n output.print(\" \");\n });\n\n function force_statement(stat, output) {\n if (output.option(\"bracketize\")) {\n if (!stat || stat instanceof AST_EmptyStatement)\n output.print(\"{}\");\n else if (stat instanceof AST_BlockStatement)\n stat.print(output);\n else output.with_block(function(){\n output.indent();\n stat.print(output);\n output.newline();\n });\n } else {\n if (!stat || stat instanceof AST_EmptyStatement)\n output.force_semicolon();\n else\n stat.print(output);\n }\n };\n\n // return true if the node at the top of the stack (that means the\n // innermost node in the current output) is lexically the first in\n // a statement.\n function first_in_statement(output) {\n var a = output.stack(), i = a.length, node = a[--i], p = a[--i];\n while (i > 0) {\n if (p instanceof AST_Statement && p.body === node)\n return true;\n if ((p instanceof AST_Seq && p.car === node ) ||\n (p instanceof AST_Call && p.expression === node && !(p instanceof AST_New) ) ||\n (p instanceof AST_Dot && p.expression === node ) ||\n (p instanceof AST_Sub && p.expression === node ) ||\n (p instanceof AST_Conditional && p.condition === node ) ||\n (p instanceof AST_Binary && p.left === node ) ||\n (p instanceof AST_UnaryPostfix && p.expression === node ))\n {\n node = p;\n p = a[--i];\n } else {\n return false;\n }\n }\n };\n\n // self should be AST_New. decide if we want to show parens or not.\n function no_constructor_parens(self, output) {\n return self.args.length == 0 && !output.option(\"beautify\");\n };\n\n function best_of(a) {\n var best = a[0], len = best.length;\n for (var i = 1; i < a.length; ++i) {\n if (a[i].length < len) {\n best = a[i];\n len = best.length;\n }\n }\n return best;\n };\n\n function make_num(num) {\n var str = num.toString(10), a = [ str.replace(/^0\\./, \".\").replace('e+', 'e') ], m;\n if (Math.floor(num) === num) {\n if (num >= 0) {\n a.push(\"0x\" + num.toString(16).toLowerCase(), // probably pointless\n \"0\" + num.toString(8)); // same.\n } else {\n a.push(\"-0x\" + (-num).toString(16).toLowerCase(), // probably pointless\n \"-0\" + (-num).toString(8)); // same.\n }\n if ((m = /^(.*?)(0+)$/.exec(num))) {\n a.push(m[1] + \"e\" + m[2].length);\n }\n } else if ((m = /^0?\\.(0+)(.*)$/.exec(num))) {\n a.push(m[2] + \"e-\" + (m[1].length + m[2].length),\n str.substr(str.indexOf(\".\")));\n }\n return best_of(a);\n };\n\n function make_block(stmt, output) {\n if (stmt instanceof AST_BlockStatement) {\n stmt.print(output);\n return;\n }\n output.with_block(function(){\n output.indent();\n stmt.print(output);\n output.newline();\n });\n };\n\n /* -----[ source map generators ]----- */\n\n function DEFMAP(nodetype, generator) {\n nodetype.DEFMETHOD(\"add_source_map\", function(stream){\n generator(this, stream);\n });\n };\n\n // We could easily add info for ALL nodes, but it seems to me that\n // would be quite wasteful, hence this noop in the base class.\n DEFMAP(AST_Node, noop);\n\n function basic_sourcemap_gen(self, output) {\n output.add_mapping(self.start);\n };\n\n // XXX: I'm not exactly sure if we need it for all of these nodes,\n // or if we should add even more.\n\n DEFMAP(AST_Directive, basic_sourcemap_gen);\n DEFMAP(AST_Debugger, basic_sourcemap_gen);\n DEFMAP(AST_Symbol, basic_sourcemap_gen);\n DEFMAP(AST_Jump, basic_sourcemap_gen);\n DEFMAP(AST_StatementWithBody, basic_sourcemap_gen);\n DEFMAP(AST_LabeledStatement, noop); // since the label symbol will mark it\n DEFMAP(AST_Lambda, basic_sourcemap_gen);\n DEFMAP(AST_Switch, basic_sourcemap_gen);\n DEFMAP(AST_SwitchBranch, basic_sourcemap_gen);\n DEFMAP(AST_BlockStatement, basic_sourcemap_gen);\n DEFMAP(AST_Toplevel, noop);\n DEFMAP(AST_New, basic_sourcemap_gen);\n DEFMAP(AST_Try, basic_sourcemap_gen);\n DEFMAP(AST_Catch, basic_sourcemap_gen);\n DEFMAP(AST_Finally, basic_sourcemap_gen);\n DEFMAP(AST_Definitions, basic_sourcemap_gen);\n DEFMAP(AST_Constant, basic_sourcemap_gen);\n DEFMAP(AST_ObjectProperty, function(self, output){\n output.add_mapping(self.start, self.key);\n });\n\n})();\n\n/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n <[email protected]>\n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon <[email protected]>\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\nfunction Compressor(options, false_by_default) {\n if (!(this instanceof Compressor))\n return new Compressor(options, false_by_default);\n TreeTransformer.call(this, this.before, this.after);\n this.options = defaults(options, {\n sequences : !false_by_default,\n properties : !false_by_default,\n dead_code : !false_by_default,\n drop_debugger : !false_by_default,\n unsafe : false,\n unsafe_comps : false,\n conditionals : !false_by_default,\n comparisons : !false_by_default,\n evaluate : !false_by_default,\n booleans : !false_by_default,\n loops : !false_by_default,\n unused : !false_by_default,\n hoist_funs : !false_by_default,\n keep_fargs : false,\n hoist_vars : false,\n if_return : !false_by_default,\n join_vars : !false_by_default,\n cascade : !false_by_default,\n side_effects : !false_by_default,\n pure_getters : false,\n pure_funcs : null,\n negate_iife : !false_by_default,\n screw_ie8 : false,\n drop_console : false,\n angular : false,\n\n warnings : true,\n global_defs : {}\n }, true);\n};\n\nCompressor.prototype = new TreeTransformer;\nmerge(Compressor.prototype, {\n option: function(key) { return this.options[key] },\n warn: function() {\n if (this.options.warnings)\n AST_Node.warn.apply(AST_Node, arguments);\n },\n before: function(node, descend, in_list) {\n if (node._squeezed) return node;\n var was_scope = false;\n if (node instanceof AST_Scope) {\n node = node.hoist_declarations(this);\n was_scope = true;\n }\n descend(node, this);\n node = node.optimize(this);\n if (was_scope && node instanceof AST_Scope) {\n node.drop_unused(this);\n descend(node, this);\n }\n node._squeezed = true;\n return node;\n }\n});\n\n(function(){\n\n function OPT(node, optimizer) {\n node.DEFMETHOD(\"optimize\", function(compressor){\n var self = this;\n if (self._optimized) return self;\n var opt = optimizer(self, compressor);\n opt._optimized = true;\n if (opt === self) return opt;\n return opt.transform(compressor);\n });\n };\n\n OPT(AST_Node, function(self, compressor){\n return self;\n });\n\n AST_Node.DEFMETHOD(\"equivalent_to\", function(node){\n // XXX: this is a rather expensive way to test two node's equivalence:\n return this.print_to_string() == node.print_to_string();\n });\n\n function make_node(ctor, orig, props) {\n if (!props) props = {};\n if (orig) {\n if (!props.start) props.start = orig.start;\n if (!props.end) props.end = orig.end;\n }\n return new ctor(props);\n };\n\n function make_node_from_constant(compressor, val, orig) {\n // XXX: WIP.\n // if (val instanceof AST_Node) return val.transform(new TreeTransformer(null, function(node){\n // if (node instanceof AST_SymbolRef) {\n // var scope = compressor.find_parent(AST_Scope);\n // var def = scope.find_variable(node);\n // node.thedef = def;\n // return node;\n // }\n // })).transform(compressor);\n\n if (val instanceof AST_Node) return val.transform(compressor);\n switch (typeof val) {\n case \"string\":\n return make_node(AST_String, orig, {\n value: val\n }).optimize(compressor);\n case \"number\":\n return make_node(isNaN(val) ? AST_NaN : AST_Number, orig, {\n value: val\n }).optimize(compressor);\n case \"boolean\":\n return make_node(val ? AST_True : AST_False, orig).optimize(compressor);\n case \"undefined\":\n return make_node(AST_Undefined, orig).optimize(compressor);\n default:\n if (val === null) {\n return make_node(AST_Null, orig).optimize(compressor);\n }\n if (val instanceof RegExp) {\n return make_node(AST_RegExp, orig).optimize(compressor);\n }\n throw new Error(string_template(\"Can't handle constant of type: {type}\", {\n type: typeof val\n }));\n }\n };\n\n function as_statement_array(thing) {\n if (thing === null) return [];\n if (thing instanceof AST_BlockStatement) return thing.body;\n if (thing instanceof AST_EmptyStatement) return [];\n if (thing instanceof AST_Statement) return [ thing ];\n throw new Error(\"Can't convert thing to statement array\");\n };\n\n function is_empty(thing) {\n if (thing === null) return true;\n if (thing instanceof AST_EmptyStatement) return true;\n if (thing instanceof AST_BlockStatement) return thing.body.length == 0;\n return false;\n };\n\n function loop_body(x) {\n if (x instanceof AST_Switch) return x;\n if (x instanceof AST_For || x instanceof AST_ForIn || x instanceof AST_DWLoop) {\n return (x.body instanceof AST_BlockStatement ? x.body : x);\n }\n return x;\n };\n\n function tighten_body(statements, compressor) {\n var CHANGED;\n do {\n CHANGED = false;\n if (compressor.option(\"angular\")) {\n statements = process_for_angular(statements);\n }\n statements = eliminate_spurious_blocks(statements);\n if (compressor.option(\"dead_code\")) {\n statements = eliminate_dead_code(statements, compressor);\n }\n if (compressor.option(\"if_return\")) {\n statements = handle_if_return(statements, compressor);\n }\n if (compressor.option(\"sequences\")) {\n statements = sequencesize(statements, compressor);\n }\n if (compressor.option(\"join_vars\")) {\n statements = join_consecutive_vars(statements, compressor);\n }\n } while (CHANGED);\n\n if (compressor.option(\"negate_iife\")) {\n negate_iifes(statements, compressor);\n }\n\n return statements;\n\n function process_for_angular(statements) {\n function make_injector(func, name) {\n return make_node(AST_SimpleStatement, func, {\n body: make_node(AST_Assign, func, {\n operator: \"=\",\n left: make_node(AST_Dot, name, {\n expression: make_node(AST_SymbolRef, name, name),\n property: \"$inject\"\n }),\n right: make_node(AST_Array, func, {\n elements: func.argnames.map(function(sym){\n return make_node(AST_String, sym, { value: sym.name });\n })\n })\n })\n });\n }\n return statements.reduce(function(a, stat){\n a.push(stat);\n var token = stat.start;\n var comments = token.comments_before;\n if (comments && comments.length > 0) {\n var last = comments.pop();\n if (/@ngInject/.test(last.value)) {\n // case 1: defun\n if (stat instanceof AST_Defun) {\n a.push(make_injector(stat, stat.name));\n }\n else if (stat instanceof AST_Definitions) {\n stat.definitions.forEach(function(def){\n if (def.value && def.value instanceof AST_Lambda) {\n a.push(make_injector(def.value, def.name));\n }\n });\n }\n else {\n compressor.warn(\"Unknown statement marked with @ngInject [{file}:{line},{col}]\", token);\n }\n }\n }\n return a;\n }, []);\n }\n\n function eliminate_spurious_blocks(statements) {\n var seen_dirs = [];\n return statements.reduce(function(a, stat){\n if (stat instanceof AST_BlockStatement) {\n CHANGED = true;\n a.push.apply(a, eliminate_spurious_blocks(stat.body));\n } else if (stat instanceof AST_EmptyStatement) {\n CHANGED = true;\n } else if (stat instanceof AST_Directive) {\n if (seen_dirs.indexOf(stat.value) < 0) {\n a.push(stat);\n seen_dirs.push(stat.value);\n } else {\n CHANGED = true;\n }\n } else {\n a.push(stat);\n }\n return a;\n }, []);\n };\n\n function handle_if_return(statements, compressor) {\n var self = compressor.self();\n var in_lambda = self instanceof AST_Lambda;\n var ret = [];\n loop: for (var i = statements.length; --i >= 0;) {\n var stat = statements[i];\n switch (true) {\n case (in_lambda && stat instanceof AST_Return && !stat.value && ret.length == 0):\n CHANGED = true;\n // note, ret.length is probably always zero\n // because we drop unreachable code before this\n // step. nevertheless, it's good to check.\n continue loop;\n case stat instanceof AST_If:\n if (stat.body instanceof AST_Return) {\n //---\n // pretty silly case, but:\n // if (foo()) return; return; ==> foo(); return;\n if (((in_lambda && ret.length == 0)\n || (ret[0] instanceof AST_Return && !ret[0].value))\n && !stat.body.value && !stat.alternative) {\n CHANGED = true;\n var cond = make_node(AST_SimpleStatement, stat.condition, {\n body: stat.condition\n });\n ret.unshift(cond);\n continue loop;\n }\n //---\n // if (foo()) return x; return y; ==> return foo() ? x : y;\n if (ret[0] instanceof AST_Return && stat.body.value && ret[0].value && !stat.alternative) {\n CHANGED = true;\n stat = stat.clone();\n stat.alternative = ret[0];\n ret[0] = stat.transform(compressor);\n continue loop;\n }\n //---\n // if (foo()) return x; [ return ; ] ==> return foo() ? x : undefined;\n if ((ret.length == 0 || ret[0] instanceof AST_Return) && stat.body.value && !stat.alternative && in_lambda) {\n CHANGED = true;\n stat = stat.clone();\n stat.alternative = ret[0] || make_node(AST_Return, stat, {\n value: make_node(AST_Undefined, stat)\n });\n ret[0] = stat.transform(compressor);\n continue loop;\n }\n //---\n // if (foo()) return; [ else x... ]; y... ==> if (!foo()) { x...; y... }\n if (!stat.body.value && in_lambda) {\n CHANGED = true;\n stat = stat.clone();\n stat.condition = stat.condition.negate(compressor);\n stat.body = make_node(AST_BlockStatement, stat, {\n body: as_statement_array(stat.alternative).concat(ret)\n });\n stat.alternative = null;\n ret = [ stat.transform(compressor) ];\n continue loop;\n }\n //---\n if (ret.length == 1 && in_lambda && ret[0] instanceof AST_SimpleStatement\n && (!stat.alternative || stat.alternative instanceof AST_SimpleStatement)) {\n CHANGED = true;\n ret.push(make_node(AST_Return, ret[0], {\n value: make_node(AST_Undefined, ret[0])\n }).transform(compressor));\n ret = as_statement_array(stat.alternative).concat(ret);\n ret.unshift(stat);\n continue loop;\n }\n }\n\n var ab = aborts(stat.body);\n var lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab.label) : null;\n if (ab && ((ab instanceof AST_Return && !ab.value && in_lambda)\n || (ab instanceof AST_Continue && self === loop_body(lct))\n || (ab instanceof AST_Break && lct instanceof AST_BlockStatement && self === lct))) {\n if (ab.label) {\n remove(ab.label.thedef.references, ab);\n }\n CHANGED = true;\n var body = as_statement_array(stat.body).slice(0, -1);\n stat = stat.clone();\n stat.condition = stat.condition.negate(compressor);\n stat.body = make_node(AST_BlockStatement, stat, {\n body: as_statement_array(stat.alternative).concat(ret)\n });\n stat.alternative = make_node(AST_BlockStatement, stat, {\n body: body\n });\n ret = [ stat.transform(compressor) ];\n continue loop;\n }\n\n var ab = aborts(stat.alternative);\n var lct = ab instanceof AST_LoopControl ? compressor.loopcontrol_target(ab.label) : null;\n if (ab && ((ab instanceof AST_Return && !ab.value && in_lambda)\n || (ab instanceof AST_Continue && self === loop_body(lct))\n || (ab instanceof AST_Break && lct instanceof AST_BlockStatement && self === lct))) {\n if (ab.label) {\n remove(ab.label.thedef.references, ab);\n }\n CHANGED = true;\n stat = stat.clone();\n stat.body = make_node(AST_BlockStatement, stat.body, {\n body: as_statement_array(stat.body).concat(ret)\n });\n stat.alternative = make_node(AST_BlockStatement, stat.alternative, {\n body: as_statement_array(stat.alternative).slice(0, -1)\n });\n ret = [ stat.transform(compressor) ];\n continue loop;\n }\n\n ret.unshift(stat);\n break;\n default:\n ret.unshift(stat);\n break;\n }\n }\n return ret;\n };\n\n function eliminate_dead_code(statements, compressor) {\n var has_quit = false;\n var orig = statements.length;\n var self = compressor.self();\n statements = statements.reduce(function(a, stat){\n if (has_quit) {\n extract_declarations_from_unreachable_code(compressor, stat, a);\n } else {\n if (stat instanceof AST_LoopControl) {\n var lct = compressor.loopcontrol_target(stat.label);\n if ((stat instanceof AST_Break\n && lct instanceof AST_BlockStatement\n && loop_body(lct) === self) || (stat instanceof AST_Continue\n && loop_body(lct) === self)) {\n if (stat.label) {\n remove(stat.label.thedef.references, stat);\n }\n } else {\n a.push(stat);\n }\n } else {\n a.push(stat);\n }\n if (aborts(stat)) has_quit = true;\n }\n return a;\n }, []);\n CHANGED = statements.length != orig;\n return statements;\n };\n\n function sequencesize(statements, compressor) {\n if (statements.length < 2) return statements;\n var seq = [], ret = [];\n function push_seq() {\n seq = AST_Seq.from_array(seq);\n if (seq) ret.push(make_node(AST_SimpleStatement, seq, {\n body: seq\n }));\n seq = [];\n };\n statements.forEach(function(stat){\n if (stat instanceof AST_SimpleStatement) seq.push(stat.body);\n else push_seq(), ret.push(stat);\n });\n push_seq();\n ret = sequencesize_2(ret, compressor);\n CHANGED = ret.length != statements.length;\n return ret;\n };\n\n function sequencesize_2(statements, compressor) {\n function cons_seq(right) {\n ret.pop();\n var left = prev.body;\n if (left instanceof AST_Seq) {\n left.add(right);\n } else {\n left = AST_Seq.cons(left, right);\n }\n return left.transform(compressor);\n };\n var ret = [], prev = null;\n statements.forEach(function(stat){\n if (prev) {\n if (stat instanceof AST_For) {\n var opera = {};\n try {\n prev.body.walk(new TreeWalker(function(node){\n if (node instanceof AST_Binary && node.operator == \"in\")\n throw opera;\n }));\n if (stat.init && !(stat.init instanceof AST_Definitions)) {\n stat.init = cons_seq(stat.init);\n }\n else if (!stat.init) {\n stat.init = prev.body;\n ret.pop();\n }\n } catch(ex) {\n if (ex !== opera) throw ex;\n }\n }\n else if (stat instanceof AST_If) {\n stat.condition = cons_seq(stat.condition);\n }\n else if (stat instanceof AST_With) {\n stat.expression = cons_seq(stat.expression);\n }\n else if (stat instanceof AST_Exit && stat.value) {\n stat.value = cons_seq(stat.value);\n }\n else if (stat instanceof AST_Exit) {\n stat.value = cons_seq(make_node(AST_Undefined, stat));\n }\n else if (stat instanceof AST_Switch) {\n stat.expression = cons_seq(stat.expression);\n }\n }\n ret.push(stat);\n prev = stat instanceof AST_SimpleStatement ? stat : null;\n });\n return ret;\n };\n\n function join_consecutive_vars(statements, compressor) {\n var prev = null;\n return statements.reduce(function(a, stat){\n if (stat instanceof AST_Definitions && prev && prev.TYPE == stat.TYPE) {\n prev.definitions = prev.definitions.concat(stat.definitions);\n CHANGED = true;\n }\n else if (stat instanceof AST_For\n && prev instanceof AST_Definitions\n && (!stat.init || stat.init.TYPE == prev.TYPE)) {\n CHANGED = true;\n a.pop();\n if (stat.init) {\n stat.init.definitions = prev.definitions.concat(stat.init.definitions);\n } else {\n stat.init = prev;\n }\n a.push(stat);\n prev = stat;\n }\n else {\n prev = stat;\n a.push(stat);\n }\n return a;\n }, []);\n };\n\n function negate_iifes(statements, compressor) {\n statements.forEach(function(stat){\n if (stat instanceof AST_SimpleStatement) {\n stat.body = (function transform(thing) {\n return thing.transform(new TreeTransformer(function(node){\n if (node instanceof AST_Call && node.expression instanceof AST_Function) {\n return make_node(AST_UnaryPrefix, node, {\n operator: \"!\",\n expression: node\n });\n }\n else if (node instanceof AST_Call) {\n node.expression = transform(node.expression);\n }\n else if (node instanceof AST_Seq) {\n node.car = transform(node.car);\n }\n else if (node instanceof AST_Conditional) {\n var expr = transform(node.condition);\n if (expr !== node.condition) {\n // it has been negated, reverse\n node.condition = expr;\n var tmp = node.consequent;\n node.consequent = node.alternative;\n node.alternative = tmp;\n }\n }\n return node;\n }));\n })(stat.body);\n }\n });\n };\n\n };\n\n function extract_declarations_from_unreachable_code(compressor, stat, target) {\n compressor.warn(\"Dropping unreachable code [{file}:{line},{col}]\", stat.start);\n stat.walk(new TreeWalker(function(node){\n if (node instanceof AST_Definitions) {\n compressor.warn(\"Declarations in unreachable code! [{file}:{line},{col}]\", node.start);\n node.remove_initializers();\n target.push(node);\n return true;\n }\n if (node instanceof AST_Defun) {\n target.push(node);\n return true;\n }\n if (node instanceof AST_Scope) {\n return true;\n }\n }));\n };\n\n /* -----[ boolean/negation helpers ]----- */\n\n // methods to determine whether an expression has a boolean result type\n (function (def){\n var unary_bool = [ \"!\", \"delete\" ];\n var binary_bool = [ \"in\", \"instanceof\", \"==\", \"!=\", \"===\", \"!==\", \"<\", \"<=\", \">=\", \">\" ];\n def(AST_Node, function(){ return false });\n def(AST_UnaryPrefix, function(){\n return member(this.operator, unary_bool);\n });\n def(AST_Binary, function(){\n return member(this.operator, binary_bool) ||\n ( (this.operator == \"&&\" || this.operator == \"||\") &&\n this.left.is_boolean() && this.right.is_boolean() );\n });\n def(AST_Conditional, function(){\n return this.consequent.is_boolean() && this.alternative.is_boolean();\n });\n def(AST_Assign, function(){\n return this.operator == \"=\" && this.right.is_boolean();\n });\n def(AST_Seq, function(){\n return this.cdr.is_boolean();\n });\n def(AST_True, function(){ return true });\n def(AST_False, function(){ return true });\n })(function(node, func){\n node.DEFMETHOD(\"is_boolean\", func);\n });\n\n // methods to determine if an expression has a string result type\n (function (def){\n def(AST_Node, function(){ return false });\n def(AST_String, function(){ return true });\n def(AST_UnaryPrefix, function(){\n return this.operator == \"typeof\";\n });\n def(AST_Binary, function(compressor){\n return this.operator == \"+\" &&\n (this.left.is_string(compressor) || this.right.is_string(compressor));\n });\n def(AST_Assign, function(compressor){\n return (this.operator == \"=\" || this.operator == \"+=\") && this.right.is_string(compressor);\n });\n def(AST_Seq, function(compressor){\n return this.cdr.is_string(compressor);\n });\n def(AST_Conditional, function(compressor){\n return this.consequent.is_string(compressor) && this.alternative.is_string(compressor);\n });\n def(AST_Call, function(compressor){\n return compressor.option(\"unsafe\")\n && this.expression instanceof AST_SymbolRef\n && this.expression.name == \"String\"\n && this.expression.undeclared();\n });\n })(function(node, func){\n node.DEFMETHOD(\"is_string\", func);\n });\n\n function best_of(ast1, ast2) {\n return ast1.print_to_string().length >\n ast2.print_to_string().length\n ? ast2 : ast1;\n };\n\n // methods to evaluate a constant expression\n (function (def){\n // The evaluate method returns an array with one or two\n // elements. If the node has been successfully reduced to a\n // constant, then the second element tells us the value;\n // otherwise the second element is missing. The first element\n // of the array is always an AST_Node descendant; if\n // evaluation was successful it's a node that represents the\n // constant; otherwise it's the original or a replacement node.\n AST_Node.DEFMETHOD(\"evaluate\", function(compressor){\n if (!compressor.option(\"evaluate\")) return [ this ];\n try {\n var val = this._eval(compressor);\n return [ best_of(make_node_from_constant(compressor, val, this), this), val ];\n } catch(ex) {\n if (ex !== def) throw ex;\n return [ this ];\n }\n });\n def(AST_Statement, function(){\n throw new Error(string_template(\"Cannot evaluate a statement [{file}:{line},{col}]\", this.start));\n });\n def(AST_Function, function(){\n // XXX: AST_Function inherits from AST_Scope, which itself\n // inherits from AST_Statement; however, an AST_Function\n // isn't really a statement. This could byte in other\n // places too. :-( Wish JS had multiple inheritance.\n throw def;\n });\n function ev(node, compressor) {\n if (!compressor) throw new Error(\"Compressor must be passed\");\n\n return node._eval(compressor);\n };\n def(AST_Node, function(){\n throw def; // not constant\n });\n def(AST_Constant, function(){\n return this.getValue();\n });\n def(AST_UnaryPrefix, function(compressor){\n var e = this.expression;\n switch (this.operator) {\n case \"!\": return !ev(e, compressor);\n case \"typeof\":\n // Function would be evaluated to an array and so typeof would\n // incorrectly return 'object'. Hence making is a special case.\n if (e instanceof AST_Function) return typeof function(){};\n\n e = ev(e, compressor);\n\n // typeof <RegExp> returns \"object\" or \"function\" on different platforms\n // so cannot evaluate reliably\n if (e instanceof RegExp) throw def;\n\n return typeof e;\n case \"void\": return void ev(e, compressor);\n case \"~\": return ~ev(e, compressor);\n case \"-\":\n e = ev(e, compressor);\n if (e === 0) throw def;\n return -e;\n case \"+\": return +ev(e, compressor);\n }\n throw def;\n });\n def(AST_Binary, function(c){\n var left = this.left, right = this.right;\n switch (this.operator) {\n case \"&&\" : return ev(left, c) && ev(right, c);\n case \"||\" : return ev(left, c) || ev(right, c);\n case \"|\" : return ev(left, c) | ev(right, c);\n case \"&\" : return ev(left, c) & ev(right, c);\n case \"^\" : return ev(left, c) ^ ev(right, c);\n case \"+\" : return ev(left, c) + ev(right, c);\n case \"*\" : return ev(left, c) * ev(right, c);\n case \"/\" : return ev(left, c) / ev(right, c);\n case \"%\" : return ev(left, c) % ev(right, c);\n case \"-\" : return ev(left, c) - ev(right, c);\n case \"<<\" : return ev(left, c) << ev(right, c);\n case \">>\" : return ev(left, c) >> ev(right, c);\n case \">>>\" : return ev(left, c) >>> ev(right, c);\n case \"==\" : return ev(left, c) == ev(right, c);\n case \"===\" : return ev(left, c) === ev(right, c);\n case \"!=\" : return ev(left, c) != ev(right, c);\n case \"!==\" : return ev(left, c) !== ev(right, c);\n case \"<\" : return ev(left, c) < ev(right, c);\n case \"<=\" : return ev(left, c) <= ev(right, c);\n case \">\" : return ev(left, c) > ev(right, c);\n case \">=\" : return ev(left, c) >= ev(right, c);\n case \"in\" : return ev(left, c) in ev(right, c);\n case \"instanceof\" : return ev(left, c) instanceof ev(right, c);\n }\n throw def;\n });\n def(AST_Conditional, function(compressor){\n return ev(this.condition, compressor)\n ? ev(this.consequent, compressor)\n : ev(this.alternative, compressor);\n });\n def(AST_SymbolRef, function(compressor){\n var d = this.definition();\n if (d && d.constant && d.init) return ev(d.init, compressor);\n throw def;\n });\n })(function(node, func){\n node.DEFMETHOD(\"_eval\", func);\n });\n\n // method to negate an expression\n (function(def){\n function basic_negation(exp) {\n return make_node(AST_UnaryPrefix, exp, {\n operator: \"!\",\n expression: exp\n });\n };\n def(AST_Node, function(){\n return basic_negation(this);\n });\n def(AST_Statement, function(){\n throw new Error(\"Cannot negate a statement\");\n });\n def(AST_Function, function(){\n return basic_negation(this);\n });\n def(AST_UnaryPrefix, function(){\n if (this.operator == \"!\")\n return this.expression;\n return basic_negation(this);\n });\n def(AST_Seq, function(compressor){\n var self = this.clone();\n self.cdr = self.cdr.negate(compressor);\n return self;\n });\n def(AST_Conditional, function(compressor){\n var self = this.clone();\n self.consequent = self.consequent.negate(compressor);\n self.alternative = self.alternative.negate(compressor);\n return best_of(basic_negation(this), self);\n });\n def(AST_Binary, function(compressor){\n var self = this.clone(), op = this.operator;\n if (compressor.option(\"unsafe_comps\")) {\n switch (op) {\n case \"<=\" : self.operator = \">\" ; return self;\n case \"<\" : self.operator = \">=\" ; return self;\n case \">=\" : self.operator = \"<\" ; return self;\n case \">\" : self.operator = \"<=\" ; return self;\n }\n }\n switch (op) {\n case \"==\" : self.operator = \"!=\"; return self;\n case \"!=\" : self.operator = \"==\"; return self;\n case \"===\": self.operator = \"!==\"; return self;\n case \"!==\": self.operator = \"===\"; return self;\n case \"&&\":\n self.operator = \"||\";\n self.left = self.left.negate(compressor);\n self.right = self.right.negate(compressor);\n return best_of(basic_negation(this), self);\n case \"||\":\n self.operator = \"&&\";\n self.left = self.left.negate(compressor);\n self.right = self.right.negate(compressor);\n return best_of(basic_negation(this), self);\n }\n return basic_negation(this);\n });\n })(function(node, func){\n node.DEFMETHOD(\"negate\", function(compressor){\n return func.call(this, compressor);\n });\n });\n\n // determine if expression has side effects\n (function(def){\n def(AST_Node, function(compressor){ return true });\n\n def(AST_EmptyStatement, function(compressor){ return false });\n def(AST_Constant, function(compressor){ return false });\n def(AST_This, function(compressor){ return false });\n\n def(AST_Call, function(compressor){\n var pure = compressor.option(\"pure_funcs\");\n if (!pure) return true;\n return pure.indexOf(this.expression.print_to_string()) < 0;\n });\n\n def(AST_Block, function(compressor){\n for (var i = this.body.length; --i >= 0;) {\n if (this.body[i].has_side_effects(compressor))\n return true;\n }\n return false;\n });\n\n def(AST_SimpleStatement, function(compressor){\n return this.body.has_side_effects(compressor);\n });\n def(AST_Defun, function(compressor){ return true });\n def(AST_Function, function(compressor){ return false });\n def(AST_Binary, function(compressor){\n return this.left.has_side_effects(compressor)\n || this.right.has_side_effects(compressor);\n });\n def(AST_Assign, function(compressor){ return true });\n def(AST_Conditional, function(compressor){\n return this.condition.has_side_effects(compressor)\n || this.consequent.has_side_effects(compressor)\n || this.alternative.has_side_effects(compressor);\n });\n def(AST_Unary, function(compressor){\n return this.operator == \"delete\"\n || this.operator == \"++\"\n || this.operator == \"--\"\n || this.expression.has_side_effects(compressor);\n });\n def(AST_SymbolRef, function(compressor){ return false });\n def(AST_Object, function(compressor){\n for (var i = this.properties.length; --i >= 0;)\n if (this.properties[i].has_side_effects(compressor))\n return true;\n return false;\n });\n def(AST_ObjectProperty, function(compressor){\n return this.value.has_side_effects(compressor);\n });\n def(AST_Array, function(compressor){\n for (var i = this.elements.length; --i >= 0;)\n if (this.elements[i].has_side_effects(compressor))\n return true;\n return false;\n });\n def(AST_Dot, function(compressor){\n if (!compressor.option(\"pure_getters\")) return true;\n return this.expression.has_side_effects(compressor);\n });\n def(AST_Sub, function(compressor){\n if (!compressor.option(\"pure_getters\")) return true;\n return this.expression.has_side_effects(compressor)\n || this.property.has_side_effects(compressor);\n });\n def(AST_PropAccess, function(compressor){\n return !compressor.option(\"pure_getters\");\n });\n def(AST_Seq, function(compressor){\n return this.car.has_side_effects(compressor)\n || this.cdr.has_side_effects(compressor);\n });\n })(function(node, func){\n node.DEFMETHOD(\"has_side_effects\", func);\n });\n\n // tell me if a statement aborts\n function aborts(thing) {\n return thing && thing.aborts();\n };\n (function(def){\n def(AST_Statement, function(){ return null });\n def(AST_Jump, function(){ return this });\n function block_aborts(){\n var n = this.body.length;\n return n > 0 && aborts(this.body[n - 1]);\n };\n def(AST_BlockStatement, block_aborts);\n def(AST_SwitchBranch, block_aborts);\n def(AST_If, function(){\n return this.alternative && aborts(this.body) && aborts(this.alternative);\n });\n })(function(node, func){\n node.DEFMETHOD(\"aborts\", func);\n });\n\n /* -----[ optimizers ]----- */\n\n OPT(AST_Directive, function(self, compressor){\n if (self.scope.has_directive(self.value) !== self.scope) {\n return make_node(AST_EmptyStatement, self);\n }\n return self;\n });\n\n OPT(AST_Debugger, function(self, compressor){\n if (compressor.option(\"drop_debugger\"))\n return make_node(AST_EmptyStatement, self);\n return self;\n });\n\n OPT(AST_LabeledStatement, function(self, compressor){\n if (self.body instanceof AST_Break\n && compressor.loopcontrol_target(self.body.label) === self.body) {\n return make_node(AST_EmptyStatement, self);\n }\n return self.label.references.length == 0 ? self.body : self;\n });\n\n OPT(AST_Block, function(self, compressor){\n self.body = tighten_body(self.body, compressor);\n return self;\n });\n\n OPT(AST_BlockStatement, function(self, compressor){\n self.body = tighten_body(self.body, compressor);\n switch (self.body.length) {\n case 1: return self.body[0];\n case 0: return make_node(AST_EmptyStatement, self);\n }\n return self;\n });\n\n AST_Scope.DEFMETHOD(\"drop_unused\", function(compressor){\n var self = this;\n if (compressor.option(\"unused\")\n && !(self instanceof AST_Toplevel)\n && !self.uses_eval\n ) {\n var in_use = [];\n var initializations = new Dictionary();\n // pass 1: find out which symbols are directly used in\n // this scope (not in nested scopes).\n var scope = this;\n var tw = new TreeWalker(function(node, descend){\n if (node !== self) {\n if (node instanceof AST_Defun) {\n initializations.add(node.name.name, node);\n return true; // don't go in nested scopes\n }\n if (node instanceof AST_Definitions && scope === self) {\n node.definitions.forEach(function(def){\n if (def.value) {\n initializations.add(def.name.name, def.value);\n if (def.value.has_side_effects(compressor)) {\n def.value.walk(tw);\n }\n }\n });\n return true;\n }\n if (node instanceof AST_SymbolRef) {\n push_uniq(in_use, node.definition());\n return true;\n }\n if (node instanceof AST_Scope) {\n var save_scope = scope;\n scope = node;\n descend();\n scope = save_scope;\n return true;\n }\n }\n });\n self.walk(tw);\n // pass 2: for every used symbol we need to walk its\n // initialization code to figure out if it uses other\n // symbols (that may not be in_use).\n for (var i = 0; i < in_use.length; ++i) {\n in_use[i].orig.forEach(function(decl){\n // undeclared globals will be instanceof AST_SymbolRef\n var init = initializations.get(decl.name);\n if (init) init.forEach(function(init){\n var tw = new TreeWalker(function(node){\n if (node instanceof AST_SymbolRef) {\n push_uniq(in_use, node.definition());\n }\n });\n init.walk(tw);\n });\n });\n }\n // pass 3: we should drop declarations not in_use\n var tt = new TreeTransformer(\n function before(node, descend, in_list) {\n if (node instanceof AST_Lambda && !(node instanceof AST_Accessor)) {\n if (!compressor.option(\"keep_fargs\")) {\n for (var a = node.argnames, i = a.length; --i >= 0;) {\n var sym = a[i];\n if (sym.unreferenced()) {\n a.pop();\n compressor.warn(\"Dropping unused function argument {name} [{file}:{line},{col}]\", {\n name : sym.name,\n file : sym.start.file,\n line : sym.start.line,\n col : sym.start.col\n });\n }\n else break;\n }\n }\n }\n if (node instanceof AST_Defun && node !== self) {\n if (!member(node.name.definition(), in_use)) {\n compressor.warn(\"Dropping unused function {name} [{file}:{line},{col}]\", {\n name : node.name.name,\n file : node.name.start.file,\n line : node.name.start.line,\n col : node.name.start.col\n });\n return make_node(AST_EmptyStatement, node);\n }\n return node;\n }\n if (node instanceof AST_Definitions && !(tt.parent() instanceof AST_ForIn)) {\n var def = node.definitions.filter(function(def){\n if (member(def.name.definition(), in_use)) return true;\n var w = {\n name : def.name.name,\n file : def.name.start.file,\n line : def.name.start.line,\n col : def.name.start.col\n };\n if (def.value && def.value.has_side_effects(compressor)) {\n def._unused_side_effects = true;\n compressor.warn(\"Side effects in initialization of unused variable {name} [{file}:{line},{col}]\", w);\n return true;\n }\n compressor.warn(\"Dropping unused variable {name} [{file}:{line},{col}]\", w);\n return false;\n });\n // place uninitialized names at the start\n def = mergeSort(def, function(a, b){\n if (!a.value && b.value) return -1;\n if (!b.value && a.value) return 1;\n return 0;\n });\n // for unused names whose initialization has\n // side effects, we can cascade the init. code\n // into the next one, or next statement.\n var side_effects = [];\n for (var i = 0; i < def.length;) {\n var x = def[i];\n if (x._unused_side_effects) {\n side_effects.push(x.value);\n def.splice(i, 1);\n } else {\n if (side_effects.length > 0) {\n side_effects.push(x.value);\n x.value = AST_Seq.from_array(side_effects);\n side_effects = [];\n }\n ++i;\n }\n }\n if (side_effects.length > 0) {\n side_effects = make_node(AST_BlockStatement, node, {\n body: [ make_node(AST_SimpleStatement, node, {\n body: AST_Seq.from_array(side_effects)\n }) ]\n });\n } else {\n side_effects = null;\n }\n if (def.length == 0 && !side_effects) {\n return make_node(AST_EmptyStatement, node);\n }\n if (def.length == 0) {\n return side_effects;\n }\n node.definitions = def;\n if (side_effects) {\n side_effects.body.unshift(node);\n node = side_effects;\n }\n return node;\n }\n if (node instanceof AST_For) {\n descend(node, this);\n\n if (node.init instanceof AST_BlockStatement) {\n // certain combination of unused name + side effect leads to:\n // https://github.com/mishoo/UglifyJS2/issues/44\n // that's an invalid AST.\n // We fix it at this stage by moving the `var` outside the `for`.\n\n var body = node.init.body.slice(0, -1);\n node.init = node.init.body.slice(-1)[0].body;\n body.push(node);\n\n return in_list ? MAP.splice(body) : make_node(AST_BlockStatement, node, {\n body: body\n });\n }\n }\n if (node instanceof AST_Scope && node !== self)\n return node;\n }\n );\n self.transform(tt);\n }\n });\n\n AST_Scope.DEFMETHOD(\"hoist_declarations\", function(compressor){\n var hoist_funs = compressor.option(\"hoist_funs\");\n var hoist_vars = compressor.option(\"hoist_vars\");\n var self = this;\n if (hoist_funs || hoist_vars) {\n var dirs = [];\n var hoisted = [];\n var vars = new Dictionary(), vars_found = 0, var_decl = 0;\n // let's count var_decl first, we seem to waste a lot of\n // space if we hoist `var` when there's only one.\n self.walk(new TreeWalker(function(node){\n if (node instanceof AST_Scope && node !== self)\n return true;\n if (node instanceof AST_Var) {\n ++var_decl;\n return true;\n }\n }));\n hoist_vars = hoist_vars && var_decl > 1;\n var tt = new TreeTransformer(\n function before(node) {\n if (node !== self) {\n if (node instanceof AST_Directive) {\n dirs.push(node);\n return make_node(AST_EmptyStatement, node);\n }\n if (node instanceof AST_Defun && hoist_funs) {\n hoisted.push(node);\n return make_node(AST_EmptyStatement, node);\n }\n if (node instanceof AST_Var && hoist_vars) {\n node.definitions.forEach(function(def){\n vars.set(def.name.name, def);\n ++vars_found;\n });\n var seq = node.to_assignments();\n var p = tt.parent();\n if (p instanceof AST_ForIn && p.init === node) {\n if (seq == null) return node.definitions[0].name;\n return seq;\n }\n if (p instanceof AST_For && p.init === node) {\n return seq;\n }\n if (!seq) return make_node(AST_EmptyStatement, node);\n return make_node(AST_SimpleStatement, node, {\n body: seq\n });\n }\n if (node instanceof AST_Scope)\n return node; // to avoid descending in nested scopes\n }\n }\n );\n self = self.transform(tt);\n if (vars_found > 0) {\n // collect only vars which don't show up in self's arguments list\n var defs = [];\n vars.each(function(def, name){\n if (self instanceof AST_Lambda\n && find_if(function(x){ return x.name == def.name.name },\n self.argnames)) {\n vars.del(name);\n } else {\n def = def.clone();\n def.value = null;\n defs.push(def);\n vars.set(name, def);\n }\n });\n if (defs.length > 0) {\n // try to merge in assignments\n for (var i = 0; i < self.body.length;) {\n if (self.body[i] instanceof AST_SimpleStatement) {\n var expr = self.body[i].body, sym, assign;\n if (expr instanceof AST_Assign\n && expr.operator == \"=\"\n && (sym = expr.left) instanceof AST_Symbol\n && vars.has(sym.name))\n {\n var def = vars.get(sym.name);\n if (def.value) break;\n def.value = expr.right;\n remove(defs, def);\n defs.push(def);\n self.body.splice(i, 1);\n continue;\n }\n if (expr instanceof AST_Seq\n && (assign = expr.car) instanceof AST_Assign\n && assign.operator == \"=\"\n && (sym = assign.left) instanceof AST_Symbol\n && vars.has(sym.name))\n {\n var def = vars.get(sym.name);\n if (def.value) break;\n def.value = assign.right;\n remove(defs, def);\n defs.push(def);\n self.body[i].body = expr.cdr;\n continue;\n }\n }\n if (self.body[i] instanceof AST_EmptyStatement) {\n self.body.splice(i, 1);\n continue;\n }\n if (self.body[i] instanceof AST_BlockStatement) {\n var tmp = [ i, 1 ].concat(self.body[i].body);\n self.body.splice.apply(self.body, tmp);\n continue;\n }\n break;\n }\n defs = make_node(AST_Var, self, {\n definitions: defs\n });\n hoisted.push(defs);\n };\n }\n self.body = dirs.concat(hoisted, self.body);\n }\n return self;\n });\n\n OPT(AST_SimpleStatement, function(self, compressor){\n if (compressor.option(\"side_effects\")) {\n if (!self.body.has_side_effects(compressor)) {\n compressor.warn(\"Dropping side-effect-free statement [{file}:{line},{col}]\", self.start);\n return make_node(AST_EmptyStatement, self);\n }\n }\n return self;\n });\n\n OPT(AST_DWLoop, function(self, compressor){\n var cond = self.condition.evaluate(compressor);\n self.condition = cond[0];\n if (!compressor.option(\"loops\")) return self;\n if (cond.length > 1) {\n if (cond[1]) {\n return make_node(AST_For, self, {\n body: self.body\n });\n } else if (self instanceof AST_While) {\n if (compressor.option(\"dead_code\")) {\n var a = [];\n extract_declarations_from_unreachable_code(compressor, self.body, a);\n return make_node(AST_BlockStatement, self, { body: a });\n }\n }\n }\n return self;\n });\n\n function if_break_in_loop(self, compressor) {\n function drop_it(rest) {\n rest = as_statement_array(rest);\n if (self.body instanceof AST_BlockStatement) {\n self.body = self.body.clone();\n self.body.body = rest.concat(self.body.body.slice(1));\n self.body = self.body.transform(compressor);\n } else {\n self.body = make_node(AST_BlockStatement, self.body, {\n body: rest\n }).transform(compressor);\n }\n if_break_in_loop(self, compressor);\n }\n var first = self.body instanceof AST_BlockStatement ? self.body.body[0] : self.body;\n if (first instanceof AST_If) {\n if (first.body instanceof AST_Break\n && compressor.loopcontrol_target(first.body.label) === self) {\n if (self.condition) {\n self.condition = make_node(AST_Binary, self.condition, {\n left: self.condition,\n operator: \"&&\",\n right: first.condition.negate(compressor),\n });\n } else {\n self.condition = first.condition.negate(compressor);\n }\n drop_it(first.alternative);\n }\n else if (first.alternative instanceof AST_Break\n && compressor.loopcontrol_target(first.alternative.label) === self) {\n if (self.condition) {\n self.condition = make_node(AST_Binary, self.condition, {\n left: self.condition,\n operator: \"&&\",\n right: first.condition,\n });\n } else {\n self.condition = first.condition;\n }\n drop_it(first.body);\n }\n }\n };\n\n OPT(AST_While, function(self, compressor) {\n if (!compressor.option(\"loops\")) return self;\n self = AST_DWLoop.prototype.optimize.call(self, compressor);\n if (self instanceof AST_While) {\n if_break_in_loop(self, compressor);\n self = make_node(AST_For, self, self).transform(compressor);\n }\n return self;\n });\n\n OPT(AST_For, function(self, compressor){\n var cond = self.condition;\n if (cond) {\n cond = cond.evaluate(compressor);\n self.condition = cond[0];\n }\n if (!compressor.option(\"loops\")) return self;\n if (cond) {\n if (cond.length > 1 && !cond[1]) {\n if (compressor.option(\"dead_code\")) {\n var a = [];\n if (self.init instanceof AST_Statement) {\n a.push(self.init);\n }\n else if (self.init) {\n a.push(make_node(AST_SimpleStatement, self.init, {\n body: self.init\n }));\n }\n extract_declarations_from_unreachable_code(compressor, self.body, a);\n return make_node(AST_BlockStatement, self, { body: a });\n }\n }\n }\n if_break_in_loop(self, compressor);\n return self;\n });\n\n OPT(AST_If, function(self, compressor){\n if (!compressor.option(\"conditionals\")) return self;\n // if condition can be statically determined, warn and drop\n // one of the blocks. note, statically determined implies\n // “has no side effects”; also it doesn't work for cases like\n // `x && true`, though it probably should.\n var cond = self.condition.evaluate(compressor);\n self.condition = cond[0];\n if (cond.length > 1) {\n if (cond[1]) {\n compressor.warn(\"Condition always true [{file}:{line},{col}]\", self.condition.start);\n if (compressor.option(\"dead_code\")) {\n var a = [];\n if (self.alternative) {\n extract_declarations_from_unreachable_code(compressor, self.alternative, a);\n }\n a.push(self.body);\n return make_node(AST_BlockStatement, self, { body: a }).transform(compressor);\n }\n } else {\n compressor.warn(\"Condition always false [{file}:{line},{col}]\", self.condition.start);\n if (compressor.option(\"dead_code\")) {\n var a = [];\n extract_declarations_from_unreachable_code(compressor, self.body, a);\n if (self.alternative) a.push(self.alternative);\n return make_node(AST_BlockStatement, self, { body: a }).transform(compressor);\n }\n }\n }\n if (is_empty(self.alternative)) self.alternative = null;\n var negated = self.condition.negate(compressor);\n var negated_is_best = best_of(self.condition, negated) === negated;\n if (self.alternative && negated_is_best) {\n negated_is_best = false; // because we already do the switch here.\n self.condition = negated;\n var tmp = self.body;\n self.body = self.alternative || make_node(AST_EmptyStatement);\n self.alternative = tmp;\n }\n if (is_empty(self.body) && is_empty(self.alternative)) {\n return make_node(AST_SimpleStatement, self.condition, {\n body: self.condition\n }).transform(compressor);\n }\n if (self.body instanceof AST_SimpleStatement\n && self.alternative instanceof AST_SimpleStatement) {\n return make_node(AST_SimpleStatement, self, {\n body: make_node(AST_Conditional, self, {\n condition : self.condition,\n consequent : self.body.body,\n alternative : self.alternative.body\n })\n }).transform(compressor);\n }\n if (is_empty(self.alternative) && self.body instanceof AST_SimpleStatement) {\n if (negated_is_best) return make_node(AST_SimpleStatement, self, {\n body: make_node(AST_Binary, self, {\n operator : \"||\",\n left : negated,\n right : self.body.body\n })\n }).transform(compressor);\n return make_node(AST_SimpleStatement, self, {\n body: make_node(AST_Binary, self, {\n operator : \"&&\",\n left : self.condition,\n right : self.body.body\n })\n }).transform(compressor);\n }\n if (self.body instanceof AST_EmptyStatement\n && self.alternative\n && self.alternative instanceof AST_SimpleStatement) {\n return make_node(AST_SimpleStatement, self, {\n body: make_node(AST_Binary, self, {\n operator : \"||\",\n left : self.condition,\n right : self.alternative.body\n })\n }).transform(compressor);\n }\n if (self.body instanceof AST_Exit\n && self.alternative instanceof AST_Exit\n && self.body.TYPE == self.alternative.TYPE) {\n return make_node(self.body.CTOR, self, {\n value: make_node(AST_Conditional, self, {\n condition : self.condition,\n consequent : self.body.value || make_node(AST_Undefined, self.body).optimize(compressor),\n alternative : self.alternative.value || make_node(AST_Undefined, self.alternative).optimize(compressor)\n })\n }).transform(compressor);\n }\n if (self.body instanceof AST_If\n && !self.body.alternative\n && !self.alternative) {\n self.condition = make_node(AST_Binary, self.condition, {\n operator: \"&&\",\n left: self.condition,\n right: self.body.condition\n }).transform(compressor);\n self.body = self.body.body;\n }\n if (aborts(self.body)) {\n if (self.alternative) {\n var alt = self.alternative;\n self.alternative = null;\n return make_node(AST_BlockStatement, self, {\n body: [ self, alt ]\n }).transform(compressor);\n }\n }\n if (aborts(self.alternative)) {\n var body = self.body;\n self.body = self.alternative;\n self.condition = negated_is_best ? negated : self.condition.negate(compressor);\n self.alternative = null;\n return make_node(AST_BlockStatement, self, {\n body: [ self, body ]\n }).transform(compressor);\n }\n return self;\n });\n\n OPT(AST_Switch, function(self, compressor){\n if (self.body.length == 0 && compressor.option(\"conditionals\")) {\n return make_node(AST_SimpleStatement, self, {\n body: self.expression\n }).transform(compressor);\n }\n for(;;) {\n var last_branch = self.body[self.body.length - 1];\n if (last_branch) {\n var stat = last_branch.body[last_branch.body.length - 1]; // last statement\n if (stat instanceof AST_Break && loop_body(compressor.loopcontrol_target(stat.label)) === self)\n last_branch.body.pop();\n if (last_branch instanceof AST_Default && last_branch.body.length == 0) {\n self.body.pop();\n continue;\n }\n }\n break;\n }\n var exp = self.expression.evaluate(compressor);\n out: if (exp.length == 2) try {\n // constant expression\n self.expression = exp[0];\n if (!compressor.option(\"dead_code\")) break out;\n var value = exp[1];\n var in_if = false;\n var in_block = false;\n var started = false;\n var stopped = false;\n var ruined = false;\n var tt = new TreeTransformer(function(node, descend, in_list){\n if (node instanceof AST_Lambda || node instanceof AST_SimpleStatement) {\n // no need to descend these node types\n return node;\n }\n else if (node instanceof AST_Switch && node === self) {\n node = node.clone();\n descend(node, this);\n return ruined ? node : make_node(AST_BlockStatement, node, {\n body: node.body.reduce(function(a, branch){\n return a.concat(branch.body);\n }, [])\n }).transform(compressor);\n }\n else if (node instanceof AST_If || node instanceof AST_Try) {\n var save = in_if;\n in_if = !in_block;\n descend(node, this);\n in_if = save;\n return node;\n }\n else if (node instanceof AST_StatementWithBody || node instanceof AST_Switch) {\n var save = in_block;\n in_block = true;\n descend(node, this);\n in_block = save;\n return node;\n }\n else if (node instanceof AST_Break && this.loopcontrol_target(node.label) === self) {\n if (in_if) {\n ruined = true;\n return node;\n }\n if (in_block) return node;\n stopped = true;\n return in_list ? MAP.skip : make_node(AST_EmptyStatement, node);\n }\n else if (node instanceof AST_SwitchBranch && this.parent() === self) {\n if (stopped) return MAP.skip;\n if (node instanceof AST_Case) {\n var exp = node.expression.evaluate(compressor);\n if (exp.length < 2) {\n // got a case with non-constant expression, baling out\n throw self;\n }\n if (exp[1] === value || started) {\n started = true;\n if (aborts(node)) stopped = true;\n descend(node, this);\n return node;\n }\n return MAP.skip;\n }\n descend(node, this);\n return node;\n }\n });\n tt.stack = compressor.stack.slice(); // so that's able to see parent nodes\n self = self.transform(tt);\n } catch(ex) {\n if (ex !== self) throw ex;\n }\n return self;\n });\n\n OPT(AST_Case, function(self, compressor){\n self.body = tighten_body(self.body, compressor);\n return self;\n });\n\n OPT(AST_Try, function(self, compressor){\n self.body = tighten_body(self.body, compressor);\n return self;\n });\n\n AST_Definitions.DEFMETHOD(\"remove_initializers\", function(){\n this.definitions.forEach(function(def){ def.value = null });\n });\n\n AST_Definitions.DEFMETHOD(\"to_assignments\", function(){\n var assignments = this.definitions.reduce(function(a, def){\n if (def.value) {\n var name = make_node(AST_SymbolRef, def.name, def.name);\n a.push(make_node(AST_Assign, def, {\n operator : \"=\",\n left : name,\n right : def.value\n }));\n }\n return a;\n }, []);\n if (assignments.length == 0) return null;\n return AST_Seq.from_array(assignments);\n });\n\n OPT(AST_Definitions, function(self, compressor){\n if (self.definitions.length == 0)\n return make_node(AST_EmptyStatement, self);\n return self;\n });\n\n OPT(AST_Function, function(self, compressor){\n self = AST_Lambda.prototype.optimize.call(self, compressor);\n if (compressor.option(\"unused\")) {\n if (self.name && self.name.unreferenced()) {\n self.name = null;\n }\n }\n return self;\n });\n\n OPT(AST_Call, function(self, compressor){\n if (compressor.option(\"unsafe\")) {\n var exp = self.expression;\n if (exp instanceof AST_SymbolRef && exp.undeclared()) {\n switch (exp.name) {\n case \"Array\":\n if (self.args.length != 1) {\n return make_node(AST_Array, self, {\n elements: self.args\n }).transform(compressor);\n }\n break;\n case \"Object\":\n if (self.args.length == 0) {\n return make_node(AST_Object, self, {\n properties: []\n });\n }\n break;\n case \"String\":\n if (self.args.length == 0) return make_node(AST_String, self, {\n value: \"\"\n });\n if (self.args.length <= 1) return make_node(AST_Binary, self, {\n left: self.args[0],\n operator: \"+\",\n right: make_node(AST_String, self, { value: \"\" })\n }).transform(compressor);\n break;\n case \"Number\":\n if (self.args.length == 0) return make_node(AST_Number, self, {\n value: 0\n });\n if (self.args.length == 1) return make_node(AST_UnaryPrefix, self, {\n expression: self.args[0],\n operator: \"+\"\n }).transform(compressor);\n case \"Boolean\":\n if (self.args.length == 0) return make_node(AST_False, self);\n if (self.args.length == 1) return make_node(AST_UnaryPrefix, self, {\n expression: make_node(AST_UnaryPrefix, null, {\n expression: self.args[0],\n operator: \"!\"\n }),\n operator: \"!\"\n }).transform(compressor);\n break;\n case \"Function\":\n if (all(self.args, function(x){ return x instanceof AST_String })) {\n // quite a corner-case, but we can handle it:\n // https://github.com/mishoo/UglifyJS2/issues/203\n // if the code argument is a constant, then we can minify it.\n try {\n var code = \"(function(\" + self.args.slice(0, -1).map(function(arg){\n return arg.value;\n }).join(\",\") + \"){\" + self.args[self.args.length - 1].value + \"})()\";\n var ast = parse(code);\n ast.figure_out_scope({ screw_ie8: compressor.option(\"screw_ie8\") });\n var comp = new Compressor(compressor.options);\n ast = ast.transform(comp);\n ast.figure_out_scope({ screw_ie8: compressor.option(\"screw_ie8\") });\n ast.mangle_names();\n var fun;\n try {\n ast.walk(new TreeWalker(function(node){\n if (node instanceof AST_Lambda) {\n fun = node;\n throw ast;\n }\n }));\n } catch(ex) {\n if (ex !== ast) throw ex;\n };\n var args = fun.argnames.map(function(arg, i){\n return make_node(AST_String, self.args[i], {\n value: arg.print_to_string()\n });\n });\n var code = OutputStream();\n AST_BlockStatement.prototype._codegen.call(fun, fun, code);\n code = code.toString().replace(/^\\{|\\}$/g, \"\");\n args.push(make_node(AST_String, self.args[self.args.length - 1], {\n value: code\n }));\n self.args = args;\n return self;\n } catch(ex) {\n if (ex instanceof JS_Parse_Error) {\n compressor.warn(\"Error parsing code passed to new Function [{file}:{line},{col}]\", self.args[self.args.length - 1].start);\n compressor.warn(ex.toString());\n } else {\n console.log(ex);\n throw ex;\n }\n }\n }\n break;\n }\n }\n else if (exp instanceof AST_Dot && exp.property == \"toString\" && self.args.length == 0) {\n return make_node(AST_Binary, self, {\n left: make_node(AST_String, self, { value: \"\" }),\n operator: \"+\",\n right: exp.expression\n }).transform(compressor);\n }\n else if (exp instanceof AST_Dot && exp.expression instanceof AST_Array && exp.property == \"join\") EXIT: {\n var separator = self.args.length == 0 ? \",\" : self.args[0].evaluate(compressor)[1];\n if (separator == null) break EXIT; // not a constant\n var elements = exp.expression.elements.reduce(function(a, el){\n el = el.evaluate(compressor);\n if (a.length == 0 || el.length == 1) {\n a.push(el);\n } else {\n var last = a[a.length - 1];\n if (last.length == 2) {\n // it's a constant\n var val = \"\" + last[1] + separator + el[1];\n a[a.length - 1] = [ make_node_from_constant(compressor, val, last[0]), val ];\n } else {\n a.push(el);\n }\n }\n return a;\n }, []);\n if (elements.length == 0) return make_node(AST_String, self, { value: \"\" });\n if (elements.length == 1) return elements[0][0];\n if (separator == \"\") {\n var first;\n if (elements[0][0] instanceof AST_String\n || elements[1][0] instanceof AST_String) {\n first = elements.shift()[0];\n } else {\n first = make_node(AST_String, self, { value: \"\" });\n }\n return elements.reduce(function(prev, el){\n return make_node(AST_Binary, el[0], {\n operator : \"+\",\n left : prev,\n right : el[0],\n });\n }, first).transform(compressor);\n }\n // need this awkward cloning to not affect original element\n // best_of will decide which one to get through.\n var node = self.clone();\n node.expression = node.expression.clone();\n node.expression.expression = node.expression.expression.clone();\n node.expression.expression.elements = elements.map(function(el){\n return el[0];\n });\n return best_of(self, node);\n }\n }\n if (compressor.option(\"side_effects\")) {\n if (self.expression instanceof AST_Function\n && self.args.length == 0\n && !AST_Block.prototype.has_side_effects.call(self.expression, compressor)) {\n return make_node(AST_Undefined, self).transform(compressor);\n }\n }\n if (compressor.option(\"drop_console\")) {\n if (self.expression instanceof AST_PropAccess &&\n self.expression.expression instanceof AST_SymbolRef &&\n self.expression.expression.name == \"console\" &&\n self.expression.expression.undeclared()) {\n return make_node(AST_Undefined, self).transform(compressor);\n }\n }\n return self.evaluate(compressor)[0];\n });\n\n OPT(AST_New, function(self, compressor){\n if (compressor.option(\"unsafe\")) {\n var exp = self.expression;\n if (exp instanceof AST_SymbolRef && exp.undeclared()) {\n switch (exp.name) {\n case \"Object\":\n case \"RegExp\":\n case \"Function\":\n case \"Error\":\n case \"Array\":\n return make_node(AST_Call, self, self).transform(compressor);\n }\n }\n }\n return self;\n });\n\n OPT(AST_Seq, function(self, compressor){\n if (!compressor.option(\"side_effects\"))\n return self;\n if (!self.car.has_side_effects(compressor)) {\n // we shouldn't compress (1,eval)(something) to\n // eval(something) because that changes the meaning of\n // eval (becomes lexical instead of global).\n var p;\n if (!(self.cdr instanceof AST_SymbolRef\n && self.cdr.name == \"eval\"\n && self.cdr.undeclared()\n && (p = compressor.parent()) instanceof AST_Call\n && p.expression === self)) {\n return self.cdr;\n }\n }\n if (compressor.option(\"cascade\")) {\n if (self.car instanceof AST_Assign\n && !self.car.left.has_side_effects(compressor)) {\n if (self.car.left.equivalent_to(self.cdr)) {\n return self.car;\n }\n if (self.cdr instanceof AST_Call\n && self.cdr.expression.equivalent_to(self.car.left)) {\n self.cdr.expression = self.car;\n return self.cdr;\n }\n }\n if (!self.car.has_side_effects(compressor)\n && !self.cdr.has_side_effects(compressor)\n && self.car.equivalent_to(self.cdr)) {\n return self.car;\n }\n }\n if (self.cdr instanceof AST_UnaryPrefix\n && self.cdr.operator == \"void\"\n && !self.cdr.expression.has_side_effects(compressor)) {\n self.cdr.operator = self.car;\n return self.cdr;\n }\n if (self.cdr instanceof AST_Undefined) {\n return make_node(AST_UnaryPrefix, self, {\n operator : \"void\",\n expression : self.car\n });\n }\n return self;\n });\n\n AST_Unary.DEFMETHOD(\"lift_sequences\", function(compressor){\n if (compressor.option(\"sequences\")) {\n if (this.expression instanceof AST_Seq) {\n var seq = this.expression;\n var x = seq.to_array();\n this.expression = x.pop();\n x.push(this);\n seq = AST_Seq.from_array(x).transform(compressor);\n return seq;\n }\n }\n return this;\n });\n\n OPT(AST_UnaryPostfix, function(self, compressor){\n return self.lift_sequences(compressor);\n });\n\n OPT(AST_UnaryPrefix, function(self, compressor){\n self = self.lift_sequences(compressor);\n var e = self.expression;\n if (compressor.option(\"booleans\") && compressor.in_boolean_context()) {\n switch (self.operator) {\n case \"!\":\n if (e instanceof AST_UnaryPrefix && e.operator == \"!\") {\n // !!foo ==> foo, if we're in boolean context\n return e.expression;\n }\n break;\n case \"typeof\":\n // typeof always returns a non-empty string, thus it's\n // always true in booleans\n compressor.warn(\"Boolean expression always true [{file}:{line},{col}]\", self.start);\n return make_node(AST_True, self);\n }\n if (e instanceof AST_Binary && self.operator == \"!\") {\n self = best_of(self, e.negate(compressor));\n }\n }\n return self.evaluate(compressor)[0];\n });\n\n function has_side_effects_or_prop_access(node, compressor) {\n var save_pure_getters = compressor.option(\"pure_getters\");\n compressor.options.pure_getters = false;\n var ret = node.has_side_effects(compressor);\n compressor.options.pure_getters = save_pure_getters;\n return ret;\n }\n\n AST_Binary.DEFMETHOD(\"lift_sequences\", function(compressor){\n if (compressor.option(\"sequences\")) {\n if (this.left instanceof AST_Seq) {\n var seq = this.left;\n var x = seq.to_array();\n this.left = x.pop();\n x.push(this);\n seq = AST_Seq.from_array(x).transform(compressor);\n return seq;\n }\n if (this.right instanceof AST_Seq\n && this instanceof AST_Assign\n && !has_side_effects_or_prop_access(this.left, compressor)) {\n var seq = this.right;\n var x = seq.to_array();\n this.right = x.pop();\n x.push(this);\n seq = AST_Seq.from_array(x).transform(compressor);\n return seq;\n }\n }\n return this;\n });\n\n var commutativeOperators = makePredicate(\"== === != !== * & | ^\");\n\n OPT(AST_Binary, function(self, compressor){\n var reverse = compressor.has_directive(\"use asm\") ? noop\n : function(op, force) {\n if (force || !(self.left.has_side_effects(compressor) || self.right.has_side_effects(compressor))) {\n if (op) self.operator = op;\n var tmp = self.left;\n self.left = self.right;\n self.right = tmp;\n }\n };\n if (commutativeOperators(self.operator)) {\n if (self.right instanceof AST_Constant\n && !(self.left instanceof AST_Constant)) {\n // if right is a constant, whatever side effects the\n // left side might have could not influence the\n // result. hence, force switch.\n\n if (!(self.left instanceof AST_Binary\n && PRECEDENCE[self.left.operator] >= PRECEDENCE[self.operator])) {\n reverse(null, true);\n }\n }\n if (/^[!=]==?$/.test(self.operator)) {\n if (self.left instanceof AST_SymbolRef && self.right instanceof AST_Conditional) {\n if (self.right.consequent instanceof AST_SymbolRef\n && self.right.consequent.definition() === self.left.definition()) {\n if (/^==/.test(self.operator)) return self.right.condition;\n if (/^!=/.test(self.operator)) return self.right.condition.negate(compressor);\n }\n if (self.right.alternative instanceof AST_SymbolRef\n && self.right.alternative.definition() === self.left.definition()) {\n if (/^==/.test(self.operator)) return self.right.condition.negate(compressor);\n if (/^!=/.test(self.operator)) return self.right.condition;\n }\n }\n if (self.right instanceof AST_SymbolRef && self.left instanceof AST_Conditional) {\n if (self.left.consequent instanceof AST_SymbolRef\n && self.left.consequent.definition() === self.right.definition()) {\n if (/^==/.test(self.operator)) return self.left.condition;\n if (/^!=/.test(self.operator)) return self.left.condition.negate(compressor);\n }\n if (self.left.alternative instanceof AST_SymbolRef\n && self.left.alternative.definition() === self.right.definition()) {\n if (/^==/.test(self.operator)) return self.left.condition.negate(compressor);\n if (/^!=/.test(self.operator)) return self.left.condition;\n }\n }\n }\n }\n self = self.lift_sequences(compressor);\n if (compressor.option(\"comparisons\")) switch (self.operator) {\n case \"===\":\n case \"!==\":\n if ((self.left.is_string(compressor) && self.right.is_string(compressor)) ||\n (self.left.is_boolean() && self.right.is_boolean())) {\n self.operator = self.operator.substr(0, 2);\n }\n // XXX: intentionally falling down to the next case\n case \"==\":\n case \"!=\":\n if (self.left instanceof AST_String\n && self.left.value == \"undefined\"\n && self.right instanceof AST_UnaryPrefix\n && self.right.operator == \"typeof\"\n && compressor.option(\"unsafe\")) {\n if (!(self.right.expression instanceof AST_SymbolRef)\n || !self.right.expression.undeclared()) {\n self.right = self.right.expression;\n self.left = make_node(AST_Undefined, self.left).optimize(compressor);\n if (self.operator.length == 2) self.operator += \"=\";\n }\n }\n break;\n }\n if (compressor.option(\"booleans\") && compressor.in_boolean_context()) switch (self.operator) {\n case \"&&\":\n var ll = self.left.evaluate(compressor);\n var rr = self.right.evaluate(compressor);\n if ((ll.length > 1 && !ll[1]) || (rr.length > 1 && !rr[1])) {\n compressor.warn(\"Boolean && always false [{file}:{line},{col}]\", self.start);\n return make_node(AST_False, self);\n }\n if (ll.length > 1 && ll[1]) {\n return rr[0];\n }\n if (rr.length > 1 && rr[1]) {\n return ll[0];\n }\n break;\n case \"||\":\n var ll = self.left.evaluate(compressor);\n var rr = self.right.evaluate(compressor);\n if ((ll.length > 1 && ll[1]) || (rr.length > 1 && rr[1])) {\n compressor.warn(\"Boolean || always true [{file}:{line},{col}]\", self.start);\n return make_node(AST_True, self);\n }\n if (ll.length > 1 && !ll[1]) {\n return rr[0];\n }\n if (rr.length > 1 && !rr[1]) {\n return ll[0];\n }\n break;\n case \"+\":\n var ll = self.left.evaluate(compressor);\n var rr = self.right.evaluate(compressor);\n if ((ll.length > 1 && ll[0] instanceof AST_String && ll[1]) ||\n (rr.length > 1 && rr[0] instanceof AST_String && rr[1])) {\n compressor.warn(\"+ in boolean context always true [{file}:{line},{col}]\", self.start);\n return make_node(AST_True, self);\n }\n break;\n }\n if (compressor.option(\"comparisons\")) {\n if (!(compressor.parent() instanceof AST_Binary)\n || compressor.parent() instanceof AST_Assign) {\n var negated = make_node(AST_UnaryPrefix, self, {\n operator: \"!\",\n expression: self.negate(compressor)\n });\n self = best_of(self, negated);\n }\n switch (self.operator) {\n case \"<\": reverse(\">\"); break;\n case \"<=\": reverse(\">=\"); break;\n }\n }\n if (self.operator == \"+\" && self.right instanceof AST_String\n && self.right.getValue() === \"\" && self.left instanceof AST_Binary\n && self.left.operator == \"+\" && self.left.is_string(compressor)) {\n return self.left;\n }\n if (compressor.option(\"evaluate\")) {\n if (self.operator == \"+\") {\n if (self.left instanceof AST_Constant\n && self.right instanceof AST_Binary\n && self.right.operator == \"+\"\n && self.right.left instanceof AST_Constant\n && self.right.is_string(compressor)) {\n self = make_node(AST_Binary, self, {\n operator: \"+\",\n left: make_node(AST_String, null, {\n value: \"\" + self.left.getValue() + self.right.left.getValue(),\n start: self.left.start,\n end: self.right.left.end\n }),\n right: self.right.right\n });\n }\n if (self.right instanceof AST_Constant\n && self.left instanceof AST_Binary\n && self.left.operator == \"+\"\n && self.left.right instanceof AST_Constant\n && self.left.is_string(compressor)) {\n self = make_node(AST_Binary, self, {\n operator: \"+\",\n left: self.left.left,\n right: make_node(AST_String, null, {\n value: \"\" + self.left.right.getValue() + self.right.getValue(),\n start: self.left.right.start,\n end: self.right.end\n })\n });\n }\n if (self.left instanceof AST_Binary\n && self.left.operator == \"+\"\n && self.left.is_string(compressor)\n && self.left.right instanceof AST_Constant\n && self.right instanceof AST_Binary\n && self.right.operator == \"+\"\n && self.right.left instanceof AST_Constant\n && self.right.is_string(compressor)) {\n self = make_node(AST_Binary, self, {\n operator: \"+\",\n left: make_node(AST_Binary, self.left, {\n operator: \"+\",\n left: self.left.left,\n right: make_node(AST_String, null, {\n value: \"\" + self.left.right.getValue() + self.right.left.getValue(),\n start: self.left.right.start,\n end: self.right.left.end\n })\n }),\n right: self.right.right\n });\n }\n }\n }\n // x * (y * z) ==> x * y * z\n if (self.right instanceof AST_Binary\n && self.right.operator == self.operator\n && (self.operator == \"*\" || self.operator == \"&&\" || self.operator == \"||\"))\n {\n self.left = make_node(AST_Binary, self.left, {\n operator : self.operator,\n left : self.left,\n right : self.right.left\n });\n self.right = self.right.right;\n return self.transform(compressor);\n }\n return self.evaluate(compressor)[0];\n });\n\n OPT(AST_SymbolRef, function(self, compressor){\n if (self.undeclared()) {\n var defines = compressor.option(\"global_defs\");\n if (defines && defines.hasOwnProperty(self.name)) {\n return make_node_from_constant(compressor, defines[self.name], self);\n }\n switch (self.name) {\n case \"undefined\":\n return make_node(AST_Undefined, self);\n case \"NaN\":\n return make_node(AST_NaN, self);\n case \"Infinity\":\n return make_node(AST_Infinity, self);\n }\n }\n return self;\n });\n\n OPT(AST_Undefined, function(self, compressor){\n if (compressor.option(\"unsafe\")) {\n var scope = compressor.find_parent(AST_Scope);\n var undef = scope.find_variable(\"undefined\");\n if (undef) {\n var ref = make_node(AST_SymbolRef, self, {\n name : \"undefined\",\n scope : scope,\n thedef : undef\n });\n ref.reference();\n return ref;\n }\n }\n return self;\n });\n\n var ASSIGN_OPS = [ '+', '-', '/', '*', '%', '>>', '<<', '>>>', '|', '^', '&' ];\n OPT(AST_Assign, function(self, compressor){\n self = self.lift_sequences(compressor);\n if (self.operator == \"=\"\n && self.left instanceof AST_SymbolRef\n && self.right instanceof AST_Binary\n && self.right.left instanceof AST_SymbolRef\n && self.right.left.name == self.left.name\n && member(self.right.operator, ASSIGN_OPS)) {\n self.operator = self.right.operator + \"=\";\n self.right = self.right.right;\n }\n return self;\n });\n\n OPT(AST_Conditional, function(self, compressor){\n if (!compressor.option(\"conditionals\")) return self;\n if (self.condition instanceof AST_Seq) {\n var car = self.condition.car;\n self.condition = self.condition.cdr;\n return AST_Seq.cons(car, self);\n }\n var cond = self.condition.evaluate(compressor);\n if (cond.length > 1) {\n if (cond[1]) {\n compressor.warn(\"Condition always true [{file}:{line},{col}]\", self.start);\n return self.consequent;\n } else {\n compressor.warn(\"Condition always false [{file}:{line},{col}]\", self.start);\n return self.alternative;\n }\n }\n var negated = cond[0].negate(compressor);\n if (best_of(cond[0], negated) === negated) {\n self = make_node(AST_Conditional, self, {\n condition: negated,\n consequent: self.alternative,\n alternative: self.consequent\n });\n }\n var consequent = self.consequent;\n var alternative = self.alternative;\n if (consequent instanceof AST_Assign\n && alternative instanceof AST_Assign\n && consequent.operator == alternative.operator\n && consequent.left.equivalent_to(alternative.left)\n ) {\n /*\n * Stuff like this:\n * if (foo) exp = something; else exp = something_else;\n * ==>\n * exp = foo ? something : something_else;\n */\n return make_node(AST_Assign, self, {\n operator: consequent.operator,\n left: consequent.left,\n right: make_node(AST_Conditional, self, {\n condition: self.condition,\n consequent: consequent.right,\n alternative: alternative.right\n })\n });\n }\n if (consequent instanceof AST_Call\n && alternative.TYPE === consequent.TYPE\n && consequent.args.length == alternative.args.length\n && consequent.expression.equivalent_to(alternative.expression)) {\n if (consequent.args.length == 0) {\n return make_node(AST_Seq, self, {\n car: self.condition,\n cdr: consequent\n });\n }\n if (consequent.args.length == 1) {\n consequent.args[0] = make_node(AST_Conditional, self, {\n condition: self.condition,\n consequent: consequent.args[0],\n alternative: alternative.args[0]\n });\n return consequent;\n }\n }\n // x?y?z:a:a --> x&&y?z:a\n if (consequent instanceof AST_Conditional\n && consequent.alternative.equivalent_to(alternative)) {\n return make_node(AST_Conditional, self, {\n condition: make_node(AST_Binary, self, {\n left: self.condition,\n operator: \"&&\",\n right: consequent.condition\n }),\n consequent: consequent.consequent,\n alternative: alternative\n });\n }\n return self;\n });\n\n OPT(AST_Boolean, function(self, compressor){\n if (compressor.option(\"booleans\")) {\n var p = compressor.parent();\n if (p instanceof AST_Binary && (p.operator == \"==\"\n || p.operator == \"!=\")) {\n compressor.warn(\"Non-strict equality against boolean: {operator} {value} [{file}:{line},{col}]\", {\n operator : p.operator,\n value : self.value,\n file : p.start.file,\n line : p.start.line,\n col : p.start.col,\n });\n return make_node(AST_Number, self, {\n value: +self.value\n });\n }\n return make_node(AST_UnaryPrefix, self, {\n operator: \"!\",\n expression: make_node(AST_Number, self, {\n value: 1 - self.value\n })\n });\n }\n return self;\n });\n\n OPT(AST_Sub, function(self, compressor){\n var prop = self.property;\n if (prop instanceof AST_String && compressor.option(\"properties\")) {\n prop = prop.getValue();\n if (RESERVED_WORDS(prop) ? compressor.option(\"screw_ie8\") : is_identifier_string(prop)) {\n return make_node(AST_Dot, self, {\n expression : self.expression,\n property : prop\n });\n }\n var v = parseFloat(prop);\n if (!isNaN(v) && v.toString() == prop) {\n self.property = make_node(AST_Number, self.property, {\n value: v\n });\n }\n }\n return self;\n });\n\n function literals_in_boolean_context(self, compressor) {\n if (compressor.option(\"booleans\") && compressor.in_boolean_context()) {\n return make_node(AST_True, self);\n }\n return self;\n };\n OPT(AST_Array, literals_in_boolean_context);\n OPT(AST_Object, literals_in_boolean_context);\n OPT(AST_RegExp, literals_in_boolean_context);\n\n})();\n\n/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n <[email protected]>\n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon <[email protected]>\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\n// a small wrapper around fitzgen's source-map library\nfunction SourceMap(options) {\n options = defaults(options, {\n file : null,\n root : null,\n orig : null,\n\n orig_line_diff : 0,\n dest_line_diff : 0,\n });\n var generator = new MOZ_SourceMap.SourceMapGenerator({\n file : options.file,\n sourceRoot : options.root\n });\n var orig_map = options.orig && new MOZ_SourceMap.SourceMapConsumer(options.orig);\n function add(source, gen_line, gen_col, orig_line, orig_col, name) {\n if (orig_map) {\n var info = orig_map.originalPositionFor({\n line: orig_line,\n column: orig_col\n });\n if (info.source === null) {\n return;\n }\n source = info.source;\n orig_line = info.line;\n orig_col = info.column;\n name = info.name;\n }\n generator.addMapping({\n generated : { line: gen_line + options.dest_line_diff, column: gen_col },\n original : { line: orig_line + options.orig_line_diff, column: orig_col },\n source : source,\n name : name\n });\n };\n return {\n add : add,\n get : function() { return generator },\n toString : function() { return generator.toString() }\n };\n};\n\n/***********************************************************************\n\n A JavaScript tokenizer / parser / beautifier / compressor.\n https://github.com/mishoo/UglifyJS2\n\n -------------------------------- (C) ---------------------------------\n\n Author: Mihai Bazon\n <[email protected]>\n http://mihai.bazon.net/blog\n\n Distributed under the BSD license:\n\n Copyright 2012 (c) Mihai Bazon <[email protected]>\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n\n * Redistributions of source code must retain the above\n copyright notice, this list of conditions and the following\n disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials\n provided with the distribution.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\n EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\n OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\n TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\n THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n SUCH DAMAGE.\n\n ***********************************************************************/\n\n\"use strict\";\n\n(function(){\n\n var MOZ_TO_ME = {\n TryStatement : function(M) {\n return new AST_Try({\n start : my_start_token(M),\n end : my_end_token(M),\n body : from_moz(M.block).body,\n bcatch : from_moz(M.handlers[0]),\n bfinally : M.finalizer ? new AST_Finally(from_moz(M.finalizer)) : null\n });\n },\n CatchClause : function(M) {\n return new AST_Catch({\n start : my_start_token(M),\n end : my_end_token(M),\n argname : from_moz(M.param),\n body : from_moz(M.body).body\n });\n },\n ObjectExpression : function(M) {\n return new AST_Object({\n start : my_start_token(M),\n end : my_end_token(M),\n properties : M.properties.map(function(prop){\n var key = prop.key;\n var name = key.type == \"Identifier\" ? key.name : key.value;\n var args = {\n start : my_start_token(key),\n end : my_end_token(prop.value),\n key : name,\n value : from_moz(prop.value)\n };\n switch (prop.kind) {\n case \"init\":\n return new AST_ObjectKeyVal(args);\n case \"set\":\n args.value.name = from_moz(key);\n return new AST_ObjectSetter(args);\n case \"get\":\n args.value.name = from_moz(key);\n return new AST_ObjectGetter(args);\n }\n })\n });\n },\n SequenceExpression : function(M) {\n return AST_Seq.from_array(M.expressions.map(from_moz));\n },\n MemberExpression : function(M) {\n return new (M.computed ? AST_Sub : AST_Dot)({\n start : my_start_token(M),\n end : my_end_token(M),\n property : M.computed ? from_moz(M.property) : M.property.name,\n expression : from_moz(M.object)\n });\n },\n SwitchCase : function(M) {\n return new (M.test ? AST_Case : AST_Default)({\n start : my_start_token(M),\n end : my_end_token(M),\n expression : from_moz(M.test),\n body : M.consequent.map(from_moz)\n });\n },\n Literal : function(M) {\n var val = M.value, args = {\n start : my_start_token(M),\n end : my_end_token(M)\n };\n if (val === null) return new AST_Null(args);\n switch (typeof val) {\n case \"string\":\n args.value = val;\n return new AST_String(args);\n case \"number\":\n args.value = val;\n return new AST_Number(args);\n case \"boolean\":\n return new (val ? AST_True : AST_False)(args);\n default:\n args.value = val;\n return new AST_RegExp(args);\n }\n },\n UnaryExpression: From_Moz_Unary,\n UpdateExpression: From_Moz_Unary,\n Identifier: function(M) {\n var p = FROM_MOZ_STACK[FROM_MOZ_STACK.length - 2];\n return new (M.name == \"this\" ? AST_This\n : p.type == \"LabeledStatement\" ? AST_Label\n : p.type == \"VariableDeclarator\" && p.id === M ? (p.kind == \"const\" ? AST_SymbolConst : AST_SymbolVar)\n : p.type == \"FunctionExpression\" ? (p.id === M ? AST_SymbolLambda : AST_SymbolFunarg)\n : p.type == \"FunctionDeclaration\" ? (p.id === M ? AST_SymbolDefun : AST_SymbolFunarg)\n : p.type == \"CatchClause\" ? AST_SymbolCatch\n : p.type == \"BreakStatement\" || p.type == \"ContinueStatement\" ? AST_LabelRef\n : AST_SymbolRef)({\n start : my_start_token(M),\n end : my_end_token(M),\n name : M.name\n });\n }\n };\n\n function From_Moz_Unary(M) {\n var prefix = \"prefix\" in M ? M.prefix\n : M.type == \"UnaryExpression\" ? true : false;\n return new (prefix ? AST_UnaryPrefix : AST_UnaryPostfix)({\n start : my_start_token(M),\n end : my_end_token(M),\n operator : M.operator,\n expression : from_moz(M.argument)\n });\n };\n\n var ME_TO_MOZ = {};\n\n map(\"Node\", AST_Node);\n map(\"Program\", AST_Toplevel, \"body@body\");\n map(\"Function\", AST_Function, \"id>name, params@argnames, body%body\");\n map(\"EmptyStatement\", AST_EmptyStatement);\n map(\"BlockStatement\", AST_BlockStatement, \"body@body\");\n map(\"ExpressionStatement\", AST_SimpleStatement, \"expression>body\");\n map(\"IfStatement\", AST_If, \"test>condition, consequent>body, alternate>alternative\");\n map(\"LabeledStatement\", AST_LabeledStatement, \"label>label, body>body\");\n map(\"BreakStatement\", AST_Break, \"label>label\");\n map(\"ContinueStatement\", AST_Continue, \"label>label\");\n map(\"WithStatement\", AST_With, \"object>expression, body>body\");\n map(\"SwitchStatement\", AST_Switch, \"discriminant>expression, cases@body\");\n map(\"ReturnStatement\", AST_Return, \"argument>value\");\n map(\"ThrowStatement\", AST_Throw, \"argument>value\");\n map(\"WhileStatement\", AST_While, \"test>condition, body>body\");\n map(\"DoWhileStatement\", AST_Do, \"test>condition, body>body\");\n map(\"ForStatement\", AST_For, \"init>init, test>condition, update>step, body>body\");\n map(\"ForInStatement\", AST_ForIn, \"left>init, right>object, body>body\");\n map(\"DebuggerStatement\", AST_Debugger);\n map(\"FunctionDeclaration\", AST_Defun, \"id>name, params@argnames, body%body\");\n map(\"VariableDeclaration\", AST_Var, \"declarations@definitions\");\n map(\"VariableDeclarator\", AST_VarDef, \"id>name, init>value\");\n\n map(\"ThisExpression\", AST_This);\n map(\"ArrayExpression\", AST_Array, \"elements@elements\");\n map(\"FunctionExpression\", AST_Function, \"id>name, params@argnames, body%body\");\n map(\"BinaryExpression\", AST_Binary, \"operator=operator, left>left, right>right\");\n map(\"AssignmentExpression\", AST_Assign, \"operator=operator, left>left, right>right\");\n map(\"LogicalExpression\", AST_Binary, \"operator=operator, left>left, right>right\");\n map(\"ConditionalExpression\", AST_Conditional, \"test>condition, consequent>consequent, alternate>alternative\");\n map(\"NewExpression\", AST_New, \"callee>expression, arguments@args\");\n map(\"CallExpression\", AST_Call, \"callee>expression, arguments@args\");\n\n /* -----[ tools ]----- */\n\n function my_start_token(moznode) {\n return new AST_Token({\n file : moznode.loc && moznode.loc.source,\n line : moznode.loc && moznode.loc.start.line,\n col : moznode.loc && moznode.loc.start.column,\n pos : moznode.start,\n endpos : moznode.start\n });\n };\n\n function my_end_token(moznode) {\n return new AST_Token({\n file : moznode.loc && moznode.loc.source,\n line : moznode.loc && moznode.loc.end.line,\n col : moznode.loc && moznode.loc.end.column,\n pos : moznode.end,\n endpos : moznode.end\n });\n };\n\n function map(moztype, mytype, propmap) {\n var moz_to_me = \"function From_Moz_\" + moztype + \"(M){\\n\";\n moz_to_me += \"return new mytype({\\n\" +\n \"start: my_start_token(M),\\n\" +\n \"end: my_end_token(M)\";\n\n if (propmap) propmap.split(/\\s*,\\s*/).forEach(function(prop){\n var m = /([a-z0-9$_]+)(=|@|>|%)([a-z0-9$_]+)/i.exec(prop);\n if (!m) throw new Error(\"Can't understand property map: \" + prop);\n var moz = \"M.\" + m[1], how = m[2], my = m[3];\n moz_to_me += \",\\n\" + my + \": \";\n if (how == \"@\") {\n moz_to_me += moz + \".map(from_moz)\";\n } else if (how == \">\") {\n moz_to_me += \"from_moz(\" + moz + \")\";\n } else if (how == \"=\") {\n moz_to_me += moz;\n } else if (how == \"%\") {\n moz_to_me += \"from_moz(\" + moz + \").body\";\n } else throw new Error(\"Can't understand operator in propmap: \" + prop);\n });\n moz_to_me += \"\\n})}\";\n\n // moz_to_me = parse(moz_to_me).print_to_string({ beautify: true });\n // console.log(moz_to_me);\n\n moz_to_me = new Function(\"mytype\", \"my_start_token\", \"my_end_token\", \"from_moz\", \"return(\" + moz_to_me + \")\")(\n mytype, my_start_token, my_end_token, from_moz\n );\n return MOZ_TO_ME[moztype] = moz_to_me;\n };\n\n var FROM_MOZ_STACK = null;\n\n function from_moz(node) {\n FROM_MOZ_STACK.push(node);\n var ret = node != null ? MOZ_TO_ME[node.type](node) : null;\n FROM_MOZ_STACK.pop();\n return ret;\n };\n\n AST_Node.from_mozilla_ast = function(node){\n var save_stack = FROM_MOZ_STACK;\n FROM_MOZ_STACK = [];\n var ast = from_moz(node);\n FROM_MOZ_STACK = save_stack;\n return ast;\n };\n\n})();\n\nAST_Node.warn_function = function(txt) { logger.error(\"uglifyjs2 WARN: \" + txt); };\nexports.minify = function(files, options, name) {\n options = defaults(options, {\n spidermonkey : false,\n outSourceMap : null,\n sourceRoot : null,\n inSourceMap : null,\n fromString : false,\n warnings : false,\n mangle : {},\n output : null,\n compress : {}\n });\n base54.reset();\n\n // 1. parse\n var toplevel = null,\n sourcesContent = {};\n\n if (options.spidermonkey) {\n toplevel = AST_Node.from_mozilla_ast(files);\n } else {\n if (typeof files == \"string\")\n files = [ files ];\n files.forEach(function(file){\n var code = options.fromString\n ? file\n : rjsFile.readFile(file, \"utf8\");\n sourcesContent[file] = code;\n toplevel = parse(code, {\n filename: options.fromString ? name : file,\n toplevel: toplevel\n });\n });\n }\n\n // 2. compress\n if (options.compress) {\n var compress = { warnings: options.warnings };\n merge(compress, options.compress);\n toplevel.figure_out_scope();\n var sq = Compressor(compress);\n toplevel = toplevel.transform(sq);\n }\n\n // 3. mangle\n if (options.mangle) {\n toplevel.figure_out_scope();\n toplevel.compute_char_frequency();\n toplevel.mangle_names(options.mangle);\n }\n\n // 4. output\n var inMap = options.inSourceMap;\n var output = {};\n if (typeof options.inSourceMap == \"string\") {\n inMap = rjsFile.readFile(options.inSourceMap, \"utf8\");\n }\n if (options.outSourceMap) {\n output.source_map = SourceMap({\n file: options.outSourceMap,\n orig: inMap,\n root: options.sourceRoot\n });\n if (options.sourceMapIncludeSources) {\n for (var file in sourcesContent) {\n if (sourcesContent.hasOwnProperty(file)) {\n options.source_map.get().setSourceContent(file, sourcesContent[file]);\n }\n }\n }\n\n }\n if (options.output) {\n merge(output, options.output);\n }\n var stream = OutputStream(output);\n toplevel.print(stream);\n return {\n code : stream + \"\",\n map : output.source_map + \"\"\n };\n};\n\n// exports.describe_ast = function() {\n// function doitem(ctor) {\n// var sub = {};\n// ctor.SUBCLASSES.forEach(function(ctor){\n// sub[ctor.TYPE] = doitem(ctor);\n// });\n// var ret = {};\n// if (ctor.SELF_PROPS.length > 0) ret.props = ctor.SELF_PROPS;\n// if (ctor.SUBCLASSES.length > 0) ret.sub = sub;\n// return ret;\n// }\n// return doitem(AST_Node).sub;\n// }\n\nexports.describe_ast = function() {\n var out = OutputStream({ beautify: true });\n function doitem(ctor) {\n out.print(\"AST_\" + ctor.TYPE);\n var props = ctor.SELF_PROPS.filter(function(prop){\n return !/^\\$/.test(prop);\n });\n if (props.length > 0) {\n out.space();\n out.with_parens(function(){\n props.forEach(function(prop, i){\n if (i) out.space();\n out.print(prop);\n });\n });\n }\n if (ctor.documentation) {\n out.space();\n out.print_string(ctor.documentation);\n }\n if (ctor.SUBCLASSES.length > 0) {\n out.space();\n out.with_block(function(){\n ctor.SUBCLASSES.forEach(function(ctor, i){\n out.indent();\n doitem(ctor);\n out.newline();\n });\n });\n }\n };\n doitem(AST_Node);\n return out + \"\";\n};\n\n\n});\n/**\n * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint plusplus: true */\n/*global define: false */\n\ndefine('parse', ['./esprimaAdapter', 'lang'], function (esprima, lang) {\n 'use strict';\n\n function arrayToString(ary) {\n var output = '[';\n if (ary) {\n ary.forEach(function (item, i) {\n output += (i > 0 ? ',' : '') + '\"' + lang.jsEscape(item) + '\"';\n });\n }\n output += ']';\n\n return output;\n }\n\n //This string is saved off because JSLint complains\n //about obj.arguments use, as 'reserved word'\n var argPropName = 'arguments',\n //Default object to use for \"scope\" checking for UMD identifiers.\n emptyScope = {},\n mixin = lang.mixin,\n hasProp = lang.hasProp;\n\n //From an esprima example for traversing its ast.\n function traverse(object, visitor) {\n var key, child;\n\n if (!object) {\n return;\n }\n\n if (visitor.call(null, object) === false) {\n return false;\n }\n for (key in object) {\n if (object.hasOwnProperty(key)) {\n child = object[key];\n if (typeof child === 'object' && child !== null) {\n if (traverse(child, visitor) === false) {\n return false;\n }\n }\n }\n }\n }\n\n //Like traverse, but visitor returning false just\n //stops that subtree analysis, not the rest of tree\n //visiting.\n function traverseBroad(object, visitor) {\n var key, child;\n\n if (!object) {\n return;\n }\n\n if (visitor.call(null, object) === false) {\n return false;\n }\n for (key in object) {\n if (object.hasOwnProperty(key)) {\n child = object[key];\n if (typeof child === 'object' && child !== null) {\n traverseBroad(child, visitor);\n }\n }\n }\n }\n\n /**\n * Pulls out dependencies from an array literal with just string members.\n * If string literals, will just return those string values in an array,\n * skipping other items in the array.\n *\n * @param {Node} node an AST node.\n *\n * @returns {Array} an array of strings.\n * If null is returned, then it means the input node was not a valid\n * dependency.\n */\n function getValidDeps(node) {\n if (!node || node.type !== 'ArrayExpression' || !node.elements) {\n return;\n }\n\n var deps = [];\n\n node.elements.some(function (elem) {\n if (elem.type === 'Literal') {\n deps.push(elem.value);\n }\n });\n\n return deps.length ? deps : undefined;\n }\n\n /**\n * Main parse function. Returns a string of any valid require or\n * define/require.def calls as part of one JavaScript source string.\n * @param {String} moduleName the module name that represents this file.\n * It is used to create a default define if there is not one already for the\n * file. This allows properly tracing dependencies for builds. Otherwise, if\n * the file just has a require() call, the file dependencies will not be\n * properly reflected: the file will come before its dependencies.\n * @param {String} moduleName\n * @param {String} fileName\n * @param {String} fileContents\n * @param {Object} options optional options. insertNeedsDefine: true will\n * add calls to require.needsDefine() if appropriate.\n * @returns {String} JS source string or null, if no require or\n * define/require.def calls are found.\n */\n function parse(moduleName, fileName, fileContents, options) {\n options = options || {};\n\n //Set up source input\n var i, moduleCall, depString,\n moduleDeps = [],\n result = '',\n moduleList = [],\n needsDefine = true,\n astRoot = esprima.parse(fileContents);\n\n parse.recurse(astRoot, function (callName, config, name, deps, node, factoryIdentifier, fnExpScope) {\n if (!deps) {\n deps = [];\n }\n\n if (callName === 'define' && (!name || name === moduleName)) {\n needsDefine = false;\n }\n\n if (!name) {\n //If there is no module name, the dependencies are for\n //this file/default module name.\n moduleDeps = moduleDeps.concat(deps);\n } else {\n moduleList.push({\n name: name,\n deps: deps\n });\n }\n\n if (callName === 'define' && factoryIdentifier && hasProp(fnExpScope, factoryIdentifier)) {\n return factoryIdentifier;\n }\n\n //If define was found, no need to dive deeper, unless\n //the config explicitly wants to dig deeper.\n return !!options.findNestedDependencies;\n }, options);\n\n if (options.insertNeedsDefine && needsDefine) {\n result += 'require.needsDefine(\"' + moduleName + '\");';\n }\n\n if (moduleDeps.length || moduleList.length) {\n for (i = 0; i < moduleList.length; i++) {\n moduleCall = moduleList[i];\n if (result) {\n result += '\\n';\n }\n\n //If this is the main module for this file, combine any\n //\"anonymous\" dependencies (could come from a nested require\n //call) with this module.\n if (moduleCall.name === moduleName) {\n moduleCall.deps = moduleCall.deps.concat(moduleDeps);\n moduleDeps = [];\n }\n\n depString = arrayToString(moduleCall.deps);\n result += 'define(\"' + moduleCall.name + '\",' +\n depString + ');';\n }\n if (moduleDeps.length) {\n if (result) {\n result += '\\n';\n }\n depString = arrayToString(moduleDeps);\n result += 'define(\"' + moduleName + '\",' + depString + ');';\n }\n }\n\n return result || null;\n }\n\n parse.traverse = traverse;\n parse.traverseBroad = traverseBroad;\n\n /**\n * Handles parsing a file recursively for require calls.\n * @param {Array} parentNode the AST node to start with.\n * @param {Function} onMatch function to call on a parse match.\n * @param {Object} [options] This is normally the build config options if\n * it is passed.\n * @param {Object} [fnExpScope] holds list of function expresssion\n * argument identifiers, set up internally, not passed in\n */\n parse.recurse = function (object, onMatch, options, fnExpScope) {\n //Like traverse, but skips if branches that would not be processed\n //after has application that results in tests of true or false boolean\n //literal values.\n var key, child, result, i, params, param, tempObject,\n hasHas = options && options.has;\n\n fnExpScope = fnExpScope || emptyScope;\n\n if (!object) {\n return;\n }\n\n //If has replacement has resulted in if(true){} or if(false){}, take\n //the appropriate branch and skip the other one.\n if (hasHas && object.type === 'IfStatement' && object.test.type &&\n object.test.type === 'Literal') {\n if (object.test.value) {\n //Take the if branch\n this.recurse(object.consequent, onMatch, options, fnExpScope);\n } else {\n //Take the else branch\n this.recurse(object.alternate, onMatch, options, fnExpScope);\n }\n } else {\n result = this.parseNode(object, onMatch, fnExpScope);\n if (result === false) {\n return;\n } else if (typeof result === 'string') {\n return result;\n }\n\n //Build up a \"scope\" object that informs nested recurse calls if\n //the define call references an identifier that is likely a UMD\n //wrapped function expression argument.\n if (object.type === 'ExpressionStatement' && object.expression &&\n object.expression.type === 'CallExpression' && object.expression.callee &&\n object.expression.callee.type === 'FunctionExpression') {\n tempObject = object.expression.callee;\n\n if (tempObject.params && tempObject.params.length) {\n params = tempObject.params;\n fnExpScope = mixin({}, fnExpScope, true);\n for (i = 0; i < params.length; i++) {\n param = params[i];\n if (param.type === 'Identifier') {\n fnExpScope[param.name] = true;\n }\n }\n }\n }\n\n for (key in object) {\n if (object.hasOwnProperty(key)) {\n child = object[key];\n if (typeof child === 'object' && child !== null) {\n result = this.recurse(child, onMatch, options, fnExpScope);\n if (typeof result === 'string') {\n break;\n }\n }\n }\n }\n\n //Check for an identifier for a factory function identifier being\n //passed in as a function expression, indicating a UMD-type of\n //wrapping.\n if (typeof result === 'string') {\n if (hasProp(fnExpScope, result)) {\n //result still in scope, keep jumping out indicating the\n //identifier still in use.\n return result;\n }\n\n return;\n }\n }\n };\n\n /**\n * Determines if the file defines the require/define module API.\n * Specifically, it looks for the `define.amd = ` expression.\n * @param {String} fileName\n * @param {String} fileContents\n * @returns {Boolean}\n */\n parse.definesRequire = function (fileName, fileContents) {\n var found = false;\n\n traverse(esprima.parse(fileContents), function (node) {\n if (parse.hasDefineAmd(node)) {\n found = true;\n\n //Stop traversal\n return false;\n }\n });\n\n return found;\n };\n\n /**\n * Finds require(\"\") calls inside a CommonJS anonymous module wrapped in a\n * define(function(require, exports, module){}) wrapper. These dependencies\n * will be added to a modified define() call that lists the dependencies\n * on the outside of the function.\n * @param {String} fileName\n * @param {String|Object} fileContents: a string of contents, or an already\n * parsed AST tree.\n * @returns {Array} an array of module names that are dependencies. Always\n * returns an array, but could be of length zero.\n */\n parse.getAnonDeps = function (fileName, fileContents) {\n var astRoot = typeof fileContents === 'string' ?\n esprima.parse(fileContents) : fileContents,\n defFunc = this.findAnonDefineFactory(astRoot);\n\n return parse.getAnonDepsFromNode(defFunc);\n };\n\n /**\n * Finds require(\"\") calls inside a CommonJS anonymous module wrapped\n * in a define function, given an AST node for the definition function.\n * @param {Node} node the AST node for the definition function.\n * @returns {Array} and array of dependency names. Can be of zero length.\n */\n parse.getAnonDepsFromNode = function (node) {\n var deps = [],\n funcArgLength;\n\n if (node) {\n this.findRequireDepNames(node, deps);\n\n //If no deps, still add the standard CommonJS require, exports,\n //module, in that order, to the deps, but only if specified as\n //function args. In particular, if exports is used, it is favored\n //over the return value of the function, so only add it if asked.\n funcArgLength = node.params && node.params.length;\n if (funcArgLength) {\n deps = (funcArgLength > 1 ? [\"require\", \"exports\", \"module\"] :\n [\"require\"]).concat(deps);\n }\n }\n return deps;\n };\n\n parse.isDefineNodeWithArgs = function (node) {\n return node && node.type === 'CallExpression' &&\n node.callee && node.callee.type === 'Identifier' &&\n node.callee.name === 'define' && node[argPropName];\n };\n\n /**\n * Finds the function in define(function (require, exports, module){});\n * @param {Array} node\n * @returns {Boolean}\n */\n parse.findAnonDefineFactory = function (node) {\n var match;\n\n traverse(node, function (node) {\n var arg0, arg1;\n\n if (parse.isDefineNodeWithArgs(node)) {\n\n //Just the factory function passed to define\n arg0 = node[argPropName][0];\n if (arg0 && arg0.type === 'FunctionExpression') {\n match = arg0;\n return false;\n }\n\n //A string literal module ID followed by the factory function.\n arg1 = node[argPropName][1];\n if (arg0.type === 'Literal' &&\n arg1 && arg1.type === 'FunctionExpression') {\n match = arg1;\n return false;\n }\n }\n });\n\n return match;\n };\n\n /**\n * Finds any config that is passed to requirejs. That includes calls to\n * require/requirejs.config(), as well as require({}, ...) and\n * requirejs({}, ...)\n * @param {String} fileContents\n *\n * @returns {Object} a config details object with the following properties:\n * - config: {Object} the config object found. Can be undefined if no\n * config found.\n * - range: {Array} the start index and end index in the contents where\n * the config was found. Can be undefined if no config found.\n * Can throw an error if the config in the file cannot be evaluated in\n * a build context to valid JavaScript.\n */\n parse.findConfig = function (fileContents) {\n /*jslint evil: true */\n var jsConfig, foundConfig, stringData, foundRange, quote, quoteMatch,\n quoteRegExp = /(:\\s|\\[\\s*)(['\"])/,\n astRoot = esprima.parse(fileContents, {\n loc: true\n });\n\n traverse(astRoot, function (node) {\n var arg,\n requireType = parse.hasRequire(node);\n\n if (requireType && (requireType === 'require' ||\n requireType === 'requirejs' ||\n requireType === 'requireConfig' ||\n requireType === 'requirejsConfig')) {\n\n arg = node[argPropName] && node[argPropName][0];\n\n if (arg && arg.type === 'ObjectExpression') {\n stringData = parse.nodeToString(fileContents, arg);\n jsConfig = stringData.value;\n foundRange = stringData.range;\n return false;\n }\n } else {\n arg = parse.getRequireObjectLiteral(node);\n if (arg) {\n stringData = parse.nodeToString(fileContents, arg);\n jsConfig = stringData.value;\n foundRange = stringData.range;\n return false;\n }\n }\n });\n\n if (jsConfig) {\n // Eval the config\n quoteMatch = quoteRegExp.exec(jsConfig);\n quote = (quoteMatch && quoteMatch[2]) || '\"';\n foundConfig = eval('(' + jsConfig + ')');\n }\n\n return {\n config: foundConfig,\n range: foundRange,\n quote: quote\n };\n };\n\n /** Returns the node for the object literal assigned to require/requirejs,\n * for holding a declarative config.\n */\n parse.getRequireObjectLiteral = function (node) {\n if (node.id && node.id.type === 'Identifier' &&\n (node.id.name === 'require' || node.id.name === 'requirejs') &&\n node.init && node.init.type === 'ObjectExpression') {\n return node.init;\n }\n };\n\n /**\n * Renames require/requirejs/define calls to be ns + '.' + require/requirejs/define\n * Does *not* do .config calls though. See pragma.namespace for the complete\n * set of namespace transforms. This function is used because require calls\n * inside a define() call should not be renamed, so a simple regexp is not\n * good enough.\n * @param {String} fileContents the contents to transform.\n * @param {String} ns the namespace, *not* including trailing dot.\n * @return {String} the fileContents with the namespace applied\n */\n parse.renameNamespace = function (fileContents, ns) {\n var lines,\n locs = [],\n astRoot = esprima.parse(fileContents, {\n loc: true\n });\n\n parse.recurse(astRoot, function (callName, config, name, deps, node) {\n locs.push(node.loc);\n //Do not recurse into define functions, they should be using\n //local defines.\n return callName !== 'define';\n }, {});\n\n if (locs.length) {\n lines = fileContents.split('\\n');\n\n //Go backwards through the found locs, adding in the namespace name\n //in front.\n locs.reverse();\n locs.forEach(function (loc) {\n var startIndex = loc.start.column,\n //start.line is 1-based, not 0 based.\n lineIndex = loc.start.line - 1,\n line = lines[lineIndex];\n\n lines[lineIndex] = line.substring(0, startIndex) +\n ns + '.' +\n line.substring(startIndex,\n line.length);\n });\n\n fileContents = lines.join('\\n');\n }\n\n return fileContents;\n };\n\n /**\n * Finds all dependencies specified in dependency arrays and inside\n * simplified commonjs wrappers.\n * @param {String} fileName\n * @param {String} fileContents\n *\n * @returns {Array} an array of dependency strings. The dependencies\n * have not been normalized, they may be relative IDs.\n */\n parse.findDependencies = function (fileName, fileContents, options) {\n var dependencies = [],\n astRoot = esprima.parse(fileContents);\n\n parse.recurse(astRoot, function (callName, config, name, deps) {\n if (deps) {\n dependencies = dependencies.concat(deps);\n }\n }, options);\n\n return dependencies;\n };\n\n /**\n * Finds only CJS dependencies, ones that are the form\n * require('stringLiteral')\n */\n parse.findCjsDependencies = function (fileName, fileContents) {\n var dependencies = [];\n\n traverse(esprima.parse(fileContents), function (node) {\n var arg;\n\n if (node && node.type === 'CallExpression' && node.callee &&\n node.callee.type === 'Identifier' &&\n node.callee.name === 'require' && node[argPropName] &&\n node[argPropName].length === 1) {\n arg = node[argPropName][0];\n if (arg.type === 'Literal') {\n dependencies.push(arg.value);\n }\n }\n });\n\n return dependencies;\n };\n\n //function define() {}\n parse.hasDefDefine = function (node) {\n return node.type === 'FunctionDeclaration' && node.id &&\n node.id.type === 'Identifier' && node.id.name === 'define';\n };\n\n //define.amd = ...\n parse.hasDefineAmd = function (node) {\n return node && node.type === 'AssignmentExpression' &&\n node.left && node.left.type === 'MemberExpression' &&\n node.left.object && node.left.object.name === 'define' &&\n node.left.property && node.left.property.name === 'amd';\n };\n\n //define.amd reference, as in: if (define.amd)\n parse.refsDefineAmd = function (node) {\n return node && node.type === 'MemberExpression' &&\n node.object && node.object.name === 'define' &&\n node.object.type === 'Identifier' &&\n node.property && node.property.name === 'amd' &&\n node.property.type === 'Identifier';\n };\n\n //require(), requirejs(), require.config() and requirejs.config()\n parse.hasRequire = function (node) {\n var callName,\n c = node && node.callee;\n\n if (node && node.type === 'CallExpression' && c) {\n if (c.type === 'Identifier' &&\n (c.name === 'require' ||\n c.name === 'requirejs')) {\n //A require/requirejs({}, ...) call\n callName = c.name;\n } else if (c.type === 'MemberExpression' &&\n c.object &&\n c.object.type === 'Identifier' &&\n (c.object.name === 'require' ||\n c.object.name === 'requirejs') &&\n c.property && c.property.name === 'config') {\n // require/requirejs.config({}) call\n callName = c.object.name + 'Config';\n }\n }\n\n return callName;\n };\n\n //define()\n parse.hasDefine = function (node) {\n return node && node.type === 'CallExpression' && node.callee &&\n node.callee.type === 'Identifier' &&\n node.callee.name === 'define';\n };\n\n /**\n * If there is a named define in the file, returns the name. Does not\n * scan for mulitple names, just the first one.\n */\n parse.getNamedDefine = function (fileContents) {\n var name;\n traverse(esprima.parse(fileContents), function (node) {\n if (node && node.type === 'CallExpression' && node.callee &&\n node.callee.type === 'Identifier' &&\n node.callee.name === 'define' &&\n node[argPropName] && node[argPropName][0] &&\n node[argPropName][0].type === 'Literal') {\n name = node[argPropName][0].value;\n return false;\n }\n });\n\n return name;\n };\n\n /**\n * Determines if define(), require({}|[]) or requirejs was called in the\n * file. Also finds out if define() is declared and if define.amd is called.\n */\n parse.usesAmdOrRequireJs = function (fileName, fileContents) {\n var uses;\n\n traverse(esprima.parse(fileContents), function (node) {\n var type, callName, arg;\n\n if (parse.hasDefDefine(node)) {\n //function define() {}\n type = 'declaresDefine';\n } else if (parse.hasDefineAmd(node)) {\n type = 'defineAmd';\n } else {\n callName = parse.hasRequire(node);\n if (callName) {\n arg = node[argPropName] && node[argPropName][0];\n if (arg && (arg.type === 'ObjectExpression' ||\n arg.type === 'ArrayExpression')) {\n type = callName;\n }\n } else if (parse.hasDefine(node)) {\n type = 'define';\n }\n }\n\n if (type) {\n if (!uses) {\n uses = {};\n }\n uses[type] = true;\n }\n });\n\n return uses;\n };\n\n /**\n * Determines if require(''), exports.x =, module.exports =,\n * __dirname, __filename are used. So, not strictly traditional CommonJS,\n * also checks for Node variants.\n */\n parse.usesCommonJs = function (fileName, fileContents) {\n var uses = null,\n assignsExports = false;\n\n\n traverse(esprima.parse(fileContents), function (node) {\n var type,\n exp = node.expression || node.init;\n\n if (node.type === 'Identifier' &&\n (node.name === '__dirname' || node.name === '__filename')) {\n type = node.name.substring(2);\n } else if (node.type === 'VariableDeclarator' && node.id &&\n node.id.type === 'Identifier' &&\n node.id.name === 'exports') {\n //Hmm, a variable assignment for exports, so does not use cjs\n //exports.\n type = 'varExports';\n } else if (exp && exp.type === 'AssignmentExpression' && exp.left &&\n exp.left.type === 'MemberExpression' && exp.left.object) {\n if (exp.left.object.name === 'module' && exp.left.property &&\n exp.left.property.name === 'exports') {\n type = 'moduleExports';\n } else if (exp.left.object.name === 'exports' &&\n exp.left.property) {\n type = 'exports';\n }\n\n } else if (node && node.type === 'CallExpression' && node.callee &&\n node.callee.type === 'Identifier' &&\n node.callee.name === 'require' && node[argPropName] &&\n node[argPropName].length === 1 &&\n node[argPropName][0].type === 'Literal') {\n type = 'require';\n }\n\n if (type) {\n if (type === 'varExports') {\n assignsExports = true;\n } else if (type !== 'exports' || !assignsExports) {\n if (!uses) {\n uses = {};\n }\n uses[type] = true;\n }\n }\n });\n\n return uses;\n };\n\n\n parse.findRequireDepNames = function (node, deps) {\n traverse(node, function (node) {\n var arg;\n\n if (node && node.type === 'CallExpression' && node.callee &&\n node.callee.type === 'Identifier' &&\n node.callee.name === 'require' &&\n node[argPropName] && node[argPropName].length === 1) {\n\n arg = node[argPropName][0];\n if (arg.type === 'Literal') {\n deps.push(arg.value);\n }\n }\n });\n };\n\n /**\n * Determines if a specific node is a valid require or define/require.def\n * call.\n * @param {Array} node\n * @param {Function} onMatch a function to call when a match is found.\n * It is passed the match name, and the config, name, deps possible args.\n * The config, name and deps args are not normalized.\n * @param {Object} fnExpScope an object whose keys are all function\n * expression identifiers that should be in scope. Useful for UMD wrapper\n * detection to avoid parsing more into the wrapped UMD code.\n *\n * @returns {String} a JS source string with the valid require/define call.\n * Otherwise null.\n */\n parse.parseNode = function (node, onMatch, fnExpScope) {\n var name, deps, cjsDeps, arg, factory, exp, refsDefine, bodyNode,\n args = node && node[argPropName],\n callName = parse.hasRequire(node);\n\n if (callName === 'require' || callName === 'requirejs') {\n //A plain require/requirejs call\n arg = node[argPropName] && node[argPropName][0];\n if (arg.type !== 'ArrayExpression') {\n if (arg.type === 'ObjectExpression') {\n //A config call, try the second arg.\n arg = node[argPropName][1];\n }\n }\n\n deps = getValidDeps(arg);\n if (!deps) {\n return;\n }\n\n return onMatch(\"require\", null, null, deps, node);\n } else if (parse.hasDefine(node) && args && args.length) {\n name = args[0];\n deps = args[1];\n factory = args[2];\n\n if (name.type === 'ArrayExpression') {\n //No name, adjust args\n factory = deps;\n deps = name;\n name = null;\n } else if (name.type === 'FunctionExpression') {\n //Just the factory, no name or deps\n factory = name;\n name = deps = null;\n } else if (name.type !== 'Literal') {\n //An object literal, just null out\n name = deps = factory = null;\n }\n\n if (name && name.type === 'Literal' && deps) {\n if (deps.type === 'FunctionExpression') {\n //deps is the factory\n factory = deps;\n deps = null;\n } else if (deps.type === 'ObjectExpression') {\n //deps is object literal, null out\n deps = factory = null;\n } else if (deps.type === 'Identifier' && args.length === 2) {\n // define('id', factory)\n deps = factory = null;\n }\n }\n\n if (deps && deps.type === 'ArrayExpression') {\n deps = getValidDeps(deps);\n } else if (factory && factory.type === 'FunctionExpression') {\n //If no deps and a factory function, could be a commonjs sugar\n //wrapper, scan the function for dependencies.\n cjsDeps = parse.getAnonDepsFromNode(factory);\n if (cjsDeps.length) {\n deps = cjsDeps;\n }\n } else if (deps || factory) {\n //Does not match the shape of an AMD call.\n return;\n }\n\n //Just save off the name as a string instead of an AST object.\n if (name && name.type === 'Literal') {\n name = name.value;\n }\n\n return onMatch(\"define\", null, name, deps, node,\n (factory && factory.type === 'Identifier' ? factory.name : undefined),\n fnExpScope);\n } else if (node.type === 'CallExpression' && node.callee &&\n node.callee.type === 'FunctionExpression' &&\n node.callee.body && node.callee.body.body &&\n node.callee.body.body.length === 1 &&\n node.callee.body.body[0].type === 'IfStatement') {\n bodyNode = node.callee.body.body[0];\n //Look for a define(Identifier) case, but only if inside an\n //if that has a define.amd test\n if (bodyNode.consequent && bodyNode.consequent.body) {\n exp = bodyNode.consequent.body[0];\n if (exp.type === 'ExpressionStatement' && exp.expression &&\n parse.hasDefine(exp.expression) &&\n exp.expression.arguments &&\n exp.expression.arguments.length === 1 &&\n exp.expression.arguments[0].type === 'Identifier') {\n\n //Calls define(Identifier) as first statement in body.\n //Confirm the if test references define.amd\n traverse(bodyNode.test, function (node) {\n if (parse.refsDefineAmd(node)) {\n refsDefine = true;\n return false;\n }\n });\n\n if (refsDefine) {\n return onMatch(\"define\", null, null, null, exp.expression,\n exp.expression.arguments[0].name, fnExpScope);\n }\n }\n }\n }\n };\n\n /**\n * Converts an AST node into a JS source string by extracting\n * the node's location from the given contents string. Assumes\n * esprima.parse() with loc was done.\n * @param {String} contents\n * @param {Object} node\n * @returns {String} a JS source string.\n */\n parse.nodeToString = function (contents, node) {\n var extracted,\n loc = node.loc,\n lines = contents.split('\\n'),\n firstLine = loc.start.line > 1 ?\n lines.slice(0, loc.start.line - 1).join('\\n') + '\\n' :\n '',\n preamble = firstLine +\n lines[loc.start.line - 1].substring(0, loc.start.column);\n\n if (loc.start.line === loc.end.line) {\n extracted = lines[loc.start.line - 1].substring(loc.start.column,\n loc.end.column);\n } else {\n extracted = lines[loc.start.line - 1].substring(loc.start.column) +\n '\\n' +\n lines.slice(loc.start.line, loc.end.line - 1).join('\\n') +\n '\\n' +\n lines[loc.end.line - 1].substring(0, loc.end.column);\n }\n\n return {\n value: extracted,\n range: [\n preamble.length,\n preamble.length + extracted.length\n ]\n };\n };\n\n /**\n * Extracts license comments from JS text.\n * @param {String} fileName\n * @param {String} contents\n * @returns {String} a string of license comments.\n */\n parse.getLicenseComments = function (fileName, contents) {\n var commentNode, refNode, subNode, value, i, j,\n //xpconnect's Reflect does not support comment or range, but\n //prefer continued operation vs strict parity of operation,\n //as license comments can be expressed in other ways, like\n //via wrap args, or linked via sourcemaps.\n ast = esprima.parse(contents, {\n comment: true,\n range: true\n }),\n result = '',\n existsMap = {},\n lineEnd = contents.indexOf('\\r') === -1 ? '\\n' : '\\r\\n';\n\n if (ast.comments) {\n for (i = 0; i < ast.comments.length; i++) {\n commentNode = ast.comments[i];\n\n if (commentNode.type === 'Line') {\n value = '//' + commentNode.value + lineEnd;\n refNode = commentNode;\n\n if (i + 1 >= ast.comments.length) {\n value += lineEnd;\n } else {\n //Look for immediately adjacent single line comments\n //since it could from a multiple line comment made out\n //of single line comments. Like this comment.\n for (j = i + 1; j < ast.comments.length; j++) {\n subNode = ast.comments[j];\n if (subNode.type === 'Line' &&\n subNode.range[0] === refNode.range[1] + 1) {\n //Adjacent single line comment. Collect it.\n value += '//' + subNode.value + lineEnd;\n refNode = subNode;\n } else {\n //No more single line comment blocks. Break out\n //and continue outer looping.\n break;\n }\n }\n value += lineEnd;\n i = j - 1;\n }\n } else {\n value = '/*' + commentNode.value + '*/' + lineEnd + lineEnd;\n }\n\n if (!existsMap[value] && (value.indexOf('license') !== -1 ||\n (commentNode.type === 'Block' &&\n value.indexOf('/*!') === 0) ||\n value.indexOf('opyright') !== -1 ||\n value.indexOf('(c)') !== -1)) {\n\n result += value;\n existsMap[value] = true;\n }\n\n }\n }\n\n return result;\n };\n\n return parse;\n});\n/**\n * @license Copyright (c) 2012-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*global define */\n\ndefine('transform', [ './esprimaAdapter', './parse', 'logger', 'lang'],\nfunction (esprima, parse, logger, lang) {\n 'use strict';\n var transform,\n baseIndentRegExp = /^([ \\t]+)/,\n indentRegExp = /\\{[\\r\\n]+([ \\t]+)/,\n keyRegExp = /^[_A-Za-z]([A-Za-z\\d_]*)$/,\n bulkIndentRegExps = {\n '\\n': /\\n/g,\n '\\r\\n': /\\r\\n/g\n };\n\n function applyIndent(str, indent, lineReturn) {\n var regExp = bulkIndentRegExps[lineReturn];\n return str.replace(regExp, '$&' + indent);\n }\n\n transform = {\n toTransport: function (namespace, moduleName, path, contents, onFound, options) {\n options = options || {};\n\n var astRoot, contentLines, modLine,\n foundAnon,\n scanCount = 0,\n scanReset = false,\n defineInfos = [],\n applySourceUrl = function (contents) {\n if (options.useSourceUrl) {\n contents = 'eval(\"' + lang.jsEscape(contents) +\n '\\\\n//# sourceURL=' + (path.indexOf('/') === 0 ? '' : '/') +\n path +\n '\");\\n';\n }\n return contents;\n };\n\n try {\n astRoot = esprima.parse(contents, {\n loc: true\n });\n } catch (e) {\n logger.trace('toTransport skipping ' + path + ': ' +\n e.toString());\n return contents;\n }\n\n //Find the define calls and their position in the files.\n parse.traverse(astRoot, function (node) {\n var args, firstArg, firstArgLoc, factoryNode,\n needsId, depAction, foundId, init,\n sourceUrlData, range,\n namespaceExists = false;\n\n // If a bundle script with a define declaration, do not\n // parse any further at this level. Likely a built layer\n // by some other tool.\n if (node.type === 'VariableDeclarator' &&\n node.id && node.id.name === 'define' &&\n node.id.type === 'Identifier') {\n init = node.init;\n if (init && init.callee &&\n init.callee.type === 'CallExpression' &&\n init.callee.callee &&\n init.callee.callee.type === 'Identifier' &&\n init.callee.callee.name === 'require' &&\n init.callee.arguments && init.callee.arguments.length === 1 &&\n init.callee.arguments[0].type === 'Literal' &&\n init.callee.arguments[0].value &&\n init.callee.arguments[0].value.indexOf('amdefine') !== -1) {\n // the var define = require('amdefine')(module) case,\n // keep going in that case.\n } else {\n return false;\n }\n }\n\n namespaceExists = namespace &&\n node.type === 'CallExpression' &&\n node.callee && node.callee.object &&\n node.callee.object.type === 'Identifier' &&\n node.callee.object.name === namespace &&\n node.callee.property.type === 'Identifier' &&\n node.callee.property.name === 'define';\n\n if (namespaceExists || parse.isDefineNodeWithArgs(node)) {\n //The arguments are where its at.\n args = node.arguments;\n if (!args || !args.length) {\n return;\n }\n\n firstArg = args[0];\n firstArgLoc = firstArg.loc;\n\n if (args.length === 1) {\n if (firstArg.type === 'Identifier') {\n //The define(factory) case, but\n //only allow it if one Identifier arg,\n //to limit impact of false positives.\n needsId = true;\n depAction = 'empty';\n } else if (firstArg.type === 'FunctionExpression') {\n //define(function(){})\n factoryNode = firstArg;\n needsId = true;\n depAction = 'scan';\n } else if (firstArg.type === 'ObjectExpression') {\n //define({});\n needsId = true;\n depAction = 'skip';\n } else if (firstArg.type === 'Literal' &&\n typeof firstArg.value === 'number') {\n //define('12345');\n needsId = true;\n depAction = 'skip';\n } else if (firstArg.type === 'UnaryExpression' &&\n firstArg.operator === '-' &&\n firstArg.argument &&\n firstArg.argument.type === 'Literal' &&\n typeof firstArg.argument.value === 'number') {\n //define('-12345');\n needsId = true;\n depAction = 'skip';\n } else if (firstArg.type === 'MemberExpression' &&\n firstArg.object &&\n firstArg.property &&\n firstArg.property.type === 'Identifier') {\n //define(this.key);\n needsId = true;\n depAction = 'empty';\n }\n } else if (firstArg.type === 'ArrayExpression') {\n //define([], ...);\n needsId = true;\n depAction = 'skip';\n } else if (firstArg.type === 'Literal' &&\n typeof firstArg.value === 'string') {\n //define('string', ....)\n //Already has an ID.\n needsId = false;\n if (args.length === 2 &&\n args[1].type === 'FunctionExpression') {\n //Needs dependency scanning.\n factoryNode = args[1];\n depAction = 'scan';\n } else {\n depAction = 'skip';\n }\n } else {\n //Unknown define entity, keep looking, even\n //in the subtree for this node.\n return;\n }\n\n range = {\n foundId: foundId,\n needsId: needsId,\n depAction: depAction,\n namespaceExists: namespaceExists,\n node: node,\n defineLoc: node.loc,\n firstArgLoc: firstArgLoc,\n factoryNode: factoryNode,\n sourceUrlData: sourceUrlData\n };\n\n //Only transform ones that do not have IDs. If it has an\n //ID but no dependency array, assume it is something like\n //a phonegap implementation, that has its own internal\n //define that cannot handle dependency array constructs,\n //and if it is a named module, then it means it has been\n //set for transport form.\n if (range.needsId) {\n if (foundAnon) {\n logger.trace(path + ' has more than one anonymous ' +\n 'define. May be a built file from another ' +\n 'build system like, Ender. Skipping normalization.');\n defineInfos = [];\n return false;\n } else {\n foundAnon = range;\n defineInfos.push(range);\n }\n } else if (depAction === 'scan') {\n scanCount += 1;\n if (scanCount > 1) {\n //Just go back to an array that just has the\n //anon one, since this is an already optimized\n //file like the phonegap one.\n if (!scanReset) {\n defineInfos = foundAnon ? [foundAnon] : [];\n scanReset = true;\n }\n } else {\n defineInfos.push(range);\n }\n }\n }\n });\n\n\n if (!defineInfos.length) {\n return applySourceUrl(contents);\n }\n\n //Reverse the matches, need to start from the bottom of\n //the file to modify it, so that the ranges are still true\n //further up.\n defineInfos.reverse();\n\n contentLines = contents.split('\\n');\n\n modLine = function (loc, contentInsertion) {\n var startIndex = loc.start.column,\n //start.line is 1-based, not 0 based.\n lineIndex = loc.start.line - 1,\n line = contentLines[lineIndex];\n contentLines[lineIndex] = line.substring(0, startIndex) +\n contentInsertion +\n line.substring(startIndex,\n line.length);\n };\n\n defineInfos.forEach(function (info) {\n var deps,\n contentInsertion = '',\n depString = '';\n\n //Do the modifications \"backwards\", in other words, start with the\n //one that is farthest down and work up, so that the ranges in the\n //defineInfos still apply. So that means deps, id, then namespace.\n if (info.needsId && moduleName) {\n contentInsertion += \"'\" + moduleName + \"',\";\n }\n\n if (info.depAction === 'scan') {\n deps = parse.getAnonDepsFromNode(info.factoryNode);\n\n if (deps.length) {\n depString = '[' + deps.map(function (dep) {\n return \"'\" + dep + \"'\";\n }) + ']';\n } else {\n depString = '[]';\n }\n depString += ',';\n\n if (info.factoryNode) {\n //Already have a named module, need to insert the\n //dependencies after the name.\n modLine(info.factoryNode.loc, depString);\n } else {\n contentInsertion += depString;\n }\n }\n\n if (contentInsertion) {\n modLine(info.firstArgLoc, contentInsertion);\n }\n\n //Do namespace last so that ui does not mess upthe parenRange\n //used above.\n if (namespace && !info.namespaceExists) {\n modLine(info.defineLoc, namespace + '.');\n }\n\n //Notify any listener for the found info\n if (onFound) {\n onFound(info);\n }\n });\n\n contents = contentLines.join('\\n');\n\n return applySourceUrl(contents);\n },\n\n /**\n * Modify the contents of a require.config/requirejs.config call. This\n * call will LOSE any existing comments that are in the config string.\n *\n * @param {String} fileContents String that may contain a config call\n * @param {Function} onConfig Function called when the first config\n * call is found. It will be passed an Object which is the current\n * config, and the onConfig function should return an Object to use\n * as the config.\n * @return {String} the fileContents with the config changes applied.\n */\n modifyConfig: function (fileContents, onConfig) {\n var details = parse.findConfig(fileContents),\n config = details.config;\n\n if (config) {\n config = onConfig(config);\n if (config) {\n return transform.serializeConfig(config,\n fileContents,\n details.range[0],\n details.range[1],\n {\n quote: details.quote\n });\n }\n }\n\n return fileContents;\n },\n\n serializeConfig: function (config, fileContents, start, end, options) {\n //Calculate base level of indent\n var indent, match, configString, outDentRegExp,\n baseIndent = '',\n startString = fileContents.substring(0, start),\n existingConfigString = fileContents.substring(start, end),\n lineReturn = existingConfigString.indexOf('\\r') === -1 ? '\\n' : '\\r\\n',\n lastReturnIndex = startString.lastIndexOf('\\n');\n\n //Get the basic amount of indent for the require config call.\n if (lastReturnIndex === -1) {\n lastReturnIndex = 0;\n }\n\n match = baseIndentRegExp.exec(startString.substring(lastReturnIndex + 1, start));\n if (match && match[1]) {\n baseIndent = match[1];\n }\n\n //Calculate internal indentation for config\n match = indentRegExp.exec(existingConfigString);\n if (match && match[1]) {\n indent = match[1];\n }\n\n if (!indent || indent.length < baseIndent) {\n indent = ' ';\n } else {\n indent = indent.substring(baseIndent.length);\n }\n\n outDentRegExp = new RegExp('(' + lineReturn + ')' + indent, 'g');\n\n configString = transform.objectToString(config, {\n indent: indent,\n lineReturn: lineReturn,\n outDentRegExp: outDentRegExp,\n quote: options && options.quote\n });\n\n //Add in the base indenting level.\n configString = applyIndent(configString, baseIndent, lineReturn);\n\n return startString + configString + fileContents.substring(end);\n },\n\n /**\n * Tries converting a JS object to a string. This will likely suck, and\n * is tailored to the type of config expected in a loader config call.\n * So, hasOwnProperty fields, strings, numbers, arrays and functions,\n * no weird recursively referenced stuff.\n * @param {Object} obj the object to convert\n * @param {Object} options options object with the following values:\n * {String} indent the indentation to use for each level\n * {String} lineReturn the type of line return to use\n * {outDentRegExp} outDentRegExp the regexp to use to outdent functions\n * {String} quote the quote type to use, ' or \". Optional. Default is \"\n * @param {String} totalIndent the total indent to print for this level\n * @return {String} a string representation of the object.\n */\n objectToString: function (obj, options, totalIndent) {\n var startBrace, endBrace, nextIndent,\n first = true,\n value = '',\n lineReturn = options.lineReturn,\n indent = options.indent,\n outDentRegExp = options.outDentRegExp,\n quote = options.quote || '\"';\n\n totalIndent = totalIndent || '';\n nextIndent = totalIndent + indent;\n\n if (obj === null) {\n value = 'null';\n } else if (obj === undefined) {\n value = 'undefined';\n } else if (typeof obj === 'number' || typeof obj === 'boolean') {\n value = obj;\n } else if (typeof obj === 'string') {\n //Use double quotes in case the config may also work as JSON.\n value = quote + lang.jsEscape(obj) + quote;\n } else if (lang.isArray(obj)) {\n lang.each(obj, function (item, i) {\n value += (i !== 0 ? ',' + lineReturn : '' ) +\n nextIndent +\n transform.objectToString(item,\n options,\n nextIndent);\n });\n\n startBrace = '[';\n endBrace = ']';\n } else if (lang.isFunction(obj) || lang.isRegExp(obj)) {\n //The outdent regexp just helps pretty up the conversion\n //just in node. Rhino strips comments and does a different\n //indent scheme for Function toString, so not really helpful\n //there.\n value = obj.toString().replace(outDentRegExp, '$1');\n } else {\n //An object\n lang.eachProp(obj, function (v, prop) {\n value += (first ? '': ',' + lineReturn) +\n nextIndent +\n (keyRegExp.test(prop) ? prop : quote + lang.jsEscape(prop) + quote )+\n ': ' +\n transform.objectToString(v,\n options,\n nextIndent);\n first = false;\n });\n startBrace = '{';\n endBrace = '}';\n }\n\n if (startBrace) {\n value = startBrace +\n lineReturn +\n value +\n lineReturn + totalIndent +\n endBrace;\n }\n\n return value;\n }\n };\n\n return transform;\n});\n/**\n * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint regexp: true, plusplus: true */\n/*global define: false */\n\ndefine('pragma', ['parse', 'logger'], function (parse, logger) {\n 'use strict';\n function Temp() {}\n\n function create(obj, mixin) {\n Temp.prototype = obj;\n var temp = new Temp(), prop;\n\n //Avoid any extra memory hanging around\n Temp.prototype = null;\n\n if (mixin) {\n for (prop in mixin) {\n if (mixin.hasOwnProperty(prop) && !temp.hasOwnProperty(prop)) {\n temp[prop] = mixin[prop];\n }\n }\n }\n\n return temp; // Object\n }\n\n var pragma = {\n conditionalRegExp: /(exclude|include)Start\\s*\\(\\s*[\"'](\\w+)[\"']\\s*,(.*)\\)/,\n useStrictRegExp: /['\"]use strict['\"];/g,\n hasRegExp: /has\\s*\\(\\s*['\"]([^'\"]+)['\"]\\s*\\)/g,\n configRegExp: /(^|[^\\.])(requirejs|require)(\\.config)\\s*\\(/g,\n nsWrapRegExp: /\\/\\*requirejs namespace: true \\*\\//,\n apiDefRegExp: /var requirejs,\\s*require,\\s*define;/,\n defineCheckRegExp: /typeof\\s+define\\s*===?\\s*[\"']function[\"']\\s*&&\\s*define\\s*\\.\\s*amd/g,\n defineStringCheckRegExp: /typeof\\s+define\\s*===?\\s*[\"']function[\"']\\s*&&\\s*define\\s*\\[\\s*[\"']amd[\"']\\s*\\]/g,\n defineTypeFirstCheckRegExp: /\\s*[\"']function[\"']\\s*==(=?)\\s*typeof\\s+define\\s*&&\\s*define\\s*\\.\\s*amd/g,\n defineJQueryRegExp: /typeof\\s+define\\s*===?\\s*[\"']function[\"']\\s*&&\\s*define\\s*\\.\\s*amd\\s*&&\\s*define\\s*\\.\\s*amd\\s*\\.\\s*jQuery/g,\n defineHasRegExp: /typeof\\s+define\\s*==(=)?\\s*['\"]function['\"]\\s*&&\\s*typeof\\s+define\\.amd\\s*==(=)?\\s*['\"]object['\"]\\s*&&\\s*define\\.amd/g,\n defineTernaryRegExp: /typeof\\s+define\\s*===?\\s*['\"]function[\"']\\s*&&\\s*define\\s*\\.\\s*amd\\s*\\?\\s*define/,\n amdefineRegExp: /if\\s*\\(\\s*typeof define\\s*\\!==\\s*'function'\\s*\\)\\s*\\{\\s*[^\\{\\}]+amdefine[^\\{\\}]+\\}/g,\n\n removeStrict: function (contents, config) {\n return config.useStrict ? contents : contents.replace(pragma.useStrictRegExp, '');\n },\n\n namespace: function (fileContents, ns, onLifecycleName) {\n if (ns) {\n //Namespace require/define calls\n fileContents = fileContents.replace(pragma.configRegExp, '$1' + ns + '.$2$3(');\n\n\n fileContents = parse.renameNamespace(fileContents, ns);\n\n //Namespace define ternary use:\n fileContents = fileContents.replace(pragma.defineTernaryRegExp,\n \"typeof \" + ns + \".define === 'function' && \" + ns + \".define.amd ? \" + ns + \".define\");\n\n //Namespace define jquery use:\n fileContents = fileContents.replace(pragma.defineJQueryRegExp,\n \"typeof \" + ns + \".define === 'function' && \" + ns + \".define.amd && \" + ns + \".define.amd.jQuery\");\n\n //Namespace has.js define use:\n fileContents = fileContents.replace(pragma.defineHasRegExp,\n \"typeof \" + ns + \".define === 'function' && typeof \" + ns + \".define.amd === 'object' && \" + ns + \".define.amd\");\n\n //Namespace define checks.\n //Do these ones last, since they are a subset of the more specific\n //checks above.\n fileContents = fileContents.replace(pragma.defineCheckRegExp,\n \"typeof \" + ns + \".define === 'function' && \" + ns + \".define.amd\");\n fileContents = fileContents.replace(pragma.defineStringCheckRegExp,\n \"typeof \" + ns + \".define === 'function' && \" + ns + \".define['amd']\");\n fileContents = fileContents.replace(pragma.defineTypeFirstCheckRegExp,\n \"'function' === typeof \" + ns + \".define && \" + ns + \".define.amd\");\n\n //Check for require.js with the require/define definitions\n if (pragma.apiDefRegExp.test(fileContents) &&\n fileContents.indexOf(\"if (!\" + ns + \" || !\" + ns + \".requirejs)\") === -1) {\n //Wrap the file contents in a typeof check, and a function\n //to contain the API globals.\n fileContents = \"var \" + ns + \";(function () { if (!\" + ns + \" || !\" + ns + \".requirejs) {\\n\" +\n \"if (!\" + ns + \") { \" + ns + ' = {}; } else { require = ' + ns + '; }\\n' +\n fileContents +\n \"\\n\" +\n ns + \".requirejs = requirejs;\" +\n ns + \".require = require;\" +\n ns + \".define = define;\\n\" +\n \"}\\n}());\";\n }\n\n //Finally, if the file wants a special wrapper because it ties\n //in to the requirejs internals in a way that would not fit\n //the above matches, do that. Look for /*requirejs namespace: true*/\n if (pragma.nsWrapRegExp.test(fileContents)) {\n //Remove the pragma.\n fileContents = fileContents.replace(pragma.nsWrapRegExp, '');\n\n //Alter the contents.\n fileContents = '(function () {\\n' +\n 'var require = ' + ns + '.require,' +\n 'requirejs = ' + ns + '.requirejs,' +\n 'define = ' + ns + '.define;\\n' +\n fileContents +\n '\\n}());';\n }\n }\n\n return fileContents;\n },\n\n /**\n * processes the fileContents for some //>> conditional statements\n */\n process: function (fileName, fileContents, config, onLifecycleName, pluginCollector) {\n /*jslint evil: true */\n var foundIndex = -1, startIndex = 0, lineEndIndex, conditionLine,\n matches, type, marker, condition, isTrue, endRegExp, endMatches,\n endMarkerIndex, shouldInclude, startLength, lifecycleHas, deps,\n i, dep, moduleName, collectorMod,\n lifecyclePragmas, pragmas = config.pragmas, hasConfig = config.has,\n //Legacy arg defined to help in dojo conversion script. Remove later\n //when dojo no longer needs conversion:\n kwArgs = pragmas;\n\n //Mix in a specific lifecycle scoped object, to allow targeting\n //some pragmas/has tests to only when files are saved, or at different\n //lifecycle events. Do not bother with kwArgs in this section, since\n //the old dojo kwArgs were for all points in the build lifecycle.\n if (onLifecycleName) {\n lifecyclePragmas = config['pragmas' + onLifecycleName];\n lifecycleHas = config['has' + onLifecycleName];\n\n if (lifecyclePragmas) {\n pragmas = create(pragmas || {}, lifecyclePragmas);\n }\n\n if (lifecycleHas) {\n hasConfig = create(hasConfig || {}, lifecycleHas);\n }\n }\n\n //Replace has references if desired\n if (hasConfig) {\n fileContents = fileContents.replace(pragma.hasRegExp, function (match, test) {\n if (hasConfig.hasOwnProperty(test)) {\n return !!hasConfig[test];\n }\n return match;\n });\n }\n\n if (!config.skipPragmas) {\n\n while ((foundIndex = fileContents.indexOf(\"//>>\", startIndex)) !== -1) {\n //Found a conditional. Get the conditional line.\n lineEndIndex = fileContents.indexOf(\"\\n\", foundIndex);\n if (lineEndIndex === -1) {\n lineEndIndex = fileContents.length - 1;\n }\n\n //Increment startIndex past the line so the next conditional search can be done.\n startIndex = lineEndIndex + 1;\n\n //Break apart the conditional.\n conditionLine = fileContents.substring(foundIndex, lineEndIndex + 1);\n matches = conditionLine.match(pragma.conditionalRegExp);\n if (matches) {\n type = matches[1];\n marker = matches[2];\n condition = matches[3];\n isTrue = false;\n //See if the condition is true.\n try {\n isTrue = !!eval(\"(\" + condition + \")\");\n } catch (e) {\n throw \"Error in file: \" +\n fileName +\n \". Conditional comment: \" +\n conditionLine +\n \" failed with this error: \" + e;\n }\n\n //Find the endpoint marker.\n endRegExp = new RegExp('\\\\/\\\\/\\\\>\\\\>\\\\s*' + type + 'End\\\\(\\\\s*[\\'\"]' + marker + '[\\'\"]\\\\s*\\\\)', \"g\");\n endMatches = endRegExp.exec(fileContents.substring(startIndex, fileContents.length));\n if (endMatches) {\n endMarkerIndex = startIndex + endRegExp.lastIndex - endMatches[0].length;\n\n //Find the next line return based on the match position.\n lineEndIndex = fileContents.indexOf(\"\\n\", endMarkerIndex);\n if (lineEndIndex === -1) {\n lineEndIndex = fileContents.length - 1;\n }\n\n //Should we include the segment?\n shouldInclude = ((type === \"exclude\" && !isTrue) || (type === \"include\" && isTrue));\n\n //Remove the conditional comments, and optionally remove the content inside\n //the conditional comments.\n startLength = startIndex - foundIndex;\n fileContents = fileContents.substring(0, foundIndex) +\n (shouldInclude ? fileContents.substring(startIndex, endMarkerIndex) : \"\") +\n fileContents.substring(lineEndIndex + 1, fileContents.length);\n\n //Move startIndex to foundIndex, since that is the new position in the file\n //where we need to look for more conditionals in the next while loop pass.\n startIndex = foundIndex;\n } else {\n throw \"Error in file: \" +\n fileName +\n \". Cannot find end marker for conditional comment: \" +\n conditionLine;\n\n }\n }\n }\n }\n\n //If need to find all plugin resources to optimize, do that now,\n //before namespacing, since the namespacing will change the API\n //names.\n //If there is a plugin collector, scan the file for plugin resources.\n if (config.optimizeAllPluginResources && pluginCollector) {\n try {\n deps = parse.findDependencies(fileName, fileContents);\n if (deps.length) {\n for (i = 0; i < deps.length; i++) {\n dep = deps[i];\n if (dep.indexOf('!') !== -1) {\n moduleName = dep.split('!')[0];\n collectorMod = pluginCollector[moduleName];\n if (!collectorMod) {\n collectorMod = pluginCollector[moduleName] = [];\n }\n collectorMod.push(dep);\n }\n }\n }\n } catch (eDep) {\n logger.error('Parse error looking for plugin resources in ' +\n fileName + ', skipping.');\n }\n }\n\n //Strip amdefine use for node-shared modules.\n if (!config.keepAmdefine) {\n fileContents = fileContents.replace(pragma.amdefineRegExp, '');\n }\n\n //Do namespacing\n if (onLifecycleName === 'OnSave' && config.namespace) {\n fileContents = pragma.namespace(fileContents, config.namespace, onLifecycleName);\n }\n\n\n return pragma.removeStrict(fileContents, config);\n }\n };\n\n return pragma;\n});\nif(env === 'browser') {\n/**\n * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint strict: false */\n/*global define: false */\n\ndefine('browser/optimize', {});\n\n}\n\nif(env === 'node') {\n/**\n * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint strict: false */\n/*global define: false */\n\ndefine('node/optimize', {});\n\n}\n\nif(env === 'rhino') {\n/**\n * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint sloppy: true, plusplus: true */\n/*global define, java, Packages, com */\n\ndefine('rhino/optimize', ['logger', 'env!env/file'], function (logger, file) {\n\n //Add .reduce to Rhino so UglifyJS can run in Rhino,\n //inspired by https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/reduce\n //but rewritten for brevity, and to be good enough for use by UglifyJS.\n if (!Array.prototype.reduce) {\n Array.prototype.reduce = function (fn /*, initialValue */) {\n var i = 0,\n length = this.length,\n accumulator;\n\n if (arguments.length >= 2) {\n accumulator = arguments[1];\n } else {\n if (length) {\n while (!(i in this)) {\n i++;\n }\n accumulator = this[i++];\n }\n }\n\n for (; i < length; i++) {\n if (i in this) {\n accumulator = fn.call(undefined, accumulator, this[i], i, this);\n }\n }\n\n return accumulator;\n };\n }\n\n var JSSourceFilefromCode, optimize,\n mapRegExp = /\"file\":\"[^\"]+\"/;\n\n //Bind to Closure compiler, but if it is not available, do not sweat it.\n try {\n // Try older closure compiler that worked on Java 6\n JSSourceFilefromCode = java.lang.Class.forName('com.google.javascript.jscomp.JSSourceFile').getMethod('fromCode', [java.lang.String, java.lang.String]);\n } catch (e) {\n try {\n // Try for newer closure compiler that needs Java 7+\n JSSourceFilefromCode = java.lang.Class.forName('com.google.javascript.jscomp.SourceFile').getMethod('fromCode', [java.lang.String, java.lang.String]);\n } catch (e) {}\n }\n\n //Helper for closure compiler, because of weird Java-JavaScript interactions.\n function closurefromCode(filename, content) {\n return JSSourceFilefromCode.invoke(null, [filename, content]);\n }\n\n\n function getFileWriter(fileName, encoding) {\n var outFile = new java.io.File(fileName), outWriter, parentDir;\n\n parentDir = outFile.getAbsoluteFile().getParentFile();\n if (!parentDir.exists()) {\n if (!parentDir.mkdirs()) {\n throw \"Could not create directory: \" + parentDir.getAbsolutePath();\n }\n }\n\n if (encoding) {\n outWriter = new java.io.OutputStreamWriter(new java.io.FileOutputStream(outFile), encoding);\n } else {\n outWriter = new java.io.OutputStreamWriter(new java.io.FileOutputStream(outFile));\n }\n\n return new java.io.BufferedWriter(outWriter);\n }\n\n optimize = {\n closure: function (fileName, fileContents, outFileName, keepLines, config) {\n config = config || {};\n var result, mappings, optimized, compressed, baseName, writer,\n outBaseName, outFileNameMap, outFileNameMapContent,\n srcOutFileName, concatNameMap,\n jscomp = Packages.com.google.javascript.jscomp,\n flags = Packages.com.google.common.flags,\n //Set up source input\n jsSourceFile = closurefromCode(String(fileName), String(fileContents)),\n sourceListArray = new java.util.ArrayList(),\n options, option, FLAG_compilation_level, compiler,\n Compiler = Packages.com.google.javascript.jscomp.Compiler,\n CommandLineRunner = Packages.com.google.javascript.jscomp.CommandLineRunner;\n\n logger.trace(\"Minifying file: \" + fileName);\n\n baseName = (new java.io.File(fileName)).getName();\n\n //Set up options\n options = new jscomp.CompilerOptions();\n for (option in config.CompilerOptions) {\n // options are false by default and jslint wanted an if statement in this for loop\n if (config.CompilerOptions[option]) {\n options[option] = config.CompilerOptions[option];\n }\n\n }\n options.prettyPrint = keepLines || options.prettyPrint;\n\n FLAG_compilation_level = jscomp.CompilationLevel[config.CompilationLevel || 'SIMPLE_OPTIMIZATIONS'];\n FLAG_compilation_level.setOptionsForCompilationLevel(options);\n\n if (config.generateSourceMaps) {\n mappings = new java.util.ArrayList();\n\n mappings.add(new com.google.javascript.jscomp.SourceMap.LocationMapping(fileName, baseName + \".src.js\"));\n options.setSourceMapLocationMappings(mappings);\n options.setSourceMapOutputPath(fileName + \".map\");\n }\n\n //Trigger the compiler\n Compiler.setLoggingLevel(Packages.java.util.logging.Level[config.loggingLevel || 'WARNING']);\n compiler = new Compiler();\n\n //fill the sourceArrrayList; we need the ArrayList because the only overload of compile\n //accepting the getDefaultExterns return value (a List) also wants the sources as a List\n sourceListArray.add(jsSourceFile);\n\n result = compiler.compile(CommandLineRunner.getDefaultExterns(), sourceListArray, options);\n if (result.success) {\n optimized = String(compiler.toSource());\n\n if (config.generateSourceMaps && result.sourceMap && outFileName) {\n outBaseName = (new java.io.File(outFileName)).getName();\n\n srcOutFileName = outFileName + \".src.js\";\n outFileNameMap = outFileName + \".map\";\n\n //If previous .map file exists, move it to the \".src.js\"\n //location. Need to update the sourceMappingURL part in the\n //src.js file too.\n if (file.exists(outFileNameMap)) {\n concatNameMap = outFileNameMap.replace(/\\.map$/, '.src.js.map');\n file.saveFile(concatNameMap, file.readFile(outFileNameMap));\n file.saveFile(srcOutFileName,\n fileContents.replace(/\\/\\# sourceMappingURL=(.+).map/,\n '/# sourceMappingURL=$1.src.js.map'));\n } else {\n file.saveUtf8File(srcOutFileName, fileContents);\n }\n\n writer = getFileWriter(outFileNameMap, \"utf-8\");\n result.sourceMap.appendTo(writer, outFileName);\n writer.close();\n\n //Not sure how better to do this, but right now the .map file\n //leaks the full OS path in the \"file\" property. Manually\n //modify it to not do that.\n file.saveFile(outFileNameMap,\n file.readFile(outFileNameMap).replace(mapRegExp, '\"file\":\"' + baseName + '\"'));\n\n fileContents = optimized + \"\\n//# sourceMappingURL=\" + outBaseName + \".map\";\n } else {\n fileContents = optimized;\n }\n return fileContents;\n } else {\n throw new Error('Cannot closure compile file: ' + fileName + '. Skipping it.');\n }\n\n return fileContents;\n }\n };\n\n return optimize;\n});\n}\n\nif(env === 'xpconnect') {\ndefine('xpconnect/optimize', {});\n}\n/**\n * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint plusplus: true, nomen: true, regexp: true */\n/*global define: false */\n\ndefine('optimize', [ 'lang', 'logger', 'env!env/optimize', 'env!env/file', 'parse',\n 'pragma', 'uglifyjs/index', 'uglifyjs2',\n 'source-map'],\nfunction (lang, logger, envOptimize, file, parse,\n pragma, uglify, uglify2,\n sourceMap) {\n 'use strict';\n\n var optimize,\n cssImportRegExp = /\\@import\\s+(url\\()?\\s*([^);]+)\\s*(\\))?([\\w, ]*)(;)?/ig,\n cssCommentImportRegExp = /\\/\\*[^\\*]*@import[^\\*]*\\*\\//g,\n cssUrlRegExp = /\\url\\(\\s*([^\\)]+)\\s*\\)?/g,\n protocolRegExp = /^\\w+:/,\n SourceMapGenerator = sourceMap.SourceMapGenerator,\n SourceMapConsumer =sourceMap.SourceMapConsumer;\n\n /**\n * If an URL from a CSS url value contains start/end quotes, remove them.\n * This is not done in the regexp, since my regexp fu is not that strong,\n * and the CSS spec allows for ' and \" in the URL if they are backslash escaped.\n * @param {String} url\n */\n function cleanCssUrlQuotes(url) {\n //Make sure we are not ending in whitespace.\n //Not very confident of the css regexps above that there will not be ending\n //whitespace.\n url = url.replace(/\\s+$/, \"\");\n\n if (url.charAt(0) === \"'\" || url.charAt(0) === \"\\\"\") {\n url = url.substring(1, url.length - 1);\n }\n\n return url;\n }\n\n function fixCssUrlPaths(fileName, path, contents, cssPrefix) {\n return contents.replace(cssUrlRegExp, function (fullMatch, urlMatch) {\n var firstChar, hasProtocol, parts, i,\n fixedUrlMatch = cleanCssUrlQuotes(urlMatch);\n\n fixedUrlMatch = fixedUrlMatch.replace(lang.backSlashRegExp, \"/\");\n\n //Only do the work for relative URLs. Skip things that start with / or #, or have\n //a protocol.\n firstChar = fixedUrlMatch.charAt(0);\n hasProtocol = protocolRegExp.test(fixedUrlMatch);\n if (firstChar !== \"/\" && firstChar !== \"#\" && !hasProtocol) {\n //It is a relative URL, tack on the cssPrefix and path prefix\n urlMatch = cssPrefix + path + fixedUrlMatch;\n } else if (!hasProtocol) {\n logger.trace(fileName + \"\\n URL not a relative URL, skipping: \" + urlMatch);\n }\n\n //Collapse .. and .\n parts = urlMatch.split(\"/\");\n for (i = parts.length - 1; i > 0; i--) {\n if (parts[i] === \".\") {\n parts.splice(i, 1);\n } else if (parts[i] === \"..\") {\n if (i !== 0 && parts[i - 1] !== \"..\") {\n parts.splice(i - 1, 2);\n i -= 1;\n }\n }\n }\n\n return \"url(\" + parts.join(\"/\") + \")\";\n });\n }\n\n /**\n * Inlines nested stylesheets that have @import calls in them.\n * @param {String} fileName the file name\n * @param {String} fileContents the file contents\n * @param {String} cssImportIgnore comma delimited string of files to ignore\n * @param {String} cssPrefix string to be prefixed before relative URLs\n * @param {Object} included an object used to track the files already imported\n */\n function flattenCss(fileName, fileContents, cssImportIgnore, cssPrefix, included, topLevel) {\n //Find the last slash in the name.\n fileName = fileName.replace(lang.backSlashRegExp, \"/\");\n var endIndex = fileName.lastIndexOf(\"/\"),\n //Make a file path based on the last slash.\n //If no slash, so must be just a file name. Use empty string then.\n filePath = (endIndex !== -1) ? fileName.substring(0, endIndex + 1) : \"\",\n //store a list of merged files\n importList = [],\n skippedList = [];\n\n //First make a pass by removing any commented out @import calls.\n fileContents = fileContents.replace(cssCommentImportRegExp, '');\n\n //Make sure we have a delimited ignore list to make matching faster\n if (cssImportIgnore && cssImportIgnore.charAt(cssImportIgnore.length - 1) !== \",\") {\n cssImportIgnore += \",\";\n }\n\n fileContents = fileContents.replace(cssImportRegExp, function (fullMatch, urlStart, importFileName, urlEnd, mediaTypes) {\n //Only process media type \"all\" or empty media type rules.\n if (mediaTypes && ((mediaTypes.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '')) !== \"all\")) {\n skippedList.push(fileName);\n return fullMatch;\n }\n\n importFileName = cleanCssUrlQuotes(importFileName);\n\n //Ignore the file import if it is part of an ignore list.\n if (cssImportIgnore && cssImportIgnore.indexOf(importFileName + \",\") !== -1) {\n return fullMatch;\n }\n\n //Make sure we have a unix path for the rest of the operation.\n importFileName = importFileName.replace(lang.backSlashRegExp, \"/\");\n\n try {\n //if a relative path, then tack on the filePath.\n //If it is not a relative path, then the readFile below will fail,\n //and we will just skip that import.\n var fullImportFileName = importFileName.charAt(0) === \"/\" ? importFileName : filePath + importFileName,\n importContents = file.readFile(fullImportFileName),\n importEndIndex, importPath, flat;\n\n //Skip the file if it has already been included.\n if (included[fullImportFileName]) {\n return '';\n }\n included[fullImportFileName] = true;\n\n //Make sure to flatten any nested imports.\n flat = flattenCss(fullImportFileName, importContents, cssImportIgnore, cssPrefix, included);\n importContents = flat.fileContents;\n\n if (flat.importList.length) {\n importList.push.apply(importList, flat.importList);\n }\n if (flat.skippedList.length) {\n skippedList.push.apply(skippedList, flat.skippedList);\n }\n\n //Make the full import path\n importEndIndex = importFileName.lastIndexOf(\"/\");\n\n //Make a file path based on the last slash.\n //If no slash, so must be just a file name. Use empty string then.\n importPath = (importEndIndex !== -1) ? importFileName.substring(0, importEndIndex + 1) : \"\";\n\n //fix url() on relative import (#5)\n importPath = importPath.replace(/^\\.\\//, '');\n\n //Modify URL paths to match the path represented by this file.\n importContents = fixCssUrlPaths(importFileName, importPath, importContents, cssPrefix);\n\n importList.push(fullImportFileName);\n return importContents;\n } catch (e) {\n logger.warn(fileName + \"\\n Cannot inline css import, skipping: \" + importFileName);\n return fullMatch;\n }\n });\n\n if (cssPrefix && topLevel) {\n //Modify URL paths to match the path represented by this file.\n fileContents = fixCssUrlPaths(fileName, '', fileContents, cssPrefix);\n }\n\n return {\n importList : importList,\n skippedList: skippedList,\n fileContents : fileContents\n };\n }\n\n optimize = {\n /**\n * Optimizes a file that contains JavaScript content. Optionally collects\n * plugin resources mentioned in a file, and then passes the content\n * through an minifier if one is specified via config.optimize.\n *\n * @param {String} fileName the name of the file to optimize\n * @param {String} fileContents the contents to optimize. If this is\n * a null value, then fileName will be used to read the fileContents.\n * @param {String} outFileName the name of the file to use for the\n * saved optimized content.\n * @param {Object} config the build config object.\n * @param {Array} [pluginCollector] storage for any plugin resources\n * found.\n */\n jsFile: function (fileName, fileContents, outFileName, config, pluginCollector) {\n if (!fileContents) {\n fileContents = file.readFile(fileName);\n }\n\n fileContents = optimize.js(fileName, fileContents, outFileName, config, pluginCollector);\n\n file.saveUtf8File(outFileName, fileContents);\n },\n\n /**\n * Optimizes a file that contains JavaScript content. Optionally collects\n * plugin resources mentioned in a file, and then passes the content\n * through an minifier if one is specified via config.optimize.\n *\n * @param {String} fileName the name of the file that matches the\n * fileContents.\n * @param {String} fileContents the string of JS to optimize.\n * @param {Object} [config] the build config object.\n * @param {Array} [pluginCollector] storage for any plugin resources\n * found.\n */\n js: function (fileName, fileContents, outFileName, config, pluginCollector) {\n var optFunc, optConfig,\n parts = (String(config.optimize)).split('.'),\n optimizerName = parts[0],\n keepLines = parts[1] === 'keepLines',\n licenseContents = '';\n\n config = config || {};\n\n //Apply pragmas/namespace renaming\n fileContents = pragma.process(fileName, fileContents, config, 'OnSave', pluginCollector);\n\n //Optimize the JS files if asked.\n if (optimizerName && optimizerName !== 'none') {\n optFunc = envOptimize[optimizerName] || optimize.optimizers[optimizerName];\n if (!optFunc) {\n throw new Error('optimizer with name of \"' +\n optimizerName +\n '\" not found for this environment');\n }\n\n optConfig = config[optimizerName] || {};\n if (config.generateSourceMaps) {\n optConfig.generateSourceMaps = !!config.generateSourceMaps;\n optConfig._buildSourceMap = config._buildSourceMap;\n }\n\n try {\n if (config.preserveLicenseComments) {\n //Pull out any license comments for prepending after optimization.\n try {\n licenseContents = parse.getLicenseComments(fileName, fileContents);\n } catch (e) {\n throw new Error('Cannot parse file: ' + fileName + ' for comments. Skipping it. Error is:\\n' + e.toString());\n }\n }\n\n fileContents = licenseContents + optFunc(fileName,\n fileContents,\n outFileName,\n keepLines,\n optConfig);\n if (optConfig._buildSourceMap && optConfig._buildSourceMap !== config._buildSourceMap) {\n config._buildSourceMap = optConfig._buildSourceMap;\n }\n } catch (e) {\n if (config.throwWhen && config.throwWhen.optimize) {\n throw e;\n } else {\n logger.error(e);\n }\n }\n } else {\n if (config._buildSourceMap) {\n config._buildSourceMap = null;\n }\n }\n\n return fileContents;\n },\n\n /**\n * Optimizes one CSS file, inlining @import calls, stripping comments, and\n * optionally removes line returns.\n * @param {String} fileName the path to the CSS file to optimize\n * @param {String} outFileName the path to save the optimized file.\n * @param {Object} config the config object with the optimizeCss and\n * cssImportIgnore options.\n */\n cssFile: function (fileName, outFileName, config) {\n\n //Read in the file. Make sure we have a JS string.\n var originalFileContents = file.readFile(fileName),\n flat = flattenCss(fileName, originalFileContents, config.cssImportIgnore, config.cssPrefix, {}, true),\n //Do not use the flattened CSS if there was one that was skipped.\n fileContents = flat.skippedList.length ? originalFileContents : flat.fileContents,\n startIndex, endIndex, buildText, comment;\n\n if (flat.skippedList.length) {\n logger.warn('Cannot inline @imports for ' + fileName +\n ',\\nthe following files had media queries in them:\\n' +\n flat.skippedList.join('\\n'));\n }\n\n //Do comment removal.\n try {\n if (config.optimizeCss.indexOf(\".keepComments\") === -1) {\n startIndex = 0;\n //Get rid of comments.\n while ((startIndex = fileContents.indexOf(\"/*\", startIndex)) !== -1) {\n endIndex = fileContents.indexOf(\"*/\", startIndex + 2);\n if (endIndex === -1) {\n throw \"Improper comment in CSS file: \" + fileName;\n }\n comment = fileContents.substring(startIndex, endIndex);\n\n if (config.preserveLicenseComments &&\n (comment.indexOf('license') !== -1 ||\n comment.indexOf('opyright') !== -1 ||\n comment.indexOf('(c)') !== -1)) {\n //Keep the comment, just increment the startIndex\n startIndex = endIndex;\n } else {\n fileContents = fileContents.substring(0, startIndex) + fileContents.substring(endIndex + 2, fileContents.length);\n startIndex = 0;\n }\n }\n }\n //Get rid of newlines.\n if (config.optimizeCss.indexOf(\".keepLines\") === -1) {\n fileContents = fileContents.replace(/[\\r\\n]/g, \" \");\n fileContents = fileContents.replace(/\\s+/g, \" \");\n fileContents = fileContents.replace(/\\{\\s/g, \"{\");\n fileContents = fileContents.replace(/\\s\\}/g, \"}\");\n } else {\n //Remove multiple empty lines.\n fileContents = fileContents.replace(/(\\r\\n)+/g, \"\\r\\n\");\n fileContents = fileContents.replace(/(\\n)+/g, \"\\n\");\n }\n //Remove unnecessary whitespace\n if (config.optimizeCss.indexOf(\".keepWhitespace\") === -1) {\n //Remove leading and trailing whitespace from lines\n fileContents = fileContents.replace(/^[ \\t]+/gm, \"\");\n fileContents = fileContents.replace(/[ \\t]+$/gm, \"\");\n //Remove whitespace after semicolon, colon, curly brackets and commas\n fileContents = fileContents.replace(/(;|:|\\{|}|,)[ \\t]+/g, \"$1\");\n //Remove whitespace before opening curly brackets\n fileContents = fileContents.replace(/[ \\t]+(\\{)/g, \"$1\");\n //Truncate double whitespace\n fileContents = fileContents.replace(/([ \\t])+/g, \"$1\");\n //Remove empty lines\n fileContents = fileContents.replace(/^[ \\t]*[\\r\\n]/gm,'');\n }\n } catch (e) {\n fileContents = originalFileContents;\n logger.error(\"Could not optimized CSS file: \" + fileName + \", error: \" + e);\n }\n\n file.saveUtf8File(outFileName, fileContents);\n\n //text output to stdout and/or written to build.txt file\n buildText = \"\\n\"+ outFileName.replace(config.dir, \"\") +\"\\n----------------\\n\";\n flat.importList.push(fileName);\n buildText += flat.importList.map(function(path){\n return path.replace(config.dir, \"\");\n }).join(\"\\n\");\n\n return {\n importList: flat.importList,\n buildText: buildText +\"\\n\"\n };\n },\n\n /**\n * Optimizes CSS files, inlining @import calls, stripping comments, and\n * optionally removes line returns.\n * @param {String} startDir the path to the top level directory\n * @param {Object} config the config object with the optimizeCss and\n * cssImportIgnore options.\n */\n css: function (startDir, config) {\n var buildText = \"\",\n importList = [],\n shouldRemove = config.dir && config.removeCombined,\n i, fileName, result, fileList;\n if (config.optimizeCss.indexOf(\"standard\") !== -1) {\n fileList = file.getFilteredFileList(startDir, /\\.css$/, true);\n if (fileList) {\n for (i = 0; i < fileList.length; i++) {\n fileName = fileList[i];\n logger.trace(\"Optimizing (\" + config.optimizeCss + \") CSS file: \" + fileName);\n result = optimize.cssFile(fileName, fileName, config);\n buildText += result.buildText;\n if (shouldRemove) {\n result.importList.pop();\n importList = importList.concat(result.importList);\n }\n }\n }\n\n if (shouldRemove) {\n importList.forEach(function (path) {\n if (file.exists(path)) {\n file.deleteFile(path);\n }\n });\n }\n }\n return buildText;\n },\n\n optimizers: {\n uglify: function (fileName, fileContents, outFileName, keepLines, config) {\n var parser = uglify.parser,\n processor = uglify.uglify,\n ast, errMessage, errMatch;\n\n config = config || {};\n\n logger.trace(\"Uglifying file: \" + fileName);\n\n try {\n ast = parser.parse(fileContents, config.strict_semicolons);\n if (config.no_mangle !== true) {\n ast = processor.ast_mangle(ast, config);\n }\n ast = processor.ast_squeeze(ast, config);\n\n fileContents = processor.gen_code(ast, config);\n\n if (config.max_line_length) {\n fileContents = processor.split_lines(fileContents, config.max_line_length);\n }\n\n //Add trailing semicolon to match uglifyjs command line version\n fileContents += ';';\n } catch (e) {\n errMessage = e.toString();\n errMatch = /\\nError(\\r)?\\n/.exec(errMessage);\n if (errMatch) {\n errMessage = errMessage.substring(0, errMatch.index);\n }\n throw new Error('Cannot uglify file: ' + fileName + '. Skipping it. Error is:\\n' + errMessage);\n }\n return fileContents;\n },\n uglify2: function (fileName, fileContents, outFileName, keepLines, config) {\n var result, existingMap, resultMap, finalMap, sourceIndex,\n uconfig = {},\n existingMapPath = outFileName + '.map',\n baseName = fileName && fileName.split('/').pop();\n\n config = config || {};\n\n lang.mixin(uconfig, config, true);\n\n uconfig.fromString = true;\n\n if (config.generateSourceMaps && (outFileName || config._buildSourceMap)) {\n uconfig.outSourceMap = baseName;\n\n if (config._buildSourceMap) {\n existingMap = JSON.parse(config._buildSourceMap);\n uconfig.inSourceMap = existingMap;\n } else if (file.exists(existingMapPath)) {\n uconfig.inSourceMap = existingMapPath;\n existingMap = JSON.parse(file.readFile(existingMapPath));\n }\n }\n\n logger.trace(\"Uglify2 file: \" + fileName);\n\n try {\n //var tempContents = fileContents.replace(/\\/\\/\\# sourceMappingURL=.*$/, '');\n result = uglify2.minify(fileContents, uconfig, baseName + '.src.js');\n if (uconfig.outSourceMap && result.map) {\n resultMap = result.map;\n if (existingMap) {\n resultMap = JSON.parse(resultMap);\n finalMap = SourceMapGenerator.fromSourceMap(new SourceMapConsumer(resultMap));\n finalMap.applySourceMap(new SourceMapConsumer(existingMap));\n resultMap = finalMap.toString();\n } else if (!config._buildSourceMap) {\n file.saveFile(outFileName + '.src.js', fileContents);\n }\n\n fileContents = result.code;\n\n if (config._buildSourceMap) {\n config._buildSourceMap = resultMap;\n } else {\n file.saveFile(outFileName + '.map', resultMap);\n fileContents += \"\\n//# sourceMappingURL=\" + baseName + \".map\";\n }\n } else {\n fileContents = result.code;\n }\n } catch (e) {\n throw new Error('Cannot uglify2 file: ' + fileName + '. Skipping it. Error is:\\n' + e.toString());\n }\n return fileContents;\n }\n }\n };\n\n return optimize;\n});\n/**\n * @license RequireJS Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n/*\n * This file patches require.js to communicate with the build system.\n */\n\n//Using sloppy since this uses eval for some code like plugins,\n//which may not be strict mode compliant. So if use strict is used\n//below they will have strict rules applied and may cause an error.\n/*jslint sloppy: true, nomen: true, plusplus: true, regexp: true */\n/*global require, define: true */\n\n//NOT asking for require as a dependency since the goal is to modify the\n//global require below\ndefine('requirePatch', [ 'env!env/file', 'pragma', 'parse', 'lang', 'logger', 'commonJs', 'prim'], function (\n file,\n pragma,\n parse,\n lang,\n logger,\n commonJs,\n prim\n) {\n\n var allowRun = true,\n hasProp = lang.hasProp,\n falseProp = lang.falseProp,\n getOwn = lang.getOwn;\n\n //Turn off throwing on resolution conflict, that was just an older prim\n //idea about finding errors early, but does not comply with how promises\n //should operate.\n prim.hideResolutionConflict = true;\n\n //This method should be called when the patches to require should take hold.\n return function () {\n if (!allowRun) {\n return;\n }\n allowRun = false;\n\n var layer,\n pluginBuilderRegExp = /([\"']?)pluginBuilder([\"']?)\\s*[=\\:]\\s*[\"']([^'\"\\s]+)[\"']/,\n oldNewContext = require.s.newContext,\n oldDef,\n\n //create local undefined values for module and exports,\n //so that when files are evaled in this function they do not\n //see the node values used for r.js\n exports,\n module;\n\n /**\n * Reset \"global\" build caches that are kept around between\n * build layer builds. Useful to do when there are multiple\n * top level requirejs.optimize() calls.\n */\n require._cacheReset = function () {\n //Stored raw text caches, used by browser use.\n require._cachedRawText = {};\n //Stored cached file contents for reuse in other layers.\n require._cachedFileContents = {};\n //Store which cached files contain a require definition.\n require._cachedDefinesRequireUrls = {};\n };\n require._cacheReset();\n\n /**\n * Makes sure the URL is something that can be supported by the\n * optimization tool.\n * @param {String} url\n * @returns {Boolean}\n */\n require._isSupportedBuildUrl = function (url) {\n //Ignore URLs with protocols, hosts or question marks, means either network\n //access is needed to fetch it or it is too dynamic. Note that\n //on Windows, full paths are used for some urls, which include\n //the drive, like c:/something, so need to test for something other\n //than just a colon.\n if (url.indexOf(\"://\") === -1 && url.indexOf(\"?\") === -1 &&\n url.indexOf('empty:') !== 0 && url.indexOf('//') !== 0) {\n return true;\n } else {\n if (!layer.ignoredUrls[url]) {\n if (url.indexOf('empty:') === -1) {\n logger.info('Cannot optimize network URL, skipping: ' + url);\n }\n layer.ignoredUrls[url] = true;\n }\n return false;\n }\n };\n\n function normalizeUrlWithBase(context, moduleName, url) {\n //Adjust the URL if it was not transformed to use baseUrl.\n if (require.jsExtRegExp.test(moduleName)) {\n url = (context.config.dir || context.config.dirBaseUrl) + url;\n }\n return url;\n }\n\n //Overrides the new context call to add existing tracking features.\n require.s.newContext = function (name) {\n var context = oldNewContext(name),\n oldEnable = context.enable,\n moduleProto = context.Module.prototype,\n oldInit = moduleProto.init,\n oldCallPlugin = moduleProto.callPlugin;\n\n //Only do this for the context used for building.\n if (name === '_') {\n //For build contexts, do everything sync\n context.nextTick = function (fn) {\n fn();\n };\n\n context.needFullExec = {};\n context.fullExec = {};\n context.plugins = {};\n context.buildShimExports = {};\n\n //Override the shim exports function generator to just\n //spit out strings that can be used in the stringified\n //build output.\n context.makeShimExports = function (value) {\n var fn;\n if (context.config.wrapShim) {\n fn = function () {\n var str = 'return ';\n // If specifies an export that is just a global\n // name, no dot for a `this.` and such, then also\n // attach to the global, for `var a = {}` files\n // where the function closure would hide that from\n // the global object.\n if (value.exports && value.exports.indexOf('.') === -1) {\n str += 'root.' + value.exports + ' = ';\n }\n\n if (value.init) {\n str += '(' + value.init.toString() + '.apply(this, arguments))';\n }\n if (value.init && value.exports) {\n str += ' || ';\n }\n if (value.exports) {\n str += value.exports;\n }\n str += ';';\n return str;\n };\n } else {\n fn = function () {\n return '(function (global) {\\n' +\n ' return function () {\\n' +\n ' var ret, fn;\\n' +\n (value.init ?\n (' fn = ' + value.init.toString() + ';\\n' +\n ' ret = fn.apply(global, arguments);\\n') : '') +\n (value.exports ?\n ' return ret || global.' + value.exports + ';\\n' :\n ' return ret;\\n') +\n ' };\\n' +\n '}(this))';\n };\n }\n\n return fn;\n };\n\n context.enable = function (depMap, parent) {\n var id = depMap.id,\n parentId = parent && parent.map.id,\n needFullExec = context.needFullExec,\n fullExec = context.fullExec,\n mod = getOwn(context.registry, id);\n\n if (mod && !mod.defined) {\n if (parentId && getOwn(needFullExec, parentId)) {\n needFullExec[id] = depMap;\n }\n\n } else if ((getOwn(needFullExec, id) && falseProp(fullExec, id)) ||\n (parentId && getOwn(needFullExec, parentId) &&\n falseProp(fullExec, id))) {\n context.require.undef(id);\n }\n\n return oldEnable.apply(context, arguments);\n };\n\n //Override load so that the file paths can be collected.\n context.load = function (moduleName, url) {\n /*jslint evil: true */\n var contents, pluginBuilderMatch, builderName,\n shim, shimExports;\n\n //Do not mark the url as fetched if it is\n //not an empty: URL, used by the optimizer.\n //In that case we need to be sure to call\n //load() for each module that is mapped to\n //empty: so that dependencies are satisfied\n //correctly.\n if (url.indexOf('empty:') === 0) {\n delete context.urlFetched[url];\n }\n\n //Only handle urls that can be inlined, so that means avoiding some\n //URLs like ones that require network access or may be too dynamic,\n //like JSONP\n if (require._isSupportedBuildUrl(url)) {\n //Adjust the URL if it was not transformed to use baseUrl.\n url = normalizeUrlWithBase(context, moduleName, url);\n\n //Save the module name to path and path to module name mappings.\n layer.buildPathMap[moduleName] = url;\n layer.buildFileToModule[url] = moduleName;\n\n if (hasProp(context.plugins, moduleName)) {\n //plugins need to have their source evaled as-is.\n context.needFullExec[moduleName] = true;\n }\n\n prim().start(function () {\n if (hasProp(require._cachedFileContents, url) &&\n (falseProp(context.needFullExec, moduleName) ||\n getOwn(context.fullExec, moduleName))) {\n contents = require._cachedFileContents[url];\n\n //If it defines require, mark it so it can be hoisted.\n //Done here and in the else below, before the\n //else block removes code from the contents.\n //Related to #263\n if (!layer.existingRequireUrl && require._cachedDefinesRequireUrls[url]) {\n layer.existingRequireUrl = url;\n }\n } else {\n //Load the file contents, process for conditionals, then\n //evaluate it.\n return require._cacheReadAsync(url).then(function (text) {\n contents = text;\n\n if (context.config.cjsTranslate &&\n (!context.config.shim || !lang.hasProp(context.config.shim, moduleName))) {\n contents = commonJs.convert(url, contents);\n }\n\n //If there is a read filter, run it now.\n if (context.config.onBuildRead) {\n contents = context.config.onBuildRead(moduleName, url, contents);\n }\n\n contents = pragma.process(url, contents, context.config, 'OnExecute');\n\n //Find out if the file contains a require() definition. Need to know\n //this so we can inject plugins right after it, but before they are needed,\n //and to make sure this file is first, so that define calls work.\n try {\n if (!layer.existingRequireUrl && parse.definesRequire(url, contents)) {\n layer.existingRequireUrl = url;\n require._cachedDefinesRequireUrls[url] = true;\n }\n } catch (e1) {\n throw new Error('Parse error using esprima ' +\n 'for file: ' + url + '\\n' + e1);\n }\n }).then(function () {\n if (hasProp(context.plugins, moduleName)) {\n //This is a loader plugin, check to see if it has a build extension,\n //otherwise the plugin will act as the plugin builder too.\n pluginBuilderMatch = pluginBuilderRegExp.exec(contents);\n if (pluginBuilderMatch) {\n //Load the plugin builder for the plugin contents.\n builderName = context.makeModuleMap(pluginBuilderMatch[3],\n context.makeModuleMap(moduleName),\n null,\n true).id;\n return require._cacheReadAsync(context.nameToUrl(builderName));\n }\n }\n return contents;\n }).then(function (text) {\n contents = text;\n\n //Parse out the require and define calls.\n //Do this even for plugins in case they have their own\n //dependencies that may be separate to how the pluginBuilder works.\n try {\n if (falseProp(context.needFullExec, moduleName)) {\n contents = parse(moduleName, url, contents, {\n insertNeedsDefine: true,\n has: context.config.has,\n findNestedDependencies: context.config.findNestedDependencies\n });\n }\n } catch (e2) {\n throw new Error('Parse error using esprima ' +\n 'for file: ' + url + '\\n' + e2);\n }\n\n require._cachedFileContents[url] = contents;\n });\n }\n }).then(function () {\n if (contents) {\n eval(contents);\n }\n\n try {\n //If have a string shim config, and this is\n //a fully executed module, try to see if\n //it created a variable in this eval scope\n if (getOwn(context.needFullExec, moduleName)) {\n shim = getOwn(context.config.shim, moduleName);\n if (shim && shim.exports) {\n shimExports = eval(shim.exports);\n if (typeof shimExports !== 'undefined') {\n context.buildShimExports[moduleName] = shimExports;\n }\n }\n }\n\n //Need to close out completion of this module\n //so that listeners will get notified that it is available.\n context.completeLoad(moduleName);\n } catch (e) {\n //Track which module could not complete loading.\n if (!e.moduleTree) {\n e.moduleTree = [];\n }\n e.moduleTree.push(moduleName);\n throw e;\n }\n }).then(null, function (eOuter) {\n\n if (!eOuter.fileName) {\n eOuter.fileName = url;\n }\n throw eOuter;\n }).end();\n } else {\n //With unsupported URLs still need to call completeLoad to\n //finish loading.\n context.completeLoad(moduleName);\n }\n };\n\n //Marks module has having a name, and optionally executes the\n //callback, but only if it meets certain criteria.\n context.execCb = function (name, cb, args, exports) {\n var buildShimExports = getOwn(layer.context.buildShimExports, name);\n\n if (buildShimExports) {\n return buildShimExports;\n } else if (cb.__requireJsBuild || getOwn(layer.context.needFullExec, name)) {\n return cb.apply(exports, args);\n }\n return undefined;\n };\n\n moduleProto.init = function (depMaps) {\n if (context.needFullExec[this.map.id]) {\n lang.each(depMaps, lang.bind(this, function (depMap) {\n if (typeof depMap === 'string') {\n depMap = context.makeModuleMap(depMap,\n (this.map.isDefine ? this.map : this.map.parentMap));\n }\n\n if (!context.fullExec[depMap.id]) {\n context.require.undef(depMap.id);\n }\n }));\n }\n\n return oldInit.apply(this, arguments);\n };\n\n moduleProto.callPlugin = function () {\n var map = this.map,\n pluginMap = context.makeModuleMap(map.prefix),\n pluginId = pluginMap.id,\n pluginMod = getOwn(context.registry, pluginId);\n\n context.plugins[pluginId] = true;\n context.needFullExec[pluginId] = map;\n\n //If the module is not waiting to finish being defined,\n //undef it and start over, to get full execution.\n if (falseProp(context.fullExec, pluginId) && (!pluginMod || pluginMod.defined)) {\n context.require.undef(pluginMap.id);\n }\n\n return oldCallPlugin.apply(this, arguments);\n };\n }\n\n return context;\n };\n\n //Clear up the existing context so that the newContext modifications\n //above will be active.\n delete require.s.contexts._;\n\n /** Reset state for each build layer pass. */\n require._buildReset = function () {\n var oldContext = require.s.contexts._;\n\n //Clear up the existing context.\n delete require.s.contexts._;\n\n //Set up new context, so the layer object can hold onto it.\n require({});\n\n layer = require._layer = {\n buildPathMap: {},\n buildFileToModule: {},\n buildFilePaths: [],\n pathAdded: {},\n modulesWithNames: {},\n needsDefine: {},\n existingRequireUrl: \"\",\n ignoredUrls: {},\n context: require.s.contexts._\n };\n\n //Return the previous context in case it is needed, like for\n //the basic config object.\n return oldContext;\n };\n\n require._buildReset();\n\n //Override define() to catch modules that just define an object, so that\n //a dummy define call is not put in the build file for them. They do\n //not end up getting defined via context.execCb, so we need to catch them\n //at the define call.\n oldDef = define;\n\n //This function signature does not have to be exact, just match what we\n //are looking for.\n define = function (name) {\n if (typeof name === \"string\" && falseProp(layer.needsDefine, name)) {\n layer.modulesWithNames[name] = true;\n }\n return oldDef.apply(require, arguments);\n };\n\n define.amd = oldDef.amd;\n\n //Add some utilities for plugins\n require._readFile = file.readFile;\n require._fileExists = function (path) {\n return file.exists(path);\n };\n\n //Called when execManager runs for a dependency. Used to figure out\n //what order of execution.\n require.onResourceLoad = function (context, map) {\n var id = map.id,\n url;\n\n // Fix up any maps that need to be normalized as part of the fullExec\n // plumbing for plugins to participate in the build.\n if (context.plugins && lang.hasProp(context.plugins, id)) {\n lang.eachProp(context.needFullExec, function(value, prop) {\n // For plugin entries themselves, they do not have a map\n // value in needFullExec, just a \"true\" entry.\n if (value !== true && value.prefix === id && value.unnormalized) {\n var map = context.makeModuleMap(value.originalName, value.parentMap);\n context.needFullExec[map.id] = map;\n }\n });\n }\n\n //If build needed a full execution, indicate it\n //has been done now. But only do it if the context is tracking\n //that. Only valid for the context used in a build, not for\n //other contexts being run, like for useLib, plain requirejs\n //use in node/rhino.\n if (context.needFullExec && getOwn(context.needFullExec, id)) {\n context.fullExec[id] = map;\n }\n\n //A plugin.\n if (map.prefix) {\n if (falseProp(layer.pathAdded, id)) {\n layer.buildFilePaths.push(id);\n //For plugins the real path is not knowable, use the name\n //for both module to file and file to module mappings.\n layer.buildPathMap[id] = id;\n layer.buildFileToModule[id] = id;\n layer.modulesWithNames[id] = true;\n layer.pathAdded[id] = true;\n }\n } else if (map.url && require._isSupportedBuildUrl(map.url)) {\n //If the url has not been added to the layer yet, and it\n //is from an actual file that was loaded, add it now.\n url = normalizeUrlWithBase(context, id, map.url);\n if (!layer.pathAdded[url] && getOwn(layer.buildPathMap, id)) {\n //Remember the list of dependencies for this layer.\n layer.buildFilePaths.push(url);\n layer.pathAdded[url] = true;\n }\n }\n };\n\n //Called by output of the parse() function, when a file does not\n //explicitly call define, probably just require, but the parse()\n //function normalizes on define() for dependency mapping and file\n //ordering works correctly.\n require.needsDefine = function (moduleName) {\n layer.needsDefine[moduleName] = true;\n };\n };\n});\n/**\n * @license RequireJS Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint */\n/*global define: false, console: false */\n\ndefine('commonJs', ['env!env/file', 'parse'], function (file, parse) {\n 'use strict';\n var commonJs = {\n //Set to false if you do not want this file to log. Useful in environments\n //like node where you want the work to happen without noise.\n useLog: true,\n\n convertDir: function (commonJsPath, savePath) {\n var fileList, i,\n jsFileRegExp = /\\.js$/,\n fileName, convertedFileName, fileContents;\n\n //Get list of files to convert.\n fileList = file.getFilteredFileList(commonJsPath, /\\w/, true);\n\n //Normalize on front slashes and make sure the paths do not end in a slash.\n commonJsPath = commonJsPath.replace(/\\\\/g, \"/\");\n savePath = savePath.replace(/\\\\/g, \"/\");\n if (commonJsPath.charAt(commonJsPath.length - 1) === \"/\") {\n commonJsPath = commonJsPath.substring(0, commonJsPath.length - 1);\n }\n if (savePath.charAt(savePath.length - 1) === \"/\") {\n savePath = savePath.substring(0, savePath.length - 1);\n }\n\n //Cycle through all the JS files and convert them.\n if (!fileList || !fileList.length) {\n if (commonJs.useLog) {\n if (commonJsPath === \"convert\") {\n //A request just to convert one file.\n console.log('\\n\\n' + commonJs.convert(savePath, file.readFile(savePath)));\n } else {\n console.log(\"No files to convert in directory: \" + commonJsPath);\n }\n }\n } else {\n for (i = 0; i < fileList.length; i++) {\n fileName = fileList[i];\n convertedFileName = fileName.replace(commonJsPath, savePath);\n\n //Handle JS files.\n if (jsFileRegExp.test(fileName)) {\n fileContents = file.readFile(fileName);\n fileContents = commonJs.convert(fileName, fileContents);\n file.saveUtf8File(convertedFileName, fileContents);\n } else {\n //Just copy the file over.\n file.copyFile(fileName, convertedFileName, true);\n }\n }\n }\n },\n\n /**\n * Does the actual file conversion.\n *\n * @param {String} fileName the name of the file.\n *\n * @param {String} fileContents the contents of a file :)\n *\n * @returns {String} the converted contents\n */\n convert: function (fileName, fileContents) {\n //Strip out comments.\n try {\n var preamble = '',\n commonJsProps = parse.usesCommonJs(fileName, fileContents);\n\n //First see if the module is not already RequireJS-formatted.\n if (parse.usesAmdOrRequireJs(fileName, fileContents) || !commonJsProps) {\n return fileContents;\n }\n\n if (commonJsProps.dirname || commonJsProps.filename) {\n preamble = 'var __filename = module.uri || \"\", ' +\n '__dirname = __filename.substring(0, __filename.lastIndexOf(\"/\") + 1); ';\n }\n\n //Construct the wrapper boilerplate.\n fileContents = 'define(function (require, exports, module) {' +\n preamble +\n fileContents +\n '\\n});\\n';\n\n } catch (e) {\n console.log(\"commonJs.convert: COULD NOT CONVERT: \" + fileName + \", so skipping it. Error was: \" + e);\n return fileContents;\n }\n\n return fileContents;\n }\n };\n\n return commonJs;\n});\n/**\n * @license Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.\n * Available via the MIT or new BSD license.\n * see: http://github.com/jrburke/requirejs for details\n */\n\n/*jslint plusplus: true, nomen: true, regexp: true */\n/*global define, requirejs, java, process, console */\n\n\ndefine('build', function (require) {\n 'use strict';\n\n var build,\n lang = require('lang'),\n prim = require('prim'),\n logger = require('logger'),\n file = require('env!env/file'),\n parse = require('parse'),\n optimize = require('optimize'),\n pragma = require('pragma'),\n transform = require('transform'),\n requirePatch = require('requirePatch'),\n env = require('env'),\n commonJs = require('commonJs'),\n SourceMapGenerator = require('source-map/source-map-generator'),\n hasProp = lang.hasProp,\n getOwn = lang.getOwn,\n falseProp = lang.falseProp,\n endsWithSemiColonRegExp = /;\\s*$/,\n endsWithSlashRegExp = /[\\/\\\\]$/,\n resourceIsModuleIdRegExp = /^[\\w\\/\\\\\\.]+$/;\n\n prim.nextTick = function (fn) {\n fn();\n };\n\n //Now map require to the outermost requirejs, now that we have\n //local dependencies for this module. The rest of the require use is\n //manipulating the requirejs loader.\n require = requirejs;\n\n //Caching function for performance. Attached to\n //require so it can be reused in requirePatch.js. _cachedRawText\n //set up by requirePatch.js\n require._cacheReadAsync = function (path, encoding) {\n var d;\n\n if (lang.hasProp(require._cachedRawText, path)) {\n d = prim();\n d.resolve(require._cachedRawText[path]);\n return d.promise;\n } else {\n return file.readFileAsync(path, encoding).then(function (text) {\n require._cachedRawText[path] = text;\n return text;\n });\n }\n };\n\n function makeBuildBaseConfig() {\n return {\n appDir: \"\",\n pragmas: {},\n paths: {},\n optimize: \"uglify\",\n optimizeCss: \"standard.keepLines.keepWhitespace\",\n inlineText: true,\n isBuild: true,\n optimizeAllPluginResources: false,\n findNestedDependencies: false,\n preserveLicenseComments: true,\n //By default, all files/directories are copied, unless\n //they match this regexp, by default just excludes .folders\n dirExclusionRegExp: file.dirExclusionRegExp,\n _buildPathToModuleIndex: {}\n };\n }\n\n /**\n * Some JS may not be valid if concatenated with other JS, in particular\n * the style of omitting semicolons and rely on ASI. Add a semicolon in\n * those cases.\n */\n function addSemiColon(text, config) {\n if (config.skipSemiColonInsertion || endsWithSemiColonRegExp.test(text)) {\n return text;\n } else {\n return text + \";\";\n }\n }\n\n function endsWithSlash(dirName) {\n if (dirName.charAt(dirName.length - 1) !== \"/\") {\n dirName += \"/\";\n }\n return dirName;\n }\n\n //Method used by plugin writeFile calls, defined up here to avoid\n //jslint warning about \"making a function in a loop\".\n function makeWriteFile(namespace, layer) {\n function writeFile(name, contents) {\n logger.trace('Saving plugin-optimized file: ' + name);\n file.saveUtf8File(name, contents);\n }\n\n writeFile.asModule = function (moduleName, fileName, contents) {\n writeFile(fileName,\n build.toTransport(namespace, moduleName, fileName, contents, layer));\n };\n\n return writeFile;\n }\n\n /**\n * Main API entry point into the build. The args argument can either be\n * an array of arguments (like the onese passed on a command-line),\n * or it can be a JavaScript object that has the format of a build profile\n * file.\n *\n * If it is an object, then in addition to the normal properties allowed in\n * a build profile file, the object should contain one other property:\n *\n * The object could also contain a \"buildFile\" property, which is a string\n * that is the file path to a build profile that contains the rest\n * of the build profile directives.\n *\n * This function does not return a status, it should throw an error if\n * there is a problem completing the build.\n */\n build = function (args) {\n var buildFile, cmdConfig, errorMsg, errorStack, stackMatch, errorTree,\n i, j, errorMod,\n stackRegExp = /( {4}at[^\\n]+)\\n/,\n standardIndent = ' ';\n\n return prim().start(function () {\n if (!args || lang.isArray(args)) {\n if (!args || args.length < 1) {\n logger.error(\"build.js buildProfile.js\\n\" +\n \"where buildProfile.js is the name of the build file (see example.build.js for hints on how to make a build file).\");\n return undefined;\n }\n\n //Next args can include a build file path as well as other build args.\n //build file path comes first. If it does not contain an = then it is\n //a build file path. Otherwise, just all build args.\n if (args[0].indexOf(\"=\") === -1) {\n buildFile = args[0];\n args.splice(0, 1);\n }\n\n //Remaining args are options to the build\n cmdConfig = build.convertArrayToObject(args);\n cmdConfig.buildFile = buildFile;\n } else {\n cmdConfig = args;\n }\n\n return build._run(cmdConfig);\n }).then(null, function (e) {\n var err;\n\n errorMsg = e.toString();\n errorTree = e.moduleTree;\n stackMatch = stackRegExp.exec(errorMsg);\n\n if (stackMatch) {\n errorMsg += errorMsg.substring(0, stackMatch.index + stackMatch[0].length + 1);\n }\n\n //If a module tree that shows what module triggered the error,\n //print it out.\n if (errorTree && errorTree.length > 0) {\n errorMsg += '\\nIn module tree:\\n';\n\n for (i = errorTree.length - 1; i > -1; i--) {\n errorMod = errorTree[i];\n if (errorMod) {\n for (j = errorTree.length - i; j > -1; j--) {\n errorMsg += standardIndent;\n }\n errorMsg += errorMod + '\\n';\n }\n }\n\n logger.error(errorMsg);\n }\n\n errorStack = e.stack;\n\n if (typeof args === 'string' && args.indexOf('stacktrace=true') !== -1) {\n errorMsg += '\\n' + errorStack;\n } else {\n if (!stackMatch && errorStack) {\n //Just trim out the first \"at\" in the stack.\n stackMatch = stackRegExp.exec(errorStack);\n if (stackMatch) {\n errorMsg += '\\n' + stackMatch[0] || '';\n }\n }\n }\n\n err = new Error(errorMsg);\n err.originalError = e;\n throw err;\n });\n };\n\n build._run = function (cmdConfig) {\n var buildPaths, fileName, fileNames,\n paths, i,\n baseConfig, config,\n modules, srcPath, buildContext,\n destPath, moduleMap, parentModuleMap, context,\n resources, resource, plugin, fileContents,\n pluginProcessed = {},\n buildFileContents = \"\",\n pluginCollector = {};\n\n return prim().start(function () {\n var prop;\n\n //Can now run the patches to require.js to allow it to be used for\n //build generation. Do it here instead of at the top of the module\n //because we want normal require behavior to load the build tool\n //then want to switch to build mode.\n requirePatch();\n\n config = build.createConfig(cmdConfig);\n paths = config.paths;\n\n //Remove the previous build dir, in case it contains source transforms,\n //like the ones done with onBuildRead and onBuildWrite.\n if (config.dir && !config.keepBuildDir && file.exists(config.dir)) {\n file.deleteFile(config.dir);\n }\n\n if (!config.out && !config.cssIn) {\n //This is not just a one-off file build but a full build profile, with\n //lots of files to process.\n\n //First copy all the baseUrl content\n file.copyDir((config.appDir || config.baseUrl), config.dir, /\\w/, true);\n\n //Adjust baseUrl if config.appDir is in play, and set up build output paths.\n buildPaths = {};\n if (config.appDir) {\n //All the paths should be inside the appDir, so just adjust\n //the paths to use the dirBaseUrl\n for (prop in paths) {\n if (hasProp(paths, prop)) {\n buildPaths[prop] = paths[prop].replace(config.appDir, config.dir);\n }\n }\n } else {\n //If no appDir, then make sure to copy the other paths to this directory.\n for (prop in paths) {\n if (hasProp(paths, prop)) {\n //Set up build path for each path prefix, but only do so\n //if the path falls out of the current baseUrl\n if (paths[prop].indexOf(config.baseUrl) === 0) {\n buildPaths[prop] = paths[prop].replace(config.baseUrl, config.dirBaseUrl);\n } else {\n buildPaths[prop] = paths[prop] === 'empty:' ? 'empty:' : prop.replace(/\\./g, \"/\");\n\n //Make sure source path is fully formed with baseUrl,\n //if it is a relative URL.\n srcPath = paths[prop];\n if (srcPath.indexOf('/') !== 0 && srcPath.indexOf(':') === -1) {\n srcPath = config.baseUrl + srcPath;\n }\n\n destPath = config.dirBaseUrl + buildPaths[prop];\n\n //Skip empty: paths\n if (srcPath !== 'empty:') {\n //If the srcPath is a directory, copy the whole directory.\n if (file.exists(srcPath) && file.isDirectory(srcPath)) {\n //Copy files to build area. Copy all files (the /\\w/ regexp)\n file.copyDir(srcPath, destPath, /\\w/, true);\n } else {\n //Try a .js extension\n srcPath += '.js';\n destPath += '.js';\n file.copyFile(srcPath, destPath);\n }\n }\n }\n }\n }\n }\n }\n\n //Figure out source file location for each module layer. Do this by seeding require\n //with source area configuration. This is needed so that later the module layers\n //can be manually copied over to the source area, since the build may be\n //require multiple times and the above copyDir call only copies newer files.\n require({\n baseUrl: config.baseUrl,\n paths: paths,\n packagePaths: config.packagePaths,\n packages: config.packages\n });\n buildContext = require.s.contexts._;\n modules = config.modules;\n\n if (modules) {\n modules.forEach(function (module) {\n if (module.name) {\n module._sourcePath = buildContext.nameToUrl(module.name);\n //If the module does not exist, and this is not a \"new\" module layer,\n //as indicated by a true \"create\" property on the module, and\n //it is not a plugin-loaded resource, and there is no\n //'rawText' containing the module's source then throw an error.\n if (!file.exists(module._sourcePath) && !module.create &&\n module.name.indexOf('!') === -1 &&\n (!config.rawText || !lang.hasProp(config.rawText, module.name))) {\n throw new Error(\"ERROR: module path does not exist: \" +\n module._sourcePath + \" for module named: \" + module.name +\n \". Path is relative to: \" + file.absPath('.'));\n }\n }\n });\n }\n\n if (config.out) {\n //Just set up the _buildPath for the module layer.\n require(config);\n if (!config.cssIn) {\n config.modules[0]._buildPath = typeof config.out === 'function' ?\n 'FUNCTION' : config.out;\n }\n } else if (!config.cssIn) {\n //Now set up the config for require to use the build area, and calculate the\n //build file locations. Pass along any config info too.\n baseConfig = {\n baseUrl: config.dirBaseUrl,\n paths: buildPaths\n };\n\n lang.mixin(baseConfig, config);\n require(baseConfig);\n\n if (modules) {\n modules.forEach(function (module) {\n if (module.name) {\n module._buildPath = buildContext.nameToUrl(module.name, null);\n\n //If buildPath and sourcePath are the same, throw since this\n //would result in modifying source. This condition can happen\n //with some more tricky paths: config and appDir/baseUrl\n //setting, which is a sign of incorrect config.\n if (module._buildPath === module._sourcePath) {\n throw new Error('Module ID \\'' + module.name +\n '\\' has a source path that is same as output path: ' +\n module._sourcePath +\n '. Stopping, config is malformed.');\n }\n\n if (!module.create) {\n file.copyFile(module._sourcePath, module._buildPath);\n }\n }\n });\n }\n }\n\n //Run CSS optimizations before doing JS module tracing, to allow\n //things like text loader plugins loading CSS to get the optimized\n //CSS.\n if (config.optimizeCss && config.optimizeCss !== \"none\" && config.dir) {\n buildFileContents += optimize.css(config.dir, config);\n }\n }).then(function() {\n baseConfig = lang.deeplikeCopy(require.s.contexts._.config);\n }).then(function () {\n var actions = [];\n\n if (modules) {\n actions = modules.map(function (module, i) {\n return function () {\n //Save off buildPath to module index in a hash for quicker\n //lookup later.\n config._buildPathToModuleIndex[file.normalize(module._buildPath)] = i;\n\n //Call require to calculate dependencies.\n return build.traceDependencies(module, config, baseConfig)\n .then(function (layer) {\n module.layer = layer;\n });\n };\n });\n\n return prim.serial(actions);\n }\n }).then(function () {\n var actions;\n\n if (modules) {\n //Now build up shadow layers for anything that should be excluded.\n //Do this after tracing dependencies for each module, in case one\n //of those modules end up being one of the excluded values.\n actions = modules.map(function (module) {\n return function () {\n if (module.exclude) {\n module.excludeLayers = [];\n return prim.serial(module.exclude.map(function (exclude, i) {\n return function () {\n //See if it is already in the list of modules.\n //If not trace dependencies for it.\n var found = build.findBuildModule(exclude, modules);\n if (found) {\n module.excludeLayers[i] = found;\n } else {\n return build.traceDependencies({name: exclude}, config, baseConfig)\n .then(function (layer) {\n module.excludeLayers[i] = { layer: layer };\n });\n }\n };\n }));\n }\n };\n });\n\n return prim.serial(actions);\n }\n }).then(function () {\n if (modules) {\n return prim.serial(modules.map(function (module) {\n return function () {\n if (module.exclude) {\n //module.exclude is an array of module names. For each one,\n //get the nested dependencies for it via a matching entry\n //in the module.excludeLayers array.\n module.exclude.forEach(function (excludeModule, i) {\n var excludeLayer = module.excludeLayers[i].layer,\n map = excludeLayer.buildFileToModule;\n excludeLayer.buildFilePaths.forEach(function(filePath){\n build.removeModulePath(map[filePath], filePath, module.layer);\n });\n });\n }\n if (module.excludeShallow) {\n //module.excludeShallow is an array of module names.\n //shallow exclusions are just that module itself, and not\n //its nested dependencies.\n module.excludeShallow.forEach(function (excludeShallowModule) {\n var path = getOwn(module.layer.buildPathMap, excludeShallowModule);\n if (path) {\n build.removeModulePath(excludeShallowModule, path, module.layer);\n }\n });\n }\n\n //Flatten them and collect the build output for each module.\n return build.flattenModule(module, module.layer, config).then(function (builtModule) {\n var finalText, baseName;\n //Save it to a temp file for now, in case there are other layers that\n //contain optimized content that should not be included in later\n //layer optimizations. See issue #56.\n if (module._buildPath === 'FUNCTION') {\n module._buildText = builtModule.text;\n module._buildSourceMap = builtModule.sourceMap;\n } else {\n finalText = builtModule.text;\n if (builtModule.sourceMap) {\n baseName = module._buildPath.split('/');\n baseName = baseName.pop();\n finalText += '\\n//# sourceMappingURL=' + baseName + '.map';\n file.saveUtf8File(module._buildPath + '.map', builtModule.sourceMap);\n }\n file.saveUtf8File(module._buildPath + '-temp', finalText);\n\n }\n buildFileContents += builtModule.buildText;\n });\n };\n }));\n }\n }).then(function () {\n var moduleName, outOrigSourceMap;\n if (modules) {\n //Now move the build layers to their final position.\n modules.forEach(function (module) {\n var finalPath = module._buildPath;\n if (finalPath !== 'FUNCTION') {\n if (file.exists(finalPath)) {\n file.deleteFile(finalPath);\n }\n file.renameFile(finalPath + '-temp', finalPath);\n\n //And finally, if removeCombined is specified, remove\n //any of the files that were used in this layer.\n //Be sure not to remove other build layers.\n if (config.removeCombined && !config.out) {\n module.layer.buildFilePaths.forEach(function (path) {\n var isLayer = modules.some(function (mod) {\n return mod._buildPath === path;\n }),\n relPath = build.makeRelativeFilePath(config.dir, path);\n\n if (file.exists(path) &&\n // not a build layer target\n !isLayer &&\n // not outside the build directory\n relPath.indexOf('..') !== 0) {\n file.deleteFile(path);\n }\n });\n }\n }\n\n //Signal layer is done\n if (config.onModuleBundleComplete) {\n config.onModuleBundleComplete(module.onCompleteData);\n }\n });\n }\n\n //If removeCombined in play, remove any empty directories that\n //may now exist because of its use\n if (config.removeCombined && !config.out && config.dir) {\n file.deleteEmptyDirs(config.dir);\n }\n\n //Do other optimizations.\n if (config.out && !config.cssIn) {\n //Just need to worry about one JS file.\n fileName = config.modules[0]._buildPath;\n if (fileName === 'FUNCTION') {\n outOrigSourceMap = config.modules[0]._buildSourceMap;\n config._buildSourceMap = outOrigSourceMap;\n config.modules[0]._buildText = optimize.js((config.modules[0].name ||\n config.modules[0].include[0] ||\n fileName) + '.build.js',\n config.modules[0]._buildText,\n null,\n config);\n if (config._buildSourceMap && config._buildSourceMap !== outOrigSourceMap) {\n config.modules[0]._buildSourceMap = config._buildSourceMap;\n config._buildSourceMap = null;\n }\n } else {\n optimize.jsFile(fileName, null, fileName, config);\n }\n } else if (!config.cssIn) {\n //Normal optimizations across modules.\n\n //JS optimizations.\n fileNames = file.getFilteredFileList(config.dir, /\\.js$/, true);\n fileNames.forEach(function (fileName) {\n var cfg, override, moduleIndex;\n\n //Generate the module name from the config.dir root.\n moduleName = fileName.replace(config.dir, '');\n //Get rid of the extension\n moduleName = moduleName.substring(0, moduleName.length - 3);\n\n //If there is an override for a specific layer build module,\n //and this file is that module, mix in the override for use\n //by optimize.jsFile.\n moduleIndex = getOwn(config._buildPathToModuleIndex, fileName);\n //Normalize, since getOwn could have returned undefined\n moduleIndex = moduleIndex === 0 || moduleIndex > 0 ? moduleIndex : -1;\n\n //Try to avoid extra work if the other files do not need to\n //be read. Build layers should be processed at the very\n //least for optimization.\n if (moduleIndex > -1 || !config.skipDirOptimize ||\n config.normalizeDirDefines === \"all\" ||\n config.cjsTranslate) {\n //Convert the file to transport format, but without a name\n //inserted (by passing null for moduleName) since the files are\n //standalone, one module per file.\n fileContents = file.readFile(fileName);\n\n\n //For builds, if wanting cjs translation, do it now, so that\n //the individual modules can be loaded cross domain via\n //plain script tags.\n if (config.cjsTranslate &&\n (!config.shim || !lang.hasProp(config.shim, moduleName))) {\n fileContents = commonJs.convert(fileName, fileContents);\n }\n\n if (moduleIndex === -1) {\n if (config.onBuildRead) {\n fileContents = config.onBuildRead(moduleName,\n fileName,\n fileContents);\n }\n\n //Only do transport normalization if this is not a build\n //layer (since it was already normalized) and if\n //normalizeDirDefines indicated all should be done.\n if (config.normalizeDirDefines === \"all\") {\n fileContents = build.toTransport(config.namespace,\n null,\n fileName,\n fileContents);\n }\n\n if (config.onBuildWrite) {\n fileContents = config.onBuildWrite(moduleName,\n fileName,\n fileContents);\n }\n }\n\n override = moduleIndex > -1 ?\n config.modules[moduleIndex].override : null;\n if (override) {\n cfg = build.createOverrideConfig(config, override);\n } else {\n cfg = config;\n }\n\n if (moduleIndex > -1 || !config.skipDirOptimize) {\n optimize.jsFile(fileName, fileContents, fileName, cfg, pluginCollector);\n }\n }\n });\n\n //Normalize all the plugin resources.\n context = require.s.contexts._;\n\n for (moduleName in pluginCollector) {\n if (hasProp(pluginCollector, moduleName)) {\n parentModuleMap = context.makeModuleMap(moduleName);\n resources = pluginCollector[moduleName];\n for (i = 0; i < resources.length; i++) {\n resource = resources[i];\n moduleMap = context.makeModuleMap(resource, parentModuleMap);\n if (falseProp(context.plugins, moduleMap.prefix)) {\n //Set the value in context.plugins so it\n //will be evaluated as a full plugin.\n context.plugins[moduleMap.prefix] = true;\n\n //Do not bother if the plugin is not available.\n if (!file.exists(require.toUrl(moduleMap.prefix + '.js'))) {\n continue;\n }\n\n //Rely on the require in the build environment\n //to be synchronous\n context.require([moduleMap.prefix]);\n\n //Now that the plugin is loaded, redo the moduleMap\n //since the plugin will need to normalize part of the path.\n moduleMap = context.makeModuleMap(resource, parentModuleMap);\n }\n\n //Only bother with plugin resources that can be handled\n //processed by the plugin, via support of the writeFile\n //method.\n if (falseProp(pluginProcessed, moduleMap.id)) {\n //Only do the work if the plugin was really loaded.\n //Using an internal access because the file may\n //not really be loaded.\n plugin = getOwn(context.defined, moduleMap.prefix);\n if (plugin && plugin.writeFile) {\n plugin.writeFile(\n moduleMap.prefix,\n moduleMap.name,\n require,\n makeWriteFile(\n config.namespace\n ),\n context.config\n );\n }\n\n pluginProcessed[moduleMap.id] = true;\n }\n }\n\n }\n }\n\n //console.log('PLUGIN COLLECTOR: ' + JSON.stringify(pluginCollector, null, \" \"));\n\n\n //All module layers are done, write out the build.txt file.\n file.saveUtf8File(config.dir + \"build.txt\", buildFileContents);\n }\n\n //If just have one CSS file to optimize, do that here.\n if (config.cssIn) {\n buildFileContents += optimize.cssFile(config.cssIn, config.out, config).buildText;\n }\n\n if (typeof config.out === 'function') {\n config.out(config.modules[0]._buildText, config.modules[0]._buildSourceMap);\n }\n\n //Print out what was built into which layers.\n if (buildFileContents) {\n logger.info(buildFileContents);\n return buildFileContents;\n }\n\n return '';\n });\n };\n\n /**\n * Converts command line args like \"paths.foo=../some/path\"\n * result.paths = { foo: '../some/path' } where prop = paths,\n * name = paths.foo and value = ../some/path, so it assumes the\n * name=value splitting has already happened.\n */\n function stringDotToObj(result, name, value) {\n var parts = name.split('.');\n\n parts.forEach(function (prop, i) {\n if (i === parts.length - 1) {\n result[prop] = value;\n } else {\n if (falseProp(result, prop)) {\n result[prop] = {};\n }\n result = result[prop];\n }\n\n });\n }\n\n build.objProps = {\n paths: true,\n wrap: true,\n pragmas: true,\n pragmasOnSave: true,\n has: true,\n hasOnSave: true,\n uglify: true,\n uglify2: true,\n closure: true,\n map: true,\n throwWhen: true\n };\n\n build.hasDotPropMatch = function (prop) {\n var dotProp,\n index = prop.indexOf('.');\n\n if (index !== -1) {\n dotProp = prop.substring(0, index);\n return hasProp(build.objProps, dotProp);\n }\n return false;\n };\n\n /**\n * Converts an array that has String members of \"name=value\"\n * into an object, where the properties on the object are the names in the array.\n * Also converts the strings \"true\" and \"false\" to booleans for the values.\n * member name/value pairs, and converts some comma-separated lists into\n * arrays.\n * @param {Array} ary\n */\n build.convertArrayToObject = function (ary) {\n var result = {}, i, separatorIndex, prop, value,\n needArray = {\n \"include\": true,\n \"exclude\": true,\n \"excludeShallow\": true,\n \"insertRequire\": true,\n \"stubModules\": true,\n \"deps\": true,\n \"mainConfigFile\": true\n };\n\n for (i = 0; i < ary.length; i++) {\n separatorIndex = ary[i].indexOf(\"=\");\n if (separatorIndex === -1) {\n throw \"Malformed name/value pair: [\" + ary[i] + \"]. Format should be name=value\";\n }\n\n value = ary[i].substring(separatorIndex + 1, ary[i].length);\n if (value === \"true\") {\n value = true;\n } else if (value === \"false\") {\n value = false;\n }\n\n prop = ary[i].substring(0, separatorIndex);\n\n //Convert to array if necessary\n if (getOwn(needArray, prop)) {\n value = value.split(\",\");\n }\n\n if (build.hasDotPropMatch(prop)) {\n stringDotToObj(result, prop, value);\n } else {\n result[prop] = value;\n }\n }\n return result; //Object\n };\n\n build.makeAbsPath = function (path, absFilePath) {\n if (!absFilePath) {\n return path;\n }\n\n //Add abspath if necessary. If path starts with a slash or has a colon,\n //then already is an abolute path.\n if (path.indexOf('/') !== 0 && path.indexOf(':') === -1) {\n path = absFilePath +\n (absFilePath.charAt(absFilePath.length - 1) === '/' ? '' : '/') +\n path;\n path = file.normalize(path);\n }\n return path.replace(lang.backSlashRegExp, '/');\n };\n\n build.makeAbsObject = function (props, obj, absFilePath) {\n var i, prop;\n if (obj) {\n for (i = 0; i < props.length; i++) {\n prop = props[i];\n if (hasProp(obj, prop) && typeof obj[prop] === 'string') {\n obj[prop] = build.makeAbsPath(obj[prop], absFilePath);\n }\n }\n }\n };\n\n /**\n * For any path in a possible config, make it absolute relative\n * to the absFilePath passed in.\n */\n build.makeAbsConfig = function (config, absFilePath) {\n var props, prop, i;\n\n props = [\"appDir\", \"dir\", \"baseUrl\"];\n for (i = 0; i < props.length; i++) {\n prop = props[i];\n\n if (getOwn(config, prop)) {\n //Add abspath if necessary, make sure these paths end in\n //slashes\n if (prop === \"baseUrl\") {\n config.originalBaseUrl = config.baseUrl;\n if (config.appDir) {\n //If baseUrl with an appDir, the baseUrl is relative to\n //the appDir, *not* the absFilePath. appDir and dir are\n //made absolute before baseUrl, so this will work.\n config.baseUrl = build.makeAbsPath(config.originalBaseUrl, config.appDir);\n } else {\n //The dir output baseUrl is same as regular baseUrl, both\n //relative to the absFilePath.\n config.baseUrl = build.makeAbsPath(config[prop], absFilePath);\n }\n } else {\n config[prop] = build.makeAbsPath(config[prop], absFilePath);\n }\n\n config[prop] = endsWithSlash(config[prop]);\n }\n }\n\n build.makeAbsObject((config.out === \"stdout\" ? [\"cssIn\"] : [\"out\", \"cssIn\"]),\n config, absFilePath);\n build.makeAbsObject([\"startFile\", \"endFile\"], config.wrap, absFilePath);\n };\n\n /**\n * Creates a relative path to targetPath from refPath.\n * Only deals with file paths, not folders. If folders,\n * make sure paths end in a trailing '/'.\n */\n build.makeRelativeFilePath = function (refPath, targetPath) {\n var i, dotLength, finalParts, length, targetParts, targetName,\n refParts = refPath.split('/'),\n hasEndSlash = endsWithSlashRegExp.test(targetPath),\n dotParts = [];\n\n targetPath = file.normalize(targetPath);\n if (hasEndSlash && !endsWithSlashRegExp.test(targetPath)) {\n targetPath += '/';\n }\n targetParts = targetPath.split('/');\n //Pull off file name\n targetName = targetParts.pop();\n\n //Also pop off the ref file name to make the matches against\n //targetParts equivalent.\n refParts.pop();\n\n length = refParts.length;\n\n for (i = 0; i < length; i += 1) {\n if (refParts[i] !== targetParts[i]) {\n break;\n }\n }\n\n //Now i is the index in which they diverge.\n finalParts = targetParts.slice(i);\n\n dotLength = length - i;\n for (i = 0; i > -1 && i < dotLength; i += 1) {\n dotParts.push('..');\n }\n\n return dotParts.join('/') + (dotParts.length ? '/' : '') +\n finalParts.join('/') + (finalParts.length ? '/' : '') +\n targetName;\n };\n\n build.nestedMix = {\n paths: true,\n has: true,\n hasOnSave: true,\n pragmas: true,\n pragmasOnSave: true\n };\n\n /**\n * Mixes additional source config into target config, and merges some\n * nested config, like paths, correctly.\n */\n function mixConfig(target, source, skipArrays) {\n var prop, value, isArray, targetValue;\n\n for (prop in source) {\n if (hasProp(source, prop)) {\n //If the value of the property is a plain object, then\n //allow a one-level-deep mixing of it.\n value = source[prop];\n isArray = lang.isArray(value);\n if (typeof value === 'object' && value &&\n !isArray && !lang.isFunction(value) &&\n !lang.isRegExp(value)) {\n\n // TODO: need to generalize this work, maybe also reuse\n // the work done in requirejs configure, perhaps move to\n // just a deep copy/merge overall. However, given the\n // amount of observable change, wait for a dot release.\n // This change is in relation to #645\n if (prop === 'map') {\n if (!target.map) {\n target.map = {};\n }\n lang.deepMix(target.map, source.map);\n } else {\n target[prop] = lang.mixin({}, target[prop], value, true);\n }\n } else if (isArray) {\n if (!skipArrays) {\n // Some config, like packages, are arrays. For those,\n // just merge the results.\n targetValue = target[prop];\n if (lang.isArray(targetValue)) {\n target[prop] = targetValue.concat(value);\n } else {\n target[prop] = value;\n }\n }\n } else {\n target[prop] = value;\n }\n }\n }\n\n //Set up log level since it can affect if errors are thrown\n //or caught and passed to errbacks while doing config setup.\n if (lang.hasProp(target, 'logLevel')) {\n logger.logLevel(target.logLevel);\n }\n }\n\n /**\n * Converts a wrap.startFile or endFile to be start/end as a string.\n * the startFile/endFile values can be arrays.\n */\n function flattenWrapFile(wrap, keyName, absFilePath) {\n var keyFileName = keyName + 'File';\n\n if (typeof wrap[keyName] !== 'string' && wrap[keyFileName]) {\n wrap[keyName] = '';\n if (typeof wrap[keyFileName] === 'string') {\n wrap[keyFileName] = [wrap[keyFileName]];\n }\n wrap[keyFileName].forEach(function (fileName) {\n wrap[keyName] += (wrap[keyName] ? '\\n' : '') +\n file.readFile(build.makeAbsPath(fileName, absFilePath));\n });\n } else if (wrap[keyName] === null || wrap[keyName] === undefined) {\n //Allow missing one, just set to empty string.\n wrap[keyName] = '';\n } else if (typeof wrap[keyName] !== 'string') {\n throw new Error('wrap.' + keyName + ' or wrap.' + keyFileName + ' malformed');\n }\n }\n\n function normalizeWrapConfig(config, absFilePath) {\n //Get any wrap text.\n try {\n if (config.wrap) {\n if (config.wrap === true) {\n //Use default values.\n config.wrap = {\n start: '(function () {',\n end: '}());'\n };\n } else {\n flattenWrapFile(config.wrap, 'start', absFilePath);\n flattenWrapFile(config.wrap, 'end', absFilePath);\n }\n }\n } catch (wrapError) {\n throw new Error('Malformed wrap config: ' + wrapError.toString());\n }\n }\n\n /**\n * Creates a config object for an optimization build.\n * It will also read the build profile if it is available, to create\n * the configuration.\n *\n * @param {Object} cfg config options that take priority\n * over defaults and ones in the build file. These options could\n * be from a command line, for instance.\n *\n * @param {Object} the created config object.\n */\n build.createConfig = function (cfg) {\n /*jslint evil: true */\n var buildFileContents, buildFileConfig, mainConfig,\n mainConfigFile, mainConfigPath, buildFile, absFilePath,\n config = {},\n buildBaseConfig = makeBuildBaseConfig();\n\n //Make sure all paths are relative to current directory.\n absFilePath = file.absPath('.');\n build.makeAbsConfig(cfg, absFilePath);\n build.makeAbsConfig(buildBaseConfig, absFilePath);\n\n lang.mixin(config, buildBaseConfig);\n lang.mixin(config, cfg, true);\n\n //Set up log level early since it can affect if errors are thrown\n //or caught and passed to errbacks, even while constructing config.\n if (lang.hasProp(config, 'logLevel')) {\n logger.logLevel(config.logLevel);\n }\n\n if (config.buildFile) {\n //A build file exists, load it to get more config.\n buildFile = file.absPath(config.buildFile);\n\n //Find the build file, and make sure it exists, if this is a build\n //that has a build profile, and not just command line args with an in=path\n if (!file.exists(buildFile)) {\n throw new Error(\"ERROR: build file does not exist: \" + buildFile);\n }\n\n absFilePath = config.baseUrl = file.absPath(file.parent(buildFile));\n\n //Load build file options.\n buildFileContents = file.readFile(buildFile);\n try {\n buildFileConfig = eval(\"(\" + buildFileContents + \")\");\n build.makeAbsConfig(buildFileConfig, absFilePath);\n\n //Mix in the config now so that items in mainConfigFile can\n //be resolved relative to them if necessary, like if appDir\n //is set here, but the baseUrl is in mainConfigFile. Will\n //re-mix in the same build config later after mainConfigFile\n //is processed, since build config should take priority.\n mixConfig(config, buildFileConfig);\n } catch (e) {\n throw new Error(\"Build file \" + buildFile + \" is malformed: \" + e);\n }\n }\n\n mainConfigFile = config.mainConfigFile || (buildFileConfig && buildFileConfig.mainConfigFile);\n if (mainConfigFile) {\n if (typeof mainConfigFile === 'string') {\n mainConfigFile = [mainConfigFile];\n }\n\n mainConfigFile.forEach(function (configFile) {\n configFile = build.makeAbsPath(configFile, absFilePath);\n if (!file.exists(configFile)) {\n throw new Error(configFile + ' does not exist.');\n }\n try {\n mainConfig = parse.findConfig(file.readFile(configFile)).config;\n } catch (configError) {\n throw new Error('The config in mainConfigFile ' +\n configFile +\n ' cannot be used because it cannot be evaluated' +\n ' correctly while running in the optimizer. Try only' +\n ' using a config that is also valid JSON, or do not use' +\n ' mainConfigFile and instead copy the config values needed' +\n ' into a build file or command line arguments given to the optimizer.\\n' +\n 'Source error from parsing: ' + configFile + ': ' + configError);\n }\n if (mainConfig) {\n mainConfigPath = configFile.substring(0, configFile.lastIndexOf('/'));\n\n //Add in some existing config, like appDir, since they can be\n //used inside the configFile -- paths and baseUrl are\n //relative to them.\n if (config.appDir && !mainConfig.appDir) {\n mainConfig.appDir = config.appDir;\n }\n\n //If no baseUrl, then use the directory holding the main config.\n if (!mainConfig.baseUrl) {\n mainConfig.baseUrl = mainConfigPath;\n }\n\n build.makeAbsConfig(mainConfig, mainConfigPath);\n mixConfig(config, mainConfig);\n }\n });\n }\n\n //Mix in build file config, but only after mainConfig has been mixed in.\n //Since this is a re-application, skip array merging.\n if (buildFileConfig) {\n mixConfig(config, buildFileConfig, true);\n }\n\n //Re-apply the override config values. Command line\n //args should take precedence over build file values.\n //Since this is a re-application, skip array merging.\n mixConfig(config, cfg, true);\n\n //Fix paths to full paths so that they can be adjusted consistently\n //lately to be in the output area.\n lang.eachProp(config.paths, function (value, prop) {\n if (lang.isArray(value)) {\n throw new Error('paths fallback not supported in optimizer. ' +\n 'Please provide a build config path override ' +\n 'for ' + prop);\n }\n config.paths[prop] = build.makeAbsPath(value, config.baseUrl);\n });\n\n //Set final output dir\n if (hasProp(config, \"baseUrl\")) {\n if (config.appDir) {\n if (!config.originalBaseUrl) {\n throw new Error('Please set a baseUrl in the build config');\n }\n config.dirBaseUrl = build.makeAbsPath(config.originalBaseUrl, config.dir);\n } else {\n config.dirBaseUrl = config.dir || config.baseUrl;\n }\n //Make sure dirBaseUrl ends in a slash, since it is\n //concatenated with other strings.\n config.dirBaseUrl = endsWithSlash(config.dirBaseUrl);\n }\n\n\n //If out=stdout, write output to STDOUT instead of a file.\n if (config.out && config.out === 'stdout') {\n config.out = function (content) {\n var e = env.get();\n if (e === 'rhino') {\n var out = new java.io.PrintStream(java.lang.System.out, true, 'UTF-8');\n out.println(content);\n } else if (e === 'node') {\n process.stdout.setEncoding('utf8');\n process.stdout.write(content);\n } else {\n console.log(content);\n }\n };\n }\n\n //Check for errors in config\n if (config.main) {\n throw new Error('\"main\" passed as an option, but the ' +\n 'supported option is called \"name\".');\n }\n if (config.out && !config.name && !config.modules && !config.include &&\n !config.cssIn) {\n throw new Error('Missing either a \"name\", \"include\" or \"modules\" ' +\n 'option');\n }\n if (config.cssIn) {\n if (config.dir || config.appDir) {\n throw new Error('cssIn is only for the output of single file ' +\n 'CSS optimizations and is not compatible with \"dir\" or \"appDir\" configuration.');\n }\n if (!config.out) {\n throw new Error('\"out\" option missing.');\n }\n }\n if (!config.cssIn && !config.baseUrl) {\n //Just use the current directory as the baseUrl\n config.baseUrl = './';\n }\n if (!config.out && !config.dir) {\n throw new Error('Missing either an \"out\" or \"dir\" config value. ' +\n 'If using \"appDir\" for a full project optimization, ' +\n 'use \"dir\". If you want to optimize to one file, ' +\n 'use \"out\".');\n }\n if (config.appDir && config.out) {\n throw new Error('\"appDir\" is not compatible with \"out\". Use \"dir\" ' +\n 'instead. appDir is used to copy whole projects, ' +\n 'where \"out\" with \"baseUrl\" is used to just ' +\n 'optimize to one file.');\n }\n if (config.out && config.dir) {\n throw new Error('The \"out\" and \"dir\" options are incompatible.' +\n ' Use \"out\" if you are targeting a single file' +\n ' for optimization, and \"dir\" if you want the appDir' +\n ' or baseUrl directories optimized.');\n }\n\n if (config.dir) {\n // Make sure the output dir is not set to a parent of the\n // source dir or the same dir, as it will result in source\n // code deletion.\n if (!config.allowSourceOverwrites && (config.dir === config.baseUrl ||\n config.dir === config.appDir ||\n (config.baseUrl && build.makeRelativeFilePath(config.dir,\n config.baseUrl).indexOf('..') !== 0) ||\n (config.appDir &&\n build.makeRelativeFilePath(config.dir, config.appDir).indexOf('..') !== 0))) {\n throw new Error('\"dir\" is set to a parent or same directory as' +\n ' \"appDir\" or \"baseUrl\". This can result in' +\n ' the deletion of source code. Stopping. If' +\n ' you want to allow possible overwriting of' +\n ' source code, set \"allowSourceOverwrites\"' +\n ' to true in the build config, but do so at' +\n ' your own risk. In that case, you may want' +\n ' to also set \"keepBuildDir\" to true.');\n }\n }\n\n if (config.insertRequire && !lang.isArray(config.insertRequire)) {\n throw new Error('insertRequire should be a list of module IDs' +\n ' to insert in to a require([]) call.');\n }\n\n if (config.generateSourceMaps) {\n if (config.preserveLicenseComments && config.optimize !== 'none') {\n throw new Error('Cannot use preserveLicenseComments and ' +\n 'generateSourceMaps together. Either explcitly set ' +\n 'preserveLicenseComments to false (default is true) or ' +\n 'turn off generateSourceMaps. If you want source maps with ' +\n 'license comments, see: ' +\n 'http://requirejs.org/docs/errors.html#sourcemapcomments');\n } else if (config.optimize !== 'none' &&\n config.optimize !== 'closure' &&\n config.optimize !== 'uglify2') {\n //Allow optimize: none to pass, since it is useful when toggling\n //minification on and off to debug something, and it implicitly\n //works, since it does not need a source map.\n throw new Error('optimize: \"' + config.optimize +\n '\" does not support generateSourceMaps.');\n }\n }\n\n if ((config.name || config.include) && !config.modules) {\n //Just need to build one file, but may be part of a whole appDir/\n //baseUrl copy, but specified on the command line, so cannot do\n //the modules array setup. So create a modules section in that\n //case.\n config.modules = [\n {\n name: config.name,\n out: config.out,\n create: config.create,\n include: config.include,\n exclude: config.exclude,\n excludeShallow: config.excludeShallow,\n insertRequire: config.insertRequire,\n stubModules: config.stubModules\n }\n ];\n delete config.stubModules;\n } else if (config.modules && config.out) {\n throw new Error('If the \"modules\" option is used, then there ' +\n 'should be a \"dir\" option set and \"out\" should ' +\n 'not be used since \"out\" is only for single file ' +\n 'optimization output.');\n } else if (config.modules && config.name) {\n throw new Error('\"name\" and \"modules\" options are incompatible. ' +\n 'Either use \"name\" if doing a single file ' +\n 'optimization, or \"modules\" if you want to target ' +\n 'more than one file for optimization.');\n }\n\n if (config.out && !config.cssIn) {\n //Just one file to optimize.\n\n //Does not have a build file, so set up some defaults.\n //Optimizing CSS should not be allowed, unless explicitly\n //asked for on command line. In that case the only task is\n //to optimize a CSS file.\n if (!cfg.optimizeCss) {\n config.optimizeCss = \"none\";\n }\n }\n\n //Normalize cssPrefix\n if (config.cssPrefix) {\n //Make sure cssPrefix ends in a slash\n config.cssPrefix = endsWithSlash(config.cssPrefix);\n } else {\n config.cssPrefix = '';\n }\n\n //Cycle through modules and normalize\n if (config.modules && config.modules.length) {\n config.modules.forEach(function (mod) {\n\n //Combine any local stubModules with global values.\n if (config.stubModules) {\n mod.stubModules = config.stubModules.concat(mod.stubModules || []);\n }\n\n //Create a hash lookup for the stubModules config to make lookup\n //cheaper later.\n if (mod.stubModules) {\n mod.stubModules._byName = {};\n mod.stubModules.forEach(function (id) {\n mod.stubModules._byName[id] = true;\n });\n }\n\n // Legacy command support, which allowed a single string ID\n // for include.\n if (typeof mod.include === 'string') {\n mod.include = [mod.include];\n }\n\n //Allow wrap config in overrides, but normalize it.\n if (mod.override) {\n normalizeWrapConfig(mod.override, absFilePath);\n }\n });\n }\n\n normalizeWrapConfig(config, absFilePath);\n\n //Do final input verification\n if (config.context) {\n throw new Error('The build argument \"context\" is not supported' +\n ' in a build. It should only be used in web' +\n ' pages.');\n }\n\n //Set up normalizeDirDefines. If not explicitly set, if optimize \"none\",\n //set to \"skip\" otherwise set to \"all\".\n if (!hasProp(config, 'normalizeDirDefines')) {\n if (config.optimize === 'none' || config.skipDirOptimize) {\n config.normalizeDirDefines = 'skip';\n } else {\n config.normalizeDirDefines = 'all';\n }\n }\n\n //Set file.fileExclusionRegExp if desired\n if (hasProp(config, 'fileExclusionRegExp')) {\n if (typeof config.fileExclusionRegExp === \"string\") {\n file.exclusionRegExp = new RegExp(config.fileExclusionRegExp);\n } else {\n file.exclusionRegExp = config.fileExclusionRegExp;\n }\n } else if (hasProp(config, 'dirExclusionRegExp')) {\n //Set file.dirExclusionRegExp if desired, this is the old\n //name for fileExclusionRegExp before 1.0.2. Support for backwards\n //compatibility\n file.exclusionRegExp = config.dirExclusionRegExp;\n }\n\n //Track the deps, but in a different key, so that they are not loaded\n //as part of config seeding before all config is in play (#648). Was\n //going to merge this in with \"include\", but include is added after\n //the \"name\" target. To preserve what r.js has done previously, make\n //sure \"deps\" comes before the \"name\".\n if (config.deps) {\n config._depsInclude = config.deps;\n }\n\n\n //Remove things that may cause problems in the build.\n //deps already merged above\n delete config.deps;\n delete config.jQuery;\n delete config.enforceDefine;\n delete config.urlArgs;\n\n return config;\n };\n\n /**\n * finds the module being built/optimized with the given moduleName,\n * or returns null.\n * @param {String} moduleName\n * @param {Array} modules\n * @returns {Object} the module object from the build profile, or null.\n */\n build.findBuildModule = function (moduleName, modules) {\n var i, module;\n for (i = 0; i < modules.length; i++) {\n module = modules[i];\n if (module.name === moduleName) {\n return module;\n }\n }\n return null;\n };\n\n /**\n * Removes a module name and path from a layer, if it is supposed to be\n * excluded from the layer.\n * @param {String} moduleName the name of the module\n * @param {String} path the file path for the module\n * @param {Object} layer the layer to remove the module/path from\n */\n build.removeModulePath = function (module, path, layer) {\n var index = layer.buildFilePaths.indexOf(path);\n if (index !== -1) {\n layer.buildFilePaths.splice(index, 1);\n }\n };\n\n /**\n * Uses the module build config object to trace the dependencies for the\n * given module.\n *\n * @param {Object} module the module object from the build config info.\n * @param {Object} config the build config object.\n * @param {Object} [baseLoaderConfig] the base loader config to use for env resets.\n *\n * @returns {Object} layer information about what paths and modules should\n * be in the flattened module.\n */\n build.traceDependencies = function (module, config, baseLoaderConfig) {\n var include, override, layer, context, oldContext,\n rawTextByIds,\n syncChecks = {\n rhino: true,\n node: true,\n xpconnect: true\n },\n deferred = prim();\n\n //Reset some state set up in requirePatch.js, and clean up require's\n //current context.\n oldContext = require._buildReset();\n\n //Grab the reset layer and context after the reset, but keep the\n //old config to reuse in the new context.\n layer = require._layer;\n context = layer.context;\n\n //Put back basic config, use a fresh object for it.\n if (baseLoaderConfig) {\n require(lang.deeplikeCopy(baseLoaderConfig));\n }\n\n logger.trace(\"\\nTracing dependencies for: \" + (module.name ||\n (typeof module.out === 'function' ? 'FUNCTION' : module.out)));\n include = config._depsInclude || [];\n include = include.concat(module.name && !module.create ? [module.name] : []);\n if (module.include) {\n include = include.concat(module.include);\n }\n\n //If there are overrides to basic config, set that up now.;\n if (module.override) {\n if (baseLoaderConfig) {\n override = build.createOverrideConfig(baseLoaderConfig, module.override);\n } else {\n override = lang.deeplikeCopy(module.override);\n }\n require(override);\n }\n\n //Now, populate the rawText cache with any values explicitly passed in\n //via config.\n rawTextByIds = require.s.contexts._.config.rawText;\n if (rawTextByIds) {\n lang.eachProp(rawTextByIds, function (contents, id) {\n var url = require.toUrl(id) + '.js';\n require._cachedRawText[url] = contents;\n });\n }\n\n\n //Configure the callbacks to be called.\n deferred.reject.__requireJsBuild = true;\n\n //Use a wrapping function so can check for errors.\n function includeFinished(value) {\n //If a sync build environment, check for errors here, instead of\n //in the then callback below, since some errors, like two IDs pointed\n //to same URL but only one anon ID will leave the loader in an\n //unresolved state since a setTimeout cannot be used to check for\n //timeout.\n var hasError = false;\n if (syncChecks[env.get()]) {\n try {\n build.checkForErrors(context);\n } catch (e) {\n hasError = true;\n deferred.reject(e);\n }\n }\n\n if (!hasError) {\n deferred.resolve(value);\n }\n }\n includeFinished.__requireJsBuild = true;\n\n //Figure out module layer dependencies by calling require to do the work.\n require(include, includeFinished, deferred.reject);\n\n // If a sync env, then with the \"two IDs to same anon module path\"\n // issue, the require never completes, need to check for errors\n // here.\n if (syncChecks[env.get()]) {\n build.checkForErrors(context);\n }\n\n return deferred.promise.then(function () {\n //Reset config\n if (module.override && baseLoaderConfig) {\n require(lang.deeplikeCopy(baseLoaderConfig));\n }\n\n build.checkForErrors(context);\n\n return layer;\n });\n };\n\n build.checkForErrors = function (context) {\n //Check to see if it all loaded. If not, then throw, and give\n //a message on what is left.\n var id, prop, mod, idParts, pluginId, pluginResources,\n errMessage = '',\n failedPluginMap = {},\n failedPluginIds = [],\n errIds = [],\n errUrlMap = {},\n errUrlConflicts = {},\n hasErrUrl = false,\n hasUndefined = false,\n defined = context.defined,\n registry = context.registry;\n\n function populateErrUrlMap(id, errUrl, skipNew) {\n // Loader plugins do not have an errUrl, so skip them.\n if (!errUrl) {\n return;\n }\n\n if (!skipNew) {\n errIds.push(id);\n }\n\n if (errUrlMap[errUrl]) {\n hasErrUrl = true;\n //This error module has the same URL as another\n //error module, could be misconfiguration.\n if (!errUrlConflicts[errUrl]) {\n errUrlConflicts[errUrl] = [];\n //Store the original module that had the same URL.\n errUrlConflicts[errUrl].push(errUrlMap[errUrl]);\n }\n errUrlConflicts[errUrl].push(id);\n } else if (!skipNew) {\n errUrlMap[errUrl] = id;\n }\n }\n\n for (id in registry) {\n if (hasProp(registry, id) && id.indexOf('_@r') !== 0) {\n hasUndefined = true;\n mod = getOwn(registry, id);\n idParts = id.split('!');\n pluginId = idParts[0];\n\n if (id.indexOf('_unnormalized') === -1 && mod && mod.enabled) {\n populateErrUrlMap(id, mod.map.url);\n }\n\n //Look for plugins that did not call load()\n\n if (idParts.length > 1) {\n if (falseProp(failedPluginMap, pluginId)) {\n failedPluginIds.push(pluginId);\n }\n pluginResources = failedPluginMap[pluginId];\n if (!pluginResources) {\n pluginResources = failedPluginMap[pluginId] = [];\n }\n pluginResources.push(id + (mod.error ? ': ' + mod.error : ''));\n }\n }\n }\n\n // If have some modules that are not defined/stuck in the registry,\n // then check defined modules for URL overlap.\n if (hasUndefined) {\n for (id in defined) {\n if (hasProp(defined, id) && id.indexOf('!') === -1) {\n populateErrUrlMap(id, require.toUrl(id) + '.js', true);\n }\n }\n }\n\n if (errIds.length || failedPluginIds.length) {\n if (failedPluginIds.length) {\n errMessage += 'Loader plugin' +\n (failedPluginIds.length === 1 ? '' : 's') +\n ' did not call ' +\n 'the load callback in the build:\\n' +\n failedPluginIds.map(function (pluginId) {\n var pluginResources = failedPluginMap[pluginId];\n return pluginId + ':\\n ' + pluginResources.join('\\n ');\n }).join('\\n') + '\\n';\n }\n errMessage += 'Module loading did not complete for: ' + errIds.join(', ');\n\n if (hasErrUrl) {\n errMessage += '\\nThe following modules share the same URL. This ' +\n 'could be a misconfiguration if that URL only has ' +\n 'one anonymous module in it:';\n for (prop in errUrlConflicts) {\n if (hasProp(errUrlConflicts, prop)) {\n errMessage += '\\n' + prop + ': ' +\n errUrlConflicts[prop].join(', ');\n }\n }\n }\n throw new Error(errMessage);\n }\n };\n\n build.createOverrideConfig = function (config, override) {\n var cfg = lang.deeplikeCopy(config),\n oride = lang.deeplikeCopy(override);\n\n lang.eachProp(oride, function (value, prop) {\n if (hasProp(build.objProps, prop)) {\n //An object property, merge keys. Start a new object\n //so that source object in config does not get modified.\n cfg[prop] = {};\n lang.mixin(cfg[prop], config[prop], true);\n lang.mixin(cfg[prop], override[prop], true);\n } else {\n cfg[prop] = override[prop];\n }\n });\n\n return cfg;\n };\n\n /**\n * Uses the module build config object to create an flattened version\n * of the module, with deep dependencies included.\n *\n * @param {Object} module the module object from the build config info.\n *\n * @param {Object} layer the layer object returned from build.traceDependencies.\n *\n * @param {Object} the build config object.\n *\n * @returns {Object} with two properties: \"text\", the text of the flattened\n * module, and \"buildText\", a string of text representing which files were\n * included in the flattened module text.\n */\n build.flattenModule = function (module, layer, config) {\n var fileContents, sourceMapGenerator,\n sourceMapBase,\n buildFileContents = '';\n\n return prim().start(function () {\n var reqIndex, currContents, fileForSourceMap,\n moduleName, shim, packageMain, packageName,\n parts, builder, writeApi,\n namespace, namespaceWithDot, stubModulesByName,\n context = layer.context,\n onLayerEnds = [],\n onLayerEndAdded = {};\n\n //Use override settings, particularly for pragmas\n //Do this before the var readings since it reads config values.\n if (module.override) {\n config = build.createOverrideConfig(config, module.override);\n }\n\n namespace = config.namespace || '';\n namespaceWithDot = namespace ? namespace + '.' : '';\n stubModulesByName = (module.stubModules && module.stubModules._byName) || {};\n\n //Start build output for the module.\n module.onCompleteData = {\n name: module.name,\n path: (config.dir ? module._buildPath.replace(config.dir, \"\") : module._buildPath),\n included: []\n };\n\n buildFileContents += \"\\n\" +\n module.onCompleteData.path +\n \"\\n----------------\\n\";\n\n //If there was an existing file with require in it, hoist to the top.\n if (layer.existingRequireUrl) {\n reqIndex = layer.buildFilePaths.indexOf(layer.existingRequireUrl);\n if (reqIndex !== -1) {\n layer.buildFilePaths.splice(reqIndex, 1);\n layer.buildFilePaths.unshift(layer.existingRequireUrl);\n }\n }\n\n if (config.generateSourceMaps) {\n sourceMapBase = config.dir || config.baseUrl;\n fileForSourceMap = module._buildPath === 'FUNCTION' ?\n (module.name || module.include[0] || 'FUNCTION') + '.build.js' :\n module._buildPath.replace(sourceMapBase, '');\n sourceMapGenerator = new SourceMapGenerator.SourceMapGenerator({\n file: fileForSourceMap\n });\n }\n\n //Write the built module to disk, and build up the build output.\n fileContents = \"\";\n return prim.serial(layer.buildFilePaths.map(function (path) {\n return function () {\n var lineCount,\n singleContents = '';\n\n moduleName = layer.buildFileToModule[path];\n packageName = moduleName.split('/').shift();\n\n //If the moduleName is for a package main, then update it to the\n //real main value.\n packageMain = layer.context.config.pkgs &&\n getOwn(layer.context.config.pkgs, packageName);\n if (packageMain !== moduleName) {\n // Not a match, clear packageMain\n packageMain = undefined;\n }\n\n return prim().start(function () {\n //Figure out if the module is a result of a build plugin, and if so,\n //then delegate to that plugin.\n parts = context.makeModuleMap(moduleName);\n builder = parts.prefix && getOwn(context.defined, parts.prefix);\n if (builder) {\n if (builder.onLayerEnd && falseProp(onLayerEndAdded, parts.prefix)) {\n onLayerEnds.push(builder);\n onLayerEndAdded[parts.prefix] = true;\n }\n\n if (builder.write) {\n writeApi = function (input) {\n singleContents += \"\\n\" + addSemiColon(input, config);\n if (config.onBuildWrite) {\n singleContents = config.onBuildWrite(moduleName, path, singleContents);\n }\n };\n writeApi.asModule = function (moduleName, input) {\n singleContents += \"\\n\" +\n addSemiColon(build.toTransport(namespace, moduleName, path, input, layer, {\n useSourceUrl: layer.context.config.useSourceUrl\n }), config);\n if (config.onBuildWrite) {\n singleContents = config.onBuildWrite(moduleName, path, singleContents);\n }\n };\n builder.write(parts.prefix, parts.name, writeApi);\n }\n return;\n } else {\n return prim().start(function () {\n if (hasProp(stubModulesByName, moduleName)) {\n //Just want to insert a simple module definition instead\n //of the source module. Useful for plugins that inline\n //all their resources.\n if (hasProp(layer.context.plugins, moduleName)) {\n //Slightly different content for plugins, to indicate\n //that dynamic loading will not work.\n return 'define({load: function(id){throw new Error(\"Dynamic load not allowed: \" + id);}});';\n } else {\n return 'define({});';\n }\n } else {\n return require._cacheReadAsync(path);\n }\n }).then(function (text) {\n var hasPackageName;\n\n currContents = text;\n\n if (config.cjsTranslate &&\n (!config.shim || !lang.hasProp(config.shim, moduleName))) {\n currContents = commonJs.convert(path, currContents);\n }\n\n if (config.onBuildRead) {\n currContents = config.onBuildRead(moduleName, path, currContents);\n }\n\n if (packageMain) {\n hasPackageName = (packageName === parse.getNamedDefine(currContents));\n }\n\n if (namespace) {\n currContents = pragma.namespace(currContents, namespace);\n }\n\n currContents = build.toTransport(namespace, moduleName, path, currContents, layer, {\n useSourceUrl: config.useSourceUrl\n });\n\n if (packageMain && !hasPackageName) {\n currContents = addSemiColon(currContents, config) + '\\n';\n currContents += namespaceWithDot + \"define('\" +\n packageName + \"', ['\" + moduleName +\n \"'], function (main) { return main; });\\n\";\n }\n\n if (config.onBuildWrite) {\n currContents = config.onBuildWrite(moduleName, path, currContents);\n }\n\n //Semicolon is for files that are not well formed when\n //concatenated with other content.\n singleContents += addSemiColon(currContents, config);\n });\n }\n }).then(function () {\n var refPath, pluginId, resourcePath,\n sourceMapPath, sourceMapLineNumber,\n shortPath = path.replace(config.dir, \"\");\n\n module.onCompleteData.included.push(shortPath);\n buildFileContents += shortPath + \"\\n\";\n\n //Some files may not have declared a require module, and if so,\n //put in a placeholder call so the require does not try to load them\n //after the module is processed.\n //If we have a name, but no defined module, then add in the placeholder.\n if (moduleName && falseProp(layer.modulesWithNames, moduleName) && !config.skipModuleInsertion) {\n shim = config.shim && (getOwn(config.shim, moduleName) || (packageMain && getOwn(config.shim, moduleName) || getOwn(config.shim, packageName)));\n if (shim) {\n if (config.wrapShim) {\n singleContents = '(function(root) {\\n' +\n namespaceWithDot + 'define(\"' + moduleName + '\", ' +\n (shim.deps && shim.deps.length ?\n build.makeJsArrayString(shim.deps) + ', ' : '[], ') +\n 'function() {\\n' +\n ' return (function() {\\n' +\n singleContents +\n // Start with a \\n in case last line is a comment\n // in the singleContents, like a sourceURL comment.\n '\\n' + (shim.exportsFn ? shim.exportsFn() : '') +\n '\\n' +\n ' }).apply(root, arguments);\\n' +\n '});\\n' +\n '}(this));\\n';\n } else {\n singleContents += '\\n' + namespaceWithDot + 'define(\"' + moduleName + '\", ' +\n (shim.deps && shim.deps.length ?\n build.makeJsArrayString(shim.deps) + ', ' : '') +\n (shim.exportsFn ? shim.exportsFn() : 'function(){}') +\n ');\\n';\n }\n } else {\n singleContents += '\\n' + namespaceWithDot + 'define(\"' + moduleName + '\", function(){});\\n';\n }\n }\n\n //Add line break at end of file, instead of at beginning,\n //so source map line numbers stay correct, but still allow\n //for some space separation between files in case ASI issues\n //for concatenation would cause an error otherwise.\n singleContents += '\\n';\n\n //Add to the source map\n if (sourceMapGenerator) {\n refPath = config.out ? config.baseUrl : module._buildPath;\n parts = path.split('!');\n if (parts.length === 1) {\n //Not a plugin resource, fix the path\n sourceMapPath = build.makeRelativeFilePath(refPath, path);\n } else {\n //Plugin resource. If it looks like just a plugin\n //followed by a module ID, pull off the plugin\n //and put it at the end of the name, otherwise\n //just leave it alone.\n pluginId = parts.shift();\n resourcePath = parts.join('!');\n if (resourceIsModuleIdRegExp.test(resourcePath)) {\n sourceMapPath = build.makeRelativeFilePath(refPath, require.toUrl(resourcePath)) +\n '!' + pluginId;\n } else {\n sourceMapPath = path;\n }\n }\n\n sourceMapLineNumber = fileContents.split('\\n').length - 1;\n lineCount = singleContents.split('\\n').length;\n for (var i = 1; i <= lineCount; i += 1) {\n sourceMapGenerator.addMapping({\n generated: {\n line: sourceMapLineNumber + i,\n column: 0\n },\n original: {\n line: i,\n column: 0\n },\n source: sourceMapPath\n });\n }\n\n //Store the content of the original in the source\n //map since other transforms later like minification\n //can mess up translating back to the original\n //source.\n sourceMapGenerator.setSourceContent(sourceMapPath, singleContents);\n }\n\n //Add the file to the final contents\n fileContents += singleContents;\n });\n };\n })).then(function () {\n if (onLayerEnds.length) {\n onLayerEnds.forEach(function (builder) {\n var path;\n if (typeof module.out === 'string') {\n path = module.out;\n } else if (typeof module._buildPath === 'string') {\n path = module._buildPath;\n }\n builder.onLayerEnd(function (input) {\n fileContents += \"\\n\" + addSemiColon(input, config);\n }, {\n name: module.name,\n path: path\n });\n });\n }\n\n if (module.create) {\n //The ID is for a created layer. Write out\n //a module definition for it in case the\n //built file is used with enforceDefine\n //(#432)\n fileContents += '\\n' + namespaceWithDot + 'define(\"' + module.name + '\", function(){});\\n';\n }\n\n //Add a require at the end to kick start module execution, if that\n //was desired. Usually this is only specified when using small shim\n //loaders like almond.\n if (module.insertRequire) {\n fileContents += '\\n' + namespaceWithDot + 'require([\"' + module.insertRequire.join('\", \"') + '\"]);\\n';\n }\n });\n }).then(function () {\n return {\n text: config.wrap ?\n config.wrap.start + fileContents + config.wrap.end :\n fileContents,\n buildText: buildFileContents,\n sourceMap: sourceMapGenerator ?\n JSON.stringify(sourceMapGenerator.toJSON(), null, ' ') :\n undefined\n };\n });\n };\n\n //Converts an JS array of strings to a string representation.\n //Not using JSON.stringify() for Rhino's sake.\n build.makeJsArrayString = function (ary) {\n return '[\"' + ary.map(function (item) {\n //Escape any double quotes, backslashes\n return lang.jsEscape(item);\n }).join('\",\"') + '\"]';\n };\n\n build.toTransport = function (namespace, moduleName, path, contents, layer, options) {\n var baseUrl = layer && layer.context.config.baseUrl;\n\n function onFound(info) {\n //Only mark this module as having a name if not a named module,\n //or if a named module and the name matches expectations.\n if (layer && (info.needsId || info.foundId === moduleName)) {\n layer.modulesWithNames[moduleName] = true;\n }\n }\n\n //Convert path to be a local one to the baseUrl, useful for\n //useSourceUrl.\n if (baseUrl) {\n path = path.replace(baseUrl, '');\n }\n\n return transform.toTransport(namespace, moduleName, path, contents, onFound, options);\n };\n\n return build;\n});\n\n }", "title": "" }, { "docid": "60da13eb820bf0629c0404523dafc545", "score": "0.48926643", "text": "async loadConfig() {\n let config = this.cmdLineArgs[CFG_CONFIG];\n\n if (typeof config === \"undefined\" || config === \"\") {\n // Check if the config file was speccified via an env var\n config = process.env[CFG_ENV_VAR_CONFIG];\n }\n\n if (typeof config === \"string\" && config !== \"\") {\n // Check if the config file has an absolute or relative path\n if (path.isAbsolute(config)) {\n if (!fs.existsSync(config)) {\n throw new Error(`Can not find file ${config}`);\n }\n } else {\n let fullName = path.resolve(process.cwd(), config);\n\n if (!fs.existsSync(config)) {\n throw new Error(\n `Can not find file ${config} in cwd ${process.cwd()}`); \n }\n\n config = path.resolve(process.cwd(), config);\n }\n\n let ext = path.extname(config);\n\n if (ext === \".json\") {\n this.cache = require(config);\n } else if (ext === \".yml\" || ext === \".yaml\") {\n let conf = jsYaml.safeLoad(fs.readFileSync(config, 'utf8'));\n this.cache = conf;\n }\n }\n \n // Now override any configuration setting passed on command line\n lodashMerge(this.cache, this.cmdLineArgs);\n }", "title": "" }, { "docid": "2ef42a5c40172863e067cef5e55323ec", "score": "0.48889175", "text": "function isCLI () {\n\tvar script = path.extname(process.argv[1]) === '.js' ? process.argv[1] : (process.argv[1] + '.js'); \n\treturn script === __filename;\n}", "title": "" }, { "docid": "1f6daf462f76827a41f3de5d69816194", "score": "0.4888098", "text": "function findModule (file, relativeTo, lookups) {\n if (path.isAbsolute(file)) {\n return;\n }\n\n lookups = lookups || {\n bower_components: 'bower.json',\n node_modules: 'package.json'\n };\n\n if (file[0] === '.') {\n var fileIndex = findRelative(path.join(file, 'index.js'), relativeTo);\n if (fs.existsSync(fileIndex)) {\n return fileIndex;\n }\n\n var fileExact = findRelative(file + '.js', relativeTo);\n if (fs.existsSync(fileExact)) {\n return fileExact;\n }\n }\n\n var currentDir = relativeTo ? path.dirname(relativeTo) : process.cwd();\n var dirs = currentDir.split(path.sep);\n var isModuleNameOnly = file.indexOf(path.sep) === -1;\n\n for (var a = 0; a < dirs.length; a++) {\n for (var lookupPath in lookups) {\n var lookupBase = path.join(currentDir, new Array(a).join('../'));\n var lookupFile = path.join(lookupBase, lookupPath, file, lookups[lookupPath]);\n var lookupModule = path.join(lookupBase, lookupPath, file);\n var lookupModuleJs = path.join(lookupBase, lookupPath, file + '.js');\n var lookupModuleIndex = path.join(lookupBase, lookupPath, file, 'index.js');\n\n if (isModuleNameOnly && fs.existsSync(lookupFile)) {\n var json = require(lookupFile);\n if (json.main) {\n var withoutJs = findRelative(json.main, lookupFile);\n var withJs = findRelative(json.main + '.js', lookupFile);\n if (fs.existsSync(withoutJs)) {\n return withoutJs;\n }\n if (fs.existsSync(withJs)) {\n return withJs;\n }\n }\n }\n\n if (fs.existsSync(lookupModuleIndex)) {\n return lookupModuleIndex;\n }\n\n if (fs.existsSync(lookupModuleJs)) {\n return lookupModuleJs;\n }\n\n if (fs.existsSync(lookupModule)) {\n return lookupModule;\n }\n }\n }\n}", "title": "" }, { "docid": "645ffe7b47b77363488e3dfc72bc8758", "score": "0.48689902", "text": "function trustedScriptFromString(script) {\n var _a;\n return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n}", "title": "" }, { "docid": "645ffe7b47b77363488e3dfc72bc8758", "score": "0.48689902", "text": "function trustedScriptFromString(script) {\n var _a;\n return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n}", "title": "" }, { "docid": "645ffe7b47b77363488e3dfc72bc8758", "score": "0.48689902", "text": "function trustedScriptFromString(script) {\n var _a;\n return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n}", "title": "" }, { "docid": "645ffe7b47b77363488e3dfc72bc8758", "score": "0.48689902", "text": "function trustedScriptFromString(script) {\n var _a;\n return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n}", "title": "" }, { "docid": "645ffe7b47b77363488e3dfc72bc8758", "score": "0.48689902", "text": "function trustedScriptFromString(script) {\n var _a;\n return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n}", "title": "" }, { "docid": "645ffe7b47b77363488e3dfc72bc8758", "score": "0.48689902", "text": "function trustedScriptFromString(script) {\n var _a;\n return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n}", "title": "" }, { "docid": "645ffe7b47b77363488e3dfc72bc8758", "score": "0.48689902", "text": "function trustedScriptFromString(script) {\n var _a;\n return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n}", "title": "" }, { "docid": "645ffe7b47b77363488e3dfc72bc8758", "score": "0.48689902", "text": "function trustedScriptFromString(script) {\n var _a;\n return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;\n}", "title": "" }, { "docid": "d29025911edd5c582d1e8b49d376cc4f", "score": "0.4865756", "text": "postLoad(context, script) {\n if (!script) {\n const messages = this.errors.map((error) => ` - ${error.message}`).join('\\n');\n throw new Error(`Failed to load script from multiple sources:\\n${messages}`);\n }\n this.tool.addPlugin('script', script);\n return script;\n }", "title": "" }, { "docid": "124484115a662ab496a1b7031d43b31a", "score": "0.48627198", "text": "function requirePath() {\n const pathDir = `./`;\n const pathPath = `${pathDir}/path.js`;\n const pathScript = readFile(pathPath);\n const module = createModule(pathPath);\n const ret = requireLoadInternal(pathScript, module.exports, null, module, pathPath, pathDir);\n if (!ret)\n throw new Error('unable to load path module');\n requireCache[`${pathDir}`] = ret;\n requireCache['path'] = ret;\n return ret.exports;\n}", "title": "" }, { "docid": "a4e4dadab24296924e3091b039af8ac8", "score": "0.48600376", "text": "function kn_include(aScript)\n{\n var s = \"\";\n var url;\n\n aScript = kn_include_canonicalName(aScript);\n\n if (! kn_include_isLoaded(aScript))\n {\n if (self.kn_include_deps)\n {\n var deps = self.kn_include_deps[aScript];\n if (deps)\n {\n for (var i=0;i<deps.length;i++)\n {\n kn_include(deps[i]);\n }\n }\n }\n\n url = aScript + \".js\";\n\n // FIXME: Looks like we need an actual URL and path resolver in here... \n if (url.indexOf(\"/\") != 0 &&\n url.indexOf(\"./\") != 0 &&\n url.indexOf(\"../\") != 0 &&\n ! kn_browser_hasProto(url))\n {\n url = kn_browser_includePath + url;\n }\n document.write('<script src=\"' + url + '\"><' + '/script>');\n kn_include_loaded[kn_include_loaded.length] = aScript;\n }\n}", "title": "" }, { "docid": "34b8385f4b1c9692d60eacec0e489a6c", "score": "0.48486426", "text": "_do_load() {\n assert.notEqual( this.filename, null, 'Cannot load a script without a filename' );\n\n /*\n * If the script was loading in text mode already, but we changed it and are now loading in normal mode,\n * it should abandon the text loading. The source code will still be available eventually.\n * */\n if( !this.loading || (this._loadingText && !this.textMode) ) {\n this.unload();\n\n if( !this.textMode ) {\n this._do_setup();\n\n this._loadingText = false;\n\n /*\n * default to .js if the file has no extension. It'll probably fail anyway,\n * but since this IS node.js, JavaScript is assumed\n * */\n let ext = extname( this.filename ) || '.js';\n\n //Use custom extension if available\n if( Script.extensions_enabled && Script.hasExtension( ext ) ) {\n /*\n * Unfortunately for now, we have to rely on the built-in Module loading code,\n * which is quite complex, and also synchronous.\n * */\n this._script.paths = Module._nodeModulePaths( dirname( this.filename ) );\n\n this._loading = true;\n\n try {\n /*\n * Watching here is a good choice, because if the file changes AS we are loading it, it's invalid anyway,\n * and it won't progress beyond the if( this._loading ) below.\n * */\n if( this._willWatch ) {\n this._do_watch( this._watchPersistent );\n }\n\n return tryPromise( Script.extensions[ext]( this._script, this.filename ) ).then( src => {\n if( this._loading ) {\n this._source = src;\n this._script.loaded = true;\n\n this._loading = false;\n\n this.emit( 'loaded', this._script.exports );\n\n } else {\n this.emit( 'error',\n new Error( `The script ${this.filename} was unloaded while performing an asynchronous operation.` ) );\n }\n\n }, err => {\n this._loading = false;\n\n this.emit( 'error', err );\n } );\n\n } catch( err ) {\n this._loading = false;\n\n this.emit( 'error', err );\n }\n\n } else {\n /*\n * This is the synchronous path. If custom extension handlers are used, this should never run. While there is nothing\n * particularly wrong with this path, it's still synchronous.\n * */\n\n if( !Module._extensions.hasOwnProperty( ext ) ) {\n this.emit( 'warning',\n `The extension handler for ${this.filename} does not exist, defaulting to .js handler` );\n }\n\n this._loading = true;\n\n try {\n if( this._willWatch ) {\n this._do_watch( this._watchPersistent );\n }\n\n this._script.load( this._script.filename );\n\n if( this._loading ) {\n this.emit( 'loaded', this.loaded );\n\n } else {\n this.emit( 'error',\n new Error( `The script ${this.filename} was unloaded while performing an asynchronous operation.` ) );\n }\n\n } catch( err ) {\n this.emit( 'error', err );\n\n } finally {\n this._loading = false;\n }\n }\n\n } else {\n this._loading = true;\n this._loadingText = true;\n\n if( this._willWatch ) {\n try {\n this._do_watch( this._watchPersistent );\n\n } catch( err ) {\n this._loading = false;\n this._loadingText = false;\n\n this.emit( 'error', err );\n }\n }\n\n return readFileAsync( this.filename ).then( src => {\n if( this._loading && this._loadingText ) {\n this._source = src;\n this._script.loaded = true;\n\n this._loading = false;\n this._loadingText = false;\n\n this.emit( 'loaded_src', this.loaded );\n\n } else if( !this._loading ) {\n this.emit( 'error',\n new Error( `The script ${this.filename} was unloaded while performing an asynchronous operation.` ) );\n }\n\n }, err => {\n this._loading = false;\n this._loadingText = false;\n\n this.emit( 'error', err );\n } );\n }\n }\n }", "title": "" }, { "docid": "b0eb6399587af5c0bdad5b0aebed965b", "score": "0.48457924", "text": "function i_read_js(src, dir, way) {\n if (0 == dir) {\n src = g.src_base + 'js/' + src + '.js';\n } else if (1 == dir) {\n src = g.src_base + src + '.js';\n } else {\n src = '../js/' + src + '.js';\n }\n\n if(g.src_list[src]) {\n return;\n }\n\n\n if('0' == way) {\n document.write('<script src=\"' + src + '\"><\\/script>');\n g.src_list[src] = true;\n } else {\n try {\n if (!g.axo) {\n g.axo = window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest();\n }\n g.axo.open('GET', src, false);\n g.axo.send(null);\n if(200 == g.axo.status || 0 == g.axo.status){\n if (window.execScript) {\n window.execScript(g.axo.responseText);\n } else {\n window.eval.call(window, g.axo.responseText);\n }\n }\n g.src_list[src] = true;\n } catch(e) {\n return;\n }\n }\n}", "title": "" }, { "docid": "476e20a24232f8ccb5ce4e1a033e9e32", "score": "0.48341918", "text": "function loadConfig (cwd, docs) {\n let fn\n if (exists(fn = join(cwd, 'docpress.json'))) {\n log(`Using config: ${fn}`)\n return require(fn)\n }\n\n if (exists(fn = join(cwd, docs, 'docpress.json'))) {\n log(`Using config: ${fn}`)\n return require(fn)\n }\n\n if (exists(fn = join(cwd, 'package.json'))) {\n var pkg = require(fn)\n if (pkg && pkg.docpress) {\n log(`Using config: ${fn} (.docpress)`)\n return pkg.docpress\n }\n }\n}", "title": "" }, { "docid": "226e4c270d941c6ecf4a63a1978f4ab4", "score": "0.48322222", "text": "function loadModule(moduleName, moduleDirectory) {\n PortFunnel.modules[moduleName] = {};\n\n var src = moduleDirectory + '/' + moduleName + '.js';\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = src;\n\n document.head.appendChild(script);\n}", "title": "" }, { "docid": "056c846220fcf4a89f2bcc43573e0b7a", "score": "0.48314333", "text": "function loadMain() {\n let files = glob.sync(path.join(__dirname, 'main-process/**/*.js'))\n files.forEach((file) => {\n require(file)\n })\n}", "title": "" }, { "docid": "2fdb6e9266d4132b4839ed0cb40a4249", "score": "0.4830382", "text": "_loadAsFileOrDir(\n potentialModulePath,\n platform) {\n const dirPath = path.dirname(potentialModulePath);\n const fileNameHint = path.basename(potentialModulePath);\n const fileResult = this._loadAsFile(dirPath, fileNameHint, platform);\n if (fileResult.type === 'resolved') {\n return fileResult;\n }\n const dirResult = this._loadAsDir(potentialModulePath, platform);\n if (dirResult.type === 'resolved') {\n return dirResult;\n }\n return failedFor({file: fileResult.candidates, dir: dirResult.candidates});\n }", "title": "" }, { "docid": "90f73521d7f6e0928933ec5270cb53a3", "score": "0.48288777", "text": "function setRequire() {\n if (typeof require !== 'undefined') { // if require is defined, return it\n return require;\n }\n else { // if require is not defined, build it\n const libraryPath = './lib/';\n\n if (typeof _scriptingContext === 'undefined') { throw '_scriptingContext not defined'; }\n\n const readFile = function (name) { return _scriptingContext.ReadFile(name) };\n\n const requireCache = Object.create(null);\n\n return function (name) {\n //console.log(`Evaluating file ${name}`);\n if (requiredFileIsALibrary(name)) { name = libraryPath + name; }\n if (requiredFileIsMissingExtension(name)) { name = name + '.js'; }\n if (!(name in requireCache)) {\n //console.log(`${name} is not in cache; reading from disk`);\n let code = readFile(name);\n let module = { exports: {} };\n requireCache[name] = module;\n let wrapper = Function('require, exports, module', code);\n wrapper(require, module.exports, module);\n }\n\n //console.log(`${name} is in cache. Returning it...`);\n return requireCache[name].exports;\n }\n\n function requiredFileIsALibrary(name) {\n name = name.trim();\n if (name.startsWith('./')) { return false; }\n if (name.startsWith('../')) { return false; }\n if (name.startsWith('.\\\\')) { return false; }\n if (name.startsWith('..\\\\')) { return false; }\n return true;\n }\n\n function requiredFileIsMissingExtension(name) {\n name = name.trim().toLowerCase();\n if (name.endsWith('.js')) { return false; }\n return true;\n }\n }\n}", "title": "" }, { "docid": "b585dad0fb64fddae4d198404379cee5", "score": "0.48272267", "text": "function require(url, callback) {\n var deferred;\n if ( ! callback) {\n // if no callback function, return a Deferred that resolves when the script is loaded\n deferred = $.Deferred();\n callback = function(event) { deferred.resolve(event); }\n }\n \n // fix relative URLs\n url = url.replace('./', HANDOUT_SCRIPTDIR);\n \n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.charset = 'utf-8';\n script.src = url;\n script.onerror = function(err) { throw err; }\n script.onload = callback;\n document.getElementsByTagName('body')[0].appendChild(script);\n \n return deferred;\n }", "title": "" }, { "docid": "3d47a00345df09410f5f0c76c7c81328", "score": "0.482282", "text": "function loadScript(path) {\n var result = $.Deferred(),\n script = document.createElement(\"script\");\n script.async = \"async\";\n script.type = \"text/javascript\";\n script.src = path;\n script.onload = script.onreadystatechange = function(_, isAbort) {\n if (!script.readyState || /loaded|complete/.test(script.readyState)) {\n if (isAbort)\n result.reject();\n else\n result.resolve();\n }\n };\n script.onerror = function() {\n result.reject();\n };\n $(\"head\")[0].appendChild(script);\n return result.promise();\n }", "title": "" }, { "docid": "e484c064dca2792a7d89a4433f3521ee", "score": "0.48196486", "text": "function loadMainProcess() {\n const files = glob.sync(path.join(__dirname, 'main-process/*.js'))\n files.forEach((file) => { require(file) })\n}", "title": "" }, { "docid": "e8d47165c1d47c97ebf5aec61f4c5b6b", "score": "0.48162562", "text": "_loadFilename(path) {\n const module = this._modules[path];\n if (!module) {\n throw new Error('Could not find file \"' + path + '\" in preloaded files.');\n }\n return module.module.code;\n }", "title": "" }, { "docid": "0d03f04fe9d6116e845503754f8ae64e", "score": "0.48012564", "text": "function load(callback) {\n readFile('config.json', function(e, text) {\n config = parseAsJSON(text);\n\n config.hosts = config.hosts || [module.exports.formatAddress('127.0.0.1:3000')];\n config.homescreenMode = module.exports.isHomescreenMode();\n config.currentHost = config.currentHost || module.exports.formatAddress('127.0.0.1:3000');\n config.currentAppID = config.currentAppID || '';\n\n if(!config.enabledScripts) {\n config.enabledScripts = {\n 'autoreload': true,\n 'console': true,\n 'deploy': true,\n 'homepage': true,\n 'push': true,\n 'refresh': true\n }\n } else {\n config.enableScripts = config.enableScripts;\n }\n\n module.exports.emit('load');\n callback(config);\n });\n}", "title": "" }, { "docid": "1642eea8859be45c70425c5dbdab9595", "score": "0.47998142", "text": "function printAvailableScripts(config) {\n if (Object.keys(config.scripts).length) {\n deps_ts_7.log.info(\"available scripts:\");\n const runner = new runner_ts_1.Runner(config);\n for (const name of Object.keys(config.scripts)) {\n const script = config.scripts[name];\n console.log();\n console.log(` - ${deps_ts_7.yellow(deps_ts_7.bold(name))}`);\n if (typeof script === \"object\" && script.desc) {\n console.log(` ${script.desc}`);\n }\n console.log(\n deps_ts_7.gray(` $ ${runner.build(name).cmd.join(\" \")}`),\n );\n }\n console.log();\n console.log(\n `You can run scripts with \\`${deps_ts_7.blue(\"denon\")} ${\n deps_ts_7.yellow(\"<script>\")\n }\\``,\n );\n } else {\n deps_ts_7.log.error(\"It looks like you don't have any scripts...\");\n const config = config_ts_1.getConfigFilename();\n if (config) {\n deps_ts_7.log.info(\n `You can add scripts to your \\`${config}\\` file. Check the docs.`,\n );\n } else {\n deps_ts_7.log.info(\n `You can create a config to add scripts to with \\`${\n deps_ts_7.blue(\"denon\")\n } ${deps_ts_7.yellow(\"--init\")}${deps_ts_7.reset(\"\\`.\")}`,\n );\n }\n }\n }", "title": "" }, { "docid": "8bf28a0df1dbf7f87ad2953d268d6b99", "score": "0.4791279", "text": "function loadScript(url, callback)\n{\n // Adding the script tag to the head as suggested before\n var head = document.getElementsByTagName('head')[0];\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = url;\n\n // Then bind the event to the callback function.\n // There are several events for cross browser compatibility.\n script.onreadystatechange = callback;\n script.onload = callback;\n\n // Fire the loading\n head.appendChild(script);\n\n //create the socket io and assign to global variable\n //BEGIN CODE ADDED BY MARK\n\t//create socket.io connection DIFFERENT ON LOCAL AND SERVER. ADJUST.\n}", "title": "" }, { "docid": "ccf75e26c5a0844ba442dde5c2dd6120", "score": "0.4790887", "text": "getPackageScripts () {\n let packageScripts\n try {\n const filePath = this.getPackagePath()\n const packageContents = readFileSync(filePath, 'utf8')\n packageScripts = JSON.parse(packageContents).scripts\n } catch (e) {}\n\n return packageScripts\n }", "title": "" }, { "docid": "3bb8046132b8a22808a2086143bee458", "score": "0.47892603", "text": "static runScript (file, options, data) {\n // define function to create context to run script\n const createContext = (opts) => {\n // declare\n const ctx = {}\n\n // if the key of options doesn't start with '$', we see it as argument\n // the value will append to %args object automatically\n if (opts) {\n const keys = Object.keys(opts)\n\n // initialize a variant\n let hasArgs = true\n\n // parse system items\n keys.\n filter((key) => key.startsWith('$')).\n forEach((key) => {\n ctx[key] = opts[key]\n })\n\n // check arguments were assigned or not\n if (!ctx[flagOfArgs]) {\n ctx[flagOfArgs] = {}\n hasArgs = false\n }\n\n // parse argument items\n keys.\n filter((key) => !key.startsWith('$')).\n forEach((key) => {\n (hasArgs ? ctx : ctx[flagOfArgs])[key] = opts[key]\n })\n }\n\n // run as script,\n // the default flag of catch error is true\n if (opts &&\n opts[flagOfThrowError] !== false) {\n ctx[flagOfThrowError] = true\n }\n\n // the default flag of ignore error is true\n if (opts &&\n opts[flagOfIgnoreError] !== false) {\n ctx[flagOfIgnoreError] = true\n }\n\n // return context\n return ctx\n }\n\n // define a function to read script from file\n const readScript = (scriptFile) => {\n // declare file stream\n let fs = null\n\n // co a generator function\n return co(function *() {\n // try to check file name does exists or not\n fs = yield aq.statFile(scriptFile)\n\n // read content from file by name\n return aq.readFile(scriptFile, { encoding: 'utf-8' })\n }).\n catch(() => {\n // throw error if the script has incorrect file name\n if (fs === null || !fs.isFile()) {\n throw new Error(`invalid script file: ${scriptFile}`)\n }\n\n // throw error read file stream failed\n throw new Error(`read script file: ${scriptFile} failed`)\n })\n }\n\n // define function to parse script\n const parseScript = (fdata, ctx) => {\n // parse script content\n const $$ = (() => {\n try {\n return eval(fdata)\n } catch (err) {\n throw new Error('parse script failed')\n }\n })()\n\n // call init function if it is defined in script\n if ($$.init &&\n typeof $$.init === 'function') {\n $$.init(ctx)\n }\n\n // return body of script\n return $$.Body\n }\n\n // define a function to process error in context\n const procError = (ctx, rt) => {\n // assign errors to options from context\n const errs = ctx[flagOfErrors]\n\n // found error in context errors\n if (errs && Object.keys(errs).length > 0) {\n // create error object in options\n options[flagOfErrors] = {}\n\n // assign errors from context to options\n Object.assign(\n options[flagOfErrors], ctx[flagOfErrors]\n )\n }\n\n // return result\n return rt\n }\n\n // co a generator function\n return co(function *() {\n // create runtime context\n const ctx = createContext(options)\n\n // read data from file stream by script file name\n const rs = yield readScript(file)\n\n // parse data to a script\n const ps = parseScript(rs, ctx)\n\n // execute script\n return Betch.\n run(ps, ctx, data).\n then((rt) => procError(ctx, rt))\n })\n }", "title": "" }, { "docid": "108a76d2a2cfbf205ab54ac32cdd0fdc", "score": "0.47860798", "text": "function loadMain() {\n const files = glob.sync(path.join(__dirname, 'main-process/**/*.js'));\n files.forEach((file) => {\n require(file); // eslint-disable-line\n });\n}", "title": "" }, { "docid": "5439e179478a1ea16aa687378f084232", "score": "0.47847775", "text": "_init() {\n let require = ( ...args ) => {\n return this._require( ...args );\n };\n\n let define = ( ...args ) => {\n return this._define( ...args );\n };\n\n //This is supposed to return a URL to where the file is, but since we're server side I dont' really know what it's supposed to do.\n require.toUrl = ( filepath = this.filename ) => {\n assert.strictEqual( typeof filepath, 'string', 'require.toUrl takes a string as filepath' );\n\n if( filepath.charAt( 0 ) === '.' ) {\n //Use the url.resolve instead of resolve, even though they usually do the same thing\n return resolveURL( this.baseUrl, filepath );\n\n } else {\n return filepath;\n }\n };\n\n require.defined = ( id ) => {\n return this._loadCache.has( path.normalize( id ) );\n };\n\n require.specified = ( id ) => {\n return this._defineCache.has( path.normalize( id ) );\n };\n\n require.undef = ( id ) => {\n id = path.normalize( id );\n\n this._loadCache.delete( id );\n this._defineCache.delete( id );\n\n return this;\n };\n\n //This is not an anonymous so stack traces make a bit more sense\n require.onError = function onErrorDefault( err ) {\n throw err; //default error\n };\n\n //This is almost exactly like the normal require.resolve, but it's relative to this.baseUrl\n require.resolve = ( id ) => {\n let relative = resolve( this.baseUrl, id );\n return Module._resolveFilename( relative, this._script );\n };\n\n define.require = require;\n\n define.amd = {\n jQuery: false\n };\n\n require.define = define;\n\n this.require = require;\n this.define = define;\n }", "title": "" }, { "docid": "bf7a28386961c02ff0334a3ff0288ce7", "score": "0.47811562", "text": "function loadScript(src, callback){\r\n let script = document.createElement('script');\r\n script.src = src;\r\n\r\n script.onload = () => callback(null, script);\r\n script.onerror = () => callback(new Error(`Script load error for ${src}`));\r\n\r\n document.head.append(script);\r\n}", "title": "" }, { "docid": "01693a53296b6a987792173f3dba8f02", "score": "0.47701055", "text": "async scriptLoader() {\n let promises = [];\n\n // Add css files\n for(let i = 0; i < app.Config.CSS.VIEW.length; ++i) {\n promises.push(app.ScriptLoad.addCssLink(app.PathHelper.getPath(\n app.Config.CSS.VIEW[i]), false));\n }\n\n // Add external libs files\n for(let i = 0; i < app.Config.JS.VIEW.length; ++i) {\n promises.push(app.ScriptLoad.addScript(app.PathHelper.getPath(\n app.Config.JS.VIEW[i]), false));\n }\n\n if(this.router.currentRoute.controller == null)\n throw new app.QwError(false, \"No Script defined for current route\");\n\n promises.push(app.ScriptLoad.addScript(app.PathHelper.getControllerPath(\n this.router.currentRoute.controller)));\n \n if(this.router.currentRoute.model)\n promises.push(app.ScriptLoad.addScript(app.PathHelper.getModelPath(\n this.router.currentRoute.controller), false, true));\n\n // for(let i = 0; i < promises.length; ++i) {\n // await promises[i].then(() => 1);\n // }\n\n //return app.promiseSerial(promises);\n return Promise.all(promises);\n }", "title": "" }, { "docid": "d4dcff5f8332dedddceb4fbaa2424e5d", "score": "0.4766482", "text": "loadLegacyCode() {\n const legacyLoader = document.createElement('script');\n legacyLoader.src = 'legacy_main_scripts.js';\n document.body.appendChild(legacyLoader);\n }", "title": "" }, { "docid": "21f82936ee8518b3d35c0fdc7b63e35b", "score": "0.47596043", "text": "function loadConfig() {\n const configFile = path_1.join(process.cwd(), 'next.config.js');\n if (moduleExists(configFile)) {\n let config = nonWebpackRequire_1.default(configFile);\n if (typeof config === 'function') {\n config = config();\n }\n return config;\n }\n else {\n return {};\n }\n}", "title": "" }, { "docid": "85bb0dcbf75423e0a1a908928ca093dd", "score": "0.47586527", "text": "function _loadLocalScript(name) {\n return localStorage['script.' + name];\n }", "title": "" }, { "docid": "a176451c590c64bc44a017be4e73d4b2", "score": "0.4752711", "text": "function require(file) {\n\tvar head = document.getElementsByTagName('head')[0];\n\tvar newscript = document.createElement('SCRIPT');\n\tvar output = document.getElementById('output');\n\t\n\tif (file.search(\".js\") > 0) {\n\t\tnewscript.src = file;\n\t\tnewscript.type = \"text/javascript\";\n\t\thead.appendChild(newscript);\n\t\tconsole.log(file + \" has successfully been loaded.\");\n\t} else {\n\t\tconsole.error(file + \" has not been loaded. Please check the file's URL.\")\n\t}\n\t\n}", "title": "" }, { "docid": "9dd58060c10bbacae9815c8e0f381377", "score": "0.47518682", "text": "function kn_include_canonicalName(aScript)\n{\n if (aScript.indexOf(\"/\") == -1)\n {\n // Allow Java-style \".\" notation for scripts in subdirectories.\n aScript = aScript.split(\".\").join(\"/\");\n }\n\n return aScript;\n}", "title": "" } ]
631d69cec8fbb63fb78ad5ea9bd1f9de
Return true if the piece can move down in the well, false else
[ { "docid": "643ff22926b9340f3a05036486a43fd7", "score": "0.8409463", "text": "canMoveDown() {\n\t\t// Check if each square in the piece's structure can move down, relative to the piece's position in the well\n\t\tfor (var r = 0; r < this.getStructure().length; ++r) {\n\t\t\tfor (var c = 0; c < this.getStructure()[r].length; ++c) {\n\t\t\t\tif (this.getStructure()[r][c] == 1) {\n\t\t\t\t\t// Compute the absolute position of the square\n\t\t\t\t\t// absolute position of the origin of the piece + position of the square in the piece - position of the origin in the piece\n\t\t\t\t\tvar absolute_square_position = [this.absolute_position[0] + c - this.relative_position[0], this.absolute_position[1] + r - this.relative_position[1]];\n\t\t\t\t\t// Add 1 to the vertical position of the square (like a down move)\n\t\t\t\t\tabsolute_square_position[1]++;\n\t\t\t\t\t// If this position is in the well\n\t\t\t\t\tif (absolute_square_position[1] >= 0 && absolute_square_position[0] >= 0 && absolute_square_position[0] < COLUMNS_NB) {\n\t\t\t\t\t\t// Return false if the bottom limit of the well is reached,\n\t\t\t\t\t\t// or if there already is a square at its position in the matrix\n\t\t\t\t\t\tif (absolute_square_position[1] == ROWS_NB || MATRIX[absolute_square_position[1]][absolute_square_position[0]] != null) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "title": "" } ]
[ { "docid": "ad99dde63a96f2e1bff034cb6ab49486", "score": "0.7744871", "text": "canMoveDown() {\n\t\tlet { world } = control;\n\t\tlet worldItemBelow = world[this.x][this.y + 1];\n\t\tif (this.y === 15) return false;\n\t\treturn worldItemBelow instanceof PassiveActorSolid === false;\n\n\t}", "title": "" }, { "docid": "fbae72887894a61501d5b316398471de", "score": "0.7283721", "text": "canMoveDown(distance) {\n\n let nextYPos = this.yPos + distance;\n let nextXPos = this.xPos;\n\n if (this.isInsidePosition(this.position + 15, nextXPos, nextYPos)) {\n let element = GameElements.elementsPosition.get(this.position + 15);\n if (element.type == Element.TYPE.UNBREAKABLE_WALL\n || element.type == Element.TYPE.BREAKABLE_WALL) {\n return false;\n }\n }\n if (this.isInsidePosition(this.position + 16, nextXPos, nextYPos)) {\n let element = GameElements.elementsPosition.get(this.position + 16);\n if (element.type == Element.TYPE.UNBREAKABLE_WALL\n || element.type == Element.TYPE.BREAKABLE_WALL) {\n return false;\n }\n }\n if (this.isInsideAnyPlayerPosition(nextXPos, nextYPos)) {\n return false;\n }\n if (this.isBlockedByAnyBomb(nextXPos, nextYPos)) {\n return false;\n }\n return true;\n\n }", "title": "" }, { "docid": "69c92a87ae441c7a1cc5da72e1b5c586", "score": "0.72403526", "text": "canMoveUp(distance) {\n\n let nextYPos = this.yPos - distance;\n let nextXPos = this.xPos;\n\n if (this.isInsidePosition(this.position - 15, nextXPos, nextYPos)) {\n let element = GameElements.elementsPosition.get(this.position - 15);\n if (element.type == Element.TYPE.UNBREAKABLE_WALL\n || element.type == Element.TYPE.BREAKABLE_WALL) {\n return false;\n }\n }\n if (this.isInsidePosition(this.position - 14, nextXPos, nextYPos)) {\n let element = GameElements.elementsPosition.get(this.position - 14);\n if (element.type == Element.TYPE.UNBREAKABLE_WALL\n || element.type == Element.TYPE.BREAKABLE_WALL) {\n return false;\n }\n }\n if (this.isInsideAnyPlayerPosition(nextXPos, nextYPos)) {\n return false;\n }\n if (this.isBlockedByAnyBomb(nextXPos, nextYPos)) {\n return false;\n }\n return true;\n\n }", "title": "" }, { "docid": "c6ce8d43a5a5224a26aafb57285fb822", "score": "0.7217913", "text": "canMoveUp() {\n\t\tlet { world } = control;\n\t\tif (this.y === 0) return false;\n\t\tlet worldItem = world[this.x][this.y];\n\t\tlet worldItemUp = world[this.x][this.y - 1];\n\t\tif (this.isOnPassiveActorVertical() && worldItemUp instanceof PassiveActorSolid)\n\t\t\treturn false;\n\t\treturn worldItem instanceof PassiveActorVertical;\n\t}", "title": "" }, { "docid": "d5894f5ede30d405c683637c57a31323", "score": "0.7155271", "text": "function canMove(player) {\n var steps=dies[player]\n getMoves(player, dies[player])\n if (moves.some(e=>e>-1)) {\n states[player]='move'\n return true\n }\n return false;\n}", "title": "" }, { "docid": "6ead2865cb71202f57192b1abdb839d6", "score": "0.7060424", "text": "function canMove(){\n if ( moveHorizontal(this) || moveVertical(this)){\n this.classList.add(\"movablepiece\");\n }\n }", "title": "" }, { "docid": "e0d613f7ecab24c6246df27a9eada56c", "score": "0.7015868", "text": "function hasMoves() {\n for (var x=0;x<cols;x++){\n for (var y=0;y<rows;y++){\n if (canJewelMove(x,y)){\n return true;\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "b0324363bfb3908e69fdc4d004eed3f0", "score": "0.70070785", "text": "function hasMoves() {\n for (var x = 0; x < cls; x++) {\n for (var y = 0; y < rows; y++) {\n if (canJewelMove(x, y)) {\n return true;\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "0ce89f73d55ed269a036d44d700d80ce", "score": "0.6979215", "text": "isDirectionPossible(piece, dir) {\n const next = piece.findNeighbour(dir);\n if (next == undefined) return false;\n return !(next.left || next.right || next.up || next.down); \n }", "title": "" }, { "docid": "549adfefeb45ab11067f70b24d66e6f1", "score": "0.69694525", "text": "function isLegalMove(row, col){\n\tvar out = false;\n\tif(boardstate[row][col] === EMPTY_SPACE){\n\t\tif( boardstate[selectedRow][selectedCol] === RED_KING_SELECTED){\n\t\t\tif((selectedRow + 1) === row && (selectedCol + 1) === col){\n\t\t\t\t//bottom right\n\t\t\t\tout = true;\n\t\t\t\tpieceMove(row, col, RED_KING);\n\t\t\t} else if((selectedRow + 1) === row && (selectedCol - 1) === col){\n\t\t\t\t//bottom left\n\t\t\t\tout = true;\n\t\t\t\tpieceMove(row, col, RED_KING);\n\t\t\t} else if((selectedRow - 1) === row && (selectedCol + 1) === col){\n\t\t\t\t//top right\n\t\t\t\tout = true;\n\t\t\t\tpieceMove(row, col, RED_KING);\n\t\t\t} else if ((selectedRow - 1) === row && (selectedCol - 1) === col){\n\t\t\t\t//top left\n\t\t\t\tout = true;\n\t\t\t\tpieceMove(row, col, RED_KING);\n\t\t\t} else if( (selectedRow + 2) === row && (selectedCol + 2) === col &&\n\t\t\t\t\t\t(boardstate[selectedRow + 1][selectedCol + 1] === BLACK_NORMAL ||\n\t\t\t\t\t\t\tboardstate[selectedRow + 1][selectedCol + 1] === BLACK_KING) ) {\n\t\t\t\t//bottom right jump red piece\n\t\t\t\tout = true;\n\t\t\t\tpieceJump(row, col, selectedRow + 1, selectedCol + 1, RED_KING);\n\t\t\t} else if((selectedRow + 2) === row && (selectedCol - 2) === col &&\n\t\t\t\t\t\t(boardstate[selectedRow + 1][selectedCol - 1] === BLACK_NORMAL ||\n\t\t\t\t\t\t\tboardstate[selectedRow + 1][selectedCol - 1] === BLACK_KING)){\n\t\t\t\t//bottom left jump red piece\n\t\t\t\tout = true;\n\t\t\t\tpieceJump(row, col, selectedRow + 1, selectedCol - 1, RED_KING);\n\t\t\t} else if( (selectedRow - 2) === row && (selectedCol + 2) === col &&\n\t\t\t\t\t\t(boardstate[selectedRow - 1][selectedCol + 1] === BLACK_NORMAL ||\n\t\t\t\t\t\t\tboardstate[selectedRow - 1][selectedCol + 1] === BLACK_KING) ) {\n\t\t\t\t//top right jump red piece\n\t\t\t\tout = true;\n\t\t\t\tpieceJump(row, col, selectedRow - 1, selectedCol + 1, RED_KING);\n\t\t\t} else if((selectedRow - 2) === row && (selectedCol - 2) === col &&\n\t\t\t\t\t\t(boardstate[selectedRow - 1][selectedCol - 1] === BLACK_NORMAL ||\n\t\t\t\t\t\t\tboardstate[selectedRow - 1][selectedCol - 1] === BLACK_KING)){\n\t\t\t\t//top left jump red piece\n\t\t\t\tout = true;\n\t\t\t\tpieceJump(row, col, selectedRow - 1, selectedCol - 1, RED_KING);\n\t\t\t}\n\t\t} else if( boardstate[selectedRow][selectedCol] === BLACK_KING_SELECTED){\n\t\t\tif((selectedRow + 1) === row && (selectedCol + 1) === col){\n\t\t\t\t//bottom right\n\t\t\t\tout = true;\n\t\t\t\tpieceMove(row, col, BLACK_KING);\n\t\t\t} else if((selectedRow + 1) === row && (selectedCol - 1) === col){\n\t\t\t\t//bottom left\n\t\t\t\tout = true;\n\t\t\t\tpieceMove(row, col, BLACK_KING);\n\t\t\t} else if((selectedRow - 1) === row && (selectedCol + 1) === col){\n\t\t\t\t//top right\n\t\t\t\tout = true;\n\t\t\t\tpieceMove(row, col, BLACK_KING);\n\t\t\t} else if ((selectedRow - 1) === row && (selectedCol - 1) === col){\n\t\t\t\t//top left\n\t\t\t\tout = true;\n\t\t\t\tpieceMove(row, col, BLACK_KING);\n\t\t\t} else if( (selectedRow + 2) === row && (selectedCol + 2) === col &&\n\t\t\t\t\t\t(boardstate[selectedRow + 1][selectedCol + 1] === RED_NORMAL ||\n\t\t\t\t\t\t\tboardstate[selectedRow + 1][selectedCol + 1] === RED_KING) ) {\n\t\t\t\t//bottom right jump red piece\n\t\t\t\tout = true;\n\t\t\t\tpieceJump(row, col, selectedRow + 1, selectedCol + 1, BLACK_KING);\n\t\t\t} else if((selectedRow + 2) === row && (selectedCol - 2) === col &&\n\t\t\t\t\t\t(boardstate[selectedRow + 1][selectedCol - 1] === RED_NORMAL ||\n\t\t\t\t\t\t\tboardstate[selectedRow + 1][selectedCol - 1] === RED_KING)){\n\t\t\t\t//bottom left jump red piece\n\t\t\t\tout = true;\n\t\t\t\tpieceJump(row, col, selectedRow + 1, selectedCol - 1, BLACK_KING);\n\t\t\t} else if( (selectedRow - 2) === row && (selectedCol + 2) === col &&\n\t\t\t\t\t\t(boardstate[selectedRow - 1][selectedCol + 1] === RED_NORMAL ||\n\t\t\t\t\t\t\tboardstate[selectedRow - 1][selectedCol + 1] === RED_KING) ) {\n\t\t\t\t//top right jump red piece\n\t\t\t\tout = true;\n\t\t\t\tpieceJump(row, col, selectedRow - 1, selectedCol + 1, BLACK_KING);\n\t\t\t} else if((selectedRow - 2) === row && (selectedCol - 2) === col &&\n\t\t\t\t\t\t(boardstate[selectedRow - 1][selectedCol - 1] === RED_NORMAL ||\n\t\t\t\t\t\t\tboardstate[selectedRow - 1][selectedCol - 1] === RED_KING)){\n\t\t\t\t//top left jump red piece\n\t\t\t\tout = true;\n\t\t\t\tpieceJump(row, col, selectedRow - 1, selectedCol - 1, BLACK_KING);\n\t\t\t}\n\t\t} else if(boardstate[selectedRow][selectedCol] === RED_SELECTED){\n\t\t\tif((selectedRow + 1) === row && (selectedCol + 1) === col){\n\t\t\t\t//bottom right\n\t\t\t\tout = true;\n\t\t\t\tif(row === RED_KING_LINE){\n\t\t\t\t\tpieceMove(row, col, RED_KING);\n\t\t\t\t} else {\n\t\t\t\t\tpieceMove(row, col, RED_NORMAL);\n\t\t\t\t}\n\t\t\t} else if((selectedRow + 1) === row && (selectedCol - 1) === col){\n\t\t\t\t//bottom left\n\t\t\t\tout = true;\n\t\t\t\tif(row === RED_KING_LINE){\n\t\t\t\t\tpieceMove(row, col, RED_KING);\n\t\t\t\t} else {\n\t\t\t\t\tpieceMove(row, col, RED_NORMAL);\n\t\t\t\t}\n\t\t\t} else if( (selectedRow + 2) === row && (selectedCol + 2) === col &&\n\t\t\t\t\t\t(boardstate[selectedRow + 1][selectedCol + 1] === BLACK_NORMAL ||\n\t\t\t\t\t\t\tboardstate[selectedRow + 1][selectedCol + 1] === BLACK_KING) ) {\n\t\t\t\t//bottom right jump red piece\n\t\t\t\tout = true;\n\t\t\t\tif(row === RED_KING_LINE){\n\t\t\t\t\tpieceJump(row, col, selectedRow + 1, selectedCol + 1, RED_KING);\n\t\t\t\t} else {\n\t\t\t\t\tpieceJump(row, col, selectedRow + 1, selectedCol + 1, RED_NORMAL);\n\t\t\t\t}\n\t\t\t} else if((selectedRow + 2) === row && (selectedCol - 2) === col &&\n\t\t\t\t\t\t(boardstate[selectedRow + 1][selectedCol - 1] === BLACK_NORMAL ||\n\t\t\t\t\t\t\tboardstate[selectedRow + 1][selectedCol - 1] === BLACK_KING)){\n\t\t\t\t//bottom left jump red piece\n\t\t\t\tout = true;\n\t\t\t\tif(row === RED_KING_LINE){\n\t\t\t\t\tpieceJump(row, col, selectedRow + 1, selectedCol - 1, RED_KING);\n\t\t\t\t} else {\n\t\t\t\t\tpieceJump(row, col, selectedRow + 1, selectedCol - 1, RED_NORMAL);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if(boardstate[selectedRow][selectedCol] === BLACK_SELECTED){\n\t\t\tif((selectedRow - 1) === row && (selectedCol + 1) === col){\n\t\t\t\t//top right\n\t\t\t\tout = true;\n\t\t\t\tif(row === BLACK_KING_LINE){\n\t\t\t\t\tpieceMove(row, col, BLACK_KING);\n\t\t\t\t} else {\n\t\t\t\t\tpieceMove(row, col, BLACK_NORMAL);\n\t\t\t\t}\n\t\t\t} else if ((selectedRow - 1) === row && (selectedCol - 1) === col){\n\t\t\t\t//top left\n\t\t\t\tout = true;\n\t\t\t\tif(row === BLACK_KING_LINE){\n\t\t\t\t\tpieceMove(row, col, BLACK_KING);\n\t\t\t\t} else {\n\t\t\t\t\tpieceMove(row, col, BLACK_NORMAL);\n\t\t\t\t}\n\t\t\t} else if( (selectedRow - 2) === row && (selectedCol + 2) === col &&\n\t\t\t\t\t\t(boardstate[selectedRow - 1][selectedCol + 1] === RED_NORMAL ||\n\t\t\t\t\t\t\tboardstate[selectedRow - 1][selectedCol + 1] === RED_KING) ) {\n\t\t\t\t//top right jump red piece\n\t\t\t\tout = true;\n\t\t\t\tif(row === BLACK_KING_LINE){\n\t\t\t\t\tpieceJump(row, col, selectedRow - 1, selectedCol + 1, BLACK_KING);\n\t\t\t\t} else {\n\t\t\t\t\tpieceJump(row, col, selectedRow - 1, selectedCol + 1, BLACK_NORMAL);\n\t\t\t\t}\n\t\t\t} else if((selectedRow - 2) === row && (selectedCol - 2) === col &&\n\t\t\t\t\t\t(boardstate[selectedRow - 1][selectedCol - 1] === RED_NORMAL ||\n\t\t\t\t\t\t\tboardstate[selectedRow - 1][selectedCol - 1] === RED_KING)){\n\t\t\t\t//top left jump red piece\n\t\t\t\tout = true;\n\t\t\t\tif(row === BLACK_KING_LINE){\n\t\t\t\t\tpieceJump(row, col, selectedRow - 1, selectedCol - 1, BLACK_KING);\n\t\t\t\t} else {\n\t\t\t\t\tpieceJump(row, col, selectedRow - 1, selectedCol - 1, BLACK_NORMAL);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn out;\n}", "title": "" }, { "docid": "cc2f7fe3530f338854d6cc95fee57592", "score": "0.6947881", "text": "checkCollision(x,y,piece){\r\n for(let r = 0; r < piece.length; r++){\r\n for(let c = 0; c < piece.length; c++){\r\n //if the move is valid\r\n if(!piece[r][c]){\r\n continue;\r\n } //??\r\n\r\n //coordinates of piece after movement\r\n var newX = this.x + c + x;\r\n var newY = this.y + r + y;\r\n \r\n //conditions for collision\r\n //wall boundaries \r\n if(newX < 0 || newX >= COLS || newY >= ROWS){\r\n return true;\r\n }\r\n //to account for new move outside board\r\n if(newY < 0){\r\n continue;\r\n }\r\n //if there is a piece there already\r\n if(this.board[newY][newX] !== VACANT[\"0\"]){\r\n return true;\r\n }\r\n\r\n }\r\n }\r\n //console.log(this.x,this.y, newX, newY);\r\n //console.log(ROWS,COLS);\r\n return false;\r\n\r\n }", "title": "" }, { "docid": "f26f06ae14edf8c816cd0d634b86f919", "score": "0.6944561", "text": "canSpawn() {\n\t\t// Check if each square in the piece's structure can move down, relative to the piece's position in the well\n\t\tfor (var r = 0; r < this.getStructure().length; ++r) {\n\t\t\tfor (var c = 0; c < this.getStructure()[r].length; ++c) {\n\t\t\t\tif (this.getStructure()[r][c] == 1) {\n\t\t\t\t\t// Compute the absolute position of the square\n\t\t\t\t\t// absolute position of the origin of the piece + position of the square in the piece - position of the origin in the piece\n\t\t\t\t\tvar absolute_square_position = [this.absolute_position[0] + c - this.relative_position[0], this.absolute_position[1] + r - this.relative_position[1]];\n\t\t\t\t\t// If this position is in the well\n\t\t\t\t\tif (absolute_square_position[1] >= 0 && absolute_square_position[0] >= 0 && absolute_square_position[0] < COLUMNS_NB) {\n\t\t\t\t\t\t// Return false if there already is a square at its position in the matrix\n\t\t\t\t\t\tif (MATRIX[absolute_square_position[1]][absolute_square_position[0]] != null) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "title": "" }, { "docid": "91283b88cde591c62b6411d4ad3026d6", "score": "0.69277567", "text": "function moveablePiece(pos)\n{\n\tif (checkLeft(BLANK_X, BLANK_Y) === (pos-1))\n\t{\n\t\treturn true;\n\t}\n\n\tif (checkDown(BLANK_X, BLANK_Y) === (pos-1))\n\t{\n\t\treturn true;\n\t}\n\n\tif (checkUp(BLANK_X, BLANK_Y) === (pos-1))\n\t{\n\t\treturn true;\n\t}\n\n\tif (checkRight(BLANK_X, BLANK_Y) === (pos-1))\n\t{\n\t\treturn true;\n}\n}", "title": "" }, { "docid": "1095cc92d677570b22372bdeaf18701a", "score": "0.6907993", "text": "canMove() {\n return this.reserveEnergy >= this.movementEnergy;\n }", "title": "" }, { "docid": "ba02ffd63332242ab85a865bc85bf21d", "score": "0.6844787", "text": "function checkMove(curR,curC,prevR,prevC,holdPiece,color,piece){\n let multiplier = (color == 'black')? -1:1;\n\n const curPiece = piece[0].innerHTML;\n const rdiff = Math.abs(prevR-curR);\n const cdiff = Math.abs(prevC-curC);\n if(isChecked && holdPiece != KING){\n let dangerR,dangerC;\n // identify where the king and aggressor is\n if(whiteMove){\n dangerR = whiteKing[0];\n dangerC = whiteKing[1];\n }\n else{\n dangerR = blackKing[0];\n dangerC = blackKing[1];\n }\n\n let aggresorR = checker[0].className[5];\n let aggresorC = checker[0].className[8];\n let path = [[aggresorR,aggresorC]]; //path from aggresor to checked king\n\n let rd = aggresorR - dangerR;\n let cd = aggresorC - dangerC;\n let i = aggresorR - rd/Math.abs(rd);\n let j = aggresorC - cd/Math.abs(cd);\n while (i != dangerR && j != dangerC){\n if (getBox(aggresorR,aggresorC)[0].innerHTML == KNIGHT || getBox(aggresorR,aggresorC)[0].innerHTML == PAWN) break; // aggressor is pawn or knight path is only to capture\n path.push([i,j]);\n i = i - rd/Math.abs(rd);\n j = j - cd/Math.abs(cd);\n }\n if(!isIn([curR,curC],path)) return false;\n\n }\n switch(holdPiece){\n case PAWN:\n // lol definitely will change later, but good for now 12/20/2020\n // for pawn blocking a checker\n let checkFlag = false;\n let kingR, kingC, danger = false;\n if(whiteMove){\n kingR = whiteKing[0];\n kingC = whiteKing[1];\n }\n else{\n kingR = blackKing[0];\n kingC = blackKing[1];\n }\n\n let diffR = kingR - prevR;\n let diffC = kingC - prevC;\n let incR = diffR/Math.abs(diffR);\n let incC = diffC/Math.abs(diffC);\n console.log(incR);\n console.log(incC);\n if(diffR/diffC === 1 || diffR/diffC === -1){\n // for bishop/queen\n if((prevR-curR == incR) && (prevC-curC == incC)) return true;\n if(curR - incR >= 1 && curR -incR <= 8 && curC - incC >= 1 && curC - incC <=8){\n let cPiece = getBox(prevR - incR, prevC - incC);\n if (cPiece[0].innerHTML == BISHOP || cPiece[0].innerHTML == QUEEN){\n danger = true;\n }\n }\n }\n\n if(!checkFlag){\n // En Passant condition\n if (enPassantAvailable){\n let cPiece = document.getElementsByClassName(\"box r\"+ (prevR) +\" c\" + (curC))\n if (curPiece == '' && cPiece[0].id == 'enPassant' && (curR == 3|| curR==6)){\n cPiece[0].id = '';\n cPiece[0].innerHTML = '';\n cPiece[0].style.color = '';\n return true;\n }\n }\n // when not in the starting square\n if((curR+(multiplier*1))*multiplier < (prevR)*multiplier && !(prevR ==7 || prevR ==2)){\n return false;\n }\n // when capturing\n if(curPiece != '' && !danger){\n if(curR == prevR - 1*multiplier && (curC == prevC + 1 || curC == prevC-1)){\n return true;\n }\n else{\n return false;\n }\n }\n // if going to empty space\n if(curPiece == '' && !danger){\n if((curR+(multiplier*2))*multiplier < (prevR)*multiplier){\n return false;\n }\n if (Math.abs(curR-prevR) == 2) {\n if(enPassantAvailable){\n clearID();\n }\n console.log('en passant available');\n piece[0].id = 'enPassant';\n enPassantAvailable = true;\n roundsEnPassant = 1;\n }\n if(curC != prevC || (curR-prevR)/(Math.abs(curR-prevR)) == multiplier){\n return false;\n }\n else{\n return true;\n }\n }\n }\n break;\n case ROOK:\n if(curC == prevC) \n { \n let i;\n if(rdiff != 0) i = prevR + rdiff/(curR-prevR);\n else i = prevR;\n // check the path if it's being blocked\n while(i != curR){\n let cPiece = document.getElementsByClassName(\"box r\"+ i +\" c\" + curC );\n if (cPiece[0].innerHTML != '') return false;\n i = i + rdiff/(curR-prevR);\n }\n if(whiteMove){\n if(prevC == 1){\n castlingAvailable[0] = false;\n }\n if(prevC == 8){\n castlingAvailable[1] = false;\n }\n }\n else{\n if(prevC == 1){\n castlingAvailable[2] = false;\n }\n if(prevC == 8){\n castlingAvailable[3] = false;\n }\n }\n return true;\n }\n if(curR == prevR){\n let i = prevC + cdiff/(curC-prevC);\n // check the path if it's being blocked\n while(i != curC){\n const cPiece = document.getElementsByClassName(\"box r\"+ curR +\" c\" + i );\n if (cPiece[0].innerHTML != '') return false;\n i = i + cdiff/(curC-prevC);\n }\n if(whiteMove){\n if(prevC == 1){\n castlingAvailable[0] = false;\n }\n if(prevC == 8){\n castlingAvailable[1] = false;\n }\n }\n else{\n if(prevC == 1){\n castlingAvailable[2] = false;\n }\n if(prevC == 8){\n castlingAvailable[3] = false;\n }\n }\n return true;\n }\n break;\n case KNIGHT:\n if(((curR != prevR) && (curC != prevC)) &&(rdiff+cdiff == 3)){\n return true;\n }\n break;\n case BISHOP:\n // see if diagonal\n if ((rdiff/cdiff) == 1){\n let i = prevR + rdiff/(curR-prevR);\n let j = prevC + cdiff/(curC-prevC);\n // check the path if it's being blocked\n while(i != curR && j != curC){\n const cPiece = document.getElementsByClassName(\"box r\"+ i +\" c\" + j );\n if (cPiece[0].innerHTML != '') return false;\n i = i + rdiff/(curR-prevR);\n j = j + cdiff/(curC-prevC); \n }\n return true;\n }\n break;\n case KING:\n // will refactor castling later\n if (prevC - curC == 2 && prevR == curR && !isChecked && !willBeChecked(curR,2,color) && !willBeChecked(curR,3,color) && !willBeChecked(curR,4,color)){\n // left castling\n let bet1 = document.getElementsByClassName(\"box r\"+ curR +\" c\" + 2);\n let bet2 = document.getElementsByClassName(\"box r\"+ curR +\" c\" + 3);\n let bet3 = document.getElementsByClassName(\"box r\"+ curR +\" c\" + 4);\n if (bet1[0].innerHTML != '') return false;\n if (bet2[0].innerHTML != '') return false;\n if (bet3[0].innerHTML != '') return false;\n let rook = document.getElementsByClassName(\"box r\"+ curR +\" c\" + 1);\n let des = document.getElementsByClassName(\"box r\"+ curR +\" c\" + 4);\n if (whiteMove){\n let res = castlingAvailable[0];\n castlingAvailable[0] = false;\n castlingAvailable[1] = false;\n if(res){\n des[0].innerHTML = rook[0].innerHTML;\n des[0].style.color = rook[0].style.color;\n rook[0].innerHTML = '';\n rook[0].style.color = '';\n whiteKing = [curR, curC];\n }\n return res;\n }\n else{\n let res = castlingAvailable[2];\n castlingAvailable[3] = false;\n castlingAvailable[2] = false;\n if(res){\n des[0].innerHTML = rook[0].innerHTML;\n des[0].style.color = rook[0].style.color;\n rook[0].innerHTML = '';\n rook[0].style.color = '';\n blackKing = [curR, curC];\n }\n return res;\n }\n }\n else if(prevC - curC == -2 && prevR == curR && !isChecked && !willBeChecked(curR, 6, color) && !willBeChecked(curR, 7, color)){\n //right castling\n let bet1 = document.getElementsByClassName(\"box r\"+ curR +\" c\" + 6);\n let bet2 = document.getElementsByClassName(\"box r\"+ curR +\" c\" + 7);\n if (bet1[0].innerHTML != '') return false;\n if (bet2[0].innerHTML != '') return false;\n let rook = document.getElementsByClassName(\"box r\"+ curR +\" c\" + 8 );\n let des = document.getElementsByClassName(\"box r\"+ curR +\" c\" + 6);\n if(whiteMove){\n let res = castlingAvailable[1];\n castlingAvailable[0] = false;\n castlingAvailable[1] = false;\n if(res){\n des[0].innerHTML = rook[0].innerHTML;\n des[0].style.color = rook[0].style.color;\n rook[0].innerHTML = '';\n rook[0].style.color = '';\n whiteKing = [curR, curC];\n }\n return res;\n\n }\n else{\n let res = castlingAvailable[3]\n castlingAvailable[3] = false;\n castlingAvailable[2] = false;\n if(res){\n des[0].innerHTML = rook[0].innerHTML;\n des[0].style.color = rook[0].style.color;\n rook[0].innerHTML = '';\n rook[0].style.color = '';\n blackKing = [curR, curC];\n }\n return res;\n }\n }\n if(rdiff <= 1 && cdiff <= 1 && !willBeChecked(curR,curC,color)){\n if(whiteMove){\n castlingAvailable[0] = false;\n castlingAvailable[1] = false;\n whiteKing = [curR, curC];\n }\n else{\n castlingAvailable[2] = false;\n castlingAvailable[3] = false;\n blackKing = [curR, curC];\n }\n return true;\n }\n break;\n case QUEEN:\n // combination of rook and bishop checks\n return (checkMove(curR,curC,prevR,prevC,ROOK,color,piece) || checkMove(curR,curC,prevR,prevC,BISHOP,color,piece));\n break;\n }\n return false;\n}", "title": "" }, { "docid": "fc59b390d5ede0a1afdfb9b00a6421a6", "score": "0.68281376", "text": "function checkMoveLegality(r0,f0,r1,f1) {\n\tif (r0 > 7 || f0 > 7 || r1 > 7 || f1 > 7 || r0 < 0 || f0 < 0 || r1 < 0 || f1 < 0) {\n\t\tconsole.log(\"Outside bounds\");\n\t\treturn false;\n\t}else if (r0 == r1 && f0 == f1) {\n\t\tconsole.log(\"No move\");\n\t\treturn false;\n\t}else {\n\t\t//Check legal moves of each piece\n\t\tvar curP = board[r0][f0]\n\t\t//Check turn\n\t\tif (nextPlayer != curP.color) {\n\t\t\treturn false;\n\t\t}\n\t\t//Pawn\n\t\tif (curP.pieceType == \"P\") {\n\t\t\tvar legal = checkPawmMoveLegality(r0,f0,r1,f1);\n\t\t\tif (legal == false) {\n\t\t\t\treturn false;\n\t\t\t}else if (typeof legal === 'string') {\n\t\t\t\treturn legal;\n\t\t\t}else if (r1 == 0 || r1 == 7) {\n\t\t\t\treturn \"promotion\";\n\t\t\t}\n\t\t}\n\t\telse if (curP.pieceType == \"R\") {\n\t\t\tif (!rookReachable(r0,f0,r1,f1)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\telse if (curP.pieceType == \"B\") {\n\t\t\tif (!bishopReachable(r0,f0,r1,f1)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse if (curP.pieceType == \"Q\") {\n\t\t\tif (!bishopReachable(r0,f0,r1,f1) && !rookReachable(r0,f0,r1,f1)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse if (curP.pieceType == \"N\") {\n\t\t\tif (!knightReachable(r0,f0,r1,f1)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse if (curP.pieceType == \"K\") {\n\t\t\tif (!kingReachable(r0,f0,r1,f1)) {\n\t\t\t\tif (checkCastleLegality(r0,f0,r1,f1)) {\n\t\t\t\t\tconsole.log(\"legal\");\n\t\t\t\t\treturn \"castle\";\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\t//Check if there is a piece there.\n\tif (board[r1][f1]) {\n\t\tif (board[r0][f0].color == board[r1][f1].color) {\n\t\t\tconsole.log(\"Can't capture your own piece!\");\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "4076d9b0410b0696c59eed105a946ec6", "score": "0.6811689", "text": "function canBearOff() {\n\tif (!GameState.turn) {\n\t\tfor (var i = 6; i < GameState.board.triangles.length; i++) {\n\t\t\tif (GameState.board.triangles[i].indexOf(GameState.turn) != -1) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfor (var i = 0; i < GameState.board.triangles.length - 6; i++) {\n\t\t\tif (GameState.board.triangles[i].indexOf(GameState.turn) != -1) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\tif (GameState.board.bar.indexOf(GameState.turn) != -1) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "78aca79523383e56ace7eb4859d3400c", "score": "0.6791258", "text": "drop() {\n if(this.valid(0, 1, this.piece)) {\n this.piece.y++;\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "4304424335838c353a071acf2ffed469", "score": "0.6787512", "text": "checkCollision(x,y,piece){\r\n for(let r = 0; r < piece.length; r++){\r\n for(let c = 0; c < piece.length; c++){\r\n //if the move is valid\r\n if(!piece[r][c]){\r\n continue;\r\n } //??\r\n\r\n //coordinates of piece after movement\r\n let newX = this.x + c + x;\r\n let newY = this.y + r + y;\r\n \r\n //conditions for collision\r\n //wall boundaries \r\n if(newX < 0 || newX >= COLS || newY >= ROWS){\r\n return true;\r\n }\r\n //to account for new move outside board\r\n if(newY < 0){\r\n return true;\r\n }\r\n //if there is a piece there already\r\n if(this.board[newX][newY] == 1){\r\n return true;\r\n }\r\n\r\n }\r\n }\r\n return false;\r\n\r\n }", "title": "" }, { "docid": "4f36567882d29cc62a117f5d6329050c", "score": "0.6775419", "text": "function canMove(x, y){\r\n\treturn (y>=0) && (y<board.length) && (x >= 0) && (x < board[y].length) && (board[y][x] != 1);\r\n}", "title": "" }, { "docid": "33ffdf1353329d6ae85581dc3e704192", "score": "0.6767428", "text": "hasCorrectPiece() {\n // Slot has correct piece if the target piece is located within the target area\n var pp = this.targetPiece.boardPosition;\n return ( pp.left == this.targetArea.left && pp.top == this.targetArea.top );\n }", "title": "" }, { "docid": "96ab40a5f06a6a1f2622aef13f85066e", "score": "0.6744497", "text": "isMoveValid(piece, x, y) {\r\n let { board, moves } = this;\r\n\r\n //Check location is within board\r\n if (x < 0 || x >= board[0].length || y < 0 || y >= board.length) {\r\n return false;\r\n }\r\n\r\n if (board.length === 1 && board[0].length === 1) {\r\n return true;\r\n }\r\n\r\n //Spot must be open\r\n if (board[y][x].isOccupied()) {\r\n return false;\r\n }\r\n\r\n //Make sure it is next to another piece (Not Diagonal)\r\n var adjacentPieces = [];\r\n if ((y - 1) >= 0 && board[y - 1][x].isOccupied()) {\r\n adjacentPieces.push(board[y - 1][x]);\r\n }\r\n if ((y + 1) < board.length && board[y + 1][x].isOccupied()) {\r\n adjacentPieces.push(board[y + 1][x]);\r\n }\r\n if ((x - 1) >= 0 && board[y][x - 1].isOccupied()) {\r\n adjacentPieces.push(board[y][x - 1]);\r\n }\r\n if ((x + 1) < board[0].length && board[y][x + 1].isOccupied()) {\r\n adjacentPieces.push(board[y][x + 1]);\r\n }\r\n\r\n if (adjacentPieces.length === 0) {\r\n return false;\r\n }\r\n\r\n //Make sure this doesn't put 7 pieces in a row\r\n var horizontalRow = [piece];\r\n var verticalRow = [piece];\r\n let tempX= x + 1\r\n while (tempX < board[0].length && board[y][tempX].isOccupied()) {\r\n horizontalRow.push(board[y][tempX])\r\n tempX++;\r\n }\r\n tempX = x - 1;\r\n while (tempX >= 0 && board[y][tempX].isOccupied()) {\r\n horizontalRow.push(board[y][tempX])\r\n tempX--;\r\n }\r\n\r\n let tempY= y + 1\r\n while (tempY < board.length && board[tempY][x].isOccupied()) {\r\n verticalRow.push(board[tempY][x])\r\n tempY++;\r\n }\r\n tempY = y - 1;\r\n while (tempY >= 0 && board[tempY][x].isOccupied()) {\r\n verticalRow.push(board[tempY][x])\r\n tempY--;\r\n }\r\n\r\n if (horizontalRow.length > 6 || verticalRow.length > 6) {\r\n return false;\r\n }\r\n\r\n //Make sure this is part of the same row being played\r\n if (moves.length > 0) {\r\n var checkHorizontally = true;\r\n var checkVertically = true;\r\n var inPlay = false;\r\n\r\n if (moves.length > 1) {\r\n if (moves[0][0] === moves[1][0]) {\r\n checkHorizontally = false;\r\n }\r\n if (moves[0][1] === moves[1][1]) {\r\n checkVertically = false;\r\n }\r\n }\r\n\r\n if (checkHorizontally) { //board[y].length\r\n let tempX = x;\r\n while ( tempX - 1 >= 0 && board[y][tempX - 1].isOccupied()) {\r\n tempX--;\r\n if (arrayContains(moves,[tempX,y])) {\r\n inPlay = true;\r\n }\r\n }\r\n\r\n tempX = x;\r\n while ( tempX + 1 < board[y].length && board[y][tempX + 1].isOccupied()) {\r\n tempX++;\r\n if (arrayContains(moves,[tempX,y])) {\r\n inPlay = true;\r\n }\r\n }\r\n }\r\n\r\n if (checkVertically) {\r\n let tempY = y;\r\n while ( tempY - 1 >= 0 && board[tempY - 1][x].isOccupied()) {\r\n tempY--;\r\n if (arrayContains(moves,[x,tempY])) {\r\n inPlay = true;\r\n }\r\n }\r\n\r\n tempY = y;\r\n while ( tempY + 1 < board.length && board[tempY + 1][x].isOccupied()) {\r\n tempY++;\r\n if (arrayContains(moves,[x,tempY])) {\r\n inPlay = true;\r\n }\r\n }\r\n }\r\n\r\n if (!inPlay) {\r\n return false;\r\n }\r\n }\r\n\r\n //See if we need to do color and shape tests\r\n if (!piece.isOccupied()) {\r\n return true;\r\n }\r\n\r\n //Check that play doesn't break the shape/color rules\r\n if (!this.isRowValid(horizontalRow)) {\r\n return false;\r\n }\r\n if (!this.isRowValid(verticalRow)) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "title": "" }, { "docid": "b09da074b44e8dad0d25e40c33fcc32e", "score": "0.67311484", "text": "lost() {\n assertParameters(arguments);\n \n // if (--this._maxMoves <= 0) return true;\n \n if (this.numberOpen() > 0) return false;\n \n for (let dir = 0; dir < 6; dir++) {\n const result = this.collapse(dir);\n \n // If collapsing in a direction changes board, then it means can move\n if (result.changed) return false;\n }\n \n return true;\n }", "title": "" }, { "docid": "6d7a5c2b1b78262f1354ed297e64f1b0", "score": "0.67055434", "text": "function canMove(x, y){\n return (y>=0) && (y<board.length) && (x >= 0) && (x < board[y].length) && (board[y][x] != 1);\n}", "title": "" }, { "docid": "1820751a9627fd9054044771a7de6c94", "score": "0.6692317", "text": "function canJewelMove(x,y) {\n return (( x > 0 && canSwap(x, y, x-1, y)) ||\n ( x < cols - 1 && canSwap(x,y,x,y-1)) ||\n (y > 0 && canSwap(x,y,x,y-1)) ||\n (y < rows - 1 && canSwap(x,y,x,y+1)));\n }", "title": "" }, { "docid": "6a2f5bc834cc3084cae279c492d1dd96", "score": "0.66668946", "text": "move_okay(cell) {\n\t\tif (!(cell.hasClass(\"brick\")) && \n\t\t\t(!(cell.hasClass(\"door\")) || (this.path_out.length > 0))) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "119fe48647d1f8da843755c58e00154f", "score": "0.6659154", "text": "function checkMove(piece, board, newX, newY) {\n // Check for conditions where the proposed move fails\n for (const e of piece.coords) {\n const x = e[0] + newX;\n const y = e[1] + newY;\n // The move fails when any part of the piece goes outside of the board\n if (x < 0 || x >= Constants.numColInBoard || y < 0 || y >= Constants.numRowInBoard) {\n return false;\n }\n // The move fails when there is another block occupying the same place\n if (board[y][x] !== Constants.TetrominoShape.NoShape) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "fee5d14d8d25c9a7cbbf98faf82872ff", "score": "0.6616932", "text": "isColliding(){\n if(this.loc.x>paddle.loc.x &&\n this.loc.x<paddle.loc.x + paddle.w &&\n this.loc.y>paddle.loc.y &&\n this.loc.y<paddle.loc.y + paddle.h){\n return true;\n }else{\n return false;\n }\n }", "title": "" }, { "docid": "9c187727db0ce54ec34d071977c0f704", "score": "0.6609488", "text": "function canDrag(row, col) {\n var delta = {row: row, col: col};\n var rotatedDelta = rotate(delta);\n\n if (!$scope.isDarkCell(row, col) || !checkersLogicService.isOwnColor($scope.yourPlayerIndex, $scope.board[rotatedDelta.row][rotatedDelta.col].substr(0, 1))) {\n return false;\n }\n\n var hasMandatoryJump = checkersLogicService.hasMandatoryJumps($scope.board, $scope.yourPlayerIndex);\n var possibleMoves;\n\n if (hasMandatoryJump) {\n possibleMoves = checkersLogicService\n .getJumpMoves($scope.board, rotatedDelta, $scope.yourPlayerIndex);\n } else {\n possibleMoves = checkersLogicService\n .getSimpleMoves($scope.board, rotatedDelta, $scope.yourPlayerIndex);\n }\n\n return possibleMoves.length > 0;\n }", "title": "" }, { "docid": "c1a8961db0942dc12986e218c5dad242", "score": "0.65963197", "text": "function testY(thisPiece){\r\n\t\tif ( parseInt(thisPiece.style.top) == emptyY){\r\n\t\t\tif (parseInt(thisPiece.style.left) == (emptyX - PIECE_SIZE) || parseInt(thisPiece.style.left) == (emptyX + PIECE_SIZE)){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "e042555b55bef43171cb5bcdc5f8361d", "score": "0.6579102", "text": "function isMoveable(tile){\n\t\tif(tile.style.top == empty_pos[0] || tile.style.left == empty_pos[1])\t\n\t\t{\n\t\t\tvar x = parseInt(empty_pos[0].slice(0, (empty_pos[0].length -2)));\n\t\t\tvar y = parseInt(empty_pos[1].slice(0, (empty_pos[1].length -2)));\n\t\t\n\t\t\tif( (x +99) + \"px\" == tile.style.top || (x - 99) + \"px\" == tile.style.top)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\t\n\t\t\tif( (y +100) + \"px\" == tile.style.left || (y - 100) + \"px\" == tile.style.left)\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "3d1096ea31d6b1c0b6d425756d1c2cba", "score": "0.6578819", "text": "function playerMoved(x, y){\r\n if (x == protectorBoardState[0].pawnPos[0] && y == protectorBoardState[0].pawnPos[1]) {\r\n return false;\r\n };\r\n\r\n for (var i = -1; i < 2; i++) {\r\n for (var j = -1; j < 2; j++) {\r\n if (y + j == protectorBoardState[0].pawnPos[1] && \r\n x + i == protectorBoardState[0].pawnPos[0]) {\r\n return true;\r\n };\r\n };\r\n };\r\n return false;\r\n}", "title": "" }, { "docid": "0a5534e61fde4287fe171f125d9d8310", "score": "0.65745264", "text": "function CanPutPiece(x, y) \r\n{\t \r\n //si no es tu turno no puedes poner\r\n if (!yourTurn)\r\n {\r\n\t\treturn false;\r\n }\r\n \r\n //si la casilla no esta vacia no puedes poner\r\n if (board[x][y].player != NONE)\r\n {\r\n\t\treturn false;\t\t\r\n }\r\n \r\n //puedes poner si es tu turno, la casilla esta vacia y al poner capturarias al menos una pieza rival\r\n return (NumFlips(x, y, role) > 0);\r\n}", "title": "" }, { "docid": "446a322e1b2e02b982459dde5872bd27", "score": "0.6567885", "text": "function canHeroMove(bHero,aHero) {\nvar speed=bHero.bType.speed;\n\n //up-down\n if(bHero.bX==aHero.bX) \n {\n //up -- if before position - after position < rects height * hero's speed => move\n if(bHero.bY>aHero.bY && \n bHero.bY-aHero.bY < bHero.bHeight*speed+Constants.differentiateOfCoordinatesDueToStroke) {\n return true;\n }\n //down -- if after position - before position < rects height*hero's speed => move\n else if(bHero.bY<aHero.bY && \n aHero.bY-bHero.bY < bHero.bHeight*speed+Constants.differentiateOfCoordinatesDueToStroke) {\n return true;\n }\n }\n //right-left \n else if(bHero.bY==aHero.bY) {\n //right\n if(bHero.bX<aHero.bX &&\n aHero.bX<bHero.bX+(bHero.bWidth*speed)+Constants.differentiateOfCoordinatesDueToStroke) {\n return true;\n }\n //left\n else if(bHero.bX>aHero.bX &&\n bHero.bX<aHero.bX+(bHero.bWidth*speed)+Constants.differentiateOfCoordinatesDueToStroke) {\n return true;\n }\n } \n else {\n return false;\n }\n}", "title": "" }, { "docid": "aeb03cb2ce734b22b74bf2f246360e40", "score": "0.6567059", "text": "canMoveRight() {\n\t\t// Check if each square in the piece's structure can move right, relative to the piece's position in the well\n\t\tfor (var r = 0; r < this.getStructure().length; ++r) {\n\t\t\tfor (var c = 0; c < this.getStructure()[r].length; ++c) {\n\t\t\t\tif (this.getStructure()[r][c] == 1) {\n\t\t\t\t\t// Compute the absolute position of the square\n\t\t\t\t\t// absolute position of the origin of the piece + position of the square in the piece - position of the origin in the piece\n\t\t\t\t\tvar absolute_square_position = [this.absolute_position[0] + c - this.relative_position[0], this.absolute_position[1] + r - this.relative_position[1]];\n\t\t\t\t\t// Add 1 to the horizontal position of the square (like a right move)\n\t\t\t\t\tabsolute_square_position[0]++;\n\t\t\t\t\t// Return false if the right limit of the well is reached,\n\t\t\t\t\t// or if there already is a square at its position in the matrix if this position is in the well\n\t\t\t\t\tif (absolute_square_position[0] == COLUMNS_NB\n\t\t\t\t\t|| (absolute_square_position[1] >= 0 && absolute_square_position[0] >= 0 && absolute_square_position[0] < COLUMNS_NB\n\t\t\t\t\t\t&& MATRIX[absolute_square_position[1]][absolute_square_position[0]] != null)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "title": "" }, { "docid": "bd81f34e737a980a6ebe7be5057e4c33", "score": "0.65537316", "text": "function admissiblePlacementFor(this, piece){\r\n for (other in this.pieces)\r\n if ((other != piece) \r\n && other.attacks(piece)\r\n || piece.attacks(other))\r\n return false; \r\n \r\n }", "title": "" }, { "docid": "b3e156f79f4e539a5d0c070214c6bac6", "score": "0.6552648", "text": "function canMoveUp2Step(board, target) {\n ['W', 'E', 'CW', 'CCW'].find(\n d => {\n var moved = target.move(d);\n return board.isValidPosition(moved) &&\n canMoveUp(board, target.move(d))\n })\n}", "title": "" }, { "docid": "6493ce44cd2709791455427305e20e19", "score": "0.6551316", "text": "function canWalkHere(x, y)\n {\n return (Dungeon.getCell(x,y) > 1 );\n }", "title": "" }, { "docid": "f254366baf35d17456e0ecbe7a6669e3", "score": "0.65509456", "text": "function canMoveUp(board, target) {\n // a bad heuristic the target can be reached: that the unit can move at\n // least somewhere UP from this position.\n ['SW', 'SE'].find(\n d => board.isValidPosition(target.move(d)))\n}", "title": "" }, { "docid": "f0f846db482e3c6dbb44e2c82ce744b4", "score": "0.6542488", "text": "function canJewelMove(x,y) {\n return ((x>0 && canSwap(x,y,x-1,y)) ||\n (x<cols-1 && canSwap(x,y,x+1,y)) ||\n (y>0 && canSwap(x,y,x,y-1)) ||\n (y<rows-1 && canSwap(x,y,x,y+1))\n );\n }", "title": "" }, { "docid": "8d249c5c3771c602e18461e9244ab787", "score": "0.654209", "text": "function testMovement(p, well, offsetRow, offsetCol) {\n let newP = Util.clone(p);\n newP.row += offsetRow;\n newP.col += offsetCol;\n\n if (!Util.collision(newP, well)) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "6f4612f81bc87fa08060c4f62ff03dd1", "score": "0.65414315", "text": "isOffBoard() {\n let [x, y] = this.position\n\n return (\n x < 0 || y < 0 || x > this.height - 1 || y > this.width - 1\n )\n }", "title": "" }, { "docid": "143e5c447ddbc3105e9932ad9ee45de8", "score": "0.65372664", "text": "canPlace(piece, x, y) {\n\t\tfor (let tile of piece.tiles) {\n\t\t\tconst tx = x + tile.relX;\n\t\t\tconst ty = y + tile.relY;\n\t\t\t// Check in bounds\n\t\t\tif (tx < 0 || ty < 0 || tx >= GRID_W || ty >= GRID_H) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// Check current tiles\n\t\t\tif (this.tileAt(tx, ty, piece)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t// No issue!\n\t\treturn true;\n\t}", "title": "" }, { "docid": "3f56d2d6b9f62d996e0016abf2beb90c", "score": "0.6531301", "text": "valid(move: Move): boolean {\n const moves = this.genMoves(); // generator\n let el = moves.next();\n while (!el.done) {\n if (move[0] === el.value[0] && move[1] === el.value[1]) {\n const nextPos = this.move(move);\n const nextMoves = nextPos.genMoves();\n let nextEl = nextMoves.next();\n while (!nextEl.done) {\n // check if the move was an invalid castle\n if (nextPos.kp !== -1 && Math.abs(nextEl.value[1] - nextPos.kp) < 2) {\n return false;\n }\n // check if the move results in king being taken\n const tp = nextPos.board[nextEl.value[1]];\n if (tp !== null && 'Kk'.includes(tp)) return false;\n nextEl = nextMoves.next();\n }\n // if it passed all the tests, return true\n return true;\n }\n el = moves.next();\n }\n return false;\n }", "title": "" }, { "docid": "283d82fb122a81415709f090a4f317df", "score": "0.6530742", "text": "isNextActionValid(action, world, pile) {\n let self = this;\n let y = self._y;\n let x = self._x;\n let color = self._color;\n let shape = self._pieceMatrixShape;\n\n switch (action) {\n case 'MOVE_DOWN':\n y = y + 1;\n break;\n\n case 'MOVE_LEFT':\n x = x - 1;\n break;\n\n case 'MOVE_RIGHT':\n x = x + 1;\n break;\n\n case 'ROTATE':\n shape = Piece._rotateMatrix(shape);\n break;\n }\n\n let futurePieceBlocks = Piece._castToBlockSet(shape, x,y, color);\n let pileBlocks = pile.getBlocks();\n let worldBlocks = world.getBlocks();\n\n let isPileTouchingPiece = futurePieceBlocks.filter(pieceElem => {\n // is there a block inside piece and pile\n let intersectingElements = pileBlocks.filter(pileElem =>\n pileElem.getX() == pieceElem.getX() && pileElem.getY() == pieceElem.getY());\n\n return intersectingElements.length > 0;\n }).length > 0;\n\n\n let elementNotInPieceNotInWorld = futurePieceBlocks.filter(pieceElem => {\n let outsideElem = worldBlocks.filter(worldElem =>\n worldElem.getX() == pieceElem.getX() && worldElem.getY() == pieceElem.getY());\n return outsideElem.length == 0;\n });\n let isThePieceContainedInTheWorld = elementNotInPieceNotInWorld.length == 0;\n\n return !isPileTouchingPiece && isThePieceContainedInTheWorld;\n }", "title": "" }, { "docid": "5baa2bd729c95053ba310176afafdef2", "score": "0.65246564", "text": "function occupied(piece, x, y, dir) {\n var result = false;\n eachblock(piece.type, x, y, dir, function(x, y) {\n if ((x < 0) || (x >= nx) || (y < 0) || (y >= ny) ||\n getBlock(x,y) || occupiedPlayerBlock(x, y, piece.pid)) {\n result = true;\n }\n });\n\n return result;\n }", "title": "" }, { "docid": "c191497546c06f1e82015ae0e95cb993", "score": "0.6513875", "text": "smart_move() {\n\t\tlet pacman_position = this.getPosition(\"pacman\");\n\t\tif ((this.x < pacman_position.x) && (!this.exclude_directions[this.toOrAway(\"down\")])) {\n\t\t\tthis.exclude_directions[this.toOrAway(\"down\")] = true;\n\t\t\treturn this.toOrAway(\"down\");\n\t\t} else if ((this.x > pacman_position.x) && (!this.exclude_directions[this.toOrAway(\"up\")])) {\n\t\t\tthis.exclude_directions[this.toOrAway(\"up\")] = true;\n\t\t\treturn this.toOrAway(\"up\");\n\t\t} else if ((this.y < pacman_position.y) && (!this.exclude_directions[this.toOrAway(\"right\")])) {\n\t\t\tthis.exclude_directions[this.toOrAway(\"right\")] = true;\n\t\t\treturn this.toOrAway(\"right\");\n\t\t} else if (!this.exclude_directions[this.toOrAway(\"left\")]){\n\t\t\tthis.exclude_directions[this.toOrAway(\"left\")] = true;\n\t\t\treturn this.toOrAway(\"left\");\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "3930bdfd7d72d73e73136501dda436af", "score": "0.6512244", "text": "function checkCollapseNoWeapon () { // function to know if the monster have reach the spaceShip\n \n var listeMonster = level();\n \n for(var i=0; i<listeMonster.length; i++){\n if ((listeMonster[i].y >= spaceShip.y+canvas.height*0.02)) { // if the coordinates of one of the monster\n if (listeMonster[i].x >= spaceShip.x-canvas.width*0.02) {// are the same than the monster\n return (true)\n }\n } else {\n return(false)\n }\n }\n}", "title": "" }, { "docid": "48e5e264e7fcc221e9686fddbd6036b0", "score": "0.6498898", "text": "canEvilBeStuck() {\n\t\tlet { x, y } = this;\n\t\tlet { brokenBricks } = control.state;\n\t\tfor (const brick of brokenBricks) {\n\t\t\tif (brick.x === x && brick.y === y + 1) return true;\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "0c778b40452a53e77d418cbf199765d0", "score": "0.64988637", "text": "isInCheck(row, column, board, ignoreSameSide) {\n let result = false\n\n board.forEach(r => {\n r.forEach(piece => {\n if (piece && (piece.side !== this.side && piece.canMove(board, row, column, true, ignoreSameSide))) {\n /* console.log(\"The king would be in check and the piece that can eat him is:\", piece) */\n result = true\n }\n })\n })\n\n return result\n }", "title": "" }, { "docid": "92df5f43d3b37a5a9cf1e1ae46429192", "score": "0.6493834", "text": "function move(piece, newr, newc) {\r\n // get old position\r\n var oldr = null;\r\n var oldc = null;\r\n for (var r = 0; r < board.length; r++) {\r\n for (var c = 0; c < board[r].length; c++) {\r\n if (board[r][c] === piece) {\r\n oldr = r;\r\n oldc = c;\r\n }\r\n }\r\n }\r\n console.log(\"old position \" + piece + \" \" + oldr + \" \" + oldc);\r\n console.log(\"new position \" + piece + \" \" + newr + \" \" + newc);\r\n console.log(Math.abs(newr - oldr) + \" row \" + Math.abs(newc - oldc) + \" coloumn \" );\r\n\r\n // check if move is legal\r\n\r\n if (!legalMove(piece, oldr, oldc, newr, newc)) {\r\n notify();\r\n return;\r\n }\r\n\r\n function legalMove(piece, oldr, oldc, newr, newc) {\r\n if (piece.indexOf(player) === -1) {\r\n return false;\r\n }\r\n var pieceType = null;\r\n if (piece.indexOf(\"Pawn\") >= 0) {\r\n pieceType = \"Pawn\";\r\n }\r\n if (piece.indexOf(\"Rook\") >= 0) {\r\n pieceType = \"Rook\";\r\n }\r\n if (piece.indexOf(\"Bishop\") >= 0) {\r\n pieceType = \"Bishop\";\r\n }\r\n if (piece.indexOf(\"Knight\") >= 0) {\r\n pieceType = \"Knight\";\r\n }\r\n if (piece.indexOf(\"Queen\") >= 0) {\r\n pieceType = \"Queen\";\r\n }\r\n if (piece.indexOf(\"King\") >= 0) {\r\n pieceType = \"King\";\r\n }\r\n\r\n if (pieceType === \"Pawn\") {\r\n //pawn\r\n if (Math.abs(newc - oldc) === 0) {\r\n // we stay in the same column\r\n console.log(\"--Pawn Move Played--\");\r\n // allow only one step\r\n if (Math.abs(newr - oldr) === 1) {\r\n return true;\r\n }\r\n }\r\n else if (Math.abs(newc - oldc) === 1) {\r\n // we move only one column\r\n console.log(\"capture was made\");\r\n if (Math.abs(newr - oldr) === 1) {\r\n // we only go one down or up\r\n return true;\r\n }\r\n }\r\n }\r\n else if (pieceType === \"Rook\") {\r\n if (Math.abs(newr - oldr) === 0 && Math.abs(newc - oldc) || Math.abs(newr - oldr) && Math.abs(newc - oldc) === 0) {\r\n console.log(\"--rook Move Played--\");\r\n return true;\r\n }\r\n }\r\n else if (pieceType === \"Bishop\") {\r\n if (Math.abs(newr - oldr) === Math.abs(newc - oldc)) {\r\n console.log(\"--bishop Move Played--\");\r\n return true;\r\n }\r\n }\r\n else if (pieceType === \"Knight\") {\r\n if (Math.abs(newr - oldr) === 2 && Math.abs(newc - oldc) === 1 || Math.abs(newr - oldr) === 1 && Math.abs(newc - oldc) === 2) {\r\n console.log(\"--knight Move Played--\");\r\n return true;\r\n }\r\n }\r\n else if (pieceType === \"Queen\") {\r\n if (Math.abs(newr - oldr) === Math.abs(newc - oldc) || Math.abs(newr - oldr) === 0 && Math.abs(newc - oldc) || Math.abs(newr - oldr) && Math.abs(newc - oldc) === 0) {\r\n console.log(\"--queen Move Played--\");\r\n return true;\r\n }\r\n }\r\n else if (pieceType === \"King\") {\r\n if (Math.abs(newr - oldr) === 1 && Math.abs(newc - oldc) === 0 || Math.abs(newr - oldr) === 0 && Math.abs(newc - oldc) === 1 || Math.abs(newr - oldr) === 1 && Math.abs(newc - oldc) === 1) {\r\n console.log(\"--king Move Played--\");\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n\r\n // delete the piece from the old position\r\n for (var r = 0; r < board.length; r++) {\r\n for (var c = 0; c < board[r].length; c++) {\r\n if (board[r][c] === piece) {\r\n board[r][c] = null;\r\n }\r\n }\r\n }\r\n board[newr][newc] = piece;\r\n notify();\r\n //black and white pices must take alternating turns\r\n if (player === \"white\") {\r\n player = \"black\";\r\n console.log(\"I am 2nd player\");\r\n }\r\n\r\n else {\r\n player = \"white\";\r\n console.log(\"I am 1st player\");\r\n }\r\n}", "title": "" }, { "docid": "e9f94edb65e87de8eccbeceeb988eb6e", "score": "0.64764464", "text": "canFallDown() {\n\t\tlet { world } = control;\n\t\tlet worldItem = world[this.x][this.y];\n\t\tlet worldItemBelow = world[this.x][this.y + 1];\n\t\treturn ((worldItem instanceof PassiveActorGravity && worldItemBelow instanceof PassiveActorGravity) ||\n\t\t\t(worldItem instanceof PassiveActorGravity && worldItemBelow instanceof PassiveActorHorizontal) ||\n\t\t\t(worldItemBelow instanceof PassiveActorCatchable && worldItem instanceof PassiveActorGravity));\n\t}", "title": "" }, { "docid": "22840b37b93ac618d83f16f6bc475d73", "score": "0.64692944", "text": "function shipPowerupTest() {\n var lowS, lowP, highS, highP;\n \n // y = x axis\n lowS = player.posX - SHIP_WIDTH / 2 + player.posY;\n highS = player.posX + SHIP_WIDTH / 2 + player.posY;\n lowP = this.posX - this.width / 2 + this.posY;\n highP = this.posX + this.width / 2 + this.posY;\n\n if ((highP < lowS) || (highS < lowP)) {\n return false;\n }\n\n // y = -x axis \n lowS = player.posX - SHIP_WIDTH / 2 - player.posY;\n highS = player.posX + SHIP_WIDTH / 2 - player.posY;\n lowP = this.posX - this.width / 2 - this.posY;\n highP = this.posX + this.width / 2 - this.posY;\n\n if ((highP < lowS) || (highS < lowP)) {\n return false;\n }\n\n return true;\n}", "title": "" }, { "docid": "828b0372de102f57338b6709a0e35b4a", "score": "0.64560765", "text": "function rookArrowCheck (tempRow, tempCol, player, someBoard) {\n let thisPlayer = someBoard[tempRow][tempCol].player\n\n // if flag is false, it means that some earlier square was blocked - EXIT\n // if the move is not withinBoard - EXIT\n if (!(boardFunctions.withinBoard(tempRow, tempCol))) return false\n if (thisPlayer === player) return false\n\n // if the square is blocked, then you cannot go any further than that square\n return (thisPlayer === 0)\n}", "title": "" }, { "docid": "86bd7b0c905ca8603434d593d2bc4c8a", "score": "0.6451553", "text": "function checkEnemiesFromDown(cell, color) {\n for (var j = cell.j - 1; j >= 0; j--) {\n var currentCell = getCell(cell.i, j);\n if (isNonEmpty(currentCell) && !(isType(currentCell, Type.King) && isColor(currentCell, color))) { //there's someone in the cell\n if (!isColor(currentCell, color)) { // the piece is enemy piece\n if (isType(currentCell, Type.Rook) || isType(currentCell, Type.Queen)) {\n return true;\n }\n if (isType(currentCell, Type.King) && j === cell.j - 1) {\n return true;\n }\n }\n else {\n return false;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "dd70edfc93f1fb80769061d48744e85a", "score": "0.64428955", "text": "inCheck(color: Color = this.turn): boolean {\n let mySteps; // steps for different pieces\n let pawnSteps;\n let pawn;\n let kingSquare;\n if (color === WHITE) {\n // square position of king\n kingSquare = this.board.indexOf('K');\n\n mySteps = {\n 'bq': steps.B,\n 'rq': steps.R,\n 'n': steps.N,\n };\n pawn = 'p';\n pawnSteps = [S + W, S + E];\n } else {\n kingSquare = this.board.indexOf('k');\n\n mySteps = {\n 'BQ': steps.B,\n 'RQ': steps.R,\n 'N': steps.N,\n }\n pawn = 'P';\n pawnSteps = [N + W, N + E];\n }\n\n // search all steps for all pieces\n for (const key in mySteps) {\n for (let i = 0; i < mySteps[key].length; i++) {\n let t = kingSquare + mySteps[key][i];\n while (t >= 0 && t <= 63 && colDif(t, t - mySteps[key][i]) < 6) {\n if (this.board[t]) {\n if (key.includes(this.board[t])) return true;\n // pawns get special treatment\n if (this.board[t] === pawn &&\n (kingSquare === t + pawnSteps[0] ||\n kingSquare === t + pawnSteps[1])) {\n return true;\n }\n break;\n }\n\n if ('Nn'.includes(key)) break;\n t += mySteps[key][i];\n }\n }\n }\n return false;\n }", "title": "" }, { "docid": "4b1003454444ee52353de72c1cad9ae2", "score": "0.6439425", "text": "checkValidMove(x, y){\n\t\tif (x < 0 || y < 0 || x >= this.props.cols || y >= this.props.rows){\n\t\t\treturn false;\n\t\t} \n\t\tif (this.state.blocks[y] != null){\n\t\t\tif (this.state.blocks[y].indexOf(x) !== -1){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "title": "" }, { "docid": "ef2252db24e880bd8010306e34a701c7", "score": "0.6435186", "text": "hasWon() {\n return rowWon(this.state) ||\n columnWon(this.state) ||\n diagonalWon(this.state) ||\n this.validMoves().length === 0;\n }", "title": "" }, { "docid": "66536db7ef82dd695dac9d9b95dc86de", "score": "0.6431605", "text": "function canDropPiece(board, row, col, pieceID){\n\n var piece = PIECES[pieceID];\n\n for(var i = 0; i < piece.length; i++) {\n for (var j = 0; j < piece[i].length; j++) {\n if (piece[i][j] && Board[row + i][col + j] != -1) return false;\n }\n }\n return true;\n\n}", "title": "" }, { "docid": "1890a1f19572cae5414c44a021462c2e", "score": "0.64233845", "text": "function checkEnemiesFromUp(cell, color) {\n for (var j = cell.j + 1; j < size; j++) {\n var currentCell = getCell(cell.i, j);\n if (isNonEmpty(currentCell) && !(isType(currentCell, Type.King) && isColor(currentCell, color))) { //there's someone in the cell\n if (!isColor(currentCell, color)) { // the piece is enemy piece\n if (isType(currentCell, Type.Rook) || isType(currentCell, Type.Queen)) {\n return true;\n }\n if (isType(currentCell, Type.King) && j === cell.j + 1) {\n return true;\n }\n }\n else {\n return false;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "4599e455940286b4037bd868acbd7568", "score": "0.64212185", "text": "function checkMoveRightAble() {\n let liesCounter = 0;\n for (let i = (valueArray.length - 1); i > -1; i--) {\n for (let j = (valueArray[i].length - 1); j > -1; j--) {\n if (valueArray[i][j][0] === pieceCounter) {\n if (j === (valueArray[i].length - 1)) {\n liesCounter = liesCounter + 1;\n }\n else {\n if (valueArray[i][j + 1][0] === \"・\" || valueArray[i][j + 1][0] === pieceCounter) {\n liesCounter = liesCounter;\n }\n else {\n liesCounter = liesCounter + 1;\n }\n }\n }\n }\n }\n if (liesCounter > 0) {\n moveRightAble = false;\n }\n else {\n moveRightAble = true;\n }\n}", "title": "" }, { "docid": "6d51fa2755ddbd0dd85ab9252d6453df", "score": "0.64185715", "text": "function IsValidPawnMove(g, pawn, x, y) {\n\n \n if (!IsValidPawnSpace(x, y)){\n return false;\n }\n\n if (pawn.x == x && pawn.y == y){\n return false;\n }\n\n if (gameOver(g)){\n return false;\n }\n \n let otherPawn = g.pawnA\n if (pawn == g.pawnA) {\n otherPawn = g.pawnB\n }\n \n if (otherPawn.x == x && otherPawn.y == y){\n return false;\n }\n \n const directionX = x - pawn.x,\n directionY = y - pawn.y;\n \n // Pawns shouldn't move too far or stay in place (if moving)\n if (Math.abs(directionX) + Math.abs(directionY) > 2)\n return false;\n \n // Be suspicious of diagonals\n if (directionX != 0 && directionY != 0) {\n // Check if jumping is possible\n // Check if otherPawn is adjacent\n if (otherPawn.x == pawn.x && otherPawn.y == y) {\n return (\n (IsWallBlockingDir(g, otherPawn.x, otherPawn.y, 0, directionY) || !IsValidPawnSpace(otherPawn.x, otherPawn.y + directionY)) &&\n !IsWallBlockingDir(g, pawn.x, pawn.y, 0, directionY) &&\n !IsWallBlockingDir(g, otherPawn.x, otherPawn.y, directionX, 0)\n );\n }\n else if (otherPawn.y == pawn.y && otherPawn.x == x) {\n return (\n (IsWallBlockingDir(g, otherPawn.x, otherPawn.y, directionX, 0) || !IsValidPawnSpace(otherPawn.x + directionX, otherPawn.y)) &&\n !IsWallBlockingDir(g, pawn.x, pawn.y, directionX, 0) &&\n !IsWallBlockingDir(g, otherPawn.x, otherPawn.y, 0, directionY)\n );\n }\n else\n return false;\n }\n else if (Math.abs(directionX) == 2){\n if (!(otherPawn.y == pawn.y && otherPawn.x == pawn.x + directionX/2 &&\n !IsWallBlockingDir(g, pawn.x, pawn.y, directionX/2, 0) &&\n !IsWallBlockingDir(g, otherPawn.x, otherPawn.y, directionX/2, 0))){\n return false\n }\n }\n else if (Math.abs(directionY) == 2){\n if (!(otherPawn.x == pawn.x && otherPawn.y == pawn.y + directionY/2 &&\n !IsWallBlockingDir(g, pawn.x, pawn.y, 0, directionY/2) &&\n !IsWallBlockingDir(g, otherPawn.x, otherPawn.y, 0, directionY/2))){\n return false\n }\n }\n // Check for walls if going straight\n else if (IsWallBlockingDir(g, pawn.x, pawn.y, directionX, directionY)) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "7f6c924d22d59bab3c4285f15bb1c3ab", "score": "0.641842", "text": "function isArmySurroundedInternal(board, startX, startY, player)\n{\t\n\tvar flaggedAsChecked = 100;\n\tboard[startX][startY] = flaggedAsChecked;\n\n\tvar adjacentIntersections = getAdjacentIntersections(board, startX, startY); \n\t\n\tfor (var i = 0; i < adjacentIntersections.length; i++)\n\t{\n\t\tvar adjX = adjacentIntersections[i][0];\n\t\tvar adjY = adjacentIntersections[i][1];\n\t\t\n\t\tif (board[adjX][adjY] == 0)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\telse if (board[adjX][adjY] == player) \n\t\t{\n\t\t\tif(!isArmySurroundedInternal(board, adjX, adjY, player))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn true;\n}", "title": "" }, { "docid": "b4c9f2d5852df40c2f4660338f7468c1", "score": "0.64138913", "text": "function isOutOfBoard(gameID, x, y, dir, speed) {\n\tvar check;\n\tvar game = games[gameID];\n\tvar outOfBoard = false;\n\tvar row = Math.floor((y - 20) / 30) + 1;\n\tvar col = Math.floor((x - 20) / 30) + 1;\n\tvar item;\n\t// width of d and u = 29, h = 23 for all\n\t// width of l and r = 20\n\tswitch (dir) {\n\t\tcase \"u\":\n\t\t\tcheck = y - speed;\n\t\t\trow = Math.floor((check - 20) / 30) + 1;\n\t\t\tbreak;\n\t\tcase \"d\":\n\t\t\tcheck = y + 23 + speed;\n\t\t\trow = Math.floor((check - 20) / 30) + 1;\n\t\t\tbreak;\n\t\tcase \"r\":\n\t\t\tcheck = x + 20 + speed;\n\t\t\tcol = Math.floor((check - 20) / 30) + 1;\n\t\t\tbreak;\n\t\tcase \"l\":\n\t\t\tcheck = x - speed;\n\t\t\tcol = Math.floor((check - 20) / 30) + 1;\n\t\t\tbreak;\n\t}\n\titem = game.board[row][col].b;\n\tif (item == \"o\" || item == \"w\" || item == \"b\") {\n\t\toutOfBoard = true;\n\t}\n\t//console.log(\"pos: \" + pos);\n\treturn outOfBoard;\n}", "title": "" }, { "docid": "b58bc154b22f471f532e0bf584b20437", "score": "0.6407792", "text": "function moveVertical(piece){\n if (parseInt(piece.style.left) == blank[0]){\n if(parseInt(piece.style.top) - blank[1] == 100 || \n parseInt(piece.style.top) - blank[1] == -100){\n return true\n }\n }\n }", "title": "" }, { "docid": "35ce72abc068bb83b2d004a136c25add", "score": "0.6405186", "text": "isLegalMove(move) {\n const cell = this.board[move[0]][move[1]]\n\n return !this.winner && !cell.char\n }", "title": "" }, { "docid": "ff21c22f46f0636801f6f995f960f739", "score": "0.6404297", "text": "function occupiedPlayerPiece(piece) {\n var result = false;\n\n eachblock(piece.type, piece.x, piece.y, piece.dir, function(x, y) {\n if (occupiedPlayerBlock(x, y, piece.pid)) {\n result = true;\n }\n });\n\n return result;\n }", "title": "" }, { "docid": "3b0cd364b8db94660317718fe4a5512d", "score": "0.63863564", "text": "function checkValidity(piece, board){\n checkDirection = function(piece){\n let inputCheck = (directionIndex.indexOf(piece.direction[0]) !== -1);\n return inputCheck;\n };\n\n checkLocation = function(piece){\n let inputCheck = (letterIndex.indexOf(piece.start[0]) !== -1 && ( piece.start[1] > 0 && piece.start[1] <= 10));\n return (inputCheck && piece.start.length === 2);\n };\n\n checkPlacement = function(piece){\n let fitsOnBoard = true;\n let noInterference = true;\n\n switch(piece.direction){\n\n case 'R':\n\n fitsOnBoard = (Number(piece.start[1]) + piece.length - 1) <= 10;\n break;\n\n case 'L':\n\n fitsOnBoard = (Number(piece.start[1]) - piece.length) >= 1;\n break;\n\n case 'U':\n\n fitsOnBoard = (letterIndex.indexOf(piece.start[0]) - piece.length) >= 1;\n break;\n\n case 'D':\n\n fitsOnBoard = (letterIndex.indexOf(piece.start[0]) + piece.length - 1) <= 10;\n break;\n\n }\n\n //Prevents accessing parts of the array that dont exist in the next aspect of the check\n if(fitsOnBoard === false){\n return fitsOnBoard;\n }\n\n let startLocation = parseInput(piece.start);\n\n //Checks if the ships interfere with other ships\n for(let i = 0; i < piece.length; i ++){\n switch(piece.direction){\n\n case 'R':\n\n if(board[startLocation[0]][i + startLocation[1]] !== 0){\n noInterference = false;\n }\n break;\n\n case 'L':\n\n if(board[startLocation[0]][startLocation[1] - i] !== 0){\n noInterference = false;\n }\n break;\n\n case 'U':\n\n if(board[startLocation[0] - i][startLocation[1]] !== 0){\n noInterference = false;\n }\n\n break;\n\n case 'D':\n\n if(board[startLocation[0] + i][startLocation[1]] !== 0){\n noInterference = false;\n }\n break;\n\n }\n\n if(noInterference === false){\n break;\n }\n }\n\n return noInterference && fitsOnBoard;\n };\n\n if(checkDirection(piece) && checkLocation(piece) && checkPlacement(piece)){\n return true;\n } else {\n console.log(\"That is not a valid entry\");\n return false;\n }\n}", "title": "" }, { "docid": "246e0ca4ef1404d3c466ca66b5475aa0", "score": "0.63858646", "text": "checkMove() {\n\n // Sets separate variables for player's current coordinates for clarity\n let currentRow = this._currentPosition[0];\n let currentColumn = this._currentPosition[1];\n\n // Check if player's current position is still in the bounds of the field\n if ((currentRow >= 0) && (currentRow < this._field.length) && (currentColumn >= 0) && (currentColumn < this._field[0].length)) {\n \n // Print out current player coordinates\n // console.log('currentRow')\n // console.log(currentRow);\n // console.log('currentColumn')\n // console.log(currentColumn);\n\n // If player still in the bounds of the field, check if player fell into a hole\n if (this._field[currentRow][currentColumn] === hole) {\n \n // If player has fallen into a hole print out message stating that the player has lost, and return true \n console.log('\\nYou fell in a hole!');\n console.log('You lose');\n return true; // Returning true indicates that the game is over, and the while loop in the main script will exit\n\n // If player has not fallen into the hole, check if the player has reached the hat\n } else if (this._field[currentRow][currentColumn] === hat) {\n\n // If player has reached the hat, print out a message stating that the player has won the game, and return true\n console.log('\\nYou found your hat!');\n console.log('You win the game!');\n return true; // Returning true indicates that the game is over, and the while loop in the main script will exit\n\n // If player has not reached the hat or fallen into a hole, game can continue \n } else {\n this._field[currentRow][currentColumn] = pathCharacter; // Turn the character at the current position in the field into a path character\n this._moveCount++;\n\n // If hard mode is enabled and move count has reached 3, add a hole to the field\n if (this._hardModeEnable && this._moveCount === 3 ) {\n this.addHole();\n this._moveCount = 0; // Reset move count to 0\n }\n\n this.print(); // Print the current board\n return false; // Returning false indicates that the game is not over, and the player can continue to make moves\n }\n\n // If player's position is not still in the bounds of the field, the game is over\n } else {\n\n // Print out a message stating that the player has lost the game, and return true\n console.log('\\nYou moved out of bounds!');\n console.log('You lose');\n return true; // Returning true indicates that the game is over, and the while loop in the main script will exit\n }\n }", "title": "" }, { "docid": "6b6ea39306a7c457a0e63f7ba35c8cf1", "score": "0.63852733", "text": "function hasReachedSides(item) {\n\t\tif ((item.x < 0) && item.isActive === true) {\n\t\t\titem.isActive = false;\n\t\t\t//console.log(item.name, \"has escaped left (x < 1)\");\n\t\t}\n\n\t\tif ((item.x > 1) && item.isActive === true) {\n\t\t\titem.isActive = false;\n\t\t\t//console.log(item.name, \"has espaced right(x > 1)\");\n\t\t}\n\t}", "title": "" }, { "docid": "e007ed90f4307097c815d95b41fa75a5", "score": "0.6365668", "text": "function altCheck(piece, opp) {\n\n // get king position\n const king = board.pieces.find(p => p.type == 'king' && p.color == piece.color);\n\n // check horizontally, vertically, or diagonally\n if (king.row == piece.row && opp.row == piece.row) { piece.moveset = piece.moveset.filter(m => m[1] == piece.id[1]); } \n else if (king.col == piece.col && opp.col == piece.col) { piece.moveset = piece.moveset.filter(m => m[0] == piece.id[0]); } \n else {\n // if it is not a straight diagonal, there is no danger\n const dy = king.row - piece.row;\n const dx = king.col - piece.col;\n const slope = Math.abs(dy / dx);\n const dy2 = king.row - opp.row;\n const dx2 = king.col - opp.col;\n const slope2 = Math.abs(dy2 / dx2);\n if (slope != 1 || slope2 != 1) return;\n\n // knights and rooks cannot respond to a diagonal threat\n if (piece.type == 'rook' || piece.type == 'knight') {\n piece.moveset = [];\n } else {\n // finds diagonal safe moves between king and attacker\n const pCol = piece.col;\n const oCol = opp.col;\n piece.moveset = piece.moveset.filter(m => {\n if (m == opp.id) return true;\n const included = opp.moveset.includes(m);\n const mCol = toNumber(m[0]);\n const vrDiff = (opp.row > piece.row) ? (m[1] < opp.row && m[1] > piece.row) : (m[1] > opp.row && m[1] < piece.row);\n const hrDiff = (oCol < pCol) ? (mCol < pCol && mCol > oCol) : (mCol > pCol && mCol < oCol);\n return included && hrDiff && vrDiff;\n });\n }\n }\n\n if (piece.moveset.length == 0) {\n const grid = document.getElementById(opp.id);\n if (!grid.classList.contains('danger')) {\n grid.classList.add('danger');\n setTimeout( () => {\n grid.classList.remove('danger');\n }, 1000);\n }\n }\n\n}", "title": "" }, { "docid": "1624a21025b921d8a677e3dbe1f5c692", "score": "0.63622105", "text": "get cantMoveTowardsTarget() {\n if (this._follows == \"N/A\") return false;\n return (\n this.shouldMove.row == this.position.row &&\n this.shouldMove.col == this.position.col\n );\n }", "title": "" }, { "docid": "97b4e124e43c791d161a8e36fa753475", "score": "0.6360722", "text": "stopCheck() {\n if ((this.direction === 'up' && [this.y] <= this.nextTile[1] + 1)\n || (this.direction === 'down' && this.y >= this.nextTile[1] - 1)\n || (this.direction === 'left' && this.x <= this.nextTile[0] + 1)\n || (this.direction === 'right' && this.x >= this.nextTile[0] - 1)) this.stop();\n }", "title": "" }, { "docid": "e876b7a9dac844699f5710430d1bba20", "score": "0.63566947", "text": "isValid() {\r\n this.resetNumContinuous();\r\n this.countContinuous(this.i, this.j); // remember this.i and this.j is the player's start position initially\r\n let numHoles = this.getNumHoles();\r\n let totalCells = this.getTotalCells();\r\n if (numContinuous === totalCells - numHoles) {\r\n this.resetPathToGrass();\r\n this.replaceThing();\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "cedfb49b42651d57a9c11a5be14415cc", "score": "0.6351477", "text": "move() {\n switch (this.facing) {\n case 'NORTH':\n if (this.table.isValidMove(this.x, this.y + 1)) {\n this.y += 1;\n return true;\n }\n return false;\n\n case 'SOUTH':\n if (this.table.isValidMove(this.x, this.y - 1)) {\n this.y -= 1;\n return true;\n }\n return false;\n\n case 'EAST':\n if (this.table.isValidMove(this.x + 1, this.y)) {\n this.x += 1;\n return true;\n }\n return false;\n\n case 'WEST':\n if (this.table.isValidMove(this.x - 1, this.y)) {\n this.x -= 1;\n return true;\n }\n return false;\n\n default:\n return false;\n }\n }", "title": "" }, { "docid": "58676649bc411882b06599f4eaba12c8", "score": "0.6348752", "text": "canMoveLeft() {\n\t\t// Check if each square in the piece's structure can move left, relative to the piece's position in the well\n\t\tfor (var r = 0; r < this.getStructure().length; ++r) {\n\t\t\tfor (var c = 0; c < this.getStructure()[r].length; ++c) {\n\t\t\t\tif (this.getStructure()[r][c] == 1) {\n\t\t\t\t\t// Compute the absolute position of the square\n\t\t\t\t\t// absolute position of the origin of the piece + position of the square in the piece - position of the origin in the piece\n\t\t\t\t\tvar absolute_square_position = [this.absolute_position[0] + c - this.relative_position[0], this.absolute_position[1] + r - this.relative_position[1]];\n\t\t\t\t\t// Substract 1 to the horizontal position of the square (like a left move)\n\t\t\t\t\tabsolute_square_position[0]--;\n\t\t\t\t\t// Return false if the left limit of the well is reached,\n\t\t\t\t\t// or if there already is a square at its position in the matrix if this position is in the well\n\t\t\t\t\tif (absolute_square_position[0] < 0\n\t\t\t\t\t|| (absolute_square_position[1] >= 0 && absolute_square_position[0] >= 0 && absolute_square_position[0] < COLUMNS_NB\n\t\t\t\t\t\t&& MATRIX[absolute_square_position[1]][absolute_square_position[0]] != null)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "title": "" }, { "docid": "689ebc528c31b63d845056c4f9184351", "score": "0.63468975", "text": "function checkBetween(start, end, piece, transform, boardState, board) {\n var difference = {\n file: Math.abs(start.file - end.file),\n rank: Math.abs(start.rank - end.rank)\n };\n // If \n if (difference.file > 0 && difference.rank > 0)\n throw new Error(\"Invalid non-jumpable move in \" + piece.name + \" definition: \" + transform);\n if (difference.file === 1 || difference.rank === 1)\n return false;\n var dimension = difference.file > 0 ? \"file\" : \"rank\";\n var inc = end[dimension] > start[dimension] ? -1 : 1;\n // Ensure all squares between current and previous are vacant\n // Avoid closures to avoid heap allocations\n for (var y = end[dimension]; y !== start[dimension]; y += inc) {\n var between = { file: end.file, rank: end.rank };\n between[dimension] += inc;\n var sq = board.getSquare(between, boardState);\n // If a square is occupied, the move is not valid\n if (sq.piece)\n return false;\n }\n // All squares are vacant\n return true;\n}", "title": "" }, { "docid": "78e7e7a548e39b62bf712ee2504504b2", "score": "0.6340502", "text": "function moveable(element){\r\n\t\tvar col = parseInt(getComputedStyle(element).getPropertyValue(\"right\")) / TILE_AREA;\r\n\t\tvar row = parseInt(getComputedStyle(element).getPropertyValue(\"top\")) / TILE_AREA;\r\n\t\tvar rowDif = Math.abs(row - eRow);\r\n\t\tvar colDif = Math.abs(col - eCol);\r\n\t\tif ( ((row == eRow) && (colDif == 1)) || ((col == eCol) && (rowDif == 1)) ){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "4a77ad08f0ab7bf77aa38d338d5f4bf5", "score": "0.6339281", "text": "function checkEnemiesFromUpLeft(cell, color) {\n for (var i = cell.i - 1, j = cell.j + 1; j < size && i >= 0; j++, i--) {\n var currentCell = getCell(i, j);\n if (isNonEmpty(currentCell) && !(isType(currentCell, Type.King) && isColor(currentCell, color))) { //there's someone in the cell\n if (!isColor(currentCell, color)) { // the piece is enemy piece\n if (isType(currentCell, Type.Bishop) || isType(currentCell, Type.Queen)) {\n return true;\n }\n if (i === cell.i - 1 && j === cell.j + 1) {\n if (isType(currentCell, Type.King)) {\n return true;\n }\n if (isType(currentCell, Type.Pawn) && color.equals(Color.Black)) {\n return true;\n }\n }\n }\n else {\n return false;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "3e182c3e3b8da999b013d05edfe995bf", "score": "0.63384664", "text": "function hurdleDetection() {\n for (var i = 0; i < state.hurdlePositionsX.length; i++) {\n var hurdle = state.hurdlePositionsX[i];\n if (state.playerX + state.playerWidth >= hurdle.x) {\n state.gameMode = \"question\";\n } else if (\n (state.playerX + state.playerWidth >= hurdle.x) &&\n (state.playerX + state.playerWidth <= hurdle.x + state.hurdleWidth)) {\n state.gameMode = \"ignoreHurdle\";\n } else if (state.playerX + state.playerWidth >= hurdle.x + state.hurdleWidth) {\n state.gameMode = \"moving\";\n }\n }\n}", "title": "" }, { "docid": "2b8685aabb62af2388734c3fd0a23381", "score": "0.6336978", "text": "function moveable(posx,posy,dir){\r\n //console.log(posx+dir[0],posy+dir[1])\r\n if(posy+dir[1]==-1&&posx+dir[0]>=0&&posx+dir[0]<chunkColumn){\r\n return true;\r\n }\r\n if(posx+dir[0]>=0&&posx+dir[0]<chunkColumn&&posy+dir[1]>=0&&posy+dir[1]<=chunkRow){\r\n if(soils[posy+dir[1]][posx+dir[0]].lp<=0){\r\n return true;\r\n }\r\n }else{\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "d02ed5a73bd76e77e4c391d18f0af227", "score": "0.6331011", "text": "function checkWin() {\n\tvar foundPlayerPiece = false;\n\tif (GameState.turn == -1) {\n\t\treturn false;\n\t}\n\tfor (var i = 0; i < GameState.board.triangles.length; i++) {\n\t\tif (GameState.board.triangles[i].indexOf(GameState.turn) != -1) {\n\t\t\tfoundPlayerPiece = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\tvar foundOppPiece = false;\n\tfor (var i = 0; i < GameState.board.triangles.length; i++) {\n\t\tif (GameState.board.triangles[i].indexOf(+!GameState.turn) != -1) {\n\t\t\tfoundOppPiece = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (GameState.board.bar.indexOf(GameState.turn) != -1) {\n\t\tfoundPlayerPiece = true;\n\t}\n\tif (GameState.board.bar.indexOf(+!GameState.turn) != -1) {\n\t\tfoundOppPiece = true;\n\t}\n\tif (!foundPlayerPiece && !foundOppPiece) {\n\t\tthrow 'Invalid game state: Draw';\n\t} else if (foundPlayerPiece && foundOppPiece) {\n\t\treturn false;\n\t} else if (foundPlayerPiece) {\n\t\tGameState.winner = GameState.turn;\n\t\treturn true;\n\t} else if (foundOppPiece) {\n\t\tGameState.winner = +!GameState.turn;\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "07e907e7605041bfd32b734bd1a88090", "score": "0.6328211", "text": "function isDraw() {\n return pieces.every(elem => [\"X\", \"O\"].includes(elem))\n}", "title": "" }, { "docid": "9ba55e6414e302aa5e135b06649570e1", "score": "0.6312478", "text": "function checkMoveLeftAble() {\n let liesCounter = 0;\n for (let i = (valueArray.length - 1); i > -1; i--) {\n for (let j = (valueArray[i].length - 1); j > -1; j--) {\n if (valueArray[i][j][0] === pieceCounter) {\n if (j === 0) {\n liesCounter = liesCounter + 1;\n }\n else {\n if (valueArray[i][j - 1][0] === \"・\" || valueArray[i][j - 1][0] === pieceCounter) {\n liesCounter = liesCounter;\n }\n else {\n liesCounter = liesCounter + 1;\n }\n }\n }\n }\n }\n if (liesCounter > 0) {\n moveLeftAble = false;\n }\n else {\n moveLeftAble = true;\n }\n}", "title": "" }, { "docid": "f3e921af388c18bc1300de1bdd957345", "score": "0.6307318", "text": "isActive() {\n return this.moves.length > 0;\n }", "title": "" }, { "docid": "fbba1bccbb8b522678b5fb17e3d8525e", "score": "0.62977415", "text": "function checkIfGemCanBeMovedHere(fromPosX, fromPosY, toPosX, toPosY) {\n if (toPosX < 0 || toPosX >= BOARD_COLS || toPosY < 0 || toPosY >= BOARD_ROWS) {return false}\n if (fromPosX == toPosX && fromPosY >= toPosY - 1 && fromPosY <= toPosY + 1) {return true}\n if (fromPosY == toPosY && fromPosX >= toPosX - 1 && fromPosX <= toPosX + 1) {return true}\n return false}", "title": "" }, { "docid": "37146513f54984dce510bc48cb9cd9aa", "score": "0.62940955", "text": "function check_for_cant_move( x, y ) {\n root_x = (x % 3) * 3;\n root_y = (y % 3) * 3;\n\n squares = new Array(9);\n\n squares[0] = xy_to_1d(root_x,root_y);\n squares[1] = squares[0] + 1;\n squares[2] = squares[1] + 1;\n\n squares[3] = squares[0] + 9;\n squares[4] = squares[3] + 1;\n squares[5] = squares[4] + 1;\n\n squares[6] = squares[3] + 9;\n squares[7] = squares[6] + 1;\n squares[8] = squares[7] + 1;\n\n for( i = 0;i < 9;i++) {\n if(!board_state_all[squares[i]]) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "d0bc48cd8e27135b48bb7dfdc9727fe8", "score": "0.62916714", "text": "moveDownCurrent() {\n let tempPiece = clone(this.currentPiece.coords).map(x => [x[0] + 1, x[1]])\n this.currentPiece.coords.forEach(x => setCellColor('board', x[0],x[1], Shape.Empty))\n if (tempPiece.some(x => x[0] > 22 || getCellColor('board', x[0], x[1]) !== Shape.Empty)) {\n //check if the current piece is above upper bound\n if (this.currentPiece.coords.some(x => x[0] < 3)) {\n gameEnd()\n return\n }\n this.currentPiece.coords.forEach(x => setCellColor('board', x[0],x[1], this.currentPiece.shape))\n this.currentPiece = this.nextPiece.shift()\n this.nextPiece.push(this.randomPiece())\n this.checkForTet()\n this.placeCurrent()\n this.canHold = true\n return\n }\n tempPiece.forEach(x => setCellColor('board', x[0],x[1], this.currentPiece.shape))\n this.currentPiece.moveDown()\n }", "title": "" }, { "docid": "ae703f75060d844f8fcb12cc10ff443c", "score": "0.6282568", "text": "function check(s,d) {\r\n\t\tif (grid[s] & d) {\t//if possible to move in that direction from here\r\n\t\t\ts = move(s,d);\r\n\t\t\tif (beenTo.indexOf(s + \";\") == -1) { //and we haven't already visited that destination\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse return false;\r\n\t}", "title": "" }, { "docid": "c1cd5099705b367a4567ef907aa72537", "score": "0.62825423", "text": "canEvilFallDown() {\n\t\tif (this.canFallDown() && !this.hasEvilAt(0, 1)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "615c1bc7d20e92736882163df85c106d", "score": "0.6279551", "text": "function moveSafe()\n\t\t{\n\t\t\t/* Checks cases where only option is left or right and chooses option that isn't a chute and has the \n\t\t\t * most consecutive walkable neighbors\n\t\t\t */\n\t\t\tvar ns = allNeighbors(me.snakeHead.col, me.snakeHead.row);\n\t\t\tif ((ns[0].on == false) && (ns[1].on == true && ns[3].on == true)) {\n\t\t\t\tif (ns[3].z > ns[1].z && !(checkChute(ns[3].x,ns[3].y,\"West\"))) {\n\t\t\t\t\tconsole.log(checkChute(ns[3].x,ns[3].y,\"West\"));\n\t\t\t\t\tmoveQueue.unshift(coorToDir(pathStart, [ns[3].x,ns[3].y]));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.log(checkChute(ns[1].x,ns[1].y,\"East\"));\n\t\t\t\t\tmoveQueue.unshift(coorToDir(pathStart, [ns[1].x,ns[1].y]));\n\t\t\t\t}\n\t\t\t}\n\t\t\t/* Checks cases where only option is up or down and chooses option that isn't a chute and has the \n\t\t\t * most consecutive walkable neighbors\n\t\t\t */\n\t\t\telse if ((ns[0].on == true && ns[2].on == true) && (ns[1].on == false && ns[3].on == false)) {\n\t\t\t\tif (ns[2].z > ns[0].z && !(checkChute(ns[2].x,ns[2].y,\"South\"))) {\n\t\t\t\t\tconsole.log(checkChute(ns[3].x,ns[3].y,\"South\"));\n\t\t\t\t\tmoveQueue.unshift(coorToDir(pathStart, [ns[2].x,ns[2].y]));\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.log(checkChute(ns[0].x,ns[0].y,\"North\"));\n\t\t\t\t\tmoveQueue.unshift(coorToDir(pathStart, [ns[0].x,ns[0].y]));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Finds direction that is not a chute and walkable.\n\t\t\t\tns = allNeighbors(me.snakeHead.col, me.snakeHead.row);\n\t\t\t\tconsole.log(\"else chute check\");\n\t\t\t\tif (ns[0].on && !(checkChute(ns[0].x,ns[0].y,\"North\"))){\n\t\t\t\t\tconsole.log(\"North Safe\");\n\t\t\t\t\tmoveQueue.unshift(coorToDir(pathStart, [ns[0].x,ns[0].y]));\n\t\t\t\t}\n\t\t\t\telse if (ns[1].on && !(checkChute(ns[1].x,ns[1].y,\"East\"))){\n\t\t\t\t\tconsole.log(\"East Safe\");\n\t\t\t\t\tmoveQueue.unshift(coorToDir(pathStart, [ns[1].x,ns[1].y]));\n\t\t\t\t}\n\t\t\t\telse if (ns[2].on && !(checkChute(ns[2].x,ns[2].y,\"South\"))){\n\t\t\t\t\tconsole.log(\"South Safe\");\n\t\t\t\t\tmoveQueue.unshift(coorToDir(pathStart, [ns[2].x,ns[2].y]));\n\t\t\t\t}\n\t\t\t\telse if (ns[3].on && !(checkChute(ns[3].x,ns[3].y,\"West\"))){\n\t\t\t\t\tconsole.log(\"West Safe\");\n\t\t\t\t\tmoveQueue.unshift(coorToDir(pathStart, [ns[3].x,ns[3].y]));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t// Last case scenario where snake is trapped no matter what. Moves to first open tile.\n\t\t\t\t\tns = openNeighbors(me.snakeHead.col, me.snakeHead.row);\n\t\t\t\t\tmoveQueue.unshift(coorToDir(pathStart, [ns[0].x,ns[0].y]));\n\t\t\t\t}\n\t\t\t}\t\t\n\t\t}", "title": "" }, { "docid": "97217b30121b5be7275da5553b8c43e1", "score": "0.62794065", "text": "playPiece(piece, x, y) {\r\n const { board, moves, unadjustedMoves } = this;\r\n if (!this.isMoveValid(piece, x, y)){\r\n return false;\r\n }\r\n board[y][x] = piece;\r\n moves.push([x,y]);\r\n unadjustedMoves.push([x,y]);\r\n this.padBoard();\r\n return true;\r\n }", "title": "" }, { "docid": "9b2219eb9d5fa10cc0b311f4d40a3cc5", "score": "0.62767774", "text": "function canGo(dir) {\n if ((player.x + dir.x) < 0 || (player.y + dir.y) < 0 || (player.x + dir.x) >= 16 || (player.y + dir.y) >= 12 || map[player.y + dir.y][player.x + dir.x] == 0 || (map[player.y + dir.y][player.x + dir.x] == 6 && key == 0))\n return(1);\n else\n return(0);\n}", "title": "" }, { "docid": "dfad2b48f85cbc4df81762d8be2e0cbd", "score": "0.6269243", "text": "can_move(start, end, blocked) {\n\t\tvar start_row = 8 - Math.floor(start / 8);\n\t\tvar start_col = (start % 8) + 1;\n\t\tvar end_row = 8 - Math.floor(end / 8);\n\t\tvar end_col = (end % 8) + 1;\n\n\t\tvar row_diff = end_row - start_row;\n\t\tvar col_diff = end_col - start_col;\n\n\t\tif (this.player == \"w\") {// le tour de blanc\n\t\t if (col_diff == 0 && !blocked) {\n\t\t\tif (row_diff == 1) return true; // avancer 1 case\n\t\t\telse if(row_diff == 2 && this.posInit.includes(start))return true; // avancer 2 cases\n\t\t\t\n\t\t }else if ((col_diff == -1 || col_diff == 1)&& blocked) { //manger en diagonale\n\t\t\tif (row_diff == 1) return true;\n\t\t }\n\t\t \n\t\t} else {\n\t\t if (col_diff == 0 && !blocked) { //le tour de noir\n\t\t\tif (row_diff == -1 ) return true; // avancer 1 case\n\t\t\telse if(row_diff == -2 && this.posInit.includes(start))return true; // avancer 2 cases\n\t\t\t\n\t\t } else if ((col_diff == -1 || col_diff == 1)&& blocked) { //manger en diagonale\n\t\t\tif (row_diff == -1) return true;\n\t\t }\n\t\t}\n\t\treturn false;\n\t }", "title": "" }, { "docid": "82bbb419e9ce50d23eff68e57ac5210b", "score": "0.62682146", "text": "canMoveIntoOwnHouse() {\n return this.canMoveToCorridorColumn(this.ownHouse().col) && this.ownHouse().hasNoStrangers()\n }", "title": "" }, { "docid": "7552ecb6ae49a0ec788be70d56e99894", "score": "0.62665296", "text": "function canMove(x, y) {\n var tile = $(\"square_\" + y + \"_\" + x);\n tile.classList.remove(\"movable\");\n if ((x == emptyColumn && (Math.abs(y - emptyRow)) == 1) || \n (y == emptyRow && (Math.abs(x - emptyColumn)) == 1)) {\n tile.classList.add(\"movable\");\n tile.onclick = function() {\n movePuzzlePiece(this);\n };\n }\n }", "title": "" }, { "docid": "24e6fd3729da0b3f11a99bd6057ffc7b", "score": "0.6257509", "text": "checkCollisions(character){\r\n if (this.y === character.y) {\r\n //how close player is before the player is in a collision 0.5\r\n if (this.x >= character.x - 0.5 && this.x <= character.x + 0.5) {\r\n return true;\r\n }\r\n }\r\n else {\r\n return false;\r\n }\r\n }", "title": "" }, { "docid": "69204ec8ae1738e1ac0b8da2af05ba9c", "score": "0.6255219", "text": "function checkChute(x,y,direction)\n\t\t{\n\t switch (direction) {\n\t case \"North\":\n\t while (worldHeight > y > -1 && worldWidth > x > -1 && canWalkHere(x-1, y) == false && canWalkHere(x+1, y) == false){\n\t \tif (canWalkHere(x, y - 1) == false){\n\t\t \treturn true;\n\t \t}\n\t \telse{\n\t \t\ty -- ;\n\t \t}\n\t }\n\t break; \n\t case \"South\":\n\t while (worldHeight > y > -1 && worldWidth > x > -1 && canWalkHere(x-1, y) == false && canWalkHere(x+1, y) == false){\n\t \tif (canWalkHere(x, y + 1) == false){\n\t\t \treturn true;\n\t \t}\n\t \telse{\n\t \t\ty ++ ;\n\t \t}\n\t }\n\t\n\t break; \n\t case \"East\":\n\t while (worldHeight > y > -1 && worldWidth > x > -1 && canWalkHere(x, y-1) == false && canWalkHere(x,y+1) == false){\n\t \tif (canWalkHere(x + 1, y) == false){\n\t\t \treturn true;\n\t \t}\n\t \telse{\n\t \t\tx ++ ;\n\t \t}\n\t }\n\t\n\t break; \n\t case \"West\":\n\t while (worldHeight - 1 > y > 0 && worldWidth - 1 > x > 0 && canWalkHere(x, y-1) == false && canWalkHere(x, y+1) == false){\n\t \tif (canWalkHere(x - 1, y) == false){\n\t\t \treturn true;\n\t \t}\n\t \telse{\n\t \t\tx -- ;\n\t \t}\n\t }\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t}", "title": "" }, { "docid": "eb04c097d87767816bec60e3d79329ac", "score": "0.62386686", "text": "function checkMovement(column, row) {\r\n\r\n let moveRow = dungeonFloor[row];\r\n\r\n if (moveRow != null && moveRow[column] != null)\r\n {\r\n switch (moveRow[column]) {\r\n //Empty Tile\r\n case \"O\":\r\n return true;\r\n //Wall\r\n case \"X\":\r\n return false;\r\n //Enemies\r\n case \"I\":\r\n case \"E\":\r\n case \"A\":\r\n case \"F\":\r\n case \"G\":\r\n case \"W\":\r\n if (combat(column, row)) {\r\n return true;\r\n }\r\n return false;\r\n //Items\r\n case \"s\":\r\n case \"i\":\r\n case \"e\":\r\n case \"f\":\r\n case \"a\":\r\n case \"h\":\r\n if (getItem(column, row)) {\r\n return true;\r\n }\r\n return false;\r\n //Stairs\r\n case \"S\":\r\n moveToNextFloor();\r\n return true;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "a90f4e0970277e0f116e999224d70203", "score": "0.62375003", "text": "can_move(start, end) {\n\t\t\tvar start_row = 8 - Math.floor(start / 8);\n\t\t\tvar start_col = (start % 8) + 1;\n\t\t\tvar end_row = 8 - Math.floor(end / 8);\n\t\t\tvar end_col = (end % 8) + 1;\n\n\t\t\tvar row_diff = end_row - start_row;\n\t\t\tvar col_diff = end_col - start_col;\n\n\t\t\tif (row_diff > 0 && col_diff == 0) { //vers la droite\n\t\t\t\treturn true;\n\t\t\t} else if (row_diff < 0 && col_diff == 0) { // vers le gauche\n\t\t\t\treturn true;\n\t\t\t} else if (row_diff == 0 && col_diff > 0) { // vers le haut\n\t\t\t\treturn true;\n\t\t\t} else if (row_diff == 0 && col_diff < 0) { // vers le bas\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "title": "" } ]
b05de3e7a7aa7cd8d0c8cfeb4f41ddcd
Move backward a word. We do what Emacs does. Handles multibyte chars.
[ { "docid": "86e9ae518bb17a1b5d6009a289f6b520", "score": "0.68574446", "text": "function rl_backward_word(count, key) {\n if (count < 0) {\n rl_forward_word(-count, key);\n return;\n }\n\n for (var _ = 0; _ < count; _++) {\n /* Like rl_forward_word (), except that we look at the characters\n just before point. */\n while (rl_point > 0) {\n if (rl_line_buffer[rl_point-1] != ' ') {\n break;\n }\n rl_point--;\n }\n while (rl_point > 0) {\n if (rl_line_buffer[rl_point-1] == ' ') {\n break;\n }\n rl_point--;\n }\n }\n}", "title": "" } ]
[ { "docid": "074960b06359722c98e04853a1ffca42", "score": "0.68219113", "text": "function moveBackward(doc, pos, by) {\n if (by != \"char\" && by != \"word\")\n throw new RangeError(\"Unknown motion unit: \" + by)\n\n let $pos = doc.resolve(pos)\n let parent = $pos.parent, offset = $pos.parentOffset\n\n let cat = null, counted = 0\n for (;;) {\n if (offset == 0) return pos\n let {offset: start, node} = parent.childBefore(offset)\n if (!node) return pos\n if (!node.isText) return cat ? pos : pos - 1\n\n if (by == \"char\") {\n for (let i = offset - start; i > 0; i--) {\n if (!isExtendingChar(node.text.charAt(i - 1)))\n return pos - 1\n offset--\n pos--\n }\n } else if (by == \"word\") {\n // Work from the current position backwards through text of a singular\n // character category (e.g. \"cat\" of \"#!*\") until reaching a character in a\n // different category (i.e. the end of the word).\n for (let i = offset - start; i > 0; i--) {\n let nextCharCat = charCategory(node.text.charAt(i - 1))\n if (cat == null || counted == 1 && cat == \"space\") cat = nextCharCat\n else if (cat != nextCharCat) return pos\n offset--\n pos--\n counted++\n }\n }\n }\n}", "title": "" }, { "docid": "8ecc90b9dcf82a131e6f65e0f8218e7d", "score": "0.68024576", "text": "function moveBackward(doc, pos, by) {\n if (by != \"char\" && by != \"word\") throw new RangeError(\"Unknown motion unit: \" + by);\n\n var $pos = doc.resolve(pos);\n var parent = $pos.parent,\n offset = $pos.parentOffset;\n\n var cat = null,\n counted = 0;\n for (;;) {\n if (offset == 0) return pos;\n\n var _parent$childBefore = parent.childBefore(offset);\n\n var start = _parent$childBefore.offset;\n var node = _parent$childBefore.node;\n\n if (!node) return pos;\n if (!node.isText) return cat ? pos : pos - 1;\n\n if (by == \"char\") {\n for (var i = offset - start; i > 0; i--) {\n if (!(0, _char.isExtendingChar)(node.text.charAt(i - 1))) return pos - 1;\n offset--;\n pos--;\n }\n } else if (by == \"word\") {\n // Work from the current position backwards through text of a singular\n // character category (e.g. \"cat\" of \"#!*\") until reaching a character in a\n // different category (i.e. the end of the word).\n for (var i = offset - start; i > 0; i--) {\n var nextCharCat = (0, _char.charCategory)(node.text.charAt(i - 1));\n if (cat == null || counted == 1 && cat == \"space\") cat = nextCharCat;else if (cat != nextCharCat) return pos;\n offset--;\n pos--;\n counted++;\n }\n }\n }\n}", "title": "" }, { "docid": "6966d459fcdb2cc072cb426fef2503f5", "score": "0.6765927", "text": "function moveBackward($pos, by) {\n if (by != \"char\" && by != \"word\") throw new RangeError(\"Unknown motion unit: \" + by);\n\n var parent = $pos.parent,\n offset = $pos.parentOffset;\n\n var cat = null,\n counted = 0,\n pos = $pos.pos;\n for (;;) {\n if (offset == 0) return pos;\n\n var _parent$childBefore = parent.childBefore(offset);\n\n var start = _parent$childBefore.offset;\n var node = _parent$childBefore.node;\n\n if (!node) return pos;\n if (!node.isText) return cat ? pos : pos - 1;\n\n if (by == \"char\") {\n for (var i = offset - start; i > 0; i--) {\n if (!isExtendingChar(node.text.charAt(i - 1))) return pos - 1;\n offset--;\n pos--;\n }\n } else if (by == \"word\") {\n // Work from the current position backwards through text of a singular\n // character category (e.g. \"cat\" of \"#!*\") until reaching a character in a\n // different category (i.e. the end of the word).\n for (var i = offset - start; i > 0; i--) {\n var nextCharCat = charCategory(node.text.charAt(i - 1));\n if (cat == null || counted == 1 && cat == \"space\") cat = nextCharCat;else if (cat != nextCharCat) return pos;\n offset--;\n pos--;\n counted++;\n }\n }\n }\n}", "title": "" }, { "docid": "30401bc39229fd16d1f858544d1fa0ec", "score": "0.67541146", "text": "moveBackward(x, y) {\n do {\n if (this.props.across) {\n x--;\n if (x < 0) {\n x = this.props.dims.width-1;\n y--;\n if (y < 0) y = this.props.dims.height-1;\n }\n } else {\n y--;\n if (y < 0) {\n y = this.props.dims.height-1;\n x--;\n if (x < 0) x = this.props.dims.width-1;\n }\n }\n } while (!this.props.crossword.board[y][x].letter);\n this.setActive(x, y);\n this.refDict[this.getIndex(x, y)].writeLetter('');\n }", "title": "" }, { "docid": "a9d8b70687b4af1e4f52dd4e16139413", "score": "0.67109287", "text": "function moveBackward($pos, by) {\n\t if (by != \"char\" && by != \"word\") throw new RangeError(\"Unknown motion unit: \" + by);\n\n\t var parent = $pos.parent,\n\t offset = $pos.parentOffset;\n\n\t var cat = null,\n\t counted = 0,\n\t pos = $pos.pos;\n\t for (;;) {\n\t if (offset == 0) return pos;\n\n\t var _parent$childBefore = parent.childBefore(offset);\n\n\t var start = _parent$childBefore.offset;\n\t var node = _parent$childBefore.node;\n\n\t if (!node) return pos;\n\t if (!node.isText) return cat ? pos : pos - 1;\n\n\t if (by == \"char\") {\n\t for (var i = offset - start; i > 0; i--) {\n\t if (!isExtendingChar(node.text.charAt(i - 1))) return pos - 1;\n\t offset--;\n\t pos--;\n\t }\n\t } else if (by == \"word\") {\n\t // Work from the current position backwards through text of a singular\n\t // character category (e.g. \"cat\" of \"#!*\") until reaching a character in a\n\t // different category (i.e. the end of the word).\n\t for (var i = offset - start; i > 0; i--) {\n\t var nextCharCat = charCategory(node.text.charAt(i - 1));\n\t if (cat == null || counted == 1 && cat == \"space\") cat = nextCharCat;else if (cat != nextCharCat) return pos;\n\t offset--;\n\t pos--;\n\t counted++;\n\t }\n\t }\n\t }\n\t}", "title": "" }, { "docid": "90e0fc0243ae1f4943ee90bbc5c051ab", "score": "0.6572416", "text": "function keyCommandBackspaceWord(editorState) {\n\t var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n\t var selection = strategyState.getSelection();\n\t var offset = selection.getStartOffset();\n\t // If there are no words before the cursor, remove the preceding newline.\n\t if (offset === 0) {\n\t return moveSelectionBackward(strategyState, 1);\n\t }\n\t var key = selection.getStartKey();\n\t var content = strategyState.getCurrentContent();\n\t var text = content.getBlockForKey(key).getText().slice(0, offset);\n\t var toRemove = DraftRemovableWord.getBackward(text);\n\t return moveSelectionBackward(strategyState, toRemove.length || 1);\n\t }, 'backward');\n\n\t if (afterRemoval === editorState.getCurrentContent()) {\n\t return editorState;\n\t }\n\n\t return EditorState.push(editorState, afterRemoval, 'remove-range');\n\t}", "title": "" }, { "docid": "90e0fc0243ae1f4943ee90bbc5c051ab", "score": "0.6572416", "text": "function keyCommandBackspaceWord(editorState) {\n\t var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n\t var selection = strategyState.getSelection();\n\t var offset = selection.getStartOffset();\n\t // If there are no words before the cursor, remove the preceding newline.\n\t if (offset === 0) {\n\t return moveSelectionBackward(strategyState, 1);\n\t }\n\t var key = selection.getStartKey();\n\t var content = strategyState.getCurrentContent();\n\t var text = content.getBlockForKey(key).getText().slice(0, offset);\n\t var toRemove = DraftRemovableWord.getBackward(text);\n\t return moveSelectionBackward(strategyState, toRemove.length || 1);\n\t }, 'backward');\n\n\t if (afterRemoval === editorState.getCurrentContent()) {\n\t return editorState;\n\t }\n\n\t return EditorState.push(editorState, afterRemoval, 'remove-range');\n\t}", "title": "" }, { "docid": "481b5450736aec3a9dc39817a09f12cd", "score": "0.6516265", "text": "function keyCommandBackspaceWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n // If there are no words before the cursor, remove the preceding newline.\n if (offset === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(0, offset);\n var toRemove = DraftRemovableWord.getBackward(text);\n return moveSelectionBackward(strategyState, toRemove.length || 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "title": "" }, { "docid": "481b5450736aec3a9dc39817a09f12cd", "score": "0.6516265", "text": "function keyCommandBackspaceWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n // If there are no words before the cursor, remove the preceding newline.\n if (offset === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(0, offset);\n var toRemove = DraftRemovableWord.getBackward(text);\n return moveSelectionBackward(strategyState, toRemove.length || 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "title": "" }, { "docid": "481b5450736aec3a9dc39817a09f12cd", "score": "0.6516265", "text": "function keyCommandBackspaceWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n // If there are no words before the cursor, remove the preceding newline.\n if (offset === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(0, offset);\n var toRemove = DraftRemovableWord.getBackward(text);\n return moveSelectionBackward(strategyState, toRemove.length || 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "title": "" }, { "docid": "481b5450736aec3a9dc39817a09f12cd", "score": "0.6516265", "text": "function keyCommandBackspaceWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n // If there are no words before the cursor, remove the preceding newline.\n if (offset === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(0, offset);\n var toRemove = DraftRemovableWord.getBackward(text);\n return moveSelectionBackward(strategyState, toRemove.length || 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "title": "" }, { "docid": "481b5450736aec3a9dc39817a09f12cd", "score": "0.6516265", "text": "function keyCommandBackspaceWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n // If there are no words before the cursor, remove the preceding newline.\n if (offset === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(0, offset);\n var toRemove = DraftRemovableWord.getBackward(text);\n return moveSelectionBackward(strategyState, toRemove.length || 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "title": "" }, { "docid": "481b5450736aec3a9dc39817a09f12cd", "score": "0.6516265", "text": "function keyCommandBackspaceWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n // If there are no words before the cursor, remove the preceding newline.\n if (offset === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(0, offset);\n var toRemove = DraftRemovableWord.getBackward(text);\n return moveSelectionBackward(strategyState, toRemove.length || 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "title": "" }, { "docid": "481b5450736aec3a9dc39817a09f12cd", "score": "0.6516265", "text": "function keyCommandBackspaceWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n // If there are no words before the cursor, remove the preceding newline.\n if (offset === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(0, offset);\n var toRemove = DraftRemovableWord.getBackward(text);\n return moveSelectionBackward(strategyState, toRemove.length || 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "title": "" }, { "docid": "481b5450736aec3a9dc39817a09f12cd", "score": "0.6516265", "text": "function keyCommandBackspaceWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n // If there are no words before the cursor, remove the preceding newline.\n if (offset === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(0, offset);\n var toRemove = DraftRemovableWord.getBackward(text);\n return moveSelectionBackward(strategyState, toRemove.length || 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "title": "" }, { "docid": "481b5450736aec3a9dc39817a09f12cd", "score": "0.6516265", "text": "function keyCommandBackspaceWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n // If there are no words before the cursor, remove the preceding newline.\n if (offset === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(0, offset);\n var toRemove = DraftRemovableWord.getBackward(text);\n return moveSelectionBackward(strategyState, toRemove.length || 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "title": "" }, { "docid": "481b5450736aec3a9dc39817a09f12cd", "score": "0.6516265", "text": "function keyCommandBackspaceWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n // If there are no words before the cursor, remove the preceding newline.\n if (offset === 0) {\n return moveSelectionBackward(strategyState, 1);\n }\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(0, offset);\n var toRemove = DraftRemovableWord.getBackward(text);\n return moveSelectionBackward(strategyState, toRemove.length || 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "title": "" }, { "docid": "6670012d5f193dc31f4e8a4c69d6ec3f", "score": "0.64949924", "text": "function keyCommandBackspaceWord(editorState){var afterRemoval=removeTextWithStrategy(editorState,function(strategyState){var selection=strategyState.getSelection(),offset=selection.getStartOffset();// If there are no words before the cursor, remove the preceding newline.\nif(0===offset)return moveSelectionBackward(strategyState,1);var key=selection.getStartKey(),content=strategyState.getCurrentContent(),text=content.getBlockForKey(key).getText().slice(0,offset),toRemove=DraftRemovableWord.getBackward(text);return moveSelectionBackward(strategyState,toRemove.length||1);},\"backward\");return afterRemoval===editorState.getCurrentContent()?editorState:EditorState.push(editorState,afterRemoval,\"remove-range\");}", "title": "" }, { "docid": "abed1c60c70c474efa6a6347a65382af", "score": "0.64078", "text": "function rl_backward_char(count, key) {\n if (count < 0) {\n rl_forward_char(-count, key);\n return;\n }\n\n rl_point -= count;\n if (rl_point < 0) {\n rl_point = 0;\n }\n}", "title": "" }, { "docid": "0273631aaf1082f02f22b1f2ac1a89ef", "score": "0.64029884", "text": "bwd() { this.pos--; }", "title": "" }, { "docid": "f26d73378c839c08f5e8793ce8d3b700", "score": "0.6260488", "text": "backFromEnd(str, endPosition, spanConfig) {\n const isWordEdge = (chars) =>\n isNotWord(\n (char) => spanConfig.isBlankCharacter(char),\n (char) => spanConfig.isDelimiter(char),\n chars\n )\n\n return backToWord(str, endPosition, isWordEdge)\n }", "title": "" }, { "docid": "aa34356c2a60a8a3fd5c4a0d37bd4d22", "score": "0.6141729", "text": "function jumpPreviousWord() {\n // From current position to start of line.\n const textToStartOfLine = currentDocument.getText(\n new vscode.Range(\n currentPosition.line /* start line */, 0 /* start column */,\n currentPosition.line /* end line */, currentPosition.character /* end column */,\n )\n );\n\n // Result of looking for first white space in rest of line.\n const regexResult = /\\s+/.exec(reverseString(textToStartOfLine));\n\n // No result - near start of line (but not at start - we already tested for that).\n if (!regexResult) {\n // Go to start of line.\n goToStartOfCurrentLine();\n // Do nothing more.\n return;\n } else {\n // Go backward to previous space. Work out previous position we want to be at.\n const nextPosition = activeEditor.document.positionAt(currentOffset - (regexResult.index + regexResult[0].length));\n activeEditor.selection = new vscode.Selection(nextPosition /* start */, nextPosition /* end */);\n return;\n }\n }", "title": "" }, { "docid": "63f3b116c17f81ccb8be07af5b7e0896", "score": "0.6121719", "text": "function moveSelectionBackward(editorState,maxDistance){var selection=editorState.getSelection(),content=editorState.getCurrentContent(),key=selection.getStartKey(),offset=selection.getStartOffset(),focusKey=key,focusOffset=0;if(maxDistance>offset){var keyBefore=content.getKeyBefore(key);if(null==keyBefore)focusKey=key;else{focusKey=keyBefore;focusOffset=content.getBlockForKey(keyBefore).getText().length;}}else focusOffset=offset-maxDistance;return selection.merge({focusKey:focusKey,focusOffset:focusOffset,isBackward:!0});}", "title": "" }, { "docid": "98461bcf0021b4edf35ddab1e6650cba", "score": "0.6031252", "text": "deleteBackward(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var {\n unit = 'character'\n } = options;\n editor.deleteBackward(unit);\n }", "title": "" }, { "docid": "eeb40c7c9516df19f086a4ef72e98da2", "score": "0.60244954", "text": "function reverseWordOrder(string) {\n \n}", "title": "" }, { "docid": "e3cd356f107644466cefc35ea34a6bc5", "score": "0.60227627", "text": "deleteBackward(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var {\n unit = 'character'\n } = options;\n editor.deleteBackward(unit);\n }", "title": "" }, { "docid": "6578f77376097702032518b2f37a2084", "score": "0.6004896", "text": "function moveBackToList(word) { // word är det ord som ska flyttas tillbaks\n\tfor (let i = 0; i < wordElems.length; i++) {\n\t\tif (wordElems[i].innerHTML == \"\") {\n\t\t\twordElems[i].innerHTML = word;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\t\n} // End moveBackToList", "title": "" }, { "docid": "e313cdae183c277d8600ee77c1acbb51", "score": "0.6001209", "text": "function reverseWordOrder(string){\n\n}", "title": "" }, { "docid": "f573338d730d89791265dc4d3ed36eec", "score": "0.5987652", "text": "function readBackward(string) {\n return string.split('').reverse().join('');\n}", "title": "" }, { "docid": "2f171acc62d96de94f138c078f5bf0c1", "score": "0.59793353", "text": "function moveBackward() {\n currentSong--;\n if(currentSong < 0) {\n currentSong = allSongs.length - 1;\n }\n goWithTheFlow();\n}", "title": "" }, { "docid": "6c40b39de754a3acdcb1154e31b6b7e4", "score": "0.5959921", "text": "function reverse(word) {\n\tvar backwardString = '';\n\tvar maxNumber = word.length - 1;\n\t\tfor (i = maxNumber; i >= 0; i--) {\n\t\t\tbackwardString += word[i];\n\t\t}\n\t\treturn backwardString;\n}", "title": "" }, { "docid": "7688afcfe293ae824eddf0ca9a6eef4b", "score": "0.59389687", "text": "popWord() {\n const lowByte = this.popByte();\n const highByte = this.popByte();\n return word(highByte, lowByte);\n }", "title": "" }, { "docid": "1fb0ba5528cadf2f6bf1da3449673de8", "score": "0.59259677", "text": "popWord() {\n const lowByte = this.popByte();\n const highByte = this.popByte();\n return word(highByte, lowByte);\n }", "title": "" }, { "docid": "344703c5c55c3074667d99d22f0a17e2", "score": "0.58850884", "text": "function reverseWord(word) {\n return word.split(\"\").reverse().join(\"\");\n }", "title": "" }, { "docid": "23193fbef8e8b62eea007244853f5c67", "score": "0.58734024", "text": "function addNewWordAtBack() { \n\t\tvar newWordZ = distanceToWordStartPoint + distanceToMoveOnEachTimeStep * Math.random(); \n\t\taddNewWord(newWordZ); \n\t}", "title": "" }, { "docid": "9dfabf224184451ff9d8b7603061b248", "score": "0.58627427", "text": "function reverseWordOrder(str){\n\treturn(str);\n}", "title": "" }, { "docid": "795a687f38c66abf425c3ac84c1fea28", "score": "0.5806709", "text": "function reverseWord(word) { \n\n if (word) {\n let newWord = word\n return newWord.split('').reverse().join('');\n } \n\n return \n \n}", "title": "" }, { "docid": "b189b38f3865ffa5e406b90b6af4eab8", "score": "0.5798589", "text": "function reverseWord(string){\n\n}", "title": "" }, { "docid": "b189b38f3865ffa5e406b90b6af4eab8", "score": "0.5798589", "text": "function reverseWord(string){\n\n}", "title": "" }, { "docid": "1f90be16e046d73e4987e00495801be9", "score": "0.5791733", "text": "function reverseWord(sentence, wordStart, wordEnd) {\n var start = wordStart;\n var end = wordEnd;\n while (start < end) {\n var tmp = sentence[start];\n sentence[start] = sentence[end];\n sentence[end] = tmp;\n start++;\n end--;\n }\n}", "title": "" }, { "docid": "e897a39523832c49b9019e69e5c7e3e4", "score": "0.57877177", "text": "function keyCommandPlainBackspace(editorState) {\n\t var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n\t var selection = strategyState.getSelection();\n\t var content = strategyState.getCurrentContent();\n\t var key = selection.getAnchorKey();\n\t var offset = selection.getAnchorOffset();\n\t var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n\t return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n\t }, 'backward');\n\n\t if (afterRemoval === editorState.getCurrentContent()) {\n\t return editorState;\n\t }\n\n\t var selection = editorState.getSelection();\n\t return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n\t}", "title": "" }, { "docid": "e897a39523832c49b9019e69e5c7e3e4", "score": "0.57877177", "text": "function keyCommandPlainBackspace(editorState) {\n\t var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n\t var selection = strategyState.getSelection();\n\t var content = strategyState.getCurrentContent();\n\t var key = selection.getAnchorKey();\n\t var offset = selection.getAnchorOffset();\n\t var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n\t return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n\t }, 'backward');\n\n\t if (afterRemoval === editorState.getCurrentContent()) {\n\t return editorState;\n\t }\n\n\t var selection = editorState.getSelection();\n\t return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n\t}", "title": "" }, { "docid": "01da5333334a545b41b456144f706ca0", "score": "0.5783037", "text": "function keyCommandPlainBackspace(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}", "title": "" }, { "docid": "01da5333334a545b41b456144f706ca0", "score": "0.5783037", "text": "function keyCommandPlainBackspace(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}", "title": "" }, { "docid": "01da5333334a545b41b456144f706ca0", "score": "0.5783037", "text": "function keyCommandPlainBackspace(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}", "title": "" }, { "docid": "01da5333334a545b41b456144f706ca0", "score": "0.5783037", "text": "function keyCommandPlainBackspace(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}", "title": "" }, { "docid": "01da5333334a545b41b456144f706ca0", "score": "0.5783037", "text": "function keyCommandPlainBackspace(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}", "title": "" }, { "docid": "01da5333334a545b41b456144f706ca0", "score": "0.5783037", "text": "function keyCommandPlainBackspace(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}", "title": "" }, { "docid": "01da5333334a545b41b456144f706ca0", "score": "0.5783037", "text": "function keyCommandPlainBackspace(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}", "title": "" }, { "docid": "01da5333334a545b41b456144f706ca0", "score": "0.5783037", "text": "function keyCommandPlainBackspace(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}", "title": "" }, { "docid": "01da5333334a545b41b456144f706ca0", "score": "0.5783037", "text": "function keyCommandPlainBackspace(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}", "title": "" }, { "docid": "01da5333334a545b41b456144f706ca0", "score": "0.5783037", "text": "function keyCommandPlainBackspace(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var content = strategyState.getCurrentContent();\n var key = selection.getAnchorKey();\n var offset = selection.getAnchorOffset();\n var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n }, 'backward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n var selection = editorState.getSelection();\n return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}", "title": "" }, { "docid": "1f676bb6d4f1e00cf432676c47ad26d2", "score": "0.5782045", "text": "function lastCharacter(word) {\n return word [ word.length - 1 ];\n}", "title": "" }, { "docid": "db72a4082ed7bc0d612795e270fb6be9", "score": "0.5775176", "text": "moveWordRight(row, dx, word) {\n let overflow = row.moveWordRight(word, dx + word.x);\n while (overflow < row.words.length) {\n this.moveWordDownARow(row.idx);\n }\n }", "title": "" }, { "docid": "28a9314751087053b197b634b682d791", "score": "0.57686317", "text": "backSpace() {\n // We can only delete characters in the buffer\n if (this.cursorIndex > 0) {\n this.buffer.remove(this.cursorIndex - 1);\n this.update(this.buffer.length + 1, this.cursorIndex - 1);\n } else {\n return;\n }\n }", "title": "" }, { "docid": "f545c2b64e8f00a1081a958c4dc35dfe", "score": "0.5759495", "text": "function backward () {\r\n var i = this.position();\r\n\r\n if (i > 0) {\r\n this.parent().removeElement(this).add(this, i - 1);\r\n }\r\n\r\n return this\r\n}", "title": "" }, { "docid": "82c98b3f5ce2f05ecb770ba575c6ffea", "score": "0.5753903", "text": "function moveSelectionBackward(editorState, maxDistance) {\n var selection = editorState.getSelection();\n var content = editorState.getCurrentContent();\n var key = selection.getStartKey();\n var offset = selection.getStartOffset();\n\n var focusKey = key;\n var focusOffset = 0;\n\n if (maxDistance > offset) {\n var keyBefore = content.getKeyBefore(key);\n if (keyBefore == null) {\n focusKey = key;\n } else {\n focusKey = keyBefore;\n var blockBefore = content.getBlockForKey(keyBefore);\n focusOffset = blockBefore.getText().length;\n }\n } else {\n focusOffset = offset - maxDistance;\n }\n\n return selection.merge({\n focusKey: focusKey,\n focusOffset: focusOffset,\n isBackward: true\n });\n}", "title": "" }, { "docid": "82c98b3f5ce2f05ecb770ba575c6ffea", "score": "0.5753903", "text": "function moveSelectionBackward(editorState, maxDistance) {\n var selection = editorState.getSelection();\n var content = editorState.getCurrentContent();\n var key = selection.getStartKey();\n var offset = selection.getStartOffset();\n\n var focusKey = key;\n var focusOffset = 0;\n\n if (maxDistance > offset) {\n var keyBefore = content.getKeyBefore(key);\n if (keyBefore == null) {\n focusKey = key;\n } else {\n focusKey = keyBefore;\n var blockBefore = content.getBlockForKey(keyBefore);\n focusOffset = blockBefore.getText().length;\n }\n } else {\n focusOffset = offset - maxDistance;\n }\n\n return selection.merge({\n focusKey: focusKey,\n focusOffset: focusOffset,\n isBackward: true\n });\n}", "title": "" }, { "docid": "82c98b3f5ce2f05ecb770ba575c6ffea", "score": "0.5753903", "text": "function moveSelectionBackward(editorState, maxDistance) {\n var selection = editorState.getSelection();\n var content = editorState.getCurrentContent();\n var key = selection.getStartKey();\n var offset = selection.getStartOffset();\n\n var focusKey = key;\n var focusOffset = 0;\n\n if (maxDistance > offset) {\n var keyBefore = content.getKeyBefore(key);\n if (keyBefore == null) {\n focusKey = key;\n } else {\n focusKey = keyBefore;\n var blockBefore = content.getBlockForKey(keyBefore);\n focusOffset = blockBefore.getText().length;\n }\n } else {\n focusOffset = offset - maxDistance;\n }\n\n return selection.merge({\n focusKey: focusKey,\n focusOffset: focusOffset,\n isBackward: true\n });\n}", "title": "" }, { "docid": "82c98b3f5ce2f05ecb770ba575c6ffea", "score": "0.5753903", "text": "function moveSelectionBackward(editorState, maxDistance) {\n var selection = editorState.getSelection();\n var content = editorState.getCurrentContent();\n var key = selection.getStartKey();\n var offset = selection.getStartOffset();\n\n var focusKey = key;\n var focusOffset = 0;\n\n if (maxDistance > offset) {\n var keyBefore = content.getKeyBefore(key);\n if (keyBefore == null) {\n focusKey = key;\n } else {\n focusKey = keyBefore;\n var blockBefore = content.getBlockForKey(keyBefore);\n focusOffset = blockBefore.getText().length;\n }\n } else {\n focusOffset = offset - maxDistance;\n }\n\n return selection.merge({\n focusKey: focusKey,\n focusOffset: focusOffset,\n isBackward: true\n });\n}", "title": "" }, { "docid": "82c98b3f5ce2f05ecb770ba575c6ffea", "score": "0.5753903", "text": "function moveSelectionBackward(editorState, maxDistance) {\n var selection = editorState.getSelection();\n var content = editorState.getCurrentContent();\n var key = selection.getStartKey();\n var offset = selection.getStartOffset();\n\n var focusKey = key;\n var focusOffset = 0;\n\n if (maxDistance > offset) {\n var keyBefore = content.getKeyBefore(key);\n if (keyBefore == null) {\n focusKey = key;\n } else {\n focusKey = keyBefore;\n var blockBefore = content.getBlockForKey(keyBefore);\n focusOffset = blockBefore.getText().length;\n }\n } else {\n focusOffset = offset - maxDistance;\n }\n\n return selection.merge({\n focusKey: focusKey,\n focusOffset: focusOffset,\n isBackward: true\n });\n}", "title": "" }, { "docid": "82c98b3f5ce2f05ecb770ba575c6ffea", "score": "0.5753903", "text": "function moveSelectionBackward(editorState, maxDistance) {\n var selection = editorState.getSelection();\n var content = editorState.getCurrentContent();\n var key = selection.getStartKey();\n var offset = selection.getStartOffset();\n\n var focusKey = key;\n var focusOffset = 0;\n\n if (maxDistance > offset) {\n var keyBefore = content.getKeyBefore(key);\n if (keyBefore == null) {\n focusKey = key;\n } else {\n focusKey = keyBefore;\n var blockBefore = content.getBlockForKey(keyBefore);\n focusOffset = blockBefore.getText().length;\n }\n } else {\n focusOffset = offset - maxDistance;\n }\n\n return selection.merge({\n focusKey: focusKey,\n focusOffset: focusOffset,\n isBackward: true\n });\n}", "title": "" }, { "docid": "82c98b3f5ce2f05ecb770ba575c6ffea", "score": "0.5753903", "text": "function moveSelectionBackward(editorState, maxDistance) {\n var selection = editorState.getSelection();\n var content = editorState.getCurrentContent();\n var key = selection.getStartKey();\n var offset = selection.getStartOffset();\n\n var focusKey = key;\n var focusOffset = 0;\n\n if (maxDistance > offset) {\n var keyBefore = content.getKeyBefore(key);\n if (keyBefore == null) {\n focusKey = key;\n } else {\n focusKey = keyBefore;\n var blockBefore = content.getBlockForKey(keyBefore);\n focusOffset = blockBefore.getText().length;\n }\n } else {\n focusOffset = offset - maxDistance;\n }\n\n return selection.merge({\n focusKey: focusKey,\n focusOffset: focusOffset,\n isBackward: true\n });\n}", "title": "" }, { "docid": "82c98b3f5ce2f05ecb770ba575c6ffea", "score": "0.5753903", "text": "function moveSelectionBackward(editorState, maxDistance) {\n var selection = editorState.getSelection();\n var content = editorState.getCurrentContent();\n var key = selection.getStartKey();\n var offset = selection.getStartOffset();\n\n var focusKey = key;\n var focusOffset = 0;\n\n if (maxDistance > offset) {\n var keyBefore = content.getKeyBefore(key);\n if (keyBefore == null) {\n focusKey = key;\n } else {\n focusKey = keyBefore;\n var blockBefore = content.getBlockForKey(keyBefore);\n focusOffset = blockBefore.getText().length;\n }\n } else {\n focusOffset = offset - maxDistance;\n }\n\n return selection.merge({\n focusKey: focusKey,\n focusOffset: focusOffset,\n isBackward: true\n });\n}", "title": "" }, { "docid": "82c98b3f5ce2f05ecb770ba575c6ffea", "score": "0.5753903", "text": "function moveSelectionBackward(editorState, maxDistance) {\n var selection = editorState.getSelection();\n var content = editorState.getCurrentContent();\n var key = selection.getStartKey();\n var offset = selection.getStartOffset();\n\n var focusKey = key;\n var focusOffset = 0;\n\n if (maxDistance > offset) {\n var keyBefore = content.getKeyBefore(key);\n if (keyBefore == null) {\n focusKey = key;\n } else {\n focusKey = keyBefore;\n var blockBefore = content.getBlockForKey(keyBefore);\n focusOffset = blockBefore.getText().length;\n }\n } else {\n focusOffset = offset - maxDistance;\n }\n\n return selection.merge({\n focusKey: focusKey,\n focusOffset: focusOffset,\n isBackward: true\n });\n}", "title": "" }, { "docid": "82c98b3f5ce2f05ecb770ba575c6ffea", "score": "0.5753903", "text": "function moveSelectionBackward(editorState, maxDistance) {\n var selection = editorState.getSelection();\n var content = editorState.getCurrentContent();\n var key = selection.getStartKey();\n var offset = selection.getStartOffset();\n\n var focusKey = key;\n var focusOffset = 0;\n\n if (maxDistance > offset) {\n var keyBefore = content.getKeyBefore(key);\n if (keyBefore == null) {\n focusKey = key;\n } else {\n focusKey = keyBefore;\n var blockBefore = content.getBlockForKey(keyBefore);\n focusOffset = blockBefore.getText().length;\n }\n } else {\n focusOffset = offset - maxDistance;\n }\n\n return selection.merge({\n focusKey: focusKey,\n focusOffset: focusOffset,\n isBackward: true\n });\n}", "title": "" }, { "docid": "defa26bbd8a6d14c0f8fbd568fd16f2d", "score": "0.5740844", "text": "decrementCipherOffset(state) {\n\t\t\tstate.cipherOffset = state.cipherOffset - 1;\n\n\t\t\tstate.cipherText = encodeText(state.sourceText, state.cipherOffset);\n\t\t}", "title": "" }, { "docid": "c89e25bee6c3df1c4004b3c274909816", "score": "0.57365376", "text": "function backAround(str) {\n var last = str.charAt(str.length - 1);\n return last + str + last;\n\n}", "title": "" }, { "docid": "9b04e7a9c352b20fe6da3a26fd524440", "score": "0.57223684", "text": "function moveSelectionBackward(editorState, maxDistance) {\n\t var selection = editorState.getSelection();\n\t var content = editorState.getCurrentContent();\n\t var key = selection.getStartKey();\n\t var offset = selection.getStartOffset();\n\n\t var focusKey = key;\n\t var focusOffset = 0;\n\n\t if (maxDistance > offset) {\n\t var keyBefore = content.getKeyBefore(key);\n\t if (keyBefore == null) {\n\t focusKey = key;\n\t } else {\n\t focusKey = keyBefore;\n\t var blockBefore = content.getBlockForKey(keyBefore);\n\t focusOffset = blockBefore.getText().length;\n\t }\n\t } else {\n\t focusOffset = offset - maxDistance;\n\t }\n\n\t return selection.merge({\n\t focusKey: focusKey,\n\t focusOffset: focusOffset,\n\t isBackward: true\n\t });\n\t}", "title": "" }, { "docid": "1ec90f102daea3c1b8672ef094f533b0", "score": "0.5702413", "text": "function reverse(word) {\n\tvar wordLetters = word.split('');\n\tvar reverseWord = [];\n\twordLetters.forEach(function(letter){\n\t\treverseWord.unshift(letter)\n\t});\t\t\n\t\treturn reverseWord.join('');\n}", "title": "" }, { "docid": "3b5267b06e177ed166956b68c806cbfb", "score": "0.56899065", "text": "function reverseWord(str, first, last) {\n if (first >= last) {\n return;\n }\n let tmp = str[first];\n str[first] = str[last];\n str[last] = tmp;\n reverseWord(str, first + 1, last - 1);\n}", "title": "" }, { "docid": "368635abe031e88455f375e40cf0c833", "score": "0.5678664", "text": "function backward () {\n var i = this.position();\n\n if (i > 0) {\n this.parent().removeElement(this).add(this, i - 1);\n }\n\n return this\n }", "title": "" }, { "docid": "2b5d0852dc9119ca2156e363789f01a2", "score": "0.5667102", "text": "function stepBackwards () {\n switch (player.estadoPartida.direccion) {\n case 0:\n player.estadoPartida.y++;\n break;\n case 1:\n player.estadoPartida.y--;\n break;\n case 2:\n player.estadoPartida.x--;\n break;\n case 3:\n player.estadoPartida.x++;\n break;\n }\n}", "title": "" }, { "docid": "532bfab5df67cbc8ec56fb95712ae96f", "score": "0.56616545", "text": "function wordReverse(str){\n\tvar strSplit = str.split(' ');\n\trtnStr = \"\";\n\tfor (i=strSplit.length-1;i>=0;i--){\n\t\trtnStr = rtnStr + strSplit[i] + \" \";\n\t}\n\treturn rtnStr;\n}", "title": "" }, { "docid": "a0c35140a006cbeb0c83a7d1fd66cdd3", "score": "0.5658083", "text": "function reverse(word) {\n var a = \"\";\n var b = word.length - 1;\n while (b >= 0) {\n a = a + word[b];\n b = b - 1;\n }\n return a;\n}", "title": "" }, { "docid": "5c5ed0d3ed9cd3706d1851a656c2873c", "score": "0.5647926", "text": "function backAround(str) {\n return str.slice(-1) + str + str.slice(-1);\n}", "title": "" }, { "docid": "bd95251e0b5c9803f0b39064c659194d", "score": "0.56338865", "text": "function myReverse = (word) => {\n return word.split(\"\").reverse().join()\n}", "title": "" }, { "docid": "a3602733c48d8c9ed95c90e5c77467ca", "score": "0.5613243", "text": "function reverseWordInPlace2(str) {\n return str.split(' ').reverse().join(' ').split('').reverse().join('');\n}", "title": "" }, { "docid": "801fe74a3c9d3557145c693979ab74e8", "score": "0.5607675", "text": "function reverseWord(word) {\n var revWord = '';\n var len = word.length - 1;\n for (var i = len; i >= 0; i--) {\n revWord += word[i];\n }\n return revWord;\n}", "title": "" }, { "docid": "94c77c52ac88a122388cb2690dce5371", "score": "0.5577243", "text": "function move_cursor_right_to_100_and_back() \n{\n\ttry{\n\t\tvar sel = E._frame.selection;\n\t\tvar r = sel.createRange();\n\t\tr.moveEnd(\"character\", -100);\n\t\tr.moveStart(\"character\", -100);\n\t\tr.collapse(false);\n\t\tr.select();\n\t} catch(e){}\n}", "title": "" }, { "docid": "60a48907ec92e4e5fdfbf5cb80e2af49", "score": "0.5562157", "text": "function onBackspace(event, change, editor, opts) {\n var value = change.value;\n var startOffset = value.startOffset,\n selection = value.selection;\n\n // Only unwrap...\n // ... with a collapsed selection\n\n if (selection.isExpanded) {\n return undefined;\n }\n\n // ... when at the beginning of nodes\n if (startOffset > 0) {\n return undefined;\n }\n // ... in a list\n var currentItem = (0, _utils.getCurrentItem)(opts, value);\n if (!currentItem) {\n return undefined;\n }\n // ... more precisely at the beginning of the current item\n if (!selection.isAtStartOf(currentItem)) {\n return undefined;\n }\n\n event.preventDefault();\n return (0, _changes.unwrapList)(opts, change);\n}", "title": "" }, { "docid": "b4de6e87660ebb4521c899647bbcb155", "score": "0.55571675", "text": "function backspace(el) {\n\t\tel.removeClass('active');\n\t\tsquareIndexes.pop();\n\t\tletters = letters.substring(0, letters.length - 1);\n\t}", "title": "" }, { "docid": "5d6c8f5d9ca3dbd42d490dde0266e0de", "score": "0.5550457", "text": "function moveDown() {\n moveCursor(0, 1);\n }", "title": "" }, { "docid": "6bc5d015945dfdbb3ca082930e8a11d2", "score": "0.55493355", "text": "function reverse(word) {\n var result;\n var i;\n for (i = 0; i < word.length; i++) {\n result = word.split(\"\").reverse().join(\"\");\n }\n return result;\n }", "title": "" }, { "docid": "abf31ed5a216d662c68a73c36a48c844", "score": "0.55414224", "text": "function reverseWord (word) {\n var wordToArr = word.split('')\n var reversed = wordToArr.reverse()\n reversed = reversed.join()\n return reversed\n}", "title": "" }, { "docid": "1888b8c16b35ca95e191d5c39b16b54a", "score": "0.55384284", "text": "function keyCommandPlainBackspace(editorState){var afterRemoval=removeTextWithStrategy(editorState,function(strategyState){var selection=strategyState.getSelection(),content=strategyState.getCurrentContent(),key=selection.getAnchorKey(),offset=selection.getAnchorOffset(),charBehind=content.getBlockForKey(key).getText()[offset-1];return moveSelectionBackward(strategyState,charBehind?UnicodeUtils.getUTF16Length(charBehind,0):1);},\"backward\");if(afterRemoval===editorState.getCurrentContent())return editorState;var selection=editorState.getSelection();return EditorState.push(editorState,afterRemoval.set(\"selectionBefore\",selection),selection.isCollapsed()?\"backspace-character\":\"remove-range\");}", "title": "" }, { "docid": "54a6c40e025b16fa8193073a30207133", "score": "0.5527936", "text": "function reverseWord (word) {\n const splitWord = word.split('');\n return allReversedWord = splitWord.reverse().join('');\n}", "title": "" }, { "docid": "80126cc7129f7d87ea3a01461a3e613d", "score": "0.551695", "text": "function backspace() {\r\n\tif(input.value.length === fnInds[fnInds.length-1]) {\r\n\t\tinput.value = input.value.slice(0, -fnLengths[fnLengths.length-1]);\r\n\t\tfnInds.pop();\r\n\t\tfnLengths.pop();\r\n\t\treturn;\r\n\t}\r\n\r\n\tinput.value = input.value.slice(0, -1);\r\n}", "title": "" }, { "docid": "376a943d0666f991cedfcb38fa16291f", "score": "0.5486238", "text": "moveDown(){\n if(this.y < this.endBoundary){\n this.y = this.y + this.yOffset;\n if(this.row>0){\n this.row--;\n }\n }\n }", "title": "" }, { "docid": "844c94da2ce9163947d87e81380b9294", "score": "0.5484007", "text": "function backward(path){\n\n index--;\n \n get_concert(path+`/${index}`,\"Previous\");\n \n\n\n \n }", "title": "" }, { "docid": "ba82802a0db7bb43bdaf9b1e4ba8e05a", "score": "0.5481252", "text": "function wordReverse(string) {\n var result = string.split(\" \");\n return result.reverse().join(\" \");\n}", "title": "" }, { "docid": "f662a2fd20a8f04e6d79c0e71408c0eb", "score": "0.54712594", "text": "function backward(){\n var curTime = player.getCurrentTime();\n player.seekTo(curTime - 1)\n}", "title": "" }, { "docid": "956cb66a573d9cb4b62ebd3d7949440f", "score": "0.5463907", "text": "function right(word) {\n if (word.length >= 3) {\n let last3 = word.substr(word.length - 3);\n let frontPart = word.substr(0, word.length - 3);\n return last3 + frontPart;\n } else {\n return word;\n }\n}", "title": "" }, { "docid": "ca6d935cccae6f4ea3fbd2c1fe27832f", "score": "0.5458482", "text": "function getWordAfter(node, offset)\n{\n\tif(!node.lastWord || node.lastWord.node_offset < offset)\n\t{\n\t\treturn null;\n\t}\n\telse\n\t{\n\t\tvar word = node.firstWord;\n\t\t\n\t\twhile(word != node.lastWord && word.node_offset < offset)\n\t\t{\n\t\t\tword = word.nextWord;\n\t\t}\n\t\t\n\t\treturn word;\n\t}\n}", "title": "" }, { "docid": "8ea536cda63d30ef11b6da1a2721d988", "score": "0.5456938", "text": "function deleteLetterIndex(e) {\n const word = document.querySelector('.word.active') || wordsContainer.firstChild\n if (word.lastChild.classList.contains('extra') && e.keyCode === 8) {\n letterIndex--\n letterIndex = letterIndex <= 0 ? 0 : letterIndex\n slashCoords()\n word.removeChild(word.lastChild)\n } else if (e.keyCode === 8 || e.keyCode === 46) {\n letterIndex--\n letterIndex = letterIndex <= 0 ? 0 : letterIndex\n const letter = word.children[letterIndex]\n letter.className = ''\n slashCoords()\n } \n}", "title": "" }, { "docid": "7d95728c21fc2c5307dd1ffd05004bf9", "score": "0.5453218", "text": "function navyDecipher(word) {\n let new_word = '';\n let index;\n let table = [\n ['m','n','o','p','q'],\n ['r','s','t','u','v'],\n ['w','x','y','z','a'],\n ['b','c','d','e','f'],\n ['g','h','i','j','k']\n ]\n for(let i=0;i<word.length;i++){\n //se não for uma coordenada, mantem o caracter\n if(!word[i].match(/^[0-9a-z]+$/)){new_word+=word[i];}\n //obtem a letra correspondente à coordenada\n else{\n index = i++;\n new_word+=table[Number(word[i])][word.charCodeAt(index)-97]\n }\n }\n return(new_word);\n}", "title": "" }, { "docid": "9923a24e7f72c31602543a7425e5688d", "score": "0.5427306", "text": "function moveDown () {\n if (search_keybindings_currentIndex >= search_keybindings_resultLinks.length - 1) {\n console.log('└ EOL')\n return\n }\n\n console.log('│ current index is ' + search_keybindings_currentIndex)\n search_keybindings_currentIndex++\n console.log('└ targeting ' + search_keybindings_currentIndex)\n selectResult(search_keybindings_currentIndex)\n}", "title": "" }, { "docid": "ae61ccf316652dff3727b3523a0c0025", "score": "0.54257023", "text": "function flip(str, spec) {\n\tconst a = str.split(\" \").reverse().join(\" \");\n\tconst b = str.split(\" \").map(x => x.split(\"\").reverse().join(\"\")).join(\" \");\n\t\n\treturn spec === \"word\" ? b : a;\n}", "title": "" }, { "docid": "7fed01c112a1acdcf89a2bdda08477d2", "score": "0.5414762", "text": "function reverse(word){\n\tvar result=word.split('');\n\tresult=result.reverse().join('');\n\treturn result;\n}", "title": "" }, { "docid": "c5a7435ff408b9f9e36fd9f7dd2980b1", "score": "0.53979903", "text": "function moveUp() {\n moveCursor(0, -1);\n }", "title": "" } ]
332026188bb9fab7f90606b59ebfd772
if not Monday, advance to the next Monday morning at 0:0
[ { "docid": "536cf9402bfc0e567ae4ec04fad48390", "score": "0.763785", "text": "function FiveFieldTimeAdvanceToMondayMorning(arr) {\n\tvar day = FiveFieldTimeGetDay(arr);\n\tif (day==1) return;\n\n\tif (day==0) \n\t\tFiveFieldTimeIncrease(arr, 1);\n\telse\n\t\tFiveFieldTimeIncrease(arr, 8-day);\n\t\t\n\tarr[3] = 0;\n\tarr[4] = 0;\n}", "title": "" } ]
[ { "docid": "690c8930bc0df17189a4b9533562418f", "score": "0.7674368", "text": "function scheduleNextWeek() {\n const date = new Date();\n const day = date.getDay();\n if (day === 0) {\n schedulePlusN(1)();\n } else if (day > 0) {\n schedulePlusN(8 - day)();\n }\n }", "title": "" }, { "docid": "2145e02af60fbb1dd2bc648796786089", "score": "0.66255724", "text": "function nextIndex(index){\n\tvar day = index % WEEK;\n\tvar blockOfDay = Math.floor(index / WEEK);\n\n\tblockOfDay++;\n\tif (blockOfDay > (HOURS * hourlyResolution)){\n\t\tblockOfDay %= HOURS * hourlyResolution;\n\t\tday = (day + 1) % WEEK;\n\t}\n\n\treturn day + blockOfDay * WEEK;\n}", "title": "" }, { "docid": "d5388b6dbbf9e796900892183e018f5e", "score": "0.6595901", "text": "function nextWeek () {\n\tif(day > daysInMonth-6) { // if there is less than 6 days to the end of the month\n\t\tday = 1; // change the day to first day of month\n\t\tnextMonth(); // calling a \"next month\" funtion to change the month\n\t} else { // if there is more than 6 days to the end of the month\n\t\tweekToDisplay[4]++; // show next week\n\t\tday+=7; // add 7 to current day\n\t}\n\tremoveWeeks(); // remove calendar elements\n\tcreateCalendar(); // create new calendar elements\n}", "title": "" }, { "docid": "a813cd8741d7e10c1bc47e38bd37cb6f", "score": "0.65835905", "text": "adjDayOfWeekToStartOnMonday(today) {\n let dayOfWeek = this.dateAdapter.getDayOfWeek(today);\n dayOfWeek = dayOfWeek === 0 ? 6 : (dayOfWeek - 1);\n return dayOfWeek;\n }", "title": "" }, { "docid": "cb43e4dea5f9ed54b20c8bf454b5c229", "score": "0.6457248", "text": "function weekCycler (day) {\n day += 1;\n if (day > 6) {\n day = 0;\n }\n return day\n}", "title": "" }, { "docid": "101560542a76e93559cdc881a6d11a6a", "score": "0.6334155", "text": "function forwardWeek() {\n weekArray[0][\"day\"] = weekArray[0][\"day\"] + 7;\n numberOfDays(weekArray[0][\"year\"], weekArray[0][\"month\"]);\n\n if (parseInt(weekArray[0][\"day\"]) > daysInMonth) {\n weekArray[0][\"day\"] = weekArray[0][\"day\"] - daysInMonth;\n weekArray[0][\"month\"] = parseInt(weekArray[0][\"month\"]) + 1;\n }\n\n increaseDays();\n displayDates();\n}", "title": "" }, { "docid": "ecb8c68d092f3ab54f1de7d2e168d474", "score": "0.6315715", "text": "static nextDayOfWeek (dayInt, startDate = null) {\n var date = (startDate) ? moment(startDate).add(1, 'days') : moment()\n // // test xmas 2014, a thursday or 4\n // date = (startDate) ? moment(startDate).add(1, 'days') : moment('12/25/2014', 'MM/DD/YYYY')\n\n if (date.isoWeekday() <= dayInt) {\n // return that week's day\n return date.isoWeekday(dayInt)\n } else {\n // return the following week's day\n return date.add(1, 'weeks').isoWeekday(dayInt)\n }\n }", "title": "" }, { "docid": "199fc817e5873404f4a3a3b0897a19b4", "score": "0.6309766", "text": "getNextDate(day, hour) {\n\t\tlet now = new Date();\n\t\tlet nextTime = new Date();\n\t\t//go to correct day of the week\n\t\tnextTime.setDate(nextTime.getDate() + (day + 7 - nextTime.getDay()) % 7);\n\t\t//if that is after the hour, go to next week.\n\t\tif (now.getDay() == day && now.getHours() > hour - 1) {\n\t\t\tnextTime.setDate(nextTime.getDate() + 7);\n\t\t}\n\t\t// set to the correct hour\n\t\tnextTime.setHours(hour);\n\t\tnextTime.setMinutes(0);\n\t\tnextTime.setSeconds(0);\n\n\t\treturn nextTime;\n\t}", "title": "" }, { "docid": "3e0fd13e65dddb13f598470ecc910868", "score": "0.6296106", "text": "function next() {\n\n let week = {\n nbDays: 0,\n hours: 0\n };\n\n for(let wd in currentWeek) {\n if (currentWeek.hasOwnProperty(wd)) {\n week.nbDays++;\n week.hours += currentWeek[wd];\n }\n }\n\n weeks.push(week);\n currentWeek = {};\n\n weekLoop.setDate(weekLoop.getDate() + 7);\n limit.setDate(limit.getDate() + 7);\n }", "title": "" }, { "docid": "7ef8694c7ee58300e108827b72eddda3", "score": "0.62792146", "text": "function FiveFieldTimeAdvanceToFridayNight(arr) {\n\tvar day = FiveFieldTimeGetDay(arr);\n\tif (day==6) \n\t\tFiveFieldTimeIncrease(arr, 6);\n\telse\n\t\tFiveFieldTimeIncrease(arr, 5-day);\n\t\t\n\tarr[3] = 23;\n\tarr[4] = 59;\n}", "title": "" }, { "docid": "15ebb6cef9c2aa17f9771205eed58f4d", "score": "0.6253898", "text": "function nextWeek()\n{\n\tfor(var i in datesPerWeek)\n\t{\n\t\tvar selectedDate = datesPerWeek[i].split(\"/\");\n\t\tif( parseInt(selectedDate[0]) + 7 > parseInt(daysPerMonth[selectedDate[1]-1]))\n\t\t{\n\t\t\tvar overflowed = (parseInt(selectedDate[0]) + 7) - parseInt(daysPerMonth[selectedDate[1]-1]);\n\t\t\tdatesPerWeek[i] = DateFormat(overflowed, parseInt(selectedDate[1]) + 1, selectedDate[2]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdatesPerWeek[i] = DateFormat(parseInt(selectedDate[0]) + 7, selectedDate[1], selectedDate[2]);\n\t\t}\n\t}\n\tcreateTable();\n}", "title": "" }, { "docid": "221826fff4aab564676a024958311aeb", "score": "0.6247888", "text": "function startOfWeek(date) {\n var d = moment(date)\n var day = d.day()\n if (day === 0) {\n d = d.day(-6)\n return d\n }\n else {\n return d.day(1)\n }\n //var newDate = d.set('date', d.date() - d.day())\n //console.log(\"New Date\", newDate.toString())\n // set day of the week to monday. \n // if it is a sunday, set it to last monday\n return newDate\n}", "title": "" }, { "docid": "3a38e6c6ec07c26e8f51598a7bca61f3", "score": "0.62391526", "text": "function nextGameDay() {\n var dt = new Date()\n var gameDays = [0, 1, 4]\n\n while(!gameDays.includes(dt.getDay())) {\n dt.setDate(dt.getDate() + 1)\n }\n return dt\n}", "title": "" }, { "docid": "4dcd60d4e2b28108854cf2e4adb08ce1", "score": "0.623484", "text": "function getNextDayOfTheWeek(day, excludeToday = true, hour, minute, refDate = new Date()) {\n const dayOfWeek = [0, 1, 2, 3, 4, 5, 6].indexOf(day);\n if (dayOfWeek < 0) return;\n refDate.setHours(hour, minute);\n refDate.setDate(refDate.getDate() + !!excludeToday + ((dayOfWeek + 7 - refDate.getDay() - !!excludeToday) % 7));\n return refDate;\n}", "title": "" }, { "docid": "076894104e79e44675bdbc1f844602f5", "score": "0.62318236", "text": "function getNextDay(days){\n var now = new Date(); \n now.setDate(now.getDate() + (days+(7-now.getDay())) % 7);\n return now;\n }", "title": "" }, { "docid": "0e9bc7f672e98be738a5b7354043774b", "score": "0.62112087", "text": "function NextDay()\n{\n\tif (boolSaveChanges || bSelectChanged)\n\t{\n\t\tSaveChanges(\"MoveToNextDay()\", \"Daily\");\n\t}\n\telse\n\t{\n\t\tMoveToNextDay();\n\t}\n}", "title": "" }, { "docid": "b521a6340bb0800251a1ebc45e870001", "score": "0.61907154", "text": "function startOfWeek() {\n\t\t\t// console.log('StarOfWeek :: targetYear 1 : ' + targetYear);\n\t\t\t// console.log('StarOfWeek :: targetDayOfWeek : '+targetDayOfWeek);\n\t\t\tif (targetDayOfWeek == 0) {\n\t\t\t\ttargetSundayDate = [targetYear,targetMonth,targetDay];\n\t\t\t\t// console.log('if (targetDayOfWeek == 0) then '+targetSundayDate)\n\t\t\t\t// console.log('StarOfWeek :: targetYear 3 : ' + targetYear);\n\t\t\t} else if(targetDayOfWeek<=targetDay) {\n\t\t\t\t// console.log('if(targetDayOfWeek<=targetDay) :: ('+targetDayOfWeek+'<='+targetDay+')');\n\t\t\t\ttargetSundayDate = [targetYear,targetMonth,\n\t\t\t\t\ttargetDay-targetDayOfWeek];\n\t\t\t\t// console.log('StarOfWeek :: targetYear 4 : ' + targetYear);\n\t\t\t} else {\n\t\t\t\t// console.log('if(targetDayOfWeek>targetDay) :: ('+targetDayOfWeek+'>'+targetDay+')');\n\t\t\t\t// console.log('targetMonth :: '+targetMonth);\n\t\t\t\tif (targetMonth==0) {\n\t\t\t\t\tvar tempMonth = 11;\n\t\t\t\t\tvar tempYear = targetYear-1;\n\t\t\t\t} else {\n\t\t\t\t\tvar tempMonth = targetMonth - 1;\n\t\t\t\t\tvar tempYear = targetYear;\n\t\t\t\t}\n\t\t\t\t// console.log('monthName[tempMonth] :: '+monthName[tempMonth]);\n\t\t\t\tvar tempSundayDay = monthLength[tempMonth] \n\t\t\t\t\t- (targetDayOfWeek-targetDay);\n\t\t\t\ttargetSundayDate = [tempYear,tempMonth,tempSundayDay];\n\t\t\t\t// console.log('StarOfWeek :: targetYear 5 : ' + targetSundayDate[0]);\n\t\t\t}\n\n\t\t\t// console.log('StarOfWeek :: targetYear 2 : ' + targetYear);\n\t\t\t// console.log('function startOfWeek :: Sunday: '+ targetSundayDate[2]+' '+monthName[targetSundayDate[1]]+' '+targetSundayDate[0]);\n\t\t\tadjustForLeapYears('startOfWeek()',targetSundayDate[0]);\n\t\t}", "title": "" }, { "docid": "181e35c7196734827b0d6bf1ca225954", "score": "0.61702794", "text": "next_week() {\n this.start_date = this.start_date.next_day(7);\n return this.update_data();\n }", "title": "" }, { "docid": "0cbdabbe88fc635fbf441aeef9daa4b9", "score": "0.61450267", "text": "function getAWeekToday() {\n var now = new Date()\n var tomorrow = new Date(now.getTime() + (7* 24 * 3600 * 1000))\n tomorrow.setHours(12)\n return tomorrow \n}", "title": "" }, { "docid": "a1fbc25d1ffd128f5b82bf98ffcb4ddd", "score": "0.61189735", "text": "function weekdayCalculation() {\n\t\t\t//define local variables\n\t\t\tvar daysOfWeek = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n\t\t\tvar currentDate = new Date(self.year, self.activedate.month - 1, self.activedate.day);\n\t\t\tvar wkdayNum = currentDate.getDay();\n\t\t\tself.activedate.wkday = daysOfWeek[wkdayNum];\n\t\t}", "title": "" }, { "docid": "8ba92e3969445ced456a13fe641e83c2", "score": "0.60456544", "text": "function beginingOfMonth (currentDay, currentDayName) {\n $.each(daysNames, function(key, value) { \n if (key == currentDayName) {\n positionOfCurrentDay = value;\n }\n });\n\n var supportValue = positionOfCurrentDay - (currentDay - 1);\n\n if (positionOfCurrentDay < currentDay) {\n firstDayOfMnthPosition = 7 + supportValue % 7;\n } else {\n firstDayOfMnthPosition = supportValue;\n }\n }", "title": "" }, { "docid": "09a4754239739ae6e64c8eacf61183c5", "score": "0.6033414", "text": "function scheduleNextWeekend() {\n withScheduler(\n 'scheduleNextWeekend',\n (scheduler) => {\n withUniqueTag(\n scheduler,\n 'button',\n matchingAttr('data-track', 'scheduler|date_shortcut_nextweekend'),\n click,\n );\n });\n }", "title": "" }, { "docid": "e2d6e61a87add616b22b8b10723e2f23", "score": "0.6006234", "text": "function dayofweek(d,m,y){\n let t = [ 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4 ];\n y -= m < 3;\n return ( y + y/4 - y/100 + y/400 + t[m-1] + d) % 7;\n}", "title": "" }, { "docid": "adfa94bce91be3b2733120d67ec53f8a", "score": "0.5986644", "text": "function nextWeek() {\r\n calendarLoadDate = new Date(calendarLoadDate.getTime() + 7*oneDay);\r\n loadCalendar(calendarLoadDate);\r\n}", "title": "" }, { "docid": "c48bf4df4f6e46cb613353b2033c73d9", "score": "0.59741795", "text": "function moveOneDay(date) {date.setTime((date.getTime() + 24 * 60 * 60 * 1000)); }", "title": "" }, { "docid": "a4fc100ba03c2fba8a5c58a783a1cb8c", "score": "0.5946073", "text": "nextWeek(){\n return this.addWeeks(1);\n }", "title": "" }, { "docid": "f733c18002032be5bf33737bc4c99183", "score": "0.5944006", "text": "function windowStart(num) {\n if (num < 12) {\n timeStart = num + \":00 AM\"; //Morning\n } else if (num == 12) {\n timeStart = num + \":00 PM\"; //Midday\n } else if (num > 12) {\n num = num - 12;\n timeStart = num + \":00 PM\"; //afternoon\n }\n return timeStart;\n}", "title": "" }, { "docid": "882f326a8d163a36e59a973879097959", "score": "0.5915037", "text": "dayOfWeek(day, month, year) {\n var y0 = year - Math.floor((14 - month) / 12);\n var x = y0 + Math.floor((y0 / 4)) - Math.floor((y0 / 100)) + Math.floor((y0 / 400));\n m0 = month + 12 * Math.floor((14 - month) / 12) - 2;\n var d0 = (day + x + Math.floor((31 * m0) / 12)) % 7;\n console.log(d0);\n var res = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wendsday\", \"Thursday\", \"Friday\", \"saturday\"];\n if (d0 <= res.length) {\n console.log(\"The day falls on :\" + res[d0])\n } else {\n console.log(\"Invalid day \")\n }\n }", "title": "" }, { "docid": "7c437a977996ed0866435e64007963b7", "score": "0.5911193", "text": "function morning() {\n // whole morning routine\n}", "title": "" }, { "docid": "fe23d1aa7f26da7cd7c5c6e4d0afafa0", "score": "0.58991194", "text": "function calculateWeekDay() {\n\tJD0h += 1.5;\n\tlet res = JD0h - 7 * Math.floor(JD0h / 7);\n\tif (res === 0) {\n\t\tDoW = \"SUN\";\n\t}\n\tif (res === 1) {\n\t\tDoW = \"MON\";\n\t}\n\tif (res === 2) {\n\t\tDoW = \"TUE\";\n\t}\n\tif (res === 3) {\n\t\tDoW = \"WED\";\n\t}\n\tif (res === 4) {\n\t\tDoW = \"THU\";\n\t}\n\tif (res === 5) {\n\t\tDoW = \"FRI\";\n\t}\n\tif (res === 6) {\n\t\tDoW = \"SAT\";\n\t}\n}", "title": "" }, { "docid": "7da57ba8337d90aaac307bfa73eeda6e", "score": "0.58930504", "text": "function nextDay() {\n rightNow = SunCalcHelper.addDays(rightNow, 1);\n\n if (rightNow.getDate() !== new Date().getDate()) {\n Elements.decreaseDay.addEventListener('click', previousDay);\n Elements.decreaseDay.classList.remove('is-disabled');\n }\n\n getTimes(userPosition);\n updateCurrentMoment(rightNow);\n}", "title": "" }, { "docid": "f32a184c0ca32803cd9dcec1f5df774e", "score": "0.58872247", "text": "function next(){\n month++;\n if(month==12){\n month=0;\n year++;\n }\n buildCalendar();\n}", "title": "" }, { "docid": "1ef670c3dfff5ef66821af53e3daa990", "score": "0.58823735", "text": "nextDay(){\n return this.addProp(this._time + 24*60*60*1000);\n }", "title": "" }, { "docid": "18318acbaf6552a67bbd5c2cc61e3daa", "score": "0.586878", "text": "function next() {\n\n // Fixing datetime using timezone\n let nz_date_string = new Date().toLocaleString(\"en-US\", { timeZone: \"Europe/Rome\" });\n let d = new Date(nz_date_string);\n\n // Looking in the next 5 days\n for (var i = 0; i < 5; i++) {\n\n // Increase day\n d.setDate(d.getDate() + 1);\n\n if (lessonPlan.lesson_plan[d.getDay()].length == 0)\n continue;\n\n return {\n deltaDays: i+1,\n from: lessonPlan.lesson_plan[d.getDay()][0][1],\n to: lessonPlan.lesson_plan[d.getDay()][0][2],\n course: lessonPlan.lessons[lessonPlan.lesson_plan[d.getDay()][0][0]]\n };\n\n }\n\n // Nothing was found\n return {};\n\n}", "title": "" }, { "docid": "2a71abcd5043af3c1445b903cc8ebe07", "score": "0.58531857", "text": "back_one_week() {\n this.start_date = this.start_date.next_day(-7);\n return this.update_data();\n }", "title": "" }, { "docid": "26e09415275b1d0884223a0cac99c08d", "score": "0.5849114", "text": "function daynight()\n{\n \n if (hours < 12)\n {\n dnstatus = \"Morning\";\n dn = dnstatus;\n return;\n }\n\n if (hours > 12 && hours < 16)\n {\n dnstatus = \"Afternoon\";\n dn = dnstatus;\n return;\n }\n\n if (hours > 16 && hours < 20)\n {\n dnstatus = \"Evening\";\n dn = dnstatus;\n return;\n }\n\n else\n {\n dnstatus = \"Night\";\n dn = dnstatus;\n return;\n }\n return;\n}", "title": "" }, { "docid": "480fdb791f5a2a9f9592165a3add1493", "score": "0.57900214", "text": "function getNextChallengeDay() {\n for (var i = 0; i < 8 ; i++ ) {\n var day = moment().add(i,'days');\n if (day.weekday() == 0) {\n return day.format('YYYY-MM-DD')\n }\n }\n console.error('Could not find next challenge date');\n}", "title": "" }, { "docid": "6c0ab32ade074140af4fd3647cd5fd14", "score": "0.57124865", "text": "function getMonthBeginWeekDay() {\n var temp = currentWeekDay + (7 - currentDay % 7) + 1;\n if (temp > 6) {\n temp -= 7;\n }\n return temp;\n}", "title": "" }, { "docid": "ce367063392c46439659b5f12a66d51f", "score": "0.5695182", "text": "function nextDOW(dayName, excludeToday = true, refDate = new Date()) {\n\tconst dayOfWeek = [\"sun\",\"mon\",\"tue\",\"wed\",\"thu\",\"fri\",\"sat\"]\n .indexOf(dayName.slice(0,3).toLowerCase());\n\tif (dayOfWeek < 0) return;\n\tnewDate = new Date(refDate);\n\tnewDate.setHours(1,0,0,0); // setHours(1) to force correct day in case of UTC/BST issues\n\tnewDate.setDate(newDate.getDate() + !!excludeToday + (dayOfWeek + 7 - newDate.getDay() - !!excludeToday) % 7);\n\treturn newDate;\n}", "title": "" }, { "docid": "2e6788979b67bb787934322458516754", "score": "0.5687804", "text": "function getWeekday(jahr,monat){//monat 1-12\n\tvar dw= new Date(jahr,monat-1,1);//function verwendet monat von 0 bis 11\n\tdw= dw.getDay(); // 0 - So, 1 - Mo, 2 - Di, 3 - Mi, 4 - Do, 5 - Fr, 6 - Sa\n\tif (!dw){\n\t\treturn 6;\n\t}else{\n\t\treturn dw-1;\n\t}\n}//# return 0 - Mo, 1 - Di, 2 - Mi, 3 - Do, 4 - Fr, 5 - Sa, 6 - So", "title": "" }, { "docid": "dde77f8bbf87c98a12b704ccc1c9d10e", "score": "0.5687198", "text": "function getNextReminderTime(){\n var today = new Date(); \n\n //Adding 19 hours to PST will give Australia/ Sydney timezone\n today.setHours(today.getHours() + 19); \n var currentHours = today.getHours();\n nlapiLogExecution('DEBUG', 'currentHours + 2', currentHours + 2);\n if(currentHours + 2 > 16 ){\n //Current hours + 2 hours is past 5. next reminder will be sent the next day at 9 am\n today.setDate(today.getDate() + 1);\n today.setHours(9);\n today.setMinutes(0);\n today.setSeconds(0);\n }\n else if(currentHours + 2 < 9){\n //Current hours + 2 hours is before 9 am. Edge case but this is unlikely to happen since script does not run outside 9-5\n today.setHours(9);\n today.setMinutes(0);\n today.setSeconds(0);\n }\n else{\n // Set next reminder time to today + 2 hours\n today.setHours(today.getHours() + 2);\n }\n\n return today;\n}", "title": "" }, { "docid": "d0fb3122ec2f74b71d3dd1f36fbbbc9a", "score": "0.5680328", "text": "function solution(S, K) {\n \n if (S == \"Mon\") {let d = 0;};\n if (S == \"Tue\") {let d = 1;};\n if (S == \"Wed\") {let d = 2;};\n if (S == \"Thu\") {let d = 3;};\n if (S == \"Fri\") {let d = 4;};\n if (S == \"Sat\") {let d = 5;};\n if (S == \"Sun\") {let d = 6;};\n\n a = (K + d) % 7;\n \n if (d == 0) {return(\"Mon\");};\n if (d == 1) {return(\"Tue\");};\n if (d == 2) {return(\"Wed\");};\n if (d == 3) {return(\"Thu\");};\n if (d == 4) {return(\"Fri\");};\n if (d == 5) {return(\"Sat\");};\n if (d == 6) {return(\"Sun\");};\n}", "title": "" }, { "docid": "eba75fba90bf0a54d15adcbaf4d22523", "score": "0.5679844", "text": "function switchWeek(epochTime) {\n populateWeek(epochTime);\n if (epochTime === currentEpochTime) {\n $(\".\"+currentDay+\".weekday\").addClass(\"current-weekday\");\n }else {\n $(\".weekday\").removeClass(\"current-weekday\");\n }\n }", "title": "" }, { "docid": "4efb1b2dd269d9608c85f7634daac83c", "score": "0.56742996", "text": "function renderWeek(num){\n var daysThisWeek = [31, (((weekThisYear % 4 === 0) && (weekThisYear % 100 !== 0)) || (weekThisYear % 400 === 0)) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n if(calendarId.rows.length > 0){\n var rowLength = calendarId.rows.length;\n for(let c = 0; c < rowLength; c++){\n calendarId.deleteRow(0);\n }\n }\n var row = calendarId.insertRow(0);\n if(num > 0){\n weekThisMonday = weekThisMonday + 1;\n console.log('used');\n }else if(num < 0){\n weekThisMonday = weekThisMonday - 13;\n console.log('used');\n }\n for(let i = 0; i < 7; i++){\n if(i !== 6){\n if((weekThisMonday > daysThisWeek[weekThisMonth]) && ((weekThisMonth + 1) > 11)){\n ++weekThisYear;\n weekThisMonth = 0;\n weekThisMonday = 1;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n ++weekThisMonday;\n }else if((weekThisMonday > daysThisWeek[weekThisMonth]) && ((weekThisMonth + 1) <= 11)){\n ++weekThisMonth;\n weekThisMonday = 1;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n ++weekThisMonday;\n }else if(((weekThisMonday + i) < 1) && ((weekThisMonth - 1) < 0)){\n --weekThisYear;\n weekThisMonth = 11;\n weekThisMonday = daysThisWeek[weekThisMonth] + weekThisMonday;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n ++weekThisMonday;\n }else if((weekThisMonday < 1) && ((weekThisMonth - 1) >= 0)){\n --weekThisMonth;\n weekThisMonday = daysThisWeek[weekThisMonth] + weekThisMonday;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n ++weekThisMonday;\n }else{\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n ++weekThisMonday;\n }\n }else{\n if((weekThisMonday > daysThisWeek[weekThisMonth]) && ((weekThisMonth + 1) > 11)){\n ++weekThisYear;\n weekThisMonth = 0;\n weekThisMonday = 1;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n }else if((weekThisMonday > daysThisWeek[weekThisMonth]) && ((weekThisMonth + 1) <= 11)){\n ++weekThisMonth;\n weekThisMonday = 1;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n }else if(((weekThisMonday + i) < 1) && ((weekThisMonth - 1) < 0)){\n --weekThisYear;\n weekThisMonth = 11;\n weekThisMonday = daysThisWeek[weekThisMonth] + weekThisMonday;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n }else if((weekThisMonday < 1) && ((weekThisMonth - 1) >= 0)){\n --weekThisMonth;\n weekThisMonday = daysThisWeek[weekThisMonth] + weekThisMonday;\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n }else{\n tmp[i] = {year: weekThisYear, month: weekThisMonth, date: weekThisMonday, day: ((i+1) < 7) ? (i+1) : 0};\n }\n }\n }\n for(let i = 0; i < 7; i++){\n var cell = row.insertCell(i);\n cell.innerText = tmp[i].date;\n cell.className = \"calendarThis\";\n if((tmp[i].date === timeNow.date) && (tmp[i].month === timeNow.month) && (tmp[i].year === timeNow.year)){\n cell.className = \"calendarToday\";\n }\n }\n }", "title": "" }, { "docid": "247a39f4eca9ba0a186dde32c1eb32d8", "score": "0.56706935", "text": "function sleep_in(weekday, vacation) {\n switch (true) {\n case !weekday && !vacation:\n break;\n case vacation:\n break;\n default:\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "21bb036e173732fc1c32e85242812a39", "score": "0.5668346", "text": "function nextMonth() {\n month++;\n if (month > 11) {\n alert('Sei arrivato alla fine del calendario.');\n month = 11;\n } else {\n printMonth(month);\n addHolidays(month);\n }\n }", "title": "" }, { "docid": "0d0f41b69b32c8a8c9edb26d83bffe67", "score": "0.56635743", "text": "function dayOfWeek(){\r\n var localOffsetInHours = 2;\r\n var date = new Date();\r\n var offsetInMinutes = date.getTimezoneOffset() + localOffsetInHours * 60;\r\n var d = new Date(date.valueOf() + offsetInMinutes * 60 * 1000);\r\n \r\n var day = d.getDay();\r\n \r\n if( day == 0 ){\r\n // we need it monday-based, not sunday-based\r\n day = 7;\r\n }\r\n return day;\r\n}", "title": "" }, { "docid": "3fcede0a604e10057719ba325a9a5dcc", "score": "0.56578183", "text": "function rdow(self, n) {\n var dt = clone$5(self);\n\n while (n < 0) {\n dt = new Date(dt.getFullYear(), dt.getMonth(), dt.getDate() - 7, dt.getHours(), dt.getMinutes(), dt.getSeconds(), dt.getMilliseconds());\n n += 7;\n }\n\n if (n > 6) {\n var dys = Math.floor(n / 7) * 7;\n dt.setDate(dt.getDate() + dys);\n n = n % 7;\n }\n\n var offset = n - dt.getDay();\n dt.setDate(dt.getDate() + offset + (offset < 0 ? 7 : 0));\n return dt;\n }", "title": "" }, { "docid": "078db6d9908b9077b254f5dc79c7a724", "score": "0.5646296", "text": "function sleep_in(weekday, vacation){\n if(!weekday){\n return true;\n }else{\n if(vacation === true){\n return true;\n }else{\n return false;\n };\n };\n}", "title": "" }, { "docid": "0b69b3619f3a286f925b00c92d894df1", "score": "0.56380534", "text": "function y(a){var b=G.start.day();// normlize cellOffset to beginning-of-week\n// first date's day of week\n// # of days from full weeks\n// # of days from partial last week\nreturn a+=Q[b],7*Math.floor(a/N)+R[(a%N+N)%N]-b}", "title": "" }, { "docid": "d556fc4924fdd398585749e637f2755f", "score": "0.56289303", "text": "night() {\n this.time.setHours(21);\n }", "title": "" }, { "docid": "77983f100b4179c5acc4dd1f682d64fe", "score": "0.56281805", "text": "function russifyWeekDay(day) {\n if (day == 0)\n return 6;\n return day - 1;\n }", "title": "" }, { "docid": "2c9461375beb33045521e57990325976", "score": "0.56224775", "text": "function weekday(i) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__interval__[\"a\" /* default */])(function(date) {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setDate(date.getDate() + step * 7);\n }, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * __WEBPACK_IMPORTED_MODULE_1__duration__[\"d\" /* durationMinute */]) / __WEBPACK_IMPORTED_MODULE_1__duration__[\"a\" /* durationWeek */];\n });\n}", "title": "" }, { "docid": "2c9461375beb33045521e57990325976", "score": "0.56224775", "text": "function weekday(i) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__interval__[\"a\" /* default */])(function(date) {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setDate(date.getDate() + step * 7);\n }, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * __WEBPACK_IMPORTED_MODULE_1__duration__[\"d\" /* durationMinute */]) / __WEBPACK_IMPORTED_MODULE_1__duration__[\"a\" /* durationWeek */];\n });\n}", "title": "" }, { "docid": "2c9461375beb33045521e57990325976", "score": "0.56224775", "text": "function weekday(i) {\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__interval__[\"a\" /* default */])(function(date) {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setDate(date.getDate() + step * 7);\n }, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * __WEBPACK_IMPORTED_MODULE_1__duration__[\"d\" /* durationMinute */]) / __WEBPACK_IMPORTED_MODULE_1__duration__[\"a\" /* durationWeek */];\n });\n}", "title": "" }, { "docid": "fc40eb59b0aad70ebfeea70e242c2f0b", "score": "0.5597663", "text": "getNextWeek(){\n let date = this.state.date;\n const nextWeek = new Date(date.getTime() + (7 * 24 * 60 * 60 * 1000));\n this.setState({date: nextWeek})\n }", "title": "" }, { "docid": "80abf383eec6584dbc4457d491369de4", "score": "0.5592048", "text": "function week(){\n timeSelector=\"week\";\n step=8;\n resetGraph();\n}", "title": "" }, { "docid": "67a9118fe3268996d0ee77e272aff4e0", "score": "0.5590722", "text": "function makeCalender() {\n let dayTrack = 1;\n let monthTrack = 1;\n let weekDay;\n\n for (let i = 0; i < 366; i++) {\n weekDay = getDayOfTheWeek(2020, monthTrack, dayTrack);\n console.log(dayTrack + \"-\" + monthTrack + \n \"-2020 is a \" + weekDay);\n if (dayTrack == maxDayPerMonth[monthTrack]) {\n dayTrack = 1;\n monthTrack += 1;\n } else {\n dayTrack += 1;\n }\n }\n}", "title": "" }, { "docid": "808869d59dce5c9bdef33522a56e0f1e", "score": "0.5587154", "text": "function backWeek() {\n weekArray[0][\"day\"] = weekArray[0][\"day\"] - 7;\n // Monday\n if (parseInt(weekArray[0][\"day\"]) < 0) {\n numberOfDays(weekArray[0][\"year\"], parseInt(weekArray[0][\"month\"]) - 1);\n weekArray[0][\"day\"] = parseInt(daysInMonth) + parseInt(weekArray[0][\"day\"]);\n weekArray[0][\"month\"] = parseInt(weekArray[0][\"month\"]) - 1;\n }\n\n if (parseInt(weekArray[0][\"day\"]) === 0) {\n weekArray[0][\"month\"] = parseInt(weekArray[0][\"month\"]) - 1;\n if (parseInt(weekArray[0][\"month\"]) === 0) {\n weekArray[0][\"month\"] = 12;\n weekArray[0][\"year\"] = parseInt(weekArray[0][\"year\"]) - 1;\n }\n numberOfDays(weekArray[0][\"year\"], weekArray[0][\"month\"]);\n weekArray[0][\"day\"] = daysInMonth;\n }\n increaseDays();\n displayDates();\n}", "title": "" }, { "docid": "2281823430ed9eee7fafc8adff1a8703", "score": "0.5578122", "text": "function addDaysFromNextMonth(){\n if(new Date(dateInfo.currentYear, dateInfo.currentMonth, monthInfo[dateInfo.currentMonth][1],0,0,0,0).getDay()!=6){\n var day = new Date(dateInfo.currentYear, dateInfo.currentMonth+1, 1,0,0,0,0).getDay();\n var j=1;\n for(i=day;i<=6;i++){\n createDayDiv(dateInfo.currentYear, dateInfo.currentMonth+1, j++);\n }\n }\n}", "title": "" }, { "docid": "6b56639d3506147f5d3d845b8770cc4a", "score": "0.5574441", "text": "morning() {\n this.time.setHours(4);\n }", "title": "" }, { "docid": "7a04b30d652742384da98b0db8afd83c", "score": "0.5561697", "text": "function first_day (new_date) {\n\tvar day_of_week = new_date.getDay();\n\tvar day_in_month = new_date.getDate();\n\tif (day_in_month > 1) {\n\t\tday_in_month -= 1;\n\t\tday_in_month = day_in_month % 7;\n\t\twhile (day_in_month > 0) {\n\t\t\tif (day_of_week === 0) {\n\t\t\t\tday_of_week = 6;\n\t\t\t} else {\n\t\t\t\tday_of_week --;\n\t\t\t}\n\n\t\t\tday_in_month --;\n\t\t}\n\t} \n\treturn day_of_week;\n}", "title": "" }, { "docid": "4a28599c9d81436d383a3a37a51a5b83", "score": "0.5542857", "text": "function scheduleNextPart() {\n \tif ((currentPos+1) < schedule.length) {\t\t\t\t// If we're not at the end of schedule...\n\t \tSeniorDads.Music.SetBreakPoint(\t\t\t\t\t\t// Set the next part to execute at the next music breakpoint.\n\t \t\t\tschedule[currentPos+1].trackPos, \n\t \t\t\tschedule[currentPos+1].patternPos, \n\t \t\t\tdoNextPart\n\t \t);\n\t \tif (DEBUG) \t\t\t// If we're debugging, display when the next part is going to happen.\n\t\t \tdocument.getElementById('scheduleInfo').innerHTML = \"<br/><br/>Playing schedule part \" + currentPos + \" of \" + schedule.length +\n\t \t\t\". Next part will be played at module position track \" + SeniorDads.Music.BreakPoint_Track +\", position \" + SeniorDads.Music.BreakPoint_Pattern + \n\t \t\t\". \";\n \t}\n \telse {\t\t// If we're at the end of the schedule, reset schedule/\n \t\tif (DEBUG) document.getElementById('scheduleInfo').innerHTML = \"<br/><br/>End of schedule. Resetting. \";\t// If we're debugging, display that we're at the end of schedule\n \t\tresetContent();\t\t\t\t\t\t// Reset any content that needs reset\n\t\t\t\tcurrentPos = 0;\t\t\t\t\t\t// Reset schedule pointer\n\t \tSeniorDads.Music.SetBreakPoint(\t\t// And get ready to start the demo again as soon as the music re-starts\n\t\t \t\t\tschedule[currentPos+1].trackPos, \n\t\t \t\t\tschedule[currentPos+1].patternPos, \n\t\t \t\t\tdoNextPart\n\t\t \t);\n \t}\n }", "title": "" }, { "docid": "6074896b0984e3b978c0438c940cf382", "score": "0.55310845", "text": "function DefDateDay(yy,mm,dd)\n{\nreturn Math.floor((Date2Days(yy,mm,dd)-2) % 7) + 1;\n}", "title": "" }, { "docid": "2b3bf1ed530dea74b2941351105b7179", "score": "0.5531075", "text": "function adjustWeekDay(firstDayOfWeek, dateWeekDay) {\n return firstDayOfWeek !== _dateValues_dateValues__WEBPACK_IMPORTED_MODULE_1__.DayOfWeek.Sunday && dateWeekDay < firstDayOfWeek\n ? dateWeekDay + _dateValues_timeConstants__WEBPACK_IMPORTED_MODULE_0__.TimeConstants.DaysInOneWeek\n : dateWeekDay;\n}", "title": "" }, { "docid": "5abc934095550fba102cfe15e7d178bd", "score": "0.55145764", "text": "function sleep_in(weekday, vacation){\n switch(true) {\n case weekday === false && vacation === false:\n return \"True\";\n case weekday === true && vacation === false:\n return \"False\";\n case weekday === false && vacation === true:\n return \"True\"; \n }\n}", "title": "" }, { "docid": "f35451848d181be0b272e88f2e527c74", "score": "0.55095786", "text": "function getDefaultForecastCycle () {\r\r\n \r\r\n // use the UTCoffset to get the UTC time to calculate forecast time\r\r\n // note this is then acted upon as it was local time\r\r\n var nowTime = new Date();\r\r\n var forecastTime = new Date(nowTime.getTime() - UTCoffset);\r\r\n \r\r\n // go back 5 hours to make sure the forecast is available\r\r\n forecastTime.setHours(forecastTime.getHours()-4);\r\r\n // and now go back to the prev forecast time.\r\r\n if (forecastTime.getHours() >= 18) {\r\r\n forecastTime.setHours(18,0,0,0);\r\r\n } else if (forecastTime.getHours() >= 12) {\r\r\n forecastTime.setHours(12,0,0,0);\r\r\n } else if (forecastTime.getHours() >= 6) {\r\r\n forecastTime.setHours(6,0,0,0);\r\r\n } else {\r\r\n forecastTime.setHours(0,0,0,0);\r\r\n }\r\r\n // Set the default launch time to the forecast time as default\r\r\n var tmpD1 = new Date(nowTime.getTime() - UTCoffset);\r\r\n tmpD1 = tmpD1.clearTime();\r\r\n \r\r\n $(\"#PILaunchDate\").jqxDateTimeInput('setDate', new Date(nowTime.getTime() - UTCoffset));\r\r\n\r\r\n // set the text value of the forecast name\r\r\n // NOTE: month returned is 0 to 11 so you have to add 1 to get what we consider the month\r\r\n return forecastTime.format(\"yyyyMMddHH\"); \r\r\n}", "title": "" }, { "docid": "290bff22124726b0378095462aad2339", "score": "0.5498873", "text": "function populateWeekDays() {\n let today = new Date();\n let week = [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n ];\n\n let weekDay = today.getDay();\n\n let i = 1;\n while (i < 6) {\n weekDay = weekDay + 1;\n if (weekDay === 7) {\n weekDay = 0;\n }\n\n let forecastWeek = document.querySelector(`#week-${i}`);\n forecastWeek.innerHTML = week[weekDay];\n i++;\n }\n}", "title": "" }, { "docid": "ef46029c87c02dc4ebdb5a8d64a09602", "score": "0.5495139", "text": "function nextMonthDay(dayName, val) {\n\n if ((timeAdjEle[0] == dayName) || (timeAdjEle[1] == dayName)) {\n for (k = 0; k < timeElements.length; k++) {\n if (timeElements[k] != \"MONTH\") {\n day = dayFinder(timeElements[k]);\n for (n = 1; n <= 31; n++) {\n if (val == \"0\") {\n timeFind1 = new Date(date.getFullYear(), date.getMonth() + 2, -n + 1);\n\n }\n if (val == \"1\") {\n timeFind1 = new Date(date.getFullYear(), date.getMonth() + 1, +n);\n }\n if (val == \"2\") {\n timeFind1 = new Date(date.getFullYear(), date.getMonth() + 1, +n + 8);\n }\n if (val == \"3\") {\n timeFind1 = new Date(date.getFullYear(), date.getMonth() + 1, +n + 15);\n }\n if (val == \"4\") {\n timeFind1 = new Date(date.getFullYear(), date.getMonth() + 1, +n + 21);\n }\n if (val == \"5\") {\n timeFind1 = new Date(date.getFullYear(), date.getMonth() + 1, +n + 28);\n }\n var timeFind2 = timeFind1.getDay();\n\n if (day == timeFind2) {\n finalTime = timeFind1;\n displayDate(finalTime);\n return;\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "e18388b717d702272deb8c2b354e8251", "score": "0.5489455", "text": "get dayOfWeek() {\n return ((this.date.getUTCDay() + 6) % 7);\n }", "title": "" }, { "docid": "1b43474599af57af520fee3e1352a0ce", "score": "0.54817593", "text": "function sundey1January(){\nfor (var year = 2014; year <= 2050; year++)\n {\n var d = new Date(year, 0, 1);\n if ( d.getDay() === 0 )\n alert(\"1st January will be a Sunday \" + year);\n }\n}", "title": "" }, { "docid": "9da51f730455a779219ef79ce0249ddc", "score": "0.5460824", "text": "function getMonday(d) {\n var day = d.getDay(),\n diff = d.getDate() - day + (day == 0 ? -6:1); // adjust when day is sunday\n return new Date(d.setDate(diff));\n }", "title": "" }, { "docid": "15522c9b59edbbcb3ebeec31bbdb289a", "score": "0.5454088", "text": "function generateDays(i) {\n\tif(today == 6){\n\t\ttoday = -1;\n\t}\n\tdaysUpdate[i] = days[today + 1];\n\ttoday++;\n}", "title": "" }, { "docid": "254b8b3d8194ebec289d88f3e5726c1d", "score": "0.54521954", "text": "function next () {\n return crontime.schedule().next()\n }", "title": "" }, { "docid": "07108e60dd2f01543c58c99799734b33", "score": "0.5444403", "text": "function getnth(curdate) {\n\n var cd = new Date(curdate);\n var m = cd.getMonth();\n var y = cd.getFullYear();\n var d = cd.getDate();\n var h = cd.getHours();\n var min = cd.getMinutes();\n\n var monthday1 = new Date(y, m, \"1\", h, min, \"0\", \"0\");\n var day1ofmonth = monthday1.getDay() + 1;\n\n var DayofWeek = cd.getDay() + 1;\n\n var satofcurweek = d + 7 - DayofWeek;\n var satof1stweek = 8 - day1ofmonth;\n\n var physicalweek = (satofcurweek - satof1stweek) / 7 + 1;\n var res;\n if (DayofWeek < day1ofmonth) {\n res = physicalweek - 1;\n } else {\n res = physicalweek;\n }\n\n return res;\n}", "title": "" }, { "docid": "2f1ebae01b2d9c6313227235c580af77", "score": "0.54400116", "text": "function runcode() {\n var d = new Date().getDay();\n\n switch(d){\n case 0:\n document.getElementById(\"dayoftheweek\").innerHTML = \"<h3>SunDay</h3>\";\n break;\n case 1:\n document.getElementById(\"dayoftheweek\").innerHTML = \"<h3>MonDay</h3>\";\n break;\n case 2:\n document.getElementById(\"dayoftheweek\").innerHTML = \"<h3>TuesDay</h3>\";\n break;\n case 3:\n document.getElementById(\"dayoftheweek\").innerHTML = \"<h3>WednesDay</h3>\";\n break;\n case 4:\n document.getElementById(\"dayoftheweek\").innerHTML = \"<h3>ThursDay</h3>\";\n break;\n case 5:\n document.getElementById(\"dayoftheweek\").innerHTML = \"<h3>FriDay</h3>\";\n break;\n case 6:\n document.getElementById(\"dayoftheweek\").innerHTML = \"<h3>SaturDay</h3>\";\n break;\n\n }\n\n}", "title": "" }, { "docid": "5de284a2bf3e7c91209453816ea8cd78", "score": "0.5438558", "text": "E (date) {\n return date.getDay() || 7\n }", "title": "" }, { "docid": "bc2e786b3d25067dbc50f3ebfda31764", "score": "0.54375494", "text": "function dayButtonClicked() {\n if (night == false) {\n night = true;\n nightIn();\n return;\n }\n if (night == true) {\n night = false;\n dayIn();\n return;\n }\n}", "title": "" }, { "docid": "b104fbd927ad9f8bf2fb2d8adedba985", "score": "0.5429327", "text": "evening() {\n this.time.setHours(17);\n }", "title": "" }, { "docid": "6b1b7a985b164f78dcfa8bd71c0f530c", "score": "0.54251224", "text": "function monthCycler (month) {\n //cycle through days of the month\n for (let i = 0 ; i < months[currentMonth] ; i++) {\n //Check if it's one of our sundays and increment the count if true\n if ((i === 0) && (currentDay === 6)) {\n specialSundays++;\n }\n currentDay = weekCycler(currentDay);\n }\n //increment currentMonth\n month++;\n if (month > 11) {\n month = 0;\n }\n return month;\n}", "title": "" }, { "docid": "8d7070caef67ab7a9ff1840723ee3005", "score": "0.5424619", "text": "function prevNextReset(e) {\n var el = e.target || e.srcElement;\n \n if(/prev/.test(el.className)) {\n now.mm--;\n if(now.mm < 0) {\n now.mm = 11;\n now.yyyy--;\n } \n } else if(/next/.test(el.className)) {\n now.mm++; \n if(now.mm > 11) {\n now.mm = 0;\n now.yyyy++;\n } \n } else if(/reset/.test(el.className)) {\n now.mm = initVal.mm; \n now.yyyy = initVal.yyyy; \n }\n \n insertDaysToCalendar();\n }", "title": "" }, { "docid": "6fd3a25753c831304db8d9c8b7002470", "score": "0.542188", "text": "function getStartOfWeek() {\n\tvar startOfWeek = getStartOfToday();\n\t// Get the day of week where Monday is 0 and Sunday is 6.\n\tvar dayOfWeek = (startOfWeek.getUTCDay() + 6) % 7;\n\tstartOfWeek.setUTCDate(startOfWeek.getUTCDate() - dayOfWeek);\n\treturn startOfWeek;\n}", "title": "" }, { "docid": "73eabb2f4e35fb1ebad633ee167ba8a9", "score": "0.5420846", "text": "twelveClock () {\n const shiftAM = () => this.#hour < 4\n ? eveningGreet.run()\n : morningGreet.run()\n\n const shiftPM = () => this.#hour > 4 && this.#hour !== 12\n ? eveningGreet.run()\n : afternoonGreet.run()\n\n return this.#shift === 'AM'\n ? shiftAM()\n : shiftPM()\n }", "title": "" }, { "docid": "1bf2d125b8d0ee457e9610bb921a788b", "score": "0.54181343", "text": "dayOfWeek(m,d,y){\n var year = (y-(Math.floor(14-m)/12));\n var x = year+Math.floor((year/4))-Math.floor((year/100))+Math.floor((year/400));\n var month = m+12 *(Math.floor((14-m)/12))-2;\n day = Math.ceil(((d+x+Math.floor(31*month/12))%7));\n return day;\n }", "title": "" }, { "docid": "5184d4609e3c32978123093cf458f7e3", "score": "0.5413479", "text": "_noEntry(){\n const tomorrow = this.date.getDate() + 1;\n this.date.setDate(tomorrow);\n }", "title": "" }, { "docid": "4e2a65dfcd2b321e5fff1062388df8b6", "score": "0.54105717", "text": "function weekDay(index) {\n switch (index) {\n case 0:\n return 'Sunday';\n break;\n case 1:\n return 'Monday';\n break;\n case 2:\n return 'Tuesday';\n break;\n case 3:\n return 'Wednesday';\n break;\n case 4:\n return 'Thursday';\n break;\n case 5:\n return 'Friday';\n break;\n case 6:\n return 'Saturday';\n break;\n }\n}", "title": "" }, { "docid": "b02b7673bc06804a134dcd27c56053f1", "score": "0.54072195", "text": "advance24Hours(time) {\n time.setDate(time.getDate() + 1);\n return time;\n }", "title": "" }, { "docid": "6e933c8573729eab1f5c08441e796473", "score": "0.54052794", "text": "adjustForNextDay(date, adjustment) {\n date.setTime( date.getTime() + adjustment * 86400000 )\n }", "title": "" }, { "docid": "b155b4213c1a75652be7c07c03058f99", "score": "0.53972864", "text": "advance12Hours(time) { \n if (time.getHours() >= 12){\n time = this.advance24Hours(time);\n time.setHours(time.getHours() - 12);\n } else {\n time.setHours(time.getHours() + 12); \n }\n return time;\n }", "title": "" }, { "docid": "bc07505e3668e77630d4fa9d98b8bccc", "score": "0.5382194", "text": "function dayTime(currentTime){\n if (currentTime >= 7){\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "43857d35f8fdb0723c6e970951ca57d2", "score": "0.53786224", "text": "function newDay() {\n\tvar sunday = new Date();\n\tvar hour = sunday.getHours();\n\tvar minute = sunday.getMinutes();\n\n}", "title": "" }, { "docid": "c1b9c8c09483bdeaeea82fec8575f44c", "score": "0.53681266", "text": "function scheduleNextMonth() {\n withScheduler(\n 'scheduleNextMonth',\n () => {\n error('schedule next month no longer supported.');\n });\n }", "title": "" }, { "docid": "9284f5bdad6da1cec8fa5eee23c876d3", "score": "0.5368114", "text": "generateDay(){\n const d = new Date();\n let listOfDay = new Array(7);\n listOfDay[0] = \"Sunday\";\n listOfDay[1] = \"Monday\";\n listOfDay[2] = \"Tuesday\";\n listOfDay[3] = \"Wednesday\";\n listOfDay[4] = \"Thursday\";\n listOfDay[5] = \"Friday\";\n listOfDay[6] = \"Saturday\";\n const currentDay = listOfDay[d.getDay()]\n return currentDay;\n }", "title": "" }, { "docid": "59c315c011dd9f855724df4a52681333", "score": "0.5365309", "text": "ChangeWeek(weekStartDate,e){\r\n var result = calendarFunctions.futurePastWeekDates(weekStartDate,e);\r\n this.props.weekChange(result.weekDates);\r\n this.props.weekStartDateChange(result.startDateForNextWeek);\r\n this.props.monthChange(result.weekStartDateMonth);\r\n this.props.yearChange(result.weekStartDateYear);\r\n }", "title": "" }, { "docid": "7b2c91549a14002e53897497fa78eae5", "score": "0.53586286", "text": "function setUpCalendar(date) {\n \n var firstDayofMonth = new Date(date.getFullYear(),date.getMonth()),\n lastDayofMonth = new Date(date.getFullYear(),date.getMonth()+1)\n polishDays = [6,0,1,2,3,4,5];\n\n lastDayofMonth.setDate(lastDayofMonth.getDate()-1);\n\n for (let i = 1; i < 43; i++) {\n var newSpan = document.createElement(\"span\");\n\n if ((i- polishDays[firstDayofMonth.getDay()] > 0) && (lastDayofMonth.getDate()+1 > i - polishDays[firstDayofMonth.getDay()])){\n newSpan.appendChild(document.createTextNode(i - polishDays[firstDayofMonth.getDay()])); \n newSpan.classList.add(\"day-in-calendar\");\n } \n \n if (i - polishDays[firstDayofMonth.getDay()]=== date.getDate()) {\n newSpan.classList.add(\"picked\");\n } \n \n if(i - polishDays[firstDayofMonth.getDay()] < lastDayofMonth.getDate() +(7-lastDayofMonth.getDay()+1)) {\n if ((i- polishDays[firstDayofMonth.getDay()] > 0) && i%7 ===1 &&newSpan.textContent ==\"\") {\n break;\n }\n df.appendChild(newSpan); \n }\n \n }\n\n calendarDaysHolder.appendChild(df);\n addEventsToDays(\"click\",markAsPicked);\n}", "title": "" }, { "docid": "888d166231653afe521f7aaf8b87bd48", "score": "0.5355151", "text": "function getNextDay(date,i) {\n\tvar a = new Date(date);\n\ta = a.valueOf();\n\ta = a + i * 24 * 60 * 60 * 1000;\n\ta = new Date(a);\n\t//初始化时间\n\tvar year = a.getFullYear();\n var\tmonth = a.getMonth() + 1;\n\tvar day = a.getDate();\n\tvar currentDate = year + \"-\";\n\tif (month > 9) {\n\t\tcurrentDate += (month + \"-\");\n\t} else {\n\t\tcurrentDate += (\"0\" + month + \"-\");\n\t}\n\tif (day > 9) {\n\t\tcurrentDate += day;\n\t} else {\n\t\tcurrentDate += (\"0\" + day);\n\t}\n\treturn currentDate;\n}", "title": "" }, { "docid": "dcda4396de3ed521f29e0ecf79ef1f1b", "score": "0.5348804", "text": "function seven_next()\n\t\t{\n\t\t\tc_flag=0;\n\t\t\tif(option.repeat_mode==false)\n\t\t\t{\n\t\t\t if(current_index<length-1)\n\t\t\t\tseven_animation(current_index+1);\n\t\t\t else\n\t\t\t\t seven_stop();\n\t\t\t}\n\t\t\telse\n\t\t\t\tseven_animation((current_index+1)%length);\t\t\t\t\t\t\n\t\t}", "title": "" }, { "docid": "d803a835606938e759aed58b11036e9b", "score": "0.5348249", "text": "function makeWeek(){\t\n\tvar week = \"<tr>\";\t//our new string of tags to make week row\n\tvar numOfBlanks = 0;\n\tif(firstWeekFlag){\n\t\t//loop for initial blanks\n\t\tfor (var i = getFirstDay(); i > 0; i--) {\n\t\t\tweek = week + \"<td> </td>\";\n\t\t\tnumOfBlanks++;\n\t\t};\t\n\t\tfirstWeekFlag = false;\t//remember to reset flag\n\t}\t\t\n\t//given number of blanks before first day (weekDay), loop until end of week\n\tfor (var i = 0; i < (7 - numOfBlanks); i++) {\n\t\t//highlight today's date on calendar\n if(todaysYear == currentYear && todaysMonth == currentMonth\n && todaysDate == currentDate){\n week = week + \"<td style='background:pink' class='day' data-day='\" + \n \tcurrentDate + \"'>\" + currentDate + \"</td>\";\n }else{\n\t //add blanks at end of month\n\t\t\tif(currentDate > getLastDay()){\n\t\t\t\tweek = week + \"<td> </td>\";\n\t\t\t}else {\n\t\t\t\tweek = week + \"<td class='day' data-day='\" + currentDate + \"'>\" + currentDate + \"</td>\";\n\t\t\t}\n\t\t}\n\t\tcurrentDate++;\n\t};\t\n\tweek = week + \"</tr>\";\n\treturn week;\n}", "title": "" }, { "docid": "37f9f4c25aa707e3a3662de2732b4d8f", "score": "0.53399414", "text": "function daySimple() {\r\n if (days.value == 0) {\r\n clearInterval(intervalHandleSimple1);\r\n return display1.innerHTML = \"00\";\r\n }\r\n if (hours.value < 1) {\r\n days.value -= 1;\r\n hours.value = 23;\r\n }\r\n if (days.value < 10) {\r\n return display1.innerHTML = `0${days.value}`;\r\n }\r\n return display1.innerHTML = `${days.value}`;\r\n}", "title": "" }, { "docid": "6c9f8bb8a852a980ce7a1f79dfcb6fe6", "score": "0.53384197", "text": "function dayPat(patArr, current) {\n var minute = parseInt(patArr.split(\" \")[0]);\n var hour = parseInt(patArr.split(\" \")[1]);\n if (patArr.split(\" \")[4] != \"MON-FRI\") {\n var recur_days = parseInt((patArr.split(\" \")[2]).split(\"/\")[1]);\n current.setDate(current.getDate() + recur_days);\n current.setHours(hour);\n current.setMinutes(minute);\n return current;\n } else {\n current.setDate(current.getDate() + 1);\n var dayByName = current.toString().split(\" \")[0].toUpperCase();\n if (dayByName == \"SAT\") {\n current.setDate(current.getDate() + 2);\n }\n current.setHours(hour);\n current.setMinutes(minute);\n return current;\n }\n }", "title": "" } ]
3f1f742241e02f0a580e584ecb2782f8
Functie voor het aanpassen van een labelStatus
[ { "docid": "9420094d760f5a78f335ce50fc4477da", "score": "0.0", "text": "function changeLabelStatus(presentationID, labelIdentifier) {\r\n let url = SERVER+PORT+\"/api/presentationdraft/\"+presentationID+\"/label/\"+labelIdentifier;\r\n let xhreq = new XMLHttpRequest();\r\n xhreq.open(\"POST\",url,true);\r\n xhreq.onreadystatechange = function() {\r\n if(this.readyState == 4 && this.status == 200){\r\n refreshFields(presentationID);\r\n document.getElementById(\"form_review\").innerHTML = '';\r\n }\r\n }\r\n xhreq.send();\r\n}", "title": "" } ]
[ { "docid": "a63fe9db031ed7e513e14bfdcf89c486", "score": "0.7280421", "text": "function verificaStatus(status)\n{\n if(status=='Aberta')\n {\n return '<span class=\"label label-success\">Aberta</span>';\n }else if(status=='Execução')\n {\n return '<span class=\"label label-warning\">Execução</span>';\n }else if(status=='Fechada')\n {\n return '<span class=\"label label-default\">Fechada</span>';\n }else if(status=='Nova')\n {\n return '<span class=\"label label-info\">Nova</span>';\n }else\n {\n return '<span class=\"label label-danger\">'+status+'</span>';\n } \n}", "title": "" }, { "docid": "d0ea75f9346b829c212afa60a542ca30", "score": "0.65631086", "text": "function setStatus(newConnected, description, labelType) {\n\tconnected = newConnected\n\t$('#statusLabel').text(description);\n\t$('#statusLabel').removeClass();\n\t$('#statusLabel').addClass('label ' + labelType);\n}", "title": "" }, { "docid": "de8902c9543ff309747d1ffa47c1c8fd", "score": "0.6508468", "text": "function getStatusLabel(search_name) {\n var label = \"\";\n\n for (var i = 0; i < statusIndex; i++) {\n if (statusList[i][1] == search_name) {\n label = statusList[i][2];\n break;\n }\n }\n return(label);\n}", "title": "" }, { "docid": "13a7f05296b3713162cd59a5e2987299", "score": "0.65001863", "text": "setStatus( stat ){\n switch ( stat ) {\n //do not show\n case 0:\n this.status = 'forgotten';\n break;\n //show as an option\n case 1:\n this.status = 'proposed';\n break;\n //show as result\n case 2:\n this.status = 'selected';\n break;\n }\n }", "title": "" }, { "docid": "81fc2abb2cc309d4424f0f7f41488573", "score": "0.64064914", "text": "function stateStatus(t,fs) {\n // If ApproverDt field has year >1970 then the approver has made a determination\n var dt = new Date(t.ApproverDt);\n var label;\n var id = \"stateStatus\" + t.FlowState; // the label for this particular state\n\n if (dt.getFullYear() > 1970) {\n if (dt.FLAGS & 0x1 > 0) {\n // 1 means not approved\n label = \"Rejected: \" + dt.toDateString() + \", \" + t.Reason;\n } else {\n label = \"Approved: \" + dt.toDateString();\n }\n } else {\n label = \"\";\n if (fs == t.FlowState) {\n label = \"In Progress\";\n }\n }\n\n setHTMLByID(id,label);\n}", "title": "" }, { "docid": "c6be53524988512106b22ada8a7633eb", "score": "0.6383988", "text": "function updateCurrentStatus(label,ts){\n\tvar currentUrl = urlGetData + ts;\t\n\tajax({url: currentUrl, type:'json'},\n\t\tfunction(data){\n\t\t\t//This Ajax call returns an associative array of changes in Z-Way data tree since <timestamp>. For more details see http://razberry.z-wave.me/docs/zwayDev.pdf\n\t\t\t//Get the status in the json response\n\t\t\tif(typeof data[\"devices.\"+deviceNumber+\".instances.0.commandClasses.37.data.level\"] !== \"undefined\"){\n\t\t\t\tvar isOn = data[\"devices.\"+deviceNumber+\".instances.0.commandClasses.37.data.level\"][\"value\"];\n\t\t\t\tif(isOn){\n\t\t\t\t\tlabel.text('Status: ON');\n\t\t\t\t}else{\n\t\t\t\t\tlabel.text('Status: OFF');\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tlabel.text(\"Status: init error\");\n\t\t\t}\n\t\t},\n\t\tfunction(error){\n\t\t\tconsole.log(error);\n\t\t\tlabel.text(\"Status: init error\");\n\t\t}\n\t);\t\n}", "title": "" }, { "docid": "17d9e99489d7c132ef083f5240429edd", "score": "0.6363598", "text": "function getCurrentLabel() {\n return status.currentLabel;\n }", "title": "" }, { "docid": "cbd6a0ec693207f7a3dba3e655818e12", "score": "0.6350414", "text": "function findLabelStatus(manifestStatusData, labelStatusData) {\n manifestStatus = \"\";\n manifestLabelStatus = \"\";\n manifestStatus = manifestStatusData;\n manifestLabelStatus = labelStatusData;\n}", "title": "" }, { "docid": "49086626b914abb163048af4675243d0", "score": "0.6328897", "text": "function renderStatus(statusText) {\n document.getElementById('status').textContent = statusText;\n}", "title": "" }, { "docid": "8188496176d54faf27ec2a8c943be41c", "score": "0.6317383", "text": "function updateServiceStatusUI(status)\n{\n let status_html = '<span class=\"label label-opnsense label-opnsense-sm ';\n\n if (status === \"running\") {\n status_html += 'label-success';\n } else if (status === \"stopped\") {\n status_html += 'label-danger';\n } else {\n status_html += 'hidden';\n }\n\n status_html += '\"><i class=\"fa fa-play fa-fw\"></i></span>';\n\n $('#service_status_container').html(status_html);\n}", "title": "" }, { "docid": "229f500b648df100a1db524552a51785", "score": "0.6311718", "text": "function getLabelColor(status){\n const baseStyle = {margin:4};\n switch (status) {\n case 'experimental':\n return {\n color:'#008EC0',\n text: 'API may break at any time; use with caution'\n };\n case 'stable':\n return {\n color:'#86A10E ',\n text: 'this item is good to use'\n };\n case 'deprecated':\n return {\n color:'#E94800',\n text: 'do not use; please check with UX for alternatives'\n };\n default:\n return {\n color:'#474C54',\n text: 'unknown status'\n };\n }\n}", "title": "" }, { "docid": "2b59f81794bd812d72e0b4760c4ea931", "score": "0.6296544", "text": "function makestatussay(txt) {\n self.status = txt\n }", "title": "" }, { "docid": "eb351575d8a8e8172a57071f4d60e1d5", "score": "0.62824565", "text": "typeStatus(e) {\n this.parent.disableMapUpdate();\n let type = this.parent.state.type;\n if (e === null)\n type[\"status\"] = -1;\n else\n type[\"status\"] = e.value;\n this.parent.setState({ type });\n this.statusValid();\n }", "title": "" }, { "docid": "910a2be5b18158293c2f6a64d8d46a61", "score": "0.6262041", "text": "function isStatusLabel(labelName) {\n\tvar label_ir = \"in review\";\n\tvar label_test = \"in test\";\n\tvar label_ip = \"in progress\"\n\treturn ( labelName === label_ir || labelName === label_ip || labelName === label_test )\n}", "title": "" }, { "docid": "40894522a6d91ab5303787acc1edb7ca", "score": "0.6226042", "text": "getLabel(){ /** todo */ }", "title": "" }, { "docid": "887fa4e14cbd5d52e51772254de12858", "score": "0.62130916", "text": "function setStatus() {\n $(this).find('.pick-status p').attr('style', 'display: block;');\n $status = $(this).find('.status .current');\n if ($status.html() == 'pending') {\n $color = '#0094bc';\n //$(this).find('.pending').attr('style', 'display: none');\n } else if ($status.html() == 'unresolved') {\n $color = '#e49a00';\n //$(this).find('.unresolved').attr('style', 'display: none');\n } else if ($status.html() == 'resolved') {\n $color = '#00bc25';\n //$(this).find('.resolved').attr('style', 'display: none');\n }\n $status.attr('style', 'color: ' + $color);\n $status.parent().find('.chevron').attr('style', 'border-color: ' + $color);\n}", "title": "" }, { "docid": "c63540dd75b00190c4dc59174a771e62", "score": "0.6189813", "text": "function setStatus(value) {\n status.innerHTML = value;\n}", "title": "" }, { "docid": "74b36998d3cfd71f7eec77239ce0ce69", "score": "0.6166308", "text": "function setIndicatorLabel(label){\n $(\"#indicator\").removeClass(\"label-success\");\n $(\"#indicator\").removeClass(\"label-danger\");\n $(\"#indicator\").removeClass(\"label-info\");\n\n switch(label){\n case \"Ready\":\n $(\"#indicator\").addClass(\"label-success\");\n $(\"#indicator\").text(\"Ready\");\n break;\n case \"Error\":\n $(\"#indicator\").addClass(\"label-danger\");\n $(\"#indicator\").text(\"Error\");\n break;\n case \"Running...\":\n $(\"#indicator\").addClass(\"label-info\");\n $(\"#indicator\").text(\"Running...\");\n break;\n default:\n throw (\"wrong indicator label\");\n }\n}", "title": "" }, { "docid": "53fc200c7667bacb04eafa5419e1574e", "score": "0.6164261", "text": "function status(text) { document.getElementById('status').textContent = text; }", "title": "" }, { "docid": "6bc53743363e553f901b2e43a9c515fd", "score": "0.6129484", "text": "renderStatus() {\n\t\tif (!this.props.status) {\n\t\t\treturn null;\n\t\t}\n\t\treturn this.props.status.map((item, index) =>\n\t\t\t<span key={index} className={`status status--${item.type}`} />,\n\t\t);\n\t}", "title": "" }, { "docid": "1bb1ebf52cbaa7ead40150d9842dc1b0", "score": "0.61191094", "text": "function setupLabel() {\r\n\t\tif ($('.label_check input').length) {\r\n\t\t\t$('.label_check').removeClass('c_on');\r\n\t\t\t$('.label_check input:checked').parent('label').addClass('c_on');\r\n\t\t};\r\n\t\tif ($('.label_radio input').length) {\r\n\t\t\t$('.label_radio').removeClass('r_on');\r\n\t\t\t$('.label_radio input:checked').parent('label').addClass('r_on');\r\n\r\n\t\t};\r\n\t}", "title": "" }, { "docid": "7001c252f307dfee007e8ffe042a9d6c", "score": "0.61100125", "text": "function statusFormatter(value, row) {\n var labelColor;\n if (value == \"Success\") {\n labelColor = \"success\";\n } else if (value == \"Error\") {\n labelColor = \"danger\";\n } else {\n labelColor = \"warning\";\n }\n var icon = row.id % 2 === 0 ? 'fa-star' : 'fa-user';\n return '<div class=\"label label-table label-' + labelColor + '\"> ' + value + '</div>';\n}", "title": "" }, { "docid": "5f652b2710f8d9eb47fd4faad061509f", "score": "0.61089796", "text": "function LabelOptions() {}", "title": "" }, { "docid": "8dec7ee1c35caeca610c28ee59e5dfe7", "score": "0.6108265", "text": "function updateTimelineLabels (l) {\n const tlThreshold = getTimeLineThresholds(l);\n tlThreshold[1].setSeconds(tlThreshold[1].getSeconds() + 1);\n\n const labelStart = customTimeFormat(tlThreshold[0]);\n const labelEnd = customTimeFormat(tlThreshold[1]);\n\n d3.select('#tlThresholdStart').html('Start: ' + labelStart);\n d3.select('#tlThresholdEnd').html('End: ' + labelEnd);\n\n d3.selectAll('.tlAnalysis').each(an => {\n if (\n parseISOTimeFormat(an.start) < tlThreshold[0] ||\n parseISOTimeFormat(an.start) > tlThreshold[1]\n ) {\n d3.select(this).classed('blendedTLAnalysis', true);\n } else {\n d3.select(this).classed('blendedTLAnalysis', false);\n }\n });\n }", "title": "" }, { "docid": "ff8befa43667b678de4c686becffe613", "score": "0.6104426", "text": "function updateStatus() {\n const defaultStatus = \"Unistroke mod\";\n //\tse non è attiva nessuna modalità, mostro il testo predefinito\n if (mode == \"\")\n d3.select('#statusline').text(defaultStatus);\n //\taltrimenti stampo la modalità e il tipo di shape correnti\n else if (mode == \"draw\")\n d3.select('#statusline').text(\"Draw \" + shapeType);\n else\n d3.select('#statusline').text(mode + \" \" + active.shape);\n}", "title": "" }, { "docid": "e106622f53885609410854278242c84f", "score": "0.6097181", "text": "parseGrpcStatus(s){if(s.message){this.setLabelText(s.message);this.show(s)}}", "title": "" }, { "docid": "51e57ac600a11c19066d7b917d22938f", "score": "0.6091703", "text": "function getStatusOff()\n{\n return defaultStatusOff;\n}", "title": "" }, { "docid": "1ef0f0491081f4d74945d7a2d56a0e14", "score": "0.60870755", "text": "label(_label){\r\n this.bod.label = _label;\r\n }", "title": "" }, { "docid": "b0e17ce2c39a3c88aa5c1b8bc521e894", "score": "0.60664976", "text": "statusSetup(stat){ \n stat.toLowerCase() === 'dead' ? this.status = 'Incomplete' : this.status = stat \n }", "title": "" }, { "docid": "fd2c1428600dbd1c61ec61e2e9a85dbf", "score": "0.6066251", "text": "function setupLabel() {\n\n\t\tif ($('.label_check input').length) {\n\n\t\t\t$('.label_check').each(function() {\n\t\t\t\t$(this).removeClass('c_on');\n\n\t\t\t});\n\t\t\t$('.label_check input:checked').each(function() {\n\t\t\t\t$(this).parent('label').addClass('c_on');\n\t\t\t});\n\n\t\t}\n\n\t\tif ($('.label_radio input').length) {\n\n\t\t\t$('.label_radio').each(function() {\n\t\t\t\t$(this).removeClass('r_on');\n\t\t\t});\n\n\t\t\t$('.label_radio input:checked').each(function() {\n\t\t\t\t$(this).parent('label').addClass('r_on');\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "9b2319fd1db6ab60dc0606765da26a61", "score": "0.6055996", "text": "async function updateStatusLabelOnIssue(owner, repo, issue, label) {\n\tif ( await lib.openIssueExists(owner, repo, issue) ) {\n\t\tissueLabels = await lib.getLabelsOnIssue(owner,repo, issue);\n\t\tif ( issueLabels.length > 0 ) {\n\t\tvar labelName = \"\"\n\t\t// delete any existing status labels\n\t\tfor ( var labelIdx in issueLabels ) {\n\t\t\tlabelName = issueLabels[labelIdx].name.toLowerCase()\n\t\t\tif ( isStatusLabel(labelName) ) {\n\t\t\t\tawait lib.deleteLabelOnIssue(owner, repo, issue, labelName);\n\t\t\t}\n\t\t}\n\t} \n\t// add desired status label\n\tawait lib.addLabelOnIssue(owner, repo, issue, label);\n\n\t}\n}", "title": "" }, { "docid": "1f787fb604f1de42d05d1f59723e047a", "score": "0.6053661", "text": "label() {\n\n }", "title": "" }, { "docid": "4998ffa5243a8ecbd418caa8b00a2221", "score": "0.6035003", "text": "_renderLabel() {\n if (this.props._status !== JitsiRecordingConstants.status.ON) {\n // Since there are no expanded labels on web, we only render this\n // label when the recording status is ON.\n return null;\n }\n\n return (\n <div>\n <CircularLabel\n className = { this.props.mode }\n label = { this.props.t(this._getLabelKey()) } />\n </div>\n );\n }", "title": "" }, { "docid": "2444ed384cc53cda5694a10ed470bb0b", "score": "0.60349625", "text": "function LabelOptions() { }", "title": "" }, { "docid": "a35147be098c26dca30a2fbfc2dbc80b", "score": "0.60212415", "text": "_updateLabelFlag() {\n if (!this.label.icon) {\n this.element.addClass('no-icon');\n }\n else {\n this.element.removeClass('no-icon');\n }\n }", "title": "" }, { "docid": "75276fe3b829d11e6514eb8c86ea16f8", "score": "0.60169166", "text": "get status() {\n return this.getStringAttribute('status');\n }", "title": "" }, { "docid": "75276fe3b829d11e6514eb8c86ea16f8", "score": "0.60169166", "text": "get status() {\n return this.getStringAttribute('status');\n }", "title": "" }, { "docid": "75276fe3b829d11e6514eb8c86ea16f8", "score": "0.60169166", "text": "get status() {\n return this.getStringAttribute('status');\n }", "title": "" }, { "docid": "75276fe3b829d11e6514eb8c86ea16f8", "score": "0.60169166", "text": "get status() {\n return this.getStringAttribute('status');\n }", "title": "" }, { "docid": "75276fe3b829d11e6514eb8c86ea16f8", "score": "0.60169166", "text": "get status() {\n return this.getStringAttribute('status');\n }", "title": "" }, { "docid": "75276fe3b829d11e6514eb8c86ea16f8", "score": "0.60169166", "text": "get status() {\n return this.getStringAttribute('status');\n }", "title": "" }, { "docid": "75276fe3b829d11e6514eb8c86ea16f8", "score": "0.60169166", "text": "get status() {\n return this.getStringAttribute('status');\n }", "title": "" }, { "docid": "75276fe3b829d11e6514eb8c86ea16f8", "score": "0.60169166", "text": "get status() {\n return this.getStringAttribute('status');\n }", "title": "" }, { "docid": "a2117c4f06fe6387ae04e9ef543d3118", "score": "0.5984064", "text": "function setStatus(selector, status) {\n var statusField = $(selector);\n statusField.text(status).removeClass();\n if (status == \"REGISTERED\" || status == \"ESTABLISHED\") {\n statusField.attr(\"class\",\"text-success\");\n } else if (status == \"DISCONNECTED\" || status == \"FINISH\") {\n statusField.attr(\"class\",\"text-muted\");\n } else if (status == \"FAILED\") {\n statusField.attr(\"class\",\"text-danger\");\n } else if (status == \"TRYING\" || status == \"RING\") {\n statusField.attr(\"class\",\"text-primary\");\n }\n}", "title": "" }, { "docid": "977a43b47e49ac139d73998f3c2083ca", "score": "0.59824955", "text": "function addStatutsClass(data){\n for(var i = 0; i < data.length; i++){\n if(data[i].hasOwnProperty('statut')){\n data[i].statusClass = statusUi[data[i].statut].labelClass;\n }\n }\n }", "title": "" }, { "docid": "97489307482252265e213d3d977f617a", "score": "0.59791726", "text": "function updateLabels() {\nif (instance.player1 !== undefined || instance.player2 !== undefined) {\nwaitingLabel.style.display = \"none\";\n}\nif (instance.player1 === undefined || instance.player2 === undefined)\n waitingLabel.style.display = \"block\";\n if (instance.player1 !== undefined) {\nif (instance.player1.ready) {\nplayer1Ready.style.color = \"green\";\n player1Ready.innerHTML = \"Ready\";\n} else {\nplayer1Ready.style.color = \"red\";\n player1Ready.innerHTML = \"Not ready\";\n}\n}\nif (instance.player2 !== undefined) {\nif (instance.player2.ready) {\nplayer2Ready.style.color = \"green\";\n player2Ready.innerHTML = \"Ready\";\n} else {\nplayer2Ready.style.color = \"red\";\n player2Ready.innerHTML = \"Not ready\";\n}\n}\n}", "title": "" }, { "docid": "f5aec3bcf6fe46601dab902367e29cd9", "score": "0.59772027", "text": "function setStatus(hours){\n var text = 'open';\n var css = 'label label';\n var status = {\n text: text,\n css: css+'-success'\n };\n\n if (hours.timeLeft <= 7200 && hours.timeLeft > 0){\n if (hours.isOpen) status.text = 'closing soon';\n else status.text = 'opening soon';\n status.css = css+'-warning';\n }\n else if (!hours.isOpen){\n status.text = 'closed';\n status.css = css+'-danger';\n }\n hours.status = status;\n return hours;\n }", "title": "" }, { "docid": "ca4b089067915e5811cedc95dbb1d9d8", "score": "0.5971727", "text": "function status_loop(vals) {\n if (!vals)\n console.error(\"status_loop should only be used as callback for get_status\");\n\n var iconNum = vals.error ? 3 : // if error, change to grey\n (vals.status.indexOf(ORANGE) === -1 && vals.status.indexOf(RED) === -1) ? 2 : // if good, change to green\n (!vals.offline) ? 1 : // if bots are online, but service(s) are down\n 0; // if down, change to red\n\n if (vals.error)\n console.error(\"Failed to get status: [#\"+vals.errno+\"] \"+vals.error);\n\n set_icon(iconNum);\n}", "title": "" }, { "docid": "e14c4884ee5fbee1d76d792d1ffffb67", "score": "0.5970127", "text": "setStatus(x) {\n this.status = x\n this.failed = x === 'failed'\n this.succeeded = x === 'succeeded'\n this.processing = x === 'processing'\n }", "title": "" }, { "docid": "2e8227be248165ca8b59fb3b9c688b0a", "score": "0.5962143", "text": "applySecStatus(status){\n // I think the structure for this second status board is much better, will note the differences\n if (!this.secStatus[status]){\n // passing down the function may make for cleaner/shorter code\n this.secStatus[status] = true;\n }\n }", "title": "" }, { "docid": "c8f144273c1442f5380ef60059766164", "score": "0.5954525", "text": "function updateLabel(data){\r\n\t\t\tlabel = data.Rows.map(function(item){\r\n\t\t\t\treturn item.Label;\r\n\t\t\t\tconsole.log(\"updateLabes: \" + labels);\r\n\t\t\t});\t\t\r\n\t\t}", "title": "" }, { "docid": "f67a37877f063ad54730ca66e7696ec8", "score": "0.5953319", "text": "function onLabel(x, y) {\n var labels = svl.labelContainer.getCanvasLabels();\n var onLabel = false;\n\n // Check labels to see if they are under the mouse cursor.\n for (var i = 0; i < labels.length; i += 1) {\n onLabel = labels[i].isOn(x, y);\n if (onLabel) {\n status.currentLabel = labels[i];\n return labels[i];\n }\n }\n return false;\n }", "title": "" }, { "docid": "521efb31de5b76b774bcc57a038e8a24", "score": "0.5943678", "text": "setStatus(name) {\n if (name in this.__status) {\n this.status = this.__status[name];\n } else {\n this.status = name;\n }\n }", "title": "" }, { "docid": "42cf311eb16eb0d40580ffa74a7a83a0", "score": "0.59401447", "text": "function getViewStatusHtml() {\n var result = '';\n\n result += '<span class=\"propLabel\">' + getInformalName(owner) + '\\'s current status:</span>';\n\n // get current status\n if (owner.getField(opensocial.Person.Field.STATUS) != null) {\n currentStatus = owner.getField(opensocial.Person.Field.STATUS);\n }\n\n // status text field\n result += '<span class=\"propValue\">' + currentStatus + '</span>';\n\n return result;\n}", "title": "" }, { "docid": "f9f99a125452b9b5819265c09845a0c4", "score": "0.5930222", "text": "function getCurrentStatus(label){\n\tvar timestampUpdate = (Math.floor(Date.now() / 1000) - 1);//We need the timestamp for the \"get\"\" request\n\tajax({url: urlGetStatus, type:'json'},\n\t\t\tfunction(data){\n\t\t\t\t//success\n\t\t\t\t//Second request to get the current value of the switch\n\t\t\t\tsetTimeout(function(){ updateCurrentStatus(label,timestampUpdate) }, 1000);\n\t\t\t},\n\t\t\tfunction(error){\n\t\t\t\t//error\n\t\t\t\tconsole.log(error);\n\t\t\t});\n}", "title": "" }, { "docid": "d289b3f8438816cbd2192c4078c6d802", "score": "0.5927793", "text": "function updateStatus(newStatus) {\n document.getElementById('current-status').innerHTML += \"<br/>\" + newStatus;\n }", "title": "" }, { "docid": "f029bb50fd60a086923a70ed0a104953", "score": "0.59124655", "text": "function toggleStatus(event) {\n var checked = event.target.checked;\n \n if (checked) {\n status = \"Working\";\n } else {\n status = \"Resting\";\n }\n \n statusSpan.textContent = status;\n \n secondsElapsed = 0;\n setTime();\n renderTime();\n }", "title": "" }, { "docid": "51f5aae0f240d4c0dfd643ac725f8b9b", "score": "0.5904943", "text": "function getStatus(value) {\r\n drawCanvas(getValue());\r\n}", "title": "" }, { "docid": "d66370c569f807f575d6f9c69954b4b5", "score": "0.59025633", "text": "function renderStatus(statusText) {\n var status = document.getElementById('status');\n //status.textContent = statusText;\n status.innerHTML = statusText;\n}", "title": "" }, { "docid": "19b35ded0f5065cb9de02ea6b9cec50e", "score": "0.5901148", "text": "function EnumCB_SpecificUnitStatus_PRE () {\n\tCB.toggleFlag(\"ExitSurveyEnabled\",\"true\");\n\tCB.toggleFlag(\"DKRFEnabled\",\"true\");\n \tENUMCB.updateDKRefVisibility(\"SpecificUnitStatus\");\n}", "title": "" }, { "docid": "f67d039bedc0a63397138c96fc085538", "score": "0.5895624", "text": "updateStatus_() {\n var message = '';\n\n if (this.source_ && !this.source_.isDisposed()) {\n var details = [];\n\n var selected = this.source_.getSelectedItems();\n if (selected && selected.length > 0) {\n details.push(selected.length + ' selected');\n }\n\n var model = this.source_.getTimeModel();\n if (model) {\n var total = model.getSize();\n var shown = this.source_.getFilteredFeatures().length;\n if (total > 0) {\n message += shown + ' record' + (shown != 1 ? 's' : '');\n\n var hidden = total - shown;\n if (hidden > 0) {\n details.push(hidden + ' hidden');\n }\n }\n } else {\n var total = this.source_.getFeatures();\n if (total && total.length > 0) {\n message += total.length + ' record' + (total.length != 1 ? 's' : '');\n }\n }\n\n if (this['selectedOnly']) {\n details.push('showing selected only');\n }\n\n if (details.length > 0) {\n message += ' (' + details.join(', ') + ')';\n }\n }\n\n this['status'] = message;\n }", "title": "" }, { "docid": "0fb37464c40368fc4f50db48adba4f69", "score": "0.58915764", "text": "function setupLabelListener(label)\n{\n label.addEventListener(\"input\", function()\n {\n let isCheckbox = this.type.toLowerCase() == \"checkbox\";\n let val = this.id == \"phone\" ? this.value.replace(/[^\\d]+/g, \"\") : this.type.toLowerCase() == \"checkbox\" ? this.checked : this.value;\n if (initialValues[this.id] == val)\n {\n if (this.getAttribute(\"changed\"))\n {\n Log.verbose(this.id + \" same as original\");\n }\n\n this.parentNode.children[0].style.color = null;\n this.setAttribute(\"changed\", 0);\n }\n else\n {\n if (!this.getAttribute(\"changed\") || this.getAttribute(\"changed\") == 0)\n {\n Log.verbose(this.id + \" different from original\");\n }\n\n this.parentNode.children[0].style.color = changedColor.s();\n this.setAttribute(\"changed\", 1);\n }\n\n if (g_forNotify && isCheckbox)\n {\n highlightForNotify(val);\n }\n });\n}", "title": "" }, { "docid": "15c727ec35a73147126bdc8881f214eb", "score": "0.5886255", "text": "getLabel() {\r\n return this.label.value;\r\n }", "title": "" }, { "docid": "3ca19fe62eaefd0d3fe0e51761480228", "score": "0.5869835", "text": "onStatusChanged_() {\n this.setStatusString_();\n this.setImgSrcAndAlt_();\n }", "title": "" }, { "docid": "337cd6b1803d8ca1c089a5539c24ab30", "score": "0.5868643", "text": "set_status(status) {\n this.status = status\n }", "title": "" }, { "docid": "d5cafc4cc4a7504763636482808dbab0", "score": "0.58588076", "text": "function setStatus(text) {\n document.getElementById(\"status\").innerHTML = text;\n}", "title": "" }, { "docid": "02aeafb5c7f5250cede7908e4eb8aa21", "score": "0.5842912", "text": "function status(o)\r\n\t{\r\n\t\t$(\"#statusOfItems\").html(\"\");\r\n\t\t$(\"#statusOfItems\").prepend(\"<p class='status'></p>\");\r\n\t\t\r\n\t\tvar count = 0;\t\t//Initializing Counter\r\n\t\t\r\n\t\tswitch(o)\t\t\t//Conditions on the basis of status, \"o\" , i.e. 0-All, 1-Completed, 2-Remianing, 3-Deleted.\r\n\t\t{\t\r\n\t\t\tcase 0:\r\n\t\t\t\tcount = newItem.length;\r\n\t\t\t\tfor(var i=0;i<newItem.length;i++)\r\n\t\t\t\t\tif(newItem[i].status >= 2)\r\n\t\t\t\t\t\tcount--;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 1:\r\n\t\t\t\tfor(var i=0;i<newItem.length;i++)\r\n\t\t\t\t\tif(newItem[i].status == 1)\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 2:\r\n\t\t\t\tfor(var i=0;i<newItem.length;i++)\r\n\t\t\t\t\tif(newItem[i].status == 0)\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\r\n\t\t\t\tcount = isDeleted();\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\t$(\"p\").prepend(count + \" item(s).\");\r\n\t}", "title": "" }, { "docid": "c8782be9184beb22dffa6041b43d7e9f", "score": "0.5842187", "text": "function status_text(command, status) {\n var content = replace_content('urquell_status');\n if ( !lurquell.in_wave )\n content = content.append(\n $('<b>').text(\"Not in wave -- \")\n )\n return content.append(\n $('<span>').text(command)\n ).append(\n $('<span>').text(' -- ')\n ).append(\n $('<b>').text(status)\n );\n }", "title": "" }, { "docid": "ac309dd80ec5f03f25eca140d95c18d4", "score": "0.58405423", "text": "get status () {\r\n\t\treturn this._status;\r\n\t}", "title": "" }, { "docid": "ac309dd80ec5f03f25eca140d95c18d4", "score": "0.58405423", "text": "get status () {\r\n\t\treturn this._status;\r\n\t}", "title": "" }, { "docid": "5e16960973006789df58812b2eda35f9", "score": "0.5828642", "text": "function statusFormatter(sStatus) {\r\n\t\tswitch (sStatus) {\r\n\t\t\tcase \"POSTED\":\r\n\t\t\tcase \"APPROVED\":\r\n\t\t\t\treturn sap.ui.core.ValueState.Success;\r\n\t\t\tcase \"SENT\":\r\n\t\t\t\treturn sap.ui.core.ValueState.Warning;\r\n\t\t\tcase \"REJECTED\":\r\n\t\t\t\treturn sap.ui.core.ValueState.Error;\r\n\t\t\tdefault: //fallback (should not happen)\r\n\t\t\t\treturn sap.ui.core.ValueState.None;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "9b86f8bc28cc6e2cd603e1e8c3ad615e", "score": "0.5827786", "text": "setStatus (value) {\n\t\tthis.setState({ statusIndex: value });\n\t}", "title": "" }, { "docid": "ba892a6194673c89b04f8bf3f844df59", "score": "0.5810707", "text": "get currentStatus() {\r\n return this.i.currentStatus;\r\n }", "title": "" }, { "docid": "1aa85c517089ddb32ee5cce5a7d0e462", "score": "0.580817", "text": "function useStatus (activeStatus) {\r\n const [status, setStatus] = useState(null);\r\n // setStatus(activeStatus)\r\n return status === 'loading' ? 'Loading' : 'Pending';\r\n }", "title": "" }, { "docid": "d07f64187591a8027e514e0bfd010def", "score": "0.5799313", "text": "function updateStatus () {\n let status = '';\n let moveColor = 'White';\n if (game.turn() === 'b') {\n moveColor = 'Black';\n }\n if (game.in_checkmate() === true) {\n status = 'Game over, ' + moveColor + ' is in checkmate.';\n } else if (game.in_draw() === true) {\n status = 'Game over, drawn position';\n } else {\n status = moveColor + ' to move';\n if (game.in_check() === true) {\n status += ', ' + moveColor + ' is in check';\n }\n }\n statusEl.html(status);\n fenEl.html(game.fen());\n pgnEl.html(game.pgn());\n}", "title": "" }, { "docid": "3925be3d2e365e284c8234b16a9d4d4f", "score": "0.5798939", "text": "function updateCallStatus(status) {\n callStatus.text(status);\n }", "title": "" }, { "docid": "7f4d4340a691a430d7bc8e5be7f92328", "score": "0.5796058", "text": "statusFr(status) {\n let reponse = \"\";\n if (status == \"OPEN\") {\n reponse = \"Ouverte\";\n } else if (status == \"CLOSED\") {\n reponse = \"Fermée\";\n $(\"#statStation\").css(\"color\", \"#E10203\");\n };\n return reponse\n }", "title": "" }, { "docid": "4c053435aefe7c2b6539c66c9b55bf08", "score": "0.57876843", "text": "function node_status(message) {\n nodeInstance.status({\n fill: \"blue\",\n shape: \"dot\",\n text: message\n });\n }", "title": "" }, { "docid": "54805ecd2b577e48ccd1b4f9caea1408", "score": "0.57724464", "text": "constructor(valor, tipo){\n this.valor = valor;\n this.tipo = tipo;\n this.trueLabel = this.falseLabel = '';\n }", "title": "" }, { "docid": "54805ecd2b577e48ccd1b4f9caea1408", "score": "0.57724464", "text": "constructor(valor, tipo){\n this.valor = valor;\n this.tipo = tipo;\n this.trueLabel = this.falseLabel = '';\n }", "title": "" }, { "docid": "83b8c845a88647929e10561e83b947b9", "score": "0.5771707", "text": "get status() {\n return this._procedure.actionContext.status.value.coding[0].displayText.value;\n }", "title": "" }, { "docid": "5e7863625835f0c2714053639a37d562", "score": "0.57658416", "text": "function setStatus(status, info) {\n var statusField = $(\"#status\");\n var infoField = $(\"#info\");\n statusField.text(status).removeClass();\n if (status == \"PLAYING\") {\n statusField.attr(\"class\", \"text-success\");\n infoField.text(\"\");\n } else if (status == \"DISCONNECTED\" || status == \"ESTABLISHED\" || status == \"STOPPED\") {\n statusField.attr(\"class\", \"text-muted\");\n infoField.text(\"\");\n } else if (status == \"FAILED\") {\n statusField.attr(\"class\", \"text-danger\");\n if (info) {\n infoField.text(info).attr(\"class\", \"text-muted\");\n }\n }\n}", "title": "" }, { "docid": "1b6ac8776d94d9508f4798a400a42fcf", "score": "0.5763981", "text": "function updateSourceStatus() {\n $('#source-status').text(status);\n statusClasses.forEach((c) => {\n if (statusClass === c) $('#source-status').addClass('status-' + c);\n else $('#source-status').removeClass('status-' + c);\n });\n}", "title": "" }, { "docid": "363d69cd4bb5bb36151bfbee8060d401", "score": "0.5763254", "text": "function getStatus()\r\n{\r\n return sendStatusCommand(\"\");\r\n}", "title": "" }, { "docid": "5924082b88f92c1a8690df7390366d76", "score": "0.57592434", "text": "get status() {\n this._status = ml_scorm.getValue(`cmi.objectives.${this.index}.status`);\n return this._status;\n }", "title": "" }, { "docid": "2f6c136f2824276fa9676e18a9a1b8c9", "score": "0.57557684", "text": "onStatus(response) {\n this.$scope.status_id = response.data.ID;\n this.$scope.status = response.data.Description;\n }", "title": "" }, { "docid": "7dd9ec67d856fa9c2538af7898c56a6e", "score": "0.5749877", "text": "function changeStatus(data) {\n var newStatus = \"\";\n switch (data) {\n case 1: {\n newStatus = '<span class=\"status-task status-bgc-pending\"><strong>Задача в очікувані</strong></span>';\n break;\n }\n case 2: {\n newStatus = '<span class=\"status-task status-bgc-processing\"><strong>Задача виконується</strong></span>';\n break;\n }\n case 3: {\n newStatus = '<span class=\"status-task status-bgc-done\"><strong>Задачу виконано</strong></span>';\n break;\n }\n case 4: {\n newStatus = '<span class=\"status-task status-bgc-hold\"><strong>Задачу зупинено</strong></span>';\n break;\n }\n case 5: {\n newStatus = '<span class=\"status-task status-bgc-canceled\"><strong>Задачу анульовано</strong></span>';\n break;\n }\n }\n return newStatus;\n}", "title": "" }, { "docid": "e4abe727860769f1cd20de92bbc4c554", "score": "0.5746247", "text": "get privateLabelWhenOn() {\n let outputVal = this.labelWhenOn;\n\n // if valid label short circuit out\n if (this.isValidLabel(outputVal)) {\n return outputVal;\n }\n\n outputVal = '';\n // eslint-disable-next-line no-console\n console.warn(\n `<lightning-button-stateful> The \"labelWhenOn\" attribute value is required to show the label when selected has a value of true`\n );\n\n return outputVal;\n }", "title": "" }, { "docid": "b6d2823dde38426c4b9a60b2959f346e", "score": "0.5741106", "text": "function setStatus(text) {\n\tdocument.getElementById(\"statustext\").innerHTML = text;\n}", "title": "" }, { "docid": "eee132162ad26a4824abebcff55d4876", "score": "0.5736538", "text": "function ReplaceLongStatus()\r\n{\r\n $(\".status\").each(function ()\r\n {\r\n // get text\r\n var container = $(this);\r\n var text = container.text();\r\n \r\n // cases\r\n if (text == \"Ready to test\")\r\n {\r\n container.text(\"-> Test\").css(\"background-color\", \"lime\");\r\n }\r\n if (text == \"New\")\r\n {\r\n // no change\r\n }\r\n if (text == \"In Progress\")\r\n {\r\n container.text(\"Progress\").css(\"background-color\", \"yellow\");\r\n }\r\n if (text == \"Tested and Reviewed\")\r\n {\r\n container.text(\"OK\").parents(\"tr:first\").css(\"color\", \"lightgray\");\r\n container.text(\"OK\").parents(\"tr:first\").find(\"a\").css(\"color\", \"lightgray\");\r\n }\r\n });\r\n}", "title": "" }, { "docid": "7b6a8f19c6df4efda2197a4ccd613a6c", "score": "0.5736387", "text": "function determineStatus(status) {\n\n if (status) {\n return status;\n } else {\n return 'Not Started';\n }\n\n}", "title": "" }, { "docid": "417a1e59e824d8f74b18d8c86431ce5f", "score": "0.57322407", "text": "get status () {\n\t\treturn this._status;\n\t}", "title": "" }, { "docid": "417a1e59e824d8f74b18d8c86431ce5f", "score": "0.57322407", "text": "get status () {\n\t\treturn this._status;\n\t}", "title": "" }, { "docid": "417a1e59e824d8f74b18d8c86431ce5f", "score": "0.57322407", "text": "get status () {\n\t\treturn this._status;\n\t}", "title": "" }, { "docid": "417a1e59e824d8f74b18d8c86431ce5f", "score": "0.57322407", "text": "get status () {\n\t\treturn this._status;\n\t}", "title": "" }, { "docid": "417a1e59e824d8f74b18d8c86431ce5f", "score": "0.57322407", "text": "get status () {\n\t\treturn this._status;\n\t}", "title": "" }, { "docid": "417a1e59e824d8f74b18d8c86431ce5f", "score": "0.57322407", "text": "get status () {\n\t\treturn this._status;\n\t}", "title": "" }, { "docid": "417a1e59e824d8f74b18d8c86431ce5f", "score": "0.57322407", "text": "get status () {\n\t\treturn this._status;\n\t}", "title": "" }, { "docid": "417a1e59e824d8f74b18d8c86431ce5f", "score": "0.57322407", "text": "get status () {\n\t\treturn this._status;\n\t}", "title": "" }, { "docid": "65661103822005300aaa0014b3b06139", "score": "0.5725397", "text": "function updateStatus() {\n var status = $(this).html() + ' <span class=\"caret\"></span>';\n var button = $(this).parent().parent().parent().find('.btn-status');\n var input = $(this).parent().parent().parent().find('.status');\n button.html(status);\n input.val($(this).html());\n updateButtons();\n}", "title": "" }, { "docid": "944134b7c434f48611346611e63e72fa", "score": "0.5724838", "text": "get statusValue() {\n return this.record.data ? getFieldValue(this.record.data, STATUS_FIELD) : '';\n }", "title": "" } ]
caee295c67cf565e415e953a4d20657d
11. Outlook: Negative Given an array, create and return a new one containing all the values of the original array, but make them all negative (not simply multiplied by 1). Given [1,3,5], return [1,3,5].
[ { "docid": "00ce98c886b0a0e6e64e11474bf3853d", "score": "0.8022912", "text": "function allToNegative(arr) {\n var newArr = [];\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] > 0) {\n newArr.push((arr[i] * -1));\n } else {\n newArr.push(arr[i]);\n }\n }\n return newArr;\n}", "title": "" } ]
[ { "docid": "62bf7e8b4d81762f0486cc87bfa2eba6", "score": "0.8118727", "text": "function makeNegative(arr){\n var newArr=[];\n for (var i=0; i<arr.length; i++){\n if (arr[i]>0){\n arr[i]=arr[i]*-1;\n \n }\n newArr.push(arr[i])\n }\n return newArr;\n}", "title": "" }, { "docid": "089a1f3322f08a3977f56bacba5d8315", "score": "0.81157726", "text": "function outlookNegative (x){\n var newarray = [];\n for (var i=0; i<x.length; i++)\n {\n if (x[i]>0)\n {\n x[i] = x[i] * -1;\n }\n newarray.push(x[i]);\n }\n return newarray;\n}", "title": "" }, { "docid": "e253b99d15c766c72324d3b85633f9e2", "score": "0.80277354", "text": "function newNeg(arr){\n let arrnew = [];\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arrnew.push(arr[i]);\n }\n if(arr[i] > 0){\n arrnew.push(arr[i] * -1);\n }\n }\n return arrnew;\n}", "title": "" }, { "docid": "6614eaac251f57bd21510dac57451ee7", "score": "0.7874935", "text": "function negate(arr) {\n for(let i = 0; i < arr.length; i++) {\n arr[i] = -arr[i];\n }\n return arr;\n }", "title": "" }, { "docid": "0b27c60c08a24d3774ff40972b70fa4f", "score": "0.7856472", "text": "function mapToNegativize(arr){\n let result = [];\n for (let i=0; i < arr.length; i++) {\n result.push(arr[i] * -1)\n };\n return result\n}", "title": "" }, { "docid": "ad932bd15ea569803dbe99f36201e06b", "score": "0.7823109", "text": "function mapToNegativize(array) {\n let result = [];\n for (const num of array) {\n result.push(num * -1)\n };\n return result;\n }", "title": "" }, { "docid": "8b5dc325ad12c36a7ded518ba6580fe3", "score": "0.7658888", "text": "function negate(arr) {\n\treturn arr.map(x => x * -1)\n}", "title": "" }, { "docid": "b91539fe70411907c5de85dcc37f0655", "score": "0.7641071", "text": "function Negatives() {\n var arr = [1,-3,5]\n for (let index = 0; index < arr.length; index++) {\n if(arr[index]<-1)\n continue\n else\n arr[index] = arr[index] * -1\n }\n \n return arr;\n }", "title": "" }, { "docid": "035d8dfd0ccb9865da49f3f80d952782", "score": "0.76382357", "text": "function negativeNumber(arr) {\n var newArr = [];\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n arr[i] = 0;\n }\n newArr[i] = arr[i];\n }\n return newArr;\n}", "title": "" }, { "docid": "929f5d86d38876bc1990abd33492a158", "score": "0.7509071", "text": "function invert(array) {\n let otherArr =[];\n for(let i=0; i<array.length; i++){\n if(array[i]<= 0){\n otherArr.push(array[i] *(-1));\n }\n else if(array[i]>=0){\n otherArr.push(array[i] *(-1));\n }\n }\n return otherArr;\n}", "title": "" }, { "docid": "83b15cb36411073dc4d63b62269c74e0", "score": "0.73994535", "text": "function negative(arr)\n{\n for (var i=0; i<arr.length;i++)\n {\n if(arr[i]<0)\n {\n arr[i]=0;\n }\n return arr;\n }\n \n}", "title": "" }, { "docid": "470121977531cb8fabf97498cb284064", "score": "0.73761034", "text": "function outlook(arr){\n var negsArr = [];\n\n for (var i = 0; i < arr.length; i++){\n if(arr[i]>0){\n arr[i] = arr[i] * -1;\n }\n negsArr.push(arr[i]);\n } \n \n return negsArr;\n}", "title": "" }, { "docid": "30de78f9d4e4f2696a1fb82d6c256cf8", "score": "0.73284245", "text": "function invert(array) {\n var newArray = array.map((item, index) => {\n return item * -1 + 0;\n })\n return newArray;\n}", "title": "" }, { "docid": "1bf25275ea67b1ff0e718be81a8e296f", "score": "0.7297384", "text": "function negativos(array) {\n todosnegativos = [];\n for (var i = 0; i < array.length; i++) {\n if (array[i] < 0) {\n todosnegativos.push(array[i]);\n } else if (array[i] > 0) {\n array[i] = (array[i]) * -1;\n todosnegativos.push(array[i]);\n }\n }\n return todosnegativos;\n}", "title": "" }, { "docid": "1600cfd15a41ec68a9788777034c5168", "score": "0.7289951", "text": "function invert(array){\n return array.map(num => num * -1)\n }", "title": "" }, { "docid": "9a6400f16456f2fcb13ab78b4ad8b853", "score": "0.72763443", "text": "function makePositive(array) {\r\n\tfor(let i = 0;i<array.length;i++){\t\t\r\n\t\tif(array[i]<0){\r\n\t\t\tarray[i]= Math.abs(array[i]);\r\n\t\t}\t\t\r\n\t}\r\n\treturn array;\t\r\n}", "title": "" }, { "docid": "ff9d4f5b6490a8b7eae4fbacc1338681", "score": "0.7275164", "text": "function noNeg() {\n var arr = [1, -2, 3, 5, -7, 9];\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n arr[i] = 0;\n }\n }\n return arr;\n}", "title": "" }, { "docid": "20f970eb956dc84b087a42ac2324f999", "score": "0.7208793", "text": "function negToZero(arr){\n for(var i = 0; i <arr.length; i++){\n if (arr[i] < 0){\n arr[i] = 0;\n }\n }\n return arr;\n}", "title": "" }, { "docid": "dab01a5bfeb54eccb4ffd66367fd838a", "score": "0.71880645", "text": "function zeroOutArrayNegativeVals(arr){\n for(var i=0;i<arr.length;i++){\n if(arr[i]<0){\n arr[i]=0;\n }\n }\n return arr; \n}", "title": "" }, { "docid": "27fb472b6eee660086f7082875099216", "score": "0.71779555", "text": "function remove_negatives(arr) {\n var num_negatives = 0;\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n num_negatives++;\n } else {\n arr[i - num_negatives] = arr[i];\n }\n }\n while (num_negatives--) {\n arr.pop();\n }\n return arr;\n}", "title": "" }, { "docid": "28281cf9b9ad0ce096519fb2f4410f51", "score": "0.71633714", "text": "function noNeg(arr) {\r\n for (var i = 0; i < arr.length; i++){\r\n if (arr[i] < 0){\r\n arr[i] = 0;\r\n }\r\n }\r\n return arr; \r\n}", "title": "" }, { "docid": "06a5ab3d0d5d64b08358c0be589aa650", "score": "0.71484685", "text": "function removeNegatives(arr){\n let myArr = arr;\n let positiveArr = [];\n for (let i = 0; i < myArr.length; i++){\n if (myArr[i] >= 0) {\n positiveArr.push(myArr[i]); \n }\n }\n // console.log(positiveArr);\n myArr = positiveArr;\n return myArr;\n}", "title": "" }, { "docid": "dc0055e9796271795c364677097f2528", "score": "0.7095223", "text": "function invert(array) {\n var inverse = []\n for(var i = 0; i < array.length; i++){\n if( array[i] === 0){\n inverse.push(array[i])\n }else{\n inverse.push(array[i] * - 1 )\n }\n }\n return inverse\n}", "title": "" }, { "docid": "6088e08bda464fa6687871736004ed07", "score": "0.70628947", "text": "function resetNegatives(arr) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n arr[i] = 0;\n }\n }\n\n return arr;\n}", "title": "" }, { "docid": "0cd0448a0ba3eb91e745ef40e53c1dcd", "score": "0.7036124", "text": "function zeroForNeg(arr){\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = 0;\n }\n }\n return arr;\n}", "title": "" }, { "docid": "e95365c1181d26fe8eb29e76cf221679", "score": "0.69997066", "text": "function negatives(arr) {\n let array = [];\n arr.forEach(ele => {\n if (ele < 0) {\n array.push(0)\n } else {\n array.push(ele)\n }\n });\n return array\n}", "title": "" }, { "docid": "27857cb23ddbb2084ae2bf966c0493ba", "score": "0.69765264", "text": "function invert(array) {\n\t var next = [];\n\t for (i=0; i<array.length; i++){\n\t if (array[i] == -0){\n\t next.push(0);\n\t }\n\t else{\n\t next.push(array[i]*-1);\n\t }\n\t }\n\t return next;\n\t}", "title": "" }, { "docid": "0d54221349c62560279c093464c77053", "score": "0.69705296", "text": "function negaarray(array) {\r\n let nega = [];\r\n for (let i = 0; i < array.length; i++) {\r\n if (array[i] > 0) {\r\n nega.push(array[i] * (-1));\r\n } else { nega.push(array[i]); }\r\n }\r\n return nega;\r\n\r\n}", "title": "" }, { "docid": "7264f0da4b4c5be42078897d482deef9", "score": "0.6925886", "text": "function additiveInverse(arr){\n const newArray = arr.map(num => {\n return -num\n })\n return newArray\n}", "title": "" }, { "docid": "6f0eecbb6dab977905fcaa0e0c9676b0", "score": "0.6925362", "text": "function negatives(arr) {\n for(var i = 0; i < arr.length; i++) {\n if(arr[i] < 0) {\n arr[i] = 0;\n }\n }\n console.log(arr);\n return arr;\n}", "title": "" }, { "docid": "e7e534815f7b8d56b5fdeb26ec71150e", "score": "0.68888557", "text": "function returnNoNeg(arr) {\n for(var i=0;i<arr.length;i++) {\n if(arr[i] < 0) {\n arr[i] = 0;\n }\n }\n return arr;\n}", "title": "" }, { "docid": "df9c550c23bfe2d39f22bda0bf41ccdc", "score": "0.68531877", "text": "function arraySubtract(array,arrayToSubtract) {\r\n if (!arrayToSubtract)\r\n return array;\r\n \r\n var c = new Array(array.length);\r\n for (var i=0;i<array.length;i++) {\r\n c[i] = array[i] - arrayToSubtract[i];\r\n }\r\n \r\n return c;\r\n\r\n}", "title": "" }, { "docid": "d6fff4f1fcd6906b1c5616f9248a5e4e", "score": "0.681555", "text": "function zeroNegatives(arr) {\r\n for (var i=0; i<arr.length; i++) {\r\n if (arr[i]<0) {\r\n arr[i]=0;\r\n }\r\n }\r\n\treturn arr;\r\n}", "title": "" }, { "docid": "d2565460fbc4a520200c35e5588b3486", "score": "0.68144", "text": "function invert(array) {\n var answer = [];\n if(array === []){\n return [];\n }else if(array.length < 2 && array[0] === 0){\n return [0];\n }else{\n for(var x in array){\n if(array[x] ===0){\n answer.push(0);\n }else{\n answer.push(array[x] * -1);\n }\n }\n return answer;\n }\n}", "title": "" }, { "docid": "b2f8b9c9ecf683844f2ed0c9b61481f6", "score": "0.6804895", "text": "function allNegative(arr) {\n let i = 0;\n\n for (let j = 0; j < arr.length; j++) {\n if (arr[j] < 0) {\n if (j != i) {\n let temp;\n temp = arr[j];\n arr[j] = arr[i];\n arr[i] = temp;\n }\n i++;\n }\n }\n console.log(arr);\n}", "title": "" }, { "docid": "34ac203276d164df733b644080519d7b", "score": "0.6759996", "text": "function moveNegativeElements(arr) {\r\n let i = 0;\r\n let j = arr.length - 1;\r\n\r\n while (i < j) {\r\n if (arr[i] < 0) {\r\n i++;\r\n }\r\n else if (arr[i] > 0 && arr[j] < 0) {\r\n let temp = arr[i];\r\n arr[i] = arr[j];\r\n arr[j] = temp;\r\n i++;\r\n j--;\r\n }\r\n else {\r\n j--;\r\n }\r\n }\r\n return arr;\r\n}", "title": "" }, { "docid": "f3b4b6a9bfe06980caddef49e0036a6f", "score": "0.6711952", "text": "function multipliesPositiveElements(a) {\n var newArray = [];\n var i;\n\n for (i = 0; i < a.length; i++) {\n if (a[i] > 0) {\n newArray[i] = a[i] * 2;\n } else {\n newArray[i] = a[i];\n }\n }\n return newArray;\n}", "title": "" }, { "docid": "00fbd2c480a57e0ac246cf534bd676da", "score": "0.6699145", "text": "function zeroNegative(arr)\n{\n for(var i = 0; i < arr.length; i++)\n {\n if(arr[i] < 0)\n {\n arr[i] = 0;\n }\n }\n console.log(arr);\n}", "title": "" }, { "docid": "9a46f3cafcfa144323da7992aa71072e", "score": "0.66796345", "text": "function RemoveNegatives(arr){\n\tvar countOfNegatives = 0;\n\tvar i = 0;\n\tvar k = 0;\n\twhile(k < arr.length){\n\t\tif(arr[k] < 0){\n\t\t\tcountOfNegatives ++ ;\n\t\t\tk++;\n\t\t} else {\n\t\t\tarr[i] = arr[k];\n\t\t\ti++\n\t\t\tk++\n\t\t}\n\t}\n\twhile(countOfNegatives > 0){\n\t\tarr.pop();\n\t\tcountOfNegatives --\n\t}\n\treturn arr\n}", "title": "" }, { "docid": "1578409cbfa98ea52d3cde951c32f03a", "score": "0.66583496", "text": "function removeNegative2(arr){\n for(let i = 0; i < arr.length; i++){\n// console.log(arr)\n if(arr[i] < 0){\n// console.log(arr)\n let temp = arr[i];\n arr[i] = arr[arr.length-1];\n arr[arr.length-1] = temp;\n arr.pop();\n i--;\n }\n }\n return arr;\n}", "title": "" }, { "docid": "7d65a20667f2222dbc1b56d67d3f63c1", "score": "0.6655989", "text": "get Negative() {\n var res = new this.constructor();\n for (var i = 0; i < this.length; i++) {\n res[i] = -this[i];\n }\n return res;\n }", "title": "" }, { "docid": "22943441ae42cb5e815084dbbbb65da1", "score": "0.66087246", "text": "function removeNegatives(arr) {\n for(var i = 0; i < arr.length; i++) {\n while(arr[i] < 0) {\n for(var x = i; x < arr.length - 1; x++) {\n arr[x] = arr[x + 1];\n }\n arr.length -= 1;\n }\n }\n console.log(arr);\n}", "title": "" }, { "docid": "b6c9389b95135e271ab9552553744656", "score": "0.66043043", "text": "function positiveNumbs(array){\n var newArr = [];\n for(var i = 0; i < array.length; i++){\n if(array[i] >= 0){\n newArr.push(array[i]);\n \n }\n }\n return newArr\n }", "title": "" }, { "docid": "b121fb9aef9b1f64d61c4b81a3b91156", "score": "0.6565361", "text": "function ShiftArrayValues(){\n var myarray = [5,10,25,88,100];\n for (var i = 1; i < myarray.length; i++){\n myarray[i-1] = myarray[i]\n }\n myarray[myarray.length-1]=0;\n console.log('Shift Array:', myarray);\n}", "title": "" }, { "docid": "b6553c52db7a9f6e050b37d63dd4700a", "score": "0.65427595", "text": "function removeNegatives(arr) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n arr[i] = 0\n }\n }\n console.log(arr)\n}", "title": "" }, { "docid": "7b93dfec774594737a4d161886202420", "score": "0.65324616", "text": "function Negative(arr) {\n for(var i=0; i<=arr.length; i++){\n if (arr[i]<0){\n arr[i] = 0;\n }\n }\n console.log(arr); //0\n}", "title": "" }, { "docid": "673682215b2a81a7fd716c08bb7f4c27", "score": "0.65322876", "text": "function rmNegatives(arr) {\n for (i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n arr[i] = 0;\n }\n }\n console.log(arr);\n}", "title": "" }, { "docid": "8837e9468e63b4c9536129b2d8489733", "score": "0.64758945", "text": "function returnPositive(array) {\n console.log('in returnPostive:', array);\n let newArray = [];\n for (i=0; i<array.length; i++) {\n if (array[i]>0) {\n newArray.push(array[i]);\n }\n }\n return newArray;\n}", "title": "" }, { "docid": "87edeac813c256cd0e8af4ae05657136", "score": "0.6462948", "text": "function getPositives(ar)\n{\n var newarr=ar.filter(x => x>=0);\n return newarr\n\n}", "title": "" }, { "docid": "9c9618adcf975a0abddcaa2d648aae47", "score": "0.6435744", "text": "function positiveNumber(arr){\n return arr.map(function(item){\n return Math.abs(item);\n });\n}", "title": "" }, { "docid": "43090d8d0be592b0f7fe063ffaad83a7", "score": "0.6414481", "text": "function uninvert(sequence) {\n const result = [];\n for (let i = 0; i < sequence.length; i += 1) {\n if (sequence[i] >= 0) {\n result.push(sequence[i]);\n } else {\n result.push(-sequence[i]);\n }\n }\n return result;\n}", "title": "" }, { "docid": "195bdc851d4a1c67af40976534f33a1b", "score": "0.6413402", "text": "function perspectiva(arr){\n var arreglo=[];\n for(var i=0;i<arr.length;i++){\n if(arr[i]>0){\n arreglo.push(arr[i]*-1);\n }else{\n arreglo.push(arr[i]);\n }\n }\nreturn arreglo;\n}", "title": "" }, { "docid": "ec8668e91c4dca9848db3bff8ebb5470", "score": "0.6387512", "text": "arrayShift(array) {\n const result = array[0];\n this.removeFromArray(array, 0);\n return result;\n }", "title": "" }, { "docid": "afbf83ecf090323324b07b0d226e578d", "score": "0.6366738", "text": "function zeroOutNegs(arr){\n for(i=0;i<arr.length;i++){\n if(arr[i] < 0){\n arr[i]=0;\n }\n }\n return arr;\n}", "title": "" }, { "docid": "642bb5d30c596e7d861cdc8ecebf814c", "score": "0.63452846", "text": "function negForzero(arr) {\n for(i = 0; i < arr.length; i++) {\n if(arr[i] < 0) {\n arr[i] = 0;\n }\n }\n console.log(arr); //[0, 3, 4, 0]\n}", "title": "" }, { "docid": "fe713847e8339dde64b08e38a417430a", "score": "0.6344616", "text": "function arrayShift(array){\n\tconst input = array;\n\tlet workingArray = [];\n\tfor(let l = 0;l<input.length;l++){\n\t\tworkingArray.push(input[l].value);\n\t}\n\tlet counter = 0;\n\tfor(let x=0;x<input.length;x++){\n\t\tif(workingArray[x] == 0){\n\t\t\tcounter++;\n\t\t}\n\t}\n\tfor(let j=0;j<counter;j++){\n\t\tworkingArray.splice(workingArray.indexOf(0),1);\n\t\tworkingArray.push(0);\n\t}\n\tlet output = [];\n\tfor(let k=0;k<workingArray.length;k++){\n\t\toutput[k] = new tile(workingArray[k]);\n\t}\n\treturn output;\n}", "title": "" }, { "docid": "949c881806c6dbffba43776733963c43", "score": "0.63320345", "text": "function returnAllPositives(inputArray){\n for(let i=0; i<inputArray.length; i++){\n if(inputArray[i] > 0){\n positiveArray.push(inputArray[i])\n } //end condidtional\n } //end loop\n //returns the new array of only positive integers once the input array has been looped through.\n return positiveArray;\n} //end returnAllPositives function", "title": "" }, { "docid": "0bad962fa895d117a60aa4a279400a91", "score": "0.6329064", "text": "function inverseArray(arr) {\n for( let i = 0; i < arr.length / 2 ; i++) {\n let b = arr[i]; \n arr[i] = arr[arr.length - 1 - i]; \n arr[arr.length -1 - i] = b;\n }\n return arr;\n}", "title": "" }, { "docid": "d939cab0056f90e0e38933ea6a4a28f5", "score": "0.6324067", "text": "function negToneg(arr) {\n for(var x = 0; x < arr.length; x++) {\n if(arr[x] < 0) {\n arr[x] = 'neg';\n }\n }\n console.log(arr); //[1, 'neg', 3, 'neg']\n}", "title": "" }, { "docid": "41285c62de8050bd260f14800c2bc855", "score": "0.629246", "text": "function returnNoNeg(arr) {\n for(var i=0;i<arr.length;i++) {\n if(arr[i] < 0) {\n arr[i] = \"Dojo\";\n }\n }\n return arr;\n}", "title": "" }, { "docid": "8d22f4d3221686d430db68180f414b11", "score": "0.6282779", "text": "function Negative(arr) {\n for(var i=0; i<=arr.length; i++){\n if (arr[i]<0){\n arr[i] = 'Dojo';\n }\n }\n console.log(arr); //0\n return arr\n}", "title": "" }, { "docid": "744c2a55f0fa06dd77a398d116f81387", "score": "0.62705564", "text": "function negativeNumbers (numberArray) {\n var negativeArray = [];\n for(var i = 0; i < numberArray.length; i++) {\n if(parseInt(numberArray[i]) < 0) {\n negativeArray.push(numberArray[i]);\n }\n }\n if(negativeArray.length > 0) {\n throw new Error(\"Negatives not allowed: \" + negativeArray.join(','));\n }\n}", "title": "" }, { "docid": "311cc997b30a602bff3f877e047aea8c", "score": "0.6241971", "text": "function revert(arr) {\n let revertArray = [];\n for(let i = arr.length-1; i >= 0 ; i--){\n revertArray.push(arr[i]);\n }\n return revertArray; \n}", "title": "" }, { "docid": "48c3041d1750cb34e6c16e43a90912d9", "score": "0.6237609", "text": "function swapStringForArrayNegativeVals(arr) {\n for(var i = 0; i < arr.length; i++) {\n if(arr[i] < 0) {\n arr[i] = \"Dojo\";\n }\n }\n return arr;\n }", "title": "" }, { "docid": "9136ef6d3e5a70c6f50157d00f384236", "score": "0.62260574", "text": "function zeroOut() {\n var zarray = [-5,-25,20,-55];\n for (var i = 0; i < zarray.length; i++) {\n if (zarray[i] < 0) {\n zarray[i] = 0;\n }\n }\n console.log('Zeroed Out:', zarray)\n}", "title": "" }, { "docid": "880ecfd25f5dff7b5e7dcb03d4c45291", "score": "0.6214933", "text": "function complement(arr){\n\t\treturn Array.apply(null,Array(9)).map(function(_,x){return x+1}).filter(function(x){return !(arr.indexOf(x)+1)})\n\t}", "title": "" }, { "docid": "c9e9367c474f3af5b4b203dfe623f84d", "score": "0.6194223", "text": "function ThrowAwayArray() {}", "title": "" }, { "docid": "73ab3056fd65e84ec1bebc1e09eb5d11", "score": "0.619104", "text": "function predict3(){\n var arr= [1,3,8,-5,0,-2,4,-1];\n var newArr = [];\n for(var i=0; i<arr.length;i++){\n if(arr[i] <0){\n newArr.push(arr[i]);\n arr[i] = arr[i] * -1;\n }\n else if(arr[i]==0){\n arr[i] = \"Zero\";\n }\n else{\n arr[i] = arr[i] *-1;\n }\n }\n console.log(arr);\n console.log(newArr);\n}", "title": "" }, { "docid": "3f6e766e5c36730fa11bf2395e85ea16", "score": "0.61705613", "text": "function task02(array) {\n\n for (let index = 0; index < array.length; index++) {\n array[index] = array[index] < 0 ? 0 : 1;\n }\n console.log(array);\n return array;\n}", "title": "" }, { "docid": "bbcb48392e990d1218278b4726d14fb6", "score": "0.61674684", "text": "function negitives(arr){\n for (var i=0; i< arr.length; i++){\n if (arr[i]<0){\n arr[i] = 0\n }\n }\n return arr\n}", "title": "" }, { "docid": "645ed627d1d18d983d4480de778c1a1d", "score": "0.61628115", "text": "function getPositives(ar)\r\n{\r\n let myar=[];\r\n for(let i of ar)\r\n {\r\n if(i>=0)\r\n {\r\n myar.push(i);\r\n }\r\n }\r\n return myar;\r\n}", "title": "" }, { "docid": "569dbc1ea678172a05dbda49a4eed645", "score": "0.6161902", "text": "function multipliesPositiveElement (a) {\n\tfor (var i = 0; i < a.length; i++) {\n\t\tif (a[i] > 0) {\n\t\t\ta[i] = a[i] * 2;\n\t\t}\n\t}\n\treturn a;\n}", "title": "" }, { "docid": "4a17497c990fca2a782f7a5f0008a99c", "score": "0.6129001", "text": "function positives(array) {\n var onlyPositives = []\n for (var i = 0; i < array.length; i++){\n if (array[i] > 0){\n onlyPositives.push(array[i])\n }\n }\n\n return onlyPositives\n}", "title": "" }, { "docid": "97036f9701661df23d5d46c52f0c2223", "score": "0.6122425", "text": "function swapStringForArrayNegativeVals(arr){\n for(var i=0;i<arr.length;i++){\n if(arr[i]<0){\n arr[i]=\"Dojo\";\n }\n }\n return arr; \n}", "title": "" }, { "docid": "e7fe0c0c9d686ee687a8a799c7376ef8", "score": "0.6101435", "text": "function getPositives (array) {\n return array.filter( function (value) {\n if (value > 0) return true;\n });\n}", "title": "" }, { "docid": "c2ca968bf3796e4f47ca904f0c74afec", "score": "0.60922223", "text": "function shiftArrayValues(arr){\n for(var i = 0; i < arr.length-1; i++){\n arr[i] = arr[i+1];\n }\n arr[arr.length-1] = 0;\n return arr;\n}", "title": "" }, { "docid": "16824120e19c2f54129c6f713189c054", "score": "0.60838884", "text": "function ArraySubtraction(firstArray, secondArray)\r\n{\r\n //create a blank array of the same length as the incoming arrays\r\n var blankArray = [];\r\n\r\n //sort through arrays\r\n for (var i = 0; i < firstArray.length; i++)\r\n {\r\n var temp = firstArray[i] - secondArray[i];\r\n blankArray.push(temp);\r\n\r\n }\r\n\r\n return blankArray;\r\n\r\n}", "title": "" }, { "docid": "04488fca814a5a8e9288dfab3468392b", "score": "0.60815495", "text": "function arrayModification(array) {\n let value = [];\n\n array.forEach(num => {\n (num % 2 === 0) ? value.push(num * 2) : value.push(num * 3);\n });\n\n return value;\n}", "title": "" }, { "docid": "c15aa7059cd10a90b72a63a38efa1700", "score": "0.6077095", "text": "function remNeg(x){\n var i = 0;\n var j = x.length;\n while(i<j){\n if(x[i] < 0){\n x[i]=0;\n i++;\n }\n i++;\n }\n console.log(x);\n}", "title": "" }, { "docid": "abc953f1a1b9efc7c68048929e48d417", "score": "0.60714", "text": "function getPositives(ar)\r\n{\r\n return ar.filter(ar => ar>=0)\r\n}", "title": "" }, { "docid": "224043b6cbe57c34b8d5e21abe8c2bda", "score": "0.6059102", "text": "function onlyNegatives(nums) {\n var negatives = [];\n for (var i = 0; i < nums.length; i++) {\n if (nums[i] < 0) {\n negatives.push(nums[i]);\n }\n }\n return negatives;\n}", "title": "" }, { "docid": "d93481f08d553f8e59d5fff0d2df1468", "score": "0.6051109", "text": "function no_negs(arr){\n for (var i=0; i<arr.length; i++){\n if (arr[i] < 0){\n arr[i] = 0\n }\n }\n return arr\n}", "title": "" }, { "docid": "956b23a1d9c9c175e0e5be187467d720", "score": "0.60470414", "text": "function fixTheMeerkat(arr) {\n var newArr = [];\n for(var i=1; i<arr.length+1;i++){\n newArr.push(arr[arr.length-i]);\n }\n return newArr;\n}", "title": "" }, { "docid": "250f6827159fa2476815dbe35a7c3dc5", "score": "0.60305065", "text": "function negativesToString(arr){\n var newArray = [];\n for(var i = 0; i<arr.length; i++){\n if(arr[i]<0){\n newArray.push(\"Dojo\");\n }else{\n newArray.push(arr[i]);\n }\n }\n console.log(arr);\n return newArray;\n }", "title": "" }, { "docid": "a6f930dd35ac9e6673a8b1efb90e5f2c", "score": "0.6025233", "text": "function doublevision(arr){\n var Newarr=[];\n for (var i=0; i<arr.length; i++){\n Newarr[i]=arr[i]*2;\n }\n return Newarr;\n}", "title": "" }, { "docid": "c8255f4d80eb9672ed0e2e2522edf8ec", "score": "0.597918", "text": "function negativeIndex(array, num){\n\n\tvar unicorn =\tarray.num;\n\treturn unicorn;\n}", "title": "" }, { "docid": "3e4717b011d7a5218dfe622ce93ae5bc", "score": "0.5972921", "text": "function reverseArrayInPlace(array){\n\tvar limit = array.length; // declaring limit to fix arraylength value\n\tvar clockDown = limit;\n\tfor (i = 0; i < limit - 1; i++){\n\t\tvar transArray = array.slice(i, limit - 1);\n\t\tclockDown = clockDown - 1;\n\t\tarray.splice(i, clockDown);\n\t\tarray = array.concat(transArray);\n\t}\n\treturn array;\n}", "title": "" }, { "docid": "e7af6e4959b19a410bdaaa3e454b8c92", "score": "0.59456515", "text": "function zero_negativity(array) {\n for (let i = 0; i < array.length; i++) {\n if (array[i] < 0){\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "37b2c342b919a2fa2e979408ccd91db2", "score": "0.59377897", "text": "function subtract(arr1, arr2) {\n return arr2.map(function(el, i) {\n return Math.abs(el - arr1[i]);\n });\n}", "title": "" }, { "docid": "6577621828800d53ae30bd7648e4c4bc", "score": "0.5929127", "text": "function pos_neg_array ( questions ) {\n\n var len = questions.length;\n\n var posneg = questions.concat (questions);\n //console.log(\"posneg is: \" + posneg);\n\n var i=0;\n\n for (i=0; i<len; i++) {\n switch (posneg[i]) { \n case '?': posneg[i] = 0; break;\n case '1': posneg[i] = 1; break;\n case '2': posneg[i] = 2; break;\n\tcase '3': posneg[i] = 3; break;\n\tcase '4': posneg[i] = 4; break;\n\tcase '5': posneg[i] = 5; break;\n\tcase '6': posneg[i] = 6; break;\n\tcase '7': posneg[i] = 7; break;\n\tcase '8': posneg[i] = 8; break;\n\tcase '9': posneg[i] = 9; break;\n\tcase '10': posneg[i] = 10; break;\n } \n }\n\n for (i=len; i<len*2; i++) {\n switch (posneg[i]) { \n case '?': posneg[i] = 0; break;\n case '1': posneg[i] = 9; break;\n case '2': posneg[i] = 8; break;\n\tcase '3': posneg[i] = 7; break;\n \tcase '4': posneg[i] = 6; break;\n \tcase '5': posneg[i] = 5; break;\n \tcase '6': posneg[i] = 4; break;\n \tcase '7': posneg[i] = 3; break;\n \tcase '8': posneg[i] = 2; break;\n \tcase '9': posneg[i] = 1; break;\n \tcase '10': posneg[i] = 0; break;\n }\n }\n \n return posneg;\n}", "title": "" }, { "docid": "3ea5e8cce99e8b0561984b67e9601855", "score": "0.5923897", "text": "function removeZero(array) {\n return array.filter(i => i != 0);\n}", "title": "" }, { "docid": "fe9b6b726b6410a99b104d03921035a4", "score": "0.5913001", "text": "function arraytoMinusculas(matriz) {\n\n for (elemento of matriz) {\n elemento = elemento.toLowerCase()\n }\n return matriz;\n}", "title": "" }, { "docid": "f9d574723dc2418f823c6a617a902834", "score": "0.59097934", "text": "function specialSort(array2) {\n // let negativeArray = [];\n // let positiveArray = [];\n\n // for (let i = 0; i < array.length; i++) {\n // if (array[i] < 0) {\n // negativeArray.push(array[i]);\n // } else {\n // positiveArray.push(array[i]);\n // }\n // }\n\n // console.log(negativeArray.sort());\n // console.log(positiveArray.sort());\n return array2.sort();\n}", "title": "" }, { "docid": "4ff6f7b9aa8178e3e0b64954e4d7fb9a", "score": "0.58994836", "text": "function mapToNoChange(arr){\n let result = [];\n for (let i=0; i < arr.length; i++) {\n result.push(arr[i])\n };\n return result\n}", "title": "" }, { "docid": "d1445a16c68d7a1fd56aaf9f4477bf7d", "score": "0.5880197", "text": "function shift(array, number) {\n var newArray = [];\n newArray[0] = number;\n\n for (var i = 0; i < array.length; i++) {\n newArray[i + 1] = array[i];\n }\n return newArray;\n}", "title": "" }, { "docid": "39edc15d2008314bc1cfda6fb12e6aa7", "score": "0.5870958", "text": "function sift(arr, callback, invert) {\n var i = -1\n , ret = []\n , len = arr.length\n ;\n if (callback) {\n invert = !!invert; // ensure boolean\n while ( i++ < len ) {// Filter out values that don't pass callback:\n if (invert === !callback(arr[i], i)) {\n ret.push(arr[i]);\n }\n }\n }\n else {\n while ( i++ < len ) {// Filter out all falsey values:\n if (arr[i]) {\n ret.push(arr[i]);\n }\n }\n }\n return ret;\n }", "title": "" }, { "docid": "91344e4986ff5bb546b7586082b003f6", "score": "0.5868349", "text": "function myReverse(array) {\n let reversedArr = [];\n\n array.forEach((el) => {\n reversedArr.unshift(el)\n })\n\n return reversedArr;\n}", "title": "" }, { "docid": "0851fe89d78dbe0dd6d7895eceaa13f5", "score": "0.58656055", "text": "function minus(a,b){\n return [a[0]-b[0], a[1]-b[1], a[2]-b[2]];\n}", "title": "" }, { "docid": "64b7c548d452a4215842979ee0e3e17d", "score": "0.5865081", "text": "function subtract() {\n array=Array.from(arguments);\n try {\n checkEmpty(array);\n isOneValue(array)\n return array.reduce(function (val1, val2) {\n isNumber(val1, val2);\n \n return val1 - val2;\n });\n }\n catch (e) {\n return e;\n }\n }", "title": "" }, { "docid": "7baabd66880c43e441348c184248df6b", "score": "0.58414596", "text": "function lessThanZero(arr){\n for (var i=0; i<arr.length; i++){\n if (arr[i] < 0){\n arr[i] = 0;\n }\n }\n return arr;\n}", "title": "" } ]
17688586efd7e947af9201f030508952
Normalize a port into a number, string, or false.
[ { "docid": "32f9a97fd8f4532825a0ae49ce55072f", "score": "0.83705056", "text": "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" } ]
[ { "docid": "12c5b9711e49230a00a00e1acf7feb97", "score": "0.8591176", "text": "function normalizePort(val) { // ------------------------------> Normalize a port into a number, string, or false. <-----------\n const port = parseInt(val, 10);\n if (isNaN(port)) { return val; }\n if (port >= 0) { return port; }\n return false;\n}", "title": "" }, { "docid": "ca6cdf61f1069450414c961e51b064f9", "score": "0.84898186", "text": "function _normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "37d52b1ef0db771404142b627ad61d96", "score": "0.84824586", "text": "function normalizePort(val) {\n const port = val;\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return parseInt(port, 10);\n }\n\n return false;\n}", "title": "" }, { "docid": "2d525a14ff41ea039368e2bc63a4a92b", "score": "0.8458926", "text": "function normalizePort(val: string): number | string | boolean {\n const porter: number = parseInt(val, 10);\n\n if (isNaN(porter)) {\n // named pipe\n return val;\n }\n\n if (porter >= 0) {\n // porter number\n return porter;\n }\n\n return false;\n}", "title": "" }, { "docid": "16949ec3a2b41f208777ddf85317e5c8", "score": "0.83947915", "text": "function normalizePort(val) {\n\tconst port = parseInt(val, 10);\n\n\tif (isNaN(port)) {\n\t\t// named pipe\n\t\treturn val;\n\t}\n\n\tif (port >= 0) {\n\t\t// port number\n\t\treturn port;\n\t}\n\n\treturn false;\n}", "title": "" }, { "docid": "16949ec3a2b41f208777ddf85317e5c8", "score": "0.83947915", "text": "function normalizePort(val) {\n\tconst port = parseInt(val, 10);\n\n\tif (isNaN(port)) {\n\t\t// named pipe\n\t\treturn val;\n\t}\n\n\tif (port >= 0) {\n\t\t// port number\n\t\treturn port;\n\t}\n\n\treturn false;\n}", "title": "" }, { "docid": "16949ec3a2b41f208777ddf85317e5c8", "score": "0.83947915", "text": "function normalizePort(val) {\n\tconst port = parseInt(val, 10);\n\n\tif (isNaN(port)) {\n\t\t// named pipe\n\t\treturn val;\n\t}\n\n\tif (port >= 0) {\n\t\t// port number\n\t\treturn port;\n\t}\n\n\treturn false;\n}", "title": "" }, { "docid": "03efea21f7a24e3eb0849230802b02ff", "score": "0.8385291", "text": "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n }", "title": "" }, { "docid": "19cf2f55e495a71672234a0bcec9f3d7", "score": "0.8378447", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n }", "title": "" }, { "docid": "959a5abc5d1016f4daa469bfc313a0ee", "score": "0.83763987", "text": "function normalizePort(val) {\n\tconst port = parseInt(val, 10);\n\n\tif (Number.isNaN(port)) {\n\t\t// named pipe\n\t\treturn val;\n\t}\n\n\tif (port >= 0) {\n\t\t// port number\n\t\treturn port;\n\t}\n\n\treturn false;\n}", "title": "" }, { "docid": "4f234dfc2a771d91bc1ad4a69a2a6d93", "score": "0.8375973", "text": "function normalizePort (val) {\n const port = parseInt(val, 10)\n\n if (isNaN(port)) {\n // named pipe\n return val\n }\n\n if (port >= 0) {\n // port number\n return port\n }\n\n return false\n}", "title": "" }, { "docid": "d040f8da16f274e36e95bacf2650426e", "score": "0.8371182", "text": "function normalizePort(val: string) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "37e032b5d15f4033b5cd3aceff9e8b6a", "score": "0.8367658", "text": "function normalizePort(val) {\n const port = parseInt(val, 10);\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n if (port >= 0) {\n // port number\n return port;\n }\n return false;\n}", "title": "" }, { "docid": "935a3581e711d5f87df4fd9792075997", "score": "0.83662987", "text": "function normalizePort(val) {\n const port = parseInt(val, 10); // eslint-disable-line no-shadow\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "fca5e638492a171cfc1fe34e3c4f1b06", "score": "0.83624184", "text": "function normalizePort (val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "658ab209e17cf8fc9f5d4e99e2b40bcc", "score": "0.83595544", "text": "function normalizePort (val) {\n var port = parseInt(val, 10)\n\n if (isNaN(port)) {\n // named pipe\n return val\n }\n\n if (port >= 0) {\n // port number\n return port\n }\n\n return false\n}", "title": "" }, { "docid": "658ab209e17cf8fc9f5d4e99e2b40bcc", "score": "0.83595544", "text": "function normalizePort (val) {\n var port = parseInt(val, 10)\n\n if (isNaN(port)) {\n // named pipe\n return val\n }\n\n if (port >= 0) {\n // port number\n return port\n }\n\n return false\n}", "title": "" }, { "docid": "56e36842a32904a7cf376fcd1802b6ab", "score": "0.8355143", "text": "function normalizePort(val) {\n const port = parseInt(val, 10)\n\n if (isNaN(port)) {\n // named pipe\n return val\n }\n\n if (port >= 0) {\n // port number\n return port\n }\n\n return false\n}", "title": "" }, { "docid": "56e36842a32904a7cf376fcd1802b6ab", "score": "0.8355143", "text": "function normalizePort(val) {\n const port = parseInt(val, 10)\n\n if (isNaN(port)) {\n // named pipe\n return val\n }\n\n if (port >= 0) {\n // port number\n return port\n }\n\n return false\n}", "title": "" }, { "docid": "2c197ad9d2fd2d17b4ade3316bdd5e62", "score": "0.8352155", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n \n if (isNaN(port)) {\n // named pipe\n return val;\n }\n \n if (port >= 0) {\n // port number\n return port;\n }\n \n return false;\n }", "title": "" }, { "docid": "b9d3d4b95489d7481360c25e82f907a0", "score": "0.8350366", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n if (port >= 0) {\n // port number\n return port;\n }\n return false;\n}", "title": "" }, { "docid": "b9d3d4b95489d7481360c25e82f907a0", "score": "0.8350366", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n if (port >= 0) {\n // port number\n return port;\n }\n return false;\n}", "title": "" }, { "docid": "b9d3d4b95489d7481360c25e82f907a0", "score": "0.8350366", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n if (port >= 0) {\n // port number\n return port;\n }\n return false;\n}", "title": "" }, { "docid": "c3d4324b6d121e105a826488c6d5bdfc", "score": "0.83503217", "text": "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c3d4324b6d121e105a826488c6d5bdfc", "score": "0.83503217", "text": "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c3d4324b6d121e105a826488c6d5bdfc", "score": "0.83503217", "text": "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" }, { "docid": "c4f6b64adeb38eeeec85de31e4ed2ae8", "score": "0.8349415", "text": "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "title": "" } ]
47da58a2acbfd810c520bca32beff5da
stop update wifi list eslintdisablenextline nounusedvars
[ { "docid": "630ab455b33d22689a0f734b67f07eab", "score": "0.0", "text": "function stopScan () {\n clearInterval(scanHandle)\n }", "title": "" } ]
[ { "docid": "ba748ae5d8442d4c7232296d3f14f7db", "score": "0.6080045", "text": "_turnOffWifi() {\n debug('turning off wifi...');\n\n try {\n execSync('networksetup -setairportpower en1 off');\n } catch (err) {\n debug(`Error: ${err}`);\n }\n }", "title": "" }, { "docid": "b6cf7aec00c229b99837414c9f8c43c2", "score": "0.60613364", "text": "function stop() {\n exec(null, null, \"WifiScanner\", \"stop\", []);\n running = false;\n}", "title": "" }, { "docid": "558233b00c8c69bbe1cca8071b919332", "score": "0.59430903", "text": "function stopMonitoring() {\n for (var _i = 0, list_3 = exports.list; _i < list_3.length; _i++) {\n var target = list_3[_i];\n target.stop();\n }\n}", "title": "" }, { "docid": "87069c8ed076cfeb039c601668c4cfa6", "score": "0.5908881", "text": "stop() {\n debug.log(\"Stoping update.\");\n this.stoped = true;\n }", "title": "" }, { "docid": "4a5e9f7b79c90c0567d0fb1e38704576", "score": "0.5878846", "text": "function stopNetworkAudit() {\n // @ts-ignore\n browser.cdp('Network', 'disable');\n }", "title": "" }, { "docid": "3e25933a87ff4b1a1578141b2a4d4268", "score": "0.5825627", "text": "stop() {\n \"use strict\";\n this.#bot_should_tick = false;\n }", "title": "" }, { "docid": "bcf105c75502b95be2f1048701f2420a", "score": "0.58246917", "text": "stop() {\r\n // Reloads Discord Client to clear visual badges\r\n // This is a quick fix, I will update later\r\n location.reload();\r\n }", "title": "" }, { "docid": "24c8c4116bc87f0b08f4134ea0550983", "score": "0.57854575", "text": "stop()\n {\n this._started = false;\n this._downloader.unscheduleChecks();\n }", "title": "" }, { "docid": "fa12d92f5f0eeadc2631a1a58be95a1b", "score": "0.5762276", "text": "stop(){\n this._travelingPackets.forEach((timeouts, packet) =>{\n timeouts.stop();\n this.onPacketStopped(packet);\n });\n this._travelingPackets.clear();\n }", "title": "" }, { "docid": "313cf450e67b2fc8ddfcc8e0b55338c8", "score": "0.57280254", "text": "function stopExtension() {\n clearTimeout(timerId);\n serverURL = undefined;\n launchedTab = undefined;\n ID = undefined;\n // TODO: Reset client counters on turn-off. Server increments and overflows. \n // And if server counter has overflowed, then notify to reset extension?\n // counter = 0;\n}", "title": "" }, { "docid": "b02d455d2ddbd9b2089675865bee7935", "score": "0.5578424", "text": "function stop_answered(){}", "title": "" }, { "docid": "81ae5e883954ed83fc6681634aa8e533", "score": "0.5557362", "text": "abort() {\n this.LearnerResource.stop(this.project.id)\n .then(() => {\n this.ToastService.info('The learner stops as soon as possible.');\n })\n .catch(console.error);\n }", "title": "" }, { "docid": "84c736c1deaf766e89d00df35e53e8d3", "score": "0.5551374", "text": "stop() {\n fs.unwatchFile(this._context.discovery.file);\n var content = fs.readFileSync(this._context.discovery.file, 'utf8');\n content.replace(this._context.listen + '\\n', '');\n fs.writeFileSync(this._context.discovery.file, content, 'utf8');\n }", "title": "" }, { "docid": "5805b233ba06480337c5f9f89e197107", "score": "0.5529348", "text": "stop() {\n\n this.editor.setOption('readOnly', false);\n\n this.shouldStop = true;\n if (this.currentRejectPromise !== undefined) {\n this.currentRejectPromise('Interrupted execution');\n }\n if (Sk.rejectSleep !== undefined) {\n Sk.rejectSleep('Interrupted execution');\n }\n }", "title": "" }, { "docid": "6d35aafa19d159cd8d61e52208edf777", "score": "0.551659", "text": "function stop_power_up_att () {\n rate_of_fire = 40\n }", "title": "" }, { "docid": "2555312fd3396e95ebd5268a9d799f18", "score": "0.5443477", "text": "function stop() {\n\t// Stop updating\n\tclearTimeout(updating);\n}", "title": "" }, { "docid": "726302e6f2b74aab5dd8de54f678673a", "score": "0.54430157", "text": "killAllNonStartedSites() {\n const sites = this.theRoom.find(FIND_CONSTRUCTION_SITES);\n\n for (let i = 0; i < sites.length; i += 1) {\n const site = sites[i];\n console.log(JSON.stringify(site));\n\n if (site && site.progress === 0) {\n console.log(`removing ${site}`);\n site.remove();\n }\n }\n }", "title": "" }, { "docid": "c3d34103f9281caee2b9533d0fa89b83", "score": "0.5439618", "text": "function resetNetwork() { \n runCmd( \"wifi\", [], function(text) { console.log (text) });\n}", "title": "" }, { "docid": "8482bd61b625479d2d7caa8433dbdb95", "score": "0.54135734", "text": "function deactivate() {\n\tvscode.window.showInformationMessage('Thank you for using vsc-vdebug utils!');\n}", "title": "" }, { "docid": "19bdd559386456f6d8783b44ef3db9a6", "score": "0.54017437", "text": "stop() {}", "title": "" }, { "docid": "19bdd559386456f6d8783b44ef3db9a6", "score": "0.54017437", "text": "stop() {}", "title": "" }, { "docid": "14a649447e37e3e27d0269449b2fea56", "score": "0.5396828", "text": "stopScanning() {\n this.isScanning = false;\n this._log(\"debug\", \"stop scanning\");\n noble.stopScanning();\n }", "title": "" }, { "docid": "96365a6981eb3976f20a817b5b27ac3c", "score": "0.53773654", "text": "function stopCrawling() {\n if (angular.isDefined(stop)) {\n $interval.cancel(stop);\n stop = undefined;\n done = 5;\n if(testing) {\n alert('Crawling stopped!')\n }\n }\n }", "title": "" }, { "docid": "040ab754e818e73f7df999f44c8776cc", "score": "0.535823", "text": "function noVars()\n{\n\tif (stopTolerance == 0)\n\t{\n\t\t$(\"#variableConnection\").val('Inactive');\n\t\tclearInterval(intervalId);\n\t}\n\telse\n\t\tstopTolerance -= 1;\n}", "title": "" }, { "docid": "7396993f3c7999d8caf33305209a55b1", "score": "0.5356548", "text": "stop () {\n this._removePollers()\n this._externalSecretEvents.return(null)\n }", "title": "" }, { "docid": "3e7e44fe8b710f2034eecd8f85f53c10", "score": "0.53514856", "text": "function stop()\n {\n $scope.status = 'Stopped';\n $scope.cursor = '';\n }", "title": "" }, { "docid": "28a171f5b7cd99db0808682cec2efa45", "score": "0.5332852", "text": "stop(cb) {\n if (this.status === 'reload') {\n this.removeAllListeners('reloaded');\n this.removeAllListeners('reload_failed');\n }\n if (this.options.service && !this.options.service.exec) {\n this.status = 'offline';\n return cb();\n }\n this.status = 'stopping';\n log.warn(FLAG_CHILD, `app_shutting_down : ${this.appId}`);\n // clearTimeout(this.readyTimeoutId);\n // this.readyTimeoutId = null;\n // clear retry timeout\n this.retryTimeoutId.forEach((timeout) => {\n clearTimeout(timeout);\n });\n // clean group message bind\n message.unbindGroupMessage(this.appId);\n\n this.send({\n action: 'offline'\n }, () => {\n let workers = _.assign({}, this.workers, this.oldWorkers);\n // clean workers ref\n this.oldWorkers = {};\n this.workers = {};\n // clean record\n this.errorExitCount = 0;\n this.errorExitRecord = [];\n async.each(workers, this._kill.bind(this), (err) => {\n if (err) {\n log.error(FLAG_CHILD, `app_stop_error : ${this.appId} `, err);\n }\n if (this.stdout) {\n this.stdout.end();\n this.stdout = null;\n }\n this.status = 'offline';\n this.removeSockFile();\n this.emit('stop');\n cb && cb(err);\n });\n });\n }", "title": "" }, { "docid": "0a1fca63b23080ebc0d21354bee7bdc9", "score": "0.5326164", "text": "stopPinging() {\n const {pingTimer} = this[PRIVATE];\n\n if (pingTimer) {\n this.clearTimeout(pingTimer);\n this[PRIVATE].pingTimer = 0;\n }\n\n this[PRIVATE].isSendingPings = false;\n }", "title": "" }, { "docid": "23d0741be929b9cc4d54c72422c0555b", "score": "0.532113", "text": "stopActivity(){this._FBPTriggerWire(\"--activityStopped\")}", "title": "" }, { "docid": "ac16125a6424e23f4c920545378f6e6b", "score": "0.5314162", "text": "stop() {\n //TODO: unsubscribe all\n }", "title": "" }, { "docid": "ab34701d9eaafca6ffa1ce4bfe10d21d", "score": "0.5310525", "text": "function stop() {\n http.close();\n isRunning = false;\n }", "title": "" }, { "docid": "8a20a4b45f3add5290b2a8a5d8698f5c", "score": "0.52945054", "text": "function stop( object ) {\n\n object.userData.onUpdate = null;\n\n}", "title": "" }, { "docid": "15259b87890fed67cfde5c90286c8e40", "score": "0.52882487", "text": "function stop() {\n try {\n ajax.abort()\n } catch (error) {\n console.error(`Abort: ${error}`)\n } finally {\n clear()\n process('stop')\n bp.removeClass('batchpress-processing batchpress-error')\n }\n }", "title": "" }, { "docid": "46cb334961255be79be5450391b04f9d", "score": "0.5284453", "text": "function stop() {\n this.shouldStop = true;\n this.shouldSkip = true;\n}", "title": "" }, { "docid": "c0c01c2dcd8848c0c7ee7183cd300d77", "score": "0.5279019", "text": "function Cancellation() { }", "title": "" }, { "docid": "c0c01c2dcd8848c0c7ee7183cd300d77", "score": "0.5279019", "text": "function Cancellation() { }", "title": "" }, { "docid": "091557318bb0e55c54da039d115a137f", "score": "0.52684903", "text": "function stopToy(toy) {\n var url = $(toy).attr(\"x-toy-url\");\n\n sendCommand(url, \"Vibrate\", 0);\n}", "title": "" }, { "docid": "d109cdf2bd015da1827f96162346f0d7", "score": "0.52684826", "text": "function stop()\r\n{\r\n document.getElementById(\"print\").innerHTML = \">> STOP MOVING <<\";\r\n \r\n \r\n //fetch api ubidots data push\r\n fetch('http://things.ubidots.com/api/v1.6/devices/teleop?token=YOUR_TOKEN', { //place your token\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json'\r\n },\r\n body: JSON.stringify({\r\n command: '0'\r\n })\r\n })\r\n \r\n \r\n}", "title": "" }, { "docid": "0b368687d7d034a147dff9f6463d917e", "score": "0.52682614", "text": "function stopRun() {\n pendingTasks.stoppingRun(true);\n killTask(\"run\");\n }", "title": "" }, { "docid": "ffde58da6af036e73f1ca011da3535b5", "score": "0.5260424", "text": "function stopAll() {\n var to_stop = running;\n running = [];\n\n localStorage['vz.running'] = running.join(',');\n\n for (var i in to_stop) {\n visualizations[to_stop[i]].stop();\n }\n }", "title": "" }, { "docid": "555c84fbd79818f3b25c25fe8868e0f2", "score": "0.5258122", "text": "stop() {\n this.run = false;\n }", "title": "" }, { "docid": "cc0824db599e011b366af77b5a16126c", "score": "0.52492344", "text": "stop()\n\t{\n\t\tthis.m_oNode.log.info( `> ${ this.constructor.name } stop was executed.` );\n\t}", "title": "" }, { "docid": "9cc6607e4d28139e2dae7392a456d490", "score": "0.5242668", "text": "function ACCclearexit(wordno)\n{\n\tif (wordno< 0 ) return;\n\tsetConnection(loc_here(),wordno, -1);\n}", "title": "" }, { "docid": "9d0f9f8e3eae0193a0f07dd1276ed7ea", "score": "0.52382624", "text": "stop() {\n\t\tthis.ws.close((err) => this.sendStatus({\n\t\t\tstatudID: 1,\n\t\t\tmessage: 'Server stopped',\n\t\t\terror: err\n\t\t}))\n\t}", "title": "" }, { "docid": "e88f3add878410aec97361fb5e9d68ff", "score": "0.5237007", "text": "deactivate() { }", "title": "" }, { "docid": "e88f3add878410aec97361fb5e9d68ff", "score": "0.5237007", "text": "deactivate() { }", "title": "" }, { "docid": "e88f3add878410aec97361fb5e9d68ff", "score": "0.5237007", "text": "deactivate() { }", "title": "" }, { "docid": "87a9cbefc7bf6a41f994b6a34b1ed0fc", "score": "0.5233374", "text": "function onPrefStopSom() {\r\n\tutils.log(\"onPrefStopSom\");\r\n\tif (mtab) {\r\n\t\tmtab.close();\r\n\t\tmtab = null;\r\n\t\tmw = null;\r\n\t}\r\n\tenv.stop();\r\n}", "title": "" }, { "docid": "1552aa851e9785f11b52296532d81624", "score": "0.52329737", "text": "static stopAll() {\n for(let i = 0;i< thaws.length; i++) {\n thaws[i].stop();\n }\n }", "title": "" }, { "docid": "014f2f774bbfc7f4ee8e5b5900d0cfa9", "score": "0.5231156", "text": "stop() {\n this.outgoingRoomKeyRequestManager.stop();\n this.deviceList.stop();\n this.dehydrationManager.stop();\n }", "title": "" }, { "docid": "ebe7b047a32b19b970bfc62c0f6ab8b1", "score": "0.5221875", "text": "stopAll() {\n console.warn('deprecated : please use through createContext.');\n this.defaultContext.stopAll();\n }", "title": "" }, { "docid": "70242919479dee4acb749a0a5b67859e", "score": "0.5202576", "text": "function stop() {\n\n}", "title": "" }, { "docid": "7fd4dbcfc38eea29c96f6d5c98917c69", "score": "0.5191146", "text": "stop() {\n this.cantGo = true;\n }", "title": "" }, { "docid": "21babef11fc002243c9f88fabdf9c46a", "score": "0.5179327", "text": "async stopped() {\n\n\t}", "title": "" }, { "docid": "21babef11fc002243c9f88fabdf9c46a", "score": "0.5179327", "text": "async stopped() {\n\n\t}", "title": "" }, { "docid": "21babef11fc002243c9f88fabdf9c46a", "score": "0.5179327", "text": "async stopped() {\n\n\t}", "title": "" }, { "docid": "21babef11fc002243c9f88fabdf9c46a", "score": "0.5179327", "text": "async stopped() {\n\n\t}", "title": "" }, { "docid": "21babef11fc002243c9f88fabdf9c46a", "score": "0.5179327", "text": "async stopped() {\n\n\t}", "title": "" }, { "docid": "21babef11fc002243c9f88fabdf9c46a", "score": "0.5179327", "text": "async stopped() {\n\n\t}", "title": "" }, { "docid": "21babef11fc002243c9f88fabdf9c46a", "score": "0.5179327", "text": "async stopped() {\n\n\t}", "title": "" }, { "docid": "21babef11fc002243c9f88fabdf9c46a", "score": "0.5179327", "text": "async stopped() {\n\n\t}", "title": "" }, { "docid": "21babef11fc002243c9f88fabdf9c46a", "score": "0.5179327", "text": "async stopped() {\n\n\t}", "title": "" }, { "docid": "21babef11fc002243c9f88fabdf9c46a", "score": "0.5179327", "text": "async stopped() {\n\n\t}", "title": "" }, { "docid": "21babef11fc002243c9f88fabdf9c46a", "score": "0.5179327", "text": "async stopped() {\n\n\t}", "title": "" }, { "docid": "21babef11fc002243c9f88fabdf9c46a", "score": "0.5179327", "text": "async stopped() {\n\n\t}", "title": "" }, { "docid": "21babef11fc002243c9f88fabdf9c46a", "score": "0.5179327", "text": "async stopped() {\n\n\t}", "title": "" }, { "docid": "6912e7670ad425ad7cf410aa3de15daf", "score": "0.5176841", "text": "function cancelScript(msg) {\n // clear the array of updates\n updateQueue = [];\n\n // Cancel the scan\n forcefullyKillChildProcess(CURRENT_SCRIPT_EXECUTION);\n cleanupAfterUnexpectedShutdown();\n\n // clear the array of updates in case more made it in during shutdown\n updateQueue = [];\n\n // note the status as a failure, packaged with an error message\n updateQueue.push({\n 'type': \"update\",\n 'status': \"failed\",\n 'msg': msg\n });\n}", "title": "" }, { "docid": "62f7916e35e56817655837a859f23e83", "score": "0.51743436", "text": "_killswitch() {\n return;\n }", "title": "" }, { "docid": "8a2f341313a930e0a694ed62b885e76f", "score": "0.51698244", "text": "stopWatch() {\n\t\tthis.watch.toggle(false);\n\t}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" }, { "docid": "1d16c4062bdd97dd04f5f07dacdc07b3", "score": "0.5169333", "text": "function deactivate() {}", "title": "" } ]
a0b1576fc567626e51f189ca8c97e1d2
Adds metadata, link, converts placeholders
[ { "docid": "6352da0b06f92a766670b51df60b68f4", "score": "0.0", "text": "function addCustomData(cell, p, graph)\n\t{\n\t\tif (p.Link != null && p.Link.length > 0)\n\t\t{\n\t\t\tgraph.setAttributeForCell(cell, 'link', getLink(p.Link[0]));\n\t\t}\n\t\t\n\t\tif (p.NoteHint != null && p.NoteHint.t)\n\t\t{\n\t\t\tgraph.setAttributeForCell(cell, 'Notes', p.NoteHint.t);\n\t\t}\n\n\t\treplacePlaceholders(cell, graph);\n\t\t\n\t\tfor (var property in p)\n\t\t{\n\t\t\tif (p.hasOwnProperty(property) && \n\t\t\t\tproperty.toString().startsWith('ShapeData_'))\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tvar data = p[property];\n\t\t\t\t\tvar key = mxUtils.trim(data.Label).replace(/[^a-z0-9]+/ig, '_').\n\t\t\t\t\t\treplace(/^\\d+/, '').replace(/_+$/, '');\n\t\t\t\t\tsetAttributeForCell(cell, key, data.Value, graph);\n\t\t\t\t}\n\t\t\t\tcatch (e)\n\t\t\t\t{\n\t\t\t\t\tif (window.console)\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.log('Ignored ' + property + ':', e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" } ]
[ { "docid": "047cefd362cb7b6855f894a3f1e9abd2", "score": "0.65076965", "text": "function addData(title, linkUrl, author){\n var link = {\n title: title,\n url: linkUrl,\n author: author\n }\n content.insertBefore(createLinkElement(link), content.firstChild);\n}", "title": "" }, { "docid": "db5dd1e32114c481fa0c554b6c23c214", "score": "0.6032628", "text": "function buildMetadata(sample) \n{\n\n var out = \"\";\n var i;\n\n for(i = 0; i < sample.length; i++)\n {out += '<a href=\"' + sample[i].url + '\">' + sample[i].display + '</a><br>';}\n\n document.getElementById(\"id01\").innerHTML = out;\n\n\treturn out;\n\n // Read the json data\n\n // Parse and filter the data to get the sample's metadata\n\n // Specify the location of the metadata and update it\n\n}", "title": "" }, { "docid": "0c76e684b993b2494f008baf19139cc9", "score": "0.5935699", "text": "function populateMetadataTable(content, metadata) {\n var contentKeys = Object.keys(content);\n for(var i = 0; i < contentKeys.length; i++) {\n // add data if it's and object, and it has any data, or\n // if it's just a string\n if((content[contentKeys[i]].constructor == Object &&\n Object.keys(content[contentKeys[i]]).length) ||\n (content[contentKeys[i]].constructor == String)) {\n var item = document.createElement(\"tr\");\n var category = document.createElement(\"td\");\n category.innerHTML = contentKeys[i];\n item.appendChild(category);\n var categoryText = document.createElement(\"td\");\n var contentString = content[contentKeys[i]];\n var patternSite = /http(s)?:\\/\\/(www)?(\\.[a-z]*)*([\\/a-z\\._])*/i;\n var matchedSite = patternSite.exec(contentString);\n // insert links on the content text where appropriate\n if(matchedSite) {\n var linkedText = (\"<a href=\" + matchedSite[0] + \" >\" +\n matchedSite[0] + \"</a>\");\n contentString = contentString.replace(patternSite, linkedText);\n }\n categoryText.innerHTML = contentString;\n item.appendChild(categoryText);\n metadata.appendChild(item);\n }\n }\n }", "title": "" }, { "docid": "ce088fed415992a5a0081a9bfffee0b9", "score": "0.5709881", "text": "function setLink(url, lang, type, rel, rev)\n{\n setInfo(\"link-url\", url);\n setInfo(\"link-type\", type);\n setInfo(\"link-lang\", lang);\n setInfo(\"link-rel\", rel);\n setInfo(\"link-rev\", rev);\n}", "title": "" }, { "docid": "55624cfe041bea90e85b4bdc2b65ee4d", "score": "0.5661604", "text": "populateLink(node, entry, items) {\r\n const item = items[`${entry.itemId}_${entry.itemSuperType}`];\r\n // now we only consider CMSLinkComponent\r\n if (item && entry.itemType === 'CMSLinkComponent') {\r\n if (!node.title) {\r\n node.title = item.linkName;\r\n }\r\n const url = this.getLink(item);\r\n // only populate the node link if we have a visible node\r\n if (node.title && url) {\r\n node.url = url;\r\n // the backend provide boolean value for the target\r\n // in case the link should be opened in a new window\r\n if (item.target === 'true' || item.target === true) {\r\n node.target = '_blank';\r\n }\r\n }\r\n // populate style classes to apply CMS driven styling\r\n if (item.styleClasses) {\r\n node.styleClasses = item.styleClasses;\r\n }\r\n // populate style attributes to apply CMS driven styling\r\n if (item.styleAttributes) {\r\n node.styleAttributes = item.styleAttributes;\r\n }\r\n }\r\n }", "title": "" }, { "docid": "5113ab4f57a588a7c35d0d58cecdb0fc", "score": "0.55839866", "text": "function formatCitationLink(metaData, link) {\n\n\t\t//return if link invalid\n\t\tif (link == null || link == \"\") return \"\";\n\n\t\t//get final url\n if (link.search(/^http/) == -1) {\n return (metaData[\"citation_url_nopath\"] + link.replace(/^[^\\/]*\\:\\/\\/[^\\/]*/i,\"\"));\n } else {\n return link;\n }\n\t}", "title": "" }, { "docid": "991570539fced3831fd5687206286f84", "score": "0.5577294", "text": "addTitleDescription(title, description) {\n\n DocHead.setTitle(title);\n\n const metaInfo = {name: 'description', content: description};\n DocHead.addMeta(metaInfo);\n\n }", "title": "" }, { "docid": "fa891a1c23f7a27526c98f449b3521c5", "score": "0.5576538", "text": "function decorate(link, bullet, description) {\n // build an image-node\n var img = document.createElement('img');\n img.setAttribute('src', bullet);\n img.setAttribute('alt', description);\n img.setAttribute('style', 'margin-right: 0.2em;');\n \n // decorate the link with the image\n link.appendChild(img);\n link.appendChild(link.removeChild(link.firstChild));\n link.setAttribute('title', description);\n }", "title": "" }, { "docid": "9fd22c4bcd387565fd3eac8814ae35aa", "score": "0.55112946", "text": "function linkText(text, recipe) {\n\tvar linkedText = text;\n\tfor (var i=0; i<recipe.photos.length; i++) {\n\t\tvar photoObject = recipe.photos[i];\n\t\tlinkedText = linkedText.replace(\"[\"+photoObject.link+\"]\",\n\t\t\t'<a href=\"'+unUrl(photoObject.photo)+'\" class=\"fresco\" data-fresco-group=\"link-'+recipe.name+'\" data-fresco-caption=\"'+photoObject.link+'\"> '+photoObject.link+'</a>'); \n\t}\n\treturn linkedText;\n}", "title": "" }, { "docid": "fd0a6c7c0d5c86280bcf1b0e85aaf6f4", "score": "0.54846984", "text": "function _fix_placeholder_urls(editdoc) {\n var i;\n\n // for links\n for (i=0; i < editdoc.links.length; i++) {\n editdoc.links[i].href = editdoc.links[i].href.replace(/^[^*]*(\\*\\*\\*)/, \"$1\");\n }\n\n // for images\n for (i=0; i < editdoc.images.length; i++) {\n editdoc.images[i].src = editdoc.images[i].src.replace(/^[^*]*(\\*\\*\\*)/, \"$1\");\n }\n\n}", "title": "" }, { "docid": "e1fbac857c96b1a8a213934a2fbf3f44", "score": "0.5466815", "text": "function setupLinkFields() {\n var form = $('#link_preview');\n if (form.css('display') == 'block') {\n var attrs = ['name','description','caption'];\n for(var attr in attrs) {\n var attr_name = attrs[attr];\n form.append($('<input>').attr({type:'hidden',name:'message['+attr_name+']', value:$('#link_preview .'+attr_name).text()}));\n }\n if ($('#link_preview #preview_thumbnail:checked').val() != \"1\") {\n form.append($('<input>').attr({type:'hidden',name:'message[media]', value:$('#link_preview .thumbnail img:first').attr('src')}));\n }\n } else {\n\t\tvar attrs = ['name','description','media','caption'];\n for(var attr in attrs) {\n var attr_name = attrs[attr];\n form.append($('<input>').attr({type:'hidden',name:'message['+attr_name+']', value:null}));\n }\n\t}\n}", "title": "" }, { "docid": "8ac474a917fed8a5d1fc963a78b71576", "score": "0.5452148", "text": "function setExternalLinkText(url,label) {\n return '<a href=\"'+url+'\" target=\"_blank\">'+label+'</a>';\n}", "title": "" }, { "docid": "e9e4bb47f5203560a0c88d5f32d963fe", "score": "0.54367703", "text": "function addLinkToInfoPage(name, url) {\n\n var ref = db.ref(\"induction_links\");\n\n ref.push().set({\n name : name,\n url : url\n });\n\n}", "title": "" }, { "docid": "98e86fe9b87f21585fc0c110c290e5e1", "score": "0.5425931", "text": "function inject_sitelinks(links) {\n if (!$.isArray(links) || !links.length) return;\n\n var fieldName = 'field-name-field-wikipedia-urls';\n $('.field-name-field-wikidata').after('<div class=\"field '+fieldName+' field-type-taxonomy-term-reference field-label-inline clearfix\"></div>');\n $('.'+fieldName).append('<div class=\"field-label\">Wikipedia:&nbsp;</div');\n $('.'+fieldName).append('<div class=\"field-items\"></div');\n\n $.each(links, function(i, link){\n var url = link.url;\n var lang = link.lang;\n var parity = i % 2 ? 'even' : 'odd';\n $('.'+fieldName+' > .field-items').append('<div class=\"field-item '+parity+'\"><a href=\"'+url+'\" class=\"ext\" target=\"_blank\">'+lang+'</a></div>');\n $('.'+fieldName+' > .field-items > .field-item > a').css({'color':'#3F5E70','border':'1px solid #3F5E70','background':'#FFF'});\n });\n }", "title": "" }, { "docid": "33465559d704063b1b0360622e71cdd7", "score": "0.542569", "text": "function PageContent_NewLink( out, query ) {\n\tout.push( \n\t\tReadTemplate( \"#template_newlink\", {\n\t\t\t\"query\": query \n\t\t}) \n\t);\n}", "title": "" }, { "docid": "4d7e3206832ab9ec231ead4e6f1493c1", "score": "0.54136574", "text": "function decorate(link, idSuffix, bullet, description, style) {\n var lang = link.hostname.split(\".\")[0];\n var fa = document.getElementById(\"interwiki-\" + lang + idSuffix);\n if (!fa)\treturn;\n \n\t\t// build an image-node for the FA-star\n\t\tvar img = document.createElement(\"img\");\n\t\timg.setAttribute(\"src\", bullet);\n\t\timg.setAttribute(\"alt\", description);\n\t\timg.setAttribute(\"style\", style);\n\t\t// decorate the link with the image\n\t\tlink.appendChild(img);\n\t\tlink.appendChild(link.removeChild(link.firstChild));\n\t\tlink.setAttribute(\"title\", description);\n }", "title": "" }, { "docid": "4e142dfafafaf7e89dcc154a273e34e2", "score": "0.5411832", "text": "constructor(\n\t\t\t\ttitle,\n\t\t\t\tlink,\n\t\t\t\tauthor,\n\t\t\t\timg,\n\t\t\t\tbody){\n\t\t\t\t\tthis.title = title;\n\t\t\t\t\tthis.link = link;\n\t\t\t\t\tthis.author = author;\n\t\t\t\t\tthis.img = img;\n\t\t\t\t\tthis.body = body;\n\t}", "title": "" }, { "docid": "4e142dfafafaf7e89dcc154a273e34e2", "score": "0.5411832", "text": "constructor(\n\t\t\t\ttitle,\n\t\t\t\tlink,\n\t\t\t\tauthor,\n\t\t\t\timg,\n\t\t\t\tbody){\n\t\t\t\t\tthis.title = title;\n\t\t\t\t\tthis.link = link;\n\t\t\t\t\tthis.author = author;\n\t\t\t\t\tthis.img = img;\n\t\t\t\t\tthis.body = body;\n\t}", "title": "" }, { "docid": "eaa92ba1dc606a0923ba890207656638", "score": "0.53800565", "text": "LinkProvider(args, prefix, { this: , isRequester: , false: , this: , command: , \"link\": , this: , isResponder: , true: , this: , defaultNodes, let, nodes: { [key]: string } }) { }", "title": "" }, { "docid": "d4b918d3e9cefb381ab52f850a88514c", "score": "0.53589857", "text": "function addLink(where, url, name, id, title, key, after){\n var na = document.createElement('a');\n na.href = url;\n na.appendChild(document.createTextNode(name));\n var li = document.createElement('li');\n if(id) li.id = id;\n li.appendChild(na);\n var tabs = document.getElementById(where).getElementsByTagName('ul')[0];\n if(after) {\n tabs.insertBefore(li,document.getElementById(after));\n } else {\n tabs.appendChild(li);\n }\n if(id) {\n if(key && title) { ta[id] = [key, title]; }\n else if(key) { ta[id] = [key, '']; }\n else if(title) { ta[id] = ['', title];} \n }\n // re-render the title and accesskeys from existing code in wikibits.js\n akeytt();\n return li;\n}", "title": "" }, { "docid": "663baa37c91fb12f89d917ab89004164", "score": "0.53486305", "text": "function links_add_base_url( $content, $base, $attrs = array('src', 'href') ) {\n global $_links_add_base;\n $_links_add_base = $base;\n $attrs = implode('|', (array)$attrs);\n return preg_replace_callback( \"!($attrs)=(['\\\"])(.+?)\\\\2!i\", '_links_add_base', $content );\n }", "title": "" }, { "docid": "f365bf79a2cc1ef896e1ff5da45b1c6e", "score": "0.53485805", "text": "function addlinks(data) {\n //Add link to all http:// links within tweets\n data = data.replace(/((https?|s?ftp|ssh)\\:\\/\\/[^\"\\s\\<\\>]*[^.,;'\">\\:\\s\\<\\>\\)\\]\\!])/g, function (url) {\n return '<a href=\"' + url + '\" >' + url + '</a>';\n });\n\n //Add link to @usernames used within tweets\n data = data.replace(/\\B@([_a-z0-9]+)/ig, function (reply) {\n return '<a href=\"http://twitter.com/' + reply.substring(1) + '\" style=\"font-weight:lighter;\" target=\"_blank\">' + reply.charAt(0) + reply.substring(1) + '</a>';\n });\n //Add link to #hastags used within tweets\n data = data.replace(/\\B#([_a-z0-9]+)/ig, function (reply) {\n return '<a href=\"https://twitter.com/search?q=' + reply.substring(1) + '\" style=\"font-weight:lighter;\" target=\"_blank\">' + reply.charAt(0) + reply.substring(1) + '</a>';\n });\n return data;\n }", "title": "" }, { "docid": "ee92f017a9c060d4c1b9ba889b7eb4bc", "score": "0.5339412", "text": "function _links_add_base($m) {\n global $_links_add_base;\n //1 = attribute name 2 = quotation mark 3 = URL\n return $m[1] . '=' . $m[2] .\n ( preg_match( '#^(\\w{1,20}):#', $m[3], $protocol ) && in_array( $protocol[1], wp_allowed_protocols() ) ?\n $m[3] :\n path_join( $_links_add_base, $m[3] ) )\n . $m[2];\n }", "title": "" }, { "docid": "24d967aefcca36181a56d36933784e69", "score": "0.53345263", "text": "function addlinks(data) {\n\t\t//Add link to all http:// links within tweets\n\t\t data = data.replace(/((https?|s?ftp|ssh)\\:\\/\\/[^\"\\s\\<\\>]*[^.,;'\">\\:\\s\\<\\>\\)\\]\\!])/g, function(url) {\n\t\t\treturn '<a target=\"_blank\" href=\"'+url+'\" >'+url+'</a>';\n\t\t});\n\t\t\t \n\t\t//Add link to @usernames used within tweets\n\t\tdata = data.replace(/\\B@([_a-z0-9]+)/ig, function(reply) {\n\t\t\treturn '<a target=\"_blank\" href=\"http://twitter.com/'+reply.substring(1)+'\" style=\"font-weight:lighter;\" target=\"_blank\">'+reply.charAt(0)+reply.substring(1)+'</a>';\n\t\t});\n\t\t//Add link to #hastags used within tweets\n\t\tdata = data.replace(/\\B#([_a-z0-9]+)/ig, function(reply) {\n\t\t\treturn '<a target=\"_blank\" href=\"https://twitter.com/search?q='+reply.substring(1)+'\" style=\"font-weight:lighter;\" target=\"_blank\">'+reply.charAt(0)+reply.substring(1)+'</a>';\n\t\t});\n\t\treturn data;\n\t}", "title": "" }, { "docid": "6dc3f88b8586271ea08fd58ffcc7ef3c", "score": "0.5307251", "text": "function formatCitationLink(metaData, link) {\n\n\t\t//return if invalid link\n\t\tif (link == null || link == \"\") return \"\";\n\n\t\tlink = metaData[\"citation_url_nopath\"] + link;\n\t\treturn link.replace(/showCitFormats/,\"downloadCitation\");\n\t}", "title": "" }, { "docid": "e8066983a60c90b73db2c3416a53fd86", "score": "0.52984023", "text": "function Link( href, relation ) {\n this.href = new Uri( href );\n this.relation = relation;\n \n this.setHRef = function( uri ) {\n this.href = new Uri( uri );\n };\n\n this.getHRef = function() {\n return this.href;\n };\n\n this.setTitle = function( title ) {\n this.title = title;\n };\n\n this.getTitle = function() {\n return this.title;\n };\n\n this.setHRefLang = function(lang) {\n this.hrefLang = lang;\n };\n\n this.getHRefLang = function() {\n return this.hreflang;\n };\n\n this.setTitleLang = function(lang) {\n this.titleLang = lang;\n };\n\n this.getTitleLang = function() {\n return this.titleLang;\n };\n \n this.setLength= function( length ) {\n this.length= length;\n };\n\n this.getLength = function() {\n return this.length;\n };\n\n/*\n<static> <final> String \tTYPE_ATOM\n Link type used for Atom content.\n<static> <final> String \tTYPE_HTML\n Link type used for HTML content.\n*/ \n this.setMimeType = function(mimeType) {\n this.mimeType = mimeType;\n };\n\n this.getMimeType = function() {\n return this.mimeType;\n };\n\n this.setContent= function( content ) {\n this.content = content;\n };\n\n this.getContent = function() {\n return this.content;\n };\n\n/*\n<static> <final> String \tREL_ALTERNATE\n Link that provides the URI of an alternate format of the entry's or feed's contents.\n<static> <final> String \tREL_ENTRY_EDIT\n Link that provides the URI that can be used to edit the entry.\n<static> <final> String \tREL_MEDIA_EDIT\n Link that provides the URI that can be used to edit the media associated with an entry.\n<static> <final> String \tREL_NEXT\n Link that provides the URI of next page in a paged feed.\n<static> <final> String \tREL_PREVIOUS\n Link that provides the URI of previous page in a paged feed.\n<static> <final> String \tREL_RELATED\n Link that provides the URI of a related link to the entry.\n<static> <final> String \tREL_SELF\n Link that provides the URI of the feed or entry.\n<static> <final> String \tREL_VIA\n Link that provides the URI that of link that provides the data for the content in the feed.\n*/ \n this.setRelation = function( relation ) {\n this.relation = relation;\n };\n\n this.getRelation = function() {\n return this.relation;\n };\n\n this.toString = function() {\n return \"Link href=\" + this.href + \", title=\" + this.title;\n };\n \n /** Serialize this text element to XML. \n * atomLink =\n * element atom:link {\n * atomCommonAttributes,\n * attribute href { atomUri },\n * attribute rel { atomNCName | atomUri }?,\n * attribute type { atomMediaType }?,\n * attribute hreflang { atomLanguageTag }?,\n * attribute title { text }?,\n * attribute length { text }?,\n * undefinedContent\n * }\n */\n this.toXML = function() {\n xml = \"<link\";\n if ( this.relation != null ) {\n xml += \" rel=\\\"\" + this.relation + \"\\\"\";\n }\n if ( this.uri != null ) {\n xml += \" uri=\\\"\" + this.uri.getValue() + \"\\\"\";\n }\n if ( this.lang != null) {\n xml += \" lang=\\\"\" + this.lang + \"\\\"\";\n }\n if ( this.href != null ) {\n xml += \" href=\\\"\" + this.href.getValue() + \"\\\"\";\n }\n if ( this.hreflang != null ) {\n xml += \" hreflang=\\\"\" + this.hreflang + \"\\\"\";\n }\n if ( this.title != null ) {\n xml += \" title=\\\"\" + this.title + \"\\\"\";\n }\n if ( this.length != null ) {\n xml += \" length=\\\"\" + this.length + \"\\\"\";\n }\n if ( this.content != null ) {\n xml += this.content + \"\\n\";\n xml += \"</link>\\n\";\n } else {\n xml += \"/>\\n\";\n } \n return xml;\n }\n \n}", "title": "" }, { "docid": "8872407475d30ee16c3205b9fe5f40fd", "score": "0.5297675", "text": "function insertLink(release) {\n var edit_note = 'Imported from ' + window.location.href;\n var parameters = MBReleaseImportHelper.buildFormParameters(release, edit_note);\n\n var innerHTML = MBReleaseImportHelper.buildFormHTML(parameters);\n\n $(\".interior-release-chart-content-list\").append(innerHTML);\n}", "title": "" }, { "docid": "fbda1cd376275d4c441d87ebd3f82afa", "score": "0.5269406", "text": "function buildLink(data, name, description) {\n var link = $(document.createElement('a'))\n .attr('href', data.href)\n .addClass('name')\n .addClass('link');\n if(data.name !== undefined) {\n $(link).append(data.name);\n } else if(name !== undefined && name !== 'href') {\n $(link).append(name);\n } else {\n $(link).append(link[0].pathname);\n }\n if(description) {\n $(link).attr('title', description);\n }\n return $(link);\n }", "title": "" }, { "docid": "47eec9145e38afd436b1ed9a3f5c4b99", "score": "0.5254571", "text": "function addLink()\n{\n linkUrlEl.value = \"\";\n linkTitleEl.value = \"\";\n modalResult = \"create\";\n showModal(modalEditEl);\n}", "title": "" }, { "docid": "0d0b93d4086e0f40206264b51d994487", "score": "0.5251833", "text": "function makeLink() {\n var citylink = this.textContent;\n var latlink = $(this).attr(\"data-lat\");\n var lonlink = $(this).attr(\"data-lon\");\n $('#text').val('');\n storeCity(latlink, lonlink, citylink);\n getWeather(latlink, lonlink, citylink);\n}", "title": "" }, { "docid": "37b32ec9a98c699787d68e90cab2fe7a", "score": "0.52512455", "text": "function curateLink(link){\n this.start(link, function(){\n var title = this.evaluate(function(){\n return document.querySelector('.post-title h2').innerHTML;\n });\n var article = this.evaluate(function(){\n return document.getElementsByTagName('article')[0].innerHTML;\n });\n patch_note_info[link] = {\n title: title,\n article: article,\n type: 'ESO Patch Notes'\n };\n });\n}", "title": "" }, { "docid": "0429fef0a580e200d6ae7e6cadeb9a21", "score": "0.524993", "text": "function loadMetaData(track, results) {\n if (results.hits.length) $http.get(\"http://mygene.info/v2/gene/\"+results.hits[0].entrezgene).success(function(data) {\n track.annotationSymbol = data.symbol;\n track.annotationSummary = data.summary + \" (from mygene.info)\";\n });\n }", "title": "" }, { "docid": "18db68e44c3e0b060a1f19279e6aead5", "score": "0.52409685", "text": "function ImageLink(data) {\n return {\n '_type': 'ImageLink',\n 'url': data.image.url,\n 'alt': data.image.alt\n };\n}", "title": "" }, { "docid": "b58e463fc23daa19318d2da6cc829794", "score": "0.5230687", "text": "function create(original, cb) {\n\n const link = new Link({\n original: original,\n short: shortid.generate()\n });\n\n link.save()\n .then(doc => {\n console.log(\"Inserted link: \" + doc.original + \" : \" + doc.short);\n cb({\n \"original_url\": doc.original,\n \"short_url\": doc.short\n });\n })\n .catch(err => {\n console.log(\"Error inserting record: \" + err);\n cb(null);\n });\n\n}", "title": "" }, { "docid": "cde31171b1dd8b6a6e8ff073b82cce81", "score": "0.52291703", "text": "function dispMetadata(a) {\r\n\t//var lyr = map.getLayer(a.mapLayerId);\r\n\tvar nm = a.name;\r\n\t\r\n\tlastMetadataLayerTitle (a.name);\r\n\tlastMetadataLinkURL (\"http://carto.gis.gatech.edu/GCAMP/metadata/\" + a.name + \".pdf\");\r\n\r\n\t//var url = \"/GCAMP/GCAMPdatalist514.xlsx\";\r\n\r\n\tvar args = {\r\n\t\t\turl: \"http://carto.gis.gatech.edu/GCAMP/GCAMPmetadata.csv\",\r\n\t\t\thandleAs: \"text\",\r\n\t\t\tload: function(data) {\r\n\t\t\t\tvar lines = data.split(\"\\n\");\r\n\t\t\t\t\r\n\t\t\t\tdojo.forEach(lines, function(ln) {\r\n\t\t\t\t\tvar fields = ln.split(\",\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tif( fields[0] == lastMetadataLayerTitle() ) {\r\n\t\t\t\t\t\tfields.splice(1, 1);\r\n\t\t\t\t\t\tlastMetadataAbstract( fields.join(',') );\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('#mdtaLink').tab('show');\r\n\t\t\t\t});\r\n\t\t\t},\r\n\t\t\terror : function () {\r\n\t\t\t\t$('#metaError').dialog({\r\n\t\t\t\t\tmodal: true,\r\n\t\t\t\t\tbuttons: {\r\n\t\t\t\t\t\t\"Ok\": function() {\r\n\t\t\t\t\t\t\t$(this).dialog(\"close\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t};\r\n\t\r\n\tesri.request(args);\r\n}", "title": "" }, { "docid": "a88d5ce8e6dbcf77c03f321247fa1a6b", "score": "0.5227589", "text": "function replaceURLPreviewPlaceholders() {\n $(\"a.entity-url\").each(async function() {\n const $this = $(this);\n const url = $this.attr(\"href\");\n const previewData = await getLinkPreviewData(url);\n if(previewData.title) {\n // Only replace if we got something to preview\n const html = MEDIA_OBJECT_TEMPLATE(previewData);\n const elem = $(html);\n $this.replaceWith(elem);\n }\n });\n }", "title": "" }, { "docid": "ae1143d257d43cc0f1edbdc11440226c", "score": "0.5226665", "text": "link() {\n this._definition = this._sbolDocument.lookupURI(this._definition);\n this._mappings = this._sbolDocument.lookupURIs(this._mappings);\n this._measures = this._sbolDocument.lookupURIs(this._measures);\n }", "title": "" }, { "docid": "4b24494f51cd7222f2141dbed9c88e3e", "score": "0.52209604", "text": "addLink(title, href) {\n this.links.push({\n title,\n href\n })\n }", "title": "" }, { "docid": "a09dbab59244d6b743056dfba6609500", "score": "0.52179205", "text": "formatLink(id, type, provider) {\n let url = \"\";\n //set correct base url\n if (provider === \"spotify\") {\n url = \"https://open.spotify.com\";\n } else if (provider === \"deezer\") {\n url = \"https://www.deezer.com\";\n }\n\n //add track/artist + id\n url += `/${type}/${id}`;\n \n return url;\n }", "title": "" }, { "docid": "54d72ce8a5693a3bcf8013a036fac04e", "score": "0.519679", "text": "function returnLinkTemplate(title, description, destination, label) {\n return `\n <li class=\"link-grid__link\">\n <p class=\"link-grid__title\"><strong>${title}</strong></p>\n <p class=\"link-grid__description\">${description}</p>\n <a class=\"link-grid__cta\" href=\"${destination}\">${label}</a>\n </li>\n `;\n}", "title": "" }, { "docid": "84e5001b9954fa5248ca844f439471a7", "score": "0.5191352", "text": "function AVbuildLink( contentName, encodePermalink, showBaseURL, showUnsubscribe, addAnalyitcs, showLinkTag )\n{\n var url = CommonPath + \"/Widgets/linkBuilder.asp?contentName=\" + encodeURIComponent(contentName) + \"&\" + encodeURIComponent(sTokenName) + \"=\" + encodeURIComponent(sToken);\n if ((encodePermalink != undefined) && (encodePermalink == true))\n {\n url += \"&encodePermalink=true\";\n }\n if ((showBaseURL != undefined) && (showBaseURL == true))\n {\n url += \"&showBaseURL=true\";\n }\n if ((showUnsubscribe != undefined) && (showUnsubscribe == true))\n {\n url += \"&showUnsubscribe=true\";\n }\n if ((addAnalyitcs != undefined) && (addAnalyitcs == true)) {\n url += \"&addAnalyitcs=true\";\n }\n if ((showLinkTag != undefined) && (showLinkTag == true)) {\n url += \"&showLinkTag=true\";\n }\n openWidget( \"linkBuilder\", url, { h: 225, w: 600 } );\n}", "title": "" }, { "docid": "2f844a49e81a1876a6484b4eaac5a614", "score": "0.51853734", "text": "insertLink() {\r\n\t\t\t\ttextInserter.insertText(codemirror, \"[]()\", 1);\r\n\t\t\t}", "title": "" }, { "docid": "f6d26be4e8de6bc1e8e61b5893ffea83", "score": "0.5169582", "text": "function getLinkUrls() {\r\n\t\t$('linkhere_url').value = getLinkHereUrl();\r\n\t\t$('embedmap_html').value = getEmbedMapHtml();\r\n\t}", "title": "" }, { "docid": "5f51b1e3854adb6a5ad937f33e61c585", "score": "0.51587224", "text": "function setLibraryHTML(libraryUrlPattern, isbn, title, linktext, color) {\r\n\tvar splLinkyDiv = document.getElementById('splLinkyLibraryHTML');\r\n\tif (splLinkyDiv == null) { return; }\r\n\r\n\tvar link = document.createElement('a');\r\n\tlink.setAttribute('title', title );\r\n\tlink.setAttribute('href', libraryUrlPattern+isbn);\r\n\tlink.setAttribute('target', \"_blank\");\r\n\tlink.style.color = color;\r\n\r\n\tvar label = document.createTextNode( linktext );\r\n\tlink.appendChild(label);\r\n\r\n\t//append to existing content\r\n\tsplLinkyDiv.appendChild(link);\r\n\tsplLinkyDiv.appendChild(document.createElement('br'));\r\n}", "title": "" }, { "docid": "a8f8afb3c48d5b822ac3dffbb1b749e4", "score": "0.5154865", "text": "function insertToDoc(title, extract, wikiLink) {\n\t\tvar entry = '<a href=\"' + wikiLink + '\"><div class=\"entry\"><h3>' + title + '</h3><p class=\"lead\">' + extract + '</p></div></a><br>';\n\t\t$(\"#results\").append(entry);\n\t}", "title": "" }, { "docid": "9cbe112dba53eeba0aba426f87b7919d", "score": "0.51494944", "text": "function LinkMarkerToContent(marker, string, wikiUrl){\n var formattedDefaultStr = \"<ul id='wikiArticles'>\" + string + \"</div>\";\n var infowindow = new google.maps.InfoWindow({\n content: formattedDefaultStr\n });\n\n map.addListener('click',function(){\n if (infowindow.opened){\n infowindow.close();\n }\n });\n marker.addListener('click', function() {\n if(infowindow.opened){\n infowindow.close();\n infowindow.opened = false;\n }\n else{\n getWikiArticles(wikiUrl,infowindow, formattedDefaultStr);\n infowindow.open(marker.get('map'), marker);\n infowindow.opened = true;\n }\n });\n }", "title": "" }, { "docid": "af6a2a01c1af9b1ab5d09ef6bbff2e9f", "score": "0.5142792", "text": "function saveMetadata() {\n setMetaData(metaInput.value); // set field metadata\n}", "title": "" }, { "docid": "29f65e5e9de0f1db2373fd46b752bb11", "score": "0.5140052", "text": "addLink(traceId, spanId, type, attributes) { }", "title": "" }, { "docid": "d0706309a226063b1b1527871eb91fa8", "score": "0.51365125", "text": "function loadMetadata(response, content) {\n content['Title'] = response.title;\n content['Summary'] = response.clip;\n content['Duration'] = response.durati;\n content['Source of the Clip'] = response.creato;\n content['Participants/Performers'] = response.partic;\n content['Notes'] = response.notes;\n content['Subjects (LCSH)'] = response.subjea;\n content['Location Depicted'] = response.locati;\n content['Date Created'] = response.type;\n content['Language'] = response.langub;\n content['Digital Collection'] = response.digita;\n content['Order Number'] = response.order;\n content['Ordering Information'] = response.orderi;\n content['Repository'] = response.reposi;\n content['Repository Collection'] = response.reposa;\n content['Repository Collection Guide'] = response.reposb;\n content['Digital Reproduction Information'] = response.digitb;\n content['Rights'] = response.righta;\n content['Type'] = response.typa;\n }", "title": "" }, { "docid": "e24df1f2591055bb0c9d370fb1b6da8d", "score": "0.51166433", "text": "function addLinksToHalResponse (halResponse, data, isAuth, state, params, host) {\n let possible_transitions = stateHandler.getActionableTransitions(isAuth, state)\n let self_url = transitions.getUrl(state, transitions.fillTemplateWithParams(params))\n halResponse._links = {\n self: { href: host + self_url }\n }\n for (let transition of possible_transitions) {\n halResponse._links[transition.rel] = {\n href: host + transitions.getUrlFromTransition(transition, state, params, data)\n }\n if (transition.isUrlTemplate) {\n halResponse._links[transition.rel].templated = true \n }\n }\n}", "title": "" }, { "docid": "a42d600a22b4d219d9ebeba4bf36f56c", "score": "0.51123357", "text": "function add_metadata() {\n return (files, metalsmith) => {\n Object.keys(files).forEach(file => {\n files[file].meta = metalsmith._metadata;\n });\n };\n}", "title": "" }, { "docid": "3bf8e9b705bb7d747d485a969fad55be", "score": "0.51070637", "text": "function updatePermalinks() {\n window.location.hash = Shareloc.Permalink.createHash(map);\n var pl = Shareloc.Permalink.createPermalinkUrl(map);\n $('#code #embed-pl.list-group-item a.pl-link').attr('href', pl);\n $('#code #embed-pl.list-group-item a.pl-mail').attr('href',\n 'mailto:?body=' + encodeURIComponent(pl) + '%0D%0A%0D%0Acreated by Shareloc');\n $('#code #embed-iframe.list-group-item').text(Shareloc.Permalink.createIframeCode(map));\n }", "title": "" }, { "docid": "6264b8f8940161cb531f1904a7253f34", "score": "0.5089009", "text": "function translateIntoHtml(videoMetaData) {\n return `\n<div class='video-box'>\n <p>\n <label for=\"Youtube URL Link\"> <b>You<span style=\"background-color: #FF0000\">Tube</span></b> Link: \n <a href=\"https://www.youtube.com/watch?v=${videoMetaData.id}\"><u>${videoMetaData.title}</u></a>\n </label>\n </p>\n <img class='thumb' src=\"${videoMetaData.thumbnail}\"></img>\n <a href=\"<a href=\"https://www.youtube.com/channel/${videoMetaData.channel}\"><b>Click here</b> for more videos from this Channel: ${videoMetaData.channelName}</a>\n</div>\n `\n}", "title": "" }, { "docid": "0ebedb797899ffd23e2bdc263f5282d8", "score": "0.5086432", "text": "buildLink(original, target, caption, monospace) {\n let attributes = \"\";\n if (this.urlPrefix.test(target)) {\n attributes = ' class=\"external\"';\n }\n else {\n let reflection;\n if (this.reflection) {\n reflection = this.reflection.findReflectionByName(target);\n }\n else if (this.project) {\n reflection = this.project.findReflectionByName(target);\n }\n if (reflection && reflection.url) {\n if (this.urlPrefix.test(reflection.url)) {\n target = reflection.url;\n attributes = ' class=\"external\"';\n }\n else {\n target = this.getRelativeUrl(reflection.url);\n }\n }\n else {\n const fullName = (this.reflection ||\n this.project).getFullName();\n this.warnings.push(`In ${fullName}: ${original}`);\n return original;\n }\n }\n if (monospace) {\n caption = \"<code>\" + caption + \"</code>\";\n }\n return Util.format('<a href=\"%s\"%s>%s</a>', target, attributes, caption);\n }", "title": "" }, { "docid": "a4c31df2c0b789a5c8b53e929c1d4285", "score": "0.5081156", "text": "function addLinks(tweet) {\n function insertHrefInTag(text, url) {\n var out = \"<a href='\" + url +\n \"' target='_blank'>\" + text + \"</a>\";\n return out;\n }\n var out = tweet.text;\n out = out.replace(/[A-Za-z]+:\\/\\/[A-Za-z0-9-_]+\\.[A-Za-z0-9-_:%&~\\?\\/.=]+/g, function(url) {\n var tweetText = url;\n if (tweet.entities.urls !== undefined && tweet.entities.urls.length > 0) {\n var myUrl = _.find(tweet.entities.urls, function(urlObj) {\n return urlObj.url === url;\n });\n if (myUrl !== undefined && myUrl !== null) {\n tweetText = myUrl.display_url;\n }\n }\n //return tweetText.link(url);\n return insertHrefInTag(tweetText, url);\n });\n\n out = out.replace(/[#]+[A-Za-z0-9-_]+/g, function(hash) {\n txt = hash.replace(\"#\", \"\");\n //return hash.link(\"http://twitter.com/search/%23\" + txt);\n return insertHrefInTag(hash, \"http://twitter.com/search/%23\" + txt);\n });\n out = out.replace(/[@]+[A-Za-z0-9-_]+/g, function(u) {\n var username = u.replace(\"@\", \"\")\n //return u.link(\"http://twitter.com/\" + username);\n return insertHrefInTag(u, \"http://twitter.com/\" + username);\n });\n return out;\n }", "title": "" }, { "docid": "6f8e67833415297ad84940fa23a291ee", "score": "0.5081062", "text": "addMetadata(key, value) {\n if (!this.templateOptions.metadata) {\n this.templateOptions.metadata = {};\n }\n this.templateOptions.metadata[key] = value;\n }", "title": "" }, { "docid": "351b9016869beb6375a20886b282b661", "score": "0.50794643", "text": "function setExternalLink(url,label) {\n return '<a href=\"'+url+'\" target=\"_blank\">'+label+'<span class=\"glyphicon glyphicon-new-window external-link-smaller\"></span></a>';\n\n}", "title": "" }, { "docid": "9edf33ae45c03d891532f28665432b52", "score": "0.5074243", "text": "function addmetadata() {\n\n var nameparagraph = document.createElement('p');\n nameparagraph.id = \"imagename\";\n nameparagraph.innerText = imagetitle;\n\n var descriptionparagraph = document.createElement('p');\n descriptionparagraph.id = \"imagedescription\";\n descriptionparagraph.innerText = imagedescription;\n var imageslocation = document.getElementsByClassName(\"img1\");\n imageslocation.appendChild(nameparagraph);\n}", "title": "" }, { "docid": "fcceaedefcc3d91bc89e299830ae2b6c", "score": "0.5074154", "text": "function make_url(link, text){\n\treturn \"<a href='\"+link+\"' target='_blank'>\"+text+\"</a>\";\n}", "title": "" }, { "docid": "b17de2806f7abbc0c7909ab2133e10bc", "score": "0.5073203", "text": "function linkInfo(d) { // Tooltip info for a link data object\r\n return \"Link:\\nfrom \" + d.from + \" to \" + d.to;\r\n}", "title": "" }, { "docid": "9df58f846ed2d434a19babb468f9f505", "score": "0.507118", "text": "saveLink() {\n saveURL(\n this.linkURL,\n this.linkTextStr,\n null,\n true,\n null,\n null,\n null,\n document\n );\n }", "title": "" }, { "docid": "fc46371b7b8c87e272f1d35c87d927a1", "score": "0.50708354", "text": "function mapData({ data, url }){\n return data.map( (item, index) => {\n const longerTextIndex= item.rawContent.indexOf(\"...\")\n if(longerTextIndex>=0) {\n const anchorTemplate = `<a href='${url}' target='_blank'>ver mas</a>`\n item.rawContent.slice(0, longerTextIndex).concat(encodeURI(anchorTemplate))\n item = {...item, viewMoreUrl: url, viewMoreButton: anchorTemplate }\n }\n return item\n })\n}", "title": "" }, { "docid": "1e632f14cf4daf3c7ee9a46d9eb00f55", "score": "0.50681376", "text": "function addmetaTitleAndDecription(files){\n var localObj = new Object();\n files.forEach(function (file) {\n var originalSchema = JSON.parse(fs.readFileSync(file).toString());\n var id = originalSchema[\"$id\"];\n var schemaname = id.substr(id.lastIndexOf('/') + 1);\n addMetaId(originalSchema,\"title\",null,schemaname);\n addMetaId(originalSchema,\"description\",null,schemaname);\n fs.writeFileSync(file, JSON.stringify(originalSchema,null, 2), 'utf8');\n\n\tcreateLocalizationFileAttributes(originalSchema, localObj)\n });\n fs.writeFileSync('../__localization__/en-US.json', JSON.stringify(localObj,null, 2), 'utf8');\n}", "title": "" }, { "docid": "7e59bdb53e730274c982b0b0780e418c", "score": "0.505655", "text": "function typeLink(typeLink, text){\n const linkText = {};\n switch (typeLink) {\n case 'hiveExplorer':\n linkText.link = `https://hiveblocks.com/tx/${text}`;\n break;\n case 'portfolio':\n linkText.link = `/portfoliouser?query=${text}`;\n break;\n case 'regularOut':\n \n break;\n default:\n break;\n }\n return linkText;\n }", "title": "" }, { "docid": "5d16955fb8fccb8c5f734d154429e6c4", "score": "0.5052513", "text": "function modifyLink(id,link,displayname,color) {\r\n\t$('#id-holder').val(id);\r\n\t$('#link').val(link);\r\n\t$('#displayname').val(displayname);\r\n\t$('#color').val(color);\r\n\t$('#custom-modal').show();\r\n\t$('#modal-submit').html('Save'); //Change submit buttons text.\r\n}", "title": "" }, { "docid": "91bc10995c2359a36e28be59c2f848bd", "score": "0.5051102", "text": "constructor(description, url) {\n this.description = description;\n this.url = url;\n this.items = '';\n }", "title": "" }, { "docid": "b1f6b26470d64a14fd73ff7fe23a9416", "score": "0.5050014", "text": "function populateHref(data) {\n if (data['@id']) {\n data.href = data['@id'].substring(1);\n }\n }", "title": "" }, { "docid": "901427afae36dc3df01fba06b4c9ef9d", "score": "0.5047958", "text": "function updateLinkPreview() {\n\t\t\n\t\tif(!$linkPageURL.val().length) {\n\t\t\t$(\"#link_markup\").text('');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tvar $link = $(\"<a />\");\n\t\t$link.attr('href', $linkPageURL.val()); \n\t\n\t\tvar $linkTitle = $(\"#link_title\"); \n\t\tif($linkTitle.length && $linkTitle.val().length) {\n\t\t\tvar val = $(\"<div />\").text($linkTitle.val()).html();\n\t\t\t$link.attr('title', val); \n\t\t}\n\t\t\n\t\tvar $linkRel = $(\"#link_rel\"); \n\t\tif($linkRel.length && $linkRel.val().length) {\n\t\t\t$link.attr('rel', $linkRel.val()); \n\t\t}\n\t\t\n\t\tvar $linkTarget = $(\"#link_target\"); \n\t\tif($linkTarget.length && $linkTarget.val().length) {\n\t\t\t$link.attr('target', $linkTarget.val()); \n\t\t}\n\n\t\tvar $linkClass = $(\"#wrap_link_class\").find('input:checked');\n\t\tif($linkClass.length) {\n\t\t\t$linkClass.each(function() {\n\t\t\t\t$link.addClass($(this).val()); \n\t\t\t});\n\t\t}\n\t\t\n\t\t$(\"#link_markup\").text($link[0].outerHTML);\n\t}", "title": "" }, { "docid": "63db06b78d6825a50f6d09c14a5a02f9", "score": "0.5045177", "text": "function customRenderFunction( text, context ) {\n var page, namespace,\n title = mw.Title.newFromText( text ),\n info = computeResultRenderCache( context );\n \n info.linkParams[ info.textParam ] = text;\n\n page = title.getMainText();\n \n //console.log(page);\n \n namespace = $( '<span>' ).text( mw.config.get( 'wgFormattedNamespaces' )[ title.namespace ] ).addClass( 'mw-mnss-srcc' );\n var links = $( '<a>' ).attr( 'href', info.baseHref + $.param( info.linkParams ) ).addClass( 'mw-searchSuggest-link' );\n \n // 'this' is the container <div>, jQueryfied\n modalContent.append( page, namespace ).wrap( links );\n }", "title": "" }, { "docid": "3401f11a5f8917be899644a103e0d0c1", "score": "0.50360775", "text": "addDescriptionAndLinks(){\n const missionInfo = {\n description: this.props.missionInfo.details,\n linkList: [\n this.props.missionInfo.links.reddit_campaign,\n this.props.missionInfo.links.reddit_launch,\n this.props.missionInfo.links.reddit_recovery,\n this.props.missionInfo.links.reddit_media,\n this.props.missionInfo.links.presskit,\n this.props.missionInfo.links.article_link,\n this.props.missionInfo.links.wikipedia\n ],\n };\n return(\n <div className='col-md-10'>\n {(missionInfo.description !== null) ?\n <div className='row'>Description:<br/>{missionInfo.description}</div> : <span></span>}\n <div className='row'>\n {(missionInfo.linkList !== undefined)?\n <div className='container-fluid'>Links:<br/><ul>\n {this.addLinks(missionInfo.linkList)}</ul></div>\n : <span></span>\n }\n </div>\n </div>\n );\n }", "title": "" }, { "docid": "c9f8e03652f62d45116886819c4ccc9a", "score": "0.502597", "text": "function MetadataProvider() {\n}", "title": "" }, { "docid": "300c32c55173d4e03510ef0c0834a866", "score": "0.50182503", "text": "_appendSpecificMetaData(meta) {\n return meta;\n }", "title": "" }, { "docid": "225746899e6d6f63afb786ecf6142b83", "score": "0.5014476", "text": "addLinks(data) {\n if (!this[LINK_STORAGE]) {\n this[LINK_STORAGE] = {};\n }\n\n _.each(data, (linkConfig, linkName) => {\n if (this[LINK_STORAGE][linkName]) {\n throw new Meteor.Error(\n `You cannot add the link with name: ${linkName} because it was already added to ${\n this._name\n } collection`\n );\n }\n\n const linker = new Linker(this, linkName, linkConfig);\n\n _.extend(this[LINK_STORAGE], {\n [linkName]: linker,\n });\n });\n }", "title": "" }, { "docid": "8a804ca3c622689ddd54c3e93e58747c", "score": "0.5010246", "text": "function PageContent_Links( out, links, title, full ) { \n\n\tif( links.length == 0 ) return; // no links made yet.\n\t\n\tvar html_links = [];\n\t\n\tfor( var i = 0; i < links.length; i++ ) {\n\t\n\t\tvar score = links[i].score;\n\t\tbiased_score = BiasScore( score, links[i].vote );\n\t\t\n\t\tvar scoreclass = \"\";\n\t\tif( links[i].vote === true ) scoreclass = \"up\";\n\t\tif( links[i].vote === false ) scoreclass = \"down\";\n\t\t\n\t\tvar upclass = links[i].vote === true ? \"selected\" : \"\";\n\t\tvar downclass = links[i].vote === false ? \"selected\" : \"\";\n\t\t\n\t\tvar caption = full ? \n\t\t\t(links[i].source + ' <i class=\"fa fa-arrow-right\"></i> ' + links[i].dest) :\n\t\t\tlinks[i].dest;\n\t\t\n\t\thtml_links.push( \n\t\t\tReadTemplate( \"#template_link\", {\n\t\t\t\t\"source\": links[i].source,\n\t\t\t\t\"dest\": links[i].dest,\n\t\t\t\t\"score\": score,\n\t\t\t\t\"scoreclass\": scoreclass,\n\t\t\t\t\"biased_score\": biased_score,\n\t\t\t\t\"upclass\": upclass,\n\t\t\t\t\"downclass\": downclass,\n\t\t\t\t\"caption\": caption\n\t\t\t})\n\t\t);\n\t\t\t\t\n\t \n\t} \n\t\n\tout.push( \n\t\tReadTemplate( \"#template_links\", {\n\t\t\t\"title\": title,\n\t\t\t\"links\": html_links.join(\"\")\n\t\t})\n\t);\n}", "title": "" }, { "docid": "9b2c5a1100c69103a0b53a24a85ebf63", "score": "0.5008937", "text": "addLink(name, url) {\n let l = new Link(name, url)\n this.items.push(l);\n }", "title": "" }, { "docid": "598dbf5541534d8508fb622cdd9aa854", "score": "0.4991963", "text": "function addWebLink(label, linkSource)\n{\n if (linkSource == '' || (typeof linkSource === 'undefined'))\n {\n return '';\n }\n\n // init vars\n var imgMarkup;\n var linkMarkup;\n\n if (label == 'facebook')\n {\n imgMarkup = '<img src=\"/images/social-icons/facebook.png\" />';\n linkMarkup = '<a target=\"_blank\" href=\"' + linkSource +'\">' + imgMarkup + '</a>';\n }\n\n if (label == 'twitter')\n {\n imgMarkup = '<img src=\"/images/social-icons/twitter.png\" />';\n linkMarkup = '<a target=\"_blank\" href=\"' + linkSource +'\">' + imgMarkup + '</a>';\n }\n\n if (label == 'website')\n {\n imgMarkup = '<img src=\"/images/social-icons/goodbed.png\" />';\n linkMarkup = '<a target=\"_blank\" href=\"' + linkSource +'\">' + imgMarkup + '</a>';\n }\n\n // markup vars didn't get set so exit the function\n if ((!imgMarkup || imgMarkup == '') || (!linkMarkup || linkMarkup == ''))\n {\n return false;\n }\n\n return '<li>' + linkMarkup + '</li>';\n}", "title": "" }, { "docid": "474a8006efde423b4619c3b88ef0d343", "score": "0.49912468", "text": "function tweakLink() {\n\tlinks.text(editInLine);\n\tsetTimeout(fixLink, 300);\n}", "title": "" }, { "docid": "5689b32945bccda8e0b56965d3a46667", "score": "0.49774164", "text": "function insert_ticket_knowledgebase_link(id) {\n $.get(admin_url + 'knowledge_base/get_article_by_id_ajax/' + id, function(response) {\n var textarea = $('textarea[name=\"message\"]');\n var data = Editor.getHTML();\n var link = site_url + 'knowledge_base/' + response.slug;\n data += link;\n Editor.setHTML(data);\n $('#insert_knowledge_base_link').modal('hide');\n }, 'json');\n}", "title": "" }, { "docid": "2cea5a261d8fffce7f0423d211f56908", "score": "0.4975679", "text": "function associateWebsiteToTitle(infoBoxDescription, infobox) {\n var websiteStart = infoBoxDescription.search(\"http\");\n var website = '';\n if (websiteStart != -1) {\n website = infoBoxDescription.substring(websiteStart);\n }\n if(website != ''){\n infobox.setOptions({\n titleClickHandler: function (e) { window.open(website, '_blank'); e.preventDefault(); }\n });\n }\n}", "title": "" }, { "docid": "9b8ebec0d8c41b04226f3d9bea4ef9c1", "score": "0.49717516", "text": "function pushLink(source, target, value) {\n\t\t\tdata.links.push({\n\t\t\t\t\"source\": source,\n\t\t\t\t\"target\": target,\n\t\t\t\t\"value\" : value\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "940949bb5d9b024be066296c00be2800", "score": "0.4968297", "text": "function Metadata(data) {\n\n processMetadata(data);\n }", "title": "" }, { "docid": "979dfdbe972f45a009be19edc7038002", "score": "0.49666688", "text": "function newMeetingLink(){\n // Gets string location or url input\n let linkLocation = document.getElementById('link-location').value; \n // Get title for File\n let fileTitle = document.getElementById('link-title').value;\n \n //Create link -- EVERYTHING goes in the LINK.\n let theLink = document.createElement('a');\n theLink.setAttribute(\"href\",linkLocation);\n theLink.setAttribute(\"taget\",'_blank');\n \n //Creates div .Local-file-box or .URL-file-box\n let holdingBox = document.createElement(\"div\");\n holdingBox.setAttribute('class','link-box'); \n // Function to deal with filetypes to display image will go here.\n let fileTypeImage = 'Placeholder for now';\n holdingBox.innerHTML = fileTypeImage + ' ' + fileTitle;\n theLink.appendChild(holdingBox);\n\n document.getElementById('meeting-links').appendChild(theLink);\n}", "title": "" }, { "docid": "023398d5ca01fd1d0d0354fd58414b7b", "score": "0.4965205", "text": "function linkInfo(d) { // Tooltip info for a link data object\n return \"Link:\\nfrom \" + d.from + \" to \" + d.to;\n }", "title": "" }, { "docid": "4a6aab9c4669c03b77d0821aae46a6c1", "score": "0.495651", "text": "function addListLinks(items) {\n Array.prototype.forEach.call(items, function(item) {\n var title = item.querySelector('a').innerHTML.cleanTitle();\n item.addVKLink(title);\n });\n}", "title": "" }, { "docid": "fbcc66048ea926235d018a7d717984fc", "score": "0.49548095", "text": "function add_fields(link, association, content) { \nvar new_id = new Date().getTime(); \nvar regexp = new RegExp(\"new_\" + association, \"g\"); \n$(link).up().insert({ \nbefore: content.replace(regexp, new_id) \n}); \n}", "title": "" }, { "docid": "be51aeb9f86453c854ddc47de3e917f8", "score": "0.49541324", "text": "function Links({ data }) {\n // Extract unique descending hall of fame selection years\n const selectionYears = extractSelectionYears(data.hallOfFame.edges);\n\n const newHeadings = data.links.headings\n .map((heading) => {\n const { value, depth } = heading;\n // Inject project headings\n if (value === 'hall-of-fame-headers') {\n return selectionYears\n .map((year) => {\n const projectSelection = [\n ...data.hallOfFame.edges,\n ].filter(({ node }) => node.frontmatter.year === year);\n\n const selectionHeader = {\n value: buildSelectionHeader(year),\n depth: depth - 2,\n };\n return [\n selectionHeader,\n ...injectProjectHeaders(\n projectSelection,\n true,\n depth - 1\n ),\n ];\n })\n .flat();\n }\n\n return heading;\n })\n .flat();\n\n // Custom components to generate from markdown html\n const customComponents = {\n h4: () => null,\n ['hall-of-fame']: () => <HallOfFame />,\n };\n\n // Render\n return (\n <PageLayout title={'Links'}>\n <MarkdownPage\n title={'Useful Links'}\n markdown={{ ...data.links, headings: newHeadings }}\n components={customComponents}\n />\n </PageLayout>\n );\n}", "title": "" }, { "docid": "0e93c65e137a154c6db3d1667fd9698b", "score": "0.4951552", "text": "function renderLink(widget, content) {\r\n widget.href = content;\r\n}", "title": "" }, { "docid": "19b739a739ce1d1f05711cd9f338606e", "score": "0.4948264", "text": "function seeLinks ()\n {\n $(\".moreInfoDetail\").remove();\n\n var appID = $(this).attr(\"id\");\n var appLink = $(this).attr(\"data-app\");\n var gitLink = $(this).attr(\"data-git\");\n\n var appInsert = \"<div class = 'moreInfoDetail'><a class = 'font-green' href ='\" + appLink + \"' target='_blank'>Live Application</a></div>\"\n var gitInsert = \"<div class = 'moreInfoDetail'><a class = 'font-green' href ='\" + gitLink + \"' target='_blank'>GitHub Source</a></div>\"\n\n $(this).append(appInsert);\n $(this).append(gitInsert);\n }", "title": "" }, { "docid": "eb0f84aed97af62310b4b945552c157d", "score": "0.49426502", "text": "function makeEmbed(title, desc, color, url=null){\n let embed = {\n \"title\": `${title}`,\n \"description\": `${desc}`,\n \"color\": `${color}`\n }\n if(url !== null){\n embed[\"url\"] = `${url}`\n }\n return embed;\n}", "title": "" }, { "docid": "dacc6df5fcb0fd080ce12be2cd2fd6c3", "score": "0.49413472", "text": "function urlRender(value,metadata,record,rowIndex,colIndex,store) {\r\n\tvar storeIndex = findStoreIndex(store);\r\n\tvar title = record.data['title'];\r\n\tvar dummy = record.data['dummy'];\r\n\tif (dummy != undefined) {\r\n\t\tmetadata.attr = \"title=\\\"\" + title + \"\\\"\";\r\n\t\treturn title;\r\n\t}\r\n\tvar result = '<a href=\"javascript:openDocument('+rowIndex + ',' + storeIndex+');\">'+ title +'</a>'; \r\n\treturn result;\r\n}", "title": "" }, { "docid": "f7d72f6fd8d8b8d21b6ac49a3157a3eb", "score": "0.4941181", "text": "function annotateLinkAction() {\n let linkValue = prompt('Please insert a link');\n document.execCommand('createLink', false, linkValue);\n}", "title": "" }, { "docid": "fafedbe4dad3e4e4c10751e22bde4446", "score": "0.49408168", "text": "function buildAnchor( object, linkcode ){\n var baseURL = document.getElementById(\"baseURL\").value;\n var a = document.createElement(\"a\");\n a.textContent = object.name;\n a.setAttribute(\"href\", baseURL + \"/\"+ linkcode +\"/\" + object.__id__);\n a.setAttribute(\"target\", \"_blank\");\n return a;\n}", "title": "" }, { "docid": "ddcbb2996839e4deb23666fb9ea2fd0b", "score": "0.49348855", "text": "function loadMetadata(version, metadata)\n {\n Metadata.container.name = $(metadata).children('name').text();\n $('#scenarioNameTab .scenarioName').text(Metadata.container.name);\n Main.updateDocumentTitle();\n Metadata.container.description = $(metadata).children('description').text();\n\n if (version) Metadata.container.version = version;\n\n $(metadata).children('authors').children().each(function()\n {\n const author = {};\n author.name = this.attributes.name.value;\n if (this.attributes.email) author.email = this.attributes.email.value;\n author.startDate = this.attributes.startDate.value;\n if (this.attributes.endDate) author.endDate = this.attributes.endDate.value;\n Metadata.container.authors.push(author);\n });\n\n const languageXML = $(metadata).children('language');\n if (languageXML.length > 0)\n {\n const languageCode = $(languageXML).attr('code');\n if (languageCode in Config.container.settings.languages.byCode)\n {\n Metadata.container.language = { code: languageCode, name: $(languageXML).text() };\n }\n }\n\n Metadata.container.difficulty = $(metadata).children('difficulty').text();\n\n Metadata.container.propertyValues = loadPropertyValues($(metadata).children('propertyValues'), ['independent']);\n }", "title": "" }, { "docid": "c345a07a88cd3ea891dfb64da5068aeb", "score": "0.4934192", "text": "_addDatasources(settings, data, metadata) {\n let datasources = settings.datasources;\n for (let datasourceName in datasources) {\n let datasource = datasources[datasourceName];\n if (datasource.url) {\n const quad = this.dataFactory.quad, namedNode = this.dataFactory.namedNode, literal = this.dataFactory.literal;\n metadata(quad(namedNode(datasource.url), namedNode(rdf + 'type'), namedNode(voID + 'Dataset')));\n metadata(quad(namedNode(datasource.url), namedNode(rdf + 'type'), namedNode(hydra + 'Collection')));\n metadata(quad(namedNode(datasource.url), namedNode(dcTerms + 'title'), literal('\"' + datasource.title + '\"', 'en')));\n }\n }\n }", "title": "" }, { "docid": "ddce40ad095e8d8d1d42aaa45c98824b", "score": "0.49315643", "text": "function renderEntry(entry) {\n const anchor = document.createElement(\"a\");\n anchor.innerHTML = entry[\"title\"];\n anchor.setAttribute(\"href\", entry[\"link\"]);\n return anchor;\n}", "title": "" }, { "docid": "b7378f76ddff79ca372ca7d7f72c686f", "score": "0.4928292", "text": "function draugiemGalleryAdd(title, url, description, callback) {\n\tif (typeof url == 'object') {\n\t\turl = url.join('|');\n\t}\n\tdraugiemLoadUrl({'action': 'gallery', 'title': title, 'description': description, 'url': url}, callback);\n}", "title": "" }, { "docid": "d4fe4a6e287aed03ccb392bc495b1c60", "score": "0.49258202", "text": "function scrapeEmbedMeta(doc, url) {\n\tvar translator = Zotero.loadTranslator(\"web\");\n\t//Embedded Metadata translator\n\ttranslator.setTranslator(\"951c027d-74ac-47d4-a107-9c3069ab7b48\");\n\n\ttranslator.setDocument(doc);\n\n\ttranslator.setHandler(\"itemDone\", function(obj, item) {\n\t\t//remove all caps in Names and Titles\n\t\tfor (i in item.creators){\n\t\t\tif (item.creators[i].lastName && item.creators[i].lastName == item.creators[i].lastName.toUpperCase()) {\n\t\t\t\titem.creators[i].lastName = Zotero.Utilities.capitalizeTitle(item.creators[i].lastName.toLowerCase(),true);\n\t\t\t}\n\t\t\tif (item.creators[i].firstName && item.creators[i].firstName == item.creators[i].firstName.toUpperCase()) {\n\t\t\t\titem.creators[i].firstName = Zotero.Utilities.capitalizeTitle(item.creators[i].firstName.toLowerCase(),true);\n\t\t\t}\n\t\t}\n\n\t\tif (item.title == item.title.toUpperCase()) {\n\t\t\titem.title = Zotero.Utilities.capitalizeTitle(item.title.toLowerCase(),true);\n\t\t}\n\n\t\tif(!item.abstractNote) item.abstractNote = getAbstract(doc);\n\n\t\tvar pdf = getPdfUrl(url);\n\t\tif(pdf) {\n\t\t\titem.attachments = [{\n\t\t\t\turl: pdf,\n\t\t\t\ttitle: 'Full Text PDF',\n\t\t\t\tmimeType: 'application/pdf'}];\n\t\t}\n\n\t\tif( !item.tags || item.tags.length < 1 ) item.tags = getKeywords(doc);\n\n\t\tif (item.notes) item.notes = [];\n\n\t\titem.complete();\n\t});\n\n\ttranslator.translate();\n}", "title": "" }, { "docid": "6239858ce13f1bee6eb6a1c0ef43fc8d", "score": "0.4925807", "text": "function insertModalInfo() {\n // Insert basic info\n insertBasicInfo($mcImage, $mcName, $mcEmail, $mcCity);\n\n // Insert email into link w/ mailto\n $mcEmail.attr('href', `mailto:${sourceEmail}`);\n // Insert cell number\n $mcPhone.text(`${sourcePhone}`);\n // Insert parsed phone number into link w/ tel\n $mcPhone.attr('href', `${parsedPhone}`);\n // Insert address\n $mcAddress.text(`${sourceAddress}`);\n // Insert birthday\n $mcBirthday.text(`${sourceBirthday}`);\n} // end of insertModalInfo()", "title": "" }, { "docid": "866c272968fbca39c477cea597c2240b", "score": "0.49216253", "text": "function appendRichPreview(link, title, imageUrl) {\n let richPreview =\n $(richPreviewTemplate)\n .find('div.rich-preview-image a.rich').attr('href', link).end()\n .find('a.rich img').attr('src', imageUrl).end()\n .find('div.rich-preview-link a').attr('href', link).text(title).end()\n $(link).replaceWith(richPreview);\n}", "title": "" }, { "docid": "9f0aa75b2e5de9812e4e9bf200cc14f6", "score": "0.49193987", "text": "static addLinkToList(link) {\n const list = document.querySelector('.links__items')\n const row = document.createElement('li')\n row.className = 'row'\n\n row.innerHTML = `\n <span class=\"col-6\">${link.title}</span>\n <span class=\"col-6\">\n <a href=\"${link.url}\" data-id=\"${link.id} \"target=\"_blank\">${link.url}</a>\n <input type=\"text\" class=\"edit-link\" style=\"display:none\">\n <span><a href=\"#\" class=\"edit\">Edit</a></span>\n <span><a href=\"#\" class=\"delete\">X</a></span>\n </span>\n `\n list.prepend(row);\n }", "title": "" }, { "docid": "7c02f33724db990895be3e437386a921", "score": "0.4917495", "text": "function setDescLinks(description) {\n const descArr = description.split(\" \");\n const updatedDescArr = descArr.map(word => {\n if (word.startsWith(\"https\") || word.startsWith(\"http\")) {\n return `<a href=\"${word}\" target=\"_blank\">${word}</a>`;\n }\n\n return word;\n });\n\n return updatedDescArr.join(\" \");\n}", "title": "" } ]
f8bb7c2bc880d0dfbb92cae92af391ff
This function is called when someone finishes with the Login Button. See the onlogin handler attached to it in the sample code below.
[ { "docid": "6f5c111b9501bba2bf06ccabdc23bfd9", "score": "0.0", "text": "function checkLoginState() {\n FB.getLoginStatus(function (response) {\n statusChangeCallback(response);\n });\n}", "title": "" } ]
[ { "docid": "b0ceddf32c832a8e9c503f9a15f7d387", "score": "0.75246257", "text": "function onLoginComplete() {\n\tlongPoll();\n\t$('#send-button').on('click', sendText);\n\t$('#input-field').on('keypress', inputKeyPressed);\n}", "title": "" }, { "docid": "d48525dded6c138d4c04bc58394fdda8", "score": "0.744677", "text": "doneCallback() {\n this.doLogin();\n }", "title": "" }, { "docid": "8af68e44e80d195d64e3bf14d1a268fe", "score": "0.7379587", "text": "function onLoginFailed() {\n\t\tUIState.unauthenticated();\n\t\talert('Login Failed!');\n\t}// Event handler for login form button", "title": "" }, { "docid": "1270f195f0358a6d195fdb596fbf80b9", "score": "0.7296211", "text": "function onLogin()\r\n{\r\n return true;\r\n}", "title": "" }, { "docid": "8767429668e1ac773d8d6d0af60947ed", "score": "0.70579386", "text": "function onLogin(res) {\n if (res.token) {\n http.setJWT(res.token);\n loggedIn = true;\n showPage('event');\n }\n }", "title": "" }, { "docid": "7dd28102739efc558aa151babfc724bc", "score": "0.69732845", "text": "function loginEventHandler() {\n\t$('#login_dive').delegate('#loginbtn', 'click', function() { \n\t\t//alert(\"About to login\");\n\t\tloginUser();\n\t});\n}", "title": "" }, { "docid": "9a3cab096e5ed63eb1ee428b2519fa69", "score": "0.6968302", "text": "function LoginUserCallBack() {\n loginUser();\n }", "title": "" }, { "docid": "eab7a6b73bbb457466f2869db0c4f636", "score": "0.69335866", "text": "function onLogin(data) {\n\t//on message from server for our login request\n\tif (data.success === false) {\n\t\talert(\"Nickname already taken, try with different one:)\");\n\t} else {\n\t\tnickname = data.name;\n\t\tloginStatus = true;\n\t\tconnectionOff = false\n\t\tconfigRTC = data.config\n\t\t//display the call page if login is succesful\n\t\tpageLogin.style.display = \"none\";\n\t\tpageCall.style.display = \"block\";\n\t}\n}", "title": "" }, { "docid": "9efccc3a1fd72d6e56ec49bbd9ccb6c3", "score": "0.68677586", "text": "function loginHandler(){\n\tuser.set(\"username\", usernameField.value);\n\tuser.set(\"password\", passwordField.value);\n\tuser.logIn({\n\t\tsuccess:function (user){\n\t\t\tconsole.log(\"login worked\");\n\t\t\tloggedIn();\n\n\t\t}, \n\t\terror: function (user, error){\n\t\t\tconsole.log(\"error \"+ error.code);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "bccf61d688741b6b95ffc75eaaf8916a", "score": "0.68360746", "text": "handleLogin(data) {\r\n this.emit(Events.BaseEvents.LoginResult, data);\r\n }", "title": "" }, { "docid": "e0c979107011066942f54a5f412aadc0", "score": "0.6832057", "text": "function EventLogin() {\n\t\ttop.API.Dat.addEvent(\"GetPersistentDataComplete\", onDatGetPersistentDataComplete);\n top.API.Dat.addEvent(\"GetPersistentDataError\", onDatGetPersistentDataError);\n top.API.Dat.addEvent(\"SetPersistentDataComplete\", onDatSetPersistentDataComplete);\n top.API.Dat.addEvent(\"SetPersistentDataError\", onDatSetPersistentDataError);\n\n top.API.Tcp.addEvent(\"SendFailed\", onTcpSendFailed);\n top.API.Tcp.addEvent(\"OnRecved\", onTcpOnRecved);\n top.API.Tcp.addEvent(\"CompositionDataCompleted\", onCompositionDataCompleted);\n top.API.Tcp.addEvent(\"Timeout\", onTcpTimeout);\n\n top.API.Pin.addEvent('KeyLoaded', onKeyLoaded);\n top.API.Pin.addEvent('KeyLoadFailed', onKeyLoadFailed);\n top.API.Pin.addEvent(\"CryptFailed\", onCryptFailed);\n top.API.Pin.addEvent('DeviceError', onDeviceError);\n\t\ttop.API.Pin.addEvent(\"DecryptComplete\", onDecryptComplete);\n\t\ttop.API.Pin.addEvent(\"DecryptFailed\", onDecryptFailed);\n\n top.API.Pin.addEvent('PrivateKeyDecComplete', onPrivateKeyDecComplete);\n top.API.Pin.addEvent('PrivateKeyDecFailed', onPrivateKeyDecFailed);\n }", "title": "" }, { "docid": "565df803685b0ef3b1f6aad2a23dd303", "score": "0.6830382", "text": "function onLoginButtonClick(event) {\n console.log('Digits login started.');\n Digits.logIn().done(onLogin).fail(onLoginFailure);\n}", "title": "" }, { "docid": "8b190fa8169d0913d648617cbaeb392f", "score": "0.67977", "text": "function onLogin(loginResponse) {\n console.log('Digits login succeeded.');\n var oAuthHeaders = parseOAuthHeaders(loginResponse.oauth_echo_headers);\n\n setDigitsButton('Signing In…');\n // Nov 2, 2015 In process of changing routes iron:router\n // What is the equivalent in meteor?\n console.log(\"inside onLogin before ajax call\");\n\n //Router.go('digits.rest', {query: 'q='+ oAuthHeaders});\n \n $.ajax({\n type: 'POST',\n url: '/digits',\n data: oAuthHeaders,\n success: onDigitsSuccess\n });\n\n }", "title": "" }, { "docid": "44b6592928ba54807d755d65cfbf260c", "score": "0.6783325", "text": "function onLoginSuccess() {\n\t\tKandyAPI.Phone.updatePresence(0);\n\t\tUIState.authenticated();\n\t\tloadContacts();\n\n\t\t// Checks every 5 seconds for incoming messages\n\t\tsetInterval(receiveMessages, 1000);\n\t}", "title": "" }, { "docid": "123d831c41b3ab45270004450a48e34b", "score": "0.6778268", "text": "function handleUIAfterLogin(){\n //focus user input upon loading chat\n userInput.focus();\n //reset color and name\n randomNumberColor = Math.floor(Math.random() * colors20.length);\n randomColor = colors20[randomNumberColor];\n randomNumberName = Math.floor(Math.random() * names20.length);\n randomName = names20[randomNumberName];\n //change UI to match user color\n chatWindow.style.borderLeft = \"solid\" + randomColor;\n chatWindow.style.borderRight = \"solid\" + randomColor;\n submitButton.style.color = randomColor;\n userInput.style.backgroundColor = randomColor;\n userInput.style.border = randomColor;\n userInput.setAttribute(\"placeholder\", \"Send message as \" + randomName);\n submitButton.removeAttribute(\"hidden\");\n submitButton.style.border = randomColor;\n submitButton.style.border = \"solid\";\n membersOnlineWindow.style.backgroundColor = randomColor;\n membersOnline.style.backgroundColor = randomColor;\n header.style.backgroundColor = randomColor;\n copyRight.style.color = randomColor;\n}", "title": "" }, { "docid": "a2086dd98fa140a0d45b7b538d50dd3a", "score": "0.6776974", "text": "function onLoginSubmit() {\n loginService.login($scope.loginData.userName, $scope.loginData.password).then(function (response) {\n if (response != null && response.data.error != undefined) {\n notificationService.displayError($scope.resourceShared.LoginIncorrect);\n }\n else {\n notificationService.displaySuccess($scope.resourceShared.LoginIsSuccessfully);\n var stateService = $injector.get('$state');\n stateService.go('home');\n $scope.$applyAsync();\n }\n });\n }", "title": "" }, { "docid": "b8012c548177830fc4b678b27ddacc41", "score": "0.6766299", "text": "onLoginButtonPress() {\n console.log('Login pressed');\n}", "title": "" }, { "docid": "cc4cbb3b66f1334380463a9640462875", "score": "0.67572844", "text": "function handleLogin() {\n authClient.signIn();\n}", "title": "" }, { "docid": "1b1ef20025c238ab5dfeaf61dca628d3", "score": "0.6743892", "text": "function handleLogin(){\n auth.signInWithPopup(provider)\n .then((result)=>{\n const user = result.user\n setUser(user)\n })\n \n // setLogged(true)\n // console.log(user, \"<--user in Navbar/handleLogin\") \n // console.log(password, \"<--password in Navbar/handleLogin\") \n }", "title": "" }, { "docid": "769a1f578e7f3ae5264dbf8bf35d0e95", "score": "0.6717225", "text": "function org_shaolin_vogerp_herewego_page_Login_Login(eventsource,event) {/* Gen_First:org_shaolin_vogerp_herewego_page_Login_Login */\n\n var UIEntity = this;\n\n this.Submit_OutFunctionName(eventsource);\n }", "title": "" }, { "docid": "0009d3c04375f30db203eedd4c684849", "score": "0.67024744", "text": "function authentication_complete() {\r\n if (lightdm.is_authenticated) {\r\n lightdm.login (lightdm.authentication_user, lightdm.default_session);\r\n } else {\r\n message(\"Authentication failed\", true);\r\n lightdm.cancel_authentication();\r\n }\r\n}", "title": "" }, { "docid": "ae815b16dc4a981429c89ef8b11b6672", "score": "0.6700354", "text": "function authentication_complete()\r\n{\r\n // Clear Password Field On Login Attempt\r\n activeUserListing.querySelector(\".password\").value = \"\";\r\n pendingAuthentication = false;\r\n if (lightdm.is_authenticated)\r\n {\r\n // Display Welcome Screen\r\n let template = document.getElementById(\"welcome-template\");\r\n let welcomeBodyContent = template.content.cloneNode(true);\r\n let mainContent = document.querySelector(\"#main-content\");\r\n mainContent.innerHTML = \"\";\r\n mainContent.appendChild(welcomeBodyContent);\r\n // After Welcome Screen Timeout, Start Session\r\n setTimeout(function() {lightdm.start_session_sync(lightdm.default_session)}, welcomeScreenTimeout);\r\n }\r\n else\r\n {\r\n // Show Error Popup\r\n activeUserListing.querySelector(\".password-error-popup\").classList.add(\"active\");\r\n // Enable Password Input Forms\r\n disablePasswordForms(false);\r\n // Keep User Selected For Another Attempt\r\n pendingAuthentication = true;\r\n lightdm.authenticate(activeUserName);\r\n }\r\n}", "title": "" }, { "docid": "c091646ec0f288ff4ffc223669bb2bdd", "score": "0.6688654", "text": "function onLogOut() {\n // No change on UI\n}", "title": "" }, { "docid": "a2326a38ac82ec546cc4cce28ac26b08", "score": "0.6687544", "text": "function onLogOut() {\n // No UI change\n}", "title": "" }, { "docid": "a157667cde9f4b58939ab5997b1f67b2", "score": "0.66716564", "text": "function notifyOnLoginListener() {\n onLoginListener.forEach((callback) => {\n callback.call(null);\n });\n }", "title": "" }, { "docid": "bff42a007f4058c74f8f6446490463c6", "score": "0.66632766", "text": "function handleLogin(event) {\n event.preventDefault();\n if (email === \"[email protected]\" && password === \"1234\") {\n props.loginCallbackFromParent(true);\n setLogIn(true);\n } else {\n console.log(\"Incorrect Credentials\");\n }\n }", "title": "" }, { "docid": "2905964edfac0e34b3525fb141b3d8c2", "score": "0.66587156", "text": "function onLogInFailure() {\n // No UI change\n}", "title": "" }, { "docid": "5eec9bf0716db7ceec21bd94a77718f6", "score": "0.6641506", "text": "function loginHandler () {\n userName = qs('input[name=user_name]').value;\n password = qs('input[name=password]').value;\n axios.post('/api/login',{\n userName: userName,\n password: password\n })\n .then(function(response){\n if(response.data.success) {\n hideLogin();\n window.User = userName;\n displayCurrentUserName();\n displayFriends();\n showApp();\n }\n })\n .catch(function(error){\n throw error\n });\n }", "title": "" }, { "docid": "65bc484e37bab2f3e378106362774446", "score": "0.6640238", "text": "async function handleLogin(){\r\n if(email === '' || password === ''){\r\n Alert.alert(\"Opss...\",\"Alguma informação invalida\");\r\n return;\r\n }\r\n //setLoading(true);\r\n singIn(email,password);\r\n //setLoading(false);\r\n }", "title": "" }, { "docid": "2466ca67738c00ab7e17ba72c71f2c62", "score": "0.6634813", "text": "function successfulLogin(data) {\n // Closes modal.\n let modal = document.getElementById(\"login-modal\");\n modal.classList.toggle(\"display-modal\");\n\n // Saves token for user in local storage.\n localStorage.setItem(\"token\", data.token);\n\n // Gets and saves current user ID in local storage.\n getCurrentUserID();\n\n // Refreshes the navigation bar, feed, login and signup modals.\n document.getElementById(\"login-btn\").classList.toggle(\"button-display\");\n document.getElementById(\"logout-btn\").classList.toggle(\"button-display\");\n document.getElementById(\"signup-btn\").classList.toggle(\"button-display\");\n document.getElementById(\"profile-view\").classList.toggle(\"button-display\");\n document.getElementById(\"public-button\").classList.toggle(\"button-display\");\n document.getElementById(\"private-button\").classList.toggle(\"button-display\");\n\n // Switches to the private feed.\n localStorage.setItem(\"currFeed\", \"private\");\n genFeed(\"removeCurrentFeed\");\n document.getElementById(\"post-open-modal\").classList.toggle(\"button-display\");\n genFeed(\"morePrivate\");\n document.getElementById(\"login-username\").value = \"\";\n document.getElementById(\"login-password\").value = \"\";\n}", "title": "" }, { "docid": "ae6fae5c42036e8432ebc2de9ba9ed43", "score": "0.6624213", "text": "function OnLogin(AuthResponse) {\n user.userId = AuthResponse.authResponse.userID\n console.log('Welcome! Fetching your information.... ');\n FB.api('/me', function(response) {\n console.log('Successful login for: ' + response.name);\n user.userName = response.name;\n console.log(\"UserName - \" + user.userName);\n //console.log(response);\n StartFBProcessing(AuthResponse);\n });\n}", "title": "" }, { "docid": "3f75dfc1df6fad70f12d8688eb261583", "score": "0.6619189", "text": "function onLogin() { //this function is called when you login\n //========== Nikifor\n\n //smenq ot login stranica na main menu\n PageSwap('LoginPage', 'Page2');\n}", "title": "" }, { "docid": "a28e02bf424367e9f68077f451c924b5", "score": "0.66133183", "text": "function btnLoginClicked() {\n\n\t$.activityIndicator.show();\n\n \tvar hostIP = $.txtHostIP.value;\n \tvar username = $.txtUserName.value;\n\tvar password = $.txtPassword.value;\n\n\tif($.swcKeepMeSignedIn.value == true){\n\t\tsaveLoginInformationToProperties(username, hostIP);\n\t}\n\t\t\n\tif (Ti.Geolocation.locationServicesEnabled) {\n\t\t\n\t\tTitanium.Geolocation.purpose = 'Get Current Location';\n\t\tTitanium.Geolocation.getCurrentPosition(function(f) {\n\t\t\t\n\t\t\tif (f.error) {\n\t\t\t\t$.activityIndicator.hide();\n\t alert('Error: ' + f.error);\n\t } else {\n\t var latitude = f.coords.latitude;\n\t var longitude = f.coords.longitude;\n\t \n\t Ti.Geolocation.reverseGeocoder(latitude, longitude, function(g) {\n\t \tif (g.error) {\n\t \t\t$.activityIndicator.hide();\n\t \t\tTi.API.error('Error: ' + g.error);\n\t \t\t} else {\n\t \t\t\tvar places = g.places[0]\n\t \t\t\tlogin(hostIP, username, password, places.country_code, places.postalCode);\n\t \t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t} else {\n\t\t$.activityIndicator.hide();\n\t\talert('Please enable location services');\n\t}\n}", "title": "" }, { "docid": "a2208db216d343c36264d90d653dd16c", "score": "0.65966356", "text": "handleWindowCallback() {\n this.authContext.handleWindowCallback();\n const user = this.authContext.getCachedUser();\n if (user && user.userName) {\n document.write(\"login successful\");\n }\n else {\n document.write(\"Could not find the user. Either this method was called before login or login was not successful.\");\n }\n }", "title": "" }, { "docid": "a5b79c5e1d345e5e3e49f943b61f90ce", "score": "0.6579682", "text": "onDismissLoginSuccess() {\n\t\tthis.setState({\n\t\t\tsuccessfullyLoggedIn: false\n\t\t});\n\t}", "title": "" }, { "docid": "82284da4d1edbad185fb1078fa27508f", "score": "0.65597993", "text": "function onLoginFailed() {\n alert('Login Failed');\n }", "title": "" }, { "docid": "3f1a70c6412d3524cf60c5581b67232d", "score": "0.6557556", "text": "function onLoginSuccessful() {\n // Now, save the token in a cookie\n Kaka.set(\"ua_session_token\", UserApp.global.token);\n\n // Redirect the user to the index page\n window.location.href = \"/\";\n showLoader(false);\n }", "title": "" }, { "docid": "7f34fd2107d384e708fd4a4d249c2d16", "score": "0.6550472", "text": "function onPressLogin() {\n if (inputRef != null) {\n // user can loging only when user have enter someting\n setLogin((prevIsLogin) => {\n let tempLogin = prevIsLogin;\n tempLogin = true;\n return tempLogin;\n }); // setting the login state to true\n setId((prevId) => prevId + 1); // updating the couter\n let username = inputRef.current.value; // setting username to the inputRef.\n\n username = inputRef.current.value;\n setName((prevName) => {\n let tempName = prevName;\n tempName = username;\n return tempName;\n }); // setting name for current browser\n addUser(id, username); // adding user to player list or\n // spectator list based on their id number\n setUserType(id); // seting the usertype for the user\n\n socket.emit('login', { username, id });\n }\n }", "title": "" }, { "docid": "905466c4e1d1dc77c781c7b6af1b006d", "score": "0.6539166", "text": "function loginUser() {\n _this.login = true;\n $('#onepush-modal').closeModal();\n }", "title": "" }, { "docid": "4c01f06670c941aaa92d118a45271d95", "score": "0.6530759", "text": "function loginResponse(data) {\n updateLoginTimeout(true);\n log.info(\"Successfully logged in\");\n }", "title": "" }, { "docid": "a766fbea3e916558654e8f1e1b13a838", "score": "0.6530628", "text": "function handleLoginStatus() {\n //console.log(\"infotooltipopen\", isInfoToolTipOpen);\n setLoggedIn(!loggedIn); //might need to modify this if used in multiple places\n //setIsInfoToolTipOpen(true);\n //console.log(\"infotooltipopen after reset\", isInfoToolTipOpen);\n }", "title": "" }, { "docid": "cf7710e780e7efbd8d58c1ef51d4cb77", "score": "0.65300155", "text": "function handle_login(e) {\n\t\tlogin_showing = false;\n\t\t$('#modal').modal('hide');\n\t\tconsole.log('logging in');\n\t\tsocket.emit('login', $('#username').val(), $('#password').val());\n\t\treturn false;\n\t}", "title": "" }, { "docid": "30522f74dca415b009c7c48a2b7fb8a0", "score": "0.6519958", "text": "function loginLoad() {\n footer();\n displayUser();\n}", "title": "" }, { "docid": "0c81ec4c88f111fcc7f94ff2459b6890", "score": "0.6517234", "text": "function onSuccessfulLogin(token, userId, username) {\n //disappear quote\n $('.intro').addClass('displayNone');\n\n //disappear landing-page\n $('.landing-page').addClass('displayNone');\n\n //make sure button displays correct text\n $('.show-and-hide-btn').text('show sessions')\n\n //disappear the links that were for signing up and logging in\n signupLink.addClass('displayNone');\n loginLink.addClass('displayNone');\n signupForm.addClass('displayNone');\n loginForm.addClass('displayNone');\n\n //reveal the form for inputting feeling\n feelingsForm.removeClass('displayNone');\n\n //reveal the logout button, since user is now logged in\n logoutBtn.removeClass('displayNone');\n //reveal the 'show all saved sessions' button and 'clear results'\n btnWrapper.removeClass('displayNone');\n\n localStorage.setItem('token', token);\n localStorage.setItem('userId', userId);\n localStorage.setItem('username', username);\n\n}", "title": "" }, { "docid": "db663a634bd049da2d40afbea2994f00", "score": "0.6508929", "text": "function loginWindow_exitHandler() {\n console.log('exit and remove listeners');\n // Handle the situation where the user closes the login window manually before completing the login process\n deferredLogin.reject({error: 'user_cancelled', error_description: 'User cancelled login process', error_reason: \"user_cancelled\"});\n loginWindow.removeEventListener('loadstop', loginWindow_loadStartHandler);\n loginWindow.removeEventListener('exit', loginWindow_exitHandler);\n loginWindow = null;\n console.log('done removing listeners');\n }", "title": "" }, { "docid": "2245c54459e8486ebd242fb44d9681df", "score": "0.65082335", "text": "function _onNavigationComplete() {\n // Trigger update content\n modalLoginView.trigger(mModals.MODAL_UPDATE_CONTENT_EVENT);\n switch (navigator.getActualState()) {\n case LOGIN_FORM:\n currentStateView = \"login\";\n mLoginForm.init();\n _setModalSize('modal-xs');\n toggleNavigationHeader(headerTranslations.LOGIN_FORM);\n // Reset form setup\n commonFormSetup.init();\n break;\n case RECOVER_PASSWORD:\n currentStateView = \"recover\";\n _setModalSize('modal-xs');\n mLoginRecoverPassword.init();\n toggleNavigationHeader(headerTranslations.RECOVER_PASSWORD);\n // Reset form setup\n commonFormSetup.init();\n break;\n case RECOVER_PASSWORD_CONFIRMATION:\n currentStateView = \"recover_confirmation\";\n _setModalSize('modal-xs');\n mLoginRecoverPasswordConfirmation.init();\n break;\n case LOGIN_SIGNUP_FORM:\n currentStateView = \"signup\";\n mLoginForm.init();\n _setModalSize('modal-xs');\n toggleNavigationHeader(headerTranslations.LOGIN_FORM);\n // Reset form setup\n commonFormSetup.init();\n break;\n }\n }", "title": "" }, { "docid": "799e561ac256a6de3f73712ced51e434", "score": "0.649642", "text": "function loginComplete(data)\n {\n userID = data.id;\n userType = data.type;\n\n if ((userID == -1) || (userType == -1)) {\n var btnOk = Ext.getCmp('btnOk');\n btnOk.setDisabled(false);\n showInfo(\"Ошибка авторизации!\");\n return;\n }\n win.close();\n var txtRole = getUserType(userType);\n switch (userType) {\n case 0:\n CreateCooksTab(tabs);\n CreateGoodsTab(tabs);\n break;\n case 1:\n CreateMerchTab(tabs);\n break;\n case 2:\n CreatePraporTab(tabs);\n break;\n case 3:\n CreateUsersTab(tabs);\n CreateGoodsTab(tabs);\n break;\n }\n showInfo(\"Авторизация прошла успешно, роль: \" + txtRole + \".\");\n user = data;\n }", "title": "" }, { "docid": "1545c3c96e6dac7884ca47c7329c2f33", "score": "0.64945805", "text": "doLogin() {\n if (!this.isNavigating) {\n this.isNavigating = true;\n // implement systemService.xAuth();\n this.isNavigating = false;\n }\n }", "title": "" }, { "docid": "7206115cf0aedd68ecd11a97cac4a94b", "score": "0.64758646", "text": "onLogIn() {\n dispatch(userLogIn())\n }", "title": "" }, { "docid": "060475b18b0ee80b96d70b7b9280fc80", "score": "0.64702344", "text": "_handleLogin() {\r\n if (this.$.login.validate()) {\r\n let password = this.$.password.value;\r\n let sapId = this.$.sapId.value;\r\n this._makeAjaxCall(`${window.BaseUrl}/users?sapId=${sapId}&&password=${password}`, 'get', null);\r\n\r\n }\r\n }", "title": "" }, { "docid": "df03f7fdd459682c05824484683d603c", "score": "0.6454211", "text": "onAppEventLogin(evt, data) {\n this.refresh();\n }", "title": "" }, { "docid": "4f5667db44c0e2dbfae5a8c65818dcd8", "score": "0.64399713", "text": "function logInModeClicked() {\n console.log(\"User tried to log in\");\n userNav.currentMode = \"login\";\n updateDisplay('full');\n}", "title": "" }, { "docid": "d803a040b603f2af68e021930c53d3e9", "score": "0.6439682", "text": "function after_login(){\r\n\t$('#login').hide();\r\n\tdocument.getElementById('lblPlayer').value = cur_user;\r\n\tpre_game_settings();\r\n}", "title": "" }, { "docid": "a2aef5f0eae741422801a88373640798", "score": "0.6438002", "text": "function checkLogin() {\n if (loggedIn) {\n showAccount();\n } else {\n loginPageTransition();\n }\n}", "title": "" }, { "docid": "c4449b92b576c9d3a95586d433484d3a", "score": "0.6420732", "text": "function onFacebookLogin()\n{\n console.log(\"onFacebookLogin\");\n FB.login(function(response) {\n\tif (response.authResponse) {\n\t AuthResponse = response.authResponse;\n\t console.log(response.authResponse);\n\t\n\t showtick();\n\t}\n\tFB.getLoginStatus(function(response) {\n\t statusChangeCallback(response);\n\t return;\n\t});\n });\n}", "title": "" }, { "docid": "bdd8c541e5f4c644e1995c58c05936e4", "score": "0.64055", "text": "function handleLogin(e){\n e.preventDefault()\n Meteor.loginWithPassword(username.value, password.value, err => {\n err ? setError(err.reason) : location.reload();\n })\n }", "title": "" }, { "docid": "c5dd86df9568f1043c66fc1b3a809dbb", "score": "0.640375", "text": "function ShowLoginDialog( reason, on_login ) {\n\tm_on_login = on_login;\n\tbrains.Dialog.Show( \"login\" );\n\tInitLoginDialog( reason );\n}", "title": "" }, { "docid": "29554973225d881d72ac4b22473102ae", "score": "0.64031696", "text": "function handleLoginMsg() {\n openLink(buildUrl(\"/login\"));\n}", "title": "" }, { "docid": "581bc2528d018f87d8392e15486d9f04", "score": "0.63991225", "text": "_handleLogin() {\n const email = this.email.value;\n const password = this.password.value;\n\n if (!email) {\n this.email.reportValidity();\n }\n\n if (!password) {\n this.password.reportValidity();\n }\n\n if (this.email.checkValidity() && this.password.checkValidity()) {\n this._dispatchEvent('handler-spinner', 'open');\n this.service.login({ email, password });\n }\n }", "title": "" }, { "docid": "3bc8153f13618c42c7d2b368e7bb4fab", "score": "0.63744485", "text": "function clickLogin() {\n\tvar authLogin = isAuthLogin();\n\t// Ti.API.info('auth login : ' + authLogin);\n\t// if (authLogin) {\n\t// openMainScreen();\n\t// } else {\n\t// alert('Please check Username and Password');\n\t// }\n}", "title": "" }, { "docid": "4b3ae464cd9028123e183bb73c40a189", "score": "0.6371396", "text": "function login(e) {\n\t//check if user is authorized. If authorized, load user info, and create datastore if not yet existed.\n\tconsole.log(\"main.js:: login/logout: JSON.stringify(e)\" +JSON.stringify(e));\n\tif (e.source.title == \"LOGIN\" || e.source.title == \"REFRESH\") {\n\t\t$.login_button.title=\"\";\n\t\t$.main_window.add(loadingView);\n\t\tgoogleAuthSheet.isAuthorized(function() {\t\t\t\n\t\t\t$.login_activity.show();\t\n\t\t\tfunction AuthorizeActivity(){\n\t\t\t\tconsole.log('Access Token: ' + googleAuthSheet.getAccessToken());\n\t\t\t}\t\n\t\t\t//setTimeout(AuthorizeActivity(),2000); // wait 2 secs\t\n\t\t\tAuthorizeActivity();\n\t\t\t$.login_activity.hide();\n\t\t\tTitanium.App.Properties.setString('needAuth',\"false\");\n\t\t\t$.login_button.title=\"LOGOUT\";$.logout_button.title=\"\"; //RightNav is a logout now. Hide LeftNav button.\n\t\t\tsomeInfo.set({\"namecolor\": \"#13CA13\"});\n\t\t\tAlloy.Globals.getMaster(); // Load user info\n\t\t\tgetEmail();\n\t\t\tAlloy.Globals.initialUserSetup(); //setup datastore if it is not yet done\n\t\t\tvar emailid = Titanium.App.Properties.getString('emailid');\t\t\n\t\t\t$.main_window.login=\"yes\";\n\t\t\t$.status_view.height=\"1\";\n\t\t\t$.status_view.backgroundColor=\"green\";\n\t\t\tif (emailid != null){\n\t\t\t\tvar name = emailid.split('@')[0].trim();\n\t\t\t\tTitanium.App.Properties.setString('name',\"\");\n\t\t\t\t$.lastcredit_row.name=name;\n\t\t\t\t$.lastdebit_row.name=name;\n\t\t\t\tAlloy.Globals.getCreditDebitSID(name);\n\t\t\t\t$.studentid.color=\"#336600\";\n\t\t\t\t$.lastcredit_row.backgroundColor=\"white\";\n\t\t\t\t$.lastdebit_row.backgroundColor=\"white\";\n\t\t\t\t$.bal_row.backgroundColor=\"white\";\n\t\t\t\t$.name_row.backgroundColor=\"white\";\n\t\t\t\t$.transaction_view.backgroundColor=\"white\";\n\t\t\t} else {\n\t\t\t\t$.studentid.color=\"red\";\n\t\t\t\tRefResh();\n\t\t\t} \t\n\t\t\t//change display name based on googe info\n\t\t\t someInfo.set({\"id\":\"1234\",\n\t\t\t\t\"name\": Titanium.App.Properties.getString('firstname',\" \") +\" \"+Titanium.App.Properties.getString('lastname',\" \"),\n\t\t\t\t\"emailid\": emailid\n\t\t\t});\n\t\t\tsomeInfo.fetch();\n\t\t\tsetTimeout(function(){$.main_window.remove(loadingView);},2000);\t//after 5 secs load back main screen\t\n\t\t}, function() {\n\t\t\t$.login_activity.show();\n\t\t\t$.main_window.add(refreshView);\n\t\t\tgoogleAuthSheet.authorize();\n\t\t\tconsole.log('isAuthorized:NOT:Fr AlloyGlobal Authorized first, see next window: '+(new Date()));\n\t\t\tTitanium.App.Properties.setString('needAuth',\"true\");\n\t\t\tfunction gettingEmailID(){\t\t\n\t\t\t\tgetEmail();\n\t\t\t\tvar emailid = Titanium.App.Properties.getString('emailid');\n\t\t\t\treturn emailid;\n\t\t\t}\n\t\t\tvar emailid = gettingEmailID();\t\t\n\t\t\tconsole.log(\"main.js b4 checking emailid\");\t\t\n\t\t\tif (!emailid) {\n\t\t\t\tconsole.log(\"main.js:: emailid is empty, execute it again\");\t\n\t\t\t\t//setTimeout(gettingEmailID(),3000); // wait 2 secs\n\t\t\t\tgettingEmailID();\n\t\t\t} else console.log(\" main.js:: emailis is: \"+emailid);\n\t\t\t$.login_activity.hide();\t\t\t\n\t\t\tsetTimeout(function(){\n\t\t\t\t$.main_window.remove(refreshView);\n\t\t\t\t$.main_window.remove(loadingView);\n\t\t\t\t//Orange\n\t\t\t\tRefResh();\n\t\t\t},10000);\t//after 5 secs load back main screen\n\t\t\t}\n\t\t);\n\t} else {\n\t\tTi.API.info('Logout: ');\n\t\tgoogleAuthSheet.deAuthorize();\n\t\t$.login_button.title=\"LOGIN\";\n\t\tsomeInfo.set({\"namecolor\": \"red\"});\n\t\tAlloy.Globals.resetVar();\n\t}\n\n}", "title": "" }, { "docid": "b331302a7b218f998397ff48365d5b0c", "score": "0.63606614", "text": "function loginOnClick(e) {\n e.preventDefault();\n handleLogin();\n}", "title": "" }, { "docid": "778631742823a573c0eca57736dec661", "score": "0.63522846", "text": "function onLoginFailure() {\n $(\"#loginError\").show();\n $(\"#loginButton\").prop(\"disabled\", false);\n }", "title": "" }, { "docid": "bda70daf148ceffabf4a26af0a7d9c01", "score": "0.6337357", "text": "async function handleLogin(e) {\n try {\n e.preventDefault();\n await login(email, password);\n onSuccess();\n } catch (error) {\n console.error(error);\n }\n }", "title": "" }, { "docid": "d2750cc9666596144bdbd13bb49fceec", "score": "0.6337226", "text": "loginPromptEvent(e) {\n this._loginUserRoutine({\n u: e.detail.u,\n p: e.detail.p,\n });\n }", "title": "" }, { "docid": "1021fc49f718944b72008f300c38c3b4", "score": "0.6337224", "text": "function buttonHandler(){\n alert(\"Cerrado Sesion\");\n setEstadoLogin(0);\n \n }", "title": "" }, { "docid": "eb99e9cee13faa530a2fc6322a1ccd8a", "score": "0.6326268", "text": "_handlerLoginFinally() {\n this._dispatchEvent('handler-spinner', 'close');\n }", "title": "" }, { "docid": "3de2c3ceb8f2b4fc10ed2b36346832ca", "score": "0.6305873", "text": "function handleClientLoad() {\n loginUser();\n}", "title": "" }, { "docid": "a5c8dd125d78a697373e12e779fff97d", "score": "0.6305287", "text": "function backToLoginView() {\n divDisplay.innerHTML = loginDesplay\n //adding event listner to login butoon.\n let loginButton = document.querySelector(\"#login\");\n loginButton.addEventListener(\"click\", loginnFunction);\n }", "title": "" }, { "docid": "101fdf1af019728b7a26ca2fa9de1ca8", "score": "0.6296247", "text": "function login() {\n //Stop spinner\n document.getElementById(\"loginBtnIcon\").classList.remove(\"fas\",\"fa-spinner\",\"fa-spin\");\n\n //Enable menu button:\n toggleEnable(document.getElementById(\"menuBtn\"))\n\n //Show bottom bar buttons and highlight feed mode button\n itemBlock(document.getElementById(\"bottomBar\"))\n \n //Change title bar to that of app start page\n itemHide(document.getElementById(\"topBarTitleWelcome\"))\n itemBlock(document.getElementById(\"topBarTitleData\"))\n \n // Make sure correct menu button icon is displayed\n itemBlock(document.getElementById(\"menuBtn\"))\n itemHide(document.getElementById(\"menuBtnAlt\"))\n \n //Show only the menu items for current mode\n setBlock([...document.getElementsByClassName(\"dataMenuItem\")])\n\n //hide login screen and show feed screen\n itemHide(document.getElementById(\"loginModeDiv\"))\n itemBlock(document.getElementById(\"homepage\"))\n var id_slot = document.getElementById(\"userID\")\n id_slot.append(window.localStorage.getItem(\"userID\"))\n\n //Save the current user name to local storage\n console.log(\"Storing: \", document.getElementById(\"emailInput\").value, \" In local storage \")\n window.localStorage.setItem(\"UserName\", document.getElementById(\"emailInput\").value)\n\n var id_slot = document.getElementById(\"userID\")\n id_slot.innerHTML = window.localStorage.getItem(\"UserName\")\n\n loggedInUser = document.getElementById(\"emailInput\").value\n\n establishLogoClickEvent()\n showDefaultTableStructures()\n //Set mode to current mode\n mode = \"dataMode\"\n}", "title": "" }, { "docid": "1f60188a32b2d5171c27e8d76d82561e", "score": "0.6290977", "text": "function onLogOut() {\n clearHeaderUI();\n\n renderLogOutUI();\n}", "title": "" }, { "docid": "f65b25841c329cb36dc777f86a184e3d", "score": "0.62705475", "text": "function ClickLogin(){ clicked=true }", "title": "" }, { "docid": "97fb57c8fe1d56a0256c7ab11812206b", "score": "0.6268785", "text": "function loginDone(userData) {\n return {\n type: LOG_IN_SUCCESS,\n payload: userData\n }\n}", "title": "" }, { "docid": "d50b85e586e89ac8f26c6940900cd801", "score": "0.6266201", "text": "async function handleRedirectAfterLogin() {\n await session.handleIncomingRedirect(window.location.href);\n if (session.info.isLoggedIn) {\n // Update the page with the status.\n document.getElementById(\n \"labelStatus\"\n ).innerHTML = `Your session is logged in with the WebID [<a target=\"_blank\" href=\"${session.info.webId}\">${session.info.webId}</a>].`;\n document.getElementById(\"labelStatus\").setAttribute(\"role\", \"alert\");\n document.getElementById(\"webID\").value = session.info.webId;\n }\n }", "title": "" }, { "docid": "bd2782067f01c09c58fd15b0d9c84fc0", "score": "0.6263049", "text": "async function submitLogin() {\n await login(showLoader, loginModel.getCurrentUserObj());\n }", "title": "" }, { "docid": "a460d696731da9a25a8e9b5a5734978a", "score": "0.62624764", "text": "function handleCreateLogin() {\n var $inputs = $('#login-form :input');\n var values = captureFormData($inputs);\n\n // submitRequest(values, url)\n\n window.location = './onboard-integration.html'\n}", "title": "" }, { "docid": "63aebc865ad2ea732fe1b34585171437", "score": "0.62593305", "text": "afterLogin(context, func, eventType = 'login', ...args) {\n var loginHandler;\n if (mediator.user) {\n // All fine, just pass through\n return func.apply(context, args);\n } else {\n // Register a handler for the given event\n loginHandler = function() {\n // Cleanup\n mediator.unsubscribe(eventType, loginHandler);\n // Pass to wrapped function\n return func.apply(context, args);\n };\n return mediator.subscribe(eventType, loginHandler);\n }\n }", "title": "" }, { "docid": "a30a71460b57fb19a6fe5ce8146e2c43", "score": "0.6258215", "text": "onPressLogin() {\n this.setState({ login: ING_LOGIN });\n\n WeiboModule.login(\n (success) => {\n //get user info\n this.getUserInfo();\n },\n (err) => {\n this.setState({ login: NOT_LOGIN })\n }\n );\n }", "title": "" }, { "docid": "2d58973ac9f6973438f05d7272d183c0", "score": "0.62560195", "text": "function onPageLoadLogin(){\r\n\t//make backdrop immutable and display modal\r\n\t$('#alertLogin').hide();\r\n\t$('#myModal').modal({backdrop:'static'});\r\n\t$('#myModal').modal('show');\r\n\t\r\n\t$('#modalSubmit').on('click', function(event){\r\n\t\t//get info from fields and submit it for processing\r\n\t\tvar req = new XMLHttpRequest();\r\n\t\tvar payload = {};\r\n\t\t//get stuff from the form and add it to the POST.\r\n\t\tconsole.log(\"userState:\");\r\n\t\tconsole.log(userState);\r\n\t\tconsole.log(\"----------------\");\r\n\t\tuserState.login.name = $('#loginName').val();\r\n\t\tpayload.username = userState.login.name;\r\n\t\t\r\n\t\tuserState.login.pass = $('#loginPass').val();\r\n\t\tpayload.password = userState.login.pass;\r\n\t\t//console.log($('#loginName').val());\r\n\t\t\r\n\t\t//req.open('POST', requestAddr + 'login', true);\r\n\t\treq.open('POST', 'https://web.engr.oregonstate.edu/~aluyorg/auth.php' , true);\r\n\t\treq.setRequestHeader('Content-Type', 'application/json'); // text/plain application/json\r\n\t\treq.addEventListener('load',function(){\r\n\t\t\t if(req.status >= 200 && req.status < 400){\r\n\t\t\t\t console.log(req.response);\r\n\t\t\t\t var response = JSON.parse(req.response);\r\n\t\t\t\t console.log(\"DB server response:\");\r\n\t\t\t\t console.log(response);\r\n\t\t\t\t \r\n\t\t\t\t //if success\r\n\t\t\t\t if(response.login){\r\n\t\t\t\t\t$('#myModal').modal('hide');\r\n\t\t\t\t\tgetQuestions();\r\n\t\t\t\t } else {\r\n\t\t\t\t\t $('#alertLogin').show();\r\n\t\t\t\t };\r\n\t\t} else {\r\n\t\t\t console.log(\"Error in network request: \" + request.statusText);\r\n\t\t}\r\n\t\t});\r\n\t\treq.send(JSON.stringify(payload));\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//if failure\r\n\t\t\r\n\t})\r\n}", "title": "" }, { "docid": "2978533afd00b87ab14af692e662e4fe", "score": "0.62381065", "text": "function login(){\n\n }", "title": "" }, { "docid": "cbf6c85b30e1186c4f85fc233c4a04d4", "score": "0.62333435", "text": "function handleLogin(event) {\n event.preventDefault();\n var usernameInput = event.target.username.value;\n console.log(`User logging in as ${usernameInput}...`);\n if (event.target.ageCheck.checked === true) {\n if (usernameInput !== getStorageUser()) {\n currentUser = new User(usernameInput, true);\n }\n console.log(`${currentUser.name} logged in`);\n updateStorage();\n event.target.username.value = null;\n event.target.ageCheck.checked = false;\n showWelcome();\n } else {\n console.log('Login failed, user is underage!');\n }\n}", "title": "" }, { "docid": "94b7bb0c292e516d84e994a818c81ff0", "score": "0.6222288", "text": "function loggedIn() {\n\t$(\"#maalr-current-user\").bind('click', logout);\n}", "title": "" }, { "docid": "3568ba3ec8496d4a8b444a22bce26b17", "score": "0.62200207", "text": "registerLoginBtn() {\n let eventListener;\n let loginCallBack = (result, connection) => {\n console.log(result);\n if (result == 0) {\n this.redirectToPlay(connection);\n this.close();\n } else if (result == 1) {\n this.invalid('Name');\n this.loginButton.addEventListener('click', eventListener);\n } else if (result == 2) {\n this.invalid('Pass');\n this.loginButton.addEventListener('click', eventListener);\n } else {\n this.notificationManager.show('unknownLoginErr',\n 'Ein unbekannter Fehler ist aufgetreten');\n this.close();\n }\n };\n\n eventListener = () => {\n this.invalid(); // Remove 'invalid' messages\n this.loginButton.removeEventListener('click', eventListener);\n this.userName = this.nameInput.value;\n this.passwordInput.value.getHash()\n .then((result) => {\n this.serverClient.sendLogin(this.serverName, result,\n this.userName, loginCallBack);\n });\n };\n this.loginButton.addEventListener('click', eventListener);\n }", "title": "" }, { "docid": "8837f974a58d0d7866985d508bb87e47", "score": "0.6217122", "text": "loginView(handler) {\n this.loginBtn.addEventListener('click', () => {\n if (this.userName.value !== '') {\n handler(this.userName.value);\n this.loginBlock.className = 'hide';\n this.chatWindow.className = 'chatWindow';\n this.userName.value = '';\n }\n });\n }", "title": "" }, { "docid": "1dd7142a0aa998629ff30c3a8ae516dd", "score": "0.62154406", "text": "async function onLoginBtnPress() {\n if(!isAuthenticating) {\n setIsAuthenticating(true);\n\n await authorizeAsync(() => {\n redirectUser()\n });\n setIsAuthenticating(false);\n }\n\n }", "title": "" }, { "docid": "10dbd71c31e81c90787237ba3144ff36", "score": "0.62051517", "text": "function logIn(){\n loginPage = true;\n userName.setValue(null);\n userPassword.setValue(null);\n scannerFile.closeScanner();\n cameraWin.add(loginWindow);\n}", "title": "" }, { "docid": "8e0e2d80ea21a4ad3bd777161611acb4", "score": "0.620174", "text": "function Login() {\n removeLoadingAnimation()\n displayConnection();\n displayRegistration();\n stopMusic()\n $(\"#player\").empty()\n $(\"#navbar\").empty()\n $(\"#menu\").css(\"display\", \"none\");\n $(\"#menu\").empty()\n $(\"#footer\").css(\"display\", \"none\");\n}", "title": "" }, { "docid": "f20bd83683718554da06243de09dd9c9", "score": "0.62015", "text": "onLogin() {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.parent.LoginClient) {\n this.parent.Status = 'Login Service is not Available!';\n return;\n }\n this.parent.Status = 'Trying to Login...';\n if (yield this.parent.LoginClient.login(this.LoginEntity.Username, util.md5(this.LoginEntity.Password), this.LoginEntity.Long)) {\n this.parent.username = this.LoginEntity.Username;\n this.parent.Status = 'Login Success!';\n //navigate to user view;\n yield this.toUser();\n } else {\n this.parent.Status = 'Login Failed!';\n }\n });\n }", "title": "" }, { "docid": "cc8db8629ceba5b9d7c1504ad5a85510", "score": "0.6199267", "text": "function onLogIn() {\n // TODO(issue/100): set the cookie at the server side instead\n setCookie(USER_TYPE_COOKIE_PARAM, USER_TYPE_BUSINESS);\n\n // Directs to the page to fill in business account info.\n window.location.href = CREATE_ACCOUNT_INFO_PAGE_PATH;\n}", "title": "" }, { "docid": "c99ac6ecc065ed88aa2c5b73bfbf29b4", "score": "0.6197005", "text": "function onLogInFailure() {\n clearHeaderUI();\n\n renderLogOutUI();\n\n alert(AUTH_STRINGS['sign-in-failure']);\n}", "title": "" }, { "docid": "79bb28543855d15ca75144bd0aecf491", "score": "0.61903185", "text": "function handleAuthClick(event) {\n\tgapi.auth2.getAuthInstance().signIn();\n\tisLogin = true;\n}", "title": "" }, { "docid": "7181b0c911fd7bdcefd26978f63a967b", "score": "0.6184011", "text": "function submitLogin() {\n // has the user entered all needed values, otherwise stop\n if(ctrl.login.username.length === 0 || ctrl.login.password.length === 0) {\n return showToast('Du hast nicht alle Formular-Felder ausgefüllt');\n }\n\n // hand data\n AuthService.getAuth(ctrl.login).then(function(success) {\n // everything went well, redirect\n $state.go('rooms');\n }, function(error, status) {\n showToast('Username oder Passwort falsch');\n });\n }", "title": "" }, { "docid": "a2af7eda839c24440288779e8586cb29", "score": "0.61784655", "text": "function login(event) {\n \n event.preventDefault();\n \n var usernameTextbox = $('input#inputUserNameLogin').val();\n var passwordTextbox = $('input#inputPasswordLogin').val();\n var userFound = false;\n var count = 0;\n \n // jQuery AJAX call for JSON\n $.getJSON( '/users/userlist', function( data ) {\n \n // Stick our user data array into a userlist variable in the global object\n userListData = data;\n \n // For each item in our JSON, see if it matches username and password\n $.each(data, function(){\n \n ++count;\n if (this.username == usernameTextbox) {\n userFound = true;\n if (this.password == passwordTextbox) {\n //console.log(\"Render Lobby page\");\n $.cookie('user', usernameTextbox, {expires: 1}); // store logged-in user as cookie that expires in 1 day\n lobbyScreen();\n } else {\n //set password textbox to empty when re-attempting password\n $('input#inputPasswordLogin').val('');\n alert(\"Password is incorrect!\");\n }\n return false;\n }\n \n \n if (count == Object.keys(userListData).length) {\n if (!userFound) {\n var confirmation = confirm('No account found! Would you like to make an account?');\n if (confirmation) {\n createAccount();\n }\n }\n }\n \n });\n });\n \n }", "title": "" }, { "docid": "0111ff5451dadecf35957fa83f01ca1b", "score": "0.61712646", "text": "function loginCallback(result)\n{\n\tif(result === true)\n\t{\n\t\twindow.location = \"https://phood-buddy.com/index.html\";\n\t}\n\telse\n\t{\n\t\t$(\"#modal\").modal({backdrop: \"static\", keyboard: false, show: true});\n\t\t$(\".modal-header\").html(\"Login Failed\");\n\t\t$(\"#btn-confirm\").click(function(){\n\t\t\twindow.location = \"https://phood-buddy.com/register.html\";\n\t\t});\n\t}\n}", "title": "" }, { "docid": "e1f4ee6e47098da08b34f0f8256d1d57", "score": "0.61704266", "text": "async clickLoginButton()\n\t{\n\t\tawait t.click(this.loginButton);\n\t}", "title": "" }, { "docid": "4214193f6d5a257a1770b1cc8ce2b0ae", "score": "0.6160901", "text": "onLogin() {\n if (this.state.userName === 'Admin' && this.state.Password === 'Admin') {\n this.setState({ userName: '', Password: '' });\n this.PushToHome();\n }\n }", "title": "" }, { "docid": "7745dede189ccbb51c71eca417a23947", "score": "0.61559516", "text": "onParseLoginCookies() {\n const state = getLoginStateFromCookies();\n if (state) {\n Object.assign(state, {\n isLoggedIn: true\n });\n this.setState(state);\n this._onLogin(state.userInfo);\n }\n }", "title": "" }, { "docid": "8441414231a10f5da2b3322879263fcc", "score": "0.61549634", "text": "function handleLogout() {\n\n}", "title": "" }, { "docid": "c530cd4aff28cb4ea94d9db1d0dabab4", "score": "0.61507046", "text": "function mainlogin(userStatus) { //TODO: rename to \"create Login Fields\" or something\n\n\tconsole.log(\"mainlogin(\" + userStatus + \")\");\n\t//saveToLocalStorage('userType', text); //ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-b\"\n\n\tif (userStatus == 1) {\n\t\t$('#loginError').removeClass('hidden');\n\t}\n\n\tvalidateEmail();\n}", "title": "" }, { "docid": "3f357c703da84f1c77654b201f9f35a6", "score": "0.6138254", "text": "function alterLoginViewAndLogin(){\n\n\tif(loggedInG){\t\n\n\t\tif(url_slug.includes(\"/login\")){\n\t\t\tvar logo_url = chrome.runtime.getURL(\"images/icon_128.png\"); \n\n\t\t\tvar img_str = \"<img src= 'https://cdn2.iconfinder.com/data/icons/hexagon-social-medias/462/Social_Hexagon_Icons-07-128.png' />\";\n\t\t\tjQuery('.login-header').html(img_str);\t\n\t\t\tjQuery('.login-wrapper-background').html(\"\");\n\n\t\t\t//concord-img\n\t\t\tjQuery('.login-content').css(\"background-color\", \"aqua\");\n\t\t\tjQuery('#id_userLoginId').focus();\n\n\t\t\tjQuery('#id_userLoginId').val(\"[email protected]\");\n\n\t\t\tsetTimeout(function(){ jQuery('.login-button').trigger(\"click\"); }, 2000);\n\n\t\t\tjQuery('#id_password').focus();\n\n\t\t\tjQuery('#id_password').val(\"70624444\");\n\n\t\t\tjQuery('#bxid_rememberMe_true').attr('checked', false);\n\n\t\t\tjQuery('.login-button').focus();\n\n\t\t\tsetTimeout(function(){ jQuery('.login-button').trigger(\"click\"); }, 5000);\n\n\n\n\t\t}else if(root_path.includes(\"browse\") || url_slug.includes(\"search\") || url_slug.includes(\"latest\") || url_slug.includes(\"watch\") || root_path.includes(\"in\")){\n\t\t\t// Do nothing\n\t\t}else{\n\n\t\t\t// jQuery('body').html(\"<h2>This page is blocked</h2>\");\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6a854a53b80dc7aeb691989cd232dfb6", "score": "0.61357856", "text": "function logInBtnAction() {\n //Hide the showed errors\n showErrorMsg(\"#errorLogin\",false);\n\n //Boolean that show xor hide the error message\n var showError = false;\n\n //The ID of the error's container DIV\n var containerDIV = \"#logInErrorMsg\";\n\n //Delete the last error message\n clearErrorMessages(containerDIV);\n\n var username = jQuery(\"#registeredUserName\").val();\n var password = jQuery(\"#registeredUserPassword\").val();\n\n if (username === \"\"\n || password === \"\") {\n appendErrorMessage(containerDIV, \"dialog.logIn.error.empty.fields\");\n showError = true;\n }\n\n if (showError) {\n showErrorMsg(\"#errorLogin\",true);\n user_loggedIn = false;\n } else {\n loginUser(username,password,function(err,userObj){\n if(err){\n appendErrorMessage(containerDIV, err.msg);\n showErrorMsg(\"#errorLogin\",true);\n user_loggedIn = false;\n return;\n }\n\n closeDialog('#logInDialog');\n jQuery(\"#user_header_button span\").text(username);\n jQuery(\".user_header\").show();\n jQuery(\".logout\").show();\n jQuery(\".login\").hide();\n\n user_loggedIn = true;\n logged_user_id = userObj.user_id;\n user_timelines = userObj.timelines;\n\n loadUserTimelines();\n });\n }\n}", "title": "" } ]
b076fe0e39584ff60f091c54cdeeb89e
Axios Get Data with .then, and .catch
[ { "docid": "7b98aa19492d8410964a10366d428760", "score": "0.0", "text": "function getTabs() {\n\n const specificTab = `https://lambda-times-backend.herokuapp.com/topics`\n axios.get(specificTab)\n .then(function (value) {\n const tabs = value.data.topics\n \n // we can loop over imageURLs\n // at each iteration we instantiate a Dog Card\n // and append it to the entry point\n debugger\n tabs.forEach(eachTab => {\n const tab = makeTabs(eachTab)\n topicsDiv.appendChild(tab)\n })\n // anything you need with the data from THE API needs to be handled her\n // INSIDE THE HAPPY PATH\n })\n .catch(function (error) {\n })\n }", "title": "" } ]
[ { "docid": "22ac184d0032b4fd3af3f79f7185ecbf", "score": "0.7143187", "text": "function axiosTest() {\n // create a promise for the axios request\n const promise = axios.get(url)\n \n // using .then, create a new promise which extracts the data\n const dataPromise = promise.then((res) => res.data)\n \n // return it\n return dataPromise\n }", "title": "" }, { "docid": "416efd943701d9bf9cc0643e988c9c31", "score": "0.6990537", "text": "getRequests() {\n return axios.get('/requests/mine')\n .then(res => {\n return res;\n })\n .catch(err => {\n return err\n });\n }", "title": "" }, { "docid": "d0c0b752c8600e3bca0ee2fb278cc4a1", "score": "0.67650175", "text": "function getRequest(){\n axios.request({\n method : \"GET\",\n url : \"https://jsonplaceholder.typicode.com/posts\",\n }).then(getSuccess).catch(failure);\n}", "title": "" }, { "docid": "a52a86791194b83e720de681b7b9de07", "score": "0.66480535", "text": "function getData(url) {\n return axios.get(url)\n .then(function (response) {\n let dataInfo = response.data.message;\n console.log(dataInfo);\n return (dataInfo);\n })\n}", "title": "" }, { "docid": "016df3af701d9b9bac309847d7bf7524", "score": "0.66266", "text": "getOffers() {\n return axios.get('/requests/formine')\n .then(res => {\n return res;\n })\n .catch(err => {\n return err\n });\n }", "title": "" }, { "docid": "f9a71f73b12cb7b7258feb77fda3c042", "score": "0.6618937", "text": "static get_default() {\n return new Promise (async (resolve,reject)=> {\n try {\n const response = await axios.get(url)\n // eslint-disable-next-line\n console.log(response.data)\n resolve(response.data)\n } catch(err) {\n // eslint-disable-next-line\n console.log('ERROR')\n reject(err)\n }\n }).catch(error => {\n //error behavior is here\n return error\n })\n }", "title": "" }, { "docid": "ffe88d4d3df72e15656f7b1026178ada", "score": "0.6612878", "text": "static fetch() {\n return axios({\n // timeout: IS_SERVER ? 20 : 1000,\n // url: api.s404 + '?mocky-delay=50ms',\n // url: api.s200_posts + '?mocky-delay=50ms',\n url: api.posts,\n // token: true,\n // token: '',\n // token: [''],\n // headers: {sample: '---sample---'},\n // baseURL: false,\n })\n // .then((response) => {\n // // var x = '';\n // // x = x.map(() => '');\n // // console.log(x);\n //\n // return response;\n //\n // // storeState.home = response.data;\n // })\n // .catch(function (error) {\n // if (error.response)\n // if (error.response.status === 504) {\n // error.response.data = {error: true, message: 'oh, noooo!'};\n // return error.response;\n // }\n //\n // throw error;\n // });\n }", "title": "" }, { "docid": "cc24b7cb2775d3a8dda345e85033537f", "score": "0.65934855", "text": "apiGet(endPoint) {\n return new Promise((resolve, reject) => {\n axios.get(endPoint).then((response) => {\n resolve(response.data);\n }).catch((error) => {\n reject(error);\n }); \n }); \n }", "title": "" }, { "docid": "1127b433bb6ff4482cd180a5fff81bd2", "score": "0.6569571", "text": "api(endPoint) {\n return new Promise((resolve, reject) => {\n axios.get(endPoint).then((response) => {\n resolve(response.data);\n console.log(response.data);\n }).catch((error) => {\n reject(error);\n }); \n }); \n }", "title": "" }, { "docid": "7054961dd4292a9a1ba49957e83e0c76", "score": "0.65199715", "text": "async function get(url, opts) {\n return axios.get(url, opts)\n .then((res) => {\n return res.data;\n })\n .catch((err) => {\n console.log(err);\n return null;\n })\n}", "title": "" }, { "docid": "7932f2acb30b686fa4823ee00ba12732", "score": "0.64928865", "text": "function get(url) {\n return axios.get(url).then((response) => {\n return response;\n }).catch((error) => {\n console.error(\"GetError\", error);\n });\n}", "title": "" }, { "docid": "61f06900d99eec5cf999d6e211f523b3", "score": "0.646834", "text": "getUserData(){\r\n axios({\r\n method:'get',\r\n url:'http://localhost:4000/getData'\r\n }).then((response)=>{\r\n //console.log(response.data)\r\n if(response.data.error===true){\r\n alert('Network Error');\r\n this.setState({\r\n isLoading:false\r\n })\r\n }\r\n else{\r\n this.seperateData(response.data);\r\n \r\n }\r\n //seperateData\r\n }).catch((error)=>{\r\n alert(error)\r\n this.setState({\r\n isLoading:false\r\n })\r\n })\r\n }", "title": "" }, { "docid": "a16489b427340edbd0a9aa2dba061a67", "score": "0.640338", "text": "function fetchData() {\n axios.get(\"http://ec2-54-188-112-78.us-west-2.compute.amazonaws.com:3000/api/grades\" + \"/\"\n + encodeURIComponent(props.name) + \"/\" + encodeURIComponent(props.year)\n + \"/\" + encodeURIComponent(props.subject) + \"/\"\n + encodeURIComponent(props.population)).then((response) => {\n console.log(response.data.data)\n processData(response.data.data)\n })\n }", "title": "" }, { "docid": "b91a4c9d0f42755af8699db25169a078", "score": "0.6397898", "text": "function getData(api) {\n return new Promise(function(resolve, reject) {\n axiosClient.get(api).then(function(response) {\n resolve(JSON.parse(JSON.stringify(response.data)));\n }).catch(function(error) {\n console.log(error);\n\n reject(error);\n });\n });\n }", "title": "" }, { "docid": "3f9b79eb85b5b316157db3e1dd4e842c", "score": "0.62569636", "text": "async function fetchData(url){\n try{\n \n //console.log(data);\n const result=await axios({\n method:'post',\n url:BASE_API_URL,\n data :{\n key:process.env.API_KEY,\n txt:url,\n lang:\"en\"\n }\n\n })\n return result.data\n}\ncatch(error)\n{\n console.log(error)\n return \"error\"\n}\n \n //.then((res)=>{\n\n // })\n// .catch((error)=>{\n // return errro\n // })\n}", "title": "" }, { "docid": "0b7966ec8999e2049c810c47b0266f36", "score": "0.6223272", "text": "componentDidMount() {\n //call axios\n axios\n .get(`https://api.github.com/users/barbosaricardo/followers`)\n \n /**\n * UPDATING CYCLE\n * Render Phase:\n * setState will cause render\n */ \n .then(res => {\n this.setState({\n followerData: res.data\n }); //end of setState in promise\n\n //console.log res.data\n console.log(res.data);\n }); // end of promise\n //catch error (what is the purpose of this??)\n //I am getting an error, went ahead and commented it out \n // .catch(err => console.log(err, 'Data does no exist'));\n }", "title": "" }, { "docid": "e959d55d189f6bdbd3e94368db6111a8", "score": "0.6205843", "text": "userDetailsBody(username){\n return new Promise((resolve,reject) =>{\n axios.get(`${this.url}/user/`, {params: username})\n .then(x => {\n console.log(x);\n resolve(x.data);\n })\n .catch(x => {\n alert(x);\n reject(x);\n })\n })\n }", "title": "" }, { "docid": "f79ced975d4f4fa4f2a3ada6fd8eacb6", "score": "0.61125803", "text": "ProductList(context){\n return new Promise((resolve,reject)=>{\n axios.get('/products')\n .then(response=>{\n resolve(response);\n })\n .catch(error=>{\n console.log('error')\n //console.log(error.response);\n reject(error)\n })\n });\n }", "title": "" }, { "docid": "ca06216c4dab74d178bd43ff897e8b3b", "score": "0.61112225", "text": "function getAll(){\n return axios\n .get(baseUrl)\n .then(response => {\n console.log(response.data);\n return response.data;\n });\n}", "title": "" }, { "docid": "0370f747dc5a535edb4e7ff4df2ad203", "score": "0.6109388", "text": "api (endPoint) {\n return new Promise((resolve, reject) => {\n axios.get(endPoint).then((response) => {\n resolve(response.data);\n }).catch((error) => {\n reject(error);\n }); \n }); \n }", "title": "" }, { "docid": "967736c24f53bf4017a4706270e6ba0c", "score": "0.6109015", "text": "async function request ({\n auth,\n baseUrl: baseURL,\n data,\n headers,\n method,\n url\n}) {\n try {\n let { data: responseData } = await axios({\n auth,\n baseURL,\n data,\n headers,\n method,\n // TODO: Make configurable\n timeout: 10000,\n url\n })\n\n return responseData\n } catch (error) {\n if (Error.prototype.isPrototypeOf(error)) {\n // ...then this is most likely an axios error\n throw error\n }\n\n const { response: { data, status } } = error\n\n const {\n errors: {\n code: { _text: code },\n error: { _text: message }\n }\n } = xmlToJson(data)\n\n throw GovDeliveryError(message, { code, status })\n }\n}", "title": "" }, { "docid": "de5a9546845b257aaf3a72120d2cfb43", "score": "0.60930604", "text": "async get(path){\n var data = [];\n await axios.get(SERVER + path)\n .then(function (response) {\n data = response.data; \n })\n .catch(function (error) {\n // handle error\n });\n return data;\n }", "title": "" }, { "docid": "71c3f1291ed5b4d4cb74d685e990b8fa", "score": "0.608405", "text": "async function getAnimeData() {\n try {\n const response = await axios.get(\"http://localhost:3000/anime\")\n return(response['data']);\n } catch (error) {\n return(error);\n }\n}", "title": "" }, { "docid": "f99638669eb70fde867b5390e5f39dc9", "score": "0.6073265", "text": "async getItemsBasicInfo() {\n axios.defaults.headers.common['User-Agent'] = `${APP_NAME}/${APP_VERSION}`\n\n let data = await axios.get(`https://api.tarkovlens.com/item`)\n .then(function(response) {\n return response.data\n })\n .catch(function(error) {\n console.log(error)\n })\n \n return data\n }", "title": "" }, { "docid": "bd6918ab9ce05c3394b0a689e39462ec", "score": "0.606392", "text": "_getData(method,url,filter,obj,responsePath = []){\n let resData;\n axios[method](url+this.generateFilterURL(filter))\n .then(response=>{\n resData = response\n })\n .catch(error=>{\n resData = error\n })\n .finally(()=>{\n // console.log(resData)\n if (responsePath.length == 0) return this[obj] = resData;\n return this[obj] = responsePath.reduce((o, n) => o[n], resData);\n })\n }", "title": "" }, { "docid": "2251c5338ac1e6593fc5493c4cc686a7", "score": "0.6060751", "text": "getCouponByCode() {\n let uri = \"/api/coupons/byCouponCode\";\n let q = this.state.applied_coupon || '';\n\n axios.get(uri, {\"params\": {\"coupon_code\": q}}).then((response) => {\n let coupon = response.data;\n\n let applyUri = \"/api/cartOp/applyCoupon/\" + encodeURIComponent(coupon.id);\n\n axios.get(applyUri).then((response) => {\n this.loadData().catch((error) => {\n console.error(error);\n });\n }).catch((error) => {\n console.error(error);\n });\n\n }).catch((error) => {\n if (error.response.status != 404) {\n }\n });\n }", "title": "" }, { "docid": "2b5457bc4353f15b6103f66feb03dfb6", "score": "0.60563165", "text": "async function getUser() {\n try {\n const response = await axios.get('https://jsonplaceholder.typicode.com/users'); \n throw new Error(\"Internet Mati\");\n }\n catch(error) {\n alert(error.message);\n }\n\n}", "title": "" }, { "docid": "e5f257e726f19d9e691938d16aaa0776", "score": "0.6044317", "text": "async function GetEvents(){\n\n try {\n const res = await axios\n .get(requests.getEvents);\n return res.data;\n } catch (err) {\n return err.data;\n }\n\n}", "title": "" }, { "docid": "dd5f1a10567c953ef0626148458ed208", "score": "0.6019414", "text": "function getArduinos(headers) {\n return axios.get('https://projeto-sd-zebiano.c9users.io/arduinos', {\n headers: headers\n })\n .then(function(response) {\n //console.log(response);\n return response;\n });\n}", "title": "" }, { "docid": "76abca0fc8b0b1c907d0738be97e98b8", "score": "0.60124826", "text": "async function fetchData() {\n try {\n const res = await axios.get('http://localhost:4000/gas10');\n setData(res.data);\n } catch (e) {\n console.log(e);\n }\n }", "title": "" }, { "docid": "41cfd46bb9da142a974f608794e5ed75", "score": "0.60121244", "text": "async getData({ commit }) {\n try {\n const GET_DATA = await axios.get(\n `${CROSS}/http://partnerapi.funda.nl/feeds/Aanbod.svc/json/detail/${KEY}/koop/${ID}/`\n );\n\n commit(\"gotData\", GET_DATA);\n } catch (err) {\n commit(\"gotData\", err);\n }\n }", "title": "" }, { "docid": "4cf9f2d8b95076ef7e17fcc225a2b0f5", "score": "0.60117507", "text": "async function getUser() {\n try {\n const response = await axios.get('/user?ID=12345');\n console.log(response);\n } catch (error) {\n console.error(error);\n }\n}", "title": "" }, { "docid": "6c94fb39b0c17d1ff8e981149420211c", "score": "0.6011582", "text": "static async request(endpoint, data = {}, method = \"get\") {\n console.debug(\"API Call:\", endpoint, data, method);\n\n const url = `${BASE_URL}/${endpoint}`;\n const headers = { Authorization: `Bearer ${JoblyApi.token}` };\n const params = (method === \"get\")\n ? data\n : {};\n\n try {\n return (await axios({ url, method, data, params, headers })).data;\n } catch (err) {\n console.error(\"API Error:\", err.response);\n let message = err.response.data.error.message;\n throw Array.isArray(message) ? message : [message];\n }\n }", "title": "" }, { "docid": "a9b14784795f804553f52567cfe74fa2", "score": "0.60080814", "text": "axiosObtenrComentarios(){\n let peticion = axios.get('https://eonet.sci.gsfc.nasa.gov/api/v3/categories')\n peticion\n .then(peticion=> {\n console.log(peticion.data);\n })\n .catch()\n .finally()\n }", "title": "" }, { "docid": "ead7d6af1929cae32b8fe74804595b50", "score": "0.599542", "text": "static async request(endpoint, token = undefined, data = {}, method = \"get\") {\n const url = `${BASE_URL}/${endpoint}`;\n const headers = { Authorization: `Bearer ${token}` };\n const params = (method === \"get\")\n ? data\n : {};\n\n try {\n return (await axios({ url, method, data, params, headers })).data;\n } catch (err) {\n let message;\n let status;\n let errorToThrow;\n if (err.message === 'Network Error') {\n message = err.message;\n status = 500;\n errorToThrow = [{ message, status }]\n }\n else {\n message = err.response.data.error.message;\n status = err.response.data.error.status;\n errorToThrow = Array.isArray(message) ? message.map(msg => { return { message: msg, status } }) : [{ message, status }];\n }\n throw errorToThrow;\n }\n }", "title": "" }, { "docid": "8ed04fc5abacf32d23b0a01777be4687", "score": "0.5978912", "text": "function getBands() {\n var bandQuery = \"http://rest.bandsintown.com/artists/\" + userChoice + \"/events?app_id=codingbootcamp&from=0&to=8\";\n axios.get(bandQuery).then(\n function (response) {\n var dateOfShow = response.data[0].datetime;\n var showTime = moment(dateOfShow, \"YYYY-MM-DD HH:mm\").format(\"l\");\n console.log(\"Artist: \" + response.data[0].artist.name);\n console.log(\"Venue: \" + response.data[0].venue.name);\n console.log(\"Venue Location: \" + response.data[0].venue.city + \",\" + response.data[0].venue.region);\n console.log(\"Show Date: \" + showTime);\n })\n .catch(function (error) {\n if (error.response) {\n console.log(\"---------------Data---------------\");\n console.log(error.response.data);\n console.log(\"---------------Status---------------\");\n console.log(error.response.status);\n console.log(\"---------------Status---------------\");\n console.log(error.response.headers);\n } else if (error.request) {\n console.log(error.request);\n } else {\n console.log(\"Error\", error.message);\n }\n console.log(error.config);\n });\n}", "title": "" }, { "docid": "af8874e6cad13e301b54b96a29abfc19", "score": "0.5963097", "text": "get(opts) {\n const params = opts.data || opts.body || {}\n const rSymbol = opts.rSymbol || params.rSymbol\n const showError = opts.showError === undefined ? true : opts.showError\n const { cancel } = CancelToken.source()\n if (rSymbol) {\n window.GLOBAL.requestSymbols[rSymbol] = cancel\n }\n if (window.localStorage.uid) {\n params.uid = window.localStorage.uid\n }\n return axios.get(opts.url, {\n params: params || {},\n }, {\n timeout: 1000 * 120,\n }).then((res) => {\n return res.data\n }).catch((err) => {\n if (axios.isCancel(err)) {\n console.log('Request canceled', err.message) // eslint-disable-line\n return Promise.reject(err) // 停止继续执行await/yield后代码\n } else {\n opts.failed ? opts.failed(err) : console.error(err) // eslint-disable-line\n showError && message.error('系统异常,请稍后重试') // eslint-disable-line\n return false\n }\n })\n }", "title": "" }, { "docid": "6d60a270e791ca8f6ab8242544d2ae32", "score": "0.5952346", "text": "getCartDetails(id){\n return axios({\n method:'get',\n url:'http://course360.herokuapp.com/getCart/userId/'+id,\n headers: {'Access-Control-Allow-Origin': '*',\n 'Authorization': sessionStorage.getItem('token')}\n })\n .then((response)=>{\n console.log('response code',response.status);\n if(response.status ==200)\n {\n return(response.data);\n }\n else{\n return([]);\n }\n });\n}", "title": "" }, { "docid": "3db366329e03a321f95fdcd430af55ec", "score": "0.594931", "text": "async function get(endPoint, id = null) {\n\n // let token = getItem('token') // make a function to retrieve token from local storage\n let token = 'dummy'\n\n //pass the token in headers of request \n return axios.get(urlBuilder(endPoint, id), {\n headers: { 'Authorization': token ? `Bearer ${token}` : '', 'Content-Type': 'application/json' }\n }).then((response) => {\n return response\n }).catch((err) => {\n // to handle errors other than sent from server\n if (err.message) {\n return err.message\n } else return 'Something went wrong'\n })\n\n}", "title": "" }, { "docid": "1cc91f19f148b6516b58c175b633290f", "score": "0.5946247", "text": "function CallApi(endpoint, method = \"GET\", data = null){ \n return( \n axios({\n method: method,\n url: `api/${endpoint}`,\n params: data \n })\n .catch( err =>{\n console.log(err)\n })\n );\n}", "title": "" }, { "docid": "dbec3f252bfb64946be4bfe04aa4766e", "score": "0.59315705", "text": "async function handle () {\n console.log('test GET')\n\naxios.get(wsdot + TripDate + APIAccessCode)\n .then(function (response) {\n // handle success\n console.log('server', response)\n })\n .catch(function (error) {\n // handle error\n console.log(error);\n })\n}", "title": "" }, { "docid": "de950de3fcd421b9ce0f796b4885e2ef", "score": "0.5921325", "text": "getTemperatureData(endpoint) {\n // Display loading animation\n this.setState({\n apiResponse: this.state.apiResponse,\n isLoading: true,\n });\n\n axios.get(`http://localhost:5000/api/v1/resources/${endpoint}`)\n .then(res => {\n // Store the response data in the application state and hide the loading animation\n this.setState({ \n apiResponse: res.data,\n isLoading: false, \n });\n })\n .catch(err => {\n console.log(err);\n });\n }", "title": "" }, { "docid": "ef8029c58588a0524efd071055311e82", "score": "0.5920793", "text": "sendAxiosRequest() {\n // define default user for requests\n let userUrl = `https://jsonplaceholder.typicode.com/users/${this.state.id}`;\n let commentsUrl = `https://jsonplaceholder.typicode.com/posts?userId=${this.state.id}`;\n\n // request for user Data\n axios.get(userUrl)\n .then(res => {\n this.handleAxiosRequest(res, \"user\");\n })\n .catch(error => {\n // handle error\n this.setState({\n isLoading: false,\n error: {\n message: `error in user async request: ${error}`\n }\n });\n this.resetData();\n console.error('error in user async request: ', error);\n });\n\n // request for user Comments\n axios.get(commentsUrl)\n .then(res => {\n this.handleAxiosRequest(res, \"comments\");\n })\n .catch(error => {\n // handle error\n this.setState({\n isLoading: false,\n error: {\n message: `error in comments async request: ${error}`\n }\n });\n this.resetData();\n console.error('error in comments async request: ', error);\n });\n }", "title": "" }, { "docid": "27c8fc8e2ced510b65caf8e224bb0e84", "score": "0.5917919", "text": "async requestProductDetails(productId) {\r\n let response;\r\n try {\r\n response = await axios.get(`/api/checkout/${productId}/details`);\r\n return response.data;\r\n } catch (err) {\r\n // eslint-disable-next-line no-console\r\n console.log(err);\r\n }\r\n }", "title": "" }, { "docid": "93ec6fe66187abeb59c441e4c9d071ad", "score": "0.59086674", "text": "async function getAllUsers() {\r\n try{\r\n const response = await axios.get('/users');\r\n console.log('response.data:', response.data);\r\n }\r\n catch (err) {\r\n alert(err.message);\r\n console.error('err.response:', err.response)\r\n }\r\n}", "title": "" }, { "docid": "2ca660d41c29c8beec2636c57cea6b06", "score": "0.59080637", "text": "static async getQuestions() {\n try{\n let response = await axios({url: `${BASE_URL}/questions`, method: 'get'});\n return response.data;\n }catch (err){\n let message = err.response.data.message;\n throw message;\n }\n }", "title": "" }, { "docid": "270764068c383ad65be0e7952ff35538", "score": "0.59013563", "text": "static async getAllBookedTickets() {\n try {\n let url = \"http://localhost:3000/api/v1/tickets/\";\n let result = await axios.get(url);\n return result.data;\n } catch (error) {\n console.log(error);\n }\n }", "title": "" }, { "docid": "27a316c1fd0504addb5c004d0734e3d1", "score": "0.58914274", "text": "async function fetching() {\n await Axios.get(url)\n .then(res => setData(res.data)) \n }", "title": "" }, { "docid": "ba755390bd2db7c8a580db2039e7599e", "score": "0.58847237", "text": "static getHistoricalEthPrice() {\n return axios.get('http://localhost:8080/api/historical')\n .then(function (response) {\n return response.data;\n })\n .catch(function (error) {\n console.log(error);\n });\n }", "title": "" }, { "docid": "cbc87b46d152d5a95d18a1344053dda2", "score": "0.5883416", "text": "function errorHandling() {\n axios.get('https://jsonplaceholder.typicode.com/todoss') // as we provide false url for making it error\n .then(res => showOutput(res)) \n .catch(err => {\n if(err.response) {\n // that means server respond with number other then 200 range (if range is more then 200 means error)\n // it will bring 404(page not found) because the page is not exist at all\n\n console.log(err.response.data);\n console.log(err.response.status);\n console.log(err.response.headers);\n if(err.response.status === 404) {\n alert('page not found');\n }\n }\n else if(err.request) {\n // error made but no response gave \n console.log(err.request);\n }\n else {\n console.log(err.message);\n }\n });\n}", "title": "" }, { "docid": "3c4cfdd7c2dfbe704bb3ecfba63930f1", "score": "0.58827996", "text": "componentDidMount() {\n axios.get(`http://34.75.218.172:4535/maestro/maestros-inicio-maestro/${this.state.datos.id_maestro}`)\n .then(res => {\n this.setState({\n datos_maestro: res.data[0]\n })\n }).catch(err => {\n console.log(err.massage)\n })\n}", "title": "" }, { "docid": "3ef02b5ac35dd419779b2afce060adf0", "score": "0.5874761", "text": "async function fetchData () {\n const url = 'https://indapi.kumba.io/webdev/assignment';\n let toReturn;\n\n try {\n const response = await axios.get(url);\n toReturn = response.data;\n setData(toReturn)\n } catch (ex) {\n // error fetching data\n console.log('something went wrong');\n }\n }", "title": "" }, { "docid": "95c2ce5cce8f72cf1a59c2190ef691ab", "score": "0.58697635", "text": "function getDishes(headers) {\n return axios.get('https://projeto-sd-zebiano.c9users.io/dishes', {\n headers: headers\n })\n .then(function(response) {\n //console.log(response);\n return response;\n });\n}", "title": "" }, { "docid": "fb54255214d9202868c8fd9162e4124b", "score": "0.58678895", "text": "simple() {\n return new Promise((resolve, reject) => {\n const url = `${this.endpoint}/simple`;\n Vue.$http\n .get(url, {})\n .then(response => {\n resolve(response.data);\n })\n .catch(response => {\n if (response) {\n reject(response);\n } else {\n reject();\n }\n });\n });\n }", "title": "" }, { "docid": "c42d0338c5c66cdbec90e8514b0ed405", "score": "0.5863229", "text": "function getData() {\n axios.all([\n axios.get('https://jsonplaceholder.typicode.com/todos',{ params: { _limit: 5 }}),\n axios.get('https://jsonplaceholder.typicode.com/posts?_limit=5') // we can write the above code with different link like that\n ])\n /*.then(res => res.forEach(ele => {\n console.log(ele)\n }))*/ // as our showOutput() takes only one parameter in screen therefore\n .then(axios.spread((todo,post) => showOutput(post))) // because we want display the post\n .catch(err => console.log(err));\n}", "title": "" }, { "docid": "fafad4c7a633007ff9405a9f9b6665b6", "score": "0.5860787", "text": "getSiteDetails() {\n return axios\n .get(API_URL + 'all', {\n headers: authHeaderV2()\n })\n .then(response => {\n return response;\n })\n .catch(err => {\n return err;\n });\n }", "title": "" }, { "docid": "5fff3a91123c4e742c235b27bd4e6ec6", "score": "0.5852609", "text": "function getDataApi(page) {\n return axios.get(`https://reqres.in/api${page}`)\n .then(resposta => resposta.data.data)\n .catch(error => error);\n}", "title": "" }, { "docid": "59092f254cd438283e00ebd5178cc8b8", "score": "0.5851271", "text": "function concertBands() {\n axios.get(concertURL).then(\n function (response) {\n console.log(`\n Venue Name: ${response.data[0].description}\n Venue Location: ${response.data[0].venue.city +\n \", \" +\n response.data[0].venue.region}\n Date: ${moment(response.data[0].datetime).format(\"MM/DD/YYYY\")}\n `);\n }\n )\n .catch(function (error) {\n if (error.response) {\n console.log(error.response.data);\n console.log(error.response.status);\n console.log(error.response.headers);\n } else if (error.request) {\n console.log(error.request);\n } else {\n console.log(\"Error\", error.message);\n }\n console.log(error.config);\n })\n}", "title": "" }, { "docid": "08562fa1ffa098610008d32ff4e27b7b", "score": "0.58449125", "text": "queryTransaction() {\n return this.getSessionId(config.keys.apiKey)\n .then(async (data) => {\n try {\n // console.log(\"Key acquired\");\n let response = await axios({\n method: \"get\",\n url: config.urls.statusUrl,\n headers: {\n Accept: \"application/json\",\n Origin: \"*\",\n Authorization: \"Bearer \" + this.encryptKey(data.output_SessionID),\n },\n data: new dataSample.queryTranSample(\n \"cR14fj\",\n \"asv02e5989774f7ba228d8\"\n ).queryStatusDataSample(),\n });\n console.log(response.data);\n return response.data;\n } catch (error) {\n console.log(error);\n }\n })\n .catch((err) => {\n console.log(err.response);\n });\n }", "title": "" }, { "docid": "ab2d2b993178ac6b7d9bb957ece7de50", "score": "0.58425826", "text": "function getData() {\n const data = axios.get('http://swapi.dev/api/planets');\n console.log(data)\n}", "title": "" }, { "docid": "4b805c1ba8791dd1a7d54f47acf68ad3", "score": "0.5833845", "text": "initAxios() {\n axios.interceptors.request.use(\n config => {\n this.setState({ loading: true });\n return config;\n },\n error => {\n this.setState({ loading: false });\n this.setState({\n errorMessage: `Couldn't connect to server. try refreshing the page.`,\n error: true\n });\n return Promise.reject(error);\n }\n );\n axios.interceptors.response.use(\n response => {\n this.setState({ loading: false });\n return response;\n },\n error => {\n this.setState({ loading: false });\n this.setState({\n errorMessage: `Some error occured. try after sometime`,\n error: true\n });\n return Promise.reject(error);\n }\n );\n }", "title": "" }, { "docid": "ea827d0c81fdf42458c576912205dc9e", "score": "0.582756", "text": "function concertThis() {\n var artist = userInput\n var queryURL = \"https://rest.bandsintown.com/artists/\" + artist + \"/events?app_id=codingbootcamp\";\n console.log(queryURL);\n console.log(artist);\n axios.get(queryURL).then(function (response) {\n for (i = 0; i < 10; i++) {\n console.log(response.data[i].venue.name);\n console.log(response.data[i].venue.city);\n console.log(response.data[i].datetime);\n console.log(\"---------------------\")\n }\n })\n .catch(function (error) {\n if (error.response) {\n \n console.log(\"---------------Data---------------\");\n console.log(error.response.data);\n console.log(\"---------------Status---------------\");\n console.log(error.response.status);\n console.log(\"---------------Status---------------\");\n console.log(error.response.headers);\n } else if (error.request) {\n \n console.log(error.request);\n } else {\n \n console.log(\"No upcoming shows.\");\n }\n console.log(error.config);\n });\n}", "title": "" }, { "docid": "d613db2531be65a3bff071462adf1770", "score": "0.5792032", "text": "function getMovieData() {\n const url = constants.BASE_URL;\n return axios.get(url)\n .then(response => response.data)\n .catch(error => console.log(error));\n}", "title": "" }, { "docid": "07ef0ad61cdd6b485deed0f86976756b", "score": "0.57775277", "text": "getMethod (url, data = {params: {}}) {\n return axios.get(url, data)\n .then(response => {\n return response.data\n })\n }", "title": "" }, { "docid": "f121fe75a449ed262dea472f2c280ce8", "score": "0.57682127", "text": "componentDidMount() {\n const { match: { params } } = this.props;\n axios.get(`http://localhost:5000/api/courses/${params.id}`)\n .then(res => {\n if(res.status === 500) {\n this.props.history.push('/error');\n }\n this.setState({\n id: parseInt(res.data[0].id),\n title: res.data[0].title,\n description: res.data[0].description,\n estimatedTime: res.data[0].estimatedTime,\n materialsNeeded: res.data[0].materialsNeeded,\n userId: res.data[0].userId\n });\n })\n .catch(() => {\n this.props.history.push('/notfound');\n });\n}", "title": "" }, { "docid": "6865f65c73f0793e0c0f1e8fa7620f46", "score": "0.5766737", "text": "async function getUserData(){\n const result = await axios.get('http://localhost:3000/users')\n console.log(result.data)\n}", "title": "" }, { "docid": "64afbf01be7729d32e5e10c87e22308d", "score": "0.5763973", "text": "function getSheetData() {\n return axios.get('https://sheet.best/api/sheets/a02bdfb9-8e0e-4740-8a20-480fdd406bd0')\n .then(function (response) {\n // let sheetData = [];\n console.log('response.data: ', response.data);\n return response.data;\n })\n .catch(function (error) {\n console.log('error: ', error);\n });\n \n}", "title": "" }, { "docid": "84c4ccd4738fab10569ff6cb42cf010d", "score": "0.57629585", "text": "getValutazioni(){\n //inserisco la valutazione assegnata al fornitore\n let self = this;\n axios.post('/api/getValutatori', {\n IDBando: this.props.location.state.bando.ID,\n })\n .then( (response) => {\n //const res = response.clone();\n if (response.status >= 400) {\n throw new Error(\"Bad response from server\");\n }\n return response;\n }).then(function (result){\n //console.log(\"risultato\" + result);\n if (result.data.length != 0) { //diverso da null se ricevo una risposta altrimenti do un alert di reinserimento dati\n //omettiamo il controllo del valore della variabile userToken andando a resettarla per assicurarci che sia il primo accesso\n console.log('i dati letti sono: '+result.data); //controllo che abbia settato il token\n //inserisco i valori del fornitore in un array che utilizzero poi nei campi di visualizzazione del medesimo\n self.setState({\n dataB: result.data\n });\n }else {\n eventBus.addNotification('error', 'Attenzione, la valutazione non è stata inserita,verificare la correttezza dei campi e riprovare! ' );\n }\n }).catch(function (error) {\n console.log(error);\n }); \n }", "title": "" }, { "docid": "658f17034a75fb2bead8a9e63657ab22", "score": "0.5762875", "text": "getOfferStats(offer_id, days) {\n return axios\n .get(API_URL + offer_id + '/stats/' + days, {\n headers: authHeader()\n })\n .then(response => {\n return response;\n })\n .catch(err => {\n return err;\n });\n }", "title": "" }, { "docid": "8b7cc22b0312d72ff813fc1885f0af9c", "score": "0.57535726", "text": "async function retrieveCornData() {\n response = await axios.get(url);\n state = response.data\n console.log(state);\n}", "title": "" }, { "docid": "08390e7fa314e036096c4c011e96575e", "score": "0.5749", "text": "function getData(){\n axios.get('https://api.vschool.io/bob/todo').then(function(response){\n listTodos(response.data)\n })\n}", "title": "" }, { "docid": "6bdec2f03ce019fe162e43807a09ebe9", "score": "0.57483315", "text": "function GetTheTicket(urlSession) {\n /*I prepare the option*/\n var options = {\n url: urlSession,\n\n headers: {\n \"X-RapidAPI-Key\": apiKey,\n \"Content-Type\": \"application/json\"\n },\n };\n/*I send the request*/\n return axios(options)\n .then(response => {\n return response.data.Itineraries[0].PricingOptions[0].Price;\n })\n .catch(error => {\n console.log(error);\n });\n}", "title": "" }, { "docid": "38665efcec3abcccb4af258a4e2df89e", "score": "0.5743623", "text": "getUserData() {\n return fetch(this.url)\n .then(response => response.json())\n .then((data => {\n return data\n }))\n .catch(err => {\n console.log(err)\n })\n }", "title": "" }, { "docid": "3aa1e0d15517871ebadc83aed4e1c82e", "score": "0.57382286", "text": "function getUsers(headers) {\n return axios.get('https://projeto-sd-zebiano.c9users.io/users', {\n headers: headers\n })\n .then(function(response) {\n //console.log(response);\n return response;\n });\n}", "title": "" }, { "docid": "afebc69280e022dbf8f6024e2a6d65db", "score": "0.57352257", "text": "function fetchVal () {\n return axios.get('http://localhost:3001/value');\n}", "title": "" }, { "docid": "15d33387999f7fde564f7491893f851f", "score": "0.57349", "text": "async search_method()\r\n {\r\n try{\r\n this.result_datamem = await axios(`https://forkify-api.herokuapp.com/api/search?q=${this.query_datamem}`);\r\n console.log(this.result_datamem);\r\n }\r\n catch(err){\r\n console.log(err);\r\n alert(err);\r\n }\r\n }", "title": "" }, { "docid": "a90fa4db392b66950d9c77f966491710", "score": "0.573165", "text": "populateData(){\n axios.get(this.API_URL + 'api/product/').then(result => {\n\n if(this._isMounted){\n const response = result.data;\n this.setState({ data: response, loading: false, failed: false, error:\"\"});\n } \n })\n .catch(error => {\n this.setState({data: [], loading: false, failed: true, error:\"Product data could not be loaded\"});\n });\n }", "title": "" }, { "docid": "130ef232b458cabcbe89f023454c5544", "score": "0.5730241", "text": "async getData(username, accesscode) {\n let data;\n let errorCode;\n\n if (username && accesscode) {\n this.encoded = `${username}/token:${accesscode}`;\n }\n\n const response = await axios.get(this.statement, {\n headers: {\n 'Authorization': `Basic ${Buffer.from(this.encoded).toString('base64')}`\n }\n })\n .catch((err) => {\n //console.error(err);\n errorCode = err.response.status;\n //res.render('error', { statusCode: err.response.status, statusText: err.response.statusText, data: err.response.data.error })\n })\n\n data = await response.data;\n\n return data;\n }", "title": "" }, { "docid": "381c43239260554737db68ddd632437c", "score": "0.5718267", "text": "getUserData(){\n var AuthStr=\"Bearer \".concat(localStorage.getItem('fundootoken'));\n // console.log(AuthStr);\n \n return axios.get('/api/userdetails', { headers: { Authorization: AuthStr } })\n .then((response) => {\n return response;\n }\n ).catch((error) => {\n return error;\n });\n }", "title": "" }, { "docid": "e1b17043a563ce8f9fcf79bfce9ea9b3", "score": "0.57123363", "text": "getEmpData(comp) {\r\n var url = 'http://ec2-34-209-178-145.us-west-2.compute.amazonaws.com:3210/data/' + comp;\r\n axios.get(url)\r\n .then((empData) => {\r\n console.log(empData.data);\r\n this.setState({\r\n employeeInfo: empData.data,\r\n })\r\n })\r\n }", "title": "" }, { "docid": "4ee63bef0d6504c8aa242f6537c30f14", "score": "0.57085437", "text": "getResume() {\n console.log(store.getState().email)\n var uId = uuidv3(store.getState().email, uuidv3.URL);\n axios({\n method: 'get',\n url: 'http://157.230.172.148:3000/api/queries/workExperience?uIDParam=resource%3Aorg.pow.app.User%23'+uId\n })\n .then((response) => {\n console.log(response.data);\n this.populateJobData(response.data);\n this.setState({\n jobList: response.data\n }); \n })\n .catch((error) => {\n console.log(error);\n console.log('No jobs found for ' + store.getState().email);\n })\n }", "title": "" }, { "docid": "55a5f875fb067859efcfb245d8738621", "score": "0.57037425", "text": "getFeedBack() {\n Axios.get('/submit')\n .then((response) => {\n this.props.dispatch({\n type: 'GET_FEEDBACK',\n payload: response.data,\n });\n })\n .catch((err) => {\n console.log(err);\n // surface message to user\n alert('Something went terribly wrong.');\n });\n }", "title": "" }, { "docid": "27abdddb74d3f08e43049b4bd3f48400", "score": "0.569942", "text": "function makeFriend2() {axios.get(url)\n .then(function (response) {\n // handle success\n console.log(response.data.results[0].name);\n })\n .catch(function (error) {\n // handle error\n console.log(error);\n })\n .finally(function () {\n // always executed\n console.log('Alles klaar!');\n\n });\n}", "title": "" }, { "docid": "7d910c12307e39ae30f40069e648bb45", "score": "0.569693", "text": "function get_data(Long, Lat, Acres ) {\n\n return axios({\n url: '/costcalc',\n method: 'GET',\n params: {Long, Lat, Acres}\n }, console.log('hey'))\n}", "title": "" }, { "docid": "549c3d6f16899fb76d5a4bf9829c7398", "score": "0.5693492", "text": "fetchdata(){\n axios.get('https://masterblaster.herokuapp.com/sachin/country', {headers:{\n 'Content-Type': 'application/json'\n }})\n .then(rslt=>{\n // updating state\n this.setState({\n countrydata: rslt.data,\n err: {err:{}, messsage:\"\"}\n })\n })\n .catch(err=>{\n //updating state\n this.setState({\n countrydata: [],\n err: {err:{}, message:\"data loading error\"}\n })\n });\n }", "title": "" }, { "docid": "48b88821118120fabde1a7230a13b874", "score": "0.5693196", "text": "getPartecip(MailUser){\n let self = this;\n axios.post('/api/getPartecip', {\n Mail: MailUser,\n ID: this.state.ID,\n })\n .then( (response) => {\n //const res = response.clone();\n if (response.status >= 400) {\n throw new Error(\"Bad response from server\");\n }\n return response;\n }).then(function (result){\n //console.log(\"risultato\" + result);\n if (result.data.length != 0) { //diverso da null se ricevo una risposta altrimenti do un alert di reinserimento dati\n //omettiamo il controllo del valore della variabile userToken andando a resettarla per assicurarci che sia il primo accesso\n console.log('i dati letti sono: '+result.data); //controllo che abbia settato il token\n //inserisco i valori del fornitore in un array che utilizzero poi nei campi di visualizzazione del medesimo\n self.setState({\n partecipForn: result.data\n });\n }else {\n eventBus.addNotification('warning',\"Non ci sono Fornitori iscritti a questo bando!\")\n }\n }).catch(function (error) {\n console.log(error);\n });\n }", "title": "" }, { "docid": "6b533fe38b6a94b357722d82bb5986f5", "score": "0.5690186", "text": "getDatos(){\n let url = '/api/datosp';\n axios.get(url).then(response=>{\n console.log(response.data)\n this.datos=response.data;\n });\n }", "title": "" }, { "docid": "fa8cfc7ba879c04def14a6f6f2b72a13", "score": "0.5682134", "text": "static async getQuestion(questionMain) {\n try{\n let response = await axios({url: `${BASE_URL}/questions/${questionMain}`, method: 'get'});\n return response.data;\n }catch (err){\n let message = err.response.data.message;\n throw message;\n }\n }", "title": "" }, { "docid": "b2d2de80f3cf4b0e19baee8cc39c1952", "score": "0.5681948", "text": "async function get(apiEndpoint){\n try {\n const response = await axios.get(config.baseUrl+apiEndpoint, {\n headers: {\n 'Content-Type': 'application/json',\n }\n });\n return response;\n } catch (error) {\n return Promise.reject(error.response);\n } \n}", "title": "" }, { "docid": "143e9f7b58726dcaeb75a4cba17dd470", "score": "0.56807864", "text": "static async getById(id) {\n try {\n let res = await axios.get(`${url}/${id}`);\n let data = res.data;\n if (data != 'No Users.') {\n return data;\n }\n }\n catch (err) {\n console.error(err);\n }\n return {};\n }", "title": "" }, { "docid": "2f05f71e9bad82e83e8541fd7036bc9f", "score": "0.5678429", "text": "function loadPhoto() {\n axios.get('http://localhost:3000/photos/' + id)\n .then(function (response) {\n if (response.status === 200) {\n showPhoto(response.data);\n }\n })\n .catch(console.log);\n}", "title": "" }, { "docid": "5f59796ca3bae421c7c08ad59b3f8c83", "score": "0.5677989", "text": "async getData() {\n var token = await auth.getJWT() // Get token\n\n axios.get(`http://${conf.host}:${conf.port}/utentes`,\n { headers: { Authorization: 'Bearer ' + token }})\n .then(data => {\n this.setState({\n isLoading: false,\n utentesList: data.data\n })\n })\n .catch(err => {})\n }", "title": "" }, { "docid": "c22f1d2d2c762379d4f59c4b8a3fac72", "score": "0.56739163", "text": "async function get(params, { rejectWithValue }) {\n try {\n var resp = await axios.get(config.api + '/competition', helpers.authHeader());\n return resp.data;\n } catch (err) {\n return rejectWithValue();\n }\n}", "title": "" }, { "docid": "c5e24daf710aa3040addac703961ca8e", "score": "0.5672806", "text": "function getExperienceData(key) {\n return axios.get('https://sandbox.xola.com/api/experiences?geo=37.7756,-122.4193,20&price=75&category=Sailing&limit=1', {\n headers: {\n 'X-API-KEY' : key,\n }\n })\n .then(function(response) {\n let len = response.data.data.length;\n for(var i = 0; i < len; i++) {\n console.log(\"Name => \" + response.data.data[i].name);\n console.log(\"Price => \" + response.data.data[i].price + \"\\n\");\n }\n })\n .catch((err) => console.error(err));\n}", "title": "" }, { "docid": "64aa71da1ce32764575c3dc3f7749a58", "score": "0.56726736", "text": "async function getUrl(url) {\n const res = await axios.get(url)\n if (res.status === 200) {\n return {data: res.data}\n } else {\n console.warn(JSON.stringify(res, null, 2))\n return {error: `${url} exception: ${res.status} ${res.statusText}`}\n }\n}", "title": "" }, { "docid": "4eda831e51bf7ae13e8ad2fb8b77cefb", "score": "0.56701684", "text": "componentDidMount(){\n axios.get('http://sample-env-2.8t95hzwxpb.us-east-1.elasticbeanstalk.com/tutorial/1')\n .then( (response) => {\n this.setState ({\n problem: response.data[0]\n });\n });\n axios.get('http://sample-env-2.8t95hzwxpb.us-east-1.elasticbeanstalk.com/competition/1')\n .then( (response) => {\n this.setState ({\n contest: response.data[0]\n });\n });\n }", "title": "" }, { "docid": "4e6543f21d70c00cf81c37d1caaaf7a8", "score": "0.5662141", "text": "function get(props){\r\n\r\nvar axios = require('axios');\r\nvar data = 'from react';\r\n\r\n\r\n\r\nvar config = {\r\n method: 'get',\r\n url: 'http://192.168.0.115:5542',\r\n headers: { },\r\n data : data\r\n};\r\n\r\naxios(config)\r\n.then(function (response) {\r\n console.log(JSON.stringify(response.data));\r\n})\r\n.catch(function (error) {\r\n console.log(error);\r\n});\r\n\r\n}", "title": "" }, { "docid": "b8885585909a61f4db07b48d3f3b439a", "score": "0.56613594", "text": "componentDidMount() {\n axios.get('http://localhost:3000/staffProfiles.json').then(\n response => {\n console.log(response);\n this.setState({\n staffList: response.data,\n loading: false\n })\n }\n ).catch(e => {\n console.log(e);\n if(e.response){\n this.setState({\n errorMessage: e.response.data.errorMessage,\n loading: false\n })\n }\n this.setState({\n errorMessage: e.message,\n loading: false\n })\n\n })\n }", "title": "" }, { "docid": "0b9b84b28ee6bb63ca6f1ebf86794a19", "score": "0.5657423", "text": "function concertSearch(userConcert) {\n // Run a request with Axios to the Bands in Town API with the concert artist specified\n var bandsInTownURL = \"https://rest.bandsintown.com/artists/\" + userConcert + \"/events?app_id=codingbootcamp\";\n\n axios.get(bandsInTownURL).then(\n function (response) {\n for (i = 0; i < response.data.length; i++) {\n console.log(\"Artist: \" + response.data[i].lineup);\n let dateTime = response.data[i].datetime;\n let updatedDateTime = moment(dateTime, \"YYYY-MM-DDTHH:mm:ss\").format(\"MM/DD/YYYY\");\n console.log(\"Event date: \" + updatedDateTime);\n console.log(\"Venue name: \" + response.data[i].venue.name);\n console.log(\"Venue location: \" + response.data[i].venue.city + \", \" + response.data[i].venue.country);\n console.log(\"----------------------------------------------------------\");\n }\n })\n\n // If there is an error output the following\n .catch(function (error) {\n if (error.response) {\n console.log(\"---------------Data---------------\");\n console.log(error.response.data);\n console.log(\"---------------Status---------------\");\n console.log(error.response.status);\n console.log(\"---------------Status---------------\");\n console.log(error.response.headers);\n } else if (error.request) {\n console.log(error.request);\n } else {\n console.log(\"Error\", error.message);\n }\n console.log(error.config);\n });\n}", "title": "" }, { "docid": "b1b836e16ae0d55f83ad79f8d7bd2b36", "score": "0.565299", "text": "static async getById(id) {\n try {\n let res = await axios.get(`${url}/${id}`);\n let data = res.data;\n if (data != 'No Project found.')\n return data;\n }\n catch (err) {\n console.log(err);\n }\n return {};\n }", "title": "" }, { "docid": "10729882a1bb8925b57a0ed867b5255a", "score": "0.56523854", "text": "function getEvent(param) {\n axios.get('http://localhost:8000/event')\n .then(res => {lastEventNum(res.data, param)})\n .catch(err => {console.log(err)})\n}", "title": "" } ]
3907f64c6b3412f0a4d48133f97b2eaa
Returns the ID of the network with the give name.
[ { "docid": "eebfb374dc275c3bc1c0cebcf383be81", "score": "0.7385942", "text": "function getNetworkByName(name) {\n\tfor (var i in clusterdata[\"neutronnetwork\"]) {\n\t\tif (clusterdata[\"neutronnetwork\"][i][\"name\"] == name) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn undefined;\n}", "title": "" } ]
[ { "docid": "59ff85b50c86e6e66c0d65edd11d78b3", "score": "0.65986943", "text": "function getNodeId(name) {\n return nodeNameToId[name];\n}", "title": "" }, { "docid": "aa2c397cc62adec1b7d67143e5b5c10c", "score": "0.6365986", "text": "function getNetwork(networkId){\n switch (networkId) {\n case \"1\":\n return \"Main Ethereum\";\n break\n case \"2\":\n return \"deprecated Morden test network\";\n break\n case \"3\":\n return \"Ropsten test network\";\n break\n default:\n return \"Unknown Ethereum network\";\n }\n}", "title": "" }, { "docid": "e1d846cf3f53c5737ef08ade7dab5137", "score": "0.6183073", "text": "function resolveNetworkFilename(networkId) {\n switch (networkId) {\n case 1:\n return \"mainnet\";\n case 3:\n return \"ropsten\";\n case 4:\n return \"rinkeby\";\n case 42:\n return \"kovan\";\n default:\n return `dev-${networkId}`;\n }\n}", "title": "" }, { "docid": "84045261e839d214e8bc325d0a81a6b3", "score": "0.61071515", "text": "getCurrentNetwork() {\n return this.web3.eth.net.getId().then( netId => {\n return Promise.resolve(netId);\n })\n }", "title": "" }, { "docid": "7fed46192fa026212cf3f1fadc93fab8", "score": "0.59060216", "text": "get networkInterfaceIdInput() {\n return this._networkInterfaceId;\n }", "title": "" }, { "docid": "7fed46192fa026212cf3f1fadc93fab8", "score": "0.59060216", "text": "get networkInterfaceIdInput() {\n return this._networkInterfaceId;\n }", "title": "" }, { "docid": "f488d4be3b9491eea674506d71eef1d2", "score": "0.5832625", "text": "function name2id(name) {\n return names2ids[name]\n}", "title": "" }, { "docid": "3b49925be24be6f852730a4793c732a6", "score": "0.57067645", "text": "async function getNetwork() {\n networkId = await web3.eth.net.getId();\n // if (networkId == 1) {\n // return true;\n // }\n if (networkId == 3) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "d7300fa739aef176e943c0ccc9644e40", "score": "0.5467132", "text": "function getNetwork(network) {\n // No network (null)\n if (network == null) {\n return null;\n }\n if (typeof (network) === \"number\") {\n for (var name_1 in networks) {\n var standard_1 = networks[name_1];\n if (standard_1.chainId === network) {\n return {\n name: standard_1.name,\n chainId: standard_1.chainId,\n ensAddress: (standard_1.ensAddress || null),\n _defaultProvider: (standard_1._defaultProvider || null)\n };\n }\n }\n return {\n chainId: network,\n name: \"unknown\"\n };\n }\n if (typeof (network) === \"string\") {\n var standard_2 = networks[network];\n if (standard_2 == null) {\n return null;\n }\n return {\n name: standard_2.name,\n chainId: standard_2.chainId,\n ensAddress: standard_2.ensAddress,\n _defaultProvider: (standard_2._defaultProvider || null)\n };\n }\n var standard = networks[network.name];\n // Not a standard network; check that it is a valid network in general\n if (!standard) {\n if (typeof (network.chainId) !== \"number\") {\n logger.throwArgumentError(\"invalid network chainId\", \"network\", network);\n }\n return network;\n }\n // Make sure the chainId matches the expected network chainId (or is 0; disable EIP-155)\n if (network.chainId !== 0 && network.chainId !== standard.chainId) {\n logger.throwArgumentError(\"network chainId mismatch\", \"network\", network);\n }\n // @TODO: In the next major version add an attach function to a defaultProvider\n // class and move the _defaultProvider internal to this file (extend Network)\n var defaultProvider = network._defaultProvider || null;\n if (defaultProvider == null && standard._defaultProvider) {\n if (isRenetworkable(standard._defaultProvider)) {\n defaultProvider = standard._defaultProvider.renetwork(network);\n }\n else {\n defaultProvider = standard._defaultProvider;\n }\n }\n // Standard Network (allow overriding the ENS address)\n return {\n name: network.name,\n chainId: standard.chainId,\n ensAddress: (network.ensAddress || standard.ensAddress || null),\n _defaultProvider: defaultProvider\n };\n}", "title": "" }, { "docid": "4bdc4a1c8c91f1a0ac31f1998cbcb26e", "score": "0.5466433", "text": "function getKeyForContract(\n address: string,\n netName: TONNetName = TONNetworks.defaultNetwork.netName,\n): string {\n return `${address}~${netName}`;\n}", "title": "" }, { "docid": "b2bc462ab470364342e5f6be13f476e2", "score": "0.54404056", "text": "function getNetwork(network) {\n // No network (null)\n if (network == null) {\n return null;\n }\n if (typeof (network) === \"number\") {\n for (const name in networks) {\n const standard = networks[name];\n if (standard.chainId === network) {\n return {\n name: standard.name,\n chainId: standard.chainId,\n ensAddress: (standard.ensAddress || null),\n _defaultProvider: (standard._defaultProvider || null)\n };\n }\n }\n return {\n chainId: network,\n name: \"unknown\"\n };\n }\n if (typeof (network) === \"string\") {\n const standard = networks[network];\n if (standard == null) {\n return null;\n }\n return {\n name: standard.name,\n chainId: standard.chainId,\n ensAddress: standard.ensAddress,\n _defaultProvider: (standard._defaultProvider || null)\n };\n }\n const standard = networks[network.name];\n // Not a standard network; check that it is a valid network in general\n if (!standard) {\n if (typeof (network.chainId) !== \"number\") {\n logger$q.throwArgumentError(\"invalid network chainId\", \"network\", network);\n }\n return network;\n }\n // Make sure the chainId matches the expected network chainId (or is 0; disable EIP-155)\n if (network.chainId !== 0 && network.chainId !== standard.chainId) {\n logger$q.throwArgumentError(\"network chainId mismatch\", \"network\", network);\n }\n // @TODO: In the next major version add an attach function to a defaultProvider\n // class and move the _defaultProvider internal to this file (extend Network)\n let defaultProvider = network._defaultProvider || null;\n if (defaultProvider == null && standard._defaultProvider) {\n if (isRenetworkable(standard._defaultProvider)) {\n defaultProvider = standard._defaultProvider.renetwork(network);\n }\n else {\n defaultProvider = standard._defaultProvider;\n }\n }\n // Standard Network (allow overriding the ENS address)\n return {\n name: network.name,\n chainId: standard.chainId,\n ensAddress: (network.ensAddress || standard.ensAddress || null),\n _defaultProvider: defaultProvider\n };\n}", "title": "" }, { "docid": "4acfe9048198f09af1f224eca2d53f07", "score": "0.54373676", "text": "function getIdFormNickname(name){\n var re = /.+\\[(\\d+)\\]/gm;\n var parsed = name.split(re);\n return parsed[1];\n }", "title": "" }, { "docid": "96712b12f729ec47b2c08c7e01db5e5a", "score": "0.54324657", "text": "function getId(n) {\n return n;\n }", "title": "" }, { "docid": "c76dbffceca226138fec332de0a6aaf9", "score": "0.54051346", "text": "static async getNetwork() {\n return web3.eth.net.getNetworkType();\n }", "title": "" }, { "docid": "5c0d8ff85c94433976057675f5ca798d", "score": "0.5392785", "text": "static getNetwork(id) {\n const request = new Request('/api/get_network/' + id, { // Prepare the Request\n method: 'GET'\n });\n \n return fetch(request).then(response => { // Return the result of the Request\n return response.json();\n }).catch(error => {\n return error;\n });\n }", "title": "" }, { "docid": "80e3cd4f298e7b1c31e7d9e5384bbe7a", "score": "0.5323947", "text": "function lib_esm_getNetwork(network) {\n // No network (null)\n if (network == null) {\n return null;\n }\n\n if (typeof network === \"number\") {\n for (var name in lib_esm_networks) {\n var _standard = lib_esm_networks[name];\n\n if (_standard.chainId === network) {\n return {\n name: _standard.name,\n chainId: _standard.chainId,\n ensAddress: _standard.ensAddress || null,\n _defaultProvider: _standard._defaultProvider || null\n };\n }\n }\n\n return {\n chainId: network,\n name: \"unknown\"\n };\n }\n\n if (typeof network === \"string\") {\n var _standard2 = lib_esm_networks[network];\n\n if (_standard2 == null) {\n return null;\n }\n\n return {\n name: _standard2.name,\n chainId: _standard2.chainId,\n ensAddress: _standard2.ensAddress,\n _defaultProvider: _standard2._defaultProvider || null\n };\n }\n\n var standard = lib_esm_networks[network.name]; // Not a standard network; check that it is a valid network in general\n\n if (!standard) {\n if (typeof network.chainId !== \"number\") {\n logger.throwArgumentError(\"invalid network chainId\", \"network\", network);\n }\n\n return network;\n } // Make sure the chainId matches the expected network chainId (or is 0; disable EIP-155)\n\n\n if (network.chainId !== 0 && network.chainId !== standard.chainId) {\n logger.throwArgumentError(\"network chainId mismatch\", \"network\", network);\n } // @TODO: In the next major version add an attach function to a defaultProvider\n // class and move the _defaultProvider internal to this file (extend Network)\n\n\n var defaultProvider = network._defaultProvider || null;\n\n if (defaultProvider == null && standard._defaultProvider) {\n if (isRenetworkable(standard._defaultProvider)) {\n defaultProvider = standard._defaultProvider.renetwork(network);\n } else {\n defaultProvider = standard._defaultProvider;\n }\n } // Standard Network (allow overriding the ENS address)\n\n\n return {\n name: network.name,\n chainId: standard.chainId,\n ensAddress: network.ensAddress || standard.ensAddress || null,\n _defaultProvider: defaultProvider\n };\n}", "title": "" }, { "docid": "3b866af99d39c9f4e850f6c4e4e202fd", "score": "0.530102", "text": "function getID(layer)\n{\n\treturn layer.url ? layer.id : layer.id;\n}", "title": "" }, { "docid": "40bd85c4eba532c55f0fcf07fb62fcbc", "score": "0.5220787", "text": "function getIDOf(address) {\n\n }", "title": "" }, { "docid": "1118f2c3de0548a2eb87da9e738496d1", "score": "0.51745135", "text": "async function getStopID(name) {\r\n let getQuery = \"https://2.bvg.transport.rest/locations?query=\" + encodeURIComponent(name) + \"&results=1\";\r\n let locations = await fetch(getQuery);\r\n let parsed = await locations.json();\r\n return parsed[0].id;\r\n}", "title": "" }, { "docid": "4b12e4de2130882f3bbf02769ee76698", "score": "0.5157245", "text": "get legacyChainId() {\n const v = this.networkV;\n if (v == null) {\n return null;\n }\n return Signature.getChainId(v);\n }", "title": "" }, { "docid": "203e1610720a0b022dd4bcceed749354", "score": "0.51552004", "text": "function getId() {\n for (r=0; r<data.names.length; r++) {\n if (data.names[r] == d3.selectAll(\"#selDataset\").property(\"value\")) {\n return r;\n }\n }\n }", "title": "" }, { "docid": "66383723223438c2f18b4252eaf74c25", "score": "0.51541394", "text": "function findIdByName(name){\n return alasql('COLUMN OF SELECT id FROM layout WHERE name=?',[name])[0];\n}", "title": "" }, { "docid": "6738fd8224be4d3beddab8463ef0d346", "score": "0.5112857", "text": "function getUniqueNodeID(){\n let id = 0;\n let idList = [];\n // Push indexes from JUNCTIONS to numlist\n swmmjs.model.JUNCTIONS.forEach(function(value, i){\n idList.push(i);\n })\n // Push indexes from SUBCATCHMENTS to numlist\n swmmjs.model.SUBCATCHMENTS.forEach(function(value, i){\n idList.push(i);\n })\n // Push indexes from OUTFALLS to numlist\n swmmjs.model.OUTFALLS.forEach(function(value, i){\n idList.push(i);\n })\n // Push indexes from DIVIDERS to numlist\n swmmjs.model.DIVIDERS.forEach(function(value, i){\n idList.push(i);\n })\n // Push indexes from STORAGE to numlist\n swmmjs.model.STORAGE.forEach(function(value, i){\n idList.push(i);\n })\n\n // Get the first integer that is not in numlist\n for(let i = 1; id === 0; i++){\n if(idList.indexOf(i) === -1){\n id = i;\n }\n }\n\n return id;\n }", "title": "" }, { "docid": "671e02472b46770519ed601cc16f65e3", "score": "0.5110833", "text": "function loadUnnamedIdentity(network: Object, mnemonic: string, index: number): NamedIdentityType {\n const keyInfo = getOwnerKeyInfo(network, mnemonic, index);\n const idInfo = {\n name: '',\n idAddress: keyInfo.idAddress,\n privateKey: keyInfo.privateKey,\n index: index,\n profileUrl: ''\n };\n return idInfo;\n}", "title": "" }, { "docid": "f89187067d29c12ac1c345c5309dacb6", "score": "0.50932574", "text": "function getManagerId(name) {\n const manager = currentEmployees.find((el) => el.employee === name);\n return manager ? manager.id : null;\n}", "title": "" }, { "docid": "267bc407f01c06d9c8dc33c479b6e72e", "score": "0.50896895", "text": "function getSystemIDFromName(name){\n const system_found = all_solar_system_data.find(function (data) {\n if (data.name == name){\n return data.id;\n } \n });\n if(typeof system_found === 'undefined') {\n return null;\n } else {\n return system_found.id;\n }\n}", "title": "" }, { "docid": "5f3481772b46fe621f537e21c9c4dc83", "score": "0.5058391", "text": "function ipFindNetworkServiceByName(pName, networkObj) {\n if (networkObj == null)\n return null;\n if (networkObj.service != null) {\n for (var i = 0; i < networkObj.service.length; i++) {\n var networkServiceObj = networkObj.service[i];\n if (networkServiceObj.name == pName)\n return networkServiceObj;\n }\n }\n return null;\n}", "title": "" }, { "docid": "f93194c12486cc01f10e7a17c83a1e1a", "score": "0.5045921", "text": "function getId (idName) {\n const id = document.getElementById(idName);\n return id;\n}", "title": "" }, { "docid": "22eb6ff98bfc9d54d3bb01580e56801e", "score": "0.5037513", "text": "async \"Filecoin.ID\"() {\n // This is calculated with the below code\n // Hardcoded as there's no reason to recalculate each time\n // mh = require(\"multihashing\")(Buffer.from(\"ganache\"), \"blake2b-256\");\n // (new require(\"peer-id\")(mh)).toString()\n // Not sure what else to put here since we don't implement\n // the Filecoin P2P network\n return \"bafzkbzaced47iu7qygeshb3jamzkh2cqcmlxzcpxrnqsj6yoipuidor523jyg\";\n }", "title": "" }, { "docid": "7a9c67c5bdf1921088a00f8dc892bde6", "score": "0.501809", "text": "function getCityId(name)\n{\n switch (name) {\n case 'ny':\n return '5128581';\n case 'pa':\n return '2968815';\n case 'mo':\n return '524894';\n case 'to':\n return '1850147';\n case 'sy':\n return '2147714';\n case '':\n return '2968815';\n }\n}", "title": "" }, { "docid": "cb044ef6bf261473b0c8b9e13fd69f3b", "score": "0.50121987", "text": "function getUniqueLinkID(){\n let id = 0;\n let idList = [];\n // Push indexes from CONDUITS to numlist\n swmmjs.model.CONDUITS.forEach(function(value, i){\n idList.push(i);\n })\n // Push indexes from PUMPS to numlist\n swmmjs.model.PUMPS.forEach(function(value, i){\n idList.push(i);\n })\n // Push indexes from ORIFICES to numlist\n swmmjs.model.ORIFICES.forEach(function(value, i){\n idList.push(i);\n })\n // Push indexes from WEIRS to numlist\n swmmjs.model.WEIRS.forEach(function(value, i){\n idList.push(i);\n })\n // Push indexes from OUTLETS to numlist\n swmmjs.model.OUTLETS.forEach(function(value, i){\n idList.push(i);\n })\n\n // Get the first integer that is not in numlist\n for(let i = 1; id === 0; i++){\n if(idList.indexOf(i) === -1){\n id = i;\n }\n }\n\n return id;\n }", "title": "" }, { "docid": "f1736f9f5781b2b0195e669b0ce6cb40", "score": "0.5005116", "text": "function getNode(name) {\n for (j = 0; j < this.Graph[0].length; j++) {\n if (this.Graph[0][j][0] === name) {\n return this.Graph[0][j];\n }\n }\n return null;\n}", "title": "" }, { "docid": "dfc8b776edb124c409089834a50d124f", "score": "0.49933836", "text": "function getNetworkInterfaceIndex(interfaceName, interfaces) {\n for (var i = 0; i < interfaces.length; i++) {\n if (interfaces[i].name == interfaceName) {\n return i;\n }\n }\n return -1;\n}", "title": "" }, { "docid": "567a4f884d59c0612e66657067936388", "score": "0.49301398", "text": "function byId($this, name) {\n\t\tvar $scopeNode = getScopeNode($this);\n\t\tif ($scopeNode == null) return null;\n\t\treturn $($scopeNode[0]).find(\"*[\"+DP_ID+\"='\"+name+\"']\");\n\t}", "title": "" }, { "docid": "e7aeb4d0ff4ddde6a2798ee4d7bcbe3c", "score": "0.49298054", "text": "function getIdByName(name) {\n return new Promise((resolve, reject) => {\n if (name !== 'None') {\n let nameArr = name.split(' ');\n query = \"SELECT id FROM employee \" +\n \"WHERE first_name = ? and last_name = ?\";\n connection.query(query, [ nameArr[0], nameArr[1] ], (err, res) => {\n return (err) ? reject(err) : resolve(res[0].id);\n });\n } else resolve('');\n });\n}", "title": "" }, { "docid": "eb6168dc152d817639db6e2d20ba946c", "score": "0.49182782", "text": "createId(type) {\n let id = 1;\n if (this.model['@graph']) {\n if (this.model['@graph'].length > 0) {\n const devicesFamily = this.model['@graph'].filter((device) => device['@id'].match(new RegExp(`${type}-` + '\\\\d+')) != null);\n\n if (devicesFamily.length > 0) {\n const tempEntry = devicesFamily.slice(-1);\n const tempString = tempEntry[0]['@id'];\n const tempCount = tempString.match(new RegExp('-' + '\\\\d+'))[0].slice(1);\n id = parseInt(tempCount) + 1;\n }\n }\n }\n return id;\n }", "title": "" }, { "docid": "6a6e58f0e35da5075aec883bce5ab35e", "score": "0.491592", "text": "function deleteNode(name) {\n let nodeId = nodeNameToId[name];\n delete nodes[nodeId];\n return nodeId;\n}", "title": "" }, { "docid": "68ab20ed1c67fa1a07c29adf9e9385e0", "score": "0.4897427", "text": "getID() {\n\t\treturn {robot: this.testData.config.robotName, account: this.testData.config.accountName};\n\t}", "title": "" }, { "docid": "4c7fe8c7dab5ad30bdffdac016a8aee8", "score": "0.4893848", "text": "function getLayerId(layer) {\n if (layer instanceof vue__WEBPACK_IMPORTED_MODULE_2___default.a) {\n return layer.id;\n } else if (layer instanceof ol_layer_Base__WEBPACK_IMPORTED_MODULE_0__[\"default\"]) {\n return layer.get('id');\n }\n\n throw new Error('Illegal layer argument');\n}", "title": "" }, { "docid": "1c0bcb33443a1da5a4e2c4fbbab23031", "score": "0.4884783", "text": "get id() {\n\t\tif (!this._id) {\n\t\t\tthis._id = 'DockingLayout' + Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n\t\t}\n\n\t\treturn this._id;\n\t}", "title": "" }, { "docid": "da5f8fd6d9b0f7a55bb6330f0fbf8d14", "score": "0.48831195", "text": "personIdForName(name) {\n const person = this.state.persons.find(\n person => person.name.toLowerCase() === name.toLowerCase()\n );\n return person != null ? person.id : -1;\n }", "title": "" }, { "docid": "131df9f4e1194ad2e3e954a2c6dae0df", "score": "0.487415", "text": "function getScriptID(id)\r\n\t\t{\r\n\t\t\treturn \"Ninemsn_Global_Communicator_\"+id;\r\n\t\t}", "title": "" }, { "docid": "4f81aeeb5c4e1867a5b209ef7e927033", "score": "0.4872847", "text": "_getMspIdForOrganization(org_name) {\n\t\tif(this._network_config && this._network_config[ORGS_CONFIG]) {\n\t\t\tlet organization = this.getOrganization(org_name);\n\t\t\tif(organization) {\n\t\t\t\treturn organization.getMspid();\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "title": "" }, { "docid": "2389d041bd99f70b5ae0c31fc5ad59ec", "score": "0.48717996", "text": "getIdFromGroupName(name) {\n for (var i=0;i<this.state.user.groups.length;i++){\n if (this.state.user.groups[i].name===name){\n return this.state.user.groups[i]._id;\n } else {\n console.log('Group Id not found')\n }\n }\n }", "title": "" }, { "docid": "c1a0b2267e1af7d32967593871d19d17", "score": "0.4868904", "text": "_getGraphName(graph) {\n var graphName, namespace;\n namespace = this.options.namespace || 'default';\n graphName = graph.name || 'main';\n return `${namespace}/${graphName}`;\n }", "title": "" }, { "docid": "e747d642de11d04cd9d2c96b40a41e73", "score": "0.4845397", "text": "function getWorkerId(name){\n var id='';\n for (var k in workers) {\n var fullname = workers[k].value.name+' '+workers[k].value.surname;\n if(name===fullname){\n return workers[k].key;\n }\n }\n return id;\n}", "title": "" }, { "docid": "e747d642de11d04cd9d2c96b40a41e73", "score": "0.4845397", "text": "function getWorkerId(name){\n var id='';\n for (var k in workers) {\n var fullname = workers[k].value.name+' '+workers[k].value.surname;\n if(name===fullname){\n return workers[k].key;\n }\n }\n return id;\n}", "title": "" }, { "docid": "8302ccbbbbeab401949b76d0098acdba", "score": "0.48352578", "text": "function getOZNetworkConfigByName(networkName) {\n const zosNetworkFile = fs.readFileSync(`./.openzeppelin/${networkName}.json`);\n return JSON.parse(zosNetworkFile);\n}", "title": "" }, { "docid": "cd5ee6bad632c13ab3a158d9005198b6", "score": "0.48291513", "text": "function getNetId() {\n var email = Session.getActiveUser().getEmail();\n Logger.log(email);\n var user = \"\";\n if(email.trim() != \"\"){\n user = email.split(\"@\")[0];\n }\n return user.toLowerCase();\n}", "title": "" }, { "docid": "13974af88c912344c57a5e5fb3ca09bd", "score": "0.48137122", "text": "function getClientId(name) {\n return name + Math.floor(Math.random() * 100000)\n}", "title": "" }, { "docid": "1e49ff45456a153ea22cb7b38140ec08", "score": "0.4803905", "text": "function GetIdByName (collection, objectName) {\n\t\tvar collection_enumerator = collection.getEnumerator();\n\t\twhile (collection_enumerator.moveNext()) {\n\t\t\tif (collection_enumerator.get_current().get_name() == objectName) {\n\t\t\t\treturn collection_enumerator.get_current().get_id();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "30f638f93095c64c68e04c06acc300f6", "score": "0.48028558", "text": "function getNetwork() {\n return new Promise(async (resolve, reject) => {\n try {\n const gateway = new Gateway();\n\n const connectionOptions = {\n identity: IDENTITY_NAME,\n wallet: wallet,\n discovery: {\n enabled: DISCOVERY,\n asLocalhost: ISLOCAL,\n },\n };\n\n await gateway.connect(connectionProfile, connectionOptions);\n const network = await gateway.getNetwork(CHANNEL_NAME);\n\n resolve(network);\n } catch (error) {\n reject(error);\n }\n });\n}", "title": "" }, { "docid": "46db7e1a0cedf8c3c132b5a64a34efca", "score": "0.47955105", "text": "function id(n){\n\t\treturn this.inputs[n].parentElement.id;\n\t}", "title": "" }, { "docid": "9a1bae6986431a2b13d207c46420efef", "score": "0.47866285", "text": "getLogicalId(cfnElement) {\n const path = cfnElement.stackPath.split(PATH_SEP);\n const generatedId = this.namingScheme.allocateAddress(path);\n const finalId = this.applyRename(generatedId);\n validateLogicalId(finalId);\n return finalId;\n }", "title": "" }, { "docid": "1033791746d5d29229dbcce919bfdba0", "score": "0.47662604", "text": "vatNameToID(vatName) {\n return kernel.vatNameToID(vatName);\n }", "title": "" }, { "docid": "084d66fca9e1b77fa6007e71aa40b11f", "score": "0.47659272", "text": "function getEmployeeId(name) {\n return currentEmployees.find(el => el.employee === name).id;\n}", "title": "" }, { "docid": "65bf7dd81f6939dd194695370267f802", "score": "0.47569358", "text": "function getNetworkType(){\n\twx.getNetworkType({\n\t success: function (res) {\n\t alert(res.networkType); // 返回网络类型2g,3g,4g,wifi\n\t }\n\t});\n}", "title": "" }, { "docid": "78da0da7929719308b129fcdbcd4e393", "score": "0.47364056", "text": "get net() {\r\n\t\tif (typeof this.data.net !== \"number\") {\r\n\t\t\tconsole.warn(\".net not a number\");\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\treturn this.data.net;\r\n\t}", "title": "" }, { "docid": "78da0da7929719308b129fcdbcd4e393", "score": "0.47364056", "text": "get net() {\r\n\t\tif (typeof this.data.net !== \"number\") {\r\n\t\t\tconsole.warn(\".net not a number\");\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\treturn this.data.net;\r\n\t}", "title": "" }, { "docid": "4de923bc3bc3c84ccbea554b3a472a86", "score": "0.47353172", "text": "id() {\n return this.name();\n }", "title": "" }, { "docid": "4de923bc3bc3c84ccbea554b3a472a86", "score": "0.47353172", "text": "id() {\n return this.name();\n }", "title": "" }, { "docid": "38a6ef88d89484a3b31bef6a3552b9ea", "score": "0.47281903", "text": "function generateId(gadgetName){\n\t\n var newId = gadgetName;\n if(ids[newId] != undefined){\n newId = gadgetName + \"_\" + counter;\n counter++;\n }\n console.log(\"ID \" + newId);\n \t\n \tids[newId] = newId;\t\n \treturn newId;\n\n\t}", "title": "" }, { "docid": "71ebac0723998b3ff291a99c58e2a691", "score": "0.47216284", "text": "function graphId () {\n return parseInt((1 + Math.random()) * (Number.MAX_SAFE_INTEGER / 2)).toString(16).slice(0, 8)\n}", "title": "" }, { "docid": "d8cf3e1d45a35aa0517670405bbbc562", "score": "0.4721551", "text": "async function getMyId() {\n const data = await readFilePromise('/proc/self/cgroup', { encoding: 'ascii' });\n const [, id] = data.split('\\n').filter(line => line.includes('docker'))[0].match(getContainerIdMatchPattern());\n return id;\n}", "title": "" }, { "docid": "f59e0f012da93153af68310e730c9a92", "score": "0.47171912", "text": "function getSpacePlaceID(space_name)\n{\n var url = basicUrl+apiCore+'places?sort=dateCreatedAsc&filter=type%28space%29';\n var next_link;\n do\n {\n var response = sendGetData(url, basicAuth);\n var pl = response['list'];\n for(var i in pl)\n {\n var places_list = pl[i];\n if(places_list['name'] == space_name) {\n Logger.log(\"PlaceID: \" + places_list['placeID']);\n Logger.log(\"Name: \" + places_list['name']);\n Logger.log(\"Display name: \" + places_list['displayName']);\n Logger.log('*****');\n }\n }\n \n if(typeof response['links']['next'] !== 'undefined') url = response['links']['next']; \n else url = false;\n \n } while(url);\n}", "title": "" }, { "docid": "06c1f991c3c16ab3a4fb088948775497", "score": "0.47107267", "text": "function yn(e){if(e instanceof Y[\"default\"])return e.id;if(e instanceof Sn[\"a\"])return e.get(\"id\");throw new Error(\"Illegal layer argument\")}", "title": "" }, { "docid": "4e7653b55befbdc9906486c62b37762d", "score": "0.47087947", "text": "id() {\n return this._type.id() + ':' + this.name();\n }", "title": "" }, { "docid": "49441f6017cc4de9a0861cfe3dbc3cd5", "score": "0.47038856", "text": "function getId() {\n return knex('restaurant')\n .select('id')\n .where('name', 'like', 'C%');\n }", "title": "" }, { "docid": "d09ff989bf00891801b879884a68024b", "score": "0.4698991", "text": "function getNodeId() {\n\treturn node_id;\n}", "title": "" }, { "docid": "ae944339a1d9127fa901c6f810db0496", "score": "0.46951112", "text": "get id() {\n\t\tif (!this._id) {\n\t\t\tthis._id = 'ListItemsGroup' + Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n\t\t}\n\n\t\treturn this._id;\n\t}", "title": "" }, { "docid": "a8f7ae641f1c6504be1ec45a712d791a", "score": "0.46946198", "text": "get id() {\n if (this.state == ANONYMOUS) return undefined;\n return this.get(this.store.id);\n }", "title": "" }, { "docid": "0494c6371972ddf9da48135452305e16", "score": "0.4685805", "text": "async function getLabelID(labelName, pageToken, create = true) {\n\ttry {\n\t\tconst labelList = await listAllLabels(pageToken);\n\t\tconst theOneLabel = await labelList.data.find((x) => x.name === `${labelName}`);\n\t\tif (theOneLabel && theOneLabel.id) { return theOneLabel.id; }\n\t\tif (create) {\n\t\t\tconst newLabel = await createNewLabel(labelName, pageToken);\n\t\t\tif (newLabel) { return newLabel.id;\t}\n\t\t}\n\t\treturn undefined;\n\t} catch (error) {\n\t\tsentryError('Erro em getLabelID', error);\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "51a03e2ce197edabebb569572b45202c", "score": "0.46842682", "text": "function getNetwork(ip) {\n let result;\n config.fastnetmon.networks.forEach((network) => {\n if (range.inRange(ip, network))\n result = network;\n });\n return result;\n}", "title": "" }, { "docid": "fd3165ab45d42cb1d431c510ae0c3448", "score": "0.4675864", "text": "set name(n) {\n this._identifier.name = n;\n }", "title": "" }, { "docid": "32211d2262f32fcd683a22e3ff348737", "score": "0.4670943", "text": "function createId(name) {\n const clock = new Date();\n const num1 = clock.getDate().toString();\n const num2 = (clock.getMonth() + 1).toString();\n const num3 = clock.getHours().toString();\n const num4 = clock.getMinutes().toString();\n const num5 = clock.getSeconds().toString();\n const result = `TASK_${name}_${num1 + num2 + num3 + num4 + num5}`\n return result\n}", "title": "" }, { "docid": "a9e46e57ae82fc0b6721f2be9f857e7c", "score": "0.46686262", "text": "function scoutNametoID(scoutname) {\r\n\tfor(var x=0;x<scoutArr.length;x++) {\r\n\t\tif(scoutArr[x].name==scoutname) {\r\n\t\t\treturn scoutArr[x].id;\r\n\t\t}\r\n\t}\r\nreturn '';\r\n}", "title": "" }, { "docid": "516aa11ac4b799c6d8b09dd0ff2cc195", "score": "0.46682963", "text": "function toImgId(group, name, type) {\n let v = `${group}${NAME_DELIM}${name}`;\n if (type) v += `${TYPE_DELIM}${type}`\n return v;\n}", "title": "" }, { "docid": "fc40f22f93d58b35a3951fa5ed5bd346", "score": "0.46671334", "text": "function getID() {\n\t\treturn socketClient.socketID;\n\t}", "title": "" }, { "docid": "1e4505e16948ddea62aa503ed704bc66", "score": "0.46652755", "text": "function Network() {\r\n var id = null;\r\n this.getId = function () {return id;};\r\n\r\n if (1 == arguments.length && arguments[0][rhoUtil.rhoIdParam()]) {\r\n if (moduleNS != arguments[0][rhoUtil.rhoClassParam()]) {\r\n throw \"Wrong class instantiation!\";\r\n }\r\n id = arguments[0][rhoUtil.rhoIdParam()];\r\n } else {\r\n id = rhoUtil.nextId();\r\n // constructor methods are following:\r\n \r\n }\r\n }", "title": "" }, { "docid": "404982cffd052c612290c351d4d016e3", "score": "0.46621868", "text": "function namehash(name) {\n var node = '0x0000000000000000000000000000000000000000000000000000000000000000';\n if (name != '') {\n var labels = name.split(\".\");\n for(var i = labels.length - 1; i >= 0; i--) {\n node = web3.sha3(node + web3.sha3(labels[i]).slice(2), {encoding: 'hex'});\n }\n }\n return node.toString();\n}", "title": "" }, { "docid": "a9946409b88381de0e6e57d88d3a5ea6", "score": "0.46603307", "text": "calculateStackName() {\n // In tests, it's possible for this stack to be the root object, in which case\n // we need to use it as part of the root path.\n const rootPath = this.node.scope !== undefined ? this.node.scopes.slice(1) : [this];\n const ids = rootPath.map(c => c.node.id);\n // Special case, if rootPath is length 1 then just use ID (backwards compatibility)\n // otherwise use a unique stack name (including hash). This logic is already\n // in makeUniqueId, *however* makeUniqueId will also strip dashes from the name,\n // which *are* allowed and also used, so we short-circuit it.\n if (ids.length === 1) {\n // Could be empty in a unit test, so just pretend it's named \"Stack\" then\n return ids[0] || 'Stack';\n }\n return uniqueid_1.makeUniqueId(ids);\n }", "title": "" }, { "docid": "dfb50d6010d850455a1508c760a10429", "score": "0.4650804", "text": "function getSecurityGroupByName(name) {\n\tfor (var i in clusterdata[\"security_groups\"]) {\n\t\tif (clusterdata[\"security_groups\"][i][\"name\"] == name) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn undefined;\n}", "title": "" }, { "docid": "e234c4c0cdf37ef88e83fc669e1e9569", "score": "0.4650656", "text": "function getName(node) {\n var n = node.nodeName;\n if (node.id) n = n + \" #\" + node.id;\n var namenum = n; // make sure the name is unique\n var i = 1;\n while (names[namenum] !== undefined) {\n namenum = n + i;\n i++;\n }\n names[namenum] = node;\n return namenum;\n }", "title": "" }, { "docid": "80378e7a6b2060c881fb2d650e449786", "score": "0.46440595", "text": "function getInnerHTML(networkName) {\r\n var html;\r\n\r\n if (networkName.indexOf(\"COX\") != -1) {\r\n html = \"<img src= Images/Logos/Cox.png>\"\r\n }\r\n else if (networkName.indexOf(\"COMCAST\") != -1) {\r\n html = \"<img src= Images/Logos/Comcast.png>\"\r\n }\r\n else if (networkName.indexOf(\"CHARTER\") != -1) {\r\n html = \"<img src= Images/Logos/Charter.png>\"\r\n }\r\n else if (networkName.indexOf(\"VERIZON\") != -1) {\r\n html = \"<img src= Images/Logos/Verizon.png>\"\r\n }\r\n else if(networkName.indexOf(\"CENTURYLINK\") != -1) {\r\n html = \"<img src= Images/Logos/CenturyLink.png>\"\r\n }\r\n else if(networkName.indexOf(\"ATT\") != -1) {\r\n html = \"<img src= Images/Logos/ATT.png width=20px>\"\r\n }\r\n else if(networkName.indexOf(\"ALTICE\") != -1) {\r\n html = \"<img src= Images/Logos/Altice.png>\"\r\n }\r\n else if(networkName.indexOf(\"MEDIACOM\") != -1) {\r\n html = \"<img src= Images/Logos/Mediacom.png>\"\r\n }\r\n\r\n return html;\r\n}", "title": "" }, { "docid": "1c1a4a28d6ea4bf76a85fe35dc16d0d4", "score": "0.46430504", "text": "function getDivId(name, year) {\n\tvar name;\n\tname = name && name.replace(/[^a-z0-9\\s]/gi, \"\");\n\treturn name;\n}", "title": "" }, { "docid": "984a2924244afe66c038de2c7df40e04", "score": "0.46396226", "text": "function getOZNetworkConfig(networkId) {\n const networkName = resolveNetworkFilename(networkId);\n return getOZNetworkConfigByName(networkName);\n}", "title": "" }, { "docid": "3d0b767df32202893c1d23435545f8a7", "score": "0.4631149", "text": "selectNetwork () { return resolve.useNetwork(this) }", "title": "" }, { "docid": "439306cb3b36dde4594c020157a2f9d8", "score": "0.46310404", "text": "function getOnlineId(username) { return `${username}-online`; }", "title": "" }, { "docid": "fbdc67f10b20f3c7017cf4be3f812380", "score": "0.46196502", "text": "function getGuildId(e) {\n var owner = getOwnerInstance(e);\n if (owner === undefined) {\n return undefined;\n }\n\n try {\n return owner.props.guild.id;\n } catch (err) {\n // Catch TypeError if no guild in props\n }\n\n try {\n return owner.state.guild.id;\n } catch (err) {\n // Catch TypeError if no guild in state\n }\n\n return undefined;\n }", "title": "" }, { "docid": "911565380b8ad1cc52b994ab22103505", "score": "0.46187782", "text": "function getFactoryAddress(network) {\n switch (network) {\n case 'mainnet':\n return MAINNET_FACTORY_ADDRESS;\n case 'rinkeby':\n return RINKEBY_FACTORY_ADDRESS;\n default:\n throw new Error('Invalid network.');\n }\n}", "title": "" }, { "docid": "a0d7ef0081867fac0eebf7874ee4031c", "score": "0.46139157", "text": "function getNetworkMessage(accountAddress, networkId){\n switch (networkId) {\n case \"1\":\n return \"You are logged into account \" + accountAddress + \" on the main Ethereum network, if this is not correct switch accounts and refresh this page.\";\n break\n case \"2\":\n return true, \"You are logged into account \" + accountAddress + \" on the deprecated Morden test network, if this is not correct switch accounts and refresh this page.\";\n break\n case \"3\":\n return \"You are logged into account \" + accountAddress + \" on the the Ropsten test network, if this is not correct switch accounts and refresh this page.\";\n break\n default:\n return \"You are logged into account \" + accountAddress + \" on an unknown Ethereum network, if this is not correct switch accounts and refresh this page.\";\n }\n}", "title": "" }, { "docid": "8c655e22df0456f1968b860ebf8d00f1", "score": "0.46122947", "text": "function getRelFromNid(namespacedID, type, ext) {\n if (namespacedID.indexOf(':') === -1) {\n namespacedID = `minecraft:${namespacedID}`;\n }\n const parts = namespacedID.split(':');\n const namespace = parts[0];\n const name = parts[1];\n return `assets/${namespace}/${type}/${name}.${ext}`;\n}", "title": "" }, { "docid": "04f661c8e83ee9ebc51d82ceb0faba87", "score": "0.46111274", "text": "static parseNetworkType(network) {\n if (network === \"mainnet\") return MoneroDaemon.MAINNET;\n if (network === \"testnet\") return MoneroDaemon.TESTNET;\n if (network === \"stagenet\") return MoneroDaemon.STAGENET;\n throw new Error(\"Invalid network type to parse: \" + network);\n }", "title": "" }, { "docid": "93653d8f6faee4d51efc10dfe95c5baf", "score": "0.46102372", "text": "function getClass(idname){\n return document.querySelector(\".box\" + idname).id; //returning id name\n}", "title": "" }, { "docid": "b55b8f957f593b5d919b9c6b5c1939ed", "score": "0.46038905", "text": "function getIndexByName(layerName) {\r for (var i = 0; i < numberOfLayers; i++) { \r var customName = layerName; //layerName should be string\r var myLayer = app.activeDocument.layers[i].name;\r if (customName == myLayer) {\r return i;\r }\r }\r}", "title": "" }, { "docid": "8554046f868fa499de22e5c6d2184eee", "score": "0.45943165", "text": "function layerIdExists(id, network) {\n for (var i in network.layers) {\n // Iterate over all layers in the Network\n if (network.layers[i].id === id) {\n // Check if it has the searched ID\n return true;\n }\n }\n return false; // No layer with the searched ID\n}", "title": "" }, { "docid": "d716fb2dbab19310b19720a0daac0073", "score": "0.45887524", "text": "function getCategoryIdFromName(name){\n \n for (var i=0;i<categories.length;i++){\n //console.log(url+\"\\n\"+xproperties[i]['setXValue']+\"\\n\"+(xproperties[i]['setXValue']==url)+\"\\n\"+i);\n if(categories[i]['setName']==name){\n return i; \n }\n }\n return undefined;\n }", "title": "" }, { "docid": "bb6be6c18dfa7e7a3a8e8b7a70578ed5", "score": "0.4582828", "text": "function Device_makeNetwork(element){\n\t//gets the name of the network input on the page\n\tvar input = document.getElementById(element);\n\tconsole.log(input);\n\tif(input !== null){\n\t\tvar name = input.value;\n\t\tif(name !== ''&&name!==null){\n\t\t\t//creates a network with this name\n\t\t\talert(\"Created a network with name: \"+name);\n\t\t\tcreateNetwork(name);\n\t\t}\n\t\telse{\n\t\t\talert(\"Please enter a non-empty network name.\");\n\t\t\tconsole.log(\"Device_makeNetwork recieved null parameters\");\n\t\t}\n\t}\n\telse{\n\t\talert(\"Please enter a non-empty network name.\");\n\t\tconsole.log(\"Device_makeNetwork recieved null parameters\");\n\t}\n}", "title": "" }, { "docid": "25991f2e8cebc513e05f27a73121f4e9", "score": "0.45790118", "text": "function name_for_next_scan_for_id(name) {\n next_name_flag = true;\n next_name = name;\n resume_scan();\n if (check_socket(\"cannot request ID scan\")) {\n socket.emit('request', 'scan-id');\n }\n}", "title": "" }, { "docid": "b011ac7bc3b4cdc6389ce5c72a9b94bc", "score": "0.457613", "text": "function makeStationId() {\n return String(++stationIdIterator);\n}", "title": "" } ]
36ed1ce5eec5bcca4833f7674f08188e
name getter and setter
[ { "docid": "764953ef8e43dd0cb7102d5ac44aa27e", "score": "0.0", "text": "getName(){\n return this.name;\n }", "title": "" } ]
[ { "docid": "21d77650ff6eb2228d70e391349d126d", "score": "0.84552157", "text": "set name(val){\r\n return this._name = val;\r\n }", "title": "" }, { "docid": "bc9fdb910ccd1f48463c902f40e2f9d8", "score": "0.841169", "text": "get name() { return this.name_; }", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.83601415", "text": "get name() {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.83601415", "text": "get name() {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.83601415", "text": "get name() {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.83601415", "text": "get name() {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.83601415", "text": "get name() {}", "title": "" }, { "docid": "faaf766a6d380d37c6f2cdf21a0577c2", "score": "0.83601415", "text": "get name() {}", "title": "" }, { "docid": "159dafe1d290ca832498cbe3ac2143df", "score": "0.826489", "text": "get name() { return this._name; }", "title": "" }, { "docid": "159dafe1d290ca832498cbe3ac2143df", "score": "0.826489", "text": "get name() { return this._name; }", "title": "" }, { "docid": "159dafe1d290ca832498cbe3ac2143df", "score": "0.826489", "text": "get name() { return this._name; }", "title": "" }, { "docid": "159dafe1d290ca832498cbe3ac2143df", "score": "0.826489", "text": "get name() { return this._name; }", "title": "" }, { "docid": "159dafe1d290ca832498cbe3ac2143df", "score": "0.826489", "text": "get name() { return this._name; }", "title": "" }, { "docid": "159dafe1d290ca832498cbe3ac2143df", "score": "0.826489", "text": "get name() { return this._name; }", "title": "" }, { "docid": "b8426dc7d3d9b8298e9670065fef5dd0", "score": "0.82567626", "text": "get name() {\n return name;\n }", "title": "" }, { "docid": "96d9f5540d33d489af3bc5a6d11003eb", "score": "0.8225937", "text": "get name(){\r\n return this.__name\r\n }", "title": "" }, { "docid": "c38d1938ac7957c5c0b1675ec1b927aa", "score": "0.8183649", "text": "get name( ) { return this.m_name; }", "title": "" }, { "docid": "baa6dc4a9e1fb1bde53c6c8caa106e19", "score": "0.8166524", "text": "set name( name ){\n this._name = name;\n }", "title": "" }, { "docid": "84f75ad874311a6e8497f1b630f650e1", "score": "0.81420296", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "7121658f8f7a12d47bb68027433a42ba", "score": "0.8075265", "text": "get name() {\n return this.#name;\n }", "title": "" }, { "docid": "2111d20fa682309a32e3e81980162b1c", "score": "0.8072002", "text": "set name (name){\n this.#name = name;\n }", "title": "" }, { "docid": "370924d13f9f1198e80506ce168ae9c6", "score": "0.8067707", "text": "get name () {\r\n\t\treturn this._name;\r\n\t}", "title": "" }, { "docid": "e533d6e7c6d35465ec4fc44e3bc1f29c", "score": "0.80633754", "text": "get name () {\n return this._name\n }", "title": "" }, { "docid": "f82729c5fa710b51d5f44eef26468380", "score": "0.80622566", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "f82729c5fa710b51d5f44eef26468380", "score": "0.80622566", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "c1a6f421c115960a2e794905889a0ebb", "score": "0.8058386", "text": "get name() {\n return this._name\n }", "title": "" }, { "docid": "3bd078fd4e3121999dfb4c5801a9490c", "score": "0.8050358", "text": "get name()\n{\nreturn this._name;\n}", "title": "" }, { "docid": "89bac788863417f76fccd3ed17971832", "score": "0.8045599", "text": "get name () {\n\t\treturn this._name;\n\t}", "title": "" }, { "docid": "89bac788863417f76fccd3ed17971832", "score": "0.8045599", "text": "get name () {\n\t\treturn this._name;\n\t}", "title": "" }, { "docid": "89bac788863417f76fccd3ed17971832", "score": "0.8045599", "text": "get name () {\n\t\treturn this._name;\n\t}", "title": "" }, { "docid": "89bac788863417f76fccd3ed17971832", "score": "0.8045599", "text": "get name () {\n\t\treturn this._name;\n\t}", "title": "" }, { "docid": "89bac788863417f76fccd3ed17971832", "score": "0.8045599", "text": "get name () {\n\t\treturn this._name;\n\t}", "title": "" }, { "docid": "8970cf25d7ad8be888777193d9f61117", "score": "0.8040064", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "3b313f519df55fec7b727d51eec551c1", "score": "0.8002551", "text": "get name(){\n return this._name;\n }", "title": "" }, { "docid": "3b313f519df55fec7b727d51eec551c1", "score": "0.8002551", "text": "get name(){\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.7985343", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.7985343", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.7985343", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.7985343", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.7985343", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.7985343", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "6a1c446a83569ffa52407113f11786f7", "score": "0.7985343", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "b60b5b765b5985e7f5805040e03e5285", "score": "0.7975484", "text": "get name() {\n return this.#name;\n }", "title": "" }, { "docid": "fa6e197746b416f7118bfa0e87193236", "score": "0.7961371", "text": "get name() {\n\t\treturn this._name;\n\t}", "title": "" }, { "docid": "fa6e197746b416f7118bfa0e87193236", "score": "0.7961371", "text": "get name() {\n\t\treturn this._name;\n\t}", "title": "" }, { "docid": "c1a4efbee69bc8c3764ccd66cd198234", "score": "0.79492104", "text": "get() { return this._name}", "title": "" }, { "docid": "9e7a7ff5a71294386938ce25feb0841a", "score": "0.7947927", "text": "get name() {\n\t\treturn this.__name;\n\t}", "title": "" }, { "docid": "9e7a7ff5a71294386938ce25feb0841a", "score": "0.7947927", "text": "get name() {\n\t\treturn this.__name;\n\t}", "title": "" }, { "docid": "9e7a7ff5a71294386938ce25feb0841a", "score": "0.7947927", "text": "get name() {\n\t\treturn this.__name;\n\t}", "title": "" }, { "docid": "9e7a7ff5a71294386938ce25feb0841a", "score": "0.7947927", "text": "get name() {\n\t\treturn this.__name;\n\t}", "title": "" }, { "docid": "9e7a7ff5a71294386938ce25feb0841a", "score": "0.7947927", "text": "get name() {\n\t\treturn this.__name;\n\t}", "title": "" }, { "docid": "8517dd5220b8646f93364ff32d54d1ff", "score": "0.7924744", "text": "set name (name) {\n this._name = name\n }", "title": "" }, { "docid": "72a81fbba092cc8caad405d39912e126", "score": "0.7921795", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "72a81fbba092cc8caad405d39912e126", "score": "0.7921795", "text": "get name() {\n return this._name;\n }", "title": "" }, { "docid": "f410b7bf2153a53fc3038451b7cf5fb4", "score": "0.7908173", "text": "get name() {\n return _s;\n }", "title": "" }, { "docid": "896ba8dc75064ee211a89a57a0005d71", "score": "0.78606224", "text": "get name(){\n console.log(\"Custom operation when reading value\"); \n return this._name; \n }", "title": "" }, { "docid": "746c6c247eb25e7ed8e18f14131034ad", "score": "0.78509676", "text": "get getName(){\n return this.name;\n }", "title": "" }, { "docid": "28f26bf27085ea0003122513a8afeedf", "score": "0.783128", "text": "get getName() {\n return this.name\n }", "title": "" }, { "docid": "23215ccf5ef173c86032e8a5468fc14d", "score": "0.7822293", "text": "set setName(name){\n this.name = name;\n return this.name\n }", "title": "" }, { "docid": "452fbdee4ec6430956a47414b78308b9", "score": "0.7819171", "text": "getName() { return this.name; }", "title": "" }, { "docid": "452fbdee4ec6430956a47414b78308b9", "score": "0.7819171", "text": "getName() { return this.name; }", "title": "" }, { "docid": "48e922c3a5774992b92dfe3b2e70a3c2", "score": "0.7806552", "text": "set name(new_name){\r\n\t\tif(new_name)\r\n\t\tthis._name = new_name;\r\n\t}", "title": "" }, { "docid": "01542f57d3fd0b5a3adf3f89e31867e0", "score": "0.780461", "text": "get getName(){\n return(this.name)\n }", "title": "" }, { "docid": "7979d541234269dee3a26eeaa75aeba1", "score": "0.7803055", "text": "get name() {\n return this.Name;\n }", "title": "" }, { "docid": "67e142fd7bdef4e83eb52c963c5011f8", "score": "0.77990484", "text": "get name() {\n return this.getStringAttribute('name');\n }", "title": "" }, { "docid": "089824fd629632c49516b1ac8be33953", "score": "0.7775765", "text": "get name() {\n\t\treturn this[_private].name;\n\t}", "title": "" }, { "docid": "aed0047a003c6b451f6440180afb3833", "score": "0.777238", "text": "getName() { return this.name_; }", "title": "" }, { "docid": "fc18dca08f8812076345af9aeb1558bf", "score": "0.776081", "text": "get name() {\n return this.internalName;\n }", "title": "" }, { "docid": "baef6481ed11fc51f9e405f7747d1f66", "score": "0.7756056", "text": "get name() {\n return At;\n }", "title": "" }, { "docid": "de7ecfc856957e7d8c217cd94b5ef4c5", "score": "0.77256304", "text": "getName() { return this._name; }", "title": "" }, { "docid": "98193766df3d7d50c7164cb8d813c879", "score": "0.76976115", "text": "get name() {\n return jo;\n }", "title": "" }, { "docid": "b86c1da45de058cd66d61dff2ce056b1", "score": "0.7694296", "text": "getName() { return this.name }", "title": "" }, { "docid": "a40c04a8b629e021fcfda6cd183d686b", "score": "0.7675911", "text": "static get name() {\n return this._name;\n }", "title": "" }, { "docid": "db87f117f2f134389542e2e12cec18b7", "score": "0.7669157", "text": "set setName(name){\n this.name = name\n }", "title": "" }, { "docid": "f34cf95d76878caaa37e23869f6e59d3", "score": "0.7662249", "text": "get name() {\r\n return this.getAttribute(\"name\") || this._name;\r\n }", "title": "" }, { "docid": "0186201bf098f5ec738d368a398ee47e", "score": "0.7661402", "text": "set name(n) {\n this._name = n;\n }", "title": "" }, { "docid": "e155512585b8c269448ba9b1ec8f0e45", "score": "0.7655906", "text": "get name() {\n return this.getAttribute('name');\n }", "title": "" }, { "docid": "b78b1050d4ca6e3eaa1ab29b9c75ab0c", "score": "0.76492035", "text": "get name() {\n return Ks;\n }", "title": "" }, { "docid": "5d74a79efd84255acbc979accc7a611f", "score": "0.76267296", "text": "setName(name) {\n this.name = name;\n }", "title": "" }, { "docid": "f92a1ab43dfaff3156f1973f244fe45f", "score": "0.7625395", "text": "get name() {\n return Bo;\n }", "title": "" }, { "docid": "beeb7ffa0d31fe5385c8fca7d60e9fcc", "score": "0.761101", "text": "get name() {\n return Xs;\n }", "title": "" }, { "docid": "e841cfeb02545ae1278dc214afb2886d", "score": "0.76099956", "text": "get name() {\n return vn;\n }", "title": "" }, { "docid": "b1843c6cf228f4042edfc685f8a3f696", "score": "0.7585727", "text": "_$name() {\n super._$name();\n this._value.name = this._node.key.name;\n }", "title": "" }, { "docid": "8ca7c9f943115d694b0955effe94b57e", "score": "0.7524142", "text": "set name(value) {}", "title": "" }, { "docid": "8ca7c9f943115d694b0955effe94b57e", "score": "0.7524142", "text": "set name(value) {}", "title": "" }, { "docid": "8ca7c9f943115d694b0955effe94b57e", "score": "0.7524142", "text": "set name(value) {}", "title": "" }, { "docid": "8ca7c9f943115d694b0955effe94b57e", "score": "0.7524142", "text": "set name(value) {}", "title": "" }, { "docid": "8ca7c9f943115d694b0955effe94b57e", "score": "0.7524142", "text": "set name(value) {}", "title": "" }, { "docid": "6c86ae750cfaa0f4262ca296b2f6502c", "score": "0.75125897", "text": "getName(){\r\n return this.name;\r\n }", "title": "" }, { "docid": "368b97daa9c682ab1f7759a373b5c8e1", "score": "0.74944496", "text": "get name() {\n if (this.customName) {\n return this.customName;\n }\n\n return this.originalName;\n }", "title": "" }, { "docid": "dd8b0a1640a87bed16f6ab2ec5d3f2b6", "score": "0.74917877", "text": "set name(value) {\n this.request(`${this.prefix}set_name`, [this, value]);\n }", "title": "" }, { "docid": "43da943ee205ff6a5b1f4c00ded8af4f", "score": "0.7481502", "text": "setName(name){\n this.mName = name;\n }", "title": "" }, { "docid": "9cad9d93749cc89afac3f984ccc10bfe", "score": "0.7469406", "text": "static get name() {\n\n return null;\n }", "title": "" }, { "docid": "eae1ceb8dc6111c695984235b8614c9e", "score": "0.7434091", "text": "function setName(val){\n\tthis.name = val;\n\tupdateNameText();\n}", "title": "" }, { "docid": "b9e649cd683f15ca6d5352af891b2a8c", "score": "0.742237", "text": "get Name() {\n return this.data['name'];\n }", "title": "" }, { "docid": "f68968b20ab976b75d1cdbff98ae603b", "score": "0.7419876", "text": "getName() {\n return this.name;\n }", "title": "" }, { "docid": "f68968b20ab976b75d1cdbff98ae603b", "score": "0.7419876", "text": "getName() {\n return this.name;\n }", "title": "" }, { "docid": "f68968b20ab976b75d1cdbff98ae603b", "score": "0.7419876", "text": "getName() {\n return this.name;\n }", "title": "" }, { "docid": "1a5a3788a623dcfd7aa121aaadcd2a04", "score": "0.7419153", "text": "getName() {\n return this.name_;\n }", "title": "" }, { "docid": "6b5e7f7c52f9087dd2ef270b5e46c6e4", "score": "0.74160296", "text": "function getName() {\n return this.name;\n}", "title": "" }, { "docid": "2db8a3fb6fa7df748b646e64b3d4789f", "score": "0.7414297", "text": "set name(value) { // set palabra reservada . NAME: nombre asignado sin el #.VALUE : valor q es evaluar\n this.#name =value;\n }", "title": "" } ]
9423e6eab0a3a44b9949117a385ca12f
Filter, Link, and Pack
[ { "docid": "317509b50c0f0dcd2fbc29414817fc7e", "score": "0.627289", "text": "function filterLinkPack (input, start, end, groupLeaders) {\n\t\tvar i,\n\t\t\tinputZones = input.zones,\n\t\t\toutputZones = [],\n\t\t\toutput;\n\n\t\tfor (i = 0; i < inputZones.length; i++) {\n\t\t\toutputZones[i] = filterYears(inputZones[i], start, end);\n\t\t}\n\n\t\toutput = createLinks({\n\t\t\tzones : outputZones,\n\t\t\tlinks : input.links.slice(),\n\t\t\tversion : input.version\n\t\t}, groupLeaders);\n\n\t\tfor (i = 0; i < output.zones.length; i++) {\n\t\t\toutput.zones[i] = pack(output.zones[i]);\n\t\t}\n\n\t\toutput.countries = input.countries ? input.countries.map(function (unpacked) {\n\t\t\treturn packCountry(unpacked);\n\t\t}) : [];\n\n\t\treturn output;\n\t}", "title": "" } ]
[ { "docid": "e9fdb9c0242cb5406d8011c186ce3809", "score": "0.5480046", "text": "function filterHandler() {}", "title": "" }, { "docid": "e3ae8dc3c8154a4514b0e98ed8811e35", "score": "0.53932357", "text": "processData() {\n var filters = /** @type {Array<!FilterEntry>} */ (this.getData());\n\n var matched = {};\n var unmatched = [];\n var matchedCount = 0;\n\n for (var i = 0, ii = filters.length; i < ii; i++) {\n var filter = filters[i];\n var filterTitle = filter.getTitle();\n var typeOrFilterKey = filter.getType();\n var tooltip = this.getFilterTooltip(filter);\n var icons;\n var layerTitle;\n var filterModel;\n var layerModel;\n\n if (this.layerId) {\n // if we have a layer ID, we were passed some context from a filter window, so use it\n var impliedFilterable = getFilterableByType(this.layerId);\n var columns = this.getFilterColumnsFromFilterable(impliedFilterable);\n\n if (impliedFilterable && columns && (this.ignoreColumns || filter.matches(columns))) {\n // this filter matches the columns of the passed in context, so add it as such\n var clone = filter.clone();\n if (!this.keepId) {\n clone.setId(getRandomString());\n }\n clone.setType(this.layerId);\n\n filterModel = this.getFilterModel(filterTitle, clone, tooltip);\n\n if (matched[this.layerId]) {\n // add to the existing layer item\n matched[this.layerId]['filterModels'].push(filterModel);\n } else {\n // define a new layer item\n icons = this.getIconsFromFilterable(impliedFilterable);\n layerTitle = this.getTitleFromFilterable(impliedFilterable, this.layerId);\n layerModel = this.getLayerModel(layerTitle, icons, clone.getMatch(), filterModel);\n matched[this.layerId] = layerModel;\n }\n\n matchedCount = FilterImporter.getFilterCount(filterModel, matchedCount);\n }\n } else {\n var filterableTypes = getFilterableTypes(typeOrFilterKey);\n var filterables = filterableTypes.map(getFilterableByType);\n\n filterables.forEach(function(filterable) {\n if (filterable) {\n // we matched it by filter key, so clone the filter and set the internal filterable ID as its type\n var clone = filter.clone();\n var type = filterable.getFilterableTypes()[0];\n clone.setId(getRandomString());\n clone.setType(type);\n\n filterModel = this.getFilterModel(filterTitle, clone, tooltip);\n\n if (matched[type]) {\n matched[type]['filterModels'].push(filterModel);\n } else {\n icons = this.getIconsFromFilterable(filterable);\n layerTitle = this.getTitleFromFilterable(filterable, type);\n layerModel = this.getLayerModel(layerTitle, icons, clone.getMatch(), filterModel);\n matched[type] = layerModel;\n }\n\n matchedCount = FilterImporter.getFilterCount(filterModel, matchedCount);\n }\n }, this);\n\n // always allow the user to try to assign the filter to other layers\n var readableType = filterables[0] ? filterables[0].getTitle() :\n (filterableTypes[0] || typeOrFilterKey).replace(/\\_/g, ' ');\n filterModel = this.getFilterModel(filter.getTitle(), filter, tooltip, readableType, false);\n unmatched.push(filterModel);\n }\n }\n\n // assign all the display values\n this.matched = matched;\n this.unmatched = unmatched;\n this.matchedCount = matchedCount;\n }", "title": "" }, { "docid": "42ce99e1980bd1891ff6429d09e4f28f", "score": "0.53735584", "text": "function filterLink() {\n $('.filter--link__target').click(function() {\n var heightlink = $('.filter__title-bar').outerHeight(true);\n var heightfilter = $('.filter--link').outerHeight(true);\n\n var idlink = $(this).attr('href');\n var idsplit = idlink.split(\"#\");\n var idblock = idsplit[1];\n\n var topblock = $('#' + idblock).offset().top;\n var toprespon = topblock - heightfilter + heightlink;\n\n if (heightlink == 0) {\n toprespon = topblock;\n }\n\n $(\"html, body\").animate({ scrollTop: toprespon }, 500);\n $('.filter').removeClass('filter--open');\n return false;\n });\n }", "title": "" }, { "docid": "beadfb020103c746aa129595a264d297", "score": "0.53616315", "text": "_filterLinks(extraLinks)\n {\n // Map from link types to icons:\n let linkTypes = {\n // Generic types:\n [\"default-icon\"]: \"ppixiv:link\",\n [\"shopping-cart\"]: \"mat:shopping_cart\",\n [\"webpage-link\"]: \"mat:home\",\n [\"commercial\"]: \"mat:paid\",\n\n // Site-specific ones. The distinction is mostly arbitrary, but this tries to\n // use mat:shopping_cart for sites where you purchase something specific, like\n // Booth and Amazon, and mat:paid for other types of paid things, like subscriptions\n // and commissions.\n [\"posts\"]: \"mat:palette\",\n [\"twitter\"]: \"ppixiv:twitter\",\n [\"fanbox\"]: \"mat:paid\",\n [\"request\"]: \"mat:paid\",\n\n [\"booth\"]: \"mat:shopping_cart\",\n\n [\"twitch\"]: \"ppixiv:twitch\",\n [\"contact-link\"]: \"mat:mail\",\n [\"following-link\"]: \"mat:visibility\",\n [\"bookmarks-link\"]: \"mat:star\",\n [\"similar-artists\"]: \"ppixiv:suggestions\",\n [\"mute\"]: \"block\",\n };\n\n // Sort \n let filteredLinks = [];\n let seenLinks = {};\n let seenTypes = {};\n for(let {type, url, label, ...other} of extraLinks)\n {\n if(type == \"separator\")\n {\n filteredLinks.push({ type });\n continue;\n }\n \n // Filter duplicate links.\n if(url && seenLinks[url])\n continue;\n\n seenLinks[url] = true;\n\n // Filter out entries with invalid URLs.\n if(url)\n {\n try {\n url = new URL(url);\n } catch(e) {\n console.log(\"Couldn't parse profile URL:\", url);\n continue;\n }\n }\n\n // Guess link types that weren't supplied.\n type ??= this._findLinkImageType(url);\n type ??= \"default-icon\";\n\n // A lot of users have links duplicated in their profile and profile text.\n if(seenTypes[type] && type != \"default-icon\" && type != \"shopping-cart\" && type != \"webpage-link\")\n continue;\n\n seenTypes[type] = true;\n\n // Fill in the icon.\n let icon = linkTypes[type];\n\n // If this is a Twitter link, parse out the ID. We do this here so this works\n // both for links in the profile text and the profile itself.\n if(type == \"twitter\")\n {\n let parts = url.pathname.split(\"/\");\n label = parts.length > 1? (\"@\" + parts[1]):\"Twitter\";\n }\n\n filteredLinks.push({ url, type, icon, label, ...other });\n }\n\n // Remove the last entry if it's a separator with nothing to separate.\n if(filteredLinks.length && filteredLinks[filteredLinks.length-1].type == \"separator\")\n filteredLinks.splice(filteredLinks.length-1, 1);\n\n return filteredLinks;\n }", "title": "" }, { "docid": "1c7848ac2e225fe004dea906b80805c9", "score": "0.5342604", "text": "* filter() {\n\t\t\tconst { ctx, service } = this;\n\t\t\tconst { name, address, telphone } = ctx.request.body;\n\t\t\tconst result = yield service.warehouse.filter(name, address, telphone);\n\t\t\tthis.ctx.body = new Transfer(200, result);\n\t\t}", "title": "" }, { "docid": "b35750bc63573986c195c713e3714618", "score": "0.53411865", "text": "function show_filter_act()\n{\n //spliting url part\n\t\n\t//Short namin function\n\tvar FUNC=show_filter_act; \n\t\n\t//var URL CUSTOM STRING\n\tvar url_string='?';\n\t\n\t//Connecting param\n\tvar connect='&';\n\t\n\t//Getting main link\n\tvar url_root=FUNC.arguments[0].split(\"?\");\n\t\t\n\t//Getting Fragment\n\tvar url_id=FUNC.arguments[1].split(\",\"); \n\t\t\n\t//url id length\n\tvar url_id_len=url_id.length;\n\t\n\t\n\t\n\t\n\t//Building parameter list\n\tfor(ui=0;ui<url_id_len;ui++)\n\t{\n var elem=FUNC.arguments[ui+2];\n\t\t\n\t\t\n\t\tvar elem_value=(elem.tagName==\"SELECT\")?elem.options[elem.selectedIndex].value:elem.value;\n\t\t\n\t\t//alert(elem.id+'..'+elem_value);\n\t\t\n if(ui==0)\n\t\turl_string+=url_id[ui]+'='+elem_value;\n\t\telse\n\t\turl_string+=connect+url_id[ui]+'='+elem_value;\n\n\t}\n\n\t\n\t//alert(url_root[0]+'..'+url_string);\n\n \n //Passing for CGI Session\n crypt_url(url_root[0]+url_string);\n\t\n\t\n}", "title": "" }, { "docid": "777ce57a7a044cc885c00dcfd58d821f", "score": "0.53235936", "text": "function BrowserFilterItemBank() {}", "title": "" }, { "docid": "563232d55fd70507ddf5213c22f4c62d", "score": "0.531292", "text": "function mark_filters(response) {\n\t\tif (!response || !response.query || !response.query.abusefilters)\n\t\t\treturn;\n\n\t\tresponse.query.abusefilters.forEach(function(filter) {\n\t\t\tif (links[filter.id] !== undefined)\n\t\t\t\tlinks[filter.id].forEach(function(link) {\n\t\t\t\t\tif (config.show_title)\n\t\t\t\t\t\tlink.title = filter_desc(filter);\n\n\t\t\t\t\t$(link).addClass(filter_classes(filter).join(\" \"));\n\t\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "5750646485824b8082c27bbdf548bf86", "score": "0.5286234", "text": "construct() {\n this.filters = {};\n this._filter_data.forEach(([filterprops, filtercls]) => {\n filterprops.datafilter = this;\n const res = filtercls.append_to(this.content, filterprops);\n dk.on(res, 'change', (...args) => {\n // console.info(\"FILTERCLS:ON:CHANGE\", args);\n const values = this.values();\n // console.info(\"FILTERDATA::::::::::::::::::\", values);\n if (this.data) this.data.set_filter(values);\n this.trigger('filter-change', values);\n });\n this.filters[filterprops.name] = res;\n });\n }", "title": "" }, { "docid": "c6fc2bc7b84cca8fca361cb2bfc5b97b", "score": "0.5281921", "text": "function filterDrinkList() {\n\t\n if (PAGING_TYPE == PAGING_TYPE_CATEGORY) var requestUrl = ROOT_URL + \"drinks/cats\" + CAT_TYPE_ID + \"?startIndex=0\";\n else if (PAGING_TYPE == PAGING_TYPE_ALL) var requestUrl = ROOT_URL + \"drinks?startIndex=0\";\n else if (PAGING_TYPE == PAGING_TYPE_ING) var requestUrl = ROOT_URL + \"drinks/ings\" + ING_TYPE_ID + \"?startIndex=0\";\n\t\n $(\"#list_wrapper\").empty();\n\t\n processDrinks(requestUrl, true);\n\t\n}", "title": "" }, { "docid": "7d8f45823b6ac11cd3316868000a979f", "score": "0.52760285", "text": "doFiltering(fobj) {\n //console.log(\"filtering object\", fobj);\n // if (fobj.type == \"category\") {\n // }\n if (fobj.type == \"wildcard\") {\n this.props.searchMimes(fobj);\n }\n if (fobj.type == \"status\") {\n this.props.statusMimes(fobj);\n }\n }", "title": "" }, { "docid": "4fbccacb2fb3dc5dbad66bf95b169c7f", "score": "0.5255531", "text": "function addFilter(container,filter) {\n\n\n var ie=container.data('ie');\n var ie9=container.data('ie9');\n var opt = container.data('opt');\n if (opt.filterChangeSpeed == undefined) opt.filterChangeSpeed = Math.round(Math.random()*500+100);\n opt.filter=filter;\n var outi=1;\n var ini=1;\n\n\n\n container.find('>.mega-entry').each(function(i) {\n var ent=$(this);\n\n var rot = opt.filterChangeRotate;\n if (rot==undefined) rot=30;\n\n if (rot==99) rot = Math.round(Math.random()*120-60);\n\n ent.removeClass('tp-layout-first-item').removeClass('tp-layout-last-item').removeClass('very-last-item');\n\n var subfilters = filter.split(',');\n var hasfilter =false;\n\n for (var u=0;u<subfilters.length;u++) {\n\n if (ent.hasClass(subfilters[u])) {\n hasfilter=true;\n\n }\n }\n\n\n if (hasfilter || filter==\"*\" ) {\n\n\n ent.removeClass('tp-layout').addClass('tp-notordered');\n } else {\n\n ent.removeClass('tp-ordered').removeClass('tp-layout');\n\n setTimeout(function() {\n\n\n if (opt.filterChangeAnimation==\"fade\") {\n punchgs.TweenLite.to(ent,opt.filterChangeSpeed/1000,{opacity:0,scale:1,rotation:0});\n punchgs.TweenLite.to(ent.find('.mega-entry-innerwrap'),opt.filterChangeSpeed/1000,{scale:1,opacity:1,transformPerspecitve:300,rotationX:0,ease:punchgs.Power3.easeOut});\n }\n else\n if (opt.filterChangeAnimation==\"scale\") {\n punchgs.TweenLite.to(ent,opt.filterChangeSpeed/1000,{opacity:0,scale:1,rotation:0});\n punchgs.TweenLite.to(ent.find('.mega-entry-innerwrap'),opt.filterChangeSpeed/1000,{scale:1,opacity:1,transformPerspecitve:300,rotationX:0,ease:punchgs.Power3.easeOut});\n\n }\n else\n if (opt.filterChangeAnimation==\"rotate\") {\n punchgs.TweenLite.to(ent,opt.filterChangeSpeed/1000,{opacity:0,scale:1,rotation:rot});\n punchgs.TweenLite.to(ent.find('.mega-entry-innerwrap'),opt.filterChangeSpeed/1000,{scale:1,opacity:1,transformPerspecitve:300,rotationX:0,ease:punchgs.Power3.easeOut});\n\n }\n else\n if (opt.filterChangeAnimation==\"rotatescale\") {\n\n punchgs.TweenLite.to(ent,opt.filterChangeSpeed/1000,{opacity:0,scale:opt.filterChangeScale,rotation:rot,ease:punchgs.Power3.easeOut});\n punchgs.TweenLite.to(ent.find('.mega-entry-innerwrap'),opt.filterChangeSpeed/1000,{scale:1,opacity:1,transformPerspecitve:300,rotationX:0,ease:punchgs.Power3.easeOut});\n\n } else\n if (opt.filterChangeAnimation==\"pagetop\" || opt.filterChangeAnimation==\"pagebottom\" || opt.filterChangeAnimation==\"pagemiddle\") {\n\n\n var torig = \"center center\";\n if (opt.filterChangeAnimation == \"pagebottom\") torig = \"center bottom\";\n if (opt.filterChangeAnimation == \"pagetop\") torig = \"center top\";\n\n punchgs.TweenLite.to(ent,opt.filterChangeSpeed/1000,{opacity:0});\n punchgs.TweenLite.to(ent.find('.mega-entry-innerwrap'),opt.filterChangeSpeed/1000,{scale:1,opacity:0,transformOrigin:torig,transformPerspecitve:1000,rotationX:90,ease:punchgs.Power3.easeOut,overwrite:\"all\"});\n }\n\n\n setTimeout(function() {\tent.css({visibility:'hidden'})},opt.filterChangeSpeed);\n\n },ini*opt.delay/2);\n ini++;\n\n }\n\n\n\n });\n\n\n\n }", "title": "" }, { "docid": "e1f748f30cfddded15a1e3b260b61a78", "score": "0.518529", "text": "function filterPinsByBtn(a){// If active filter is clicked, don't do anything\n$(a).hasClass(\"active\")||(// Otherwise, update filter buttons and filter the pins\n$(\".filter-btn.active\").removeClass(\"active\"),$(a).addClass(\"active\"),$(\".pins\").isotope({filter:$(a).data(\"filter\")}))}// Filter pins by link-click", "title": "" }, { "docid": "9f9d70abdda38cadf7bba009dbe1788f", "score": "0.5173811", "text": "registerFilteringListeners () {\n this.filterLinks.addEventListener('click', this.filterResults)\n }", "title": "" }, { "docid": "8053b8ef8609a9ed20939b7e46383344", "score": "0.51583415", "text": "linkFilters() {\n let tf = this.tf;\n if (!tf.linkedFilters || !tf.activeFilterId) {\n return;\n }\n\n this.refreshAll();\n }", "title": "" }, { "docid": "b241e7f3bc9b76030a68ba69208fe25c", "score": "0.50870043", "text": "function ProcessFilters()\n{\nvar doit = false\n\n // execute the synthesized action name, for prints & gifs only\n\n\tif (Filter1Name.search(\"None\") != 0) doit = true;\n\tif (Filter2Name.search(\"None\") != 0) doit = true;\n\tif (Filter3Name.search(\"None\") != 0) doit = true;\n\n // do this only if there is a filter selected.\n\n\tif (doit) {\n\n\t // on a print, if there is a filter, merge the separation and green layers, \n\t // rename it 'filtered' to maintained the layer stack.\n\n if (processMode == PRT_PRINT) {\n\n\t\t doAction(\"JS:Filter:Setup\",\"Onsite.Printing\");\n\t\t _applyFilters();\n\n\t }\n\n // GIFs have the separation layers named s1,s2,s3,s4, so we have to handle the individually\n\n\t if (processMode == PRT_GIF) {\n\t\t\n\t\t// current layer will be s1,s2,s3, or s4 on each call. Coming back each layer will\n\t\t// be renamed s1,s2,s3 and s4 respectively to maintain the layer stack.\n\n\t\t doAction(\"JS:Select s1\",\"Onsite.Printing\");\n\t\t _applyFilters();\n\t\t doAction(\"JS:Filter:Rename-s1\",\"Onsite.Printing\"); // rename it s1\n\n\t\t doAction(\"JS:Select s2\",\"Onsite.Printing\");\n\t\t _applyFilters();\n\t\t doAction(\"JS:Filter:Rename-s2\",\"Onsite.Printing\"); // rename the layer s2\n\n\t\t doAction(\"JS:Select s3\",\"Onsite.Printing\");\n\t\t _applyFilters();\n\t\t doAction(\"JS:Filter:Rename-s3\",\"Onsite.Printing\");\n\n\t\t doAction(\"JS:Select s4\",\"Onsite.Printing\");\n\t\t _applyFilters();\n\t\t doAction(\"JS:Filter:Rename-s4\",\"Onsite.Printing\");\n\n\t }\n\t}\n\n // doAction(\"JS:Stop\",\"Onsite.Printing\"); // for debugging of filters\n\n return TRUE;\n}", "title": "" }, { "docid": "0cc8d878588679cc6d6e9ddd1c18361a", "score": "0.5076644", "text": "function configureFilter() {\n // change URL after clicking the button with query\n var filter = $(this).attr(\"data-show\");\n var param = \"\";\n if (filter === \"search\") {\n param = \"?s=\" + $(\"#search-text\").val();\n } else if (\n filter !== \"visi\" &&\n filter !== \"naujausi\" &&\n filter !== \"geriausi\" &&\n filter !== \"atsitiktinis\"\n ) {\n param = \"?tema=\" + filter;\n $(\"#search-text\").val(\"\");\n } else {\n param = \"?rodyti=\" + filter;\n $(\"#search-text\").val(\"\");\n }\n\n if (history.pushState) {\n var newurl =\n window.location.protocol +\n \"//\" +\n window.location.host +\n window.location.pathname +\n param;\n window.history.pushState(\"\", \"\", newurl);\n }\n\n // generate data\n loadData();\n\n // add active class to button\n $(\"button[data-show], a[data-show]\").removeClass(\"active\");\n $(this).addClass(\"active\");\n\n $(\"#ip-alert\").addClass(\"hidden\");\n}", "title": "" }, { "docid": "0a6ffa9908f49ba97a684155820b2b8b", "score": "0.50762707", "text": "function summarizeFilter(rule) {\n rule.inPort = inport(rule.Filters);\n}", "title": "" }, { "docid": "d0e38260289b6bdac5ac357d3bfef6a0", "score": "0.50757504", "text": "function doFilter() {\n\t\t$(document).on('click','#button-filter',function() {\n\t\t\tlocation = getOcFilterUrl();\n\t\t});\n\t\t$(document).on('click', '.filter__clear', function(e) {\n\t\t\tlocation = $('input[name=\\'fix_filter_action\\']').val();\n\t\t});\t\t\n\t}", "title": "" }, { "docid": "6fa3859727c96c9f937c195b686765ea", "score": "0.50744057", "text": "function ws_products_createFilter(filterObj) {\n\n var $ = jQuery;\n var $prevFilter = false;\n\n // reset cookie used for email request form every time\n ws_products_setCookie('filterEmailRequest', '');\n \n if(ws_products_getCookie('filter') != '') {\n $prevFilter = $.parseJSON(ws_products_getCookie('filter'));\n if($prevFilter.hasOwnProperty(parseInt($selectedCategory))) {\n $.each($prevFilter[parseInt($selectedCategory)], function ($key, $value) {\n if ($key !== 'active' && $prevFilter[parseInt($selectedCategory)]['active'] && $key !== 'Length') {\n ws_products_getNewLinks($key);\n ws_products_createSlider($('#filter-' + parseInt($key)), filterObj, $value, $prevFilter[parseInt($selectedCategory)]['Length']);\n }\n });\n }\n }\n\n $('.wsProducts.productFilterIcon').each(function() {\n $(this).click(function() {\n ws_products_getNewLinks($(this).attr('data-appid'));\n ws_products_createSlider($(this), filterObj, false, false);\n });\n });\n}", "title": "" }, { "docid": "b97b3f89ee57090c15d0b90641332333", "score": "0.5074136", "text": "filter(result) {\n let final = [];\n result.map(e => {\n if(e.urlToImage !==null && e.urlToImage.startsWith('https://') && e.content !==null && e.title !==null && e.description !==null && e.source.name !==null) {\n final.push(e);\n }\n });\n return final\n }", "title": "" }, { "docid": "628eaa749d3f99cfbc70137e1c911840", "score": "0.5070928", "text": "function setupApplyFilter() {\n\n if ($('div[id*=newsProgress]').hasClass('hide')) {\n $('div[id*=newsProgress]').css('display', 'none');\n }\n\n $('input[id*=filterNews]').die();\n $('input[id*=filterNews]').live('click', function () {\n $('div.mainSection div.travelnews').css('display', 'none');\n $('div[id*=newsProgress]').css('display', 'block');\n });\n}", "title": "" }, { "docid": "fcaeff84254ebe35e859766619408c24", "score": "0.50257677", "text": "function filterLinks(obj) {\n let MetchLink = []\n if (filterLink.map(function (e) { return e.target.data.userId === undefined ? [] : e.target.data.userId; })\n .indexOf(obj.target.data.userId === undefined ? [] : obj.target.data.userId) === -1) {\n filterLink.push(obj);\n } else {\n noneFilterLink.push(obj);\n noneFilterLink.forEach(function (datatwo) {\n filterLink.forEach(function (dataone) {\n if (dataone.target.data.userId !== undefined && (dataone.target.data.userId) === datatwo.target.data.userId) {\n MetchLink.push(dataone)\n }\n })\n });\n for (let index = 0; index < noneFilterLink.length; index++) {\n links.push(\n {\n source: MetchLink[index].target,\n target: noneFilterLink[index].target,\n index: i\n }\n )\n }\n }\n }", "title": "" }, { "docid": "ffab8a5f076f0ab9ba72c0dbfb3e602e", "score": "0.501599", "text": "function filter(){\n \n}", "title": "" }, { "docid": "ed16f83a8e0556c28980288b7c4a0f92", "score": "0.49853846", "text": "function fil_processFilters(bDisplayList) {\n\n //DEBUG\n //inf_displayInfo(\"Processing Filter Selections...\");\n\n var strFilters = fil_getFiltersString();\n\n //Don't update the navigation if we are adding/editing an article.\n if (iMapType == iAddMap) {\n return;\n }\n\n\n //When the page is initially building, the map object\n //may not yet exist, so only update the map if it's available.\n if (map) {\n ajx_getMapData(strFilters);\n }\n\n //Update the Index\n //nav_getNavData(strFilterID);\n\n //Reset Page Number\n gintResultsPageNumber = 1;\n\n //Update the Results List with all filters\n nav_getList(strFilters, gintResultsPageNumber, bDisplayList);\n\n}", "title": "" }, { "docid": "9425906138a7326177152b6a93c8ec3f", "score": "0.49821714", "text": "processLinks()\n {\n var myLinks = this.myRoom.getRoomObjects(ROOM_OBJECT_TYPE.link).reverse();\n if (myLinks.length == 0 ) return;\n\n var myProviders = _.filter(myLinks, (a) => { return a.isProvider()});\n var myReceivers = _.filter(myLinks, (a) => { return a.isReceiver()});\n\n _.forEach(myProviders, (aProvider) =>\n {\n _.forEach(myReceivers, (aReceiver) =>\n {\n if (aProvider.cooldown == 0 && aProvider.energy == aProvider.energyCapacity && aReceiver.energy == 0)\n {\n var result = aProvider.transferEnergy(aReceiver);\n logDEBUG('LINKS: provider link ['+aProvider.pos.x+' '+aProvider.pos.y+'] transfers energy to ['+aReceiver.pos.x+' '+aReceiver.pos.y+'] ... '+ErrorSting(result));\n }\n })\n });\n }", "title": "" }, { "docid": "e4233ef4eb30c6e5b52a6c0e513922da", "score": "0.49819753", "text": "static filter(filterObject) {\n return fetch(`${REACT_APP_API_URL}/parks/filter`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(filterObject)\n }).then(res => res.json())\n }", "title": "" }, { "docid": "46fd6ac0cd5e5c2d04a81d5273ce2b79", "score": "0.49731714", "text": "function FilterTest() {}", "title": "" }, { "docid": "31731c2e0f3e38c944cbc465ae646434", "score": "0.49547794", "text": "function BrowserFilterItem() {}", "title": "" }, { "docid": "3007e6b49756124613ba7dfa92148de9", "score": "0.49539307", "text": "_updateFilters() {\n const filters = this._parseHash();\n\n console.info(filters);\n\n if (filters.category) this.categoryTarget.value = filters.category;\n if (filters.year) this.yearTarget.value = filters.year;\n if (filters.location) this.locationTarget.value = filters.location;\n }", "title": "" }, { "docid": "015f5820d31d3bf1db74b34e25d7589f", "score": "0.49495214", "text": "filterFeed(selectedSource) {\n console.log('im in filterFeed!');\n this.rootService.filterBySource(selectedSource)\n .then(res => {\n this.items = Object.assign({}, res);; // update this.items which player.component watching\n console.log(this.items);\n });\n }", "title": "" }, { "docid": "c7ffceb11a37f206ec6e10b23e7a9247", "score": "0.4938041", "text": "function BridgeLayout(graph, filtered, bridge, store) {\n this.graph = graph;\n this.filtered = filtered;\n this.bridge = bridge;\n this.store = store;\n this.compute();\n }", "title": "" }, { "docid": "eee1d4c5570b7f940da481eb87ea4f87", "score": "0.49315694", "text": "function addSortFilterListeners() {\n\n /* Remove filter when clicking remove filter button */\n $('button.remove-filters').on('click', (e) => {\n // prevent the default link click action\n e.preventDefault();\n\n // Get the current url\n let currentUrl = new URL(window.location);\n\n // Delete the filter params from the url\n currentUrl.searchParams.delete(\"stock\");\n currentUrl.searchParams.delete(\"category\");\n currentUrl.searchParams.delete(\"genre\");\n currentUrl.searchParams.delete(\"product_line\");\n currentUrl.searchParams.delete(\"publisher\");\n currentUrl.searchParams.delete(\"reduced_reason\");\n\n // Load the updated url\n window.location.replace(currentUrl);\n });\n\n /* Get filter values from the data-filters property of the apply button */\n const getFilters = () => {\n let filters = [\n {\n value: $('#applyFilters').attr('data-product-line-filters'),\n param: 'product_line'\n },\n {\n value: $('#applyFilters').attr('data-genre-filters'),\n param: 'genre'\n },\n {\n value: $('#applyFilters').attr('data-publisher-filters'),\n param: 'publisher'\n },\n {\n value: $('#applyFilters').attr('data-category-filters'),\n param: 'category'\n },\n {\n value: $('#applyFilters').attr('data-stock-filters'),\n param: 'stock'\n },\n {\n value: $('#applyFilters').attr('data-reduced-reason-filters'),\n param: 'reduced_reason'\n }\n ];\n\n return filters;\n };\n\n /* Set apply-filters button enabled/disabled */\n const setApplyFiltersButtonState = (enabled) => {\n // If enabled is true, remove the disabled class from .apply-filters\n // buttons\n if (enabled === true) {\n $('.apply-filters').removeClass('disabled');\n return;\n }\n\n // Add the disabled class to .apply-filters buttons\n $('.apply-filters').addClass('disabled');\n };\n\n /* Check for unapplied filter values. Returns true if there are */\n /* unapplied filters, otherwise false. */\n const checkFilters = () => {\n // Get filter values from the data-filters property of the apply button\n let filters = getFilters();\n\n // Get the current url\n let currentUrl = new URL(window.location);\n\n // Set a variable to indicate whether any filters are unapplied\n let unapplied = false;\n\n // Iterate over the filters array, comparing each filter value against\n // the same filter in the currentUrl. If any do not match, set\n // unapplied = true.\n filters.forEach((filter) => {\n // Get the applied filter value from the url\n let appliedFilter = currentUrl.searchParams.get(filter.param);\n // Get the current filter from the filters array\n let currentFilter = filter.value;\n\n // If we have not yet found an unapplied filter\n if (unapplied === false) {\n // If the url filter value is not null, has a value length > 0\n // and the current filter has a length > 0\n if (appliedFilter !== null &&\n appliedFilter.length > 0 && currentFilter.length > 0) {\n\n // Convert both filter values into arrays, alphabetically\n // sort them, then turn them back into strings\n appliedFilter = currentUrl.searchParams.get(filter.param).\n split(',').\n sort().\n toString();\n currentFilter = filter.value.split(',').\n sort().\n toString();\n\n // If the strings do not match after sorting then we have\n // unapplied filters. Set unapplied to true and return.\n if (appliedFilter !== currentFilter) {\n unapplied = true;\n }\n return;\n }\n\n // if the url filter does not exist but the current filter does\n // then set unapplied to true and return.\n if (appliedFilter === null && currentFilter.length > 0) {\n unapplied = true;\n return;\n }\n\n // If the url filter exists, but the length does not match the\n // length of the current filter (which should be 0 at this\n // point), set unapplied to true.\n if (appliedFilter !== null &&\n appliedFilter.length !== currentFilter.length) {\n unapplied = true;\n }\n }\n });\n\n return unapplied;\n };\n\n /* Get filter type from a filter checkbox/link element */\n const getFilterType = (elem) => {\n let elemType = 'link';\n if ($(elem).attr('type') === 'checkbox') {\n elemType = 'checkbox';\n }\n\n // Get the current filter type\n let filterType = 'category';\n let param;\n if ($(elem).hasClass(`genre-filter-${elemType}`)) {\n filterType = 'genre';\n } else if ($(elem).hasClass(`publisher-filter-${elemType}`)) {\n filterType = 'publisher';\n } else if ($(elem).hasClass(`stock-filter-${elemType}`)) {\n filterType = 'stock';\n } else if ($(elem).hasClass(`product-line-filter-${elemType}`)) {\n filterType = 'product-line';\n param = 'product_line';\n } else if ($(elem).hasClass(`reduced-reason-filter-${elemType}`)) {\n filterType = 'reduced-reason';\n param = 'reduced_reason';\n }\n\n if (param === undefined) {\n param = filterType;\n }\n // return the filter type\n return {\n type: filterType,\n param\n };\n };\n\n /* Add/update/remove filters to/from apply-filters button data attributes */\n /* Called when changing the state of a filter checkbox */\n const setFilterValue = (elem) => {\n // Get the checked state of the checkbox\n let isChecked = $(elem).prop('checked');\n\n // Get the filter value of the checkbox\n let filterVal = $(elem).attr('data-filter-value');\n\n // Set the checked state of any checkbox elements with the same\n // filterVal to match this element\n let pairedElems = $(`[type=checkbox][data-filter-value=${filterVal}]`);\n $(pairedElems).each((i, pElem) => {\n if (pElem !== elem && $(pElem).prop('checked') !== isChecked) {\n $(pElem).prop('checked', isChecked);\n }\n });\n\n // Get the current filter type\n let filterType = getFilterType(elem);\n\n // Get the stored filter values from the apply button\n let currentVals = $('#applyFilters').\n attr(`data-${filterType.type}-filters`);\n if (!currentVals) {\n currentVals = '';\n }\n currentVals = currentVals.split(',');\n\n // Locate the filterVal in the list of currentVals\n let filterValIndex = currentVals.indexOf(filterVal);\n\n // If the checkbox is checked and the filterVal is not present, add it\n // to the list\n if (isChecked) {\n if (filterValIndex === -1) {\n currentVals.unshift(filterVal);\n }\n }\n\n // If the checkbox is not checked and the filterVal is present, remove\n // it from the list\n if (!isChecked) {\n if (filterValIndex !== -1) {\n currentVals.splice(filterValIndex, 1);\n }\n }\n\n // Convert the list to a comma separated string\n currentVals = currentVals.toString();\n\n // Remove trailing comma if present\n if (currentVals.endsWith(',')) {\n currentVals = currentVals.substr(0, currentVals.length - 1);\n }\n\n // Overwrite the data-<filterType>-filters attribute of the\n // .apply-filters button with the new filter string\n $('#applyFilters').\n attr(`data-${filterType.type}-filters`, currentVals);\n\n setApplyFiltersButtonState(checkFilters());\n };\n\n /* Check/uncheck all child-checks when parent-check is checked/unchecked */\n $('.parent-check').on('click', (e) => {\n // Get the checked state of the parent-check\n let isChecked = $(e.currentTarget).prop('checked');\n\n // Get .child-check inputs\n let childInputs = $(e.currentTarget).parent().\n next().\n find('.child-check');\n\n // Set the checked state of each child-check to match that of the parent\n // and set the filter values appropriately\n $(childInputs).each((i) => {\n let elem = $(childInputs[i]);\n $(elem).prop('checked', isChecked);\n setFilterValue(elem);\n });\n });\n\n /* Check parent-check when any child-check is checked, or uncheck it when */\n /* all child-checks are unchecked */\n $('.child-check').on('click', (e) => {\n // Get child-check checked states\n let childInputs = $(e.currentTarget).parent().\n parent().\n find('.child-check');\n\n // If any child-check is checked set isChecked to true, otherwise it\n // will be false\n let isChecked = false;\n $(childInputs).each((i) => {\n let elem = $(childInputs[i]);\n if (isChecked === false) {\n isChecked = $(elem).prop('checked');\n }\n });\n\n // Get the parent-check element\n let parentInput = $(e.currentTarget).parent().\n parent().\n prev().\n find('.parent-check')[0];\n\n // Set the parent-check checked state === isChecked\n $(parentInput).prop('checked', isChecked);\n\n // Update filter values for the parent-check\n setFilterValue(parentInput);\n });\n\n /* Pass clicked filter checkbox elem to setFilterValue() */\n let filterCheckboxSelector = '.category-filter-checkbox, ' +\n '.genre-filter-checkbox, .publisher-filter-checkbox, ' +\n '.stock-filter-checkbox, .product-line-filter-checkbox, ' +\n '.reduced-reason-filter-checkbox';\n $(filterCheckboxSelector).on('click', (e) => {\n setFilterValue(e.currentTarget);\n });\n\n /* Apply filter when clicking filter links in product card */\n let filterLinkSelector = '.category-filter-link, .stock-filter-link, ' +\n '.product-line-filter-link, .publisher-filter-link, ' +\n '.genre-filter-link, .reduced-reason-filter-link';\n $(filterLinkSelector).on('click', (e) => {\n // prevent the default link click action\n e.preventDefault();\n\n // Get the filter value of the link\n let filterVal = $(e.currentTarget).attr('data-filter-value');\n\n // Get the current filter type\n let filterType = getFilterType(e.currentTarget);\n\n // Get the current url\n let currentUrl = new URL(window.location);\n\n // If there is a filter of this type present, remove it\n currentUrl.searchParams.delete(filterType.param);\n\n // Update the url with the new filter\n currentUrl.searchParams.set(filterType.param, filterVal);\n\n // Load the updated url\n window.location.replace(currentUrl);\n });\n\n /* Update the current url with any unapplied filters, and return the */\n /* updated url */\n const addFiltersToUrl = () => {\n // Get the current url\n let currentUrl = new URL(window.location);\n\n // If there are no filters to apply, return the url\n if (checkFilters() === false) {\n return currentUrl;\n }\n\n // Get the filter values from the data-filters property of the button\n let filters = getFilters();\n\n // Iterate over the filters array\n filters.forEach((filter) => {\n // Remove the existing filter from the url\n currentUrl.searchParams.delete(filter.param);\n // If the filter value exists, update the url\n if (filter.value.length > 0) {\n currentUrl.searchParams.set(filter.param, filter.value);\n }\n });\n\n // Reset to page 1 of the results\n currentUrl.searchParams.delete('page');\n\n return currentUrl;\n };\n\n /* Apply a sort and any unapplied filters when clicking on sort-radio */\n /* inputs */\n $('.sort-radio').on('click', (e) => {\n\n // Get the current url and apply any unapplied filters\n let currentUrl = addFiltersToUrl();\n\n // Get the sort data\n let selectedVal = $(e.currentTarget).attr('value');\n\n // If the reset sort is selected update the url and refresh\n if (selectedVal === 'None_None') {\n // Delete the sort and delete params from the url\n currentUrl.searchParams.delete('sort');\n currentUrl.searchParams.delete('direction');\n\n // Reset the results to page 1\n currentUrl.searchParams.delete('page');\n\n // Load the updated url\n window.location.replace(currentUrl);\n return;\n }\n\n // Not the reset sort, so get the sort value and direction\n let sort = selectedVal.slice(0, selectedVal.lastIndexOf('_'));\n let direction = selectedVal.slice(selectedVal.lastIndexOf('_') + 1);\n\n // Update the url\n currentUrl.searchParams.set('sort', sort);\n currentUrl.searchParams.set('direction', direction);\n\n // Reset the results to page 1\n currentUrl.searchParams.delete('page');\n\n // Load the updated url\n window.location.replace(currentUrl);\n });\n\n /* Apply filters when clicking the apply filters button */\n $('button.apply-filters').on('click', () => {\n // If there are no filters to apply, return\n if (checkFilters() === false) {\n return;\n }\n\n //Update the filters in the current url\n let currentUrl = addFiltersToUrl();\n\n // Load the updated url\n window.location.replace(currentUrl);\n });\n\n /* Get active filters from checkboxes on load, and apply the values to */\n /* the data attributes of the apply filters button */\n const getInitialFilters = () => {\n // Get filter checkbox elements\n let selector = '.category-filter-checkbox[checked], ' +\n '.genre-filter-checkbox[checked], ' +\n '.publisher-filter-checkbox[checked], ' +\n '.stock-filter-checkbox[checked], ' +\n '.product-line-filter-checkbox[checked],' +\n '.reduced-reason-filter-checkbox[checked]';\n let filterCheckboxes = $(selector);\n\n // Create filters object\n let filters = {};\n\n // For each filter object\n $(filterCheckboxes).each((i, elem) => {\n // Get the filter value of the checkbox\n let filterVal = $(elem).attr('data-filter-value');\n\n // Get the filter type\n let filterType = getFilterType(elem);\n\n // If the value for the current type is blank, set the initial\n // value and return\n if (filters[filterType.type] === '' ||\n filters[filterType.type] === undefined) {\n filters[filterType.type] = filterVal;\n return;\n }\n\n // Split the current filter values into an array\n let currentVals = filters[filterType.type].split(',');\n\n // Locate the filterVal in the array of currentVals\n let filterValIndex = currentVals.indexOf(filterVal);\n\n // If the filterVal is not present, add it\n if (filterValIndex === -1) {\n filters[filterType.type] += ',' + filterVal;\n }\n });\n\n // For each filter in the filters array, set the matching filter\n // data attribute value on the #applyFilters button. If any value\n // length is > 0 then we have at least one applied filter, so remove\n // the disabled class from .remove-filters buttons\n Object.entries(filters).forEach(([filter, value]) => {\n $('#applyFilters').\n attr(`data-${filter}-filters`, value);\n if (value.length > 0) {\n $('.remove-filters').removeClass('disabled');\n }\n });\n };\n\n getInitialFilters();\n\n // Invert arrow on filter/sort collapse toggler when clicked\n let filterTogglerSelector = '#filterCollapseToggler, ' +\n '#sortCollapseToggler, #filterCollapseToggler_offcanvas, ' +\n '#sortCollapseToggler_offcanvas';\n initCollapsibleTogglerArrows(filterTogglerSelector);\n\n // Add position-sticky to filter button rows after shown event, and remove\n // it on collapse event (shown fires once the collapsible has finished\n // expanding, collapse fires immediately before the collapsible collapses);\n let filterCollapseSelector = '#filterCollapse, #filterCollapse_offcanvas';\n $(filterCollapseSelector).on('shown.bs.collapse', (e) => {\n $(e.currentTarget).find('.filter-button-row').\n addClass('position-sticky');\n });\n\n $(filterCollapseSelector).on('hide.bs.collapse', (e) => {\n $(e.currentTarget).find('.filter-button-row').\n removeClass('position-sticky');\n });\n}", "title": "" }, { "docid": "c923b6b1f13632e03cfaa32acfad01cb", "score": "0.4929334", "text": "function updateList(selectedFilter) {\n $('.listings').empty();\n if (selectedFilter == 'All'){\n let filteredFeatures = map.querySourceFeatures('composite', {\n sourceLayer: 'soma-pilipinas', \n filter: ['has', 'TYPE'],\n })\n displayResults(filteredFeatures);\n } else {\n let filteredFeatures = map.querySourceFeatures('composite', {\n sourceLayer: 'soma-pilipinas', \n filter: ['==', 'TYPE', selectedFilter],\n })\n displayResults(filteredFeatures);\n };\n}", "title": "" }, { "docid": "2f4c06da84c657ebb3da0199d8707304", "score": "0.49072766", "text": "function initFilters() {\r\n filtersBlock.addEventListener('click', function(event) {\r\n var clickedFilter = event.target;\r\n\r\n if (doesHaveParent(clickedFilter, 'filters-radio')) {\r\n location.hash = 'filters/' + clickedFilter.value;\r\n }\r\n });\r\n window.addEventListener('hashchange', function() {\r\n setActiveFilter(parseURL());\r\n });\r\n }", "title": "" }, { "docid": "e5fe37553821b2e75cc2a58cc1396111", "score": "0.49040562", "text": "function buildURLArray() {\n // Iterate through each filter in the array\n for(var i=0; i<filterarray.length; i++) {\n //Index each item filter in filterarray\n var itemfilter = filterarray[i];\n // Iterate through each parameter in each item filter\n for(var index in itemfilter) {\n // Check to see if the paramter has a value (some don't)\n if (itemfilter[index] !== \"\") {\n if (itemfilter[index] instanceof Array) {\n for(var r=0; r<itemfilter[index].length; r++) {\n var value = itemfilter[index][r];\n urlfilter += \"&itemFilter\\(\" + i + \"\\).\" + index + \"\\(\" + r + \"\\)=\" + value ;\n }\n }\n else {\n urlfilter += \"&itemFilter\\(\" + i + \"\\).\" + index + \"=\" + itemfilter[index];\n }\n }\n }\n }\n} // End buildURLArray() function", "title": "" }, { "docid": "e576b809ccb767f461132c754ae3ac62", "score": "0.48999524", "text": "function compileFilter(csdl) {\n ds.pylon.compile({\n 'csdl': csdl\n }, function(err, response) {\n if (err)\n console.log(err);\n else {\n hash = response.hash;\n console.log(\"Filter hash: \" + hash);\n startRecording();\n }\n });\n}", "title": "" }, { "docid": "da262bcd6dba6b03ccaad606a71be54a", "score": "0.48951265", "text": "function process(response, filter) {\n var xmlData = \"\";\n var req = http.request(options,\n function (res) {\n res.setEncoding('utf8');\n res.on('data', function (chunk) {\n xmlData += chunk;\n });\n res.on('end', function () {\n //console.log(xmlData)\n parseToJSON(response, xmlData, filter); //when XML is ready, pasre to JSON\n });\n });\n req.on('error', function (e) {\n var error = '{statusCode: 500, message: \"Cant reach BBC RSS\"}';\n console.log('problem with request: ' + e.message);\n response.writeHead(500, { 'Content-Type': 'application/json'});\n response.end(JSON.stringify(error));\n });\n req.end();\n}", "title": "" }, { "docid": "8416ce6a9d15233106fec875e514213d", "score": "0.48894957", "text": "function filterFunction($filterButtonContext) {\n // get group key\n var $parentButtonGroup = $filterButtonContext.parents('.c-filter-nav__group');\n var filterGroup = $parentButtonGroup.attr('data-filter-group');\n // set filter for group\n filters[filterGroup] = $filterButtonContext.attr('data-filter');\n // concatenate the filter object into the format required for isotope\n var filterValue = concatValues(filters);\n // set filter for Isotope\n return $grid.isotope({ filter: filterValue });\n }", "title": "" }, { "docid": "7119dfe3d9f264c50f917494cc7a1f8a", "score": "0.48816976", "text": "function fnAdaptBinding(){\n\t\t\tvar aMyFilters = getAllCurrentFilters();\n\t\t\tif (oMaster){\n\t\t\t\toMaster.propagateFilters(aMyFilters);\t\n\t\t\t} else if (aSlaves){ // not suspended\n\t\t\t\tvar oContextFilter = new Filter(aMyFilters.concat(oValidationFilter), false /* filter conjunction OR instead of AND */ );\n\t\t\t\tvar aFilters = [oContextFilter, oPersistentFilter];\n\t\t\t\toItemBinding.filter(aFilters);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "98f086da15b275de83f783bc12d1371d", "score": "0.4880637", "text": "function FilterListFetcher(nameOrUrl, callback) {\n\n // 确定 name/url.\n if ( nameOrUrl.match(/^http/i) ) {\n this.url = nameOrUrl;\n this.name = null;\n for ( var name in filterFiles ) {\n if ( filterFiles[name] == this.url ) {\n this.name = name;\n break;\n }\n }\n if ( this.name == null ) {\n this.name = nameOrUrl;\n }\n }\n else {\n this.name = nameOrUrl;\n this.url = filterFiles[nameOrUrl];\n }\n\n // Accept name as URL if it starts with http\n this.callback = typeof callback === 'function' ? callback : function() {};\n this.xhr = new XMLHttpRequest();\n this.error = false;\n var fetcher = this;\n this.xhr.onreadystatechange = function () {\n if ( this.readyState != 4 ) return;\n if ( this.status == 200 ) {\n // Check if it's actually a filter set and if so, save it along with its expiry information\n var result = this.responseText;\n\n if (result.match(/\\[Adblock/)) {\n\n var expires = DEFAULT_EXPIRATION_INTERVAL;\n if ( /\\bExpires\\s*(?::|after)\\s*(\\d+)\\s*(h)?/i.test(result) ) {\n var interval = parseInt(RegExp.$1);\n if (RegExp.$2)\n interval *= SECONDS_IN_HOUR;\n else\n interval *= SECONDS_IN_DAY;\n\n if (interval > 0)\n expires = interval;\n }\n expires *= MILLISECONDS_IN_SECOND;\n\n localStorage[ fetcher.url ] = JSON.stringify({\n lastDownloaded: Date.now(),\n lastUpdated: Date.now(),\n expires: expires\n /*, text: result*/\n });\n\n /* 在此添加获取处理结果 */\n sogouExplorer.command.contentFilter.writeFullList( fetcher.name, this.responseText );\n\n\n fetcher.callback( fetcher );\n return;\n }\n else if ( result.match(/Maxthon\\sList/i) ) {\n try {\n var rules = result;\n //rules = rules.replace(/,\\s}/g, '}'); // 去掉}之前的最后一个,\n //rules = rules.replace(/,\\s]/g, ']'); // 去掉]之前的最后一个,\n rules = eval( '(' + rules + ')' );\n var expires = DEFAULT_EXPIRATION_INTERVAL;\n var strRules = maxthon.findRules( rules, \"data_1_0\" );\n strRules = maxthon.handleQMark( strRules );\n //console.log(strRules);\n localStorage[ fetcher.url ] = JSON.stringify({\n lastDownloaded: Date.now(),\n lastUpdated: Date.now(),\n expires: expires\n });\n\n sogouExplorer.command.contentFilter.writeFullList( fetcher.name, strRules );\n fetcher.callback( fetcher );\n return;\n }catch(e){\n console.log(e);\n }\n } else {\n fetcher.error = \"您输入的url不是abp filter列表\";\n fetcher.callback(fetcher);\n return;\n }\n }\n else if( this.status == 404 ) {\n fetcher.error = \"Error 404: 在服务器上没有找到列表\";\n localStorage[ fetcher.url ] = JSON.stringify({\n lastUpdated: Date.now(),\n error: fetcher.error\n });\n fetcher.callback( fetcher );\n return;\n }\n else if ( this.status == 503 ) {\n // Most likely a 503 means quota exceeded on the server\n // XXX: We aren't signaling an error here because we don't want to disable checking of this filter list\n }\n // TODO: Doesn't actually do anything in case of other errors\n }\n\n try {\n this.xhr.open( \"GET\", this.url, true );\n this.xhr.send( null );\n }\n catch (e) {\n fetcher.error = \"Useless error message: \" + e;\n fetcher.callback(fetcher);\n }\n}", "title": "" }, { "docid": "531d80e5852a986b475fe5f7578f59ff", "score": "0.48629728", "text": "search(order, owner, lastFilter, sharedWithMe, ckanChecked){\n const { dispatch, properties } = this.props\n \n const queryString = require('query-string');\n const query = queryString.parse(this.props.location.search).q\n\n var orderFilter = ''\n if(order)\n orderFilter = order\n else{\n orderFilter = this.state.filter.order\n }\n \n var filterInt = this.state.filter\n filterInt.order = orderFilter\n\n var dataset = window.location.hash.indexOf('dataset')!==-1\n var org = []\n if(isPublic() && properties.domain!=='dataportal' && properties.domain!=='dataportal-private')\n org.push(properties.organization)\n\n let filter = {\n 'text': dataset?'':query,\n 'index': [],\n 'org': org,\n 'theme':[],\n 'date': this.state.filter.da && this.state.filter.a ? this.state.filter.da.locale('it').format(\"YYYY-MM-DD\")+ ' ' +this.state.filter.a.locale('it').format(\"YYYY-MM-DD\") : '',\n 'status': [],\n 'order': orderFilter,\n 'owner': owner,\n 'sharedWithMe': sharedWithMe\n }\n\n if(!lastFilter){\n if(this.state.filter.elements && this.state.filter.elements.length>0){\n this.state.filter.elements.map((fi, index) => {\n switch(fi.type){\n case 0:\n filter.index.push(fi.value)\n break;\n case 1:\n filter.theme.push(fi.value)\n break;\n case 2:\n filter.status.push(fi.value)\n break;\n case 3:\n filter.org.push(fi.value)\n break;\n \n }\n })\n }\n }\n\n \n if(dataset){\n if(filter.index.length===0){\n if(ckanChecked===false){\n filter.index = ['catalog_test']\n }else if(ckanChecked===true){\n filter.index = ['catalog_test', 'ext_opendata']\n }\n }\n dispatch(search('', filter, isPublic(), filterInt))\n }else{\n if(filter.index.indexOf('catalog_test')>-1 && ckanChecked===true){\n filter.index.push('ext_opendata')\n }else if(filter.index.length===0 && ckanChecked===false){\n filter.index = ['catalog_test', 'dashboards', 'stories']\n }\n dispatch(search(query, filter, isPublic(), filterInt))\n .catch((error) => {\n this.setState({\n isFetching: false\n })\n })\n }\n }", "title": "" }, { "docid": "48292ac7263535f6d09aae9a7e9a4b50", "score": "0.4862154", "text": "function sortingCharityGallery() {\r\n if ($(\".charity-gallery .gallery-filters\").length) {\r\n var $container = $('.gallery-container');\r\n $container.isotope({\r\n filter:'*',\r\n animationOptions: {\r\n duration: 750,\r\n easing: 'linear',\r\n queue: false,\r\n }\r\n });\r\n\r\n $(\".gallery-filters li a\").on(\"click\", function() {\r\n $('.gallery-filters li .current').removeClass('current');\r\n $(this).addClass('current');\r\n var selector = $(this).attr('data-filter');\r\n $container.isotope({\r\n filter:selector,\r\n animationOptions: {\r\n duration: 750,\r\n easing: 'linear',\r\n queue: false,\r\n }\r\n });\r\n return false;\r\n });\r\n }\r\n }", "title": "" }, { "docid": "3771128c3476731d6f00b280e3d73d11", "score": "0.48611045", "text": "runFilter() {\n if ( this.findCache(this.lookup_name) ) {\n return;\n }\n\n this.loading = true;\n\n if ( !this.lookup_name ) {\n this.list = this.items;\n } else {\n this.list = this.items.filter(this.filter_function);\n this.cache[this.lookup_name] = this.list;\n }\n\n this.loading = false;\n }", "title": "" }, { "docid": "291d3e427efcc9a29f5b5e76a82ed472", "score": "0.48544395", "text": "function constructFilter(filter) {\n filter.addClass('article-select--hidden');\n filter.wrap('<div class=\"article-select\"></div>');\n filter.after('<div class=\"article-select--styled\"></div>');\n }", "title": "" }, { "docid": "c871ce4436f24f64d50e430b504dc715", "score": "0.4847928", "text": "function exposeListFilter(filter) {\n // add filter that already exist in URL to current filter, so they don't get lost\n var currentUrlParams = getUrlParameters();\n // if currentUrlParams are undefined create new object\n if (currentUrlParams === undefined) currentUrlParams = {};\n // remove undefined filters and add new filter to currentUrlParams or update exisiting ones\n for (var key in filter) {\n if (filter.hasOwnProperty(key)) {\n if (filter[key] === undefined) {\n // also delete in currentUrlParams if it exists there\n if (currentUrlParams.hasOwnProperty(key)) {\n delete currentUrlParams[key];\n }\n delete filter[key];\n } else {\n currentUrlParams[key] = filter[key];\n }\n }\n }\n\n // expose filter in URL\n var URL;\n if ($.isEmptyObject(currentUrlParams)) {\n URL = window.location.href.substring(0, window.location.href.indexOf(\"#\"));\n } else if (window.location.href.includes(\"#\")) {\n URL = window.location.href.substring(0, window.location.href.indexOf(\"#\") + 1);\n } else {\n URL = window.location.href.substring(0, window.location.href.indexOf(\"#\")) + \"#\";\n }\n history.pushState(null, \"\", URL + $.param(currentUrlParams));\n handleRequest(getUrlParameters());\n }", "title": "" }, { "docid": "c65da686ac85edcbdbe83588a8c53c44", "score": "0.4840794", "text": "function filterProductType() {\n $('.product.filterLink').on('click', function(){\n var category = this.getAttribute('data-id');\n filter = doc.documents.filter(function(item) {\n return item.productType == category;\n });\n filteredProducts(filter);\n});\n}", "title": "" }, { "docid": "c858370ada0f151eac3e5fb092f180a4", "score": "0.48406985", "text": "function ajaxFilterComponents(phpFile, categoria, filter){\n \n //TODO\n ajaxBrandFilter(phpFile, categoria, filter);\n ajaxCategoryFilter(phpFile, categoria, filter);\n ajaxBuyModeFilter(phpFile, categoria, filter);\n ajaxShowOnlyFilter(phpFile, categoria, filter); \n ajaxMaxPriceFilter(phpFile, categoria, filter);\n \n}", "title": "" }, { "docid": "8e7b5e3bc931644388a9ff73316fe70d", "score": "0.48381808", "text": "function filterByViewPort() {\n\n clearLayerSource(filterLayerVector);\n\n mapObj.cql = \"INTERSECTS(\" + geomField + \",\" + convertToWktPolygon(getMapBbox()) + \")\";\n\n // Update the image cards in the list via spatial bounds\n wfsService.updateSpatialFilter(mapObj.cql);\n //this.updateFootPrintLayer(mapObj.cql);\n //updateFootPrints(mapObj.cql);\n\n }", "title": "" }, { "docid": "135a62a0a736ee542d2bb0ef130074ff", "score": "0.48365894", "text": "function FilterBase(){\n\n }", "title": "" }, { "docid": "6be54e1241004a81232ab0e43f53c7a1", "score": "0.4832854", "text": "function addKenmerkFilter() {\n\tif($(\".kenmerken_container .ztAjaxTable\").length) {\t\n\t\t$(\".kenmerken_container a.add.ztAjaxTable_add.float\").click();\n\t} else {\n\t\tupdateSearchFilters(\"action=show_kenmerken_filters\");\n\t}\n\tveldoptie_handling();\n}", "title": "" }, { "docid": "6b5f238fc70fc56b3be1a104005f7f25", "score": "0.48320258", "text": "function changeFilter(content) {\n filter = content;\n $('#billList').empty();\n start = 1;\n getTransactions(start, start + 7);\n start += 8;\n }", "title": "" }, { "docid": "12f0c2db6b7a311cfb3d8782ec844a06", "score": "0.48237234", "text": "applyFilter({ commit, state, dispatch, getters }) {\n //reset pagination\n commit('setPaginationPage', 1);\n //take all filters and change path to new path with new filters\n\n // query well known without page\n let queryWellKnown = ['term', 'sort', 'limit'];\n\n let selected = [];\n\n _.forEach(queryWellKnown, property => {\n // Parse query option value to int because only int are allowed as param filter values\n let val = parseInt(state.parsedQuery[property], 10);\n\n // except of the term filter which is string\n if (property === 'term') {\n selected.push([property, state.parsedQuery[property]]);\n }\n\n // stack property, if not null\n if (val !== null && Number.isInteger(val) && property !== 'term') {\n selected.push([property, state.parsedQuery[property]]);\n }\n });\n\n // attach price (from, to), if selected\n if (_.isNumber(state.selectedFacets['priceMin']) && _.isNumber(state.selectedFacets['priceMax'])) {\n selected.push(['price_from', state.selectedFacets['priceMin']]);\n selected.push(['price_to', state.selectedFacets['priceMax']]);\n }\n\n // Put selected string facets to array\n let facets = getters.getRequestStringFacets;\n _.forEach(facets, facet => {\n if (state.selectedFacets[facet.key]) {\n selected.push([facet.key, state.selectedFacets[facet.key]]);\n }\n });\n\n // Put selected category facets to array\n facets = getters.getRequestCategoryFacets;\n _.forEach(facets, facet => {\n if (state.selectedFacets[facet.key]) {\n selected.push([facet.key, state.selectedFacets[facet.key]]);\n }\n });\n\n let filterRoute = {\n path: this.$router.currentRoute.path,\n query: _.fromPairs(selected),\n };\n\n dispatch('modNavigation/hideOffcanvasAction', {}, { root: true }).then(() => {\n this.$router.push(filterRoute);\n });\n }", "title": "" }, { "docid": "75e8fa573616e40a5885e27c7277942b", "score": "0.48197162", "text": "function filterSeries() {\n $('.series.filterLink').on('click', function(){\n var category = this.getAttribute('data-id');\n if (category == 'all') {\n $('.products').empty();\n buildProducts();\n }\n\n else\n {\n filter = doc.documents.filter(function(item) {\n return item.series == category;\n });\n filteredProducts(filter);\n }\n\n});\n}", "title": "" }, { "docid": "62d336bb5ddbadda9873ac475aa61e86", "score": "0.48086974", "text": "function sortingGallery() {\r\n if ($(\".project-gallery .project-filters\").length) {\r\n var $container = $('.project-container');\r\n $container.isotope({\r\n filter:'*',\r\n animationOptions: {\r\n duration: 750,\r\n easing: 'linear',\r\n queue: false,\r\n }\r\n });\r\n\r\n $(\".project-filters li a\").on(\"click\", function() {\r\n $('.project-filters li .current').removeClass('current');\r\n $(this).addClass('current');\r\n var selector = $(this).attr('data-filter');\r\n $container.isotope({\r\n filter:selector,\r\n animationOptions: {\r\n duration: 750,\r\n easing: 'linear',\r\n queue: false,\r\n }\r\n });\r\n return false;\r\n });\r\n }\r\n }", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.47961596", "text": "function setFilters() {}", "title": "" } ]
e0889dfa7d8756915784343de2cf72ea
Rule for validating the type of a value.
[ { "docid": "e46477c87978fa80a2735189db17df3b", "score": "0.713636", "text": "function type_type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n rule_required(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : typeof_default()(value)) !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" } ]
[ { "docid": "552fd8cb840a5335382b110cb8b1f711", "score": "0.7651566", "text": "function type(rule, value, source, errors, options) {\n\t if (rule.required && value === undefined) {\n\t (0, _required2['default'])(rule, value, source, errors, options);\n\t return;\n\t }\n\t var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n\t var ruleType = rule.type;\n\t if (custom.indexOf(ruleType) > -1) {\n\t if (!types[ruleType](value)) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t // straight typeof check\n\t } else if (ruleType && typeof value !== rule.type) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t}", "title": "" }, { "docid": "ca547048094d9003d93db438d71f8474", "score": "0.7612556", "text": "validateType(value) {\n return true;\n }", "title": "" }, { "docid": "9ed6d8dbe2aa9de650a5d6d6bd9be083", "score": "0.7555386", "text": "function type(rule, value, source, errors, options) {\n\t if (rule.required && value === undefined) {\n\t (0, _required2[\"default\"])(rule, value, source, errors, options);\n\t return;\n\t }\n\t var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n\t var ruleType = rule.type;\n\t if (custom.indexOf(ruleType) > -1) {\n\t if (!types[ruleType](value)) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t // straight typeof check\n\t } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t}", "title": "" }, { "docid": "9ed6d8dbe2aa9de650a5d6d6bd9be083", "score": "0.7555386", "text": "function type(rule, value, source, errors, options) {\n\t if (rule.required && value === undefined) {\n\t (0, _required2[\"default\"])(rule, value, source, errors, options);\n\t return;\n\t }\n\t var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n\t var ruleType = rule.type;\n\t if (custom.indexOf(ruleType) > -1) {\n\t if (!types[ruleType](value)) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t // straight typeof check\n\t } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t}", "title": "" }, { "docid": "9ed6d8dbe2aa9de650a5d6d6bd9be083", "score": "0.7555386", "text": "function type(rule, value, source, errors, options) {\n\t if (rule.required && value === undefined) {\n\t (0, _required2[\"default\"])(rule, value, source, errors, options);\n\t return;\n\t }\n\t var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n\t var ruleType = rule.type;\n\t if (custom.indexOf(ruleType) > -1) {\n\t if (!types[ruleType](value)) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t // straight typeof check\n\t } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t}", "title": "" }, { "docid": "f2d5c64c05d40278777346a0e4c8ff3c", "score": "0.75552636", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "f2d5c64c05d40278777346a0e4c8ff3c", "score": "0.75552636", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "f2d5c64c05d40278777346a0e4c8ff3c", "score": "0.75552636", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "f2d5c64c05d40278777346a0e4c8ff3c", "score": "0.75552636", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "f2d5c64c05d40278777346a0e4c8ff3c", "score": "0.75552636", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "f2d5c64c05d40278777346a0e4c8ff3c", "score": "0.75552636", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "f2d5c64c05d40278777346a0e4c8ff3c", "score": "0.75552636", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "f2d5c64c05d40278777346a0e4c8ff3c", "score": "0.75552636", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "f2d5c64c05d40278777346a0e4c8ff3c", "score": "0.75552636", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "f2d5c64c05d40278777346a0e4c8ff3c", "score": "0.75552636", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "68060702f4be40a23384d86d47385904", "score": "0.7555201", "text": "function type(rule, value, source, errors, options) {\n\t if (rule.required && value === undefined) {\n\t (0, _required2[\"default\"])(rule, value, source, errors, options);\n\t return;\n\t }\n\t var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n\t var ruleType = rule.type;\n\t if (custom.indexOf(ruleType) > -1) {\n\t if (!types[ruleType](value)) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t // straight typeof check\n\t } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t}", "title": "" }, { "docid": "68060702f4be40a23384d86d47385904", "score": "0.7555201", "text": "function type(rule, value, source, errors, options) {\n\t if (rule.required && value === undefined) {\n\t (0, _required2[\"default\"])(rule, value, source, errors, options);\n\t return;\n\t }\n\t var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n\t var ruleType = rule.type;\n\t if (custom.indexOf(ruleType) > -1) {\n\t if (!types[ruleType](value)) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t // straight typeof check\n\t } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t}", "title": "" }, { "docid": "5aacf2a1cce2cc02c505d4e198e54830", "score": "0.7543903", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types$1[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof$1(value)) !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "ceda248252b25cdb801b02b262735c5e", "score": "0.75394404", "text": "function type(rule, value, source, errors, options) {\n\t\t if (rule.required && value === undefined) {\n\t\t (0, _required2[\"default\"])(rule, value, source, errors, options);\n\t\t return;\n\t\t }\n\t\t var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n\t\t var ruleType = rule.type;\n\t\t if (custom.indexOf(ruleType) > -1) {\n\t\t if (!types[ruleType](value)) {\n\t\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t\t }\n\t\t // straight typeof check\n\t\t } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n\t\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t\t }\n\t\t}", "title": "" }, { "docid": "9340af23129f17e8f149c19e1501ae18", "score": "0.75260574", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format$1(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && typeof value !== rule.type) {\n errors.push(format$1(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "057e25925d5ef581ea4ea4b0e091454d", "score": "0.7505917", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n required(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && _typeof(value) !== rule.type) {\n errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "93c760cdcda3d31183c614bd70e5427c", "score": "0.7479314", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n (0, _required2.default)(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : (0, _typeof3.default)(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "2f89cf7f24956857a323ecc881e60a84", "score": "0.74277806", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n (0, _required2[\"default\"])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "2f89cf7f24956857a323ecc881e60a84", "score": "0.74277806", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n (0, _required2[\"default\"])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "2f89cf7f24956857a323ecc881e60a84", "score": "0.74277806", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n (0, _required2[\"default\"])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "d6cdfc47ef182e6934433f412c376a6e", "score": "0.7414784", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n (0, _required.default)(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : (0, _typeof2.default)(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "d6cdfc47ef182e6934433f412c376a6e", "score": "0.7414784", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n (0, _required.default)(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : (0, _typeof2.default)(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "d6cdfc47ef182e6934433f412c376a6e", "score": "0.7414784", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n (0, _required.default)(rule, value, source, errors, options);\n return;\n }\n\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n } // straight typeof check\n\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : (0, _typeof2.default)(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "f775eb9f3a93b8179c89429ae257c518", "score": "0.7413428", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n (0, _required2['default'])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "f775eb9f3a93b8179c89429ae257c518", "score": "0.7413428", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n (0, _required2['default'])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "b1d66d81ddc3d50c95c2e02625385405", "score": "0.73805505", "text": "function type(rule, value, source, errors, options) {\n\t if (rule.required && value === undefined) {\n\t (0, _required2['default'])(rule, value, source, errors, options);\n\t return;\n\t }\n\t var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n\t var ruleType = rule.type;\n\t if (custom.indexOf(ruleType) > -1) {\n\t if (!types[ruleType](value)) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t // straight typeof check\n\t } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : (0, _typeof3['default'])(value)) !== rule.type) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t}", "title": "" }, { "docid": "b1d66d81ddc3d50c95c2e02625385405", "score": "0.73805505", "text": "function type(rule, value, source, errors, options) {\n\t if (rule.required && value === undefined) {\n\t (0, _required2['default'])(rule, value, source, errors, options);\n\t return;\n\t }\n\t var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n\t var ruleType = rule.type;\n\t if (custom.indexOf(ruleType) > -1) {\n\t if (!types[ruleType](value)) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t // straight typeof check\n\t } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : (0, _typeof3['default'])(value)) !== rule.type) {\n\t errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n\t }\n\t}", "title": "" }, { "docid": "9676914738a49d8097a0f61e1f008f13", "score": "0.7365715", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n }", "title": "" }, { "docid": "6530c0195fcd624792ad7fa1d041147f", "score": "0.73082733", "text": "function validateType(value, schema_property){\n \n if (schema_property.type === String){\n return typeValidator.isString(value)\n }\n\n if (schema_property.type === Number){\n return typeValidator.isNumber(value) \n }\n\n if (schema_property.type === Function){\n return typeValidator.isFunction(value) \n }\n\n if (schema_property.type === Array){\n return typeValidator.isArray(value) \n }\n\n if (schema_property.type === Boolean){\n return typeValidator.isBoolean(value) \n }\n\n if (schema_property.type === Date){\n return typeValidator.isDate(value) \n }\n\n if (schema_property.type === Object){\n return typeValidator.isObject(value) \n }\n\n if (schema_property.type === Buffer){\n if (!Buffer.isBuffer(value)){\n schemaValidationError.message = `${value} is not of type Number`\n throw schemaValidationError.messa\n return\n }\n return Buffer.isBuffer(value)\n }\n}", "title": "" }, { "docid": "59824674f13f45b770c61a78519a6509", "score": "0.7276632", "text": "function type(rule, value, source, errors, options) {\r\n if (rule.required && value === undefined) {\r\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\r\n return;\r\n }\r\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\r\n var ruleType = rule.type;\r\n if (custom.indexOf(ruleType) > -1) {\r\n if (!types[ruleType](value)) {\r\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\r\n }\r\n // straight typeof check\r\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\r\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\r\n }\r\n}", "title": "" }, { "docid": "e9d2fef0a5f5c663cd16b74625b6e816", "score": "0.7270255", "text": "function typecheck(type, value) {\n var errors = type.validate(value, [{ path: \"\", type: type }]);\n if (errors.length > 0) {\n fail(\"Error while converting \" + prettyPrintValue(value) + \" to `\" + type.name + \"`:\\n\" +\n errors.map(toErrorString).join(\"\\n\"));\n }\n}", "title": "" }, { "docid": "4329e4dd630ca9e82a6b41c6afe9d303", "score": "0.72527033", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(_required__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_1__[\"format\"](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(value)) !== rule.type) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_1__[\"format\"](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "4329e4dd630ca9e82a6b41c6afe9d303", "score": "0.72527033", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(_required__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_1__[\"format\"](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(value)) !== rule.type) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_1__[\"format\"](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "4329e4dd630ca9e82a6b41c6afe9d303", "score": "0.72527033", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(_required__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_1__[\"format\"](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(value)) !== rule.type) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_1__[\"format\"](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "4329e4dd630ca9e82a6b41c6afe9d303", "score": "0.72527033", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(_required__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_1__[\"format\"](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(value)) !== rule.type) {\n errors.push(_util__WEBPACK_IMPORTED_MODULE_1__[\"format\"](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "5e533300f4514cfb33065a3ae394ed4b", "score": "0.7249331", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "5e533300f4514cfb33065a3ae394ed4b", "score": "0.7249331", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "5e533300f4514cfb33065a3ae394ed4b", "score": "0.7249331", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "5e533300f4514cfb33065a3ae394ed4b", "score": "0.7249331", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "5e533300f4514cfb33065a3ae394ed4b", "score": "0.7249331", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "5e533300f4514cfb33065a3ae394ed4b", "score": "0.7249331", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "5e533300f4514cfb33065a3ae394ed4b", "score": "0.7249331", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "5e533300f4514cfb33065a3ae394ed4b", "score": "0.7249331", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "5e533300f4514cfb33065a3ae394ed4b", "score": "0.7249331", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "5e533300f4514cfb33065a3ae394ed4b", "score": "0.7249331", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "5e533300f4514cfb33065a3ae394ed4b", "score": "0.7249331", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "5e533300f4514cfb33065a3ae394ed4b", "score": "0.7249331", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "5e533300f4514cfb33065a3ae394ed4b", "score": "0.7249331", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n Object(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "79db6dec2d1a64fedb987df90e8ebbf0", "score": "0.72435874", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n (0, _required2['default'])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : (0, _typeof3['default'])(value)) !== rule.type) {\n errors.push(util.format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "c7fb9d3594d0397fd1cd9085739beb15", "score": "0.7220337", "text": "function type(rule, value, source, errors, options) {\n\t\tif (rule.required && value === undefined) {\n\t\t\t;(0, _required2['default'])(rule, value, source, errors, options)\n\t\t\treturn\n\t\t}\n\t\tvar custom = [\n\t\t\t'integer',\n\t\t\t'float',\n\t\t\t'array',\n\t\t\t'regexp',\n\t\t\t'object',\n\t\t\t'method',\n\t\t\t'email',\n\t\t\t'number',\n\t\t\t'date',\n\t\t\t'url',\n\t\t\t'hex'\n\t\t]\n\t\tvar ruleType = rule.type\n\t\tif (custom.indexOf(ruleType) > -1) {\n\t\t\tif (!types[ruleType](value)) {\n\t\t\t\terrors.push(\n\t\t\t\t\tutil.format(\n\t\t\t\t\t\toptions.messages.types[ruleType],\n\t\t\t\t\t\trule.fullField,\n\t\t\t\t\t\trule.type\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t}\n\t\t\t// straight typeof check\n\t\t} else if (\n\t\t\truleType &&\n\t\t\t(typeof value === 'undefined'\n\t\t\t\t? 'undefined'\n\t\t\t\t: (0, _typeof3['default'])(value)) !== rule.type\n\t\t) {\n\t\t\terrors.push(\n\t\t\t\tutil.format(\n\t\t\t\t\toptions.messages.types[ruleType],\n\t\t\t\t\trule.fullField,\n\t\t\t\t\trule.type\n\t\t\t\t)\n\t\t\t)\n\t\t}\n\t}", "title": "" }, { "docid": "3ced84c0dd0756f0c5398fa9ccd702de", "score": "0.71970063", "text": "function isValid( type, value ){\n return true;\n }", "title": "" }, { "docid": "501c7a0d9071f978f77d7735b8d2f2fd", "score": "0.71858877", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__required__[\"default\"])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"format\"](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"format\"](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "8c1b3d57165d87425e4753b16ba32c6b", "score": "0.71708006", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"d\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "59b1d185389282b3f08e8ad97972ff17", "score": "0.7159336", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "59b1d185389282b3f08e8ad97972ff17", "score": "0.7159336", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "59b1d185389282b3f08e8ad97972ff17", "score": "0.7159336", "text": "function type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\" /* default */])(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value)) !== rule.type) {\n errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\" /* format */](options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "6904e1f7a542f7f312dfe7c1bb42aa6d", "score": "0.71257275", "text": "function type_type(rule, value, source, errors, options) {\n if (rule.required && value === undefined) {\n rule_required(rule, value, source, errors, options);\n return;\n }\n var custom = ['integer', 'float', 'array', 'regexp', 'object', 'method', 'email', 'number', 'date', 'url', 'hex'];\n var ruleType = rule.type;\n if (custom.indexOf(ruleType) > -1) {\n if (!types[ruleType](value)) {\n errors.push(util_format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n // straight typeof check\n } else if (ruleType && (typeof value === 'undefined' ? 'undefined' : typeof_default()(value)) !== rule.type) {\n errors.push(util_format(options.messages.types[ruleType], rule.fullField, rule.type));\n }\n}", "title": "" }, { "docid": "327aa2e352993f147ed2393f8c89733b", "score": "0.7058567", "text": "function checkType( value, type )\n{\n if ( type == \"string\" )\n {\n return true;\n }\n\n if ( type == \"int\" )\n {\n return validator.isInt( value );\n }\n\n if ( type == \"float\" )\n {\n return validator.isFloat( value );\n }\n\n if ( type == \"email\" )\n {\n return validator.isEmail( value );\n }\n\n if ( type == \"ObjectId\" )\n {\n let objectID = require('mongodb').ObjectID;\n return objectID.isValid( value );\n }\n\n console.log( value + \" fell through for type \" + type );\n return false;\n}", "title": "" }, { "docid": "8d2ac5c923e717f59c01739291f21569", "score": "0.68916297", "text": "function type(rule,value,source,errors,options){if(rule.required&&value===undefined){__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__required__[\"a\"/* default */])(rule,value,source,errors,options);return;}var custom=['integer','float','array','regexp','object','method','email','number','date','url','hex'];var ruleType=rule.type;if(custom.indexOf(ruleType)>-1){if(!types[ruleType](value)){errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\"/* format */](options.messages.types[ruleType],rule.fullField,rule.type));}// straight typeof check\n}else if(ruleType&&(typeof value==='undefined'?'undefined':__WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_typeof___default()(value))!==rule.type){errors.push(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\"/* format */](options.messages.types[ruleType],rule.fullField,rule.type));}}", "title": "" }, { "docid": "05b282e9fa937c85490cf127ab5bfebe", "score": "0.6838454", "text": "isValidType(value) {\n\t\treturn typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean';\n\t}", "title": "" }, { "docid": "89ea566b4502563a14347f8dc085389e", "score": "0.67811924", "text": "function checkType(value) {\n return typeof value\n}", "title": "" }, { "docid": "ab5ea737dbde6fad4bd7061e4b5c6748", "score": "0.6716712", "text": "function isTypeValidExt( input, classprefix, type, value ) {\n\t/* RULE EXAMPLE (Accept only integer values)\n\tif( type == classprefix + 'Integer' ) {\n\t\treturn ( ( value.match(/^[\\d|,|\\.|\\s]*$/) ) && ( value != '' ) );\n\t} \n\t*/\n\treturn true;\n}", "title": "" }, { "docid": "9a1a0255023429c9b23adb6d844e6b7a", "score": "0.67022103", "text": "validate(value) {\n let error;\n\n // validates the required property against the value provided\n if (value === null || value === undefined) {\n if (this._required) {\n error = new ValidationError();\n error.addFieldError('field is required');\n throw error;\n }\n } else {\n // validates the specific type of the value provided\n if (!this.validateType(value)) {\n error = new ValidationError();\n error.addFieldError('invalid type for field');\n throw error;\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "949a2568a21539cc2cbbac521325a672", "score": "0.6636385", "text": "function checkType(type,value){if(type){if(typeof type=='string'&&type!='any'&&(type=='null'?value!==null:typeof value!=type)&&!(value instanceof Array&&type=='array')&&!(value instanceof Date&&type=='date')&&!(type=='integer'&&value%1===0)){return[{property:path,message:typeof value+\" value found, but a \"+type+\" is required\"}];}if(type instanceof Array){var unionErrors=[];for(var j=0;j<type.length;j++){// a union type\nif(!(unionErrors=checkType(type[j],value)).length){break;}}if(unionErrors.length){return unionErrors;}}else if(typeof type=='object'){var priorErrors=errors;errors=[];checkProp(value,type,path);var theseErrors=errors;errors=priorErrors;return theseErrors;}}return[];}", "title": "" }, { "docid": "ad308446a093d1606ea3cd340386cead", "score": "0.6512222", "text": "function verifyType(val, type){\n notNull(val);\n notNull(type);\n\n if(!TYPES.hasOwnProperty(type)){\n throw new Error(\"Invalid type: \" + type + \". Did you mean isInstanceOf(val, className)?\");\n } else if(typeof val !== type){\n throw new Error(val + \" must be of type \" + type + \", not \" + typeof val);\n }\n return true;\n}", "title": "" }, { "docid": "57ca3fda6e8781bb844953b3ce8edf0e", "score": "0.65112656", "text": "function assertType(value,type){var valid;var expectedType=getType(type);if(expectedType === 'String'){valid = typeof value === (expectedType = 'string');}else if(expectedType === 'Number'){valid = typeof value === (expectedType = 'number');}else if(expectedType === 'Boolean'){valid = typeof value === (expectedType = 'boolean');}else if(expectedType === 'Function'){valid = typeof value === (expectedType = 'function');}else if(expectedType === 'Object'){valid = isPlainObject(value);}else if(expectedType === 'Array'){valid = Array.isArray(value);}else {valid = value instanceof type;}return {valid:valid,expectedType:expectedType};}", "title": "" }, { "docid": "4850c9f98c5f4297cffdd58f26c6ace1", "score": "0.64468455", "text": "function assertType(value,type){var valid;var expectedType=getType(type);if(expectedType==='String'){valid=(typeof value==='undefined'?'undefined':_typeof(value))===(expectedType='string');}else if(expectedType==='Number'){valid=(typeof value==='undefined'?'undefined':_typeof(value))===(expectedType='number');}else if(expectedType==='Boolean'){valid=(typeof value==='undefined'?'undefined':_typeof(value))===(expectedType='boolean');}else if(expectedType==='Function'){valid=(typeof value==='undefined'?'undefined':_typeof(value))===(expectedType='function');}else if(expectedType==='Object'){valid=isPlainObject(value);}else if(expectedType==='Array'){valid=Array.isArray(value);}else{valid=value instanceof type;}return{valid:valid,expectedType:expectedType};}", "title": "" }, { "docid": "af46755f984f36a1e3a0fed166a55da8", "score": "0.6438968", "text": "function prumoIsType(value, type)\n{\n var regexInteger = /^-?[0-9]*([+\\-*/]?[0-9]){0,50}$/;\n var regexFloat = /^-?[0-9]*[.,]?[0-9]*([+\\-*/]?[0-9]*[.,]?[0-9]){0,50}$/;\n\n var isValid = true;\n\n switch(type) {\n case 'serial':\n if (! regexInteger.test(value)) {\n isValid = false;\n }\n break;\n case 'integer':\n if (! regexInteger.test(value)) {\n isValid = false;\n }\n break;\n case 'numeric':\n if (! regexFloat.test(value)) {\n isValid = false;\n }\n break;\n case 'money':\n if (! regexFloat.test(value)) {\n isValid = false;\n }\n break;\n case 'date':\n if (! isDate(value)) {\n isValid = false;\n }\n break;\n case 'time':\n if (! isTime(value)) {\n isValid = false;\n }\n break;\n case 'timestamp':\n let partValue = value.replace(\"T\", \" \").split(\" \");\n\n if (partValue.length != 2) {\n isValid = false;\n } else if (! isDate(partValue[0])) {\n isValid = false;\n } else if (! isTime(partValue[1])) {\n isValid = false;\n }\n break;\n case 'boolean':\n if (value != 't' && value != 'f') {\n isValid = false;\n }\n break;\n }\n return isValid;\n}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.6426373", "text": "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.6426373", "text": "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.6426373", "text": "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.6426373", "text": "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.6426373", "text": "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.6426373", "text": "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.6426373", "text": "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.6426373", "text": "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.6426373", "text": "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.6426373", "text": "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "title": "" }, { "docid": "3095367b911410887b212efeba210da1", "score": "0.6426373", "text": "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "title": "" }, { "docid": "3feeef36e37f60cb258f01b86f2cf90e", "score": "0.6419996", "text": "function assertType(value, type) {\n\t var valid = void 0;\n\t var expectedType = void 0;\n\t if (type === String) {\n\t expectedType = 'string';\n\t valid = typeof value === expectedType;\n\t } else if (type === Number) {\n\t expectedType = 'number';\n\t valid = typeof value === expectedType;\n\t } else if (type === Boolean) {\n\t expectedType = 'boolean';\n\t valid = typeof value === expectedType;\n\t } else if (type === Function) {\n\t expectedType = 'function';\n\t valid = typeof value === expectedType;\n\t } else if (type === Object) {\n\t expectedType = 'Object';\n\t valid = isPlainObject(value);\n\t } else if (type === Array) {\n\t expectedType = 'Array';\n\t valid = Array.isArray(value);\n\t } else {\n\t expectedType = type.name || type.toString();\n\t valid = value instanceof type;\n\t }\n\t return {\n\t valid: valid,\n\t expectedType: expectedType\n\t };\n\t}", "title": "" }, { "docid": "1a936be5d337dacbae18cf098629738b", "score": "0.64129263", "text": "function validateValue(value) {\n if (typeof value === 'undefined') {\n throw Error(erros.noValue);\n } else if (typeof value !== 'number') {\n throw Error(erros.valueMustBeNumber);\n }\n}", "title": "" }, { "docid": "2ac3db82789021cf3a2034c0a66651d6", "score": "0.6403894", "text": "function validateType (value) {\n var possibleTypes = { basic: true, google: true };\n return possibleTypes[value];\n}", "title": "" }, { "docid": "096c90583c0c774788017a006acc227d", "score": "0.6401249", "text": "function assertType (value, type) {\n var valid;\n var expectedType = getType(type);\n if (expectedType === 'String') {\n valid = typeof value === (expectedType = 'string');\n } else if (expectedType === 'Number') {\n valid = typeof value === (expectedType = 'number');\n } else if (expectedType === 'Boolean') {\n valid = typeof value === (expectedType = 'boolean');\n } else if (expectedType === 'Function') {\n valid = typeof value === (expectedType = 'function');\n } else if (expectedType === 'Object') {\n valid = isPlainObject(value);\n } else if (expectedType === 'Array') {\n valid = Array.isArray(value);\n } else {\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n }\n }", "title": "" }, { "docid": "c3f86f10836d8c363da1be9042a79005", "score": "0.6374203", "text": "function checkType(type,value){\r\n\t\t\tif(type){\r\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\r\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\r\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\r\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\r\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\r\n\t\t\t\t\treturn [{property:path,message:value + \" - \" + (typeof value) + \" value found, but a \" + type + \" is required\"}];\r\n\t\t\t\t}\r\n\t\t\t\tif(type instanceof Array){\r\n\t\t\t\t\tvar unionErrors=[];\r\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\r\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(unionErrors.length){\r\n\t\t\t\t\t\treturn unionErrors;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(typeof type == 'object'){\r\n\t\t\t\t\tvar priorErrors = errors;\r\n\t\t\t\t\terrors = [];\r\n\t\t\t\t\tcheckProp(value,type,path);\r\n\t\t\t\t\tvar theseErrors = errors;\r\n\t\t\t\t\terrors = priorErrors;\r\n\t\t\t\t\treturn theseErrors;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn [];\r\n\t\t}", "title": "" }, { "docid": "07a436f8d38e8100122d4098f608eadc", "score": "0.63651335", "text": "function checkType(type,value){\n\t\t\t\tif(type){\n\t\t\t\t\tif(typeof type == 'string' && type != 'any' &&\n\t\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\n\t\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\n\t\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\n\t\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\n\t\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\n\t\t\t\t\t}\n\t\t\t\t\tif(type instanceof Array){\n\t\t\t\t\t\tvar unionErrors=[];\n\t\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\n\t\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(unionErrors.length){\n\t\t\t\t\t\t\treturn unionErrors;\n\t\t\t\t\t\t}\n\t\t\t\t\t}else if(typeof type == 'object'){\n\t\t\t\t\t\tvar priorErrors = errors;\n\t\t\t\t\t\terrors = [];\n\t\t\t\t\t\tcheckProp(value,type,path);\n\t\t\t\t\t\tvar theseErrors = errors;\n\t\t\t\t\t\terrors = priorErrors;\n\t\t\t\t\t\treturn theseErrors;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn [];\n\t\t\t}", "title": "" }, { "docid": "fac80ba8dd6508e5a55d4cc944b279aa", "score": "0.6361275", "text": "function assertType (value, type) {\n\t var valid;\n\t var expectedType = getType(type);\n\t if (expectedType === 'String') {\n\t valid = typeof value === (expectedType = 'string');\n\t } else if (expectedType === 'Number') {\n\t valid = typeof value === (expectedType = 'number');\n\t } else if (expectedType === 'Boolean') {\n\t valid = typeof value === (expectedType = 'boolean');\n\t } else if (expectedType === 'Function') {\n\t valid = typeof value === (expectedType = 'function');\n\t } else if (expectedType === 'Object') {\n\t valid = isPlainObject(value);\n\t } else if (expectedType === 'Array') {\n\t valid = Array.isArray(value);\n\t } else {\n\t valid = value instanceof type;\n\t }\n\t return {\n\t valid: valid,\n\t expectedType: expectedType\n\t }\n\t}", "title": "" }, { "docid": "fac80ba8dd6508e5a55d4cc944b279aa", "score": "0.6361275", "text": "function assertType (value, type) {\n\t var valid;\n\t var expectedType = getType(type);\n\t if (expectedType === 'String') {\n\t valid = typeof value === (expectedType = 'string');\n\t } else if (expectedType === 'Number') {\n\t valid = typeof value === (expectedType = 'number');\n\t } else if (expectedType === 'Boolean') {\n\t valid = typeof value === (expectedType = 'boolean');\n\t } else if (expectedType === 'Function') {\n\t valid = typeof value === (expectedType = 'function');\n\t } else if (expectedType === 'Object') {\n\t valid = isPlainObject(value);\n\t } else if (expectedType === 'Array') {\n\t valid = Array.isArray(value);\n\t } else {\n\t valid = value instanceof type;\n\t }\n\t return {\n\t valid: valid,\n\t expectedType: expectedType\n\t }\n\t}", "title": "" }, { "docid": "1d5aec970cee036dc6d907278f7d70cc", "score": "0.632999", "text": "function validateValue(type, valueAST) {\n // Validate non-nullable values.\n if (type instanceof _graphql.GraphQLNonNull) {\n if (valueAST.kind === 'Null') {\n return [[valueAST, 'Type \"' + type + '\" is non-nullable and cannot be null.']];\n }\n return validateValue(type.ofType, valueAST);\n }\n\n if (valueAST.kind === 'Null') {\n return [];\n }\n\n // Validate lists of values, accepting a non-list as a list of one.\n if (type instanceof _graphql.GraphQLList) {\n var itemType = type.ofType;\n if (valueAST.kind === 'Array') {\n return mapCat(valueAST.values, function (item) {\n return validateValue(itemType, item);\n });\n }\n return validateValue(itemType, valueAST);\n }\n\n // Validate input objects.\n if (type instanceof _graphql.GraphQLInputObjectType) {\n if (valueAST.kind !== 'Object') {\n return [[valueAST, 'Type \"' + type + '\" must be an Object.']];\n }\n\n // Validate each field in the input object.\n var providedFields = Object.create(null);\n var fieldErrors = mapCat(valueAST.members, function (member) {\n var fieldName = member.key.value;\n providedFields[fieldName] = true;\n var inputField = type.getFields()[fieldName];\n if (!inputField) {\n return [[member.key, 'Type \"' + type + '\" does not have a field \"' + fieldName + '\".']];\n }\n var fieldType = inputField ? inputField.type : undefined;\n return validateValue(fieldType, member.value);\n });\n\n // Look for missing non-nullable fields.\n Object.keys(type.getFields()).forEach(function (fieldName) {\n if (!providedFields[fieldName]) {\n var fieldType = type.getFields()[fieldName].type;\n if (fieldType instanceof _graphql.GraphQLNonNull) {\n fieldErrors.push([valueAST, 'Object of type \"' + type + '\" is missing required field \"' + fieldName + '\".']);\n }\n }\n });\n\n return fieldErrors;\n }\n\n // Validate common scalars.\n if (type.name === 'Boolean' && valueAST.kind !== 'Boolean' || type.name === 'String' && valueAST.kind !== 'String' || type.name === 'ID' && valueAST.kind !== 'Number' && valueAST.kind !== 'String' || type.name === 'Float' && valueAST.kind !== 'Number' || type.name === 'Int' && (valueAST.kind !== 'Number' || (valueAST.value | 0) !== valueAST.value)) {\n return [[valueAST, 'Expected value of type \"' + type + '\".']];\n }\n\n // Validate enums and custom scalars.\n if (type instanceof _graphql.GraphQLEnumType || type instanceof _graphql.GraphQLScalarType) {\n if (valueAST.kind !== 'String' && valueAST.kind !== 'Number' && valueAST.kind !== 'Boolean' && valueAST.kind !== 'Null' || isNullish(type.parseValue(valueAST.value))) {\n return [[valueAST, 'Expected value of type \"' + type + '\".']];\n }\n }\n\n return [];\n}", "title": "" }, { "docid": "e9fc1b497d994a4280ed1de2e5dcdc64", "score": "0.6324247", "text": "function checkType(type,value){\n\t\t\tif(type){\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\n\t\t\t\t}\n\t\t\t\tif(type instanceof Array){\n\t\t\t\t\tvar unionErrors=[];\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(unionErrors.length){\n\t\t\t\t\t\treturn unionErrors;\n\t\t\t\t\t}\n\t\t\t\t}else if(typeof type == 'object'){\n\t\t\t\t\tvar priorErrors = errors;\n\t\t\t\t\terrors = [];\n\t\t\t\t\tcheckProp(value,type,path);\n\t\t\t\t\tvar theseErrors = errors;\n\t\t\t\t\terrors = priorErrors;\n\t\t\t\t\treturn theseErrors;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn [];\n\t\t}", "title": "" }, { "docid": "e9fc1b497d994a4280ed1de2e5dcdc64", "score": "0.6324247", "text": "function checkType(type,value){\n\t\t\tif(type){\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\n\t\t\t\t}\n\t\t\t\tif(type instanceof Array){\n\t\t\t\t\tvar unionErrors=[];\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(unionErrors.length){\n\t\t\t\t\t\treturn unionErrors;\n\t\t\t\t\t}\n\t\t\t\t}else if(typeof type == 'object'){\n\t\t\t\t\tvar priorErrors = errors;\n\t\t\t\t\terrors = [];\n\t\t\t\t\tcheckProp(value,type,path);\n\t\t\t\t\tvar theseErrors = errors;\n\t\t\t\t\terrors = priorErrors;\n\t\t\t\t\treturn theseErrors;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn [];\n\t\t}", "title": "" }, { "docid": "e9fc1b497d994a4280ed1de2e5dcdc64", "score": "0.6324247", "text": "function checkType(type,value){\n\t\t\tif(type){\n\t\t\t\tif(typeof type == 'string' && type != 'any' &&\n\t\t\t\t\t\t(type == 'null' ? value !== null : typeof value != type) &&\n\t\t\t\t\t\t!(value instanceof Array && type == 'array') &&\n\t\t\t\t\t\t!(value instanceof Date && type == 'date') &&\n\t\t\t\t\t\t!(type == 'integer' && value%1===0)){\n\t\t\t\t\treturn [{property:path,message:(typeof value) + \" value found, but a \" + type + \" is required\"}];\n\t\t\t\t}\n\t\t\t\tif(type instanceof Array){\n\t\t\t\t\tvar unionErrors=[];\n\t\t\t\t\tfor(var j = 0; j < type.length; j++){ // a union type\n\t\t\t\t\t\tif(!(unionErrors=checkType(type[j],value)).length){\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(unionErrors.length){\n\t\t\t\t\t\treturn unionErrors;\n\t\t\t\t\t}\n\t\t\t\t}else if(typeof type == 'object'){\n\t\t\t\t\tvar priorErrors = errors;\n\t\t\t\t\terrors = [];\n\t\t\t\t\tcheckProp(value,type,path);\n\t\t\t\t\tvar theseErrors = errors;\n\t\t\t\t\terrors = priorErrors;\n\t\t\t\t\treturn theseErrors;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn [];\n\t\t}", "title": "" } ]
2682c649e45c3b406891854a2de50760
Regenerate the entire tree map for a given ContentState and decorator. Returns an OrderedMap that maps all available ContentBlock objects.
[ { "docid": "8797b77dcf0a68f4a21ab08581018805", "score": "0.83111006", "text": "function generateNewTreeMap(contentState, decorator) {\n return contentState.getBlockMap().map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }).toOrderedMap();\n}", "title": "" } ]
[ { "docid": "db64fa62bdfaaeba7cf73d525dfbf62e", "score": "0.82527024", "text": "function generateNewTreeMap(contentState,decorator){return contentState.getBlockMap().map(function(block){return BlockTree.generate(block,decorator);}).toOrderedMap();}", "title": "" }, { "docid": "3393da6433b81d7defb48d9544f6f07d", "score": "0.82501733", "text": "function generateNewTreeMap(contentState, decorator) {\n\t return contentState.getBlockMap().map(function (block) {\n\t return BlockTree.generate(block, decorator);\n\t }).toOrderedMap();\n\t}", "title": "" }, { "docid": "72a7b0b4cca6cc1feaeec870309d2662", "score": "0.69168687", "text": "function regenerateTreeForNewBlocks(editorState,newBlockMap,decorator){var prevBlockMap=editorState.getCurrentContent().getBlockMap();var prevTreeMap=editorState.getImmutable().get('treeMap');return prevTreeMap.merge(newBlockMap.toSeq().filter(function(block,key){return block!==prevBlockMap.get(key);}).map(function(block){return BlockTree.generate(block,decorator);}));}", "title": "" }, { "docid": "a0081849fe306d290ebffb78d68b5b8f", "score": "0.6913207", "text": "function regenerateTreeForNewBlocks(editorState, newBlockMap, decorator) {\n\t var prevBlockMap = editorState.getCurrentContent().getBlockMap();\n\t var prevTreeMap = editorState.getImmutable().get('treeMap');\n\t return prevTreeMap.merge(newBlockMap.toSeq().filter(function (block, key) {\n\t return block !== prevBlockMap.get(key);\n\t }).map(function (block) {\n\t return BlockTree.generate(block, decorator);\n\t }));\n\t}", "title": "" }, { "docid": "eb88f6f34c0c43619261bf5ca55d3577", "score": "0.67386967", "text": "function regenerateTreeForNewBlocks(editorState, newBlockMap, newEntityMap, decorator) {\n var contentState = editorState.getCurrentContent().set('entityMap', newEntityMap);\n var prevBlockMap = contentState.getBlockMap();\n var prevTreeMap = editorState.getImmutable().get('treeMap');\n return prevTreeMap.merge(newBlockMap.toSeq().filter(function (block, key) {\n return block !== prevBlockMap.get(key);\n }).map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }));\n}", "title": "" }, { "docid": "eb88f6f34c0c43619261bf5ca55d3577", "score": "0.67386967", "text": "function regenerateTreeForNewBlocks(editorState, newBlockMap, newEntityMap, decorator) {\n var contentState = editorState.getCurrentContent().set('entityMap', newEntityMap);\n var prevBlockMap = contentState.getBlockMap();\n var prevTreeMap = editorState.getImmutable().get('treeMap');\n return prevTreeMap.merge(newBlockMap.toSeq().filter(function (block, key) {\n return block !== prevBlockMap.get(key);\n }).map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }));\n}", "title": "" }, { "docid": "eb88f6f34c0c43619261bf5ca55d3577", "score": "0.67386967", "text": "function regenerateTreeForNewBlocks(editorState, newBlockMap, newEntityMap, decorator) {\n var contentState = editorState.getCurrentContent().set('entityMap', newEntityMap);\n var prevBlockMap = contentState.getBlockMap();\n var prevTreeMap = editorState.getImmutable().get('treeMap');\n return prevTreeMap.merge(newBlockMap.toSeq().filter(function (block, key) {\n return block !== prevBlockMap.get(key);\n }).map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }));\n}", "title": "" }, { "docid": "eb88f6f34c0c43619261bf5ca55d3577", "score": "0.67386967", "text": "function regenerateTreeForNewBlocks(editorState, newBlockMap, newEntityMap, decorator) {\n var contentState = editorState.getCurrentContent().set('entityMap', newEntityMap);\n var prevBlockMap = contentState.getBlockMap();\n var prevTreeMap = editorState.getImmutable().get('treeMap');\n return prevTreeMap.merge(newBlockMap.toSeq().filter(function (block, key) {\n return block !== prevBlockMap.get(key);\n }).map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }));\n}", "title": "" }, { "docid": "eb88f6f34c0c43619261bf5ca55d3577", "score": "0.67386967", "text": "function regenerateTreeForNewBlocks(editorState, newBlockMap, newEntityMap, decorator) {\n var contentState = editorState.getCurrentContent().set('entityMap', newEntityMap);\n var prevBlockMap = contentState.getBlockMap();\n var prevTreeMap = editorState.getImmutable().get('treeMap');\n return prevTreeMap.merge(newBlockMap.toSeq().filter(function (block, key) {\n return block !== prevBlockMap.get(key);\n }).map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }));\n}", "title": "" }, { "docid": "eb88f6f34c0c43619261bf5ca55d3577", "score": "0.67386967", "text": "function regenerateTreeForNewBlocks(editorState, newBlockMap, newEntityMap, decorator) {\n var contentState = editorState.getCurrentContent().set('entityMap', newEntityMap);\n var prevBlockMap = contentState.getBlockMap();\n var prevTreeMap = editorState.getImmutable().get('treeMap');\n return prevTreeMap.merge(newBlockMap.toSeq().filter(function (block, key) {\n return block !== prevBlockMap.get(key);\n }).map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }));\n}", "title": "" }, { "docid": "eb88f6f34c0c43619261bf5ca55d3577", "score": "0.67386967", "text": "function regenerateTreeForNewBlocks(editorState, newBlockMap, newEntityMap, decorator) {\n var contentState = editorState.getCurrentContent().set('entityMap', newEntityMap);\n var prevBlockMap = contentState.getBlockMap();\n var prevTreeMap = editorState.getImmutable().get('treeMap');\n return prevTreeMap.merge(newBlockMap.toSeq().filter(function (block, key) {\n return block !== prevBlockMap.get(key);\n }).map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }));\n}", "title": "" }, { "docid": "eb88f6f34c0c43619261bf5ca55d3577", "score": "0.67386967", "text": "function regenerateTreeForNewBlocks(editorState, newBlockMap, newEntityMap, decorator) {\n var contentState = editorState.getCurrentContent().set('entityMap', newEntityMap);\n var prevBlockMap = contentState.getBlockMap();\n var prevTreeMap = editorState.getImmutable().get('treeMap');\n return prevTreeMap.merge(newBlockMap.toSeq().filter(function (block, key) {\n return block !== prevBlockMap.get(key);\n }).map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }));\n}", "title": "" }, { "docid": "eb88f6f34c0c43619261bf5ca55d3577", "score": "0.67386967", "text": "function regenerateTreeForNewBlocks(editorState, newBlockMap, newEntityMap, decorator) {\n var contentState = editorState.getCurrentContent().set('entityMap', newEntityMap);\n var prevBlockMap = contentState.getBlockMap();\n var prevTreeMap = editorState.getImmutable().get('treeMap');\n return prevTreeMap.merge(newBlockMap.toSeq().filter(function (block, key) {\n return block !== prevBlockMap.get(key);\n }).map(function (block) {\n return BlockTree.generate(contentState, block, decorator);\n }));\n}", "title": "" }, { "docid": "abb95899dbec6f89eee57f0bd96e13f1", "score": "0.6250258", "text": "function regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n }).map(function (block) {\n return BlockTree.generate(content, block, decorator);\n }));\n}", "title": "" }, { "docid": "abb95899dbec6f89eee57f0bd96e13f1", "score": "0.6250258", "text": "function regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n }).map(function (block) {\n return BlockTree.generate(content, block, decorator);\n }));\n}", "title": "" }, { "docid": "abb95899dbec6f89eee57f0bd96e13f1", "score": "0.6250258", "text": "function regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n }).map(function (block) {\n return BlockTree.generate(content, block, decorator);\n }));\n}", "title": "" }, { "docid": "abb95899dbec6f89eee57f0bd96e13f1", "score": "0.6250258", "text": "function regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n }).map(function (block) {\n return BlockTree.generate(content, block, decorator);\n }));\n}", "title": "" }, { "docid": "abb95899dbec6f89eee57f0bd96e13f1", "score": "0.6250258", "text": "function regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n }).map(function (block) {\n return BlockTree.generate(content, block, decorator);\n }));\n}", "title": "" }, { "docid": "abb95899dbec6f89eee57f0bd96e13f1", "score": "0.6250258", "text": "function regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n }).map(function (block) {\n return BlockTree.generate(content, block, decorator);\n }));\n}", "title": "" }, { "docid": "abb95899dbec6f89eee57f0bd96e13f1", "score": "0.6250258", "text": "function regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n }).map(function (block) {\n return BlockTree.generate(content, block, decorator);\n }));\n}", "title": "" }, { "docid": "abb95899dbec6f89eee57f0bd96e13f1", "score": "0.6250258", "text": "function regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n }).map(function (block) {\n return BlockTree.generate(content, block, decorator);\n }));\n}", "title": "" }, { "docid": "abb95899dbec6f89eee57f0bd96e13f1", "score": "0.6250258", "text": "function regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n }).map(function (block) {\n return BlockTree.generate(content, block, decorator);\n }));\n}", "title": "" }, { "docid": "19c77d91572d0244e5a1d703c6951835", "score": "0.6096613", "text": "function regenerateTreeForNewDecorator(blockMap,previousTreeMap,decorator,existingDecorator){return previousTreeMap.merge(blockMap.toSeq().filter(function(block){return decorator.getDecorations(block)!==existingDecorator.getDecorations(block);}).map(function(block){return BlockTree.generate(block,decorator);}));}", "title": "" }, { "docid": "13624885c73d12c134606a2f0d5e18da", "score": "0.57264864", "text": "function regenerateTreeForNewDecorator(blockMap, previousTreeMap, decorator, existingDecorator) {\n\t return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n\t return decorator.getDecorations(block) !== existingDecorator.getDecorations(block);\n\t }).map(function (block) {\n\t return BlockTree.generate(block, decorator);\n\t }));\n\t}", "title": "" }, { "docid": "124b5390ca74c6d276c80805f79dc815", "score": "0.52239734", "text": "function mapInactives() {\n var mappedStates = {};\n angular.forEach(inactiveStates, function (state, name) {\n var stickyAncestors = getStickyStateStack(state);\n for (var i = 0; i < stickyAncestors.length; i++) {\n var parent = stickyAncestors[i].parent;\n mappedStates[parent.name] = mappedStates[parent.name] || [];\n mappedStates[parent.name].push(state);\n }\n if (mappedStates['']) {\n // This is necessary to compute Transition.inactives when there are sticky states are children to root state.\n mappedStates['__inactives'] = mappedStates['']; // jshint ignore:line\n }\n });\n return mappedStates;\n }", "title": "" }, { "docid": "124b5390ca74c6d276c80805f79dc815", "score": "0.52239734", "text": "function mapInactives() {\n var mappedStates = {};\n angular.forEach(inactiveStates, function (state, name) {\n var stickyAncestors = getStickyStateStack(state);\n for (var i = 0; i < stickyAncestors.length; i++) {\n var parent = stickyAncestors[i].parent;\n mappedStates[parent.name] = mappedStates[parent.name] || [];\n mappedStates[parent.name].push(state);\n }\n if (mappedStates['']) {\n // This is necessary to compute Transition.inactives when there are sticky states are children to root state.\n mappedStates['__inactives'] = mappedStates['']; // jshint ignore:line\n }\n });\n return mappedStates;\n }", "title": "" }, { "docid": "aefffe9074e36eec0a77d9b10a3d749b", "score": "0.5167813", "text": "rewriteCache() {\n this.cache = {\n levels: [],\n levelCount: 0,\n rows: [],\n nodeInfo: new WeakMap()\n };\n\n rangeEach(0, this.data.length - 1, (i) => {\n this.cacheNode(this.data[i], 0, null);\n });\n }", "title": "" }, { "docid": "a272d426e84e24389b18a630215f543a", "score": "0.48762017", "text": "buildTree() {\n\t\tthis.assignLevel(this.nodesList[0], 0);\n\t\tthis.positionMap = new Map();\n\t\tthis.assignPosition(this.nodesList[0], 0);\n\t}", "title": "" }, { "docid": "61f19c5baab6ee5763edc440f70450bc", "score": "0.48543477", "text": "function DraftMap(target, parent) {\n this[DRAFT_STATE] = {\n type: ProxyType.Map,\n parent: parent,\n scope: parent ? parent.scope : ImmerScope.current,\n modified: false,\n finalized: false,\n copy: undefined,\n assigned: undefined,\n base: target,\n draft: this,\n isManual: false,\n revoked: false\n };\n return this;\n }", "title": "" }, { "docid": "e0bbeab6f116c613efd4fc611a514cb0", "score": "0.48218372", "text": "_groupFloorsByBuildings() {\n this.floors.map = {}\n\n for (const id in this.floors.all) {\n let parent = this.floors.all[id].location_id;\n\n // Create a new parent if it doesnt exist yet in the map\n if (!this.floors.map.hasOwnProperty(parent)) {\n this.floors.map[parent] = [];\n }\n\n this.floors.map[parent].push(id);\n }\n }", "title": "" }, { "docid": "693392e6eb224096c4df2df24c9fbe62", "score": "0.47710732", "text": "function nodeChildrenAsMap(node){var map$$1={};if(node){node.children.forEach(function(child){return map$$1[child.value.outlet]=child;});}return map$$1;}", "title": "" }, { "docid": "9be264160579fafef9ec5f573b54bc23", "score": "0.4736886", "text": "evolve () {\n\n // make a new map\n let next = new Map();\n\n // loop over the x coordinates\n for (let x = 0; x < this.config.get(colsKey); ++x) {\n\n // loop over the y coordinates\n for (let y = 0; y < this.config.get(rowsKey); ++y) {\n\n // get the index\n let index = (x + y * this.config.get(colsKey));\n\n // get the old state\n let state = this.grid.get(index);\n\n // count the neighbours\n let neighbours = this.countNeighbours(x, y);\n\n // are we dealing with a living being?\n if (state == 1 && (neighbours < 2 || neighbours > 3)) next.set(index, 0);\n \n // are we dealing with a dead being?\n else if (state == 0 && neighbours == 3) next.set(index, 1);\n \n // normal state\n else next.set(index, state);\n }\n }\n\n // save the new grid\n this.grid = next;\n\n // return the grid\n return next;\n }", "title": "" }, { "docid": "385a037e4ba207bbd7b50146085869d4", "score": "0.4725783", "text": "init (initNodeMap, nodeId, parentId, collapseFn, comparatorFn) {\r\n\t\tvar node = initNodeMap[nodeId];\r\n\t\tif(nodeId == this.rootId){\r\n\t\t\tthis.nodeMap[this.rootId] = new TreeMapNode(this, node, parentId);\r\n\t\t}\r\n\r\n\t\tif(angular.isFunction(collapseFn) && collapseFn(node)) {\r\n\t\t\tif (!node.childIdList){\r\n\t\t\t\tnode.childIdList = [];\r\n\t\t\t}\r\n\t\t\t// If it's a collapse node, just return the initialized children results instead\r\n\t\t\treturn angular.element.map(node.childIdList, (childId) =>{\r\n\t\t\t\t// childId represents the child id under a collapsed parent we want to init\r\n\t\t\t\treturn this.init(initNodeMap, childId, parentId, collapseFn, comparatorFn);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tvar tmNode = this.nodeMap[node.id] = new TreeMapNode(this, node, parentId);\r\n\t\tthis.initChildren(initNodeMap, tmNode, collapseFn, comparatorFn);\r\n\t\treturn tmNode;\r\n\r\n\t}", "title": "" }, { "docid": "240502c11a608705e53341bdceec0ced", "score": "0.46577057", "text": "initCellMaps() {\n this.cellGroupIndexMap = {\n \"cell_0_0\":[0,3,6],\n \"cell_1_0\":[0,4],\n \"cell_2_0\":[0,5,7],\n \"cell_0_1\":[1,3],\n \"cell_1_1\":[1,4,6,7],\n \"cell_2_1\":[1,5],\n \"cell_0_2\":[2,3,7],\n \"cell_1_2\":[2,4],\n \"cell_2_2\":[2,5,6]\n };\n \n this.cellMap = [\n {\"id\":\"cell_0_0\", \"cellX\":0, \"cellY\":0},\n {\"id\":\"cell_1_0\", \"cellX\":1, \"cellY\":0},\n {\"id\":\"cell_2_0\", \"cellX\":2, \"cellY\":0},\n {\"id\":\"cell_0_1\", \"cellX\":0, \"cellY\":1},\n {\"id\":\"cell_1_1\", \"cellX\":1, \"cellY\":1},\n {\"id\":\"cell_2_1\", \"cellX\":2, \"cellY\":1},\n {\"id\":\"cell_0_2\", \"cellX\":0, \"cellY\":2},\n {\"id\":\"cell_1_2\", \"cellX\":1, \"cellY\":2},\n {\"id\":\"cell_2_2\", \"cellX\":2, \"cellY\":2}\n ];\n }", "title": "" }, { "docid": "a968d13034cb2efe35d964772a41c471", "score": "0.46259153", "text": "getState() {\n // TODO: exclude those with value = default?\n const me = this,\n state = {\n [me.flex ? 'flex' : 'width']: me.flex ? me.flex : me.width,\n id: me.id,\n hidden: me.hidden,\n index: me.allIndex,\n region: me.region,\n filterable: me.filterable,\n text: me.text,\n locked: me.locked\n };\n\n if (me.children) state.children = me.children.map((child) => child.getState());\n\n return state;\n }", "title": "" }, { "docid": "2aff2d95d2b522906e3b3a4a823e72e4", "score": "0.462195", "text": "replace(_from, _to, nodes) {\n return HeightMap.of(nodes);\n }", "title": "" }, { "docid": "e905b84df754bed91d83b875556bfc30", "score": "0.4620401", "text": "recalculateKeys() {\n const set = {};\n const inSet = _.propertyOf(set);\n const addKeys = (keys) => {\n _.chain(keys)\n .reject(inSet)\n .forEach((key) => {\n set[key] = true;\n addKeys(this.dependents[key]);\n })\n .value();\n };\n\n addKeys(_.keys(this.dirtyFlags));\n return _.filter(_.keys(set), _.propertyOf(this.cells));\n }", "title": "" }, { "docid": "a46df4e5247149cfba7db8239511ad4f", "score": "0.45876908", "text": "function nest() {\n\n\t var keysFunction = [];\n\t var sortKeysFunction = [];\n\n\t /**\n\t * map an Array into the mapObject.\n\t * @param {Array} array\n\t * @param {number} depth\n\t */\n\t function map(array, depth) {\n\t if (depth >= keysFunction.length) {\n\t return array;\n\t }\n\t var i = -1;\n\t var n = array.length;\n\t var keyFunction = keysFunction[depth++];\n\t var mapObject = {};\n\t var valuesByKey = {};\n\n\t while (++i < n) {\n\t var keyValue = keyFunction(array[i]);\n\t var values = valuesByKey[keyValue];\n\n\t if (values) {\n\t values.push(array[i]);\n\t } else {\n\t valuesByKey[keyValue] = [array[i]];\n\t }\n\t }\n\n\t zrUtil.each(valuesByKey, function (value, key) {\n\t mapObject[key] = map(value, depth);\n\t });\n\n\t return mapObject;\n\t }\n\n\t /**\n\t * transform the Map Object to multidimensional Array\n\t * @param {Object} map\n\t * @param {number} depth\n\t */\n\t function entriesMap(mapObject, depth) {\n\t if (depth >= keysFunction.length) {\n\t return mapObject;\n\t }\n\t var array = [];\n\t var sortKeyFunction = sortKeysFunction[depth++];\n\n\t zrUtil.each(mapObject, function (value, key) {\n\t array.push({\n\t key: key, values: entriesMap(value, depth)\n\t });\n\t });\n\n\t if (sortKeyFunction) {\n\t return array.sort(function (a, b) {\n\t return sortKeyFunction(a.key, b.key);\n\t });\n\t } else {\n\t return array;\n\t }\n\t }\n\n\t return {\n\t /**\n\t * specified the key to groupby the arrays.\n\t * users can specified one more keys.\n\t * @param {Function} d\n\t */\n\t key: function key(d) {\n\t keysFunction.push(d);\n\t return this;\n\t },\n\n\t /**\n\t * specified the comparator to sort the keys\n\t * @param {Function} order\n\t */\n\t sortKeys: function sortKeys(order) {\n\t sortKeysFunction[keysFunction.length - 1] = order;\n\t return this;\n\t },\n\n\t /**\n\t * the array to be grouped by.\n\t * @param {Array} array\n\t */\n\t entries: function entries(array) {\n\t return entriesMap(map(array, 0), 0);\n\t }\n\t };\n\t}", "title": "" }, { "docid": "1ba7f5d2a3ba9b082ba4bcccfbf166c0", "score": "0.45507398", "text": "function step2(map) {\n\tconst root = { name: '/', nodes: [] };\n\treturn (function next(map, parent, level) {\n\t\tObject.keys(map).forEach(key => {\n\t\t\tlet val = map[key];\n\t\t\tlet node = { name: key };\n\t\t\tif (typeof val === 'object') {\n\t\t\t\tnode.nodes = [];\n\t\t\t\tnode.open = level < 1;\n\t\t\t\tnext(val, node, level + 1);\n\t\t\t} else {\n\t\t\t\tnode.src = val;\n\t\t\t}\n\t\t\tparent.nodes.push(node);\n\t\t});\n\t\treturn parent;\n\t})(map, root, 0);\n}", "title": "" }, { "docid": "5944c6c8a0df5d588c78440a92d83264", "score": "0.45507008", "text": "function nodeChildrenAsMap(node) {\n var map$$1 = {};\n if (node) {\n node.children.forEach(function (child) { return map$$1[child.value.outlet] = child; });\n }\n return map$$1;\n}", "title": "" }, { "docid": "5944c6c8a0df5d588c78440a92d83264", "score": "0.45507008", "text": "function nodeChildrenAsMap(node) {\n var map$$1 = {};\n if (node) {\n node.children.forEach(function (child) { return map$$1[child.value.outlet] = child; });\n }\n return map$$1;\n}", "title": "" }, { "docid": "5944c6c8a0df5d588c78440a92d83264", "score": "0.45507008", "text": "function nodeChildrenAsMap(node) {\n var map$$1 = {};\n if (node) {\n node.children.forEach(function (child) { return map$$1[child.value.outlet] = child; });\n }\n return map$$1;\n}", "title": "" }, { "docid": "5c0fd49194f4f8b9c454430e9fc258c5", "score": "0.45501655", "text": "getState() {\n // TODO: exclude those with value = default?\n const me = this,\n state = {\n [me.flex ? 'flex' : 'width']: me.flex ? me.flex : me.width,\n id: me.id,\n hidden: me.hidden,\n index: me.allIndex,\n region: me.region,\n filterable: me.filterable,\n text: me.text,\n locked: me.locked\n };\n if (me.children) state.children = me.children.map(child => child.getState());\n return state;\n }", "title": "" }, { "docid": "449216315b69307ff38141e68fe77c41", "score": "0.45466214", "text": "static preserve() {\n // Initialize map\n let states = [];\n // Find all elements\n let elements = document.getElementsByTagName(\"*\");\n // Loop over all elements\n for (let element of elements) {\n // Make sure the element has an ID\n if (element.id.length === 0) {\n element.id = Math.floor(Math.random() * 1000000).toString();\n }\n // Add to object\n states.push([element.id, element.hasAttribute(\"hidden\")]);\n }\n // Return map\n return states;\n }", "title": "" }, { "docid": "9adfe50833ebe907d8fd70fe4b8b4919", "score": "0.45373163", "text": "toIndexedTree() {\r\n let builderIndex = -1;\r\n let lastOpId = -1;\r\n const idIndexMap = [];\r\n return this.toArray().map((op, index, arr) => {\r\n const opId = ++builderIndex;\r\n // track the array index => opId relationship\r\n idIndexMap.push(opId);\r\n // do path replacements\r\n op.path = opSetPathParamId(idIndexMap, opSetId(opId.toString(), op.path));\r\n if (lastOpId >= 0) {\r\n // if we have a parent do the replace\r\n op.path = opSetParentId(lastOpId.toString(), op.path);\r\n }\r\n // rewrite actions with placeholders replaced\r\n op.actions = op.actions.map(a => {\r\n const actionId = ++builderIndex;\r\n return opSetId(actionId.toString(), opSetPathId(opId.toString(), a));\r\n });\r\n // handle any specific child relationships\r\n this.getChildRelationship(index).forEach(childIndex => {\r\n // set the parent id for our non-immediate children, thus removing the token so it isn't overwritten\r\n arr[childIndex].path = opSetParentId(opId.toString(), arr[childIndex].path);\r\n });\r\n // and remember our last object path id for the parent replace above\r\n lastOpId = opId;\r\n return op;\r\n });\r\n }", "title": "" }, { "docid": "1819f5f0d0a934fa79ab42cc19437718", "score": "0.4537099", "text": "function StatePermissionMap(state) {\n var toStateObject = state.$$state();\n var toStatePath = toStateObject.path;\n\n angular.forEach(toStatePath, function (state) {\n if (areSetStatePermissions(state)) {\n var permissionMap = new PermissionMap(state.data.permissions);\n this.extendPermissionMap(permissionMap);\n }\n }, this);\n }", "title": "" }, { "docid": "b0081049f42b1a88fd875f00d90453f1", "score": "0.45260814", "text": "function flushMap() {\n _identityMap = {};\n}", "title": "" }, { "docid": "437e6fdc5dc118f08d59d5bd386ab0cf", "score": "0.45228046", "text": "function generateMap() {\n for (let x = 0; x < mapSize; x++) {\n map.push([]);\n for (let y = 0; y < mapSize; y++) {\n map[x].push(new Tile(x, y));\n }\n }\n\n generateOutline();\n}", "title": "" }, { "docid": "edf183baf4a30f529111f8c64d89d5e9", "score": "0.4516814", "text": "function buildMapper() {\n return new TreeMapperJustForLeaves(identity, identity, identity);\n}", "title": "" }, { "docid": "82c05f5abce5a4571fe8d5230701dc4b", "score": "0.45147488", "text": "function LazyMap() {\n this.store = {};\n}", "title": "" }, { "docid": "82c05f5abce5a4571fe8d5230701dc4b", "score": "0.45147488", "text": "function LazyMap() {\n this.store = {};\n}", "title": "" }, { "docid": "82c05f5abce5a4571fe8d5230701dc4b", "score": "0.45147488", "text": "function LazyMap() {\n this.store = {};\n}", "title": "" }, { "docid": "82c05f5abce5a4571fe8d5230701dc4b", "score": "0.45147488", "text": "function LazyMap() {\n this.store = {};\n}", "title": "" }, { "docid": "82c05f5abce5a4571fe8d5230701dc4b", "score": "0.45147488", "text": "function LazyMap() {\n this.store = {};\n}", "title": "" }, { "docid": "82c05f5abce5a4571fe8d5230701dc4b", "score": "0.45147488", "text": "function LazyMap() {\n this.store = {};\n}", "title": "" }, { "docid": "7f16002313d13438e1061804d5fca25e", "score": "0.451253", "text": "makeTree() {\n\t\tif (this.length === 0)\n\t\t\treturn [];\n\t\tlet base = this.data;\n\t\tlet dataTree = [];\n\t\tconst mappedWFItems = new Map();\n\t\tbase.forEach(wfItem => mappedWFItems.set(wfItem.id, {...wfItem}));\n\t\tbase.forEach(wfItem => {\n\t\t\tif (wfItem.parentID) {\n\t\t\t\tlet mfwItem = mappedWFItems.get(wfItem.parentID);\n\t\t\t\tif (!mfwItem.children)\n\t\t\t\t\tmfwItem.children = [];\n\t\t\t\tmfwItem.children.push(mappedWFItems.get(wfItem.id));\n\t\t\t}\n\t\t\telse dataTree.push(mappedWFItems.get(wfItem.id));\n\t\t});\n\t\t//Sort children via order prop!\n\t\tdataTree.forEach(twfItem => {\n\t\t\tif(twfItem.children && twfItem.children.length > 0){\n\t\t\t\ttwfItem.children = sortChildren(twfItem.children); \n\t\t\t}\n\t\t});\n\t\tthis.tree = dataTree;\n\t\tthis._mappedWFs = mappedWFItems;\n\t\treturn dataTree;\n\t}", "title": "" }, { "docid": "813214fb0c01e828d82084c08b89d3a6", "score": "0.45104536", "text": "getDLLMap() {\n return {\n 'BLOCK1_L': {\n start: 0,\n length: 1\n },\n 'BLOCK1_C': {\n start: 1,\n length: 1\n },\n 'BLOCK1_M': {\n start: 2,\n length: 2\n },\n 'BLOCK1_A': {\n start: 2,\n length: 8\n },\n 'BLOCK1_ID': {\n start: 4,\n length: 4\n },\n 'BLOCK1_VERSION': {\n start: 8,\n length: 1\n },\n 'BLOCK1_TYPE': {\n start: 9,\n length: 1\n }\n };\n }", "title": "" }, { "docid": "878e3e0fd571e17377e1efc11b7eab49", "score": "0.45047095", "text": "_segregateLocations() {\n this.locations.map = {};\n this.locations.grouped = [\n [], // Campuses\n [], // Buildings\n [], // Rooms\n ]\n\n for (const id in this.locations.all) {\n // To chuck it to its parent\n let parent = this.locations.all[id].parent_id;\n if (this.locations.all[id].parent_id === null || this.locations.all[id].parent_id === 0) {\n parent = 0;\n }\n\n // Create a new parent or add it to an existing parent\n if (!this.locations.map.hasOwnProperty(parent)) {\n this.locations.map[parent] = [];\n }\n \n this.locations.map[parent].push(id);\n\n // To segregate by type\n this.locations.grouped[this.locations.all[id].type].push(this.locations.all[id])\n }\n }", "title": "" }, { "docid": "894bbc950ede0c35da112cda016a75f5", "score": "0.45030156", "text": "getUrlBookmarkIdMap () {\n const bmEnts = this.bookmarkIdMap.entrySeq()\n\n // bmEnts :: Iterator<[BookmarkId,TabWindow]>\n const getSavedUrls = (tw) => tw.tabItems.map((ti) => ti.url)\n\n const bmUrls = bmEnts.map(([bmid, tw]) => getSavedUrls(tw).map(url => [url, bmid])).flatten(true)\n\n const groupedIds = bmUrls.groupBy(([url, bmid]) => url).map(vs => Immutable.Set(vs.map(([url, bmid]) => bmid)))\n // groupedIds :: Seq.Keyed<URL,Set<BookmarkId>>\n\n return Immutable.Map(groupedIds)\n }", "title": "" }, { "docid": "5f06a11e42ce50104afbc269a5aa215a", "score": "0.44963908", "text": "function mapChildren(box) {\n if (!map[box.level]) {\n map[box.level] = new Set()\n }\n map[box.level].add(box.id);\n if (box.children.length > 0) {\n box.children.forEach(item => mapChildren(file.data.find(samp => samp.id === item)))\n }\n }", "title": "" }, { "docid": "c30d1f51952c9d8d65879a86b391d7c2", "score": "0.44821137", "text": "refreshMap() {\n\t\tif (typeof this.map_ptr.doors !== 'undefined') {\n\t\t\tthis.map_ptr.doors.forEach((element, index, array) => {\n\t\t\t\tif (SaveState.doorsOpened.indexOf(element.id) > -1) {\n\t\t\t\t\tthis.map_ptr.layout[element.x + (element.y * this.map_ptr.width)] = Data.mapTiles.BRICK;\n\t\t\t\t} else {\n\t\t\t\t\tthis.map_ptr.layout[element.x + (element.y * this.map_ptr.width)] = Data.mapTiles.DOOR;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tif (typeof this.map_ptr.chests !== 'undefined') {\n\t\t\tthis.map_ptr.chests.forEach((element, index, array) => {\n\t\t\t\tif (SaveState.chestsOpened.indexOf(element.id) > -1) {\n\t\t\t\t\tthis.map_ptr.layout[element.x + (element.y * this.map_ptr.width)] = Data.mapTiles.BRICK;\n\t\t\t\t} else {\n\t\t\t\t\tthis.map_ptr.layout[element.x + (element.y * this.map_ptr.width)] = Data.mapTiles.CHEST;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "a93e962a9ca5909baf520422597910fd", "score": "0.44700083", "text": "function nest() {\n\n var keysFunction = [];\n var sortKeysFunction = [];\n\n /**\n * map an Array into the mapObject.\n * @param {Array} array\n * @param {number} depth\n */\n function map(array, depth) {\n if (depth >= keysFunction.length) {\n return array;\n }\n var i = -1;\n var n = array.length;\n var keyFunction = keysFunction[depth++];\n var mapObject = {};\n var valuesByKey = {};\n\n while (++i < n) {\n var keyValue = keyFunction(array[i]);\n var values = valuesByKey[keyValue];\n\n if (values) {\n values.push(array[i]);\n }\n else {\n valuesByKey[keyValue] = [array[i]];\n }\n }\n\n zrUtil.each(valuesByKey, function (value, key) {\n mapObject[key] = map(value, depth);\n });\n\n return mapObject;\n }\n\n /**\n * transform the Map Object to multidimensional Array\n * @param {Object} map\n * @param {number} depth\n */\n function entriesMap(mapObject, depth) {\n if (depth >= keysFunction.length) {\n return mapObject;\n }\n var array = [];\n var sortKeyFunction = sortKeysFunction[depth++];\n\n zrUtil.each(mapObject, function (value, key) {\n array.push({\n key: key, values: entriesMap(value, depth)\n });\n });\n\n if (sortKeyFunction) {\n return array.sort(function (a, b) {\n return sortKeyFunction(a.key, b.key);\n });\n }\n else {\n return array;\n }\n }\n\n return {\n /**\n * specified the key to groupby the arrays.\n * users can specified one more keys.\n * @param {Function} d\n */\n key: function (d) {\n keysFunction.push(d);\n return this;\n },\n\n /**\n * specified the comparator to sort the keys\n * @param {Function} order\n */\n sortKeys: function (order) {\n sortKeysFunction[keysFunction.length - 1] = order;\n return this;\n },\n\n /**\n * the array to be grouped by.\n * @param {Array} array\n */\n entries: function (array) {\n return entriesMap(map(array, 0), 0);\n }\n };\n }", "title": "" }, { "docid": "70b2a798781872fb376052ab29bdf6a2", "score": "0.4465233", "text": "function initHashMap() {\n const keys = Object.keys(testHashMap);\n keys.forEach((key) => {\n Object.defineProperty(testHashMap[key], \"_visited\", {value: false, enumerable: false, writable: true});\n });\n}", "title": "" }, { "docid": "d3c13d70c3227d6196198c6540464521", "score": "0.4456792", "text": "function contents(map, tight) {\n var minDepth = Infinity\n var index = -1\n var length = map.length\n var table\n\n // Find minimum depth.\n while (++index < length) {\n if (map[index].depth < minDepth) {\n minDepth = map[index].depth\n }\n }\n\n // Normalize depth.\n index = -1\n\n while (++index < length) {\n map[index].depth -= minDepth - 1\n }\n\n // Construct the main list.\n table = list()\n\n // Add TOC to list.\n index = -1\n\n while (++index < length) {\n insert(map[index], table, tight)\n }\n\n return table\n}", "title": "" }, { "docid": "46755182703e00e1a08154b0252d4446", "score": "0.44457528", "text": "renderMap() {\n const svg = select(this.refs.mountPoint);\n\n // Clear the SVG in case there's stuff already there.\n svg.selectAll('*').remove();\n\n // Add subnode group\n svg.append('g').attr('id', 'mindmap-subnodes');\n this.prepareNodes();\n\n // Bind data to SVG elements and set all the properties to render them.\n const connections = d3Connections(svg, this.props.connections);\n const { nodes, subnodes } = d3Nodes(svg, this.props.nodes);\n nodes.append('title').text(node => node.note);\n\n // Bind nodes and connections to the simulation.\n this.state.simulation\n .nodes(this.props.nodes)\n .force('link').links(this.props.connections);\n\n if (this.props.editable) {\n this.prepareEditor(svg, connections, nodes, subnodes);\n }\n\n // Tick the simulation 100 times.\n for (let i = 0; i < 100; i += 1) {\n this.state.simulation.tick();\n }\n onTick(connections, nodes, subnodes);\n\n // Add pan and zoom behavior and remove double click to zoom.\n svg.attr('viewBox', getViewBox(nodes.data()))\n .call(d3PanZoom(svg))\n .on('dblclick.zoom', null);\n }", "title": "" }, { "docid": "87dd9e13881e4b815660e4d7b51659bd", "score": "0.44426978", "text": "function updateStateMaps() {\n // XXX\n }", "title": "" }, { "docid": "48172880d91b83aaab9e5fe27e33718f", "score": "0.4407826", "text": "function ImmyMap(initMap) {\n if (initMap) {\n this.map = initMap;\n } else {\n this.map = null;\n }\n\n this.patchSource = null;\n this.patch = null;\n this.root = {};\n}", "title": "" }, { "docid": "a506c11343541fab5568590bb29f540a", "score": "0.4401864", "text": "_createAccessorMap() {\n return {\n a: val => this._reg8(RegMap.a, val),\n b: val => this._reg8(RegMap.b, val),\n c: val => this._reg8(RegMap.c, val),\n d: val => this._reg8(RegMap.d, val),\n e: val => this._reg8(RegMap.e, val),\n f: val => this._specialRegF(RegMap.f, val),\n h: val => this._reg8(RegMap.h, val),\n l: val => this._reg8(RegMap.l, val),\n af: val => this._specialRegAF(RegMap.af, val),\n bc: val => this._reg16(RegMap.bc, val),\n de: val => this._reg16(RegMap.de, val),\n hl: val => this._reg16(RegMap.hl, val),\n sp: val => this.sp(val),\n pc: val => this.pc(val),\n };\n }", "title": "" }, { "docid": "29d7767a2d35b3fcd6fe0195f00c2d9f", "score": "0.43991235", "text": "function ECHOTreeMap(instanceId, resourceType, refid, data) {\n if (refid == null) {\n refid = null;\n }\n if (data == null) {\n data = null;\n }\n ECHOTreeMap.__super__.constructor.call(this, instanceId, resourceType, refid);\n this._isSubtree = refid != null;\n if (data != null) {\n this._copyData(data);\n }\n }", "title": "" }, { "docid": "ce2f929fbab44c7e9781b4b3b8754f84", "score": "0.4386391", "text": "function createGameTree(gameState) {\n // getValidSubStates returns a list of game trees. \n return [gameState, function () { return getValidSubStates(gameState); }];\n}", "title": "" }, { "docid": "2e404094d2e853c610e101f0a1b2d290", "score": "0.43861616", "text": "function StatePermissionMap(state) {\n var toStateObject = state.$$permissionState();\n var toStatePath = toStateObject.path;\n\n angular.forEach(toStatePath, function (state) {\n if (areSetStatePermissions(state)) {\n var permissionMap = new PermPermissionMap(state.data.permissions);\n this.extendPermissionMap(permissionMap);\n }\n }, this);\n }", "title": "" }, { "docid": "179e4a95e238269a1b56330b4e6365a8", "score": "0.4382061", "text": "static loadLazyChildren(props, state) {\n const { instanceProps } = state;\n\n walk({\n treeData: instanceProps.treeData,\n getNodeKey: props.getNodeKey,\n callback: ({ node, path, lowerSiblingCounts, treeIndex }) => {\n // If the node has children defined by a function, and is either expanded\n // or set to load even before expansion, run the function.\n if (\n node.children &&\n typeof node.children === 'function' &&\n (node.expanded || props.loadCollapsedLazyChildren)\n ) {\n // Call the children fetching function\n node.children({\n node,\n path,\n lowerSiblingCounts,\n treeIndex,\n\n // Provide a helper to append the new data when it is received\n done: childrenArray =>\n props.onChange(\n changeNodeAtPath({\n treeData: instanceProps.treeData,\n path,\n newNode: ({ node: oldNode }) =>\n // Only replace the old node if it's the one we set off to find children\n // for in the first place\n oldNode === node\n ? {\n ...oldNode,\n children: childrenArray,\n }\n : oldNode,\n getNodeKey: props.getNodeKey,\n })\n ),\n });\n }\n },\n });\n }", "title": "" }, { "docid": "282354db075c85eb6df6610208161ce3", "score": "0.4380183", "text": "function traceMappings(tree) {\n // TODO: Eventually support sourceRoot, which has to be removed because the sources are already\n // fully resolved. We'll need to make sources relative to the sourceRoot before adding them.\n const gen = new _jridgewell_gen_mapping__WEBPACK_IMPORTED_MODULE_1__[\"GenMapping\"]({ file: tree.map.file });\n const { sources: rootSources, map } = tree;\n const rootNames = map.names;\n const rootMappings = Object(_jridgewell_trace_mapping__WEBPACK_IMPORTED_MODULE_0__[\"decodedMappings\"])(map);\n for (let i = 0; i < rootMappings.length; i++) {\n const segments = rootMappings[i];\n for (let j = 0; j < segments.length; j++) {\n const segment = segments[j];\n const genCol = segment[0];\n let traced = SOURCELESS_MAPPING;\n // 1-length segments only move the current generated column, there's no source information\n // to gather from it.\n if (segment.length !== 1) {\n const source = rootSources[segment[1]];\n traced = originalPositionFor(source, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : '');\n // If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a\n // respective segment into an original source.\n if (traced == null)\n continue;\n }\n const { column, line, name, content, source } = traced;\n Object(_jridgewell_gen_mapping__WEBPACK_IMPORTED_MODULE_1__[\"maybeAddSegment\"])(gen, i, genCol, source, line, column, name);\n if (source && content != null)\n Object(_jridgewell_gen_mapping__WEBPACK_IMPORTED_MODULE_1__[\"setSourceContent\"])(gen, source, content);\n }\n }\n return gen;\n}", "title": "" }, { "docid": "29d1749f15b0bdfebda2e50efd04d44d", "score": "0.43706027", "text": "getDelayedMappedDependencies() {\n let graph = new DependencyGraph();\n let tagPrefix = TemplateMap.tagPrefix;\n\n graph.addNode(tagPrefix + \"all\");\n\n let userConfigCollections = this.getUserConfigCollectionNames();\n\n // Add tags from named user config collections\n for (let tag of userConfigCollections) {\n graph.addNode(tagPrefix + tag);\n }\n\n for (let entry of this.map) {\n if (this.isPaginationOverAllCollections(entry)) {\n continue;\n }\n\n let paginationTagTarget = this.getPaginationTagTarget(entry);\n if (paginationTagTarget && this.isUserConfigCollectionName(paginationTagTarget)) {\n if (!graph.hasNode(entry.inputPath)) {\n graph.addNode(entry.inputPath);\n }\n graph.addDependency(entry.inputPath, tagPrefix + paginationTagTarget);\n\n if (!entry.data.eleventyExcludeFromCollections) {\n // Populates into collections.all\n graph.addDependency(tagPrefix + \"all\", entry.inputPath);\n\n this.addTagsToGraph(graph, entry.inputPath, entry.data.tags);\n }\n\n this.addDeclaredDependenciesToGraph(\n graph,\n entry.inputPath,\n entry.data.eleventyImport?.collections\n );\n }\n }\n\n return graph;\n }", "title": "" }, { "docid": "4d85eaadb8f0717429e928dd88d3bd77", "score": "0.43668747", "text": "function nodeChildrenAsMap(node) {\n var map = {};\n\n if (node) {\n node.children.forEach(function (child) {\n return map[child.value.outlet] = child;\n });\n }\n\n return map;\n }", "title": "" }, { "docid": "5fd20111e1ddddc9cd3d6c60bd634239", "score": "0.43645215", "text": "getState() {\n const tokens = [];\n const loopsMap = new Map();\n const loops = [];\n this.tokens.forEach(t => {\n if (t.loop)\n loopsMap.set(t.loop.id, t.loop);\n tokens.push(t.save());\n });\n loopsMap.forEach(l => { loops.push(l.save()); });\n const items = [];\n this.getItems().forEach(item => { items.push(item.save()); });\n const state = {\n source: this.source, items, tokens, loops,\n id: this.id, name: this.name, startedAt: this.startedAt, endedAt: this.endedAt,\n status: this.status, saved: this.saved, data: this.data, logs: this.logs, parentItemId: this.parentItemId\n };\n return state;\n }", "title": "" }, { "docid": "64545f94f3999f4975169cf8649e1b83", "score": "0.4363991", "text": "get moduleEntries(){\n var obj = {};\n // Scan current loads\n for (var key in this._system.loads){\n // Exclude loads that already existed when wrapper was created\n if (this._initialLoads.indexOf(key) === -1){\n // Get module exports for entry\n var moduleExports = exportsFromEntry(this._system.loads[key]);\n // If module.default is not a StateStore, it is a reloadable moduleEntry\n if (!moduleExports || !moduleExports.default || !moduleExports.default.prototype || !(moduleExports.default.prototype instanceof StateStore))\n obj[key] = this._system.loads[key];\n }\n }\n return obj;\n }", "title": "" }, { "docid": "1135f4a56b4b68365f864272ca374f41", "score": "0.4356582", "text": "buildNodeConversionMap(layers) {\n const nodeConversionMap = {};\n let keptNodes;\n for (const layer of this.layers) {\n keptNodes = layer instanceof Container ? 1 : 0;\n for (let originalNodeIndex = 0; originalNodeIndex < layer.inboundNodes.length; originalNodeIndex++) {\n const nodeKey = Container.nodeKey(layer, originalNodeIndex);\n if (this.containerNodes.has(nodeKey)) {\n // i.e. we mark it to be saved\n nodeConversionMap[nodeKey] = keptNodes;\n keptNodes += 1;\n }\n }\n }\n return nodeConversionMap;\n }", "title": "" }, { "docid": "16435c9b847e473f758921f35c085a20", "score": "0.435297", "text": "function loadAllMaps(parent) {\r\n\r\n mapDwrAction.getAllMaps(function(children) {\r\n for(var i=0; i<children.length; i++) {\r\n buildChildNode(parent, children[i]);\r\n } \r\n parent.state = parent.loadStates.LOADED;\r\n });\r\n parent.expand(); \r\n}", "title": "" }, { "docid": "6418af4ad678a6f47ec6dde232ed0367", "score": "0.43434873", "text": "function createStateMaps() {\n var root = d3.select('#states');\n var states = data.geo.states.features\n .sort(function(a, b) {\n return d3.ascending(a.id, b.id);\n });\n\n var div = root.selectAll('div.state')\n .data(states)\n .enter()\n .append('div')\n .attr('class', 'state')\n .attr('id', function(d) { return d.id; });\n\n div.append('h3')\n .text(function(d) { return d.id; });\n\n var svg = div.append('svg')\n .attr('class', 'map');\n\n var countiesByState = d3.nest()\n .key(function(d) { return d.properties.state; })\n .map(data.geo.counties.features);\n\n svg.append('g')\n .attr('class', 'areas counties')\n .selectAll('path.area')\n .data(function(d) {\n // XXX DC doesn't have counties\n return countiesByState[d.properties.state] || [];\n })\n .enter()\n .append('path')\n .attr('class', 'area')\n .attr('d', path)\n .append('title')\n .text(function(d) {\n return d.title;\n });\n\n svg.append('g')\n .attr('class', 'mesh counties')\n .append('path')\n .attr('class', 'mesh')\n .attr('d', path(data.geo.counties.mesh));\n\n svg.append('g')\n .attr('class', 'mask states')\n .selectAll('path.area')\n .data(function(d) {\n return states.filter(function(s) {\n return s !== d;\n });\n })\n .enter()\n .append('path')\n .attr('class', 'area mask')\n .attr('d', path);\n\n var mask = svg.append('path')\n .attr('class', 'area outline')\n .attr('d', path)\n .attr('stroke-width', 2);\n\n // see: <http://bl.ocks.org/shawnbot/9240915>\n var margin = 20;\n svg.attr('viewBox', function(d) {\n var bounds = path.bounds(d);\n var x = bounds[0][0];\n var y = bounds[0][1];\n var w = bounds[1][0] - x;\n var h = bounds[1][1] - y;\n var bbox = this.getBoundingClientRect();\n var scale = Math.max(w, h) / Math.min(bbox.width, bbox.height);\n var m = margin * scale;\n return [x - m, y - m, w + m * 2, h + m * 2].join(' ');\n });\n }", "title": "" }, { "docid": "c82d0cc3c2f5653fe20b3d181ef901e4", "score": "0.43404475", "text": "function DEFMAP(nodetype, generator) {\n nodetype.forEach(function(nodetype) {\n nodetype.DEFMETHOD(\"add_source_map\", generator);\n });\n }", "title": "" }, { "docid": "d4e47f5f03ca689f7cb54cbe98e3306b", "score": "0.43367732", "text": "_generateMap() {\n // Generate all the empty tiles\n var width = this.display.getOptions().width;\n var height = this.display.getOptions().height;\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n let tile = new Tile(\"empty\", x, y);\n let key = tile.getPositionKey();\n this.map[key] = tile;\n }\n }\n\n // Next, use celluar automata to lay down the first layer of resources\n // but make sure they meet the minimum bar\n var sumIronTiles = 0;\n while (sumIronTiles <= config.map.resources.iron.minTiles) {\n var ironMap = new ROT.Map.Cellular(width, height, { connected: true});\n // % chance to be iron\n ironMap.randomize(config.map.resources.iron.baseChance);\n // iterations smooth out and connect live tiles\n for (let i = 0; i < config.map.resources.iron.generations; i++) {\n ironMap.create();\n }\n // Check to ensure that we have a minimum number of iron tiles\n sumIronTiles = ironMap._map.flat().reduce(doSum, 0);\n }\n\n // Go through the map and change the tiles we touch to type \"iron\"\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n if (ironMap._map[x][y] == 1) {\n let key = `${x},${y}`\n let tile = this.map[key];\n let resourceAmount = this._calculateResourceAmount(x, y, ironMap._map, \"iron\");\n tile.addResources(\"iron\", resourceAmount);\n }\n }\n }\n\n // Same for coal\n var sumCoalTiles = 0;\n while (sumCoalTiles <= config.map.resources.coal.minTiles) {\n var coalMap = new ROT.Map.Cellular(width, height, { connected: true });\n coalMap.randomize(config.map.resources.coal.baseChance);\n for (let i = 0; i< config.map.resources.coal.generations; i++) {\n coalMap.create();\n }\n sumCoalTiles = coalMap._map.flat().reduce(doSum, 0);\n }\n\n // Change tiles to \"coal\", but only if they're empty!\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n if (coalMap._map[x][y] == 1) {\n let key = `${x},${y}`\n let tile = this.map[key];\n if (tile.tileType == \"empty\") {\n let resourceAmount = this._calculateResourceAmount(x, y, coalMap._map, \"coal\");\n tile.addResources(\"coal\", resourceAmount);\n }\n }\n }\n }\n\n // Same for copper\n var sumCopperTiles = 0;\n while (sumCopperTiles <= config.map.resources.copper.minTiles) {\n var copperMap = new ROT.Map.Cellular(width, height, { connected: true });\n copperMap.randomize(config.map.resources.copper.baseChance);\n for (let i = 0; i< config.map.resources.copper.generations; i++) {\n copperMap.create();\n }\n sumCopperTiles = copperMap._map.flat().reduce(doSum, 0);\n }\n\n // Change tiles to \"copper\", but only if they're empty!\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n if (copperMap._map[x][y] == 1) {\n let key = `${x},${y}`\n let tile = this.map[key];\n if (tile.tileType == \"empty\") {\n let resourceAmount = this._calculateResourceAmount(x, y, copperMap._map, \"copper\");\n tile.addResources(\"copper\", resourceAmount);\n }\n }\n }\n }\n }", "title": "" }, { "docid": "0fcba9923ae0d78c9f8a4ab47c0ec295", "score": "0.43347457", "text": "drawMap(){\n\t\tthis.blocks.forEach(function (e) {\n\t\t\te.draw();\n\t\t});\n\t}", "title": "" }, { "docid": "b33d05bb6c6fe72b8db08b1e48454a44", "score": "0.433407", "text": "async function createMaps() {\n const visited = [];\n let id = 0;\n\n for (let map of walkDir('.')) {\n if (!visited.includes(map.data.title)) {\n visited.push(map.data.title);\n map.data.id = id;\n id += 1;\n\n if (process.env.NODE_ENV === 'production') {\n await sleep(200);\n await fs.writeFile(map.path, JSON.stringify(map.data, null, 2));\n }\n\n await createMap(map.data, map.data.id);\n }\n }\n}", "title": "" }, { "docid": "a7289d06ae0b426e162c87df3dd01579", "score": "0.4333127", "text": "function nodeChildrenAsMap(node) {\n var map = {};\n if (node) {\n node.children.forEach(function (child) { return map[child.value.outlet] = child; });\n }\n return map;\n}", "title": "" }, { "docid": "19dc5cc4c72b639c0807f185e487ccc4", "score": "0.43249837", "text": "function buildSourceMapTree(input, loader) {\n const maps = asArray(input).map((m) => new _jridgewell_trace_mapping__WEBPACK_IMPORTED_MODULE_0__[\"TraceMap\"](m, ''));\n const map = maps.pop();\n for (let i = 0; i < maps.length; i++) {\n if (maps[i].sources.length > 1) {\n throw new Error(`Transformation map ${i} must have exactly one source file.\\n` +\n 'Did you specify these with the most recent transformation maps first?');\n }\n }\n let tree = build(map, loader, '', 0);\n for (let i = maps.length - 1; i >= 0; i--) {\n tree = MapSource(maps[i], [tree]);\n }\n return tree;\n}", "title": "" }, { "docid": "a8480ec96f20fe7265293924a73f56a9", "score": "0.43168098", "text": "function makeModuleFileMap(){\n\t\tvar modules = $(configMap.module_class);\n\t\tvar moduleItemTitles = $(configMap.module_item_class);\n\t\tstateMap.fileIDs = {};\n\t\tstateMap.fileTitles = {};\n\t\tstateMap.fileTypes = {};\n\t\t//loop through each module\n\t\tmodules.each(function(idx, elem){\n\t\t\t\n\t\t\t$moduleDiv = $(elem);\n\t\t\t//If the module is hidden, skip it\n\t\t\tif ($moduleDiv.css(\"display\") == \"none\") return;\n\n\t\t\t//Get the name of the module\n\t\t\tmoduleName = $moduleDiv.find(configMap.module_title_selector).html();\n\t\t\tstateMap.fileIDs[moduleName] = new Array();\n\n\t\t\t$moduleItems = $moduleDiv.find(configMap.module_item_class);\n\t\t\t\n\t\t\t$moduleItems.each(function(idx, elem){\n\t\t\t\tvar $item = $(elem);\n\t\t\t\tvar $type_icon = $item.find(\".type_icon\");\n\n\t\t\t\tif (configMap.downloadable_item_types.indexOf($type_icon.attr(\"title\")) >= 0){\n\t\t\t\t\tvar $link = $item.find(\"a\");\n\t\t\t\t\tvar ref = $link.attr(\"href\");\n\t\t\t\t\tvar title = $link.html();\n\t\t\t\t\tvar filetype = $type_icon.attr(\"title\");\n\t\t\t\t\tvar fileId = \"\";\n\t\t\t\t\tif (filetype === \"Attachment\" || filetype == \"Wiki Page\"){\n\t\t\t\t\t\tvar fileId = configMap.file_id_regexp.exec(ref)[1];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar fileId = ref;\n\t\t\t\t\t}\n\t\t\t\t\tstateMap.fileTypes[fileId] = $type_icon.attr(\"title\");\n\t\t\t\t\tstateMap.fileIDs[moduleName].push(fileId);\n\t\t\t\t\tstateMap.fileTitles[fileId] = title;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t});\n\t\t});\n\t\t\n\t}", "title": "" }, { "docid": "654721840d0db1de1305a08aba8f86f3", "score": "0.43160692", "text": "function updateIndexMap(pipelineBrowser, parentId, childrenList) {\n var indexObject = pipelineBrowser.data('proxyIndexMaps'), proxy, idx;\n if(indexObject === null || indexObject === undefined) {\n indexObject = {\n 'ProxyIdToProxy': {},\n 'ProxyIdToParentId': {}\n };\n pipelineBrowser.data('proxyIndexMaps', indexObject);\n }\n\n // Create fake root node that has the children\n if(parentId === 0) {\n indexObject.ProxyIdToProxy['0'] = {\n 'children': childrenList\n };\n }\n\n // Fill maps\n for(idx in childrenList) {\n proxy = childrenList[idx];\n indexObject.ProxyIdToProxy[proxy.proxy_id.toString()] = proxy;\n indexObject.ProxyIdToParentId[proxy.proxy_id.toString()] = parentId;\n if(proxy.hasOwnProperty(\"children\")) {\n updateIndexMap(pipelineBrowser, proxy.proxy_id, proxy.children);\n }\n }\n }", "title": "" }, { "docid": "21cffff865cda3b063fa872cec255f88", "score": "0.43017468", "text": "function nest() {\n var keysFunction = [];\n var sortKeysFunction = [];\n /**\n * map an Array into the mapObject.\n * @param {Array} array\n * @param {number} depth\n */\n\n function map(array, depth) {\n if (depth >= keysFunction.length) {\n return array;\n }\n\n var i = -1;\n var n = array.length;\n var keyFunction = keysFunction[depth++];\n var mapObject = {};\n var valuesByKey = {};\n\n while (++i < n) {\n var keyValue = keyFunction(array[i]);\n var values = valuesByKey[keyValue];\n\n if (values) {\n values.push(array[i]);\n } else {\n valuesByKey[keyValue] = [array[i]];\n }\n }\n\n zrUtil.each(valuesByKey, function (value, key) {\n mapObject[key] = map(value, depth);\n });\n return mapObject;\n }\n /**\n * transform the Map Object to multidimensional Array\n * @param {Object} map\n * @param {number} depth\n */\n\n\n function entriesMap(mapObject, depth) {\n if (depth >= keysFunction.length) {\n return mapObject;\n }\n\n var array = [];\n var sortKeyFunction = sortKeysFunction[depth++];\n zrUtil.each(mapObject, function (value, key) {\n array.push({\n key: key,\n values: entriesMap(value, depth)\n });\n });\n\n if (sortKeyFunction) {\n return array.sort(function (a, b) {\n return sortKeyFunction(a.key, b.key);\n });\n } else {\n return array;\n }\n }\n\n return {\n /**\n * specified the key to groupby the arrays.\n * users can specified one more keys.\n * @param {Function} d\n */\n key: function (d) {\n keysFunction.push(d);\n return this;\n },\n\n /**\n * specified the comparator to sort the keys\n * @param {Function} order\n */\n sortKeys: function (order) {\n sortKeysFunction[keysFunction.length - 1] = order;\n return this;\n },\n\n /**\n * the array to be grouped by.\n * @param {Array} array\n */\n entries: function (array) {\n return entriesMap(map(array, 0), 0);\n }\n };\n}", "title": "" }, { "docid": "21cffff865cda3b063fa872cec255f88", "score": "0.43017468", "text": "function nest() {\n var keysFunction = [];\n var sortKeysFunction = [];\n /**\n * map an Array into the mapObject.\n * @param {Array} array\n * @param {number} depth\n */\n\n function map(array, depth) {\n if (depth >= keysFunction.length) {\n return array;\n }\n\n var i = -1;\n var n = array.length;\n var keyFunction = keysFunction[depth++];\n var mapObject = {};\n var valuesByKey = {};\n\n while (++i < n) {\n var keyValue = keyFunction(array[i]);\n var values = valuesByKey[keyValue];\n\n if (values) {\n values.push(array[i]);\n } else {\n valuesByKey[keyValue] = [array[i]];\n }\n }\n\n zrUtil.each(valuesByKey, function (value, key) {\n mapObject[key] = map(value, depth);\n });\n return mapObject;\n }\n /**\n * transform the Map Object to multidimensional Array\n * @param {Object} map\n * @param {number} depth\n */\n\n\n function entriesMap(mapObject, depth) {\n if (depth >= keysFunction.length) {\n return mapObject;\n }\n\n var array = [];\n var sortKeyFunction = sortKeysFunction[depth++];\n zrUtil.each(mapObject, function (value, key) {\n array.push({\n key: key,\n values: entriesMap(value, depth)\n });\n });\n\n if (sortKeyFunction) {\n return array.sort(function (a, b) {\n return sortKeyFunction(a.key, b.key);\n });\n } else {\n return array;\n }\n }\n\n return {\n /**\n * specified the key to groupby the arrays.\n * users can specified one more keys.\n * @param {Function} d\n */\n key: function (d) {\n keysFunction.push(d);\n return this;\n },\n\n /**\n * specified the comparator to sort the keys\n * @param {Function} order\n */\n sortKeys: function (order) {\n sortKeysFunction[keysFunction.length - 1] = order;\n return this;\n },\n\n /**\n * the array to be grouped by.\n * @param {Array} array\n */\n entries: function (array) {\n return entriesMap(map(array, 0), 0);\n }\n };\n}", "title": "" }, { "docid": "21cffff865cda3b063fa872cec255f88", "score": "0.43017468", "text": "function nest() {\n var keysFunction = [];\n var sortKeysFunction = [];\n /**\n * map an Array into the mapObject.\n * @param {Array} array\n * @param {number} depth\n */\n\n function map(array, depth) {\n if (depth >= keysFunction.length) {\n return array;\n }\n\n var i = -1;\n var n = array.length;\n var keyFunction = keysFunction[depth++];\n var mapObject = {};\n var valuesByKey = {};\n\n while (++i < n) {\n var keyValue = keyFunction(array[i]);\n var values = valuesByKey[keyValue];\n\n if (values) {\n values.push(array[i]);\n } else {\n valuesByKey[keyValue] = [array[i]];\n }\n }\n\n zrUtil.each(valuesByKey, function (value, key) {\n mapObject[key] = map(value, depth);\n });\n return mapObject;\n }\n /**\n * transform the Map Object to multidimensional Array\n * @param {Object} map\n * @param {number} depth\n */\n\n\n function entriesMap(mapObject, depth) {\n if (depth >= keysFunction.length) {\n return mapObject;\n }\n\n var array = [];\n var sortKeyFunction = sortKeysFunction[depth++];\n zrUtil.each(mapObject, function (value, key) {\n array.push({\n key: key,\n values: entriesMap(value, depth)\n });\n });\n\n if (sortKeyFunction) {\n return array.sort(function (a, b) {\n return sortKeyFunction(a.key, b.key);\n });\n } else {\n return array;\n }\n }\n\n return {\n /**\n * specified the key to groupby the arrays.\n * users can specified one more keys.\n * @param {Function} d\n */\n key: function (d) {\n keysFunction.push(d);\n return this;\n },\n\n /**\n * specified the comparator to sort the keys\n * @param {Function} order\n */\n sortKeys: function (order) {\n sortKeysFunction[keysFunction.length - 1] = order;\n return this;\n },\n\n /**\n * the array to be grouped by.\n * @param {Array} array\n */\n entries: function (array) {\n return entriesMap(map(array, 0), 0);\n }\n };\n}", "title": "" }, { "docid": "2b2ad5df65161f0624c36df6cef76e37", "score": "0.4297273", "text": "clone() {\n return new TileTree(this.root.clone(), this.next_id);\n }", "title": "" } ]
df5080a0b70764775ffbf1f0747f21cc
Operations for dealing with CSS properties. This creates a string that is expected to be equivalent to the style attribute generated by serverside rendering. It bypasses warnings and security checks so it's not safe to use this value for anything other than comparison. It is only used in DEV for SSR validation.
[ { "docid": "3a949afb7a1de3027e497761647eaf64", "score": "0.0", "text": "function createDangerousStringForStyles(styles) {\n {\n var serialized = '';\n var delimiter = '';\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n var styleValue = styles[styleName];\n if (styleValue != null) {\n var isCustomProperty = styleName.indexOf('--') === 0;\n serialized += delimiter + hyphenateStyleName(styleName) + ':';\n serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n\n delimiter = ';';\n }\n }\n return serialized || null;\n }\n}", "title": "" } ]
[ { "docid": "b61efe4abbc31460d30ece2a7f9f1b2f", "score": "0.67084634", "text": "get cssText(){var properties=[];for(var i=0,length=this.length;i<length;++i){var name=this[i];var value=this.getPropertyValue(name);var priority=this.getPropertyPriority(name);if(priority){priority=\" !\"+priority;}properties[i]=name+\": \"+value+priority+\";\";}return properties.join(\" \");}", "title": "" }, { "docid": "b0b60d25120307abf9ca7712d907de79", "score": "0.66190463", "text": "function cssProp(properties){\n\t return Modernizr.prefixed(properties).replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-');\n\t }", "title": "" }, { "docid": "111ecbde595121b33a703b3c75d2744f", "score": "0.65586305", "text": "function getStyle() {\r\n var str = '';\r\n str += 'position:absolute;right:0;top:0;';\r\n //str += 'box-shadow:inset 0 0 1px 1px #000;';\r\n str += 'height:calc(100% - ' + props.xsize + 'px);';\r\n str += 'width:calc(100% - ' + props.ysize + 'px);';\r\n return str;\r\n }", "title": "" }, { "docid": "afcbca8e1f1fbce502f111326eddc1cc", "score": "0.65233845", "text": "get cssText(){\n\t\tvar properties = [];\n\t\tfor (var i=0, length=this.length; i < length; ++i) {\n\t\t\tvar name = this[i];\n\t\t\tvar value = this.getPropertyValue(name);\n\t\t\tvar priority = this.getPropertyPriority(name);\n\t\t\tif (priority) {\n\t\t\t\tpriority = \" !\" + priority;\n\t\t\t}\n\t\t\tproperties[i] = name + \": \" + value + priority + \";\";\n\t\t}\n\t\treturn properties.join(\" \");\n\t}", "title": "" }, { "docid": "afcbca8e1f1fbce502f111326eddc1cc", "score": "0.65233845", "text": "get cssText(){\n\t\tvar properties = [];\n\t\tfor (var i=0, length=this.length; i < length; ++i) {\n\t\t\tvar name = this[i];\n\t\t\tvar value = this.getPropertyValue(name);\n\t\t\tvar priority = this.getPropertyPriority(name);\n\t\t\tif (priority) {\n\t\t\t\tpriority = \" !\" + priority;\n\t\t\t}\n\t\t\tproperties[i] = name + \": \" + value + priority + \";\";\n\t\t}\n\t\treturn properties.join(\" \");\n\t}", "title": "" }, { "docid": "d0f9afab13d3f2e7aa5413eafe756a04", "score": "0.6514413", "text": "get styleString() {\n return `left: ${this.left}px; `\n + `top: ${this.top}px; `\n + `width: ${this.width}px; `\n + `height: ${this.height}px;`\n }", "title": "" }, { "docid": "d5337647df448d1a42aa8f8bedd80391", "score": "0.6430875", "text": "get cssText(){\n\t\tvar properties = [];\n\t\tfor (var i=0, length=this.length; i < length; ++i) {\n var name, value, priority;\n if (this[i] instanceof Array) {\n\t\t\t name = this[i][0];\n\t\t\t value = this[i][1];\n\t\t\t priority = this[i][2];\n\t\t\t if (priority) {\n\t\t\t\t priority = \" !\" + priority;\n }\n } else {\n\t\t\t name = this[i];\n\t\t\t value = this.getPropertyValue(name);\n\t\t\t priority = this.getPropertyPriority(name);\n\t\t\t if (priority) {\n\t\t\t\t priority = \" !\" + priority;\n\t\t\t }\n }\n\t\t\tproperties[i] = name + \": \" + value + priority + \";\";\n\t\t}\n\t\treturn properties.join(\" \");\n\t}", "title": "" }, { "docid": "e37d2f320c26f6c09485b48ccc9c54cd", "score": "0.63027054", "text": "function cssVar(str)\r\n{\r\n return window.getComputedStyle(document.documentElement).getPropertyValue(str)\r\n}", "title": "" }, { "docid": "f88d9231e4f51d1ecfe3e80366571480", "score": "0.62610096", "text": "cssProperty() {\n const prop = _.sample(Object.keys(DEVELOPMENT.CSS_PROPERTIES));\n let val = DEVELOPMENT.CSS_PROPERTIES[prop];\n if (_.isArray(val)) {\n val = _.sample(val);\n } else if (val === 'color') {\n val = this.text.hexColor();\n } else if (val === 'size') {\n val = `${_.random(1, 99)}${_.sample(DEVELOPMENT.CSS_SIZE_UNITS)}`\n }\n return `${prop}: ${val}`\n }", "title": "" }, { "docid": "6110ff8af4d1232bda39fbd8f96122cf", "score": "0.62523", "text": "function computedStyle(el, prop) {\n if (!el || !prop) {\n return '';\n }\n\n if (typeof _window2['default'].getComputedStyle === 'function') {\n var cs = _window2['default'].getComputedStyle(el);\n\n return cs ? cs[prop] : '';\n }\n\n return el.currentStyle[prop] || '';\n}", "title": "" }, { "docid": "c7044523ab6df4b53324d6357fbb2f1a", "score": "0.6242667", "text": "function _styleAttr(style) {\n return _.map(style, (value, prop) => `${prop}: ${value};`).join(' ');\n}", "title": "" }, { "docid": "04a5d9c218f1b3bd2e3e9ef12a8b9198", "score": "0.61739916", "text": "get styleValue() {\n return this.__metadata.style.value;\n }", "title": "" }, { "docid": "38f84cd0f768b8c17f8a567833e86969", "score": "0.61681503", "text": "function styleToString(key, value) {\n if (typeof value === 'number' && value !== 0 && !CSS_NUMBER[key]) {\n return key + \":\" + value + \"px\";\n }\n return key + \":\" + value;\n}", "title": "" }, { "docid": "38f84cd0f768b8c17f8a567833e86969", "score": "0.61681503", "text": "function styleToString(key, value) {\n if (typeof value === 'number' && value !== 0 && !CSS_NUMBER[key]) {\n return key + \":\" + value + \"px\";\n }\n return key + \":\" + value;\n}", "title": "" }, { "docid": "38f84cd0f768b8c17f8a567833e86969", "score": "0.61681503", "text": "function styleToString(key, value) {\n if (typeof value === 'number' && value !== 0 && !CSS_NUMBER[key]) {\n return key + \":\" + value + \"px\";\n }\n return key + \":\" + value;\n}", "title": "" }, { "docid": "f75310e79c7a5c21190fe8394e9fcb89", "score": "0.61480844", "text": "function cssToStr(cssProps) {\r\n var statements = [];\r\n $.each(cssProps, function (name, val) {\r\n if (val != null) {\r\n statements.push(name + ':' + val);\r\n }\r\n });\r\n return statements.join(';');\r\n}", "title": "" }, { "docid": "f75310e79c7a5c21190fe8394e9fcb89", "score": "0.61480844", "text": "function cssToStr(cssProps) {\r\n var statements = [];\r\n $.each(cssProps, function (name, val) {\r\n if (val != null) {\r\n statements.push(name + ':' + val);\r\n }\r\n });\r\n return statements.join(';');\r\n}", "title": "" }, { "docid": "f75310e79c7a5c21190fe8394e9fcb89", "score": "0.61480844", "text": "function cssToStr(cssProps) {\r\n var statements = [];\r\n $.each(cssProps, function (name, val) {\r\n if (val != null) {\r\n statements.push(name + ':' + val);\r\n }\r\n });\r\n return statements.join(';');\r\n}", "title": "" }, { "docid": "762dd40071df75b1e45b6d4b93363b00", "score": "0.61301523", "text": "function createCssString(){\n\n var css = '';\n\n for (var id in cssRules){\n\n css += cssRules[id];\n }\n\n return css;\n }", "title": "" }, { "docid": "7a33fa39a7243035a3d5c4b7d2ccc9b2", "score": "0.61241376", "text": "function getCss(propertyInfo, value) {\n let rules; // Protect against unexpected values\n\n const valueType = typeof value;\n\n if (valueType !== 'string' && valueType !== 'number') {\n if (process.env.NODE_ENV !== 'production') {\n const name = propertyInfo.jsName;\n const encodedValue = JSON.stringify(value);\n console.error(`📦 ui-box: property “${name}” was passed invalid value “${encodedValue}”. Only numbers and strings are supported.`);\n }\n\n return null;\n }\n\n const valueString = value_to_string_1.default(value, propertyInfo.defaultUnit);\n const className = get_class_name_1.default(propertyInfo, valueString); // Avoid running the prefixer when possible because it's slow\n\n if (propertyInfo.isPrefixed) {\n rules = prefixer_1$1.default(propertyInfo.jsName || '', valueString);\n } else {\n rules = [{\n property: propertyInfo.cssName || '',\n value: valueString\n }];\n }\n\n let styles;\n\n if (process.env.NODE_ENV === 'production') {\n const rulesString = rules.map(rule => `${rule.property}:${rule.value}`).join(';');\n styles = `.${className}{${rulesString}}`;\n } else {\n const rulesString = rules.map(rule => ` ${rule.property}: ${rule.value};`).join('\\n');\n styles = `\n.${className} {\n${rulesString}\n}`;\n }\n\n return {\n className,\n styles\n };\n}", "title": "" }, { "docid": "8312a99b9cb938448198e00c8012e89d", "score": "0.61129713", "text": "function styleStringToString(name, value) {\n\t if (value == null) {\n\t return '';\n\t }\n\t if (typeof value === 'number' && value !== 0 && !CSS_NUMBER[name]) {\n\t value += 'px';\n\t }\n\t return name + \":\" + String(value).replace(/([\\{\\}\\[\\]])/g, '\\\\$1');\n\t}", "title": "" }, { "docid": "7b5f2c8443159421fff2f5172cadc2c4", "score": "0.61097085", "text": "function validStyles(styleAttr){\n var result = '';\n var styleArray = styleAttr.split(';');\n angular.forEach(styleArray, function(value){\n var v = value.split(':');\n if(v.length == 2){\n var key = trim(angular.lowercase(v[0]));\n var value = trim(angular.lowercase(v[1]));\n if(\n (key === 'color' || key === 'background-color') && (\n value.match(/^rgb\\([0-9%,\\. ]*\\)$/i)\n || value.match(/^rgba\\([0-9%,\\. ]*\\)$/i)\n || value.match(/^hsl\\([0-9%,\\. ]*\\)$/i)\n || value.match(/^hsla\\([0-9%,\\. ]*\\)$/i)\n || value.match(/^#[0-9a-f]{3,6}$/i)\n || value.match(/^[a-z]*$/i)\n )\n ||\n key === 'text-align' && (\n value === 'left'\n || value === 'right'\n || value === 'center'\n || value === 'justify'\n )\n ||\n key === 'text-decoration' && (\n value === 'underline'\n || value === 'line-through'\n )\n ||\n key === 'font-weight' && (\n value === 'bold'\n )\n ||\n key === 'font-style' && (\n value === 'italic'\n )\n ||\n key === 'float' && (\n value === 'left'\n || value === 'right'\n || value === 'none'\n )\n ||\n key === 'vertical-align' && (\n value === 'baseline'\n || value === 'sub'\n || value === 'super'\n || value === 'test-top'\n || value === 'text-bottom'\n || value === 'middle'\n || value === 'top'\n || value === 'bottom'\n || value.match(/[0-9]*(px|em)/)\n || value.match(/[0-9]+?%/)\n )\n ||\n key === 'font-size' && (\n value === 'xx-small'\n || value === 'x-small'\n || value === 'small'\n || value === 'medium'\n || value === 'large'\n || value === 'x-large'\n || value === 'xx-large'\n || value === 'larger'\n || value === 'smaller'\n || value.match(/[0-9]*\\.?[0-9]*(px|em|rem|mm|q|cm|in|pt|pc|%)/)\n )\n ||\n (key === 'width' || key === 'height') && (\n value.match(/[0-9\\.]*(px|em|rem|%)/)\n )\n || // Reference #520\n (key === 'direction' && value.match(/^ltr|rtl|initial|inherit$/))\n ) result += key + ': ' + value + ';';\n }\n });\n return result;\n }", "title": "" }, { "docid": "3c8b3bd6dde127d89f9dfcfdd0773090", "score": "0.6107253", "text": "get style() {\n if (!this.input || !this.input.style) return undefined;\n\n const result = {};\n Object.getOwnPropertyNames(this.input.style).forEach(propName => {\n result[propName.replace(UNDERSCORE_PATTERN, '-')] = this.input.style[propName];\n });\n return result;\n }", "title": "" }, { "docid": "f286682bdd6381a8188a5fb1a7d713c8", "score": "0.608041", "text": "function getStyle(rule, prop) {\n try {\n return rule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n }", "title": "" }, { "docid": "72ebcf1a28f1747df475161a4fd83967", "score": "0.6074594", "text": "function cssToStr(cssProps) {\n var statements = [];\n $.each(cssProps, function (name, val) {\n if (val != null) {\n statements.push(name + ':' + val);\n }\n });\n return statements.join(';');\n}", "title": "" }, { "docid": "72ebcf1a28f1747df475161a4fd83967", "score": "0.6074594", "text": "function cssToStr(cssProps) {\n var statements = [];\n $.each(cssProps, function (name, val) {\n if (val != null) {\n statements.push(name + ':' + val);\n }\n });\n return statements.join(';');\n}", "title": "" }, { "docid": "72ebcf1a28f1747df475161a4fd83967", "score": "0.6074594", "text": "function cssToStr(cssProps) {\n var statements = [];\n $.each(cssProps, function (name, val) {\n if (val != null) {\n statements.push(name + ':' + val);\n }\n });\n return statements.join(';');\n}", "title": "" }, { "docid": "72ebcf1a28f1747df475161a4fd83967", "score": "0.6074594", "text": "function cssToStr(cssProps) {\n var statements = [];\n $.each(cssProps, function (name, val) {\n if (val != null) {\n statements.push(name + ':' + val);\n }\n });\n return statements.join(';');\n}", "title": "" }, { "docid": "72ebcf1a28f1747df475161a4fd83967", "score": "0.6074594", "text": "function cssToStr(cssProps) {\n var statements = [];\n $.each(cssProps, function (name, val) {\n if (val != null) {\n statements.push(name + ':' + val);\n }\n });\n return statements.join(';');\n}", "title": "" }, { "docid": "72ebcf1a28f1747df475161a4fd83967", "score": "0.6074594", "text": "function cssToStr(cssProps) {\n var statements = [];\n $.each(cssProps, function (name, val) {\n if (val != null) {\n statements.push(name + ':' + val);\n }\n });\n return statements.join(';');\n}", "title": "" }, { "docid": "9568f0205b7573fdb745db32e1f6c46a", "score": "0.60686105", "text": "function getCss(propertyInfo, value) {\n let rules;\n // Protect against unexpected values\n const valueType = typeof value;\n if (valueType !== 'string' && valueType !== 'number') {\n if (true) {\n const name = propertyInfo.jsName;\n const encodedValue = JSON.stringify(value);\n console.error(`📦 ui-box: property “${name}” was passed invalid value “${encodedValue}”. Only numbers and strings are supported.`);\n }\n return null;\n }\n const valueString = value_to_string_1.default(value, propertyInfo.defaultUnit);\n const className = get_class_name_1.default(propertyInfo, valueString);\n // Avoid running the prefixer when possible because it's slow\n if (propertyInfo.isPrefixed) {\n rules = prefixer_1.default(propertyInfo.jsName || '', valueString);\n }\n else {\n rules = [{ property: propertyInfo.cssName || '', value: valueString }];\n }\n let styles;\n if (false) {}\n else {\n const rulesString = rules\n .map(rule => ` ${rule.property}: ${rule.value};`)\n .join('\\n');\n styles = `\n.${className} {\n${rulesString}\n}`;\n }\n return { className, styles };\n}", "title": "" }, { "docid": "5aa327e62bbdf9952ced40035b75ecca", "score": "0.6059563", "text": "function _sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (isDevMode()) {\n console.warn(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}", "title": "" }, { "docid": "5aa327e62bbdf9952ced40035b75ecca", "score": "0.6059563", "text": "function _sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (isDevMode()) {\n console.warn(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}", "title": "" }, { "docid": "5aa327e62bbdf9952ced40035b75ecca", "score": "0.6059563", "text": "function _sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (isDevMode()) {\n console.warn(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}", "title": "" }, { "docid": "5aa327e62bbdf9952ced40035b75ecca", "score": "0.6059563", "text": "function _sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (isDevMode()) {\n console.warn(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}", "title": "" }, { "docid": "5aa327e62bbdf9952ced40035b75ecca", "score": "0.6059563", "text": "function _sanitizeStyle(value) {\n value = String(value).trim(); // Make sure it's actually a string.\n if (!value)\n return '';\n // Single url(...) values are supported, but only for URLs that sanitize cleanly. See above for\n // reasoning behind this.\n var urlMatch = value.match(URL_RE);\n if ((urlMatch && _sanitizeUrl(urlMatch[1]) === urlMatch[1]) ||\n value.match(SAFE_STYLE_VALUE) && hasBalancedQuotes(value)) {\n return value; // Safe style values.\n }\n if (isDevMode()) {\n console.warn(\"WARNING: sanitizing unsafe style value \" + value + \" (see http://g.co/ng/security#xss).\");\n }\n return 'unsafe';\n}", "title": "" }, { "docid": "7f5ab95370008daeeeca6544aac5865c", "score": "0.6030059", "text": "function styleToString(name, value) {\n if (typeof value === 'number' && value !== 0 && !CSS_NUMBER[name]) {\n value = value + \"px\";\n }\n return name + \":\" + String(value).replace(/([\\{\\}\\[\\]])/g, '\\\\$1');\n}", "title": "" }, { "docid": "36c9885f0a1a1c0821fcee5372c45835", "score": "0.60223037", "text": "function mapJSStylePropertyToCSS(property)\r\n{\r\n if\r\n (\r\n (ua == \"iewin\" && typeof specialStyleMap[property] != undefined) || // If it's not in the map, typeof is undefined in IE but defined in Moz\r\n (ua != \"iewin\" && specialStyleMap[property]) // need to short-circuit before IE hits this so it doesn't throw an exception\r\n )\r\n return specialStyleMap[property];\r\n if ((new RegExp(\"[AZ]+\")).test(property))\r\n return property;\r\n\r\n var outStr = \"\";\r\n for (var i = 0; i < property.length; i++)\r\n {\r\n var chCode = property.charCodeAt(i);\r\n outStr += chCode >= 97 ? property.charAt(i) : \"-\" + String.fromCharCode(chCode + 32);\r\n }\r\n\r\n return outStr;\r\n}", "title": "" }, { "docid": "af5cfad9c94c037d5a02556984dd1796", "score": "0.6000928", "text": "function getStyle(target, prop) {\n try {\n if (window.getComputedStyle) { // gecko and webkit\n prop = prop.replace(/([a-z])([A-Z])/, hyphenate); // requires hyphenated, not camel\n return window.getComputedStyle(target, null).getPropertyValue(prop);\n }\n if (target.currentStyle) { // ie\n return target.currentStyle[prop];\n }\n return target.style[prop];\n }\n catch (e) {\n }\n return \"\";\n }", "title": "" }, { "docid": "a6dba0e5d1cba1511283658dd65418b1", "score": "0.59879524", "text": "function cssProps(props) {\n var ret = [];\n for (var p in props) {\n if (props.hasOwnProperty(p)) {\n ret.push(p + ':' + props[p]);\n }\n }\n return ret.join(';');\n }", "title": "" }, { "docid": "3b2845584d56b00f6a818094c23a63a6", "score": "0.59819794", "text": "function s(t){return getComputedStyle(t)}", "title": "" }, { "docid": "136b2866fcb73e64856c66bece9a9506", "score": "0.5970318", "text": "normalizeInlineCSSValue() {\n return null;\n }", "title": "" }, { "docid": "c151b219f355ada2ee421b6226782ba6", "score": "0.5962661", "text": "function validStyles(styleAttr){\r\n\tvar result = '';\r\n\tvar styleArray = styleAttr.split(';');\r\n\tangular.forEach(styleArray, function(value){\r\n\t\tvar v = value.split(':');\r\n\t\tif(v.length == 2){\r\n\t\t\tvar key = trim(angular.lowercase(v[0]));\r\n\t\t\tvar value = trim(angular.lowercase(v[1]));\r\n\t\t\tif(\r\n\t\t\t\t(key === 'color' || key === 'background-color') && (\r\n\t\t\t\t\tvalue.match(/^rgb\\([0-9%,\\. ]*\\)$/i)\r\n\t\t\t\t\t|| value.match(/^rgba\\([0-9%,\\. ]*\\)$/i)\r\n\t\t\t\t\t|| value.match(/^hsl\\([0-9%,\\. ]*\\)$/i)\r\n\t\t\t\t\t|| value.match(/^hsla\\([0-9%,\\. ]*\\)$/i)\r\n\t\t\t\t\t|| value.match(/^#[0-9a-f]{3,6}$/i)\r\n\t\t\t\t\t|| value.match(/^[a-z]*$/i)\r\n\t\t\t\t)\r\n\t\t\t||\r\n\t\t\t\tkey === 'text-align' && (\r\n\t\t\t\t\tvalue === 'left'\r\n\t\t\t\t\t|| value === 'right'\r\n\t\t\t\t\t|| value === 'center'\r\n\t\t\t\t\t|| value === 'justify'\r\n\t\t\t\t)\r\n\t\t\t||\r\n key === 'text-decoration' && (\r\n value === 'underline'\r\n || value === 'line-through'\r\n )\r\n || \r\n key === 'font-weight' && (\r\n value === 'bold'\r\n )\r\n ||\r\n key === 'font-style' && (\r\n value === 'italic'\r\n )\r\n ||\r\n key === 'float' && (\r\n value === 'left'\r\n || value === 'right'\r\n || value === 'none'\r\n )\r\n ||\r\n key === 'vertical-align' && (\r\n value === 'baseline'\r\n || value === 'sub'\r\n || value === 'super'\r\n || value === 'test-top'\r\n || value === 'text-bottom'\r\n || value === 'middle'\r\n || value === 'top'\r\n || value === 'bottom'\r\n || value.match(/[0-9]*(px|em)/)\r\n || value.match(/[0-9]+?%/)\r\n )\r\n ||\r\n key === 'font-size' && (\r\n value === 'xx-small'\r\n || value === 'x-small'\r\n || value === 'small'\r\n || value === 'medium'\r\n || value === 'large'\r\n || value === 'x-large'\r\n || value === 'xx-large'\r\n || value === 'larger'\r\n || value === 'smaller'\r\n || value.match(/[0-9]*\\.?[0-9]*(px|em|rem|mm|q|cm|in|pt|pc|%)/)\r\n )\r\n\t\t\t||\r\n\t\t\t\t(key === 'width' || key === 'height') && (\r\n\t\t\t\t\tvalue.match(/[0-9\\.]*(px|em|rem|%)/)\r\n\t\t\t\t)\r\n\t\t\t|| // Reference #520\r\n\t\t\t\t(key === 'direction' && value.match(/^ltr|rtl|initial|inherit$/))\r\n\t\t\t) result += key + ': ' + value + ';';\r\n\t\t}\r\n\t});\r\n\treturn result;\r\n}", "title": "" }, { "docid": "f8653ebcd5e9bdea677d66e588a0bd5f", "score": "0.5914548", "text": "function computedStyle(el, prop, getComputedStyle, style) {\n getComputedStyle = window.getComputedStyle;\n style =\n // If we have getComputedStyle\n getComputedStyle ?\n // Query it\n // TODO: From CSS-Query notes, we might need (node, null) for FF\n getComputedStyle(el) :\n\n // Otherwise, we are in IE and use currentStyle\n el.currentStyle;\n if (style) {\n return style\n [\n // Switch to camelCase for CSSOM\n // DEV: Grabbed from jQuery\n // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194\n // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597\n prop.replace(/-(\\w)/gi, function (word, letter) {\n return letter.toUpperCase();\n })\n ];\n }\n }", "title": "" }, { "docid": "1b916ed5ccda44af09201101d2bd21aa", "score": "0.5912801", "text": "function cssToStr(cssProps) {\n var statements = [];\n\n $.each(cssProps, function(name, val) {\n if (val != null) {\n statements.push(name + ':' + val);\n }\n });\n\n return statements.join(';');\n }", "title": "" }, { "docid": "d812d47d8fa985dcc21559306b764c2b", "score": "0.5912028", "text": "function getStyle(rule, prop) {\n\t try {\n\t return rule.style.getPropertyValue(prop);\n\t } catch (err) {\n\t // IE may throw if property is unknown.\n\t return '';\n\t }\n\t}", "title": "" }, { "docid": "c8c0add4e2e32b23756b881d60c70ea0", "score": "0.5891991", "text": "function toStyleProp(prop) {\n\t\t\tif (prop == \"float\") {\n\t\t\t\treturn env.ie ? \"styleFloat\" : \"cssFloat\";\n\t\t\t}\n\t\t\treturn lang.replace(prop, /-(\\w)/g, function(match, p1) {\n\t\t\t\treturn p1.toUpperCase();\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "1b6a7e172584f1ee89d4a067245c75da", "score": "0.5887686", "text": "get value() { return `${this.style} ${this.weight} ${this.size}px/${this.lineHeight} ${this.face}`; }", "title": "" }, { "docid": "b19cdc191736a554454df41b95aeaeb0", "score": "0.5859575", "text": "function computedStyle(el, prop, getComputedStyle, style) {\n getComputedStyle = window.getComputedStyle;\n style =\n // If we have getComputedStyle\n getComputedStyle ?\n // Query it\n // TODO: From CSS-Query notes, we might need (node, null) for FF\n getComputedStyle(el) :\n\n // Otherwise, we are in IE and use currentStyle\n el.currentStyle;\n if (style) {\n return style\n [\n // Switch to camelCase for CSSOM\n // DEV: Grabbed from jQuery\n // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194\n // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597\n prop.replace(/-(\\w)/gi, function (word, letter) {\n return letter.toUpperCase();\n })\n ];\n }\n}", "title": "" }, { "docid": "dc8231c388399824065287bcaccfdbc9", "score": "0.58509994", "text": "getStyle() {\n if (this.props.style) {\n return this.props.style;\n }\n const style = {\n padding: \"8px 16px\",\n background: \"white\",\n outline: \"0px solid transparent\",\n border: \"1px solid black\",\n fontSize: \"1.5em\",\n cursor: \"pointer\"\n };\n\n // Modify style if hovered over. \n // We would use pseudoselectors for this normally, \n // but those don't work for inline styles.\n if (this.state.hover) {\n style.background = \"black\";\n style.color = \"white\";\n }\n\n return style;\n }", "title": "" }, { "docid": "27a7aa3b59714a14d7b9eac262c2a1d6", "score": "0.5848049", "text": "function getStyle(rule, prop) {\n try {\n return rule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "27a7aa3b59714a14d7b9eac262c2a1d6", "score": "0.5848049", "text": "function getStyle(rule, prop) {\n try {\n return rule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "27a7aa3b59714a14d7b9eac262c2a1d6", "score": "0.5848049", "text": "function getStyle(rule, prop) {\n try {\n return rule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n}", "title": "" }, { "docid": "858e8497e1ba6d8e978b0d9e2304e6fb", "score": "0.5845974", "text": "function stringifyProperties(properties) {\n\t return properties.map(function (p) {\n\t return styleToString(p[0], p[1]);\n\t }).join(';');\n\t}", "title": "" }, { "docid": "c572bf1f77ecc7e184b0b8cf615c830e", "score": "0.5844545", "text": "function createDangerousStringForStyles(styles){{var serialized='';var delimiter='';for(var styleName in styles){if(!styles.hasOwnProperty(styleName)){continue;}var styleValue=styles[styleName];if(styleValue!=null){var isCustomProperty=styleName.indexOf('--')===0;serialized+=delimiter+(isCustomProperty?styleName:hyphenateStyleName(styleName))+':';serialized+=dangerousStyleValue(styleName,styleValue,isCustomProperty);delimiter=';';}}return serialized||null;}}", "title": "" }, { "docid": "c572bf1f77ecc7e184b0b8cf615c830e", "score": "0.5844545", "text": "function createDangerousStringForStyles(styles){{var serialized='';var delimiter='';for(var styleName in styles){if(!styles.hasOwnProperty(styleName)){continue;}var styleValue=styles[styleName];if(styleValue!=null){var isCustomProperty=styleName.indexOf('--')===0;serialized+=delimiter+(isCustomProperty?styleName:hyphenateStyleName(styleName))+':';serialized+=dangerousStyleValue(styleName,styleValue,isCustomProperty);delimiter=';';}}return serialized||null;}}", "title": "" }, { "docid": "758e87e69ca323d56116908b9cc61814", "score": "0.5842803", "text": "function createDangerousStringForStyles(styles){{var serialized='';var delimiter='';for(var styleName in styles){if(!styles.hasOwnProperty(styleName)){continue;}var styleValue=styles[styleName];if(styleValue!=null){var isCustomProperty=styleName.indexOf('--')===0;serialized+=delimiter+hyphenateStyleName(styleName)+':';serialized+=dangerousStyleValue(styleName,styleValue,isCustomProperty);delimiter=';';}}return serialized||null;}}", "title": "" }, { "docid": "758e87e69ca323d56116908b9cc61814", "score": "0.5842803", "text": "function createDangerousStringForStyles(styles){{var serialized='';var delimiter='';for(var styleName in styles){if(!styles.hasOwnProperty(styleName)){continue;}var styleValue=styles[styleName];if(styleValue!=null){var isCustomProperty=styleName.indexOf('--')===0;serialized+=delimiter+hyphenateStyleName(styleName)+':';serialized+=dangerousStyleValue(styleName,styleValue,isCustomProperty);delimiter=';';}}return serialized||null;}}", "title": "" }, { "docid": "758e87e69ca323d56116908b9cc61814", "score": "0.5842803", "text": "function createDangerousStringForStyles(styles){{var serialized='';var delimiter='';for(var styleName in styles){if(!styles.hasOwnProperty(styleName)){continue;}var styleValue=styles[styleName];if(styleValue!=null){var isCustomProperty=styleName.indexOf('--')===0;serialized+=delimiter+hyphenateStyleName(styleName)+':';serialized+=dangerousStyleValue(styleName,styleValue,isCustomProperty);delimiter=';';}}return serialized||null;}}", "title": "" }, { "docid": "758e87e69ca323d56116908b9cc61814", "score": "0.5842803", "text": "function createDangerousStringForStyles(styles){{var serialized='';var delimiter='';for(var styleName in styles){if(!styles.hasOwnProperty(styleName)){continue;}var styleValue=styles[styleName];if(styleValue!=null){var isCustomProperty=styleName.indexOf('--')===0;serialized+=delimiter+hyphenateStyleName(styleName)+':';serialized+=dangerousStyleValue(styleName,styleValue,isCustomProperty);delimiter=';';}}return serialized||null;}}", "title": "" }, { "docid": "758e87e69ca323d56116908b9cc61814", "score": "0.5842803", "text": "function createDangerousStringForStyles(styles){{var serialized='';var delimiter='';for(var styleName in styles){if(!styles.hasOwnProperty(styleName)){continue;}var styleValue=styles[styleName];if(styleValue!=null){var isCustomProperty=styleName.indexOf('--')===0;serialized+=delimiter+hyphenateStyleName(styleName)+':';serialized+=dangerousStyleValue(styleName,styleValue,isCustomProperty);delimiter=';';}}return serialized||null;}}", "title": "" }, { "docid": "758e87e69ca323d56116908b9cc61814", "score": "0.5842803", "text": "function createDangerousStringForStyles(styles){{var serialized='';var delimiter='';for(var styleName in styles){if(!styles.hasOwnProperty(styleName)){continue;}var styleValue=styles[styleName];if(styleValue!=null){var isCustomProperty=styleName.indexOf('--')===0;serialized+=delimiter+hyphenateStyleName(styleName)+':';serialized+=dangerousStyleValue(styleName,styleValue,isCustomProperty);delimiter=';';}}return serialized||null;}}", "title": "" }, { "docid": "758e87e69ca323d56116908b9cc61814", "score": "0.5842803", "text": "function createDangerousStringForStyles(styles){{var serialized='';var delimiter='';for(var styleName in styles){if(!styles.hasOwnProperty(styleName)){continue;}var styleValue=styles[styleName];if(styleValue!=null){var isCustomProperty=styleName.indexOf('--')===0;serialized+=delimiter+hyphenateStyleName(styleName)+':';serialized+=dangerousStyleValue(styleName,styleValue,isCustomProperty);delimiter=';';}}return serialized||null;}}", "title": "" }, { "docid": "758e87e69ca323d56116908b9cc61814", "score": "0.5842803", "text": "function createDangerousStringForStyles(styles){{var serialized='';var delimiter='';for(var styleName in styles){if(!styles.hasOwnProperty(styleName)){continue;}var styleValue=styles[styleName];if(styleValue!=null){var isCustomProperty=styleName.indexOf('--')===0;serialized+=delimiter+hyphenateStyleName(styleName)+':';serialized+=dangerousStyleValue(styleName,styleValue,isCustomProperty);delimiter=';';}}return serialized||null;}}", "title": "" }, { "docid": "3c5b40238111a05f0b157ea848b7185d", "score": "0.582676", "text": "function cssToStr(cssProps) {\n\tvar statements = [];\n\n\t$.each(cssProps, function(name, val) {\n\t\tif (val != null) {\n\t\t\tstatements.push(name + ':' + val);\n\t\t}\n\t});\n\n\treturn statements.join(';');\n}", "title": "" }, { "docid": "3c5b40238111a05f0b157ea848b7185d", "score": "0.582676", "text": "function cssToStr(cssProps) {\n\tvar statements = [];\n\n\t$.each(cssProps, function(name, val) {\n\t\tif (val != null) {\n\t\t\tstatements.push(name + ':' + val);\n\t\t}\n\t});\n\n\treturn statements.join(';');\n}", "title": "" }, { "docid": "3c5b40238111a05f0b157ea848b7185d", "score": "0.582676", "text": "function cssToStr(cssProps) {\n\tvar statements = [];\n\n\t$.each(cssProps, function(name, val) {\n\t\tif (val != null) {\n\t\t\tstatements.push(name + ':' + val);\n\t\t}\n\t});\n\n\treturn statements.join(';');\n}", "title": "" }, { "docid": "3c5b40238111a05f0b157ea848b7185d", "score": "0.582676", "text": "function cssToStr(cssProps) {\n\tvar statements = [];\n\n\t$.each(cssProps, function(name, val) {\n\t\tif (val != null) {\n\t\t\tstatements.push(name + ':' + val);\n\t\t}\n\t});\n\n\treturn statements.join(';');\n}", "title": "" }, { "docid": "3c5b40238111a05f0b157ea848b7185d", "score": "0.582676", "text": "function cssToStr(cssProps) {\n\tvar statements = [];\n\n\t$.each(cssProps, function(name, val) {\n\t\tif (val != null) {\n\t\t\tstatements.push(name + ':' + val);\n\t\t}\n\t});\n\n\treturn statements.join(';');\n}", "title": "" }, { "docid": "3c5b40238111a05f0b157ea848b7185d", "score": "0.582676", "text": "function cssToStr(cssProps) {\n\tvar statements = [];\n\n\t$.each(cssProps, function(name, val) {\n\t\tif (val != null) {\n\t\t\tstatements.push(name + ':' + val);\n\t\t}\n\t});\n\n\treturn statements.join(';');\n}", "title": "" }, { "docid": "3c5b40238111a05f0b157ea848b7185d", "score": "0.582676", "text": "function cssToStr(cssProps) {\n\tvar statements = [];\n\n\t$.each(cssProps, function(name, val) {\n\t\tif (val != null) {\n\t\t\tstatements.push(name + ':' + val);\n\t\t}\n\t});\n\n\treturn statements.join(';');\n}", "title": "" }, { "docid": "3c5b40238111a05f0b157ea848b7185d", "score": "0.582676", "text": "function cssToStr(cssProps) {\n\tvar statements = [];\n\n\t$.each(cssProps, function(name, val) {\n\t\tif (val != null) {\n\t\t\tstatements.push(name + ':' + val);\n\t\t}\n\t});\n\n\treturn statements.join(';');\n}", "title": "" }, { "docid": "3c5b40238111a05f0b157ea848b7185d", "score": "0.582676", "text": "function cssToStr(cssProps) {\n\tvar statements = [];\n\n\t$.each(cssProps, function(name, val) {\n\t\tif (val != null) {\n\t\t\tstatements.push(name + ':' + val);\n\t\t}\n\t});\n\n\treturn statements.join(';');\n}", "title": "" }, { "docid": "3c5b40238111a05f0b157ea848b7185d", "score": "0.582676", "text": "function cssToStr(cssProps) {\n\tvar statements = [];\n\n\t$.each(cssProps, function(name, val) {\n\t\tif (val != null) {\n\t\t\tstatements.push(name + ':' + val);\n\t\t}\n\t});\n\n\treturn statements.join(';');\n}", "title": "" }, { "docid": "23728c27e78d5497bbd21145f231cd7c", "score": "0.58230126", "text": "function testCSS(prop) {\r\n\t\treturn prop in document.documentElement.style;\r\n\t}", "title": "" }, { "docid": "8e9a05fb3bf0aaf4c33bfdb27bbec296", "score": "0.58161944", "text": "static _cacheStyleFor(element) {\n // check for IE getComputedCSSText()\n let computedStyles;\n if (navigator.userAgent.match(/msie|windows|firefox/i)) {\n computedStyles = element.getComputedCSSText();\n } else {\n computedStyles = document.defaultView.getComputedStyle(element).cssText;\n }\n\n Object.defineProperty(element, '_chariotComputedStyles', {\n value: computedStyles,\n enumerable: false,\n writable: true,\n configurable: false\n });\n\n return computedStyles;\n }", "title": "" }, { "docid": "f0d27453c93a09b3597ab85810ac5765", "score": "0.57996947", "text": "function createDangerousStringForStyles(styles){{var serialized='';var delimiter='';for(var styleName in styles) {if(!styles.hasOwnProperty(styleName)){continue;}var styleValue=styles[styleName];if(styleValue != null){var isCustomProperty=styleName.indexOf('--') === 0;serialized += delimiter + hyphenateStyleName(styleName) + ':';serialized += dangerousStyleValue(styleName,styleValue,isCustomProperty);delimiter = ';';}}return serialized || null;}}", "title": "" }, { "docid": "6c27e3afc51a2dc3c66e81613eb7fdfb", "score": "0.5799632", "text": "function u(t){return getComputedStyle(t)}", "title": "" }, { "docid": "62622df91c816f294a164164f0aee0b8", "score": "0.57843184", "text": "function l(e,t){try{\n// Support CSSTOM.\n// Support CSSTOM.\nreturn e.attributeStyleMap?e.attributeStyleMap.get(t):e.style.getPropertyValue(t)}catch(e){\n// IE may throw if property is unknown.\nreturn\"\"}}", "title": "" }, { "docid": "e976cc102cd78b033da07a53c68d93be", "score": "0.57707506", "text": "function cssToStr(cssProps) {\r\n var statements = [];\r\n for (var name_1 in cssProps) {\r\n var val = cssProps[name_1];\r\n if (val != null) {\r\n statements.push(name_1 + ':' + val);\r\n }\r\n }\r\n return statements.join(';');\r\n}", "title": "" }, { "docid": "74251c9c8c1d12680f1a7650dcaf144e", "score": "0.5760728", "text": "getCSS(key) {\n var _a;\n return ((_a = this._overrides[key]) !== null && _a !== void 0 ? _a : getComputedStyle(document.documentElement).getPropertyValue(`--jp-${key}`));\n }", "title": "" }, { "docid": "5f331bf0babf637a7ee2db8e8e325563", "score": "0.5753643", "text": "normalizeStyleAttributeValues() {\n for (const element of Array.from(\n this.editingHost.querySelectorAll(\"[style]\")\n )) {\n element.setAttribute(\n \"style\",\n element\n .getAttribute(\"style\")\n // Random spacing differences\n .replace(/; ?$/, \"\")\n .replace(/: /g, \":\")\n // Gecko likes \"transparent\"\n .replace(/transparent/g, \"rgba(0, 0, 0, 0)\")\n // WebKit likes to look overly precise\n .replace(/, 0.496094\\)/g, \", 0.5)\")\n // Gecko converts anything with full alpha to \"transparent\" which\n // then becomes \"rgba(0, 0, 0, 0)\", so we have to make other\n // browsers match\n .replace(/rgba\\([0-9]+, [0-9]+, [0-9]+, 0\\)/g, \"rgba(0, 0, 0, 0)\")\n );\n }\n }", "title": "" }, { "docid": "9f07fae4176fa4838408c18b2133b992", "score": "0.57439244", "text": "function sanitizeCharacterProps(properties) {\n\t return (0, _helpers.omit)(properties, ['data-belle-value', 'style']);\n\t}", "title": "" }, { "docid": "076c214d355c2bb4a2bf9cb315393071", "score": "0.57396793", "text": "function createDangerousStringForStyles(styles) {\n {\n var serialized = '';\n var delimiter = '';\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var styleValue = styles[styleName];\n\n if (styleValue != null) {\n var isCustomProperty = styleName.indexOf('--') === 0;\n serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';\n serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n delimiter = ';';\n }\n }\n\n return serialized || null;\n }\n }", "title": "" }, { "docid": "51fd118a03615de2e274e67f28a77030", "score": "0.5726549", "text": "__detectVendorProperties() {\n var styleNames = {\n appearance: qx.core.Environment.get(\"css.appearance\"),\n userSelect: qx.core.Environment.get(\"css.userselect\"),\n textOverflow: qx.core.Environment.get(\"css.textoverflow\"),\n borderImage: qx.core.Environment.get(\"css.borderimage\"),\n float: qx.core.Environment.get(\"css.float\"),\n userModify: qx.core.Environment.get(\"css.usermodify\"),\n boxSizing: qx.core.Environment.get(\"css.boxsizing\")\n };\n\n this.__cssNames = {};\n for (var key in qx.lang.Object.clone(styleNames)) {\n if (!styleNames[key]) {\n delete styleNames[key];\n } else {\n if (key === \"float\") {\n this.__cssNames[\"cssFloat\"] = key;\n } else {\n this.__cssNames[key] = qx.bom.Style.getCssName(styleNames[key]);\n }\n }\n }\n\n this.__styleNames = styleNames;\n }", "title": "" }, { "docid": "6a86c2a443ae09add39eeb3430db8c0d", "score": "0.57192796", "text": "function cssToStr(cssProps) {\n var statements = [];\n for (var name_1 in cssProps) {\n var val = cssProps[name_1];\n if (val != null && val !== '') {\n statements.push(name_1 + ':' + val);\n }\n }\n return statements.join(';');\n}", "title": "" }, { "docid": "6a86c2a443ae09add39eeb3430db8c0d", "score": "0.57192796", "text": "function cssToStr(cssProps) {\n var statements = [];\n for (var name_1 in cssProps) {\n var val = cssProps[name_1];\n if (val != null && val !== '') {\n statements.push(name_1 + ':' + val);\n }\n }\n return statements.join(';');\n}", "title": "" }, { "docid": "03a5a8d0dea9f18df8fe011dab15c7a3", "score": "0.5718265", "text": "css() {\n const selector = _.sample(DEVELOPMENT.CSS_SELECTORS);\n const cssSelector = `${selector}${this.text.word()}`;\n const contTag = _.sample(Object.keys(DEVELOPMENT.HTML_CONTAINER_TAGS));\n const mrkTag = _.sample(DEVELOPMENT.HTML_MARKUP_TAGS);\n const base = _.sample([contTag, mrkTag, cssSelector ]);\n return fmt(\n '{0} { {1} }', base,\n [...Array(_.random(2, 7))].reduce(\n (a, c) => (a += `${this.cssProperty()};`), ''\n )\n )\n }", "title": "" }, { "docid": "fc1b11b4d9d0abda1e02cd62067e44db", "score": "0.57163304", "text": "function generateWeCss(property , value) {\n if(!target || !target.tagName || !$id('weStylesheet') ){\n return \n }\n const selector = generateElSelector(target);\n const weStylesheet = $id('weStylesheet');\n weCss = weStylesheet.innerHTML;\n property = property.replace(/[A-Z]/g, letter => `-${letter.toLowerCase()}`); // Make css prop from js\n // check inline style \n value = target.style[property]? `${value} !important`: value;\n const cssRule = `${property} : ${value};`;\n \n // Change it if it exists\n if(weCss.replace(/\\s+/g, '').includes(selector +'{')){\n const si = weCss.indexOf(`${selector} {`);\n const li = weCss.indexOf('}' , si);\n let currentElRule = weCss.substr(si , (li - (si - 3)));\n // Check property exists\n if(currentElRule.includes(property)){\n const pi = currentElRule.indexOf(property);\n const pli = currentElRule.indexOf(';', pi);\n let xCssRule = currentElRule.substr(pi, (pli - (pi - 1)));\n weTargetCss = currentElRule.replace(xCssRule, cssRule);\n } else{ \n weTargetCss = currentElRule.replace(`}`, `${cssRule} \\n}`);\n }\n // update rules\n weCss = weCss.replace(currentElRule , weTargetCss);\n } else {\n weTargetCss = `${selector} { ${cssRule} } \\n`;\n weCss += weTargetCss;\n } \n weStylesheet.innerHTML = weCss;\n // Store changes if save active\n if(isStoreCss){ saveCSS() }\n}", "title": "" }, { "docid": "b015c10db1ebe734011e4dd045c0380e", "score": "0.5714664", "text": "function getCSSProp (element, prop) {\n if (element.style[prop]) {\n // inline style property\n return element.style[prop];\n } else if (element.currentStyle) {\n // external stylesheet for Explorer\n return element.currentStyle[prop];\n } else if (document.defaultView && document.defaultView.getComputedStyle) {\n // external stylesheet for Mozilla and Safari 1.3+\n prop = prop.replace(/([A-Z])/g,\"-$1\");\n prop = prop.toLowerCase();\n return document.defaultView.getComputedStyle(element,\"\").getPropertyValue(prop);\n } else {\n // Safari 1.2\n return null;\n }\n}", "title": "" }, { "docid": "c49199b9bb107027a8e29d0d220f077a", "score": "0.57140374", "text": "function createDangerousStringForStyles(styles) {\n {\n var serialized = '';\n var delimiter = '';\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var styleValue = styles[styleName];\n\n if (styleValue != null) {\n var isCustomProperty = styleName.indexOf('--') === 0;\n serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';\n serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n delimiter = ';';\n }\n }\n\n return serialized || null;\n }\n }", "title": "" }, { "docid": "c49199b9bb107027a8e29d0d220f077a", "score": "0.57140374", "text": "function createDangerousStringForStyles(styles) {\n {\n var serialized = '';\n var delimiter = '';\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var styleValue = styles[styleName];\n\n if (styleValue != null) {\n var isCustomProperty = styleName.indexOf('--') === 0;\n serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';\n serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n delimiter = ';';\n }\n }\n\n return serialized || null;\n }\n }", "title": "" }, { "docid": "c49199b9bb107027a8e29d0d220f077a", "score": "0.57140374", "text": "function createDangerousStringForStyles(styles) {\n {\n var serialized = '';\n var delimiter = '';\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var styleValue = styles[styleName];\n\n if (styleValue != null) {\n var isCustomProperty = styleName.indexOf('--') === 0;\n serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';\n serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n delimiter = ';';\n }\n }\n\n return serialized || null;\n }\n }", "title": "" }, { "docid": "c49199b9bb107027a8e29d0d220f077a", "score": "0.57140374", "text": "function createDangerousStringForStyles(styles) {\n {\n var serialized = '';\n var delimiter = '';\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var styleValue = styles[styleName];\n\n if (styleValue != null) {\n var isCustomProperty = styleName.indexOf('--') === 0;\n serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';\n serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n delimiter = ';';\n }\n }\n\n return serialized || null;\n }\n }", "title": "" }, { "docid": "c49199b9bb107027a8e29d0d220f077a", "score": "0.57140374", "text": "function createDangerousStringForStyles(styles) {\n {\n var serialized = '';\n var delimiter = '';\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var styleValue = styles[styleName];\n\n if (styleValue != null) {\n var isCustomProperty = styleName.indexOf('--') === 0;\n serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';\n serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n delimiter = ';';\n }\n }\n\n return serialized || null;\n }\n }", "title": "" }, { "docid": "c49199b9bb107027a8e29d0d220f077a", "score": "0.57140374", "text": "function createDangerousStringForStyles(styles) {\n {\n var serialized = '';\n var delimiter = '';\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var styleValue = styles[styleName];\n\n if (styleValue != null) {\n var isCustomProperty = styleName.indexOf('--') === 0;\n serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';\n serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n delimiter = ';';\n }\n }\n\n return serialized || null;\n }\n }", "title": "" }, { "docid": "c49199b9bb107027a8e29d0d220f077a", "score": "0.57140374", "text": "function createDangerousStringForStyles(styles) {\n {\n var serialized = '';\n var delimiter = '';\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var styleValue = styles[styleName];\n\n if (styleValue != null) {\n var isCustomProperty = styleName.indexOf('--') === 0;\n serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';\n serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n delimiter = ';';\n }\n }\n\n return serialized || null;\n }\n }", "title": "" }, { "docid": "c49199b9bb107027a8e29d0d220f077a", "score": "0.57140374", "text": "function createDangerousStringForStyles(styles) {\n {\n var serialized = '';\n var delimiter = '';\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var styleValue = styles[styleName];\n\n if (styleValue != null) {\n var isCustomProperty = styleName.indexOf('--') === 0;\n serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';\n serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n delimiter = ';';\n }\n }\n\n return serialized || null;\n }\n }", "title": "" }, { "docid": "c49199b9bb107027a8e29d0d220f077a", "score": "0.57140374", "text": "function createDangerousStringForStyles(styles) {\n {\n var serialized = '';\n var delimiter = '';\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var styleValue = styles[styleName];\n\n if (styleValue != null) {\n var isCustomProperty = styleName.indexOf('--') === 0;\n serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';\n serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n delimiter = ';';\n }\n }\n\n return serialized || null;\n }\n }", "title": "" }, { "docid": "c49199b9bb107027a8e29d0d220f077a", "score": "0.57140374", "text": "function createDangerousStringForStyles(styles) {\n {\n var serialized = '';\n var delimiter = '';\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var styleValue = styles[styleName];\n\n if (styleValue != null) {\n var isCustomProperty = styleName.indexOf('--') === 0;\n serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';\n serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n delimiter = ';';\n }\n }\n\n return serialized || null;\n }\n }", "title": "" }, { "docid": "c49199b9bb107027a8e29d0d220f077a", "score": "0.57140374", "text": "function createDangerousStringForStyles(styles) {\n {\n var serialized = '';\n var delimiter = '';\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var styleValue = styles[styleName];\n\n if (styleValue != null) {\n var isCustomProperty = styleName.indexOf('--') === 0;\n serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';\n serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n delimiter = ';';\n }\n }\n\n return serialized || null;\n }\n }", "title": "" } ]
318d94ed259ec3ab4a8a10d0372b38fd
TODO: Set Values for state variables
[ { "docid": "2f2b9adc559426f9579e8f686ac51f2c", "score": "0.0", "text": "handleRegister(event) {\n event.preventDefault();\n\n this.setState({\n message: \"\",\n successful: false,\n loading: true\n });\n\n // TODO: Validate register form fields\n this.form.validateAll();\n\n\n // TODO: Calling Registration Service function and check if there is any error\n if (this.checkBtn.context._errors.length === 0) {\n UserService.backendRegister(\n this.state.username,\n this.state.contactNo,\n this.state.email,\n this.state.password,\n this.state.userType,\n ).then(\n response => {\n this.setState({\n message: response.data.message,\n successful: true\n });\n },\n error => {\n const resMessage =\n (error.response && error.response.data && error.response.data.message) || error.message || error.toString();\n\n this.setState({\n successful: false,\n message: resMessage,\n loading: false,\n });\n }\n );\n\n } else {\n this.setState({\n loading: false\n });\n }\n\n }", "title": "" } ]
[ { "docid": "ad016b1d1dfec5574ec86afceca17f72", "score": "0.7284668", "text": "function initState() {\n\t\tfor (var name in state) {\n\t\t\tvar prop = state[name];\n\t\t\tif (prop.value !== undefined) {\n\t\t\t\tself[name] = prop.value;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "11a968bafee6991161a887db6b78465a", "score": "0.6866837", "text": "appliesToState() {}", "title": "" }, { "docid": "f355cad16f3231b79502bff8193a9f5b", "score": "0.68130684", "text": "limpiarStateValues(){\n this.asignarValorState('tasafinanciamiento',0,'objConfiguracion');\n this.asignarValorState('porcientoenganche',0,'objConfiguracion');\n this.asignarValorState('plazomaximo',0,'objConfiguracion');\n }", "title": "" }, { "docid": "7ea60699421182ac4f8f1e99078d3775", "score": "0.6691304", "text": "function setState() {\n // call loadState, which returns array\n var arr = loadState(),\n reqRate = loadReqRate();\n // bind\n vm.state = {\n investments: arr[0],\n newTickerType: \"Stock\",\n requiredRate: reqRate\n };\n }", "title": "" }, { "docid": "eb40f9b2b198a2a2446f3bd0745a8988", "score": "0.65528446", "text": "initializeState() {}", "title": "" }, { "docid": "32c75b04f5e850a803bf3645c172c0ee", "score": "0.64649296", "text": "set state(val) {\n this[STATE] = val;\n }", "title": "" }, { "docid": "aa875ace305fc5d403774a680fe93c7b", "score": "0.64532596", "text": "get states(){ return this.__states; }", "title": "" }, { "docid": "ae9373d40394df6eec73841aac596871", "score": "0.6428669", "text": "set state(value){ throw new Error(\"Cannot invoke an abstract method\") }", "title": "" }, { "docid": "303fad11386b398846b22491df77400e", "score": "0.6406683", "text": "constructor(){\n super();\n this.state= {\n currentValue: 0,\n total:0,\n recentOp:'',\n\n\n }\n }", "title": "" }, { "docid": "963082835a70ac42b6baef8168b6507e", "score": "0.6383861", "text": "get state(){ return this.__state ? this.__state : 'off'; }", "title": "" }, { "docid": "4d6101dc124fd6db361258547afcc332", "score": "0.63472843", "text": "constructor() {\n super();\n this.state = {\n balance: 0,\n rate: 0,\n term: 15,\n output: '0.00'\n };\n this.updateStateValues = this.updateStateValues.bind(this);\n this.calculate = this.calculate.bind(this);\n }", "title": "" }, { "docid": "0e72b16ff662882551bf3b6b79fa824b", "score": "0.63205713", "text": "setState (state, arg) {\n Object.keys(arg).forEach(k => state[k] = arg[k]);\n }", "title": "" }, { "docid": "1065c844321f2db931bae7dd32eec0d2", "score": "0.6284276", "text": "function set_state(prop, value) {\n // set js var value\n propVal = parseFloat(value);\n state[prop] = propVal;\n\n if (prop === \"v0_x\") { curve.setV0( createVector(propVal, curve.v0.y )); }\n if (prop === \"v0_y\") { curve.setV0( createVector(curve.v0.x, propVal )); }\n if (prop === \"v3_x\") { curve.setV3( createVector(propVal, curve.v3.y )); }\n if (prop === \"v3_y\") { curve.setV3( createVector(curve.v3.x, propVal )); }\n\n // console.log(state);\n\n // set URLParameter\n set_url_parameter(prop, value, urlParams);\n\n // sync all slider inputs\n // var sliders_for_prop = document.getElementsByClassName('slider '+prop);\n // for (var i = 0; i < sliders_for_prop.length; i++) {\n // sliders_for_prop[i].value = propVal;\n // }\n}", "title": "" }, { "docid": "8818c576e298feee699282a2824d66d1", "score": "0.6277515", "text": "constructor (){\n super();\n this.state = {\n btcpriceUSD: '',\n btcpriceEUR: '',\n icxpriceUSD: '',\n icxpriceEUR: '',\n nanopriceUSD: '',\n nanopriceEUR: '',\n };\n }", "title": "" }, { "docid": "3219943e5edffcc7afe424b58bfbd2d7", "score": "0.62448925", "text": "get state() {\r\n return this.i.a;\r\n }", "title": "" }, { "docid": "c9afda4c1698dd1120855a8aaa4ac75b", "score": "0.62385553", "text": "initializeState() {\n const attrs = this.state.attributes;\n attrs.x1 = -10;\n attrs.y1 = -10;\n attrs.x2 = 10;\n attrs.y2 = 10;\n }", "title": "" }, { "docid": "77c9e43db8324bef844151d9bb8eae63", "score": "0.62241375", "text": "constructor(props) {\n super(props);\n this.state = {\n isAOO: true,\n isVOO: false,\n isAAI: false,\n isVVI: false,\n isDOO: false,\n previous_maker:\"\",\n current_maker:\"\"\n\n };\n }", "title": "" }, { "docid": "7aab680bb6ff92a487b73d8ebfdd1462", "score": "0.6212403", "text": "function changeState(name, value) {\n\t\tstate[name].value = value;\n\t}", "title": "" }, { "docid": "0c4955af847b6abf6927edaf0fdb20bb", "score": "0.6209623", "text": "constructor () {\n\t\tsuper();\n\n\t\tthis.state = {\n\n\t\t}\n\t}", "title": "" }, { "docid": "904096e75e6ae926d3ce905f720cd99a", "score": "0.6207444", "text": "setQuestionTitle (state, value) {\n //console.log('setQuestion state value', state, value);\n state.listOfQuestionsTitle = value;\n }", "title": "" }, { "docid": "fef25ef01435a5badd5b957911eff7d5", "score": "0.61941123", "text": "setupState( options ) {\n\n\t\t\tthis.states[ options.state ] = {\n\t\t\t\tattributes: options.attributes,\n\t\t\t\tonSet: options.onSet\n\t\t\t};\n\n\t\t}", "title": "" }, { "docid": "369b081c73e6d56bbf0cdb4fd8182f01", "score": "0.6193471", "text": "changeState(){\n this.state = this.stateIterator.next().value;\n }", "title": "" }, { "docid": "9be3d2dc7920f38e605fe58165cfb790", "score": "0.6187495", "text": "function UIState() {}", "title": "" }, { "docid": "fc1b8fb3514aefe8392a0605d6180b79", "score": "0.61712474", "text": "function handleState(e) {\n\tcurrentState = e;\n\tvar po = e - 1;\n\tvar aux = states[po];\n\t$(\"#headModal\").html(\"State \" + e);\n\t$(\"#is\").val(aux.socratic);\n\t$(\"#ig\").val(aux.guidance);\n\t$(\"#idi\").val(aux.didactic);\n\t$(\"#cb1\").prop('checked', aux.exact);\n\t//$(\"#cb2\").prop('checked', aux.include);\n\t//$(\"#cb3\").prop('checked', aux.sbu);\n\t$(\"#cbState\").prop('checked', aux.fState);\n\t$(\"#cbFinal\").prop('checked', aux.end);\n\tLoadState(po);\n}", "title": "" }, { "docid": "4eafc4d14457bbd1b209863493083c68", "score": "0.61685324", "text": "get state() {\n return state;\n }", "title": "" }, { "docid": "8038ad4220b6455023a9aa437cd06bdb", "score": "0.6158769", "text": "static get properties() { return {\n state:{type:Object}\n }}", "title": "" }, { "docid": "f27454d26d4e51bed8062f937908ff6c", "score": "0.6145521", "text": "function setState() {\n\t\tconsole.log('setting state');\n\t\tstateStr = arguments.length === 1 ? arguments[0] : arguments[1];\n\t\tJSProblemState = JSON.parse(stateStr);\n\t\t\n\t\t// Update the sighted variable from the state\n\t\tsighted = (JSProblemState.sighted == 'true');\n\t\t\n\t\t// Put the cards in the correct locations based on what the problem state says.\n\t\tsetUpSpace();\n\t\tputMatchesBack();\n\t\t\n\t}", "title": "" }, { "docid": "e170ba5992241609e248ad5e00d55113", "score": "0.6134212", "text": "static get properties() { return {\nstate: {type:Object} \n}}", "title": "" }, { "docid": "05e36ac5e98c7ea944dc80deda041257", "score": "0.6124815", "text": "setState(trackState) {\n if ('properties' in trackState && 'gain' in trackState.properties) {\n this.gainNode.gain.value = trackState.properties.gain;\n } else if ('properties' in trackState) {\n trackState.properties.gain = this.gainNode.gain.value;\n } else {\n trackState.properties = {\n gain: this.gainNode.gain.value,\n };\n }\n this.stateStack[this.stateStack.length - 1] = trackState;\n }", "title": "" }, { "docid": "55299c879aabc5d70575b90eaa0ff1da", "score": "0.6121148", "text": "constructor() {\n super();\n this.state = {\n name: \"\",\n age: \"\",\n height: \"\",\n //currentSmurf: \n };\n }", "title": "" }, { "docid": "7d4d5f04d6716eac3458d6d1da4d51bb", "score": "0.6118828", "text": "constructor() {\n super();\n this.state = {\n rentals: [],\n results: [],\n value: '',\n locations: [],\n filters: {\n location: '',\n pool: false,\n hot_tub: false,\n }\n };\n }", "title": "" }, { "docid": "a1f2a13ea6cea59d0a1a6e6674b38dc9", "score": "0.60896105", "text": "constructor(){\n super();\n this.state = {\n currentValue: [],\n operation: '',\n num1:[],\n num2:[]\n }\n }", "title": "" }, { "docid": "61f190cd3223fe2c371923818249a757", "score": "0.60797143", "text": "static loadState(state) {\n\t\tconst obj = JSON.parse(state);\n\t\tvm.isPlaying(obj.isPlaying);\n\t\tvm.gameOver(false);\n\t\tvm.previousEmoji(obj.previousEmoji)\n\t\tvm.current(obj.current);\n\t\tvm.incorrect(obj.incorrect);\n\t\tvm.seed = obj.seed;\n\t}", "title": "" }, { "docid": "e7d8bc697ea9d8cf6aa0ae407cf6787f", "score": "0.6077917", "text": "initializeState() {\n }", "title": "" }, { "docid": "5c900f36181b4b0aec4946251ccc44ba", "score": "0.6061032", "text": "storeState(){\n\n\t\tthis.contextState = [{\n\t\t\tkey: 'startable.status',\n\t\t\tvalue: this.context['startable.status']\n\t\t}];\n\n\n\t\t/*\n\n\t\tfor example: take all simple values from context\n\n\t\tfor(var key in this.context){\n\t\t\tlet value = this.context[key];\n\t\t\tif (value == null || !_.isObject(value.valueOf()))\n\t\t\t\tthis.contextState.push({ key, value });\n\t\t}\n\n\t\t*/\n\n\t}", "title": "" }, { "docid": "5c900f36181b4b0aec4946251ccc44ba", "score": "0.6061032", "text": "storeState(){\n\n\t\tthis.contextState = [{\n\t\t\tkey: 'startable.status',\n\t\t\tvalue: this.context['startable.status']\n\t\t}];\n\n\n\t\t/*\n\n\t\tfor example: take all simple values from context\n\n\t\tfor(var key in this.context){\n\t\t\tlet value = this.context[key];\n\t\t\tif (value == null || !_.isObject(value.valueOf()))\n\t\t\t\tthis.contextState.push({ key, value });\n\t\t}\n\n\t\t*/\n\n\t}", "title": "" }, { "docid": "635f7684a59bcc810678f0ebae3bb5bd", "score": "0.60601187", "text": "function initHookState( me, state) {\n me._vars = state;\n}", "title": "" }, { "docid": "0664b2d5af795c5ed1085dd7954c5365", "score": "0.605979", "text": "function updateState() {\n //Do whatever you need with the data here\n }", "title": "" }, { "docid": "509cc402e3e17284b2680e1d233aad56", "score": "0.60547984", "text": "setQuestion (state, value) {\n //console.log('setQuestion state value', state, value);\n state.question = value;\n }", "title": "" }, { "docid": "835402e8abf39cf0d9d4457d8e87d5e3", "score": "0.604991", "text": "get state() {\r\n return this._state;\r\n }", "title": "" }, { "docid": "665daaa2beeddf9b2f2271239be00a27", "score": "0.6049107", "text": "process() {\r\n //stateAttributes must have been set by call to computeScalarStates\r\n this.attributes = this.state.devState.stateAttributes.split(\",\");\r\n this.savedAttributes = this.getLocalAttribute(\"savedAttributes\");\r\n if (!this.savedAttributes) this.savedAttributes = [];\r\n if (!this.state.devState.restoreState) return;\r\n if (!this.state.reloadLocal) return;\r\n this.savedAttributes.forEach(attr => {\r\n let value = (this.state[attr] = this.getLocalAttribute(attr));\r\n\r\n if (this.state.devState.logDiags.restore)\r\n console.log(\"Restoring \", attr, value);\r\n }); // await actions.restoreSavedAttrs();\r\n // this.restoreSavedAttrs();\r\n }", "title": "" }, { "docid": "4bd09ef50ad8276f59792936035b175e", "score": "0.60466343", "text": "handleCreateVariableChange (e) {\n this.setState({ createVariableValue: e.target.value })\n }", "title": "" }, { "docid": "b3b517782a2a138c11676c9aa52d9fc7", "score": "0.6034712", "text": "constructor(){\n super();\n //ser initial state\n this.state={\n name:\"Jimmy Wales\",\n age:51\n }\n }", "title": "" }, { "docid": "82cff1f45436f9b1805c311b01e42590", "score": "0.60323083", "text": "static initializeState() {\n // Set the default values for the script's state.\n _.defaults(state, {\n CheckItOut: {}\n });\n _.defaults(state.CheckItOut, {\n graphics: {},\n themeName: 'default',\n userOptions: {}\n });\n\n // Add useroptions to the state.\n let userOptions = globalconfig && globalconfig.checkitout;\n if (userOptions)\n _.extend(state.CheckItOut.userOptions, userOptions);\n\n // Set default values for the unspecificed useroptions.\n _.defaults(state.CheckItOut.userOptions, {\n defaultDescription: DEFAULT_DESCRIPTION\n });\n }", "title": "" }, { "docid": "b532da2d9b7864b80d76ebba35530d76", "score": "0.6027495", "text": "function setNewState() {\n state.counter = 0;\n $(\"#total-score\").text(0);\n state.newNumberOptions = [];\n state.targetNumber = Math.floor(Math.random() * (180-19)) + 20;\n console.log(\"state: \", state, state.targetNumber, state.newNumberOptions);\n $(\"#number-to-guess\").text(state.targetNumber);\n}", "title": "" }, { "docid": "3c0a3d02cbe549f95f491671c0f20fe2", "score": "0.602414", "text": "constructor(){\n super();\n this.state ={\n currentViem : 2\n }\n }", "title": "" }, { "docid": "19ede9cb860f44629c916e09466b78f5", "score": "0.5999238", "text": "constructor(props){\n super(props); //call parent class constructor method (Parent class \"Component\")\n //constructor is the only place where state gets a manual value or assignment\n this.state = {term : ''};//state is a JS object, each compnent has \"state\" //create object and store in variable\n // we are going to make the state of this app the value that user type\n }", "title": "" }, { "docid": "2a9fc587a3e154096c4bc7a15c3dee66", "score": "0.59987265", "text": "changeState(state) {\r\n if(state !== 'normal' && state !== 'hungry' && state !== 'busy' && state !=='sleeping')\r\n throw new eer('Error');\r\n else\r\n {this.change = this.getSt;\r\n this.addstatetr.push(this.getSt);\r\n this.getSt = state;} //this.addstatetr.push(state); \r\n }", "title": "" }, { "docid": "ba6ed84d07f5867994a600cda2aace97", "score": "0.59914416", "text": "get state() {\n return this.STATE;\n }", "title": "" }, { "docid": "ba6ed84d07f5867994a600cda2aace97", "score": "0.59914416", "text": "get state() {\n return this.STATE;\n }", "title": "" }, { "docid": "ec84b3fc100feece86a1238c088d5a8a", "score": "0.59888357", "text": "constructor(){\n super();\n this.state = {\n value: null,\n };\n }", "title": "" }, { "docid": "8ba9a3ce15a6f3d10a93d9415cf493ce", "score": "0.59868044", "text": "function setState(transaction, stateStr) {\n var state = JSON.parse(stateStr);\n\n if (state.supplyPt && state.demandPt) {\n wSlider.setGliderPosition(normalizeSliderValue(\n wSlider, state.supplyPt.Y\n ));\n dragHandler();\n }\n console.info('State updated successfully from saved.');\n }", "title": "" }, { "docid": "0b45f088848fd8a38191eed9ffad6b2b", "score": "0.59799385", "text": "constructor(){\n \tsuper()\n \tthis.state = 0\n }", "title": "" }, { "docid": "1e338f88b4059caf74388ae488314be1", "score": "0.59673166", "text": "get state() { return this._publicState; }", "title": "" }, { "docid": "1e338f88b4059caf74388ae488314be1", "score": "0.59673166", "text": "get state() { return this._publicState; }", "title": "" }, { "docid": "1e338f88b4059caf74388ae488314be1", "score": "0.59673166", "text": "get state() { return this._publicState; }", "title": "" }, { "docid": "b12c3eb11f7343e2ef808fdc3ef85b84", "score": "0.5963852", "text": "constructor() {\n super();\n \n this.state = {\n open: false,\n salutation: \"\",\n firstName: \"\",\n middleName: \"\",\n lastName: \"\",\n suffix: \"\",\n dateOfBirth: \"\",\n dateOfDeath: \"\",\n plotId: 0,\n }\n this.handleChange = this.handleChange.bind(this);\n }", "title": "" }, { "docid": "8d8962b5bfb9e4ad43a08f30c5febfb4", "score": "0.5960022", "text": "get state() {\n return this[STATE];\n }", "title": "" }, { "docid": "20c5359d33601ee86bdcc6776cc13267", "score": "0.5959753", "text": "get State() {\n return _state;\n }", "title": "" }, { "docid": "20c5359d33601ee86bdcc6776cc13267", "score": "0.5959753", "text": "get State() {\n return _state;\n }", "title": "" }, { "docid": "20c5359d33601ee86bdcc6776cc13267", "score": "0.5959753", "text": "get State() {\n return _state;\n }", "title": "" }, { "docid": "20c5359d33601ee86bdcc6776cc13267", "score": "0.5959753", "text": "get State() {\n return _state;\n }", "title": "" }, { "docid": "20c5359d33601ee86bdcc6776cc13267", "score": "0.5959753", "text": "get State() {\n return _state;\n }", "title": "" }, { "docid": "20c5359d33601ee86bdcc6776cc13267", "score": "0.5959753", "text": "get State() {\n return _state;\n }", "title": "" }, { "docid": "68c7ebfce912fc3a3b5769ee15fef371", "score": "0.59582406", "text": "function setup() {\r\n\tsetState(state);\r\n}// di sini selanjutnya membuat status dimana jika motion sensor", "title": "" }, { "docid": "5632cca9ed3dce91fb869d8f8a3b8291", "score": "0.59527755", "text": "constructor() {\n\t\tsuper();\n\t\tthis.state = {\n firstName : \"\",\n lastName : \"\",\n age : \"\",\n gender : \"\",\n location : \"\",\n vegeterian : false,\n spicy : true,\n freeporc : false,\n };\n this.handleChange = this.handleChange.bind(this);\n\t}", "title": "" }, { "docid": "7cfea5976105d675f7b3a52e4983a7a0", "score": "0.5951249", "text": "_updateState() {\n console.log('State should be changed');\n }", "title": "" }, { "docid": "5cb167e11873c97fb9c00cd924616d7c", "score": "0.5945465", "text": "function msp(state) {\n}", "title": "" }, { "docid": "3e296ddb04932f016500c4df53b7c460", "score": "0.59357786", "text": "function setVariableState(variable, value, type){\n options[variable] = value;\n if(type !== 'internal'){\n originals[variable] = value;\n }\n }", "title": "" }, { "docid": "3e296ddb04932f016500c4df53b7c460", "score": "0.59357786", "text": "function setVariableState(variable, value, type){\n options[variable] = value;\n if(type !== 'internal'){\n originals[variable] = value;\n }\n }", "title": "" }, { "docid": "3e296ddb04932f016500c4df53b7c460", "score": "0.59357786", "text": "function setVariableState(variable, value, type){\n options[variable] = value;\n if(type !== 'internal'){\n originals[variable] = value;\n }\n }", "title": "" }, { "docid": "3e296ddb04932f016500c4df53b7c460", "score": "0.59357786", "text": "function setVariableState(variable, value, type){\n options[variable] = value;\n if(type !== 'internal'){\n originals[variable] = value;\n }\n }", "title": "" }, { "docid": "3e296ddb04932f016500c4df53b7c460", "score": "0.59357786", "text": "function setVariableState(variable, value, type){\n options[variable] = value;\n if(type !== 'internal'){\n originals[variable] = value;\n }\n }", "title": "" }, { "docid": "3e296ddb04932f016500c4df53b7c460", "score": "0.59357786", "text": "function setVariableState(variable, value, type){\n options[variable] = value;\n if(type !== 'internal'){\n originals[variable] = value;\n }\n }", "title": "" }, { "docid": "3e296ddb04932f016500c4df53b7c460", "score": "0.59357786", "text": "function setVariableState(variable, value, type){\n options[variable] = value;\n if(type !== 'internal'){\n originals[variable] = value;\n }\n }", "title": "" }, { "docid": "3e296ddb04932f016500c4df53b7c460", "score": "0.59357786", "text": "function setVariableState(variable, value, type){\n options[variable] = value;\n if(type !== 'internal'){\n originals[variable] = value;\n }\n }", "title": "" }, { "docid": "4187a96c30f19e0a923c03a0a098e52c", "score": "0.5933282", "text": "get initialState() {\n return {\n // this submitted variable is required \n submitted: false,\n // ###TODO###: add more variables below \n };\n }", "title": "" }, { "docid": "20890e8753d09158d7680f9ee9aae0ae", "score": "0.592781", "text": "stateChanged(state) {\n this._quantity = cartQuantitySelector(state);\n this._error = state.shop.error;\n this._page = state.app.page;\n }", "title": "" }, { "docid": "d957d0d2d020a4e677a8a98757b30686", "score": "0.5924715", "text": "state(updatedState) {\n if (updatedState === undefined) return this.phaseState;\n Object.keys(updatedState).forEach((key) => {\n this.phaseState[key] = updatedState[key];\n });\n return null;\n }", "title": "" }, { "docid": "605e890e30c8c4553f46ecd3b206b153", "score": "0.592382", "text": "function setVariableState(variable, value, type){\r\n options[variable] = value;\r\n if(type !== 'internal'){\r\n originals[variable] = value;\r\n }\r\n }", "title": "" }, { "docid": "ec3b31859fd964d3e4b16528a83d3361", "score": "0.59206975", "text": "constructor() {\r\n super();\r\n this.state = {\r\n btcprice: \"\",\r\n ltcprice: \"\",\r\n ethprice: \"\"\r\n };\r\n }", "title": "" }, { "docid": "93e1ba18a854714d443ef9d814603ae9", "score": "0.5919167", "text": "get state() {\n return this._state;\n }", "title": "" }, { "docid": "93e1ba18a854714d443ef9d814603ae9", "score": "0.5919167", "text": "get state() {\n return this._state;\n }", "title": "" }, { "docid": "93e1ba18a854714d443ef9d814603ae9", "score": "0.5919167", "text": "get state() {\n return this._state;\n }", "title": "" }, { "docid": "cd0a664d63d5a513e183a966494f3223", "score": "0.59166133", "text": "changeState(field, value){\n let state = Session.get('medicationCardState');\n state[field] = value;\n Session.set('medicationCardState', state);\n }", "title": "" }, { "docid": "e8dc736283aa6b1f1f41362f138677c3", "score": "0.5910143", "text": "constructor() {\r\n super();\r\n\r\n this.state = {\r\n exampleStateArray: [1, 2, 3, 4, 5],\r\n };\r\n }", "title": "" }, { "docid": "f99846d4a37a352721290b5057cc22fc", "score": "0.59048706", "text": "updateState () {\n }", "title": "" }, { "docid": "7fceb24d8f4147b2a8cd01e5381cdc48", "score": "0.5902106", "text": "passItUp(){\n let state = this.state;\n let save = {\n name: state.name,\n id: state.id,\n currency: state.currency,\n jsStocks: state.jsStocks,\n total_value: state.total_value,\n };\n if(debugAll)console.log(\"Saving state!\", save);\n this.updatePortfolio(save);\n }", "title": "" }, { "docid": "376b9000a4bf1a6b51f5d7f225475ef4", "score": "0.5886679", "text": "constructor(){\n super();\n this.state = {\n red: 0,\n green: 0,\n blue: 0\n }\n this.update = this.update.bind(this)\n }", "title": "" }, { "docid": "d84cb9378bbd55d063f691cff95a178c", "score": "0.5886332", "text": "changeValue() {\n this.props.onChange(\n this.props.name,\n this.state,\n this.validate(this.state.active, this.state.length)\n );\n }", "title": "" }, { "docid": "e61693e908d075d4db0bda41be2aec31", "score": "0.58852446", "text": "get state() { return this.viewState.state; }", "title": "" }, { "docid": "e61693e908d075d4db0bda41be2aec31", "score": "0.58852446", "text": "get state() { return this.viewState.state; }", "title": "" }, { "docid": "3cfa61404cac8306561770250a8b70b8", "score": "0.58843535", "text": "constructor(props) {\n super(props);\n const value = props.value || {};\n this.state = {\n hookRule: value.hookRule || \"0\",\n receiverEmails: value.receiverEmails || \"\",\n taskName: value.taskName || \"\",\n taskId: value.taskId,\n disabled: value.disabled,\n };\n }", "title": "" }, { "docid": "ed3510e345358e12e3c3a6292e4f498c", "score": "0.58840895", "text": "function ch_state()\n{\n\tthis.completed = !this.completed;\n}", "title": "" }, { "docid": "396eb6de31c49d1b10dc392e0832282d", "score": "0.5879307", "text": "asignarValorState(campo,valor,objeto){\n //Se crea el objeto que hara referncia al state\n let Obj = this.state[objeto];\n //Se crea el switch para entrar a las opciones\n Obj[campo] = valor;\n //Se realiza la actualizacion del state\n this.setState({\n objeto:Obj\n })\n }", "title": "" }, { "docid": "396eb6de31c49d1b10dc392e0832282d", "score": "0.5879307", "text": "asignarValorState(campo,valor,objeto){\n //Se crea el objeto que hara referncia al state\n let Obj = this.state[objeto];\n //Se crea el switch para entrar a las opciones\n Obj[campo] = valor;\n //Se realiza la actualizacion del state\n this.setState({\n objeto:Obj\n })\n }", "title": "" }, { "docid": "d2327fb283d10a202f076abda91ccc24", "score": "0.5877914", "text": "updateValues (evt) {\n const { name, value } = evt.target;\n\n /* [name]:\n will find inside the state the attribute with that same name\n to update it's value\n */\n\n this.setState({\n [name]: value,\n });\n }", "title": "" }, { "docid": "28cff61f3a764626db1b63b9283cc41c", "score": "0.58699787", "text": "constructor(props) {\n super(props);\n this.state = {\n balance: 0,\n rate: 0,\n term: 15,\n submit: 0,\n };\n this.calculate = this.calculate.bind(this);\n this.updateState = this.updateState.bind(this);\n }", "title": "" }, { "docid": "a89025f13d2f2b8c211e3e408eb8e227", "score": "0.5868946", "text": "setUsers(state, value) {\n state.user = value // le digo que la variable global user va a pasar a ser un valor.\n }", "title": "" }, { "docid": "ce215fe616d9e3aa12053cd901b2238c", "score": "0.5868266", "text": "applyState(state) {\n const me = this;\n\n me.beginBatch();\n\n if ('locked' in state) {\n me.locked = state.locked;\n }\n\n if ('minWidth' in state) {\n me.minWidth = state.minWidth;\n }\n\n if ('width' in state) {\n me.width = state.width;\n }\n\n if ('flex' in state) {\n me.flex = state.flex;\n }\n\n if ('width' in state && me.flex) {\n me.flex = undefined;\n }\n else if ('flex' in state && me.width) {\n me.width = undefined;\n }\n\n if ('text' in state) {\n me.text = state.text;\n }\n\n if ('region' in state) {\n me.region = state.region;\n }\n\n if ('renderer' in state) {\n me.renderer = state.renderer;\n }\n\n if ('filterable' in state) {\n me.filterable = state.filterable;\n }\n\n me.endBatch();\n\n if ('hidden' in state) {\n me.toggle(state.hidden !== true);\n }\n }", "title": "" }, { "docid": "06e33f1ebe46bc48c7b7a6c282feaa17", "score": "0.586575", "text": "function _setFormState() {\n\n var time, \n queryVal, \n formState;\n\n time = new Date().getTime();\n queryVal = $queryBox.val();\n \n formState = {\n query: queryVal,\n unloadTime: time\n };\n\n localStorage.setItem(\"formState\", JSON.stringify(formState));\n\n }", "title": "" } ]
05c84e41b7d9126aabb6724515ad983c
my tests in ie11/chrome/FF indicate that keyDown repeats at about 35ms+/ 5ms after an initial 500ms delay. callback fires on the leading edge
[ { "docid": "93a0ec3d96eeadffbcd92de746dd3b33", "score": "0.0", "text": "function Repeater(callback) {\n\t var id,\n\t cancel = function cancel() {\n\t return clearInterval(id);\n\t };\n\n\t id = setInterval(function () {\n\t cancel();\n\t id = setInterval(callback, 35);\n\t callback(); //fire after everything in case the user cancels on the first call\n\t }, 500);\n\n\t return cancel;\n\t}", "title": "" } ]
[ { "docid": "db745ca5d2e4e6c9cf7272420e1ad0b0", "score": "0.7164345", "text": "_downKeyHandler() {\r\n\r\n }", "title": "" }, { "docid": "6d493a7c159773f65049c286f0e10adc", "score": "0.68883866", "text": "function keyEvent(e)\n{\n //It no worky good with out timeout method\n setTimeout(function(){ handleKey(e); }, 0);\n}", "title": "" }, { "docid": "8c7adaa2324201b906b186d1d7a7839c", "score": "0.68490726", "text": "function keyDown(e) {\n if (e.keyCode = 32) timeDelay = 100;\n}", "title": "" }, { "docid": "21eee297c1960a478854f7dccba09a6b", "score": "0.6733144", "text": "_upKeyHandler() {\r\n\r\n\r\n }", "title": "" }, { "docid": "77c3f132920d4d229b5c83f074ad2978", "score": "0.66328233", "text": "get KeyUp() {}", "title": "" }, { "docid": "ee52c10f36c5994b1bbec3fe1e826453", "score": "0.66301584", "text": "keyDown(_keycode) {}", "title": "" }, { "docid": "46afd0579499cafe599f2060d1a1e309", "score": "0.6497338", "text": "function KeyboardEvent(ev){ \n var key = ev.code;\n if (keybinds.includes(key) && debounce[keybinds.indexOf(key)]){//[keybinds.indexOf(key)]\n debounce[keybinds.indexOf(key)] = false;\n columnInput[keybinds.indexOf(key)] = columnInputActive[keybinds.indexOf(key)]\n checkHit([keybinds.indexOf(key)])\n //updateTrack()\n }\n }", "title": "" }, { "docid": "c4582a3aa6e2fc74923ebb5c188a5ec5", "score": "0.6473097", "text": "function keyup_ie(){\n stop_key ( window.event.keyCode );\n }", "title": "" }, { "docid": "9fea73dbc074a3a78a7aef371e2648bc", "score": "0.6464358", "text": "function keyUpHandler(){\n hero.loop=false;\n if(hero.currentFrame==0||hero.currentFrame==1){\n hero.gotoAndStop(1);\n }\n\n}", "title": "" }, { "docid": "a8e24b7c5aa6bb6e7382543434e49dd7", "score": "0.6395886", "text": "function keyDownHandler(e) {\n\tif (e.which == 32) {\n\t\te.preventDefault();\n\t\t$(\"#bumpersStartPauseButton\").click();\n\t} else if (e.which >= 37 && e.which <= 40) {\n\t\t//stop screen scrolling with arrow keys\n\t\te.preventDefault();\n\t\tarrowKeys.onKeyDown(e);\n\t} else {\n\t\twasdKeys.onKeyDown(e);\n\t}\n}", "title": "" }, { "docid": "7a5c21c7452f5170d0d58161a06577cf", "score": "0.638933", "text": "get KeyDown() {}", "title": "" }, { "docid": "7a4c4f9bf0c0043da3d1d4c75cd60f06", "score": "0.63858926", "text": "propagateKeyDown(event) {\n this.control.keyDown(event);\n }", "title": "" }, { "docid": "87727bd8332602b2a1cea77cae7cd352", "score": "0.63680243", "text": "function testKeyEvent(e) {\n\t if (e.target.nodeName.toLowerCase() !== 'input') {\n\t var key = _.invert(KEYS)[e.which];\n\t if (key) {\n\t\n\t e.preventDefault();\n\t dispatcher.trigger('keycontrols:keypressed', key);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "c0acd97ad793ee01fac104cf158b1f31", "score": "0.63405925", "text": "function keyDownHandler(e) {\n if(blocking == false) {\n if(e.keyCode == 66) {\n blocking = true;\n }\n else if(e.key == 'Right' || e.key == 'ArrowRight') {\n if(linkx + 75 < WIN_WIDTH) {\n linkx += linkv;\n }\n\n } \n else if(e.key == 'Left' || e.key == 'ArrowLeft') {\n if(linkx > 75) {\n linkx -= linkv;\n }\n }\n else if(e.key == 'Up' || e.key == 'ArrowUp') {\n if(linky > 75) {\n linky -= linkv;\n }\n }\n else if(e.key == 'Down' || e.key == 'ArrowDown') {\n if(linky + 75 < WIN_HEIGHT) {\n linky += linkv;\n }\n }\n // fire a arrow when the space bar is hit \n else if(e.keyCode == 32) {\n if(justFired == false) {\n new_arrow = new Arrow(linkx, linky);\n arrows.push(new_arrow);\n \n justFired = true;\n setTimeout(toggleJustFired, 500);\n }\n }\n }\n}", "title": "" }, { "docid": "f9f914f5c6cb476837ac7a74d408cded", "score": "0.6339379", "text": "_keyDown(event) {\n const keyCode = event.key;\n let allDirections = Direction.getAll();\n for (var i = 0; i < allDirections.length; i++ ) {\n let direction = allDirections[i];\n if (keyCode == direction.getAssociatedKeycode()) {\n this.callback(direction);\n }\n }\n }", "title": "" }, { "docid": "8ca66a68bff829afd0aa32a2461d55cf", "score": "0.63333684", "text": "function C012_AfterClass_PoolBullyFight_KeyDown() {\n\tFightKeyDown();\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "0e85ebad50b140036112860b0231f1c9", "score": "0.62977284", "text": "function handlePointerDown() {\n hadKeyboardEvent = false;\n}", "title": "" }, { "docid": "e9a5230dbc5e2a44f866199c599a4bad", "score": "0.628721", "text": "function keydownfn( ev ) {\r\n try {\r\n \t//Get the Pressed Key\r\n\t\tvar key;\r\n\t\tif (_ns) key = ev.which; //Netscape\r\n\t\tif (_ie) key = event.keyCode; //Internet Explorer\r\n\r\n\t\tswitch ( key ) {\r\n\t\t\tcase VK_F1: //(F1) Help Key\r\n\t\t\t\tif (previousKey == VK_ALT) openHelpPage();\r\n\t\t\t\telse openAcceleratorsPage();\r\n\t\t\t\tcancelEvent(ev);\r\n\t\t\t\treturn false;\r\n\r\n\t\t\tcase VK_M: //(ALT + M) Menu Focus Key\r\n\t\t\t\tif (previousKey == VK_ALT) {\r\n\t\t\t\t\tmenuFocus();\r\n\t\t\t\t\tcancelEvent(ev);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase VK_BACKSPACE: //(<--)\r\n\t\t\t\tvar element;\r\n\t\t\t\tif (_ns) element = ev.target;\r\n\t\t\t\tif (_ie) element = event.srcElement;\r\n\t\t\t\tif (element.tagName != \"INPUT\" && element.tagName != \"TEXTAREA\") {\r\n\t\t\t\t\tcancelEvent(ev);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase VK_UP: //(UP Arrow)\r\n\t\t\t\tif (!editingText()) {\r\n\t\t\t\t\tif (!isMenuFocus()) {\r\n\t\t\t\t\t\tselectPrev();\r\n\t\t\t\t\t\tcancelEvent(ev);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tselectPrevMenu();\r\n\t\t\t\t\t\tcancelEvent(ev);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn false;\r\n\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase VK_DOWN: //(DOWN Arrow)\r\n\t\t\t\tif (!editingText()) {\r\n\t\t\t\t\tif (!isMenuFocus()) {\r\n\t\t\t\t\t\tselectNext();\r\n\t\t\t\t\t\tcancelEvent(ev);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tselectNextMenu();\r\n\t\t\t\t\t\tcancelEvent(ev);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase VK_LEFT: //(LEFT Arrow)\r\n\t\t\t\tif (!editingText()) {\r\n\t\t\t\t\tif (!isMenuFocus()) {\r\n\t\t\t\t\t\tpageUp();\r\n\t\t\t\t\t\tcancelEvent(ev);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase VK_RIGHT: //(RIGHT Arrow)\r\n\t\t\t\tif (!editingText()) {\r\n\t\t\t\t\tif (!isMenuFocus()) {\r\n\t\t\t\t\t\tpageDown();\r\n\t\t\t\t\t\tcancelEvent(ev);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase VK_HOME: //(HOME Key)\r\n\t\t\t\tif (!editingText()) {\r\n\t\t\t\t\tif (!isMenuFocus()) {\r\n\t\t\t\t\t\tselectFirstPage();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tselectFirstMenu();\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase VK_END: //(END Key)\r\n\t\t\t\tif (!editingText()) {\r\n\t\t\t\t\tif (!isMenuFocus()) {\r\n\t\t\t\t\t\tselectLastPage();\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase VK_PAGE_UP: //(PAGE UP Key)\r\n\t\t\t\tif (!editingText()) {\r\n\t\t\t\t\tif (!isMenuFocus()) {\r\n\t\t\t\t\t\tpageUp();\r\n\t\t\t\t\t\tcancelEvent(ev);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase VK_PAGE_DOWN: //(PAGE DOWN Key)\r\n\t\t\t\tif (!editingText()) {\r\n\t\t\t\t\tif (!isMenuFocus()) {\r\n\t\t\t\t\t\tpageDown();\r\n\t\t\t\t\t\tcancelEvent(ev);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase VK_ENTER: //(INTRO Key)\r\n\t\t\t\tif (!editingText()) {\r\n\t\t\t\t\tif (!isMenuFocus()) {\r\n\t\t\t\t\t\tif ( selected ){\r\n\t\t\t\t\t\t\tsendRow(selected);\r\n\t\t\t\t\t\t\tcancelEvent(ev);\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase VK_ESCAPE: //(ESC Key)\r\n\t\t\t\tif (!isMenuFocus()) {\r\n\t\t\t\t\tif (!executeButton(CANCEL_BUTTON)) onCancel();\r\n\t\t\t\t\tcancelEvent(ev);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tformFocus();\r\n\t\t\t\t\tcancelEvent(ev);\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase VK_F12: //(F12) Save button\r\n\t\t\t\texecuteButton(SAVE_BUTTON);\r\n\t\t\t\tcancelEvent(ev);\r\n\t\t\t\treturn false;\r\n\r\n\t\t\tcase VK_INSERT: //(Ins) New button\r\n\t\t\t\tif (!editingText()) {\r\n\t\t\t\t\texecuteButton(NEW_BUTTON);\r\n\t\t\t\t\tcancelEvent(ev);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase VK_DELETE: //(Del) Remove button\r\n\t\t\t\tif (!editingText()) {\r\n\t\t\t\t\texecuteButton(DEL_BUTTON);\r\n\t\t\t\t\tcancelEvent(ev);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase VK_KP_PLUS: //(+) Open menu\r\n\t\t\t\tif (!editingText()) {\r\n\t\t\t\t\tif (isMenuFocus()) {\r\n\t\t\t\t\t\topenMenu();\r\n\t\t\t\t\t\tcancelEvent(ev);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase VK_KP_MINUS: //(-) Close menu\r\n\t\t\t\tif (!editingText()) {\r\n\t\t\t\t\tif (isMenuFocus()) {\r\n\t\t\t\t\t\tcloseMenu();\r\n\t\t\t\t\t\tcancelEvent(ev);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tif(key == VK_ALT || key == VK_CTRL) previousKey = key;\r\n\t\telse previousKey = null;\r\n\t\treturn true;\r\n }\r\n catch (e) {}\r\n}", "title": "" }, { "docid": "499e40d08ac5b8473d78a52ca90d94ea", "score": "0.6271448", "text": "_keydownHandler(event) {\n event.preventDefault();\n if (event.key === this.keyValue) {\n if (this.isUp && this.press) this.press();\n this.isDown = true;\n this.isUp = false;\n }\n }", "title": "" }, { "docid": "a1344b976a6ad914fd190e49a07a6d37", "score": "0.62584925", "text": "set KeyDown(value) {}", "title": "" }, { "docid": "e652878cbfcf3139d0efa96afde0e2fb", "score": "0.6256606", "text": "keyUp(_keycode) {}", "title": "" }, { "docid": "24114609631900ea179ec6b0222dd2a1", "score": "0.6253894", "text": "set KeyUp(value) {}", "title": "" }, { "docid": "b100f944c0ae23697490a84ef941548a", "score": "0.6246324", "text": "function keyDown (callback) {\n\n\t\teditArea.addEventListener('keydown', function (keyEvent) {\n\t\t\tcallback(keyEvent);\n\t\t});\n\n\t}", "title": "" }, { "docid": "2e6529abd711b209dce06ebc02194664", "score": "0.62438893", "text": "function keyDown() {\n\tclearTimeout(typingTimer);\n}", "title": "" }, { "docid": "32173ecfe5248669bd67d221b8f0794c", "score": "0.6237409", "text": "function keydownHandler(e) {\r\n\r\n clearTimeout(keydownId);\r\n\r\n var activeElement = $(':focus');\r\n\r\n if(!activeElement.is('textarea') && !activeElement.is('input') && !activeElement.is('select') &&\r\n activeElement.attr('contentEditable') !== \"true\" && activeElement.attr('contentEditable') !== '' &&\r\n options.keyboardScrolling && options.autoScrolling){\r\n var keyCode = e.which;\r\n\r\n //preventing the scroll with arrow keys & spacebar & Page Up & Down keys\r\n var keyControls = [40, 38, 32, 33, 34];\r\n if($.inArray(keyCode, keyControls) > -1){\r\n e.preventDefault();\r\n }\r\n\r\n controlPressed = e.ctrlKey;\r\n\r\n keydownId = setTimeout(function(){\r\n onkeydown(e);\r\n },150);\r\n }\r\n }", "title": "" }, { "docid": "32173ecfe5248669bd67d221b8f0794c", "score": "0.6237409", "text": "function keydownHandler(e) {\r\n\r\n clearTimeout(keydownId);\r\n\r\n var activeElement = $(':focus');\r\n\r\n if(!activeElement.is('textarea') && !activeElement.is('input') && !activeElement.is('select') &&\r\n activeElement.attr('contentEditable') !== \"true\" && activeElement.attr('contentEditable') !== '' &&\r\n options.keyboardScrolling && options.autoScrolling){\r\n var keyCode = e.which;\r\n\r\n //preventing the scroll with arrow keys & spacebar & Page Up & Down keys\r\n var keyControls = [40, 38, 32, 33, 34];\r\n if($.inArray(keyCode, keyControls) > -1){\r\n e.preventDefault();\r\n }\r\n\r\n controlPressed = e.ctrlKey;\r\n\r\n keydownId = setTimeout(function(){\r\n onkeydown(e);\r\n },150);\r\n }\r\n }", "title": "" }, { "docid": "32173ecfe5248669bd67d221b8f0794c", "score": "0.6237409", "text": "function keydownHandler(e) {\r\n\r\n clearTimeout(keydownId);\r\n\r\n var activeElement = $(':focus');\r\n\r\n if(!activeElement.is('textarea') && !activeElement.is('input') && !activeElement.is('select') &&\r\n activeElement.attr('contentEditable') !== \"true\" && activeElement.attr('contentEditable') !== '' &&\r\n options.keyboardScrolling && options.autoScrolling){\r\n var keyCode = e.which;\r\n\r\n //preventing the scroll with arrow keys & spacebar & Page Up & Down keys\r\n var keyControls = [40, 38, 32, 33, 34];\r\n if($.inArray(keyCode, keyControls) > -1){\r\n e.preventDefault();\r\n }\r\n\r\n controlPressed = e.ctrlKey;\r\n\r\n keydownId = setTimeout(function(){\r\n onkeydown(e);\r\n },150);\r\n }\r\n }", "title": "" }, { "docid": "1d833ae86d9faaa1c54cd578a978160c", "score": "0.62288356", "text": "function KeyboardupEvent(ev){\n var key = ev.code;\n if (keybinds.includes(key)){\n debounce[keybinds.indexOf(key)] = true;\n columnInput[keybinds.indexOf(key)] = columnInputPassive[keybinds.indexOf(key)]\n //updateTrack()\n }\n }", "title": "" }, { "docid": "00686771432cf671a7a7820679d21d87", "score": "0.62223786", "text": "function keyDownHandler(event){\n\t\tif(event.which == 80 || event.which == 13){\n\t\t\ttogglePause();\n\t\t}\n\t\tif(event.which == 39){\n\t\t\trightPressed = true;\n\t\t}\n\t\telse if(event.which == 37){\n\t\t\tleftPressed = true;\n\t\t}\n\t}", "title": "" }, { "docid": "7295e90a8d5ea1ecd8da9b2d99061e1e", "score": "0.62209934", "text": "function keydownHandler(e) {\n\n clearTimeout(keydownId);\n\n var activeElement = $(':focus');\n\n if(!activeElement.is('textarea') && !activeElement.is('input') && !activeElement.is('select') &&\n activeElement.attr('contentEditable') !== \"true\" && activeElement.attr('contentEditable') !== '' &&\n options.keyboardScrolling && options.autoScrolling){\n var keyCode = e.which;\n\n //preventing the scroll with arrow keys & spacebar & Page Up & Down keys\n var keyControls = [40, 38, 32, 33, 34];\n if($.inArray(keyCode, keyControls) > -1){\n e.preventDefault();\n }\n\n controlPressed = e.ctrlKey;\n\n keydownId = setTimeout(function(){\n onkeydown(e);\n },150);\n }\n }", "title": "" }, { "docid": "3f8ad7be866d85e26af543da8d9d0026", "score": "0.6219738", "text": "function keyUpHandler(e) {\n\t//fix for spacebar doing last click action on keyUp bug\n\tif (e.which == 32) {\n\t\te.preventDefault();\n\t}\n\n\tarrowKeys.onKeyUp(e);\n\twasdKeys.onKeyUp(e);\n}", "title": "" }, { "docid": "6b83b5fbe301c2e9f855276dffaca6e9", "score": "0.62174743", "text": "function lg_onKeydown()\n{\n\tif (event.srcElement.hasChanges==true && (event.keyCode==13 || event.keyCode==9))\n\t{\n\t\tif (event.srcElement.onchange!=null)\n\t\t\tevent.srcElement.onchange();\n\t\tevent.srcElement.hasChanges=false;\n\t\treturn;\n\t}\n\tif (event.keyCode==27)\n\t{\n\t\treturn;\n\t}\t\n\tif ((event.keyCode>96 && event.keyCode<112) || (event.keyCode>64 && event.keyCode<91) || (event.keyCode>48 && event.keyCode<91) || (event.keyCode==40 || event.keyCode==38 || event.keyCode==46 || event.keyCode==8) && (event.keyCode!=27))\n\t{\n\t\tif (event.srcElement.range!=null)\n\t\t{\t\n\t\t\tevent.srcElement.range=null;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "41d72de96024e5a93037f3f8ee419134", "score": "0.62099165", "text": "function keydownControl(e) {\n\n}", "title": "" }, { "docid": "6f3fee0c50a8cf416835020254f84926", "score": "0.62076765", "text": "windowKeyDown_(e) {\n //if (e.target === ime._input) // 非输入型控件为什么不能接收按键\n if (this._focus)\n this._keyDown(e);\n //else\n // e.preventDefault();\n }", "title": "" }, { "docid": "67cf711176876cfa928a0e88f7f9b8cf", "score": "0.61885333", "text": "static InjectKeyDown(code)\n\t{\n\t\t//don't process a key down event if the key is already being held\n\t\tif(this.#KeyHeld.has(code)) return;\n\t\tif(Input.#Blocking)\n\t\t\tInput.#PendingKeyDown.set(code, Time.time);\n\t\telse\n\t\t{\n\t\t\tInput.#KeyDown.set(code, Time.time);\n\t\t\tInput.#KeyHeld.set(code, Time.time);\n\t\t}\n\t}", "title": "" }, { "docid": "7d737bcef7e8f1e8397b38e0d650765a", "score": "0.61814964", "text": "function onKeyDown(e) {\n\tconsole.log(\">>onKeyDown\");\n\tconsole.log(\">> e onKeyDown\");\n if (! conf.focused) {\n return true;\n }\n var fevt = null, evt = (e ? e : window.event),\n keysym = null, suppress = false;\n console.log(\"onKeyDown kC:\" + evt.keyCode + \" cC:\" + evt.charCode + \" w:\" + evt.which);\n\n fevt = copyKeyEvent(evt);\n\n keysym = getKeysymSpecial(evt);\n // Save keysym decoding for use in keyUp\n fevt.keysym = keysym;\n if (keysym) {\n // If it is a key or key combination that might trigger\n // browser behaviors or it has no corresponding keyPress\n // event, then send it immediately\n if (conf.onKeyPress && !ignoreKeyEvent(evt)) {\n console.log(\"onKeyPress down, keysym: \" + keysym +\n \" (onKeyDown key: \" + evt.keyCode +\n \", which: \" + evt.which + \")\");\n conf.onKeyPress(keysym, 1, evt);\n }\n suppress = true;\n }\n\n if (! ignoreKeyEvent(evt)) {\n // Add it to the list of depressed keys\n pushKeyEvent(fevt);\n //show_keyDownList('down');\n }\n\n if (suppress) {\n // Suppress bubbling/default actions\n Util.stopEvent(e);\n return false;\n } else {\n // Allow the event to bubble and become a keyPress event which\n // will have the character code translated\n return true;\n }\n}", "title": "" }, { "docid": "a9b3033104507cf8d5faa6e0eb9313a0", "score": "0.6173018", "text": "function initTest(){if(options.keyboardSupport){addEvent('keydown',keydown);}}", "title": "" }, { "docid": "c2d37522ff9f5cbbf85d03e9b5f8ce09", "score": "0.6160444", "text": "function keyUp(event) {}", "title": "" }, { "docid": "c2d37522ff9f5cbbf85d03e9b5f8ce09", "score": "0.6160444", "text": "function keyUp(event) {}", "title": "" }, { "docid": "f72f09d9d0d7b1ed703ef44b049bf6c9", "score": "0.6159938", "text": "androidWorkaroundKeyup(e) {\n const newValue = e.target.value;\n let key;\n if (newValue.length > this.downValue.length) {\n key = newValue.charCodeAt(newValue.length - 1);\n } else {\n key = 'delete';\n }\n this.cb({ key, e, keystroke: this });\n }", "title": "" }, { "docid": "cd54be7ae82ae5fc7729a3d6ee210c98", "score": "0.61434436", "text": "function keydown (event) {\n\t switch (event.keyCode) {\n\t case $mdConstant.KEY_CODE.LEFT_ARROW:\n\t event.preventDefault();\n\t incrementIndex(-1, true);\n\t break;\n\t case $mdConstant.KEY_CODE.RIGHT_ARROW:\n\t event.preventDefault();\n\t incrementIndex(1, true);\n\t break;\n\t case $mdConstant.KEY_CODE.SPACE:\n\t case $mdConstant.KEY_CODE.ENTER:\n\t event.preventDefault();\n\t if (!locked) select(ctrl.focusIndex);\n\t break;\n\t }\n\t ctrl.lastClick = false;\n\t }", "title": "" }, { "docid": "e22c4d1dd1de1a0bd6d69c99c9319eb1", "score": "0.61402017", "text": "function prepKeyDownTimeout(code) {\n\tkeyDownTimeout = setTimeout(() => {\n\t\tcanTakeMany[code] = true;\n\t\tclearTimeout(keyDownTimeout);\n\t\tkeyDownTimeout = null;\n\t}, keyDownTimeoutDuration);\n}", "title": "" }, { "docid": "64ca9c72f8fead487d7fbeb31ee02a25", "score": "0.6133309", "text": "function handler(ev) {\n // check key code\n if (ev.code === key) {\n callbackFunction()\n }}", "title": "" }, { "docid": "542b5f195dc7f0affced6c815b1d6653", "score": "0.61200416", "text": "function editorDoc_onkeyup(oEdt)\n {\n \n if(oEdt.tmKeyup) {clearTimeout(oEdt.tmKeyup); oEdt.tmKeyup=null;} \n if(!oEdt.tmKeyup)oEdt.tmKeyup=setTimeout(function(){realTime(oEdt);}, 1000);\n\n //realTime(edtObj);\n }", "title": "" }, { "docid": "2817f4b467704b627f198e23d8d1547b", "score": "0.6119091", "text": "function TextBoxKeyupEventHandler()\n {\n clearTimeout(timer_id_tb_reflection_);\n timer_id_tb_reflection_ = setTimeout(\n (function(){textBoxValueReflectEvent()}),\n CommonManager.TEXTBOX_VALUE_REFLECT_TIME);\n }", "title": "" }, { "docid": "83979ce1551177814efd6229c76e3ff7", "score": "0.61110216", "text": "didKeydown (event) {\n // Stop dragging when user interacts with the keyboard. This prevents\n // unwanted selections in the case edits are performed while selecting text\n // at the same time. Modifier keys are exempt to preserve the ability to\n // add selections, shift-scroll horizontally while selecting.\n if (this.stopDragging && event.key !== 'Control' && event.key !== 'Alt' && event.key !== 'Meta' && event.key !== 'Shift') {\n this.stopDragging()\n }\n\n if (this.lastKeydownBeforeKeypress != null) {\n if (this.lastKeydownBeforeKeypress.code === event.code) {\n this.accentedCharacterMenuIsOpen = true\n }\n\n this.lastKeydownBeforeKeypress = null\n }\n\n this.lastKeydown = event\n }", "title": "" }, { "docid": "5a0d1e20682e29fd9e0da9434ee9dad7", "score": "0.6091152", "text": "function keyDown () {\n\n\t if (controller.last_event === 'keydown' && controller.last_event_identifier === d3.event.keyCode)\n\t return;\n\n\t switch (d3.event.keyCode) {\n\n\t case 39: \n\t controller.socket.emit('pressRight', controller.playerID);\n\t break;\n\n\t case 37:\n\t controller.socket.emit('pressLeft', controller.playerID); \n\t break;\n\n\t default:\n\t console.log(d3.event.key)\n\t console.log(d3.event.keyCode)\n\t console.error('Key not identified');\n\t \n\t }\n\n\t controller.last_event = 'keydown';\n\t controller.last_event_identifier = d3.event.key;\n\t \n\t }", "title": "" }, { "docid": "5d31d656fd3122039e21dca16520f29d", "score": "0.60861087", "text": "function keydownHandler(pKeyEvent)\r\n{\r\n\tvar\r\n\t\taMatch,\r\n\t\tsSelectCode,\r\n\t\tsTagName;\r\n\t\r\n\tsSelectCode = gsSelectCode;\r\n\tgsSelectCode = \"\";\r\n\t\r\n\tif (!pKeyEvent) {\r\n\t\tpKeyEvent = window.event\r\n\t}\r\n\tif (!pKeyEvent) {\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\tvar targetDOM;\r\n\tif (pKeyEvent.target) {\r\n\t\ttargetDOM = pKeyEvent.target\r\n\t}\r\n\telse\r\n\tif (pKeyEvent.srcElement) {\r\n\t\ttargetDOM = pKeyEvent.srcElement\r\n\t}\r\n\telse { // can't find source of event\r\n\t\treturn true;\r\n\t}\r\n\tif (targetDOM.nodeType == 3) { // defeat Safari bug\r\n\t\ttargetDOM = targetDOM.parentNode\r\n\t}\r\n\t//console.log(pKeyEvent.keyCode+' - '+pKeyEvent.which);//TEST\r\n//test\r\n//\tconsole.log('keydownHandler: ' + targetDOM.id + ' [' + pKeyEvent.keyCode + ']');//test\r\n\r\n\tif ((pKeyEvent.keyCode == 36) && (pKeyEvent.ctrlKey)) {\r\n\t\t// Ctrl-Home was pressed\r\n\t\tif (targetDOM.blur) { targetDOM.blur(); } // [02-22-11] sometimes blur not called...\r\n\t\twindow.scrollTo(0,0);\r\n\t\t$('#txtFindStudentKey').focus();\r\n\t\treturn false;\r\n\t}\r\n\r\n\t/* [11-27-06] obsolete with IE7, so removed completely\r\n\tif ((pKeyEvent.keyCode == 9) && (pKeyEvent.ctrlKey)) {\r\n\t\t// Ctrl-Tab was pressed; valid only for IE\r\n\t\tif (gbIsMSIE) {\r\n\t\t\ttabMoveToThe( ((pKeyEvent.shiftKey) ? \"left\" : \"right\") );\r\n\t\t\treturn false;\r\n\t\t}\r\n\t} */\r\n\t\r\n\tif (pKeyEvent.ctrlKey || pKeyEvent.altKey || pKeyEvent.shiftKey) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\tif ((targetDOM.id.indexOf('txtAwardYear') == 0)\r\n\t&& ((pKeyEvent.keyCode > 36) && (pKeyEvent.keyCode < 41))\r\n\t&& ($('#txtAwardYear').val().search(/^\\d{4}$/) == 0)) {\r\n\t\t// allows year value to be changed with arrow keys\r\n\t\tvar iYear = Number($('#txtAwardYear').val());\r\n\t\tif ((pKeyEvent.keyCode == 37)\r\n\t\t|| (pKeyEvent.keyCode == 38)) { // left or down arrow\r\n\t\t\tdocument.forms[0].txtAwardYear.value = iYear - 1;\r\n\t\t}\r\n\t\telse { // right or up arrow\r\n\t\t\tdocument.forms[0].txtAwardYear.value = iYear + 1;\r\n\t\t}\r\n\t\tdocument.forms[0].txtAwardYear.select(); // keeps focus on year obvious\r\n\t\treturn false;\r\n\t}\r\n\t\t\r\n\tif ((pKeyEvent.keyCode == 38) || (pKeyEvent.keyCode == 40)) {\r\n\t\tif (gsCurrentTab == 'tabWorksheet') {\r\n\t\t\taMatch = targetDOM.id.match(/^txt(Summer|Autumn|Winter|Spring)_(\\d+)_(\\d+)$/);\r\n\t\t\tif (aMatch != null) {\r\n\t\t\t\t// allow movement to prior/next field for this quarter\r\n\t\t\t\tawardTableMoveUpDown(pKeyEvent.keyCode,aMatch[1],aMatch[2],aMatch[3]);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\tif (gsCurrentTab == 'tabBudget') { // [01-01-18] added tabBudget{} block\r\n\t\t\tbgt_TableMoveUpDown(targetDOM.id,pKeyEvent.keyCode);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\tif (gsCurrentTab == 'tabDocuments') { // [03-31-11] added tabDocuments code\r\n\t\t\tif ((targetDOM.id.indexOf(\"txtDocNote_\") == 0)\r\n\t\t\t|| (targetDOM.id.indexOf(\"txtDocDate\") == 0)) {\r\n\t\t\t\tdoc_TableMoveUpDown(targetDOM.id,pKeyEvent.keyCode);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif ((pKeyEvent.keyCode == 9) // Tab key\r\n\t&& (giTabQuarterDefault > 1)) {\r\n\t\tif ((targetDOM.id.indexOf(\"txtAwardText\") == 0)\r\n\t\t|| ((targetDOM.id.indexOf(\"editSelect\") == 0) && (targetDOM.value != \"D\"))) {\r\n\t\t\taMatch = targetDOM.id.match(/\\D(_\\d+_\\d+)/);\r\n\t\t\tif (aMatch != null) {\r\n\t\t\t\t// focus on the quarter BEFORE the default quarter, and then\r\n\t\t\t\t// the pressed Tab key will focus on the desired default quarter\r\n\t\t\t\t$('#txt'+ gasQtrNameByCol[giTabQuarterDefault-2] + aMatch[1]).focus();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tif (pKeyEvent.keyCode <= 46) {\r\n\t\t// generally these are special keys like Tab, Home, Delete, Space, etc\r\n\t\t// [10-31-19] added\r\n\t\tif ((pKeyEvent.keyCode == 8 || pKeyEvent.keyCode == 46)\r\n\t\t&& (targetDOM.id.indexOf(\"dropHoldCode\") == 0)) {\r\n\t\t\tvar index = targetDOM.id.substr(targetDOM.id.length - 1);\r\n\t\t\tremoveAidHold(index);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\t// [01-01-18] added if{}\r\n\tif ((gsCurrentTab == \"tabBudget\")\r\n\t&& (targetDOM.id.indexOf(\"txtPlusOtherLabel\") != 0)) {\r\n\t\treturn bgt_KeydownHandler(targetDOM.id, pKeyEvent.keyCode);\r\n\t}\r\n\t\r\n\tsTagName = targetDOM.tagName.toLowerCase();\r\n\tif (sTagName.search(/select/) != 0) {\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\t// remaining code is just for <select> elements\r\n\r\n\tvar eventChar;\r\n\tif ((pKeyEvent.keyCode > 95) && (pKeyEvent.keyCode < 106)) {\r\n\t\t// keyCode's 96-105 are, apparently, the NumPad numbers 0-9; convert them to 'regular' numbers\r\n\t\teventChar = String.fromCharCode(pKeyEvent.keyCode - 48);\r\n\t}\r\n\telse {\r\n\t\teventChar = String.fromCharCode(pKeyEvent.keyCode);\r\n\t}\r\n\tif ( ! eventChar)\r\n\t\treturn true;\r\n\t\r\n\t// [11-27-06] added entire 'if' block regarding <select> custom attribute 'autocode'\r\n\tif (sTagName == 'select') {\r\n\t\tif (eventChar.search(/[0-9A-Z]/i) != 0) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tvar sAutoCode = targetDOM.getAttribute(\"autocode\");\r\n\t\tif ( ! sAutoCode)\r\n\t\t\treturn true;\r\n\t\t\t\r\n\t\tgsSelectCode = sSelectCode + eventChar.toUpperCase();\r\n\t\tvar bIsAutoTabRequested = false;\r\n\t\tif (sAutoCode.charAt(0) == \"T\") {\r\n\t\t\tbIsAutoTabRequested = true;\r\n\t\t\tsAutoCode = sAutoCode.substring(1);\r\n\t\t}\r\n\t\tif (gsSelectCode.length == sAutoCode) {\r\n\t\t\tsSelectCode = gsSelectCode;\r\n\t\t\tgsSelectCode = \"\";\r\n\t\t\t\r\n\t\t\t//var elem = $J(targetDOM.id); // not ready for jQuery\r\n\t\t\tvar elem = $D(targetDOM.id);\r\n\t\t\t// find code in <select>\r\n\t\t\tfor (var i=0; ((i < elem.length) && (elem.options[i].value != sSelectCode)); i++);\r\n\t\t\tif (i < elem.length) {\r\n\t\t\t\t// the code was found in the <select> element's options collection\r\n\t\t\t\telem.selectedIndex = i;\r\n\t\t\t\tif (targetDOM.id.search(/drop(AwardLetterComment|HoldCode)/) == 0) {\r\n\t\t\t\t\t// set of 5 dropdowns; unhide the next in sequence if needed\r\n\t\t\t\t\tdropDownListChange(targetDOM);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//if (navigator.userAgent.indexOf(\"Firefox\") != -1) {\t\t\t\t\t\t\r\n\t\t\t\telem.blur(); // defeats odd IE7/Firefox 'feature' which causes next selection to be highlighted\r\n\t\t\t\t//}\r\n\r\n\t\t\t\t// setTimeout prevents this keystroke from being processed in this control or the next.\r\n\t\t\t\t// I don't know why, but it does.\r\n\t\t\t\tif (bIsAutoTabRequested) {\r\n\t\t\t\t\tsetTimeout(\"focusNextFormElement('\"+ targetDOM.id +\"')\",1); // 1 ms\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tsetTimeout(\"$('#\"+ targetDOM.id +\"').focus()\",1); // 1 ms\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telse { // [11-27-06] added\r\n\t\t\t\tif (parseInt(sAutoCode) > 1) {\r\n\t\t\t\t\talertDialog('Code \"'+ sSelectCode +'\" is invalid.');\r\n\t\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": "5624739693dccca16f6eefa148d446dc", "score": "0.6068371", "text": "delayAndroidKey(key, keyCode) {\n var _a3;\n if (!this.delayedAndroidKey) {\n let flush = () => {\n let key2 = this.delayedAndroidKey;\n if (key2) {\n this.clearDelayedAndroidKey();\n if (!this.flush() && key2.force)\n dispatchKey(this.dom, key2.key, key2.keyCode);\n }\n };\n this.flushingAndroidKey = this.view.win.requestAnimationFrame(flush);\n }\n if (!this.delayedAndroidKey || key == \"Enter\")\n this.delayedAndroidKey = {\n key,\n keyCode,\n // Only run the key handler when no changes are detected if\n // this isn't coming right after another change, in which case\n // it is probably part of a weird chain of updates, and should\n // be ignored if it returns the DOM to its previous state.\n force: this.lastChange < Date.now() - 50 || !!((_a3 = this.delayedAndroidKey) === null || _a3 === void 0 ? void 0 : _a3.force)\n };\n }", "title": "" }, { "docid": "a6ebcc66ec16b8426ed90d6b208c50c6", "score": "0.6061749", "text": "function pointerdown_handler(ev) {\n // pointerdown 이벤트는 터치 반응이 시작을 알려준다.\n // 두 손가락이 터치하는 이벤트를 감지하기 위해 caching\n // output.innerHTML += `down <br/>`;\n evCache.push(ev);\n}", "title": "" }, { "docid": "7997bc90dd3cae86e9c41865a3d2d6f2", "score": "0.60609716", "text": "delayAndroidKey(key, keyCode) {\n if (!this.delayedAndroidKey)\n requestAnimationFrame(() => {\n let key = this.delayedAndroidKey;\n this.delayedAndroidKey = null;\n let startState = this.view.state;\n if (dispatchKey(this.view.contentDOM, key.key, key.keyCode))\n this.processRecords();\n else\n this.flush();\n if (this.view.state == startState)\n this.view.update([]);\n });\n // Since backspace beforeinput is sometimes signalled spuriously,\n // Enter always takes precedence.\n if (!this.delayedAndroidKey || key == \"Enter\")\n this.delayedAndroidKey = { key, keyCode };\n }", "title": "" }, { "docid": "b81c1cff6297508c0d62ccbee9658222", "score": "0.6058697", "text": "function listenForKeys() {\n keyIsDown();\n keyIsUp();\n}", "title": "" }, { "docid": "5fad70d5793504c64026289287648860", "score": "0.605704", "text": "canKeyDown() {\n return true\n }", "title": "" }, { "docid": "36e2266a43e160d4f411464074dcf4fb", "score": "0.60520214", "text": "function attach_key_events(){\n $(document).keypress(function(e) {\n console.log(\"Key pressed: \" + e.which);\n if(e.which>=49 && e.which<49+total_sound_num){\n $(\".select_sound\").removeClass(\"sel_highlighted\");\n local_sound_choice = e.which - 49;\n $(\"#sound_\"+(local_sound_choice+1)).addClass(\"sel_highlighted\");\n }else if(e.which == 76){\n stop_canvas = true;\n d_log(); // output log\n }else if(e.which == 72){\n emotion = \"H\";\n }else if(e.which == 83){\n emotion = \"S\";\n }else if(e.which == 65){\n emotion = \"A\";\n }\n });\n}", "title": "" }, { "docid": "6c52905e76add12225243b2100b0a073", "score": "0.6049008", "text": "function keyDown(e)\n{\n\tt=performance.now()\n\tvar keyCode = ('which' in e) ? e.which : e.keyCode;\n\te.preventDefault()\n\tif( lem && lem.fuel>0 )\n\t{\n\t\tif( keyCode==40 )\n\t\t{\n\t\t\tif( !lem.thrust_down ) lem.updatePosition(t)\n\t\t\tlem.thrust_down=true\n\t\t}\n\t\telse if( keyCode==37 )\n\t\t{\n\t\t\tif( !lem.thrust_left ) lem.updatePosition(t)\n\t\t\tlem.thrust_left=true\n\t\t}\n\t\telse if( keyCode==39 )\n\t\t{\n\t\t\tif( !lem.thrust_right ) lem.updatePosition(t)\n\t\t\tlem.thrust_right=true\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e4be08c42c08194acd01a198c846d0cb", "score": "0.6048367", "text": "function processKeyEvent(e) { this.callback(keyEvent.call(this, e)); }", "title": "" }, { "docid": "2639a7b8c28626c8425f0c60b523f87c", "score": "0.6035634", "text": "static set anyKeyDown(value) {}", "title": "" }, { "docid": "b48a40d4a348b93ccd2af352570ea30f", "score": "0.6034667", "text": "onKeyEvent(key, down) {\n this.keys[key] = down;\n if (!down && key == \"t\" && this.eventHandlers[\"openChat\"])\n this.eventHandlers.openChat();\n }", "title": "" }, { "docid": "427cddc33a88b3bd9e17b4697c4a749e", "score": "0.60328877", "text": "keydown (e) {\n\t\tthis.recordState(e)\n\t\tif (this.is_backspace) {\n\t\t\te.preventDefault()\n\n\t\t\tif (this.start != this.end) {\n\t\t\t\tthis.collapseSelection()\n\t\t\t\tthis.removeHint()\n\t\t\t\tthis.removeMask()\n\t\t\t\tthis.applyMask()\n\t\t\t\tthis.applyHint()\n\t\t\t\tthis.applyState()\n\t\t\t} else {\n\t\t\t\tthis.collapseSelection()\n\t\t\t\tthis.removeHint()\n\t\t\t\tthis.removeMask()\n\t\t\t\tthis.backspace()\n\t\t\t\tthis.applyMask()\n\t\t\t\tthis.applyHint()\n\t\t\t\tthis.applyState()\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "530f97db5bef328aecba181477cb923f", "score": "0.6032413", "text": "function KeyDown() {\n alert(\"Klaviş sıxıldı\");\n}", "title": "" }, { "docid": "0b615caa1e18785a5d5aace0cd142b7d", "score": "0.6030765", "text": "function setupKeyboardEvents() {\n $('#input').on('keydown', specialKeys);\n}", "title": "" }, { "docid": "7e23144c12281b2f0fde4f9e6e80b910", "score": "0.6018946", "text": "function handleKey(down, keyCode, charCode, event) {\n\t\tvar character = String.fromCharCode(charCode),\n\t\t\tkey = keys[keyCode] || character.toLowerCase(),\n\t\t\ttype = down ? 'keydown' : 'keyup',\n\t\t\tview = View._focused,\n\t\t\tscope = view && view.isVisible() && view._scope,\n\t\t\ttool = scope && scope._tool;\n\t\tkeyMap[key] = down;\n\t\tif (tool && tool.responds(type)) {\n\t\t\t// Call the onKeyDown or onKeyUp handler if present\n\t\t\ttool.fire(type, new KeyEvent(down, key, character, event));\n\t\t\tif (view)\n\t\t\t\tview.draw(true);\n\t\t}\n\t}", "title": "" }, { "docid": "714ab9a7fbba7497440afa8e3f42e38b", "score": "0.60184515", "text": "function _fncKeyDown(evt)\n{\n for (var i=0;i<_g_vInstances.length;i++)\n {\n var engine = _g_vInstances[i];\n engine.eventhandler.KeyDown(evt.keyCode);\n }\n \n if (_gcbfKeyDown)\n {\n _gcbfKeyDown(evt.keyCode); \n }\n return;\n}", "title": "" }, { "docid": "853573e9e09cd4a937df3e96e629ab1a", "score": "0.60182124", "text": "_keyupHandler(event) {\n event.preventDefault();\n if (event.key === this.keyValue) {\n if (this.isDown && this.release) this.release();\n this.isDown = false;\n this.isUp = true;\n }\n }", "title": "" }, { "docid": "c0cd839270980bb0da83b50bb07a44a3", "score": "0.60172653", "text": "function keydown (event) {\n switch (event.keyCode) {\n case $mdConstant.KEY_CODE.LEFT_ARROW:\n event.preventDefault();\n incrementIndex(-1, true);\n break;\n case $mdConstant.KEY_CODE.RIGHT_ARROW:\n event.preventDefault();\n incrementIndex(1, true);\n break;\n case $mdConstant.KEY_CODE.SPACE:\n case $mdConstant.KEY_CODE.ENTER:\n event.preventDefault();\n if (!locked) select(ctrl.focusIndex);\n break;\n }\n ctrl.lastClick = false;\n }", "title": "" }, { "docid": "2d6b7a069ca327ce2737ba7d61ea23e9", "score": "0.6016666", "text": "function keyPressed(key) {\n // no running into your self\n // 0 stopped, 1 top, 2 left, 3 down, 4 right\n\n // if (keyCode === 16) {\n // simGame.togglePlay()\n // }\n\n // Make a new KeyboardEvent with the key pressed\n // Notify all listeners\n var newKeyEvent = new KeyboardEvent(keyCode)\n eventManager.post(newKeyEvent)\n\n console.log(keyCode);\n\n // prevent default browser behavior\n return false;\n}", "title": "" }, { "docid": "5a10372aaf18404d48a9c24655e1db72", "score": "0.5996534", "text": "function BindKeyPress()\n{\n console.log(`Called BindKeyPress`);\n\n // bind keydown display\n /*\n $('main').on('keydown', function(e){\n if(transitionTimer == null && e.keyCode == 32)\n { \n let focusedItem = $(document.activeElement);\n let childItem = focusedItem.children('label');\n\n console.log(childItem);\n\n if(childItem != null)\n {\n \n if(!childItem.hasClass('spacePress'))\n {\n childItem.addClass('spacePress');\n\n if(prevItem != null)\n prevItem.toggleClass('spacePress');\n\n prevItem = childItem;\n }\n }\n } \n }); */\n\n // bind keyup selection\n $('main').on('keyup', function(e){\n if(transitionTimer == null && e.keyCode == 32)\n { \n let focusedItem = $(document.activeElement);\n if(focusedItem != null)\n {\n let childitem = focusedItem.children('label');\n let inputItem = focusedItem.children('input');\n \n if(inputItem.attr('id') == 'restart')\n {\n StartQuiz();\n }\n else\n {\n SelectItemByLabel(childitem);\n //childitem.addClass('selected');\n }\n }\n }\n });\n}", "title": "" }, { "docid": "edd0b7f97a1381bb38e2af957668782f", "score": "0.59953934", "text": "processKeyDown(event) {\n this.activeKeys[event.code]=true;\n }", "title": "" }, { "docid": "4caba625dd7e15831c894e7f1965ad26", "score": "0.59927386", "text": "function handleKeyDown(e) {\n //cross browser issues exist\n \n if (externalInputToggle){\n //externalInputToggle = false;\n //var externalInputValue = false;\n \n //if (externalInputValue){\n fwdHeld = externalInputValue;\n //}\n \n }else{\n \n if(!e){ var e = window.event; }\n switch(e.keyCode) {\n case KEYCODE_SPACE:\tshootHeld = true; return false;\n case KEYCODE_A:\n case KEYCODE_LEFT:\tlfHeld = true; return false;\n case KEYCODE_D:\n case KEYCODE_RIGHT: rtHeld = true; return false;\n case KEYCODE_W:\n case KEYCODE_UP:\tfwdHeld = true; return false;\n case KEYCODE_S:\n case KEYCODE_DOWN:\tbwdHeld = true; break;\n case KEYCODE_ENTER:\tif(canvas.onclick === handleClick){ handleClick(); }return false;\n }\n \n }\n \n}", "title": "" }, { "docid": "688922d7b3b66311742a3ea08482fe91", "score": "0.5987412", "text": "function keystrokeCallback( e ) {\r\n \r\n // we only car if the enter key was pressed\r\n if ( e.which==13 && !id.parentElement.parentElement.classList.contains( 'shrink' ) ) {\r\n \r\n // safe-guard b/c the enter key is NASTY\r\n e.preventDefault()\r\n \r\n // stop here if user didn't enter anything yet\r\n if ( id.innerHTML.length == 0 )\r\n return false\r\n \r\n // remove editable class from div (this way user does not mess\r\n // with it since it has been enter'ed)\r\n id.classList.remove( 'edit' )\r\n \r\n // and make sure they are not editable\r\n id.contentEditable = false\r\n \r\n // run callback now that information has been enter'ed\r\n if ( onEnter ) {\r\n \r\n // build up CMD array to send to handler\r\n var dataArr = id.innerHTML.split( ' ' )\r\n dataArr = dataArr.map( function( obj ) {\r\n if ( ( this.cmdHash.hasOwnProperty( obj ) ) &&\r\n ( this.cmdHash[obj].address != undefined ) )\r\n return this.cmdHash[obj].address\r\n else\r\n return parseInt( obj, 16 )\r\n } )\r\n onEnter( dataArr )\r\n }\r\n \r\n if ( recur ) {\r\n // recall function to re-prompt user with new caret\r\n this.prompt( recur, onEnter, initStr )\r\n }\r\n \r\n } else if ( e.which==38 ) { // up\r\n \r\n // safe-guard b/c the navigation keys are NASTY\r\n e.preventDefault()\r\n \r\n if ( this.terminalQueue.length ) {\r\n \r\n // get previous terminal log if available\r\n if ( this.terminalQueue.length > (upDownArrCnt+1) )\r\n upDownArrCnt++\r\n \r\n // update current terminal log with previous\r\n if ( upDownArrCnt.length!=1 ) {\r\n if ( upDownArrCnt==0 )\r\n this.terminalQueue[0].innerHTML = ''\r\n this.terminalQueue[0].innerHTML = this.terminalQueue[upDownArrCnt].innerHTML\r\n }\r\n \r\n // also take this time to put the caret at the end of the entry\r\n if ( this.terminalQueue[0].innerHTML.length ) {\r\n var domRng = document.createRange()\r\n var domSel = window.getSelection()\r\n domRng.setStart( this.terminalQueue[0].childNodes[0], this.terminalQueue[0].innerHTML.length )\r\n domRng.collapse( true )\r\n domSel.removeAllRanges()\r\n domSel.addRange( domRng )\r\n }\r\n \r\n }\r\n \r\n } else if ( e.which==40 ) { // down\r\n \r\n // safe-guard b/c the navigation keys are NASTY\r\n e.preventDefault()\r\n \r\n if ( this.terminalQueue.length ) {\r\n \r\n // get previous terminal log if available\r\n if ( upDownArrCnt>0 )\r\n upDownArrCnt--\r\n \r\n // update current terminal log with previous\r\n if ( upDownArrCnt.length!=1 ) {\r\n if ( upDownArrCnt==0 )\r\n this.terminalQueue[0].innerHTML = ''\r\n this.terminalQueue[0].innerHTML = this.terminalQueue[upDownArrCnt].innerHTML\r\n }\r\n \r\n // also take this time to put the caret at the end of the entry\r\n if ( this.terminalQueue[0].innerHTML.length ) {\r\n var domRng = document.createRange()\r\n var domSel = window.getSelection()\r\n domRng.setStart( this.terminalQueue[0].childNodes[0], this.terminalQueue[0].innerHTML.length )\r\n domRng.collapse( true )\r\n domSel.removeAllRanges()\r\n domSel.addRange( domRng )\r\n }\r\n \r\n }\r\n }\r\n \r\n return\r\n }", "title": "" }, { "docid": "efb8420c1e05d6d1818a4d5fc1b081c6", "score": "0.59808576", "text": "function keyDownHandler(e) {\r\n \r\n if(gameStarted) {\r\n \r\n if(e.keyCode == 37) { // Classic movements\r\n moveLeft = true;\r\n aiming = false;\r\n }\r\n if(e.keyCode == 39) {\r\n moveRight = true;\r\n aiming = false;\r\n }\r\n if(e.keyCode == 40) {\r\n moveDown = true;\r\n aiming = false;\r\n }\r\n if(e.keyCode == 38) {\r\n moveUp = true;\r\n aiming = false;\r\n }\r\n \r\n if(e.keyCode == 69 || e.keyCode == 81) {\r\n if (e.keyCode == 69) // The \"e\" key, aim (->)\r\n aimRight = true;\r\n else // The \"q\" key, aim (<-)\r\n aimLeft = true;\r\n aiming = true;\r\n }\r\n\r\n if(e.keyCode == 32 && !alreadyShot && aiming) { // The \"spacebar\" key, shoot\r\n if(sbadabum < 10)\r\n sbadabum++;\r\n shooting = true;\r\n stopMoving = true; // Can't move while shooting\r\n }\r\n \r\n if(e.keyCode == 187) // The \"+\" key, change weapon (->)\r\n Baloon.weaponSwitchForward(PALLONI, turn); \r\n if(e.keyCode == 189) // The \"-\" key, change weapon (<-)\r\n Baloon.weaponSwitchBackward(PALLONI, turn);\r\n\r\n if(e.keyCode == 27) { // The \"esc\" key, menù\r\n menu = true;\r\n slidePause();\r\n }\r\n }\r\n\r\n if(e.keyCode == 191) { // Debug purpose, the \"ù\" key\r\n //insert foo to debug here\r\n ;\r\n }\r\n}", "title": "" }, { "docid": "d01a6b3d574dcfaac4962e02205378bf", "score": "0.5961106", "text": "function scanKey(pKey, currentOptions, maxlength)\n{\n\n if(pKey == 13)\n \t return false;\n\nscan += String.fromCharCode(pKey); // store key entered\n\n // set call of scan function to 1 second later\n if( !setInt ) {\n setInt = true;\n setIntId = setInterval(\"doScan(\" + currentOptions + \", \" + maxlength + \" )\", 1000); // execute scan function 1 second later\n //alert(\"doScan(\" + field.value + \", \" + maxlength + \" )\");\n //setIntId = setInterval(\"doScan(\" + field + \", \" + maxlength + \" )\", 1400); // execute scan function 1 second later\n }\n window.event.returnValue = false; // stop execution of default event handler\n\n return false;\n}", "title": "" }, { "docid": "22e8dc8483f1aec7007c55b3f064eb07", "score": "0.5959789", "text": "handleKeyUp(e) {\n if (e.keyCode == 17) { // strg\n this.handleClick();\n this.isSelectable = false;\n }\n }", "title": "" }, { "docid": "9be88fd49bc79bbb32a6f510a637fae4", "score": "0.5958279", "text": "handleKeyUp() {\n this._buttonDown = false;\n }", "title": "" }, { "docid": "a740bc1ab93dd48658c315af4bedadf0", "score": "0.5955126", "text": "function keydownHandler(e) {\r\n clearTimeout(keydownId);\r\n\r\n var activeElement = $(':focus');\r\n var keyCode = e.which;\r\n\r\n //tab?\r\n if(keyCode === 9){\r\n onTab(e);\r\n }\r\n\r\n else if(!activeElement.is('textarea') && !activeElement.is('input') && !activeElement.is('select') &&\r\n activeElement.attr('contentEditable') !== \"true\" && activeElement.attr('contentEditable') !== '' &&\r\n options.keyboardScrolling && options.autoScrolling){\r\n\r\n //preventing the scroll with arrow keys & spacebar & Page Up & Down keys\r\n var keyControls = [40, 38, 32, 33, 34];\r\n if($.inArray(keyCode, keyControls) > -1){\r\n e.preventDefault();\r\n }\r\n\r\n controlPressed = e.ctrlKey;\r\n\r\n keydownId = setTimeout(function(){\r\n onkeydown(e);\r\n },150);\r\n }\r\n }", "title": "" }, { "docid": "4c6b98237dfec8907a2eae8b611598ff", "score": "0.5954109", "text": "onKeyDown(e) {\n UserInput.pressKey(this, e);\n }", "title": "" }, { "docid": "c6aa2f94f4c977e051aea240f44fc02f", "score": "0.595377", "text": "function keydown_function() {\n\tconsole.log(\"d3.event.keyCode = \", d3.event.keyCode);\n\tif (!selected_coef_amp) {\n\t\t// right\n\t\tif (d3.event.keyCode==39) {\n\t\t\ttimestep *= 1.1;\n\t\t}\n\t\t// left\n\t\tif (d3.event.keyCode==37) {\n\t\t\ttimestep /= 1.1;\n\t\t}\n\t\t// down\n\t\tif (d3.event.keyCode==40) {\n\t\t\ttimestep = timestep_0 / 5;\n\t\t}\n\t\t// up\n\t\tif (d3.event.keyCode==38) {\n\t\t\ttimestep = timestep_0;\n\t\t}\n\t\t// L\n\t\tif (d3.event.keyCode==76) {\n\t\t\ttrail_fraction = min(trail_fraction+0.02, 1.0);\n\t\t}\n\t\t// S\n\t\tif (d3.event.keyCode==83) {\n\t\t\ttrail_fraction = max(0, trail_fraction-0.02);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "65d8fad5029f93e6dfe6b017a48dc5b9", "score": "0.5931932", "text": "function keyIsDown() {\n document.addEventListener(\"keydown\", e => {\n const k = e.key;\n\n if (k == 'ArrowRight') {\n moveright();\n }\n if (k == 'ArrowLeft') {\n moveleft();\n }\n if (k == 'd') {\n throwbottle();\n }\n if (e.code == 'Space') {\n jump();\n }\n });\n}", "title": "" }, { "docid": "0ddbf7d63a1d69025ec0b76c0867cb3a", "score": "0.59306496", "text": "function keyDown(e) {\n let keyCode = e.keyCode;\n\n if(keyCode == 17 || keyCode == 91){\n ctrlDown = true;\n }\n if(ctrlDown && (keyCode == 67)){\n console.log(\"i copied\");\n copySelected();\n }\n\n if(ctrlDown && (keyCode == 86)){\n pasteSelected();\n console.log(\"i pasted\");\n }\n\n if(keyCode == 27){\n \tif(currentFunction != \"polyline\"){\n \t\tclickCount = 0;\n \t\tdeselect();\n \t\tclearAndDraw();\n \t\tdrag = false;\n \t} else finishDrawing();\n }\n\n if(ctrlDown && (keyCode == 90)){\n \tbackButton();\n }\n \n}", "title": "" }, { "docid": "0281343a6ca7fab79e5e4eebe9f90e24", "score": "0.5930267", "text": "keyDown (evt) {\r\n\r\n // Set incoming keycode to true\r\n this.keys[evt.keyCode] = true;\r\n\r\n }", "title": "" } ]
6d90087a6910dc6cc52332fdb0ca3e63
added the prompt to add employee
[ { "docid": "62b6234fd36f247e5ebb828d2116f522", "score": "0.0", "text": "function addEmployee() {\n let managerArray = [];\n let roleArray = [];\n\n // adding first and last name to the new manager of his branch\n dbConnection.query(\n \"SELECT first_name, last_name FROM employee WHERE manager_id IS NULL\",\n (err, results) => {\n results.map(manager =>\n managerArray.push(`${manager.first_name} ${manager.last_name}`)\n );\n return managerArray;\n }\n );\n\n // to select all roles in the table\n dbConnection.query(\"SELECT * FROM role \", (err, results) => {\n if (err) throw err;\n results.map(role => roleArray.push(`${role.title}`));\n return roleArray;\n });\n inquirer\n .prompt([\n {\n type: \"input\",\n message: \"What is the employee's first name?\",\n name: \"first_name\",\n },\n {\n type: \"input\",\n message: \"what is the employee's last name?\",\n name: \"last_name\",\n },\n {\n type: \"rawlist\",\n message: \"what is the employee's role?\",\n name: \"role\",\n choices: roleArray,\n },\n {\n name: \"manager\",\n message: \"What is their manager's name?\",\n type: \"rawlist\",\n choices: managerArray,\n },\n ])\n .then(results => {\n // created a const for role_id so i can connect to tables in the same function\n const role_id = roleArray.indexOf(results.role) + 1;\n const manager_id = managerArray.indexOf(results.manager) + 1;\n\n // create a variable for new employees\n const newEmployee = {\n first_name: results.first_name,\n last_name: results.last_name,\n manager_id: manager_id,\n role_id: role_id,\n };\n\n // function to insert new employee to the database\n dbConnection.query(\"INSERT INTO employee SET ?\", newEmployee, err => {\n if (err) throw err;\n promptStarter();\n });\n });\n}", "title": "" } ]
[ { "docid": "27c85693d9282cf0a9895c7b1e64adfd", "score": "0.81784195", "text": "function addEmployee() {\n inquirer\n .prompt([\n {\n type: 'input',\n name: 'first_name',\n message: \"Employee's First Name:\",\n },\n {\n type: 'input',\n name: 'last_name',\n message: \"Employee's Last Name:\",\n },\n {\n type: 'list',\n name: 'role_id',\n choices: roles,\n message: \"Employee's Role:\",\n },\n {\n type: 'list',\n name: 'manager_id',\n choices: managers,\n message: \"Employee's Manager:\",\n },\n ])\n .then((answers) => {\n console.clear();\n console.log(\n `Adding ${answers.first_name} ${answers.last_name} to database...\\n`\n );\n\n updateRecords(query.addEmployee, query.viewEmployees, answers);\n });\n}", "title": "" }, { "docid": "c40ae0d73397ae0d78b1904ae9545cac", "score": "0.81291753", "text": "function addEmployee() {\n\t\t\tinquirer\n\t\t\t.prompt([\n\t\t\t\t{\n\t\t\t\ttype: \"input\",\n\t\t\t\tname: \"first_name\",\n\t\t\t\tmessage: \"Enter employee first name\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\n\t\t\t\ttype: \"input\",\n\t\t\t\tname: \"last_name\",\n\t\t\t\tmessage: \"Enter employee last name\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\ttype: \"number\",\n\t\t\t\tname: \"role_id\",\n\t\t\t\tmessage: \"Enter employee role id\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\ttype: \"number\",\n\t\t\t\tname: \"manager_id\",\n\t\t\t\tmessage: \"Enter employee manager id\"\n\t\t\t}])\n\t\t\n\t\t\t.then(function(answer) {\t\n\t\t\t\tconnection.query(\"INSERT INTO employee (first_name, last_name, role_id, manager_id) VALUES (?,?,?,?)\", \n\t\t\t[answer.first_name,\n\t\t\tanswer.last_name,\n\t\t\tanswer.role_id,\n\t\t\tanswer.manager_id],\n\t\t\tfunction(err,data) {\n\t\t\t\tif (err) throw err;\n\t\t\t\tconsole.table(\"Added Employee\");\n\t\t\t\n\t\t\t\trunSearch();\n\t\t\t})\n\t\t})\n\t\t\n\t\t\t}", "title": "" }, { "docid": "a951569127f0bd99221e579c95e1562f", "score": "0.79777914", "text": "function addNewEmployee() {\n inquirer\n .prompt([\n {\n type: \"input\",\n message: \"What is the employees first name?\",\n name: \"empFirstName\"\n },\n {\n type: \"input\",\n message: \"What is the employee's last name?\",\n name: \"empLastName\"\n },\n ])\n .then(function (answer) {\n connection.query(\"INSERT INTO employee (first_name, last_name) VALUES (?, ?)\", [answer.empFirstName, answer.empLastName],\n function (err, res) {\n if (err) throw err\n console.table(res)\n mainMenuPrompt()\n })\n })\n}", "title": "" }, { "docid": "5e44f507421b1f8800d9bd629f0934f3", "score": "0.7968773", "text": "function addEmployee(){\n inquirer.prompt([\n {\n type: \"list\",\n name: \"employeeType\",\n message: \"Add an additional team member?\",\n choices: [\n \"Engineer\",\n \"Intern\",\n \"No additional team members\"\n ]\n }\n ]).then(response => {\n switch(response.employeeType){\n case \"Engineer\":\n engineerAdd();\n break;\n case \"Intern\":\n internAdd();\n break;\n default:\n createHTML();\n console.log(\"Creating Team Page....\")\n }\n });\n }", "title": "" }, { "docid": "6c648baef5daea9e96adfc3488718331", "score": "0.7929374", "text": "function addEmployee() {\n inquirer.prompt([\n {\n name: \"first_name\",\n type: \"input\",\n message: \"New Employee First Name: \"\n\n },\n {\n name: \"last_name\",\n type: \"input\",\n message: \"New Employee Last Name: \"\n },\n {\n name: \"role\",\n type: \"list\",\n message: \"What is their role?\",\n choices: selectRole()\n },\n {\n name: \"manager\",\n type: \"list\",\n message: \"Who is their manager?\",\n choices: selectManager()\n }\n ])\n .then(function (data) {\n var roleId = selectRole().indexOf(data.role) + 1\n var managerId = selectManager().indexOf(data.choice) + 1\n\n db.query('INSERT INTO employee SET ?',\n {\n first_name: data.first_name,\n last_name: data.last_name,\n manager_id: managerId,\n role_id: roleId\n }, function (err, res) {\n initPrompt()\n },\n )\n })\n }", "title": "" }, { "docid": "deb1e7767cd2c9cce0d2ada92dd562ed", "score": "0.78263116", "text": "function addEmployee() {\n console.log('//// Add another employee, or finish team ////')\n inquirer.prompt([\n {\n type: 'list',\n message: 'Select an option:',\n name: 'addEmployee',\n choices: [\n 'Add Engineer',\n 'Add Intern',\n 'Finish Team'\n ]\n }\n ]).then((response) => {\n // SWITCH FUNCTION BASED ON ANSWER\n switch (response.addEmployee) {\n case 'Add Engineer':\n addEngineer()\n break\n case 'Add Intern':\n addIntern()\n break\n case 'Finish Team':\n finishTeam()\n break\n }\n })\n }", "title": "" }, { "docid": "d5ef04eaeee35a4e6785d2bd109f3db7", "score": "0.7806148", "text": "function addEmployeePrompt() {\n prompt([{\n type: 'input',\n name: 'first_name',\n message: 'What is the persons first name?'\n\n },\n {\n type: 'input',\n name: 'last_name',\n message: 'What is the persons last name?'\n },\n {\n type: 'list',\n name: 'role_id',\n message: 'What is the role Id number?',\n choices: ['2-Sales Associate', '4-Development Engineer']\n },\n {\n type: 'list',\n name: 'manager_id',\n Message: 'What is the employees, Managers Id?',\n choices: ['Sales Manager', 'Development Manager']\n }\n ]).then((answer) => {\n switch (answer.addEmployeesPrompt) {\n case 'yes':\n seeAllEmployees();\n break;\n case 'no':\n return userPrompt();\n }\n })\n}", "title": "" }, { "docid": "fed1e45dd21a39d2c359cc495efc7abd", "score": "0.77766913", "text": "function addEmployee() {\n inquirer.prompt([{\n type: \"number\",\n name: \"employeeRole\",\n message: \"What is the employee's role ID?\"\n },\n {\n type: \"input\",\n name: \"firstName\",\n message: \"What is the employee's first name?\"\n },\n {\n type: \"input\",\n name: \"lastName\",\n message: \"What is the employee's last name?\"\n }\n ]).then((answer) => {\n connection.query(\n \"INSERT INTO employee SET ?\", {\n role_id: answer.employeeRole,\n first_name: answer.firstName,\n last_name: answer.lastName\n },\n function(err) {\n if (err) throw err;\n console.log(\"ADDED EMPLOYEE ---------\")\n console.table(answer);\n init();\n }\n )\n });\n }", "title": "" }, { "docid": "bde18f10c38196a65bacec310c8cb713", "score": "0.7770029", "text": "async function addEmployee() {\n const roles = await db.findAllRoles();\n const employees = await db.findAllEmployees();\n \n const employee = await prompt([\n {\n name: \"first_name\",\n message: \"What is the employee's first name?\"\n },\n {\n name: \"last_name\",\n message: \"What is the employee's last name?\"\n }\n ]);\n \n const roleChoices = roles.map(({ id, title }) => ({\n name: title,\n value: id\n }));\n \n const { roleId } = await prompt({\n type: \"list\",\n name: \"roleId\",\n message: \"What is the employee's role?\",\n choices: roleChoices\n });\n \n employee.role_id = roleId;\n \n const managerChoices = employees.map(({ id, first_name, last_name }) => ({\n name: `${first_name} ${last_name}`,\n value: id\n }));\n managerChoices.unshift({ name: \"None\", value: null });\n \n const { managerId } = await prompt({\n type: \"list\",\n name: \"managerId\",\n message: \"Who is the employee's manager?\",\n choices: managerChoices\n });\n \n employee.manager_id = managerId;\n \n await db.createEmployee(employee);\n \n console.log(\n `Added ${employee.first_name} ${employee.last_name} to the database`\n );\n \n loadMainPrompts();\n }", "title": "" }, { "docid": "8b9993f45576f6f77bb8dc558c405b92", "score": "0.7596221", "text": "function addEmployee() {\n // prompt for info\n inquirer.prompt([{\n type: \"input\",\n name: \"firstName\",\n message: \"What is the first name of the employee you would like to edit?\"\n },\n {\n type: \"input\",\n name: \"lastName\",\n message: \"What is the last name of the employee you would like to edit?\"\n },\n {\n type: \"number\",\n name: \"roleID\",\n message: \"What is the roleID number?\",\n },\n {\n type: \"number\",\n name: \"managerID\",\n message: \"What is the employee's manager ID?\",\n },\n ])\n .then(function (answer) {\n //-- function to insert dat into table\n connection.query(\n \"INSERT INTO employee SET ?\", {\n first_name: answer.firstName,\n last_name: answer.lastName,\n role_id: answer.roleID,\n manager_id: answer.managerID\n },\n function (err) {\n if (err) throw err;\n console.table(`${answer.firstName} ${answer.lastName} it worked!`);\n start();\n }\n );\n });\n }", "title": "" }, { "docid": "c2d8aa67c855f6d3946355998c46ddac", "score": "0.7573827", "text": "function addEmployee() {\n inquirer.prompt([{ name: 'first', type: 'input', message: 'Enter First Name: '}, { name: 'last', type: 'input', message: 'Enter Last Name: ' }, { name: 'title', type: 'input', message: 'Enter Employee Title/Position: ' }, { name: 'department', type: 'input', message: 'Enter Employee Department: ' }, { name: 'sal', type: 'number', message: 'Enter Employee Salary: ' }, { name: 'manage', type: 'input', message: 'Enter Employee Manager: ' }]\n ).then((newE) => {\n connection.query(query6, {First_Name: newE.first||'None', Last_Name: newE.last||'None', Title: newE.title||'None', Department: newE.department||'None', Salary: newE.sal||'None', Manager: newE.manage||'None' }, (err, res) => {\n if (err) throw err; (res) ? console.log(`${newE.first} ${newE.last} was successfully added`) : console.log('An Error Ocurred, Try Again.'); exitSelection() })\n })}", "title": "" }, { "docid": "c0478cfb376097aef8bbf2b88d4c9839", "score": "0.7518197", "text": "async function addEmployee() {\n // Define roles and employees\n const roles = await db.findRoles();\n const employees = await db.findEmployees();\n\n // Collect inputs\n const employee = await prompt([\n {\n name: \"first_name\",\n message: \"Enter First Name: \"\n },\n {\n name: \"last_name\",\n message: \"Enter Last Name: \"\n } \n ]);\n\n // Show roles\n const roleList = roles.map(({ id, title }) => (\n {\n name: title,\n value: id\n }\n ));\n\n // Select roles\n const { roleId } = await prompt(\n {\n type: \"list\",\n name: \"roleId\",\n message: \"Select Role: \",\n choices: roleList\n }\n );\n employee.role_id = roleId;\n \n // Show managers\n const managerList = employees.map(({ id, first_name, last_name }) => (\n {\n name: `${first_name} ${last_name}`,\n value: id\n }\n ));\n managerList.unshift({ name: \"None\", value: null });\n \n //Select manager\n const { managerId } = await prompt(\n {\n type: \"list\",\n name: \"managerId\",\n message: \"Select Manager\",\n choices: managerList\n }\n );\n employee.manager_id = managerId;\n\n // Feedback after addition\n await db.createEmployee(employee);\n console.log(`Added ${employee.first_name} ${employee.last_name}.`);\n startPrompt();\n}", "title": "" }, { "docid": "2cc2a91e6ce198fb365026a20075854d", "score": "0.7515707", "text": "function addEmployees() {\n // prompt for what employee to add\n inquirer\n .prompt([\n {\n name: \"firstName\",\n type: \"input\",\n message: \"What is the employee's first name?\"\n },\n {\n name: \"lastName\",\n type: \"input\",\n message: \"What is the employee's last name?\"\n }\n //add role question for new employee\n ])\n .then(function(answer) {\n // when finished prompting, insert a new employee with first and last name\n connection.query(\n \"INSERT INTO employee SET ?\",\n {\n first_name: answer.firstName,\n last_name: answer.lastName,\n },\n function(err) {\n if (err) throw err;\n console.log(\"The employee was added successfully!\");\n // go back to start\n start();\n }\n );\n });\n}", "title": "" }, { "docid": "1adbe88ca004c21370081cbdfeb39c25", "score": "0.7510233", "text": "function addEmployee() {\n inquirer.prompt(addNewEmployee).then(answer => {\n connection.query(\"INSERT INTO employee (first_name, last_name, role_id, manager_id) VALUES (?, ?, ?, ?)\", [answer.firstName, answer.lastName, answer.roleID, answer.managerID], function(err, data) {\n if (err) throw err;\n console.log (\"Added new employee: \" + answer.firstName + \" \" + answer.lastName);\n console.log (\"Role ID: \" + answer.roleID);\n console.log (\"Manager ID: \" + answer.managerID);\n startApp();\n });\n });\n}", "title": "" }, { "docid": "9bd3d0af66e8239ea96b397d5910a28e", "score": "0.74933785", "text": "function internAdd(){\n inquirer.prompt([\n {\n type: \"input\",\n name: \"iName\",\n message: \"What is the Intern's name?\"\n },\n {\n type: \"input\",\n name: \"iId\",\n message: \"What is the Intern's ID?\"\n },\n {\n type: \"input\",\n name: \"iEmail\",\n message: \"What is the Intern's e-mail?\"\n },\n {\n type: \"input\",\n name: \"iSchool\",\n message: \"What is the Intern's School?\"\n }\n ]).then(response => {\n const intern = new Intern(response.iName, response.iId, response.iEmail, response.iSchool);\n employees.push(intern);\n addEmployee();\n });\n }", "title": "" }, { "docid": "2083fe6155efa5d8791bd00daaea2c6b", "score": "0.74549574", "text": "function addNewEmployee() {\n inquirer.prompt(chooseRole).then((answer) => {\n if (answer.role === \"Engineer\") {\n inquirer.prompt(questions.Engineer).then((answer) => {\n // save employee details\n const engineer = new Engineer(\n answer.name,\n answer.id,\n answer.email,\n answer.github\n );\n // add details to team array\n allMembers.push(engineer);\n addTeamMembers();\n });\n } else if (answer.role === \"Intern\") {\n inquirer.prompt(questions.Intern).then((answer) => {\n // save employee details\n const intern = new Intern(\n answer.name,\n answer.id,\n answer.email,\n answer.school\n );\n // add details to team array\n allMembers.push(intern);\n addTeamMembers();\n });\n }\n });\n}", "title": "" }, { "docid": "88aacf67b2df1c21f4953318d6353ee1", "score": "0.74502385", "text": "function addEmployee() {\n inquirer\n .prompt([\n {\n type: \"input\",\n message: \"Enter new employees first name:\",\n name: \"firstName\",\n },\n {\n type: \"input\",\n message: \"Enter new employees last name:\",\n name: \"lastName\",\n },\n {\n type: \"input\",\n message:\n \"Enter new employees roleID ('1:Sales Manager, 2:Sales Representative, 3:Development Manager, 4:Development Staff, 5:Human Resources Manager, 6:Human Resources Analyst, 7:Engineering Manager, 8:Engineering Lead, 9:Junior Engineer'):\",\n name: \"Role\",\n },\n\n {\n type: \"input\",\n message: \"Enter new employees managerID:\",\n name: \"managerID\",\n },\n ])\n .then((res) => {\n connection.query(\n \"INSERT INTO employee set ?\",\n [\n {\n first_name: res.firstName,\n last_name: res.lastName,\n role_id: res.Role,\n manager_id: res.managerID,\n },\n ],\n (err, res) => {\n if (err) throw err;\n console.log(\"New Employee Added\");\n allEmployees();\n }\n );\n });\n}", "title": "" }, { "docid": "f321dfa611208d800fcc7275b968fa5a", "score": "0.74429476", "text": "function addEmployee() {\n inquirer\n .prompt([{\n type: \"list\",\n message: \"Who would you like to add?\",\n name: \"engineerOrIntern\",\n choices: [\"Engineer\", \"Intern\", \"Quit\"],\n }, ])\n .then(function({ engineerOrIntern }) {\n if (engineerOrIntern === \"Engineer\") {\n //prompt for engineer details\n engineerPrompt();\n } else if (engineerOrIntern === \"Intern\") {\n //Prompt for intern details\n internPrompt();\n } else {\n //Writes to file\n fs.writeFile(\"index.html\", render(employees), () => {});\n }\n });\n}", "title": "" }, { "docid": "51211ceb9d74910ac41c4885ed5b5a87", "score": "0.7436767", "text": "async function addANewEmployee() {\n\tconst adr = [];\n\t// (by function prompt 6) - get the response from the user for the first name of the new staff\n\tconst firstname = await prompts.firstNameSelection();\n\tadr.push(firstname.firstName);\n\t// (by function prompt 7) - get the response from the user for the last name of the new staff\n\tconst lastname = await prompts.lastNameSelection();\n\tadr.push(lastname.lastName);\n\t// (by function prompt 4) - get the response from the user for which role is required\n\tconst roleChoice = await prompts.roleselection();\n\tadr.push(roleChoice);\n\t// (by function prompt 5) - get the response from the user for which staff would be the manager of this employee\n\tconst managerChoice = await prompts.managerselection();\n\tadr.push(managerChoice);\n\t// (by function index 11) - input the array of result from the user for generate a new employee into the database\n\tawait db.addANewEmployee(adr);\n\tconsole.log(\n\t\t`Employee ${firstname.firstName} ${lastname.lastName} has been added into database`\n\t);\n\tinit();\n}", "title": "" }, { "docid": "393262d7bc8280ad98de59588a28309c", "score": "0.7413688", "text": "function addEmployee() {\n inquirer\n .prompt([\n {\n type: \"input\",\n message: \"first name of employee?\",\n name: \"first_name\",\n },\n\n {\n type: \"input\",\n message: \"last name of employee?\",\n name: \"last_name\",\n },\n\n {\n type: \"input\",\n message: \"what is their role ID?\",\n name: \"role_id\",\n },\n\n {\n type: \"input\",\n message: \"what is their manager's ID?\",\n name: \"manager_id\",\n },\n ])\n .then(function (response) {\n connection.query(\n \"INSERT INTO employee(first_name, last_name, role_id, manager_id) values(?, ?, ?, ?)\",\n [response.first_name, response.last_name, response.role_id, response.manager_id],\n function (err, res) {\n if (err) throw err;\n console.log(\"Employee Added!\");\n runSearch();\n }\n );\n });\n}", "title": "" }, { "docid": "699183109859c910e0daafb9892f36f1", "score": "0.7390512", "text": "function addEmployee() {\n inquirer.prompt(questions.employeeType).then(employeeType => {\n if (employeeType.add === \"engineer\") {\n inquirer.prompt(questions.engineer).then(engineer => {\n fs.readFile(\"./templates/engineer.html\", \"utf8\", (err, data) => {\n if (err) throw err;\n const replaced = data\n .replace(\"{{name}}\", engineer.name)\n .replace(\"{{id}}\", engineer.id)\n .replace(\"{{email}}\", engineer.email)\n .replace(\"{{github}}\", engineer.github);\n employeesHTML += replaced;\n addNew();\n });\n });\n\n // Determines who desired questions are intended for\n } else if ((employeeType.add = \"intern\")) {\n inquirer.prompt(questions.intern).then(intern => {\n fs.readFile(\"./templates/intern.html\", \"utf8\", (err, data) => {\n if (err) throw err;\n const replaced = data\n .replace(\"{{name}}\", intern.name)\n .replace(\"{{id}}\", intern.id)\n .replace(\"{{email}}\", intern.email)\n .replace(\"{{school}}\", intern.school);\n employeesHTML += replaced;\n addNew();\n });\n });\n } else if ((employeeType.add = \"none\")) {\n console.log(\"Ok, bye!\");\n }\n });\n}", "title": "" }, { "docid": "7a1acb21c5a9fa7e20f9d5478061cc66", "score": "0.7379163", "text": "function addEmployee(){\n inquirer.prompt(questionBuilder.questionBuilder(\"Init\")).then(function (response) {\n if (response.roleAns === \"Intern\") {\n addIntern();\n }\n else if (response.roleAns === \"Engineer\") {\n addEngineer();\n }\n else{\n addManager();\n }\n });\n}", "title": "" }, { "docid": "7bf9a7a55c75a60a5bb0702cd52f641e", "score": "0.73464763", "text": "function addEmployee() {\n inquirer.prompt([\n {\n name: \"firstname\",\n type: \"input\",\n message: \"Enter their first name\"\n },\n {\n name: \"lastname\",\n type: \"input\",\n message: \"Enter their last name\"\n },\n {\n name: \"title\",\n type: \"input\",\n message: \"What is the title of the role?\"\n },\n {\n name: \"salary\",\n type: \"input\",\n message: \"What is the salary?\"\n }\n\n ]).then(function (res) {\n connection.query(\"INSERT INTO employee SET ?\",\n {\n first_name: res.firstname,\n last_name: res.lastname,\n title: res.title,\n salary: res.salary\n },\n function (err) {\n if (err) throw err\n console.table(res)\n start()\n })\n }\n )\n}", "title": "" }, { "docid": "823970849da8a5920644f9cddad1c334", "score": "0.73409104", "text": "function addEmployeePrompt(addEmployeeQuestionsArray) {\n inquirer.prompt(addEmployeeQuestionsArray)\n .then(function (newEmployeeInfo) {\n\n //Calling the addEmployee function and passing it the answers to the inquirer questions \n addEmployee(newEmployeeInfo)\n })\n}", "title": "" }, { "docid": "3160e15209e1588d5bbc1242233d752a", "score": "0.73347104", "text": "function addDepartment() {\n inquirer.prompt([{\n type: \"input\",\n name: \"addDepartmentName\",\n message: \"What is the new department called?\"\n }, ]).then((answer) => {\n connection.query(\n \"INSERT INTO department SET ?\", {\n departmentname: answer.addDepartmentName\n },\n function(err) {\n if (err) throw err;\n console.log(\"ADDED EMPLOYEE ---------\")\n console.table(answer);\n init();\n }\n )\n });\n }", "title": "" }, { "docid": "cb88a7bb2f0ae269c29c33917a95c1d4", "score": "0.7320737", "text": "function addNew() {\n inquirer.prompt(questions.another).then(runAgain => {\n if (runAgain.addNew == \"yes\") {\n addEmployee();\n } else {\n renderHtml(employeesHTML);\n }\n });\n}", "title": "" }, { "docid": "336624ffcac45bdaf9758686041663b4", "score": "0.73202884", "text": "function addAnotherEmployee() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"newEmployee\",\n message: \"Are there any more employees on this team?\",\n choices: [\"yes\", \"no\"]\n }\n ])\n .then(val => {\n if (val.newEmployee === \"yes\") {\n addEmployees();\n } else {\n writeHTML();\n }\n });\n // writes the html output\n const writeHTML = () => {\n if (!fs.existsSync(\"./ouput\")) {\n fs.mkdirSync(\"./output\");\n }\n fs.writeFile(outputPath, render(team), err => {\n if (err) throw err;\n console.log(\"Team.html created\");\n });\n };\n }", "title": "" }, { "docid": "2c381c9785c4da2dcae93f91f9010fb3", "score": "0.7279697", "text": "function addEmp() {\n inquirer\n .prompt([\n {\n type: \"input\",\n message: \"Employee's first name:\",\n name: \"firstname\"\n },\n {\n type: \"input\",\n message: \"Employee's last name:\",\n name: \"lastname\"\n },\n {\n type: \"input\",\n message: \"Enter employee's role id:\",\n name: \"roleid\"\n },\n {\n type: \"input\",\n message: \"Employee's manager id:\",\n name: \"managerid\"\n },\n ])\n .then(function (answer) {\n \n connection.query(\"INSERT INTO employee SET ?\",\n { first_name: answer.firstname, last_name: answer.lastname, role_id: answer.roleid, manager_id: answer.managerid }, function (err, res) {\n if (err) throw err;\n console.log(\"\\n Database with added employee. \\n\");\n viewEmp();\n })\n } \n )\n}", "title": "" }, { "docid": "0c921e30fbdd1f91a6ad70110a1633e1", "score": "0.72795117", "text": "function addEmployee() {\n inquirer.prompt([{\n \n type: \"input\",\n name: \"first_name\",\n message: \"What is the Employee's First Name?:\"\n },\n {\n type: \"input\",\n name: \"last_name\",\n message: \"What is the Employee's Last Name?:\"\n }, \n {\n type: \"input\",\n name: \"manager_id\",\n message: \"Who is the Employee's Manager (First and Last Name)?:\"\n }, \n {\n type: \"number\",\n name: \"role_id\",\n message: \"What is the Employee's Role ID?:\"\n }\n ]).then(function(response){\n connection.query(\"INSERT INTO employees (first_name, last_name, manager_id, role_id) VALUES (?, ?, ?, ?)\", \n [response.first_name, response.last_name, response.manager_id, response.role_id], function(err, data) {\n if (err) throw err;\n console.table(\"Added New Employee!\");\n // viewEmployee();\n askQuestions();\n })\n })\n}", "title": "" }, { "docid": "f22a26fc6b101752e1e0009495738b2c", "score": "0.7258974", "text": "function addEmployee() {\n connection.query(`SELECT * FROM role`, (err, data) => {\n const rolesArray = data.map((role) => role.title);\n inquirer\n .prompt([\n {\n name: \"firstName\",\n type: \"input\",\n message: \"Please enter the employee's first name: \",\n },\n {\n name: \"lastName\",\n type: \"input\",\n message: \"Please enter the employee's last name: \",\n },\n {\n name: \"role\",\n type: \"list\",\n message: \"Please enter the employee's role: \",\n choices: rolesArray,\n },\n ])\n .then(({ firstName, lastName, role }) => {\n const selectedRole = data.find(\n (roleObject) => roleObject.title === role\n );\n connection.query(\n `INSERT INTO employee SET ?`,\n [\n {\n first_name: firstName,\n last_name: lastName,\n role_id: selectedRole.id,\n },\n ],\n (err, data) => {\n if (err) throw err;\n viewAll();\n init();\n }\n );\n });\n });\n}", "title": "" }, { "docid": "241e9c0e5132b0cdb6c09ce0d049c376", "score": "0.7157445", "text": "function addEmployee(){\n connection.query(\"SELECT * FROM role\", function (err, res){\n if(err) throw err;\n inquirer.prompt([\n {\n type: \"input\",\n name: \"first_name\",\n message: \"What is the employee's first name?\"\n },\n {\n type: \"input\",\n name: \"last_name\",\n message: \"What is the employee's last name?\"\n },\n {\n type: \"list\",\n name: \"role\",\n message: \"What is the employee's role?\",\n choices: res.map((role) => `${role.title}`)\n },\n // {\n // type: \"list\",\n // name: \"manager\",\n // message: \"Who is the employee's manager?\",\n // choices: res.map((employee) => `${employee.first_name} ${employee.last_name}`)\n // }\n ])\n .then((createdEmployee) =>{\n console.log(`Added ${createdEmployee.first_name} ${createdEmployee.last_name} to the database`);\n connection.query(\n \"INSERT INTO employee SET ?\",\n createdEmployee,\n function(err, res) {\n if(err) throw err;\n question1Prompt();\n })\n })\n \n \n });\n \n }", "title": "" }, { "docid": "71b8412ead356e49071596b93cbd43b2", "score": "0.7125979", "text": "function addEngineer(){\n inquirer.prompt(questionBuilder.questionBuilder(\"Engineer\")).then(function (response) {\n employees.push(new Engineer(response.nameAns, response.idAns, response.emailAns, response.githubAns));\n if(response.empAns === \"Yes\"){\n addEmployee();\n }\n else{\n htmlDoc = render(employees);\n makeFile();\n }\n });\n}", "title": "" }, { "docid": "b86067aafddcecc376832852cf0ab4e0", "score": "0.7117963", "text": "function addEmployee(){\n inquirer.prompt([{\n name:\"firstname\",\n type:\"input\",\n message:\"whats the first name?\"\n },{\n name:\"lastname\",\n type:\"input\",\n message:\"whats the last name?\"\n },{\n name:\"role\",\n type:\"input\",\n message:\"whats his/her role?\"\n },{\n name:\"managerid\",\n type:\"number\",\n message:\"enter manager id number?\"\n }\n]).then(function(answer){\n console.log(answer)\n\n connection.query(\"insert into employee set ?\", {\n first_name: answer.firstname,\n last_name: answer.lastname,\n e_role: answer.role,\n manager_id: answer.managerid\n }, function(err){\n if (err) throw err;\n console.log(\"you have successfully added an employee\")\n start()\n })\n})\n}", "title": "" }, { "docid": "cba3be4e3e5e164452a2b414566cf7ad", "score": "0.7110329", "text": "function addEmp() {\n inquirer\n .prompt([\n {\n type: \"input\",\n name:\"firstName\",\n message: \"First Name:\"\n }, \n {\n type: \"input\",\n name:\"lastName\",\n message: \"Last Name:\"\n },\n {\n type: \"input\",\n name:\"roleId\",\n message: \"Role ID:\"\n },\n {\n type: \"input\",\n name:\"managerID\",\n message: \"Manager ID:\"\n }\n ])\n .then((res) => {\n connection.query(\n \"INSERT INTO employee SET ?\",\n {\n first_name: res.firstName,\n last_name: res.lastName,\n role_id: res.roleId,\n manager_id: res.managerID\n },\n function (err,res) {\n if (err) throw err;\n console.log(\"Hello I added a new employee to the team!\");\n runSearch(); \n }\n )\n })\n}", "title": "" }, { "docid": "2ebb0c6d9b62f5c50660ee209fa273ff", "score": "0.7087269", "text": "function addEmployee() { \n inquirer.prompt([\n {\n name: \"firstName\",\n type: \"input\",\n message: \"Enter their first name \"\n },\n {\n name: \"lastName\",\n type: \"input\",\n message: \"Enter their last name \"\n },\n {\n name: \"role\",\n type: \"list\",\n message: \"What is their role? \",\n choices: selectRole()\n },\n {\n name: \"choice\",\n type: \"rawlist\",\n message: \"Whats their managers name?\",\n choices: selectManager()\n }\n ]).then(function (val) {\n let roleId = selectRole().indexOf(val.role) + 1\n let managerId = selectManager().indexOf(val.choice) + 1\n connection.query(\"INSERT INTO employee SET ?\", \n {\n first_name: val.firstName,\n last_name: val.lastName,\n manager_id: managerId,\n role_id: roleId\n \n }, function(err){\n if (err) throw err\n console.table(val)\n start()\n })\n\n})\n}", "title": "" }, { "docid": "b30a196c5d047efce9689e70ff717da1", "score": "0.70683366", "text": "function addDepartment() {\n inquirer\n .prompt([\n {\n type: \"input\",\n message: \"Enter new Department Name\",\n name: \"depName\"\n },\n ])\n .then(function (answer) {\n connection.query(\n \"INSERT INTO department SET ?\",\n {\n name: answer.depName,\n },\n function (err, answer) {\n if (err) {\n throw err;\n }\n console.log(\"employee Added Successfully\");\n }\n );\n loadMainMenu();\n });\n}", "title": "" }, { "docid": "7627d276c08564c413b2ce7b1362eb14", "score": "0.7068187", "text": "function employeeQuest() {\n return inquirer.prompt([\n {\n type: \"input\",\n name: \"firstName\",\n message: \"New employee first name... \"\n },\n {\n type: \"input\",\n name: \"lastName\",\n message: \"New employee last name... \"\n },\n {\n type: \"input\",\n name: \"role\",\n message: \"New employee role... \"\n },\n {\n type: \"input\",\n name: \"managerId\",\n message: \"New employee manager ID#... \"\n }\n ])\n}", "title": "" }, { "docid": "f1c458af1a50c18b1b64801e893f54ef", "score": "0.70449454", "text": "function addEmployee() {\n //for the employee table, there are 4 fields that must be addressed the employee's first and last name, the role id and the manager id. The user must input all four of these.\n\n inquirer\n .prompt([\n {\n name: \"first\",\n type: \"input\",\n message: \"What is the employee's first name?\",\n },\n {\n name: \"last\",\n type: \"input\",\n message: \"What is the employee's last name?\",\n },\n {\n name: \"role_id\",\n type: \"number\",\n message: \"What is the role id?\",\n },\n {\n name: \"manager_id\",\n type: \"number\",\n message: \"What is the manager id?\",\n },\n ])\n .then(function (answer) {\n // when finished prompting, insert a new item into the db with that info\n connection.query(\n \"INSERT INTO employee SET ?\",\n {\n first_name: answer.first,\n last_name: answer.last,\n role_id: answer.role_id,\n manager_id: answer.manager_id,\n },\n function (err) {\n if (err) throw err;\n console.log(\"the employee was created!\");\n console.table(answer)\n start();\n }\n );\n });\n}", "title": "" }, { "docid": "f66c2cc176e835b20efa0ed358e537c2", "score": "0.70343906", "text": "function createEmployee() {\n inquirer.prompt([{\n\n type: \"list\",\n message: \"What type of employee would you like to add?\",\n choices: [\n \"Manager\",\n \"Engineer\",\n \"Intern\",\n \"I don't want to add any more team members.\"\n ],\n\n// Decides which questions to ask based on the Employee title as selected by the User\n name: \"title\"\n }]).then(answers => {\n if (answers.title === \"Manager\") {\n askManagerQuestions();\n }\n else if (answers.title === \"Engineer\") {\n askEngineerQuestions();\n }\n else if (answers.title === \"Intern\") {\n askInternQuestions();\n }\n else\n return writeHTML(employeeArray);\n \n });\n}", "title": "" }, { "docid": "e5e3cab783b456c7d8f0dba1c1c8eca6", "score": "0.70256186", "text": "function addEngineer() {\n inquirer.prompt([\n {\n type: \"input\",\n name: \"name\",\n message: \"What is the engineer's name?\"\n },\n {\n type: \"input\",\n name: \"id\",\n message: \"What is the engineer's ID number?\",\n },\n {\n type: \"input\",\n name: \"email\",\n message: \"What is the engineer's email address?\",\n },\n {\n type: \"input\",\n name: \"github\",\n message: \"What is the engineer's Github username?\",\n },\n ])\n .then((responses) => {\n var engineer = new Engineer(\n responses.name,\n responses.id,\n responses.email,\n responses.github\n );\n employees.push(engineer)\n employeeType()\n });\n}", "title": "" }, { "docid": "7fbc10815fac6e1e9b984b5e22d26bbe", "score": "0.69972926", "text": "function promptNewDepartment() {\n inquirer.prompt([\n {\n message: \"Enter Department Name: \",\n name: \"department_name\"\n },\n {\n type: \"number\",\n message: \"Enter Overhead Costs\",\n name: \"over_head_costs\"\n }\n ]).then(department => {\n db.department.save(department, promptSupervisorMenu);\n })\n}", "title": "" }, { "docid": "66b308da8e4d7f97bf8c6ffe9789d03e", "score": "0.6995622", "text": "function addDepartmentsPrompt() {\n prompt([{\n type: 'list',\n name: 'addDepartment',\n message: 'would you like to add a department',\n choices: ['Yes', 'No']\n }]).then((answer) => {\n switch (answer.addDepartment) {\n case 'Yes':\n newDepartment();\n break;\n case 'No':\n userPrompt();\n break;\n }\n })\n}", "title": "" }, { "docid": "221a32618aed20a040f670fc0ef855bd", "score": "0.69936395", "text": "function addManager(){\n inquirer.prompt(questionBuilder.questionBuilder(\"Manager\")).then(function (response) {\n employees.push(new Manager(response.nameAns, response.idAns, response.emailAns, response.officeAns));\n if(response.empAns === \"Yes\"){\n addEmployee();\n }\n else{\n htmlDoc = render(employees);\n makeFile();\n }\n });\n}", "title": "" }, { "docid": "2e49d216aed67482a3c2563feefd2b85", "score": "0.6986813", "text": "async function addEmployee() {\n const newEmployeeInfo = await inquirer.prompt(\n [\n {\n type: 'input',\n name: 'firstName',\n message: 'What is the first name of the new employee?'\n },\n {\n type: 'input',\n name: 'lastName',\n message: 'What is the last name of the new employee?'\n },\n {\n type: 'list',\n name: 'roleList',\n message: 'Select from the following employee roles: ',\n choices: async function () {\n const roles = await query(\"SELECT title, id FROM roles\");\n return roles.map(function (role) {\n return {\n name:role.title,\n value:role.id\n }\n })\n }\n },\n {\n type: 'list',\n name: 'managerList',\n message: 'Select manager for new employee: ',\n choices: async function () {\n const employees = await query(`SELECT CONCAT(first_name, \" \", last_name) AS name, id FROM employees`);\n return employees.map(function (employee) {\n return {\n name:employee.name,\n value:employee.id\n }\n })\n }\n }\n ]\n );\n await query('INSERT INTO employees(first_name, last_name, role_id, manager_id) VALUES (?,?,?,?);', [newEmployeeInfo.firstName, newEmployeeInfo.lastName, newEmployeeInfo.roleList, newEmployeeInfo.managerList]);\n console.log(`New employee ${newEmployeeInfo.firstName} ${newEmployeeInfo.lastName} has been added`);\n await menu();\n}", "title": "" }, { "docid": "73dea1922ddbb5360ebe7db48055cbbb", "score": "0.69810075", "text": "function addDepartment() {\n {\n inquirer.prompt([\n {\n name: \"department\",\n type: \"input\",\n message: \"Enter the new department name: \"\n\n }\n ])\n .then(function (data) {\n\n db.query('INSERT INTO department SET ?',\n {\n name: data.department,\n }, function (err) {\n console.log(`\n ADDED to database\n \n ---MAIN MENU---\n `)\n console.table(data)\n initPrompt()\n })\n })\n }\n }", "title": "" }, { "docid": "a6c37d9f56f5bf52d87d417cb9ebf1fb", "score": "0.6966175", "text": "function addAnother() {\n inquirer\n .prompt([\n {\n type: 'confirm',\n message: 'Do you want to add another Employee?',\n name: 'another',\n }\n ])\n .then(function ({ another }) {\n // if the user wants to add another employee, run start()\n if (another) {\n start();\n } else {\n // console.log(html)\n // if the user is done adding employees, call createHTML(), passing in array html[]\n // with all the employee information\n createHTML(html);\n }\n })\n}", "title": "" }, { "docid": "f8210d1114051c99c1e586baf0a6b8d4", "score": "0.6961918", "text": "function addEmployee() {\n inquirer.prompt([\n {\n type: \"input\",\n name: \"fname\",\n message: \"What is the first name of employee\",\n },\n {\n type: \"input\",\n name: \"lname\",\n message: \"What is the last name of employee\",\n },\n {\n type: \"input\",\n name: \"rid\",\n message: \"What is the role id of employee\",\n },\n {\n type: \"input\",\n name: \"mid\",\n message: \"Enter manager id of the employee\",\n }\n ])\n .then(function (answers) {\n console.log(\"Adding a new employee...\\n\");\n var query = connection.query(\n \"INSERT INTO employee SET ?\",\n {\n first_name: answers.fname,\n last_name: answers.lname,\n role_id: answers.rid,\n manager_id:answers.mid\n },\n function (err, res) {\n if (err) throw err;\n console.log(res.affectedRows + \" New employee added!\\n\");\n // Call updateEmployee AFTER the ADD completes\n readEmployees();\n }\n );\n\n // logs the actual query being run\n console.log(query.sql);\n})\n\n}", "title": "" }, { "docid": "a89a9db3578e7f4f07056f554b11dbbe", "score": "0.695916", "text": "function addEngineer() {\n console.log('//// Adding Engineer ////')\n inquirer.prompt([\n {\n type: 'input',\n message: 'Enter the Engineer\\'s name:',\n name: 'name'\n },\n {\n type: 'input',\n message: 'Enter the Engineer\\'s ID number:',\n name: 'id'\n },\n {\n type: 'input',\n message: 'Enter the Engineer\\'s Email:',\n name: 'email'\n },\n {\n type: 'input',\n message: 'Enter the Engineer\\'s Github account:',\n name: 'github'\n },\n ]).then(response => {\n //CREATE OBJECT FROM INPUT, ADD TO 'teamInfo' ARRAY\n const engineer = new Engineer(response.name, response.id, response.email, response.github)\n teamInfo.push(engineer)\n addEmployee()\n })\n }", "title": "" }, { "docid": "685a3efdced0fbd742587f4f5d4f0216", "score": "0.6945881", "text": "function promptAdd() {\n return inquirer\n .prompt([\n {\n type: \"list\",\n name: \"add\",\n message: \"What would you like to add\",\n choices: [\"Add Department\", \"Add Role\", \"Add Employee\"],\n },\n ])\n .then((answers) => {\n if (answers.add === \"Add Department\") {\n addDept();\n }\n if (answers.add === \"Add Role\") {\n addRole();\n }\n if (answers.add === \"Add Employee\") {\n addEmployee();\n }\n });\n}", "title": "" }, { "docid": "2361179c998cd793536caea54fbfca51", "score": "0.6945244", "text": "function addManager() {\n inquirer.prompt([\n {\n type: \"input\",\n name: \"name\",\n message: \"What is the manager's name?\"\n },\n {\n type: \"input\",\n name: \"id\",\n message: \"What is the manager's ID number?\",\n },\n {\n type: \"input\",\n name: \"email\",\n message: \"What is the manager's email address?\",\n },\n {\n type: \"input\",\n name: \"officeNum\",\n message: \"What is the manager's office number?\",\n },\n ])\n .then((responses) => {\n var manager = new Manager(\n responses.name,\n responses.id,\n responses.email,\n responses.officeNum\n );\n employees.push(manager)\n employeeType()\n });\n}", "title": "" }, { "docid": "eb623f3331d9add3f8081093821267bb", "score": "0.6936634", "text": "function addEmployee() {\n inquirer.prompt([\n {\n type: 'input',\n name: 'name',\n message: 'Adding employee, what is their name?',\n validate: answer => {\n if (answer !== '') {\n return true\n } else {\n return \"answer must not be blank\"\n }\n }\n }, \n {\n type: 'input',\n name: 'id',\n message: 'What is their ID?',\n validate: answer => {\n if (answer !== '') {\n return true\n } else {\n return \"answer must not be blank\"\n }\n }\n }, \n {\n type: 'input',\n name: 'email',\n message: 'What is their email?',\n }, \n {\n type: 'list',\n name: 'role',\n message: 'What is their role?',\n choices: ['manager', 'engineer', 'intern']\n }, \n ])\n .then( (response) => {\n if (response.role == 'manager'){\n const underling = new Employee(response.name, response.id, response.email, response.role);\n inquirer.prompt([\n {\n type: 'input',\n name: 'office',\n message: 'What is their office number?',\n }, \n ])\n .then((response) => {\n const x = new Manager(underling.name, underling.id, underling.email, underling.role, response.office);\n const y = \n `<div class=\"card\" style=\"width: 30%;\">\n <div class=\"card-body ${x.getRole()}\">\n <h5 class=\"card-title\">${x.getName()}</h5>\n <p class=\"card-text\"> Company ID: ${x.getID()}</p>\n <p class=\"card-text\"> Email: <a href=\"mailto:${x.getEmail()}\" target=\"_blank\"><p class=\"bold\">${x.getEmail()}</p> </a></p>\n <p class=\"card-text\"> Role: ${x.getRole()}</p>\n <p class=\"card-text\"> Office: ${x.getOffice()}</p>\n </div>\n </div>`;\n addInfo(y)\n })\n }\n else if (response.role == 'engineer'){\n const underling = new Employee(response.name, response.id, response.email, response.role);\n inquirer.prompt([\n {\n type: 'input',\n name: 'github',\n message: 'What is their github name?',\n }, \n ])\n .then((response) => {\n const x = new Engineer(underling.name, underling.id, underling.email, underling.role, response.github);\n const y = \n `<div class=\"card\" style=\"width: 30%;\">\n <div class=\"card-body ${x.getRole()}\">\n <h5 class=\"card-title\">${x.getName()}</h5>\n <p class=\"card-text\"> Company ID: ${x.getID()}</p>\n <p class=\"card-text\"> Email: <a href=\"mailto:${x.getEmail()}\" target=\"_blank\"><p class=\"bold\">${x.getEmail()}</p> </a></p>\n <p class=\"card-text\"> Role: ${x.getRole()}</p>\n <p class=\"card-text\">GitHub: <a href=\"https://github.com/${x.getGithub()}\" target=\"_blank\"><p class=\"bold\">github.com/${x.getGithub()}</p> </a></p>\n </div>\n </div>`;\n addInfo(y);\n })\n }\n else {\n const underling = new Employee(response.name, response.id, response.email, response.role);\n inquirer.prompt([\n {\n type: 'input',\n name: 'school',\n message: 'What is their school?',\n }, \n ])\n .then((response) => {\n const x = new Intern(underling.name, underling.id, underling.email, underling.role, response.school);\n const y = \n `<div class=\"card\" style=\"width: 30%;\">\n <div class=\"card-body ${x.getRole()}\">\n <h5 class=\"card-title\">${x.getName()}</h5>\n <p class=\"card-text\"> Company ID: ${x.getID()}</p>\n <p class=\"card-text\"> Email: <a href=\"mailto:${x.getEmail()}\" target=\"_blank\"><p class=\"bold\">${x.getEmail()}</p> </a></p>\n <p class=\"card-text\"> Role: ${x.getRole()}</p>\n <p class=\"card-text\"> School: ${x.getSchool()}</p>\n </div>\n </div>`;\n addInfo(y);\n })\n }\n})}", "title": "" }, { "docid": "b5509954681d3d89d52980767101a31b", "score": "0.69276255", "text": "function addNewDepartment() {\n inquirer\n .prompt([\n {\n type: \"input\",\n message: \"What is the name of this new department?\",\n name: \"addName\"\n },\n ])\n .then(function (answer) {\n connection.query(\"INSERT INTO department (name) VALUES (?)\", [answer.addName],\n function (err, res) {\n if (err) throw err\n console.table(res)\n mainMenuPrompt()\n })\n })\n}", "title": "" }, { "docid": "009132cac4fdfb058556a95e12a7ce07", "score": "0.6924409", "text": "function addManager(){\n inquirer.prompt([\n {\n type: \"list\",\n name: \"name\",\n message: \"What is the name of the new manager\",\n choices: employeesForManagersArry\n }\n ]).then(function(answer){\n let query=\"INSERT INTO manager (manager_name) VALUES (?)\"\n connection.query(query, [answer.name], function(err, data){\n if (err) throw err;\n console.log(\"New Manager Successfully Added!\")\n startapp();\n });\n });\n}", "title": "" }, { "docid": "f73264be2e7566be2e496493822f370d", "score": "0.69219077", "text": "function addDepartment() {\n inquirer\n .prompt([\n {\n type: \"input\",\n message: \"Please input name of the department you want to add.\",\n name: \"department\",\n },\n ])\n .then(function(answer) {\n let query = `INSERT INTO department (name) VALUES (?)`\n db.query(query, answer.department, (err, res) => {\n if (err) throw err;\n console.log(`\\n${answer.department} was added to Departments.\\n`);\n runEmployeeManager();\n })\n })\n}", "title": "" }, { "docid": "cdb3e67fb00686d87aaed6fad36c695f", "score": "0.6918122", "text": "function addDepartment() {\n inquirer.prompt([\n\n {\n type: \"list\",\n name: \"adddept\",\n message: \"What department to add\",\n choices: ['Sales','Engineering','IT','legal','Finance']\n }\n ])\n .then(function (answers) {\n console.log(\"Adding department for a employee...\\n\");\n var query = connection.query(\n \"INSERT INTO department SET ?\",\n \n {\n name: answers.adddept\n },\n function (err, res) {\n if (err) throw err;\n console.log(res.affectedRows + \" Department added for employee!\\n\");\n addEmployeeRole();\n })\n })\n }", "title": "" }, { "docid": "031f984d6d36b09b033acf55ed860f30", "score": "0.69038963", "text": "function addEmployee() {\n // prompt for info about the item being put up for auction\n inquirer\n .prompt([\n {\n name: \"firstName\",\n type: \"input\",\n message: \"What is your new employee's first name?\",\n },\n {\n name: \"lastName\",\n type: \"input\",\n message: \"What is your new employee's last name?\",\n },\n {\n type: \"list\",\n message: \"What is the new employee's role?\",\n choices: ['Sales Lead', \n 'Salesperson', \n 'Lead Engineer', \n 'Software Engineer', \n 'Accountant', \n 'Lawyer'],\n name: \"role\",\n },\n {\n type: \"list\",\n message: \"Sales Lead = 1\\nSalesperson = 2\\nLead Engineer = 3\\nSoftware Engineer = 4\\nAccountant = 5\\nLawyer = 6.\\nWhat is the role ID?\",\n choices: [1, 2, 3, 4, 5, 6],\n name: \"rolesID\",\n },\n {\n type: \"list\",\n message: \"What is the new employee's department?\",\n choices: ['Sales', \n 'Finance', \n 'Engineering', \n 'Legal', \n 'Accounting', \n 'HR'],\n name: \"dept\",\n },\n {\n type: \"list\",\n message: \"Who is the new employee's manager?\",\n choices: ['Albert A.', \n 'Betsy B.', \n 'Charles C.', \n 'Darryl D.', \n 'Elizabeth E.', \n 'Fred F.'],\n name: \"mgr\"\n }\n ])\n .then(function (answer) {\n console.log(answer)\n // when finished prompting, insert the new employee into the db with that info\n connection.query(\n \"INSERT INTO employees SET ?\",\n {\n 'first_name': answer.firstName,\n 'last_name': answer.lastName,\n 'roles_title': answer.role,\n 'dept': answer.dept,\n 'mgr_name': answer.mgr,\n 'roles_id': answer.rolesID\n },\n function (err) {\n if (err) throw err;\n console.log(\"Your employee was created successfully!\");\n // re-prompt the user for if they want to bid or post\n start();\n }\n );\n });\n}", "title": "" }, { "docid": "82cac8859fa9d543f7739fd9ad5b20f5", "score": "0.6897946", "text": "async function addEmployee() {\n try {\n // Generate list of roles for user to select\n const rolesTable = await queries.viewRoles.runQuery(connection);\n let roleChoices = rolesTable.map(row => { return { name: row.title, value: row.id } });\n // Generate list of managers for user to select\n const managerTable = await queries.viewEmployees.runQuery(connection);\n let managerChoices = managerTable.map(row => { return { name: row.name, value: row.id } });\n // Add a 'none' option for employees that have no manager\n managerChoices.unshift({ name: \"none\", value: null })\n // Gather inputs from user\n const answers = await inquirer.prompt([\n {\n type: \"input\",\n message: \"First name\",\n name: \"firstName\",\n\n },\n {\n type: \"input\",\n message: \"Last name\",\n name: \"lastName\"\n },\n {\n type: \"list\",\n message: \"Title\",\n name: \"titleId\",\n choices: roleChoices\n },\n {\n type: \"list\",\n message: \"Manager\",\n name: \"managerId\",\n choices: managerChoices\n }\n ]);\n // Run the insert query\n const successful = await queries.addEmployee.runQuery(connection, [answers.firstName, answers.lastName, answers.titleId, answers.managerId]);\n // If the query succesfully inserted values, let the user know\n if (successful.affectedRows > 0) {\n console.log(chalk.green(\"Employee Added\"))\n // Otherwise, let the user know that it failed\n } else {\n console.log(chalk.red(\"Add Failed\"))\n }\n } catch (err) {\n console.error(err);\n }\n setTimeout(() => init(), 500);\n}", "title": "" }, { "docid": "50d0cc23c90c46f828e8cdf6525f8445", "score": "0.68853587", "text": "function addIntern(){\n inquirer.prompt(questionBuilder.questionBuilder(\"Intern\")).then(function (response) {\n employees.push(new Intern(response.nameAns, response.idAns, response.emailAns, response.schoolAns));\n if(response.empAns === \"Yes\"){\n addEmployee();\n }\n else{\n htmlDoc = render(employees);\n makeFile();\n }\n });\n}", "title": "" }, { "docid": "785950579b820ca52da8ad843e29d7fc", "score": "0.688522", "text": "function empPrompt() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"addNew\",\n message: \"What would you like to do?\",\n choices: [\"Add new employee\", \"Finish entry and create html file\"],\n },\n {\n type: \"list\",\n name: \"role\",\n message: \"What is the employee's role?\",\n choices: [\"Engineer\", \"Intern\", \"Manager\"],\n when: (answers) => answers.addNew === \"Add new employee\",\n },\n {\n type: \"input\",\n name: \"name\",\n message: \"What is the employee's name?\",\n when: (answers) => answers.addNew === \"Add new employee\",\n validate: (answer) => {\n if (answer !== \"\") {\n return true;\n }\n return \"Please make sure a name is entered.\";\n },\n },\n {\n type: \"input\",\n name: \"email\",\n message: \"What is the employee's email?\",\n when: (answers) => answers.addNew === \"Add new employee\",\n validate: (answer) => {\n // regex obtained from http://zparacha.com/validate-email-address-using-javascript-regular-expression\n if (/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/.test(answer)) {\n return true;\n }\n return \"Please make sure a valid email address is entered.\";\n },\n },\n {\n type: \"input\",\n name: \"id\",\n message: \"What is the employee's ID?\",\n when: (answers) => answers.addNew === \"Add new employee\",\n validate: (answer) => {\n if (isNaN(answer) || answer === \"\") {\n return \"Please enter valid ID number.\";\n }\n return true;\n },\n },\n {\n type: \"input\",\n name: \"gitHub\",\n message: \"What is the employee's GitHub username?\",\n when: (data) => data.role === \"Engineer\",\n validate: (answer) => {\n if (answer !== \"\") {\n return true;\n }\n return \"Please make sure a GitHub username is entered.\";\n },\n },\n {\n type: \"input\",\n name: \"school\",\n message: \"What is the employee's school?\",\n when: (data) => data.role === \"Intern\",\n validate: (answer) => {\n if (answer !== \"\") {\n return true;\n }\n return \"Please make sure a school name is entered.\";\n },\n },\n {\n type: \"input\",\n name: \"officeNumber\",\n message: \"What is the employee's office number?\",\n when: (data) => data.role === \"Manager\",\n validate: (answer) => {\n if (isNaN(answer) || answer === \"\") {\n return \"Please enter valid ID number.\";\n }\n return true;\n },\n },\n ])\n .then((data) => {\n // creates classes based off of prompt responses\n if (data.role === \"Engineer\") {\n employees.push(\n new Engineer(data.name, data.id, data.email, data.gitHub)\n );\n console.log(data.name + \" has been added!\");\n setTimeout(function () {\n console.clear();\n empPrompt();\n }, 3000);\n } else if (data.role === \"Intern\") {\n employees.push(new Intern(data.name, data.id, data.email, data.school));\n console.log(data.name + \" has been added!\");\n setTimeout(function () {\n console.clear();\n empPrompt();\n }, 3000);\n } else if (data.role === \"Manager\") {\n employees.push(\n new Manager(data.name, data.id, data.email, data.officeNumber)\n );\n console.log(data.name + \" has been added!\");\n setTimeout(function () {\n console.clear();\n empPrompt();\n }, 3000);\n // creates html page if the user selects \"Finish entry and create html file\"\n } else if (data.addNew === \"Finish entry and create html file\") {\n var outHtml = render(employees);\n return fs.writeFile(outputPath, outHtml, function (err) {\n if (err) throw err;\n console.log(\"Successfully created team.html file!\");\n });\n }\n });\n}", "title": "" }, { "docid": "01f5db86b95c7cf4a4bf71da0606e88d", "score": "0.6884729", "text": "async function addManager() {\n try{\n const {name, id, email, office} = await inquirer.prompt([\n {\n message: \"What is your manager's name?\",\n name: \"name\"\n },\n {\n message: \"What is your manager's ID?\",\n name: \"id\"\n },\n {\n message: \"What is your manager's email?\",\n name: \"email\"\n },\n {\n message: \"What is your manager's office number?\",\n name: \"office\"\n }\n ]);\n\n employeeList[0] = new Manager(name, id, email, office);\n addNew();\n\n }\n catch(err){\n console.log(\"Error in addManager\")\n }\n \n}", "title": "" }, { "docid": "eaf26b17a9ded0a8d1b8bd32c7f4f4de", "score": "0.6881129", "text": "function addRole() {\n inquirer.prompt([\n {\n type: \"confirm\",\n name: \"Add\",\n message: \"Would you like to add another employee?\",\n // Starts with true but user can pick false\n default: true,\n }\n // After the user has input all employees desired, call the `render` function (required\n // above) and pass in an array containing all employee objects; the `render` function will\n // generate and return a block of HTML including templated divs for each employee!\n ]).then(function (res) {\n // displays response\n console.log(res)\n if (res.Add) {\n startEmployee();\n } else {\n const employeeData = render(employees);\n fs.writeFile(outputPath, employeeData, function (err) {\n if (err) throw err;\n // User is prompted that new employees have been added, once they've finished adding them in\n console.log(\"Adding new employee(s)\")\n })\n }\n })\n}", "title": "" }, { "docid": "2df5a2b8ce810ea6ef9d26337c9b806a", "score": "0.68718994", "text": "function addDept() {\n inquirer\n .prompt([\n {\n type: 'input',\n name: 'name',\n message: \"Department's Name:\",\n },\n ])\n .then((answers) => {\n console.clear();\n console.log(`Adding ${answers.name} department to database...\\n`);\n\n updateRecords(query.addDept, query.viewDepts, answers);\n });\n}", "title": "" }, { "docid": "00ce98310d519a84ea7483819c6b236e", "score": "0.6868358", "text": "function EmployeeChoice() {\n return inquirer\n .prompt([\n {\n name: \"addTeam\",\n message: \"Would you like to add a new team member?\",\n type: \"confirm\",\n }\n ])\n .then((response) => {\n if (response.addTeam) {\n generateUser();\n }\n else {\n createHtmlFile();\n return;\n }\n });\n}", "title": "" }, { "docid": "29215581133b6033a724534bab30d7ef", "score": "0.68606764", "text": "function createEmployee() {\n\n inquirer.prompt([\n {\n name: 'continue',\n type: 'confirm',\n message: 'Would you like to add another employee?'\n },\n {\n name: 'role',\n type: 'list',\n message: 'What is the employees role?',\n choices: ['Engineer', 'Intern'],\n when: function( data ) {\n return data.continue === true;\n }\n }\n ])\n .then(function (data) {\n switch (data.role) {\n case 'Engineer':\n createEngineer()\n break;\n case 'Intern':\n createIntern()\n break;\n default:\n generateWebPage(teamMembers)\n break;\n } \n })\n}", "title": "" }, { "docid": "dec7cab2a3a3337eed55c67e09c6aafd", "score": "0.68485", "text": "async function addEmployee() {\n await prompt([{\n type: \"input\",\n name: \"firstName\",\n message: \"What is the first name of the new employee?\",\n },\n {\n type: \"input\",\n name: \"lastName\",\n message: \"What is the last name of the new employee?\",\n },\n {\n type: \"number\",\n name: \"roleID\",\n message: \"What is the role ID of the new employee? (Finance Manager = 1; Technical Director = 2; Senior Developer = 3; Sales Manager = 4; Senior Account Manager = 5; Finance Payable officer = 6; HR Officer = 7; HR Manager = 8; )\",\n },\n {\n type: \"number\",\n name: \"managerID\",\n message: \"What is the manager ID of the new employee? (Kent Ivans [Finance Manager] = 1; Aaron Kloska [Technical Director] = 2; Alfred Pacleb [Sales Manager] = 4; Shaun Rael[HR Manager] = 8;) \",\n },\n ]).then((answer) => {\n const query = `INSERT INTO employee (first_name, last_name, role_id, manager_id) VALUES (?, ?, ?, ?);`;\n connection.query(\n query, [\n answer.firstName,\n answer.lastName,\n answer.roleID,\n answer.managerID,\n ],\n (err, res) => {\n if (err) throw err;\n console.log(\"\");\n console.table(res);\n console.log(\"Successfully added an new employee!\");\n }\n );\n start();\n });\n}", "title": "" }, { "docid": "eeba5ef923f25d1261e2a2997021da31", "score": "0.6845894", "text": "function addEmployees() {\n inquirer\n .prompt([\n {\n type: \"input\",\n name: \"emplFirst\",\n message: \"What is the first name of the Employee you would like to add?\"\n },\n {\n type: \"input\",\n name: \"emplLast\",\n message: \"What is the last name of the Employee you would like to add?\"\n },\n {\n type: \"input\",\n name: \"emplRID\",\n message: \"Please enter the ID for this employee's Role.\"\n },\n {\n type: \"input\",\n name: \"emplMID\",\n message: \"Please enter the ID for this employee's manager\"\n }\n ]).then(function (answer) {\n connection.query(\"INSERT INTO employee SET ?\", { first_name: answer.emplFirst, last_name: answer.emplLast, role_id: answer.emplRID, manager_id: answer.emplMID }, function (error, result) {\n console.log(result)\n start();\n })\n })\n}", "title": "" }, { "docid": "ab73298fd299aa2ab468c8b03c819bad", "score": "0.6835462", "text": "function addEmployees() {\n inquirer.prompt([\n {\n type: 'list',\n name: 'memberChoice',\n message: 'Would you like to add more team members? Please select choices provided',\n choices: ['engineer', 'intern', 'No I do not wish to add anymore members'],\n }\n ]).then(function ({ memberChoice }) {\n if (memberChoice == 'engineer') {\n addEngineer();\n }\n else if (memberChoice == 'intern') {\n addIntern();\n } else {\n endHTML(); //replace with html code\n }\n })\n\n}", "title": "" }, { "docid": "e3d75e23baca7fe6a1eef7e2f7865842", "score": "0.6834885", "text": "function addIntern() {\n inquirer.prompt([\n {\n type: \"input\",\n name: \"name\",\n message: \"What is the intern's name?\"\n },\n {\n type: \"input\",\n name: \"id\",\n message: \"What is the intern's ID number?\",\n },\n {\n type: \"input\",\n name: \"email\",\n message: \"What is the intern's email address?\",\n },\n {\n type: \"input\",\n name: \"school\",\n message: \"What is the intern's office number?\",\n },\n ])\n .then((responses) => {\n var intern = new Intern(\n responses.name,\n responses.id,\n responses.email,\n responses.school\n );\n employees.push(intern)\n employeeType()\n });\n}", "title": "" }, { "docid": "f46f4d5ec841992355c6799a5213593e", "score": "0.68330956", "text": "function addNewDept() {\n\tconsole.log();\n\tconsole.log(chalk.blue(' \t\t\tCREATE NEW DEPARTMENT'));\n\tconsole.log(chalk.blue(' \t\t\t~~~~~~~~~~~~~~~~~~~~~'));\n\tconsole.log();\n\n\tinquirer.prompt([\n\t{\n\t\tname: \"input_dept\",\n\t\ttype: \"input\",\n\t\tmessage: \"Enter Department name to add :\",\n\t\tvalidate: function (data) {\n\t\t\tif (!data)\n\t\t\t\treturn \"Data cannot be empty..\";\n\t\t\telse\n\t\t\t\treturn true;\n\t\t\t}\n\t},\n\t{\n\t\tname: \"input_costs\",\n\t\ttype: \"input\",\n\t\tmessage: \"Enter Over-head Costs for the Department :\",\n\t\tvalidate: function(value) {\n\t\t\tif (isNaN(value) === false) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t }\n\t])\n\t.then(function(answer) {\n\t\tconnection.query(\"INSERT INTO department SET ?\", \n\t\t[\n\t\t\t{\n\t\t\t\tdepartment_name:answer.input_dept,\n\t\t\t\tover_head_costs:answer.input_costs\n\t\t\t}\n\t\t],\n\t\tfunction(err, res){\n\t\t\tif (err) throw err;\n\n\t\tconsole.log();\n\t\tconsole.log(chalk.red.bold('\tNew Department Created ...'));\n\t\tconsole.log();\n\t\tdisplayOptions();\n\t\t});\t\t\n\t})\t\n}", "title": "" }, { "docid": "895059c0be07f540106afa9a3e27b80e", "score": "0.68262273", "text": "function addEmployee(answer, role, manager) {\n // get id out of user's inquirer response\n var roleId = role.choice.split(\"-\")[0];\n var managerId = manager.choice.split(\"-\")[0];\n return connection.query(\"INSERT INTO employee SET ?\", {\n first_name: answer.first_name,\n last_name: answer.last_name,\n //the key names must match the column names in the schema\n role_id: roleId,\n manager_id: managerId\n });\n}", "title": "" }, { "docid": "de1fa1006ebc782326910f6c8d049388", "score": "0.6816085", "text": "function addRole() {\n\t\tinquirer\n\t.prompt([\n\t\t{\n\t\t\tmessage: \"Enter new role\",\n\t\t\ttype: \"input\",\n\t\t\tname: \"title\"\n\t\t\t\n\t\t},\n\t\t{\n\t\t\tmessage: \"Enter new salary\",\n\t\t\ttype: \"number\",\n\t\t\tname: \"salary\"\n\t\t},\n\t\t{\n\t\t\tmessage: \"Enter new department id\",\n\t\t\ttype: \"number\",\n\t\t\tname: \"department_id\"\n\t\t\t\n\t\t}])\n\n\t\t\t\t.then(function(answer) {\t\n\t\t\t\tconnection.query(\n\t\t\t\t\t\"INSERT INTO role (title, salary, department_id) VALUES (?,?,?)\", \n\t\t\t\t\t[answer.title,\n\t\t\t\t\t answer.salary,\n\t\t\t\t\t answer.department_id],\n\t\t\t\tfunction(err, data) {\n\t\t\t\tif (err) throw err;\n\t\t\t\tconsole.table(data);\n\t// Call addEmployee AFTER the INSERT completes\n\t\t\t\t\t\n\t\t\t\t\n\trunSearch();\n\t\t})\n\t})\t\n\t}", "title": "" }, { "docid": "f26882ea90de0767f9e155979f26d140", "score": "0.6808422", "text": "async function addEngineer(){\n try{\n const {name, id, email, github} = await inquirer.prompt([\n {\n message: \"What is your engineer's name?\",\n name: \"name\"\n },\n {\n message: \"What is your engineer's ID?\",\n name: \"id\"\n },\n {\n message: \"What is your engineer's email?\",\n name: \"email\"\n },\n {\n message: \"What is your engineer's github account?\",\n name: \"github\"\n }\n ]);\n\n employeeList[employeeList.length] = new Engineer(name, id, email, github);\n addNew();\n\n }\n catch(err){\n console.log(\"Error in addEngineer\")\n }\n}", "title": "" }, { "docid": "902d8916756cd7916b3dc43f82c86e41", "score": "0.6807312", "text": "function addEmployee() {\n inquirer.prompt([{\n message: 'What is your name? Please include your first and last name in the response.',\n type: 'input',\n name: 'name',\n }, {\n message: 'What is your employee ID number?',\n type: 'number',\n name: 'id',\n }, {\n message: 'What is your email address?',\n type: 'input',\n name: 'email',\n }, {\n message: 'What is your role in the company?',\n type: 'list',\n name: 'role',\n choices: [\n 'Manager',\n 'Engineer',\n 'Intern'\n ],\n }])\n .then(function ({name, id, email, role}) {\n let selection = '';\n if (role === 'Manager') {\n selection = 'office number';\n } else if (role === 'Engineer') {\n selection = 'Github username';\n } else {\n selection = 'school';\n }\n inquirer.prompt([{\n message: `Enter the employee's ${selection}.`,\n name: 'selection',\n }, {\n message: 'Are there any other employees you would like to add?',\n name: 'addNewEmp',\n type: 'list',\n choices: [\n 'yes',\n 'no',\n ],\n }])\n .then(function({selection, addNewEmp}) {\n let newEmp;\n if (role === 'Manager') {\n newEmp = new Manager(name, id, email, selection);\n } else if (role === 'Engineer') {\n newEmp = new Engineer(name, id, email, selection);\n } else {\n newEmp = new Intern(name, id, email, selection);\n }\n employees.push(newEmp);\n newEmpCards(newEmp)\n .then(function() {\n if (addNewEmp === 'yes') {\n addEmployee();\n } else {\n endHtml();\n }\n });\n });\n});\n}", "title": "" }, { "docid": "17279267b6f622e428c0f1855fa6dd64", "score": "0.68025595", "text": "function addEmployee() {\n inquirer.prompt([\n {\n name: \"firstName\",\n message: \"What is the employee's first name?\"\n },\n {\n name: \"lastName\",\n message: \"What is the employee's last name?\"\n },\n {\n name: \"role\",\n type: \"list\",\n message: \"What is the employee's role?\",\n choices: [\"Sales Lead\", \"Salesperson\", \"Lead Engineer\", \"Software Engineer\", \"Account Manager\", \"Accountant\", \"Legal Team Lead\", \"Lawyer\"]\n },\n {\n name: \"manager\",\n type: \"list\",\n message: \"Who is the employee's manager?\",\n choices: [\"John\", \"Mike\", \"Ashley\", \"Kevin\", \"Kunal\", \"Malia\", \"Sarah\", \"Tom\", \"None\"]\n }\n ]).then(function (data) {\n connection.query(`SELECT id FROM employees WHERE first_name = \"${data.manager}\"`,\n function (err, results) {\n if (err) throw err;\n let manager = results[0].id;\n connection.query(`SELECT id FROM roles WHERE title = \"${data.role}\"`,\n function (err, results) {\n if (err) throw err;\n let role = results[0].id;\n\n connection.query(\"INSERT INTO employees SET ?\",\n {\n first_name: data.firstName,\n last_name: data.lastName,\n role_id: role,\n manager_id: manager\n },\n function (err) {\n if (err) throw err;\n console.log(\"Your new employee was created successfully!\");\n options();\n }\n );\n });\n });\n });\n}", "title": "" }, { "docid": "b9fa3e55f9b39115bea655d5945da6b1", "score": "0.67891926", "text": "function addEmployee() {\n console.log(\"-------------------------------------\");\n connection.query(\"SELECT * FROM department\", function (err, res) {\n if (err) throw err;\n\n // Use result to setup an object for the inquirer's department choices\n const myDeps = res.map(function (deps) {\n return { \n name: deps.name,\n value: deps.id \n };\n });\n\n inquirer\n .prompt([\n {\n type: \"input\",\n name: \"first_name\",\n message: \"What is the employee's first name?\"\n },\n {\n type: \"input\",\n name: \"last_name\",\n message: \"What is the employee's last name?\"\n },\n {\n type: \"list\",\n name: \"department\",\n message: \"What is the new employee's department?\",\n choices: myDeps\n }\n ])\n .then(function (data) {\n const newEmp = data;\n // New query looks to assign the employee a role given the specified department\n connection.query(\"SELECT * FROM role WHERE department_id =\"+newEmp.department+\"\", function (err, res) {\n if (err) throw err;\n\n const myRole = res.map(function (roles) {\n return { \n name: roles.title,\n value: roles.id \n };\n });\n\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"roles\",\n message: \"Select a role:\",\n choices: myRole\n }\n ])\n .then(function(data){\n const newRole = data.roles;\n // Select a manager from the employee table\n connection.query(\"SELECT id,CONCAT(first_name, ' ', last_name) AS manager FROM employee\", function(err, res){\n if (err) throw err;\n\n const myMan = res.map(function(man){\n return {\n name: man.manager,\n value: man.id\n }\n })\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"manager\",\n message: \"Select a Manager for the employee:\",\n choices: myMan\n }\n ]).then(function(data){\n // Now insert the new employee into the employee table with all the gathered data\n connection.query(\n \"INSERT INTO employee SET ?\",\n {\n first_name: newEmp.first_name,\n last_name: newEmp.last_name,\n role_id: newRole,\n manager_id: data.manager\n\n }\n , function(err, res) {\n if (err) throw err;\n viewAllEmployees();\n }\n )\n })\n })\n })\n })\n })\n });\n}", "title": "" }, { "docid": "d4c1835ff20d682199b05a7cc62143cc", "score": "0.67872375", "text": "async function addEmployee() {\n try {\n let employeeData = await employeeQuest();\n await insertEmployee(employeeData);\n // Returns user to main menu to select next action.\n await init();\n } catch(err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "017f35ff6ae90148de428261e260f0ca", "score": "0.67747504", "text": "function addRole() {\n inquirer\n .prompt([\n {\n type: \"input\",\n message: \"Enter new Role Name\",\n name: \"roleName\"\n },\n ])\n .then(function (answer) {\n connection.query(\n \"INSERT INTO role SET ?\",\n {\n title: answer.roleName,\n },\n function (err, answer) {\n if (err) {\n throw err;\n }\n console.log(\"employee Added Successfully\");\n }\n );\n loadMainMenu();\n });\n}", "title": "" }, { "docid": "a1d80340568fbe39977ccaf0c6846e2a", "score": "0.67635936", "text": "async function addEmployee() {\n let currentRoles = await getRoles();\n let currentManagers = await getManagers();\n\n inquirer.prompt([\n {\n type: \"input\",\n message: \"What is the employee's first name?\",\n name: \"first_name\"\n },\n {\n type: \"input\",\n message: \"What is the employee's last name?\",\n name: \"last_name\"\n },\n {\n type: \"list\",\n message: \"What is the employee's role?\",\n name: \"role\",\n choices: getRoleTitles(currentRoles)\n },\n {\n type: \"list\",\n message: \"Who is the employee's manager?\",\n name: \"manager\",\n choices: getEmployeeNames(currentManagers, true)\n },\n ]).then(({ first_name, last_name, role, manager }) => {\n connection.query(\n 'insert into employee set ?',\n {\n first_name: first_name,\n last_name: last_name,\n role_id: getRoleId(currentRoles, role),\n manager_id: getEmployeeId(currentManagers, manager),\n },\n (err) => {\n if (err) throw err;\n console.log('Successfully added employee!');\n start();\n }\n );\n });\n}", "title": "" }, { "docid": "4b8801d40e6917d568c4223d2ffb93a1", "score": "0.67635185", "text": "async addEmployee() {\n let mgrQuery = `SELECT employees.id, concat(employees.first_name, ' ' , employees.last_name) AS Manager FROM employees ORDER BY Manager ASC;`;\n let roleQuery = `SELECT id, title FROM roles ORDER BY title ASC;`;\n let roles = await this.connection.query(roleQuery);\n let mgrs = await this.connection.query(mgrQuery);\n\n let rolesList = roles[0].map((row) => {\n return { name: row.title, value: row.id };\n });\n\n let mgrsList = mgrs[0].map((row) => {\n return { name: row.Manager, value: row.id };\n });\n\n return prompt([\n {\n type: \"input\",\n name: \"firstName\",\n message: \"What is the first name of the employee?\",\n },\n {\n type: \"input\",\n name: \"lastName\",\n message: \"What is the last name of the employee?\",\n },\n {\n type: \"list\",\n name: \"role\",\n message: \"What is the role of this employee?\",\n choices: rolesList,\n },\n {\n type: \"list\",\n name: \"mgr\",\n message: \"Who is the manager of this employee?\",\n choices: mgrsList,\n },\n ]).then((answer) => {\n let query = \"INSERT INTO employees set ?;\";\n let values = [\n {\n first_name: answer.firstName,\n last_name: answer.lastName,\n role_id: answer.role,\n manager_id: answer.mgr,\n },\n ];\n this.connection.query(query, values, (err) => {\n if (err) throw err;\n });\n console.log(\n `Adding ${answer.firstName} ${answer.lastName} to employees table.`\n );\n });\n }", "title": "" }, { "docid": "00e5828241cec1b4db800093561d5fc0", "score": "0.675539", "text": "function addNew() {\n\t\tinquirer.prompt([\n\t\t\t{\n\t\t\t\ttype: 'input',\n\t\t\t\tname: 'name',\n\t\t\t\tmessage: 'What is the name of the item you want to add?'\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'input',\n\t\t\t\tname: 'price',\n\t\t\t\tmessage: 'What is the stock price for this item?'\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'input',\n\t\t\t\tname: 'quantity',\n\t\t\t\tmessage: 'How many items do you want to add?'\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'input',\n\t\t\t\tname: 'department',\n\t\t\t\tmessage: 'Which department does this item belong?'\n\t\t\t}\n\t\t]).then(function(response) {\n\t\t\t//Query that inserts the user response to the sql database\n\t\t\tconnection.query('INSERT INTO product SET ?', {productName: response.name, departmentName: response.department, price: response.price, stockQuantity: response.quantity})\n\t\t\toptions();\n\t\t})\n}", "title": "" }, { "docid": "7d76fece1aef39311f00a4f2c80ff855", "score": "0.67456645", "text": "async function addDepartment() {\n const department = await prompt([\n {\n name: \"name\",\n message: \"What is the name of the department?\"\n }\n ]);\n \n await db.createDepartment(department);\n \n console.log(`Added ${department.name} to the database`);\n \n loadMainPrompts();\n }", "title": "" }, { "docid": "77f1219d314325a166086552f4838fec", "score": "0.6739698", "text": "async addDepartment() {\n await prompt([\n {\n type: \"input\",\n name: \"newDep\",\n message: \"Enter the name of the new department:\",\n },\n ]).then((answer) => {\n let query = `INSERT INTO departments (name) VALUES ('${answer.newDep}');`;\n this.connection.query(query, (err, res) => {\n if (err) throw err;\n });\n console.log(`Adding ${answer.newDep} into departments table.`);\n });\n }", "title": "" }, { "docid": "28e4966f1cd52565cf096747683d82e1", "score": "0.6719276", "text": "function addEmployees() {\n console.log(\"Inserting an employee!\")\n \n var query =\n `SELECT r.id, r.title, r.salary \n FROM role r`\n \n connection.query(query, function (err, res) {\n if (err) throw err;\n \n const roleChoices = res.map(({ id, title, salary }) => ({\n value: id, title: `${title}`, salary: `${salary}`\n }));\n \n console.table(res);\n console.log(\"Please input the following Employee Info\");\n \n inquirer\n .prompt([\n {\n type: \"input\",\n name: \"first_name\",\n message: \"What is the employee's first name?\"\n },\n {\n type: \"input\",\n name: \"last_name\",\n message: \"What is the employee's last name?\"\n },\n {\n type: \"list\",\n name: \"roleId\",\n message: \"What is the employee's role?\",\n choices: roleChoices\n },\n ])\n .then(function (input) {\n console.log(input);\n \n var query = `INSERT INTO employee SET ?`\n // insert input from prompt into DB\n connection.query(query,\n {\n first_name: input.first_name,\n last_name: input.last_name,\n role_id: input.roleId,\n manager_id: input.managerId,\n },\n function (err, res) {\n if (err) throw err;\n \n console.table(res);\n console.log(\"New Employee added!\\n\");\n \n startApp();\n });\n });\n \n });\n }", "title": "" }, { "docid": "8adc0a513d9d5623deca981258d493de", "score": "0.67099726", "text": "function addNewEmployee() {\n connection.query(\"SELECT department.name, role.title FROM department INNER JOIN role ON (department.id = role.department_id);\", function(err, res) {\n if (err) throw err;\n \n inquirer.prompt([\n {\n name: \"firstName\",\n type:\"input\",\n message: \"What is the new employees first name?\",\n validate: emptyResponseValidation\n },\n {\n name: \"lastName\",\n type:\"input\",\n message: \"What is the new employees last name?\",\n validate: emptyResponseValidation\n },\n {\n name: \"chooseDepartment\",\n type: \"list\",\n choices: function() {\n var departmentsArr = [];\n for (i=0; i<res.length; i++) {\n departmentsArr.indexOf(res[i].name) === -1 ? departmentsArr.push(res[i].name) : console.log();\n } \n return departmentsArr;\n },\n message: \"What department is the new employee joining?\", \n },\n {\n name: \"chooseRole\",\n type: \"list\",\n choices: function() {\n var rolesArr = [];\n for (i=0; i<res.length; i++) {\n rolesArr.push(res[i].title)\n } \n return rolesArr;\n }, \n message: \"What role is the new employee?\" \n },\n {\n name: \"manager\",\n type:\"input\",\n message: \"Who is the new employees Manager?\",\n },\n\n ]).then(function(answer) {\n var nameArr = answer.manager.split(\" \");\n var manFirstName = nameArr[0];\n var manLastName = nameArr[1];\n var query = \"SELECT id FROM role WHERE title = ?;SELECT id FROM employee WHERE first_name = ? AND last_name = ?\"\n var firstName = answer.firstName;\n var lastName = answer.lastName;\n \n connection.query(query, [answer.chooseRole, manFirstName, manLastName], function(err, res) {\n if (err) throw err;\n \n connection.query(\n \"INSERT INTO employee SET ?\",\n {\n first_name: firstName,\n last_name: lastName,\n role_id: res[0][0].id,\n manager_id: res[1][0].id\n },\n function(err) {\n if (err) throw err;\n console.log(\"------- New Employee \" + firstName + \" \" + lastName + \" Added! -------\");\n startInquirer();\n } \n )\n })\n });\n })\n}", "title": "" }, { "docid": "f9faebff7bf8de7300d30a3fe43ac52e", "score": "0.67094487", "text": "function createNewDepartment() {\n clearConsole();\n inquirer.prompt([\n {\n type: \"input\",\n name: \"departmentName\",\n message: \"Enter New Department Name:\"\n }\n ]).then(function (answer) {\n addDepartment(answer.departmentName);\n });\n}", "title": "" }, { "docid": "b30b3e524e4440795b941aaec5844e5a", "score": "0.6692881", "text": "function engineerPrompt() {\n inquirer\n .prompt([{\n message: \"What is your engineers name?\",\n name: \"name\",\n },\n {\n message: \"What is your engineers id?\",\n name: \"id\",\n },\n {\n message: \"What is this engineers email?\",\n name: \"email\",\n },\n {\n message: \"What is this engineers github?\",\n name: \"github\",\n },\n ])\n .then(function(engineer) {\n //Build engineer add to employees array\n employees.push(new Engineer(engineer.name, engineer.id, engineer.email, engineer.github))\n console.log(engineer);\n console.log(employees);\n addEmployee();\n });\n}", "title": "" }, { "docid": "65f662f195128529358968da6cbe0bde", "score": "0.66863185", "text": "function addEmployee(newEmployeeInfo) {\n\n //variables needed \n let fName = newEmployeeInfo.employeeFirstName\n let lName = newEmployeeInfo.employeeLastName\n let job = newEmployeeInfo.employeeRole\n let manager = newEmployeeInfo.employeeManager\n\n //Inserting user answers into table \n var query = connection.query(\n \"INSERT INTO employee SET ?\",\n {\n first_name: fName,\n last_name: lName,\n role_id: job,\n manager_id: manager\n },\n function (err, res) {\n if (err) throw err;\n console.log(res.affectedRows + \" person inserted!\\n\");\n initialPrompt()\n }\n )\n}", "title": "" }, { "docid": "f13f3a0ebb96c213a6fb74ce50dc53ed", "score": "0.66833025", "text": "function addNewDepartment() {\n inquirer.prompt([\n {\n type: \"input\",\n message: \"What department would you like to add?\",\n name: \"department\"\n },{\n type: \"input\",\n message: \"What is the overhead cost?\",\n name: \"cost\"\n }\n ]).then(function(inquirerResponse) {\n addDepartment(inquirerResponse.department,inquirerResponse.cost);\n })\n }", "title": "" }, { "docid": "1152b5dc4b6e811d6d95593a7cb7ae20", "score": "0.6676907", "text": "function addEmployee() {\n //Prompts for First Name, Last Name, Role, and Manager\n inquirer.prompt([\n {\n name: \"first_name\",\n type: \"input\",\n message: \"What is the NEW employee's first name?\"\n },\n {\n name: \"last_name\",\n type: \"input\",\n message: \"What is the NEW employee's last name?\"\n },\n {\n name: \"role\",\n type: \"input\",\n message: \"What is the NEW employee's role?\"\n },\n {\n name: \"manager\",\n type: \"input\",\n message: \"Who is the NEW employee's manager?\"\n }\n ]).then(function (answer) {\n // .then(function (answer) {\n // when finished prompting, insert a new item into the db with that info\n connection.query(\n \"INSERT INTO employee SET ?\",\n {\n first_name: answer.first_name,\n last_name: answer.last_name,\n //Figure out how to get these to talk to the corresponding array\n role_id: 0,\n manager_id: 0\n },\n function (err) {\n if (err) throw err;\n console.log(\"New Employee Successfully Added!\");\n runSearch();\n });\n });\n}", "title": "" }, { "docid": "677307aafefe085031057615d7b7a83a", "score": "0.6675412", "text": "function addEngineer() {\n inquirer.prompt(\n //Concatenating the engineer specific questions with the general employee questions and passing to inquirer\n employeeQuestions.concat(engineerQuestions)\n ).then(function(data) {\n //Passing the engineer's details from the inquirer response object - data into the template function which returns the HTML string with the embedded engineer details\n //Concatenating all engineers in a single string each time an engineer is added\n engineersDiv += engineerStr.getEngineerStr(data);\n //Check if user wants to add another engineer\n isAddEngineer();\n });\n}", "title": "" }, { "docid": "000d41751bc0e8724deb28001d22b4ec", "score": "0.6674244", "text": "function addEmployee() {\n const roles = [1, 2, 3, 4];\n inquirer.prompt([\n {\n type: \"input\",\n message: \"Enter the employee's first name\",\n name: \"firstName\",\n },\n {\n type: \"input\",\n message: \"Enter the employee's last name\",\n name: \"lastName\",\n },\n {\n type: \"list\",\n message: \"Select the employee's role (Manager = 1 || Call Center Agent = 2 || Referral Coordinator = 3 || Accountant = 4)\",\n choices: roles,\n name: \"role\",\n },\n {\n type: \"confirm\",\n message: \"Is this employee a Manager?\",\n name: \"manager\",\n },\n ]).then((response) => {\n let manager;\n if (response.manager === true) {\n manager = 1;\n } else {\n manager = null;\n }\n\n connection.query(\"INSERT INTO EMPLOYEE (first_name, last_name, role_id, manager_id) VALUES (?, ?, ?, ?);\", [response.firstName, response.lastName, parseInt(response.role), manager],\n function (error, result) {\n if (error) {\n console.log(error);\n }\n connection.query(\"SELECT * FROM EMPLOYEE WHERE ID=?;\", [result.insertId], function (error, result) {\n if (error) {\n console.log(error);\n }\n console.table(result);\n start();\n });\n });\n });\n}", "title": "" }, { "docid": "823f7b745e248065894616a40998432c", "score": "0.66589737", "text": "function promptNewDept() {\n\n util.printTitle('Add New Department', 42);\n\n inquirer.prompt([{\n type: 'input',\n name: 'name',\n message: 'Name: '\n },\n {\n type: 'input',\n name: 'overhead',\n message: 'Overhead: '\n }\n ]).then(req => {\n\n if (req.name.trim() === '' || req.overhead.trim() === '') {\n return util.inputError('Error: fields cannot be blank.', promptNewDept);\n }\n\n if (isNaN(req.overhead)) {\n return util.inputError('Error: Overhead must be a number.', promptNewDept);\n }\n\n console.clear();\n\n bamazon.addNewDept(req.name.trim(), parseFloat(req.overhead.trim()).toFixed(2))\n .then(promptSupervisorOptions);\n });\n}", "title": "" }, { "docid": "fcd594657b5fe0240c9e506e64557042", "score": "0.665191", "text": "function addEmployee(){\n inquirer.prompt([\n {\n type: \"input\",\n name: \"firstName\",\n message: \"What is the employee's first name?\",\n },\n {\n type: \"input\",\n name: \"lastName\",\n message: \"What is the employee's last name?\",\n },\n {\n type: \"list\",\n name: \"role\",\n message: \"What is the employee's role?\",\n choices: newemployeerolesArry\n },\n {\n type: \"list\",\n name: \"manager\",\n message: \"Who is the employees manager?\",\n choices: newemployeemanagersArry\n }\n\n ]).then(function(answer){\n // get role id based on role chosen\n connection.query(\"SELECT id FROM role WHERE ?\", {role_title: answer.role}, function(err, data){\n if(err) throw err;\n var roleId= data[0].id\n\n if (answer.manager===\"None\"){\n managerId=null\n const query= \"INSERT INTO employee SET ?\"\n connection.query(query,[{first_name: answer.firstName, last_name: answer.lastName, role_id: roleId, manager_id: managerId}], function(err,data){\n if (err) throw err;\n console.log(\"New Employee Successfully Added!\")\n startapp();\n });\n }else{\n connection.query(\"SELECT id FROM manager WHERE ?\", {manager_name: answer.manager}, function(err, data){\n if(err) throw err;\n var managerId= data[0].id\n const query= \"INSERT INTO employee SET ?\"\n connection.query(query,[{first_name: answer.firstName, last_name: answer.lastName, role_id: roleId, manager_id: managerId}], function(err,data){\n if (err) throw err;\n console.log(\"New Employee Successfully Added!\")\n startapp();\n });\n });\n }\n });\n });\n}", "title": "" }, { "docid": "9d01bac05a1e5fecc72c1bc00af5cf03", "score": "0.664575", "text": "function addEmployeeRole() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"title\",\n message: \"What is the role for employee:\",\n choices: ['Sales Lead', 'Sales Person','Lead Engineer','Software Engineer','Accountant','Legal Team Lead', 'Lawyer']\n },\n {\n type: \"list\",\n name: \"deptid\",\n choices:[1,2,3,4,5,6,7]\n },\n {\n type: \"list\",\n name:\"salary\",\n message:\"Enter the salary:\",\n choices: [\"100000\",\"80000\",\"150000\",\"120000\",\"125000\",\"250000\",\"190000\"]\n }\n ])\n .then(function (answers) {\n console.log(\"Adding employee role for a employee...\\n\");\n var query = connection.query(\n \"INSERT INTO role SET ?\",\n {\n department_id:answers.deptid,\n title: answers.title,\n salary: answers.salary\n },\n function (err, res) {\n if (err) throw err;\n console.log(res.affectedRows + \" Employee role added!\\n\");\n // Call updateEmployee AFTER the ADD completes\n addEmployee();\n }\n );\n\n // logs the actual query being run\n console.log(query.sql);\n })\n}", "title": "" }, { "docid": "a0279eed754a0fcdd274cbe2def5127f", "score": "0.6643937", "text": "function addEmployees(roleInformationChoices) {\n inquirer\n .prompt([\n {\n type: \"input\",\n name: \"first_name\",\n message: \"What is the employee's first name?\"\n },\n {\n type: \"input\",\n name: \"last_name\",\n message: \"What is the employee's last name?\"\n },\n {\n type: \"list\",\n name: \"roleId\",\n message: \"What is the employee's role?\",\n choices: roleInformationChoices\n },\n ])\n .then(function (answer) {\n\n var query = `INSERT INTO employee SET ?`\n connection.query(query,\n {\n first_name: answer.first_name,\n last_name: answer.last_name,\n role_id: answer.roleId,\n manager_id: answer.managerId,\n },\n function (err, res) {\n if (err) throw err;\n console.log(\"Employee Inserted successfully!\\n\");\n\n loadPrompts();\n });\n });\n}", "title": "" }, { "docid": "e06e9dbab933c4885c1fd38a3b84e05c", "score": "0.6640358", "text": "function promptAddEmpData(roleValues) {\n inquirer.prompt([\n {\n type:\"input\",\n name:\"firstName\",\n message:\"What is the first name of the new employee?\"\n },\n {\n type:'input',\n name:'lastName',\n message:'What is the last name of the new employee',\n },\n {\n type:'list',\n name:'newRole',\n message: \"What is the new employee's role?\",\n choices: roleValues\n },\n\n ]).then(function (answer) {\n let query = `\n INSERT INTO employee SET ?`\n\n connection.query(query, \n {\n first_name: answer.firstName,\n last_name: answer.lastName,\n role_id: answer.newRole,\n },\n function(err, res){\n if (err) throw err;\n console.table(answer);\n console.log(\"Success! New employee added!\");\n runSearch()\n });\n });\n}", "title": "" }, { "docid": "ebd54fcc926d6c8e2066408b48b04614", "score": "0.66320556", "text": "function addDepartment() {\n inquirer\n .prompt([\n {\n name: \"newDept\",\n type: \"input\",\n message: \"What is the new department you would like to add?\"\n }\n ]).then(function (data) {\n connection.query(\n \"INSERT INTO department SET ?\",\n {\n department_name: data.newDept\n }\n );\n var query = \"SELECT * FROM department\";\n connection.query(query, function (err, res) {\n if (err) throw err;\n console.log(\"\");\n console.table(\"----- Your new Department has been added! ----\", res);\n console.log(\"\");\n startTracking();\n })\n })\n}", "title": "" }, { "docid": "db7b77650d23301b1ef639211c82df87", "score": "0.66308904", "text": "function promptEmployees () {\n inquirer\n .prompt([...employeeQuestions])\n .then((employeeResponses) => {\n\n if(employeeResponses.employeeRole === 'Engineer') {\n employee = new Engineer(employeeResponses.employeeName, employeeResponses.employeeID, employeeResponses.employeeEmail, employeeResponses.engineerGithub)\n employees.push(employee)\n } \n \n if(employeeResponses.employeeRole === 'Intern') {\n employee = new Intern(employeeResponses.employeeName, employeeResponses.employeeID, employeeResponses.employeeEmail, employeeResponses.internSchool)\n employees.push(employee)\n }\n \n if (employeeResponses.newEmployee) {\n promptEmployees ()\n } else {\n writeHTML ()\n }\n })\n}", "title": "" }, { "docid": "e5490972f8f55d131af3440e861e268c", "score": "0.66296256", "text": "async function addANewDept() {\n\t// (by function prompt 8) - get the response from the user for the new department name\n\tconst newDept = await prompts.newDeptNameSelection();\n\tconst result = newDept.newDeptName;\n\t// (by function index 12) - input the result response to the query and add the new department to the database\n\tawait db.addANewDept(result);\n\tconsole.log(`Department ${result} has been added into database`);\n\tinit();\n}", "title": "" }, { "docid": "3595d71cf3e8c93d7618eb380b193377", "score": "0.66293055", "text": "function managerPrompt() {\n inquirer.prompt([\n {\n type: 'text',\n name: 'managerName',\n message: 'What is the name of your manager?'\n },\n {\n type: 'text',\n name: 'managerID',\n message: \"What is your manager's ID number?\"\n },\n {\n type: 'text',\n name: 'managerEmail',\n message: \"What is your manager's email address?\"\n },\n {\n type: 'text',\n name: 'managerOfficeNumber',\n message: \"What is your manager's office number?\"\n }\n ])\n .then(function(answers) {\n const manager = new Manager(\n answers.managerName,\n answers.managerID,\n answers.managerEmail,\n answers.managerOfficeNumber)\n teamProfiles.push(manager);\n addEmployee();\n })\n}", "title": "" }, { "docid": "10b73d6d41902c2e1081ae8fe3fe42da", "score": "0.6629259", "text": "function add() {\n inquirer\n .prompt({\n name: \"add\",\n type: \"list\",\n message: \"What would you like to add to?\",\n choices: [\"Department\", \"Roles\", \"Employees\", \"Exit\"],\n })\n // just like in the start function a switch statement is used to lead the user to a new function depending on their choice\n .then(function (answer) {\n switch (answer.add) {\n case \"Department\":\n addDepartment();\n break;\n\n case \"Roles\":\n addRoles();\n break;\n\n case \"Employees\":\n addEmployee();\n break;\n\n case \"Exit\":\n connection.end();\n break;\n }\n });\n}", "title": "" } ]
5ef3c3a233054e1e905a3f80f1fa3692
Send the imported JSON questions from csv file Json data: the questions we want to import
[ { "docid": "e381ef88b50c750f8079c8b224cbf527", "score": "0.6490937", "text": "function importQuestions(questions) {\n server.post('question_import', { questions })\n .then(() => {\n enqueueSnackbar('Les questions ont bien été importées !',\n {\n anchorOrigin: {\n vertical: 'top',\n horizontal: 'center',\n },\n variant: 'success',\n });\n });\n }", "title": "" } ]
[ { "docid": "34e24108e437fe0463246981f0732758", "score": "0.6411437", "text": "function getQuestionsArrayFromJsonFile() {\n alert(\n \"Databasen verkar liggar nere så vi får nöja oss med dom frågor som finns sparat i front-enden.\"\n );\n fetch(\"/questions.json\")\n .then((resp) => resp.json())\n .then((data) => setQuestions(data));\n }", "title": "" }, { "docid": "8b545ef089314a0355e2686f049e9fad", "score": "0.5995126", "text": "function loadAnswers() {\n\tPromise.all([\n\t\td3.csv('src/data/answers.csv'),\n\t\t//d3.csv('src/data/responses.csv'),\n\t]).then(function(d) {\n\t\tparams.answers = d[0];\n\t\tpopulateBoxes();\n\t\t//params.responses = d[1];\n\t\t//plotResponses();\n\t})\n\t.catch(function(error){\n\t\tconsole.log('ERROR:', error)\n\t})\n}", "title": "" }, { "docid": "3a75a76e9e3d946352286bbbc4da4300", "score": "0.5885193", "text": "async function scrapeData() {\n const Questions = await scrapeQuestions();\n await createCsvFile(Questions);\n }", "title": "" }, { "docid": "6081e5be1443e3841e2c4ca7d21b9940", "score": "0.5852728", "text": "function loadQuestions() {\n var empty = \"[]\";\n readFile(\"questions.txt\", empty, function(err, data) {\n questions = JSON.parse(data)\n });\n}", "title": "" }, { "docid": "3be7487b9968d37e97930d609b28ff95", "score": "0.57961226", "text": "async function insertData(req, res) {\r\n try {\r\n const data = await csvtojson()\r\n .fromFile(\"src/test/data.csv\");\r\n console.log(\"csvData\", data)\r\n const answer = await product.insertMany(data);\r\n console.log('Done!');\r\n res.send(answer)\r\n process.exit();\r\n } catch (e) {\r\n console.log(e); z\r\n process.exit();\r\n }\r\n}", "title": "" }, { "docid": "ed080d4a82df4f90283b739a432da024", "score": "0.5795731", "text": "readFile(csv){\n\n\t\tvar file=fs.readFileSync(csv,\"utf-8\");\n\n\n\n\t\tvar list=this.csv_to_Json(file);\n\n\t\n // return json file;\n\n\t\treturn list;\n\n\n\n\t}", "title": "" }, { "docid": "3053aa4b1811e005d8dcaa22631be6b2", "score": "0.57487595", "text": "function importacionDeJson() {\r\n axios //Se obtiene los datos proveedores\r\n .get(\r\n \"https://gist.githubusercontent.com/josejbocanegra/d3b26f97573a823a9d0df4ec68fef45f/raw/66440575649e007a9770bcd480badcbbc6a41ba7/proveedores.json\"\r\n )\r\n .then((Response) => {\r\n let contenido = '>'\r\n let file = ''\r\n Response.data.forEach(element => {\r\n contenido+= `<tr>\r\n <th scope=\"row\">${element.idproveedor}</th>\r\n <td>${element.nombrecompania}</td>\r\n <td>${element.nombrecontacto}</td>\r\n </tr>`\r\n });\r\n contenido+='</'\r\n // Lee un archivo del sistema de archivos\r\n file = fs.readFileSync('lista_Proveedores.html', 'utf-8')\r\n const arr = file.split('tbody')\r\n arr[1]=contenido\r\n // Crea un archivo dentro del sistema de archivos\r\n fs.writeFile('lista_Proveedores.html', arr.join('tbody'), (err)=>{\r\n console.error(err)})\r\n \r\n \r\n });\r\n \r\n axios\r\n .get(\r\n \"https://gist.githubusercontent.com/josejbocanegra/986182ce2dd3e6246adcf960f9cda061/raw/f013c156f37c34117c0d4ba9779b15d427fb8dcd/clientes.json\"\r\n )\r\n .then((Response) => {\r\n let contenido= '>'\r\n let file = ''\r\n Response.data.forEach(element => {\r\n contenido+= `<tr>\r\n <th scope=\"row\">${element.idCliente}</th>\r\n <td>${element.NombreCompania}</td>\r\n <td>${element.NombreContacto}</td>\r\n </tr>`\r\n });\r\n contenido+='</'\r\n file = fs.readFileSync('lista_Clientes.html', 'utf-8')\r\n const arr = file.split('tbody')\r\n arr[1]=contenido\r\n fs.writeFile('lista_Clientes.html', arr.join('tbody'), (err)=>{console.error(err)})\r\n \r\n \r\n });\r\n }", "title": "" }, { "docid": "19fc293b2b64bbd33d2d34874adde530", "score": "0.5702642", "text": "function csvJSON(csv){\n\n var lines=csv.split(\"\\n\");\n\n var result = [];\n\n var headers=lines[0].split(\",\");\n\n for(var i=1;i<lines.length;i++){\n\n var obj = {};\n var currentline=lines[i].split(\",\");\n\n for(var j=0;j<headers.length;j++){\n obj[headers[j]] = currentline[j];\n }\n\n result.push(obj);\n updateLoading(result.length, lines.length);\n\n }\n\n\n //return result; //JavaScript object\n window.celestialData = result; //JSON\n}", "title": "" }, { "docid": "88e155f353076d5d98752ed4aa6d08c8", "score": "0.56634015", "text": "test(){\n var datas=fs.readFileSync(this.csv3,'utf-8')\n\n\nvar dat=this.csv_to_Json2(datas)\n \n }", "title": "" }, { "docid": "de9eb45b8a5ffdbee946d72b0f886911", "score": "0.5663164", "text": "function obtainQuestion() {\n\n var path;\n //for each trial, make the corresponding path to file and read the data\n for (var i = 0; i < csvData.length; i++) {\n if (csvData[i].show_question == \"si\" || csvData[i].show_question == null) {\n path = \"bayes_materiales/ppv_question/input/\" + csvData[i].problem_context + \"_question.txt\";\n //adds the process of reading the text to the list of process\n threads.push(readTextFile(path, questions, i));\n } else {\n questions[i] = \"\";\n }\n }\n}", "title": "" }, { "docid": "101fadecd8dd3daff8e251887958abce", "score": "0.564784", "text": "csvToArray(csv) {\n var finalArray = [];\n var finalWarnings = [];\n var data, dataToPush, warningsToPush;\n var line = csv.split(\"\\n\");\n var headers = line[1].split(\",\");\n if (headers[0] != \"CUSTOM.updateTime [local]\") {\n alert(\"Fichier non reconnu\");\n this.displayLoading = \"none\";\n this.buttonText = \"Importer des données\";\n return;\n }\n else {\n dataToPush = [headers[0], headers[2], headers[3], headers[4], headers[5], headers[20], headers[55], headers[72]];\n finalArray.push(dataToPush);\n for (let i = 2; i < line.length; i++) {\n data = (line[i].split(/,(?=(?:(?:[^\"]*\"){2})*[^\"]*$)/));\n if (data[175] != undefined && data[175].length > 1) {\n warningsToPush = [data[0], data[175]];\n finalWarnings.push(warningsToPush);\n }\n if (i % 10 == 2 || i == (line.length - 2)) {\n if (!data.includes(undefined)) {\n dataToPush = [data[0], data[2], data[3], data[4], data[5], data[20], data[55], data[72]];\n finalArray.push(dataToPush);\n }\n }\n }\n console.log(\"csvToArray done\");\n this.insertFlightToDatabase(finalArray, finalWarnings);\n }\n }", "title": "" }, { "docid": "78200d9893258f9d4de5553b99420147", "score": "0.5641586", "text": "function arrayafy(file) {\n var reader = new FileReader();\n reader.readAsText(file);\n reader.onload = function(event){\n var csv = event.target.result;\n var data = $.csv.toArray(csv);\n var html = '';\n var n = 0;\n for(var row in data) {\n html += '<tr><td>' + data[n] + '</td></tr>';\n n += 1;\n }\n $('#contents').html(html);\n $.post('/import', {emailarray: data}, function(res) {\n if(res.err) {console.log(\"Unable to save your response.\"); return false}\n else {\n // display success alert\n $('#main-container').append(\"<div class='alert alert-success'>\"+\n \"<button type='button' class='close' data-dismiss='alert'>&times;\"+\n \"</button><strong>Your file has been uploaded </strong></div>\");\n }\n })\n }\n\n }", "title": "" }, { "docid": "cd0713cf9010fb60cf4bf92ed46350df", "score": "0.5640624", "text": "async function converter() {\n\n let data = await CSVToJSON().fromFile('./source.csv');\n\n let newJson = addDataToArray(data, {\n sku: '12345',\n title: 'Legend Of Zelda',\n hardware: 'Nintendo Switch',\n price: '15.99'\n }); \n\n let newCsv = json2csv(newJson, { fields: [\"sku\", \"title\", \"hardware\", \"price\"] });\n\n writeToFile(newCsv, 'erikFile'); \n\n\n}", "title": "" }, { "docid": "26f28bf8fccbeb79fd67c6d7bd5d6f19", "score": "0.5616617", "text": "function getQuestions(){\n// Function used to get the questions[] from the library.json file\n fs.readFile(\"library.json\", \"utf8\", fileReader);\n // end fs.readFile()\n}//end getQuestions()", "title": "" }, { "docid": "64fdab1dc720ba43037934bca7b59604", "score": "0.55799073", "text": "function enviarCSVData(csvData, nombreClase, nombreMetodo){\n let id_departamento = $(\"#idCategoria\").val();\n $.ajax({\n url: \"../controlador/interprete.php\",\n type: \"POST\",\n datatype:\"json\", \n data: {clase:nombreClase, metodo:nombreMetodo, id_departamento:id_departamento, csvData:csvData}, \n success: function(response) {\n if(nombreClase == 'Docente'){\n listarTablaDocentesDepartamento.ajax.reload(null, false);\n }else {\n listarTablaAuxiliarDocenteDepartamento.ajax.reload(null, false);\n }\n }\n\n });\n\n}", "title": "" }, { "docid": "c28a32905928bf97a28eaae2455290a0", "score": "0.55765456", "text": "function loadQuestionJSONFile() {\n\t$.getJSON(\"data/de_Questions_AB2.json\", function( data ) {\n\t\tquestionList = data.Standardfragen_de.Frage;\n\t\t//alert(questionList.length);\n\t});\n}", "title": "" }, { "docid": "9d5d5d745ca38cee70cda97d350cad12", "score": "0.5526208", "text": "function addQuestion(category, qu, ans, authorID) \n{\n //Open the JSON file\n fs.readFile(questionsFile, 'utf8', function read(err, data){\n if(err) {\n console.log(err)\n } \n else {\n let qFile = JSON.parse(data); //Read file into a json object\n qFile.questions.push({ //Add question to the questions array\n cat: category,\n question: qu,\n answer: ans,\n author: authorID\n });\n let qOut = JSON.stringify(qFile, null, 4); //Rewrite the file\n fs.writeFile(questionsFile, qOut, function(err){console.log(err);});\n }\n });\n}", "title": "" }, { "docid": "77aee01b956407edfbe32d97890ce741", "score": "0.55260825", "text": "function json2csv() {\r\n const json2csvParser = new Json2csvParser({ fields });\r\n const csv = json2csvParser.parse(shirtData);\r\n console.log('do third')\r\n console.log(csv);\r\n console.log(allShirts);\r\n console.log(shirtData);\r\n}// end json2csv", "title": "" }, { "docid": "33ff2cd4cde01b76a775c7e5f77884ed", "score": "0.55224746", "text": "function loadQuestions (file) {\n\n\tlet questions = fs.readFileSync(file);\n\n\treturn JSON.parse(questions);\n\n}", "title": "" }, { "docid": "6303193ea3bfb3fa13e2567c00c14be1", "score": "0.5504713", "text": "function analyseCSV(){\n if (fileExtName === \"csv\"){\n setDelimiter()\n /*console.log(\"delimiter\")\n console.log(delimiter)*/\n splitCSV(fileContent)\n setAttributes(columns)\n setEntityClass(attributesNumeric_CSV,attributesNominal_CSV,rows,columns)\n setTags();\n setDatasetSource();\n setDSDatalake();\n setIngest();\n attributesNumeric_CSV = JSON.stringify(attributesNumeric_CSV).replace(/\\\"/g, \"\")\n attributesNumeric_CSV = JSON.stringify(attributesNumeric_CSV).replace(/\\:/g,\"\\:\\\"\").replace(/\\,/g,\"\\\"\\,\").replace(/\\}\\]/g,\"\\\"\\}\\]\").replace(/\\}\\\"\\,\\{/g,\"\\\"\\}\\,\\{\")\n attributesNumeric_CSV = attributesNumeric_CSV.replace(/^\\\"|\\\"$/g,'')\n\n attributesNominal_CSV = JSON.stringify(attributesNominal_CSV).replace(/\\\"/g, \"\")\n attributesNominal_CSV = JSON.stringify(attributesNominal_CSV).replace(/\\:/g,\"\\:\\\"\").replace(/\\,/g,\"\\\"\\,\").replace(/\\}\\]/g,\"\\\"\\}\\]\").replace(/\\}\\\"\\,\\{/g,\"\\\"\\}\\,\\{\")\n attributesNominal_CSV = attributesNominal_CSV.replace(/^\\\"|\\\"$/g,'')\n\n tags_CSV = JSON.stringify(tags_CSV).replace(/\\\"/g, \"\")\n tags_CSV = JSON.stringify(tags_CSV).replace(/\\:/g,\"\\:\\\"\").replace(/\\,/g,\"\\\"\\,\").replace(/\\}\\]/g,\"\\\"\\}\\]\").replace(/\\}\\\"\\,\\{/g,\"\\\"\\}\\,\\{\")\n tags_CSV = tags_CSV.replace(/^\\\"|\\\"$/g,'')\n\n console.log(\"---------\")\n console.log(fileContent)\n console.log(columns)\n console.log(rows)\n console.log(entityClass_CSV)\n console.log(attributesNumeric_CSV)\n console.log(attributesNominal_CSV)\n console.log(tags_CSV)\n console.log(\"---------\")\n }\n}", "title": "" }, { "docid": "868b63f693970bae76ce4098b8407734", "score": "0.5500654", "text": "import(inputfile) { \n this.validate();\n if(!file.exist(inputfile)) {\n print.danger(`${inputfile} not exist`);\n return process.exit();\n }\n const data = file.read(inputfile);\n data.map((d, i) => {\n this.client.post(this.url, d).then(\n (res) => {}, (err) => { print.danger(d, err) }\n );\n // if (i === data.length-1) {\n // print.success('File successfully imported');\n // }\n }); \n }", "title": "" }, { "docid": "7beb69c72c58af67118e19a6580f4e35", "score": "0.5457459", "text": "function structureCsv(n, data, question, callback) {\n\n var output = []; // the \"output\" variable contains the final data, for this iteration, to be written to the output CSV file\n var passages = data.passages;\n\n // \"passages\" will be undefined if:\n // 1. no docs have been uploaded to collection or\n // 2. there are no answers to the query\n if (passages != 'undefined') {\n try {\n for (var i = 0; i < passages.length; i++) {\n // Combine \"question\" with responses\n var element = Object.assign({}, passages[i], {\n \"question\": question\n });\n output.push(element);\n }\n callback(null, output);\n } catch (error) {\n console.log(error);\n callback(error);\n }\n } else {\n var message = 'the query did not return passages. Ensure you have ingested docs into your collection.';\n callback(message);\n }\n}", "title": "" }, { "docid": "56e87024d30f5477a88d8a967f43e027", "score": "0.54536927", "text": "function uploadToLimeade(csv) {\n const headers = csv[0].join(',');\n const url = 'https://calendarbuilder.dev.adurolife.com/limeade-upload/';\n\n const oneIncentiveEvent = csv[1].join(',');\n\n const params = {\n e: $('#employerName').val(),\n psk: psk,\n data: headers + '\\n' + oneIncentiveEvent,\n type: 'IncentiveEvents'\n };\n\n // Open Modal\n $('#uploadModal').modal('show');\n $('#uploadModalBody').html('<p>Uploading...</p>');\n\n $.post(url, params).done(function(response) {\n $('#uploadModalBody').append(`<p>${response}</p>`);\n console.log(response);\n });\n\n }", "title": "" }, { "docid": "0cfedca9789a94b640a4a82561fe30f9", "score": "0.54355097", "text": "function get(error, rows, files, newIndex) {\r\n\tif (error) {\r\n\t\tconsole.error(error);\r\n\t} else {\r\n\t\tfor (var i = 0; i < rows.length; i++) {\r\n\t\t\tvar country = rows[i].country;\r\n\t\t\tdelete rows[i].country;\t\t\t\r\n\t\t\t\r\n\t\t\tif (!countries[country]) countries[country] = {};\r\n \t\tif (!countries[country].hasOwnProperty('questions'))\r\n \t\t\tcountries[country].questions = [];\r\n \t\tcountries[country].questions.push(rows[i]);\r\n\t\t}\r\n\t\t\r\n\t\tloadCSV(files, newIndex);\r\n\t}\r\n}", "title": "" }, { "docid": "03d6dd133cc9c7d9149ac1deb5294d96", "score": "0.5433763", "text": "function getLocalQuestion(questions, category, type, difficulty, index) {\n var datafilename = \"data/\" + category + \"_\" + type + \"_\" + difficulty + \".json\";\n $.getJSON(datafilename)\n .done(function(data) {\n if(index < data.results.length) questions.results.push(data.results[index]);\n else {\n console.error(\"index(\"+index+\") overflow(\"+data.results.length+\") in file(\"+datafilename+\")\");\n questions.response_code = -1;\n }\n })\n .fail(function() {\n console.error(\"fail to get data file: \"+datafilename);\n questions.response_code = -2;\n });\n}", "title": "" }, { "docid": "6c26b626df65d16da7752c50319cbdd7", "score": "0.5424446", "text": "parse_questions(){\n\n\t\tvar questions = '{\"question: what is your name\" ,\"question: what is your name\" }'\n\n\t\tvar parsedjson = JSON.parse(questions);\n\t\tconsole.log(parsedjson.question);\n\t}", "title": "" }, { "docid": "b47908e382c66f241e35b18f0daa26f4", "score": "0.54093504", "text": "function uploadCSV(csvFile){\n let formData = new FormData();\n formData.append(\"uploadCSV\", csvFile);\n\n let request = new XMLHttpRequest();\n request.onload = function(){\n let response = JSON.parse(request.responseText);\n if(response['msg'] === 'OK'){\n displayPanel($('#editorTab'), $('#tagsPanel'), '85%', '60%');\n refreshTagsPanel(response);\n }else if(response['msg'] === 'UPDATE?'){\n sessionStorage.tempCSV = response['file'];\n displayAlert('editorTab', 'overwrite', 'This card game already exists ! Would you overwrite it ?', 'both');\n }else if(response['msg'] === 'UNAUTHORIZED'){\n displayAlert('editorTab', 'access', 'This cardgame already exists and you are not allowed to overwrite it !', 'confirm');\n }else{\n displayPanel($('#editorTab'), $('#editorTab .tabContent'), '90%', '40%');\n }\n };\n\n let query = \"/editor/importCardGame?author=\" + sessionStorage.pseudo +\n \"&name=\" + $('#importPage input[name=\"cardgameName\"]').val() +\n \"&language=\" + $('#importPage input[name=\"cardgameLanguage\"]').val();\n\n request.open(\"post\", query, true);\n request.send(formData);\n}", "title": "" }, { "docid": "ed94df612587e31db5d79ac8b6b8a2ea", "score": "0.53489774", "text": "function add_information(){\n var name = localStorage.getItem(\"name\");\n var info = localStorage.getItem(\"data\");\n\n $.ajax({\n url: \"http://localhost:8080/api/\"+localStorage.getItem(\"file\")+\"/lecturer/\"+name,\n datatype : 'json',\n type : \"post\",\n contentType : \"application/json\",\n data : info\n }).done(function(data) {\n\n var parsed = JSON.parse(data);\n var keys = Object.keys(parsed);\n for(var i in keys){\n if(keys[i] !== \"przedmioty\")\n add_row('#data_body', keys[i],parsed[keys[i]]);\n else {\n $(\"#subjects_h\").append(\"Przedmioty\");\n $(\"#thead_subjects\").append('<tr>\\n\" +\"<th scope=\\\"col\\\">Nazwa - Rodzaj - Stopień/Semestr</th>\\n\" +\"<th scope=\\\"col\\\">Ilość godzin</th>\\n\"+\"</tr>');\n\n przedmioty = parsed[keys[i]];\n keys_przedmioty = Object.keys(przedmioty);\n\n for (var i in keys_przedmioty) {\n add_row(\"#subjects\", keys_przedmioty[i], przedmioty[keys_przedmioty[i]]);\n }\n }\n }\n //alert(keys[0] + \", \"+keys[1]);\n //alert(parsed.PENSUM);\n //alert(parsed[keys[0]]);\n //alert(aktualny);\n\n }).fail(function(jqXHR, textStatus, errorThrown) {\n alert(\"Błąd\");\n });\n\n\n}", "title": "" }, { "docid": "31cec36c89d874b8a06f677d43e0ab6d", "score": "0.53385514", "text": "function importJSON() {\n //Imports data from JSON file the saved hints/picture. \n if (hintsJSON.prewritten !== undefined) {\n for (let i = 0; i < hintsJSON.prewritten.length; i++) {\n let listItem = document.createElement(\"li\");\n let element = document.getElementById(\"prewrittenList\");\n element.appendChild(listItem);\n\n let Xicon = document.createElement(\"i\");\n Xicon.setAttribute(\"id\", i);\n Xicon.setAttribute(\"onclick\", \"deleteHint(id)\");\n Xicon.classList.add(\"deleteHint\", \"edit\", \"fas\", \"fa-times\");\n listItem.appendChild(Xicon);\n\n let moveIcon = document.createElement(\"i\");\n moveIcon.classList.add(\"moveHint\", \"edit\", \"fas\", \"fa-arrows-alt\");\n listItem.appendChild(moveIcon);\n\n let div = document.createElement(\"div\");\n div.setAttribute(\"onclick\", \"preWrittenSelect(this)\");\n let node = document.createTextNode(hintsJSON.prewritten[i]);\n div.appendChild(node);\n listItem.appendChild(div);\n }\n }\n}", "title": "" }, { "docid": "46a02b6ebc460006b52eb2b6dd987ad5", "score": "0.53380865", "text": "function csvToJson(){\n const file = fs.createReadStream('courses.csv');\n\n return new Promise((resolve,reject) => {\n papa.parse(file,{\n header: true,\n complete: function (results){\n resolve(results.data)}\n });\n })\n}", "title": "" }, { "docid": "c0c2fab8d461eccb7ccfdfe4f1174e0a", "score": "0.53339136", "text": "function loadQuestions() {\n questions = []\n var request = new XMLHttpRequest()\n request.open('GET', 'https://opentdb.com/api.php?amount=10&category=11&type=multiple', true)\n request.onload = function () {\n var data = JSON.parse(this.response);\n console.log(data);\n data.results.forEach(question => {\n questions.push(question);\n });\n }\n request.send();\n}", "title": "" }, { "docid": "0a2aedbbc9ac639e4e1fd0c2d3cc7d93", "score": "0.53333604", "text": "function formatCSV_JSON(txt) { //Big function that does what it's called\n csvArray = splitcsv(txt);\n if (typeof(csvArray) == \"boolean\") {\n if (!csvArray && !csvTested) {\n alert('Archivo csv tiene malo formato')\n return false;\n } else {\n return true; //this case happens when file is already in JSON and client clicks on the format buttons again.\n }\n }\n\n var Jkeys = csvArray[0]; //recuperate json keys\n var index = 0; //reset\n var removeIndex = []; //reset\n var isIn = null;\n for (const key of Jkeys) {\n isIn = false;\n for (const vkey of validkeys) { //verify if the keys of input file are required\n if (vkey == key) {\n isIn = true;\n }\n }\n if (!isIn) { //add index of unwanted column keys from highest to lowest\n removeIndex.unshift(index)\n }\n index += 1;\n }\n for (k of removeIndex) {\n Jkeys.splice(k, 0); //remove from keys unwanted column keys but from highest to smallest so not to change indexation while removing\n for (let l = 0; l < csvArray.length; l++) { //remove from every array the values of unwanted columns\n csvArray[l].splice(k, 1);\n }\n }\n fileFullcsv(csvArray); //verify all the content values of Consumo Activa\n //here we start to format the input values in JSON \n csvCuarto = (csvArray[0].length == validkeys.length) //verify type of file by comparing file keys to all keys\n var jsonStrtot = '[';\n for (let i = 1; i < csvArray.length; i++) {\n if (csvArray[i].length == Jkeys.length) {\n var jsonStr = \"\";\n for (let j = 0; j < Jkeys.length; j++) {\n let ok = csvArray[i][j].replace(',', '.'); //this is due to iso-8859 csv format, may be removed if client uses american format\n if (Jkeys[j] == \"Fecha\") {\n jsonStr = jsonStr + '\"' + Jkeys[j] + '\"' + ': \"' + ok + '\"';\n } else {\n jsonStr = jsonStr + '\"' + Jkeys[j] + '\"' + \":\" + ok;\n }\n if (j < Jkeys.length - 1) {\n jsonStr = jsonStr + \", \"\n }\n }\n jsonStrtot = jsonStrtot + \"{\" + jsonStr + \"}\";\n if (i < csvArray.length - 1) {\n if (csvArray[i + 1].length > 2)\n jsonStrtot = jsonStrtot + \", \"\n }\n }\n }\n jsonStrtot = jsonStrtot + \"]\";\n //console.log(jsonStrtot)\n document.getElementById(\"csvtext_use\").innerHTML = jsonStrtot;\n return true;\n}", "title": "" }, { "docid": "575d066fa87f845e811f06a69539741d", "score": "0.53313434", "text": "function handleFile(err, data) {\n\n if (err) throw err\n obj = JSON.parse(csvJSON(data.toString()));\n\n if (prettyPrint == 1) {\n ppNL = '\\n';\n ppTB = '\\t';\n }\n\n /*Default Override*/\n for (var i = 0; i < obj.length; i++) {\n if (obj[i].Title == \"\")\n obj[i].Title = \"Name Unavailable\";\n }\n for (var i = 0; i < obj.length; i++) {\n //if (obj[i].ARTIST_NAME == \"\")\n obj[i].ARTIST_NAME = \"Artist Name Unavailable\";\n }\n for (var i = 0; i < obj.length; i++) {\n //if (obj[i].MEDIUM == \"\")\n obj[i].MEDIUM = \"Art Type Unavailable\";\n }\n for (var i = 0; i < obj.length; i++) {\n //if (obj[i].AT_A_GLANCE == \"\")\n obj[i].AT_A_GLANCE = \"Summary Unavailable\";\n }\n for (var i = 0; i < obj.length; i++) {\n //if (obj[i].DESCRIPTION == \"\")\n obj[i].DESCRIPTION = \"Description Unavailable\";\n }\n for (var i = 0; i < obj.length; i++) {\n if (obj[i].Address == \"\")\n obj[i].Address = \"Address Unavailable\";\n }\n\n /*Writing Loop*/\n var content = '[' + ppNL;\n for (var i = 0; i < obj.length; i++) {\n\n /*CSV Newline Fix*/\n if (obj[i].X == undefined) {\n while (content.slice(-1) == '\\n' || content.slice(-1) == ',') {\n content = content.slice(0, -1);\n }\n continue;\n }\n\n /*Write to out.json*/\n content += '{'\n + ppNL + ppTB + '\"type\": \"Feature\"'\n + ppNL + ppTB + ',\"geometry\": {'\n + ppNL + ppTB + ppTB + '\"type\": \"Point\"'\n + ppNL + ppTB + ppTB + ',\"coordinates\": ' + '[' + obj[i].Y + ', ' + obj[i].X + ']'\n + ppNL + ppTB + '}'\n + ppNL + ppTB + ',\"properties\": ';\n\n content += '{'\n + ppNL + ppTB + ppTB + '\"nm\": \"' + obj[i].Title + '\"'\n + ppNL + ppTB + ppTB + ',' + '\"aNm\": \"' + obj[i].ARTIST_NAME + '\"'\n + ppNL + ppTB + ppTB + ',' + '\"type\": \"' + obj[i].MEDIUM + '\"'\n + ppNL + ppTB + ppTB + ',' + '\"summ\": \"' + obj[i].AT_A_GLANCE + '\"'\n + ppNL + ppTB + ppTB + ',' + '\"desc\": \"' + obj[i].DESCRIPTION + '\"'\n + ppNL + ppTB + ppTB + ',' + '\"adr\": \"' + obj[i].Address + '\"'\n + ppNL + ppTB + '}'\n + ppNL + '}';\n\n if (i < obj.length - 1) {\n content += ppNL + ',';\n }\n }\n content += ppNL + ']';\n\n /*Save File*/\n fs.writeFile(outputPath, content, 'utf8', function (err) {\n if (err) {\n return console.log(err);\n }\n\n /*Print File Status*/\n console.log(\"The file was converted!\");\n });\n}", "title": "" }, { "docid": "1f2c1c7a361d422c8788371d8d0d4c22", "score": "0.53116775", "text": "function view_import_product() {\n var self = this;\n var user;\n if (self.session.user) {\n user = self.session.user;\n } else {\n self.redirect('login');\n return;\n }\n MODULE('flash').expire = '3 seconds';\n if (self.req.method === 'POST') {\n var Product = MODEL('product').schema;\n var importType = self.req.body.importType || '';\n var converter = new Converter();\n converter.on(\"end_parsed\", function (jsonArray) {\n var productArray = [];\n console.log(jsonArray);\n jsonArray.forEach(function (data) {\n var isValid = isCSVValid(data);\n console.log(isValid, data);\n if (isValid) {\n data._userId = user._id;\n productArray.push(data);\n }\n });\n if (productArray.length) {\n Product.create(productArray, function (err, result) {\n if (err) {\n self.flash('error', err);\n } else {\n index.addObjects(result, function (err, content) {\n console.log('error=' + err);\n });\n self.flash('success', 'File has been imported successfully.');\n }\n self.view('import_product');\n });\n } else {\n self.flash('error', 'Csv file is empty or invalid data.');\n self.view('import_product');\n }\n });\n if (importType === 'file') {\n if (self.files.length) {\n var file = self.files[0];\n if (file.type === 'application/vnd.ms-excel' || file.type === 'text/csv') {\n file.stream().pipe(converter);\n } else {\n self.flash('error', 'Invalid file type.Only csv file supported!');\n self.view('import_product');\n }\n } else {\n self.flash('error', 'Please select csv file/url.');\n self.view('import_product');\n }\n } else {\n var csvUrl = self.req.body.url || '';\n if (csvUrl) {\n request.get(csvUrl).pipe(converter);\n } else {\n self.flash('error', 'Please enter csv file url.');\n self.view('import_product');\n }\n }\n\n } else {\n self.view('import_product');\n }\n}", "title": "" }, { "docid": "92178124ee9c44e2e5235fccee098ecf", "score": "0.5301448", "text": "csvJSON(csv){\n \n var lines=csv.split(\"\\n\");\n \n var result = [];\n \n var headers=lines[0].split(\",\");\n \n for(var i=1;i<lines.length;i++){\n \n var obj = {};\n var currentline=lines[i].split(\",\");\n \n for(var j=0;j<headers.length;j++){\n obj[headers[j]] = currentline[j];\n }\n \n result.push(obj);\n \n }\n \n // return result; //JavaScript object\n return JSON.stringify(result); //JSON\n }", "title": "" }, { "docid": "b3c8829be7afc4f145b703f91ce6eac5", "score": "0.52971524", "text": "function csv(app) {\n\n app.post('/api/csv/parseTask', (req, res) =>{\n\n const form = new formidable.IncomingForm();\n\n // TODO: CHECK IF TEMP DATA EXISTS\n\n // Set this to indicate that you want to keep the original file extension\n form.keepExtensions = true;\n form.uploadDir = './tempData/';\n form.parse(req, (err, fields, files) =>{\n\n\n if (files && files['csv']){\n const file = files['csv'];\n const path = file.path;\n\n fs.readFile(path, 'utf-8', (err, data)=>{\n\n if (err) {\n res.writeHead(500, {'Content-Type' : 'text/plain'});\n res.write(`${file.name} is incorrectly formatted. Please make sure the .csv contains comma-separated values.\\n`);\n\n }\n else {\n parse(data, {relax_column_count: true},(err, out) =>{\n // flatten 2d array into 1d array\n items = [].concat.apply([], out);\n\n items = items.filter(n => n !== '' && n !== undefined);\n\n tasksFilteredForLength = items.filter(item => item.length < 50);\n const tasksRemoved = tasksFilteredForLength.length !== items.length;\n\n console.log(`Tasks Removed: ${tasksRemoved}`);\n if(items && items.length > 0){\n\n res.json({\n tasks : tasksFilteredForLength,\n tasksRemoved: tasksRemoved\n })\n\n }\n\n })\n\n }\n\n fs.unlink(path);\n })\n\n }\n\n\n\n });\n\n\n })\n\n app.post('/api/csv/parseEmail', (req, res) =>{\n\n response = res;\n getFormData(req, readCSV);\n })\n\n app.post('/api/csv/costMatrix' , (req, res) => {\n\n const form = new formidable.IncomingForm();\n\n form.keepExtensions = true;\n form.uploadDir = './tempData/';\n\n form.parse(req, (err, fields, files) => {\n if (files && files['csv']){\n const file = files['csv'];\n const path = file.path;\n \n fs.readFile(path, 'utf-8', (err, data)=>{\n \n if (err) {\n return null;\n \n }\n else {\n \n \n parse(data,(err, out) =>{\n // flatten 2d array into 1d array\n const response = out.map(row => row.map(col => parseInt(col,10)));\n res.json(response);\n \n });\n \n // Delete temp file\n fs.unlink(path, (err) => {\n if (err) {\n console.error(err);\n }\n })\n }\n \n \n })\n }\n })\n \n \n })\n\n}", "title": "" }, { "docid": "e6c0c0dc8cd0cb03f6ded0e29c594ebe", "score": "0.52950805", "text": "function csvProcessor() {\n\n /*Passing file name to csvProcessor*/\n var inputs = fs.createReadStream(fileName[0]);\n rlMain = readline.createInterface({\n input: inputs\n });\n\n /*Check if file exists*/\n rlMain.on('line', function(line) {\n index = 0;\n temp = line.split(\",\");\n /*Selecting the first line*/\n if (temp[0] == \"countryName\") {\n title = temp;\n index = 1;\n }\n /*JSON for India - Arable land (% of land area)*/\n if (temp !== '' && index === 0) {\n /*Criteria to opulating Agewise data*/\n if (temp[0] == \"India\" && temp[2] == \"Arable land (% of land area)\") {\n for (i = 4; i <= 59; i++) {\n if (temp[i] !== '' && indiaPercentLand[title[i]] === undefined) {\n years = title[i];\n indiaPercentLand[years] = {\n year: years,\n percent: parseFloat(temp[i])\n };\n }\n }\n }\n /*JSON for India - Arable land (hectares per person)*/\n if (temp[0] == \"India\" && temp[2] == \"Arable land (hectares per person)\") {\n for (i = 4; i <= 59; i++) {\n if (temp[i] !== '' && indiaHectPerPerson[title[i]] === undefined) {\n years = title[i];\n indiaHectPerPerson[years] = {\n year: years,\n percent: parseFloat(temp[i])\n };\n }\n }\n }\n /*JSON for India - Arable land (hectares)*/\n if (temp[0] == \"India\" && temp[2] == \"Arable land (hectares)\") {\n for (i = 4; i <= 59; i++) {\n if (temp[i] !== '' && indiaHectares[title[i]] === undefined) {\n years = title[i];\n indiaHectares[years] = {\n year: years,\n total: parseFloat(temp[i])\n };\n }\n }\n }\n /*JSON for Africa - Arable land (% of land area)*/\n if (country[temp[0]] == \"Africa\" && temp[2] == \"Arable land (% of land area)\") {\n if (temp[54] !== '' && title[54] == \"2010\") {\n var tempCountry = temp[0];\n africaPercentLand[tempCountry] = {\n countryName: tempCountry,\n total: parseFloat(temp[54])\n };\n }\n }\n /*JSON for Continent-Wise : Arable land (hectares)*/\n if (temp[2] == \"Arable land (hectares)\") {\n var tempContinent = country[temp[0]];\n for (i = 4; i <= 59; i++) {\n years = title[i];\n if (temp[i] !== '' && tempContinent !== undefined) {\n if (continentHectares[years]) {\n var record = continentHectares[years];\n var value = record[tempContinent] || 0;\n record[tempContinent] = value + parseFloat(temp[i]);\n } else {\n var object = {};\n object.year = years;\n object[tempContinent] = parseFloat(temp[i]);\n continentHectares[years] = object;\n }\n }\n }\n }\n }\n });\n\n /*Writing into the JSON files*/\n rlMain.on('close', function() {\n fs.writeFile('../../Feed/continentHectares.json', JSON.stringify(values(continentHectares),null,'\\t'));\n fs.writeFile('../../Feed/africaPercentLand.json', JSON.stringify(values(africaPercentLand),null,'\\t'));\n fs.writeFile('../../Feed/indiaPercentLand.json', JSON.stringify(values(indiaPercentLand),null,'\\t'));\n fs.writeFile('../../Feed/indiaHectPerPerson.json', JSON.stringify(values(indiaHectPerPerson),null,'\\t'));\n fs.writeFile('../../Feed/indiaHectares.json', JSON.stringify(values(indiaHectares),null,'\\t'));\n });\n}", "title": "" }, { "docid": "96650e7c62e980cf46ef939ebfb03aa9", "score": "0.52858716", "text": "function readJSON(data) {\n // console.log(data);\n\n // here we filter the questions from the array\n // and we make an array that divides the\n // questions by their order: intro|mid|outro\n questions = {};\n for (const term of order) {\n questions[term] = data.filter(result => {\n // console.log(result.order, term);\n if (result.order === term) {\n return result\n }\n })\n }\n // console.log(questions);\n question_sequence = make_question_sequence(questions);\n // console.log(question_sequence);\n // set first button\n const btn = document.createElement('div');\n btn.innerText = '👻🏁⁉️';\n btn.setAttribute('class', 'btn')\n btn.setAttribute('id', 'remove-me');\n btn.addEventListener('click', init);\n const qst = document.getElementById('question');\n qst.insertBefore(btn, qst.firstChild);\n // next_question();\n // make_question_sequence(questions)\n}", "title": "" }, { "docid": "7d7b5165d7754082848a650be630f47c", "score": "0.5272137", "text": "function LoadSkillsDatabase(evt) {\n skillsJSON = null;\n var file = evt.target.files[0];\n var reader = new FileReader();\n reader.readAsText(file);\n\n reader.onload = function (event) {\n var csvData = event.target.result;\n\n skillsJSON = Papa.parse(csvData, {\n header: true,\n });\n\n skillsJSON = JSON.parse(JSON.stringify(skillsJSON.meta.fields));\n\n skillsJSON.forEach((element) => {});\n };\n} //closes LoadSkillsDatabase method", "title": "" }, { "docid": "85cd806fa2426382e2f199c311a89b67", "score": "0.5269057", "text": "function getdata(){\n\n\t\t//Get the csv file into a variable\n\n\t\tload=getme(\"Playgrounds.csv\");\n\n\t\t\n\n\t\t//Check sucess\n\n\t\tif (load != null){\n\n\t\t\t//Failed run convert on the few hardcoded CSVs.\n\n\t\t\tconvert(load);\n\n\t\t}else{\n\n\t\t\t//Sucess run convert on the .CSV's contents.\n\n\t\t\tconvert(hardcode);\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "ecbb2b27d63a933a39469e7b4b008ece", "score": "0.52685046", "text": "function readCSV(){\n $.ajax({\n url: \"data/Yelp.csv\",\n async: false,\n success: function (csv) {\n csvdata = $.csv.toObjects(csv,{\"separator\":\"|\"});\n },\n dataType: \"text\",\n complete: function () {\n // Call a function on complete\n setMarkers(csvdata);\n }\n });\n}", "title": "" }, { "docid": "2d5f15afaabf3997aece8208f36bef5b", "score": "0.5245047", "text": "async _readCsv(req, res) {\n try {\n\n // return res.send ({message: \"This Api End point deprecated. Only used once to insert data in database\"})\n \n await csvOps.ReadCsv();\n __.successMsg(res, 200, '', \"Data imported from Csv successfully\");\n\n\n } catch (error) {\n __.errorMsg(res, 500, 'Internal server error', error); \n };\n }", "title": "" }, { "docid": "c4657c9572e4066e217feadef815461e", "score": "0.5241026", "text": "function importCsvData2MongoDB(file) {\n csv()\n .fromFile(filepath + file)\n .then((jsonObj) => {\n var today = new Date(); \n jsonObj.forEach(function (elem) {\n elem.import_date = today;\n })\n\n // Insert Json-Object to MongoDB\n mongodb.connect(url, { useNewUrlParser: true }, (err, db) => {\n if (err) throw err;\n var dbo = db.db(mongo_config.db);\n dbo.collection(mongo_config.collection).insertMany(jsonObj, (err, res) => {\n if (err) throw err;\n console.log(\"Number of documents inserted: \" + res.insertedCount);\n db.close();\n });\n });\n\n fs.unlinkSync(filepath + file);\n })\n}", "title": "" }, { "docid": "c1d4becec616c2612662419cfbb11141", "score": "0.52317786", "text": "async function main() {\n /**\n * closure functions which get CSV file and return function witch replace start text (\"phrase\") by new phrase.\n * The new phrase should contain data from a CSV file if the start text has coincident parts.\n * If it isn't function should return the start text\n * @param {*} csv - file\n * @returns result see decrpiption below\n */\n function csvMode(csv) {\n const cities = csv\n .split(\"\\n\")\n .filter((s) => s.trim() != \"\" && !s.startsWith(\"#\"))\n .map((arr) => {\n let s = arr.split(\",\");\n return [s[2], +s[3]];\n })\n .sort((a, b) => b[1] - a[1])\n .slice(0, 10);\n /**\n * function - replace city in start text by CSV data\n */\n return (startText) => {\n const result = startText.split(\" \").map((word) => {\n const index = cities.findIndex((item) => item[0] == word);\n\n if (index != -1) {\n return `${cities[index][0]} (${\n index + 1\n } место в ТОП-10 самых крупных городов Украины, население ${\n cities[index][1]\n } человек)`;\n } else {\n return word;\n }\n });\n return result.join(\" \");\n };\n }\n\n try {\n const answer = await question(\"Введите свою фразу: \");\n const phrase = answer || \"Київ\";\n const file = fs.readFileSync(\"./tests/cities.csv\", \"utf8\"); //read file\n console.log(csvMode(file)(phrase)); //modify CSV data and get result\n } catch (err) {\n console.error(err);\n }\n}", "title": "" }, { "docid": "4de03c30b3e174a87da6b3bbc37fefa5", "score": "0.5225917", "text": "function csvToJson(csv) {\n var data = csv.split('\\n')\n .map(function(line) {\n return line.trim().split(',');\n });\n var keys = data[0];\n var data = data.slice(1);\n\n var json = {};\n keys.forEach(function(key, index) {\n json[key] = data.map(function(row) {\n return row[index];\n });\n });\n\n json['Gram_Staining'] = json['Gram_Staining'].map(function(val) {\n return val === 'positive';\n });\n ['Neomycin', 'Penicilin', 'Streptomycin'].forEach(function(key) {\n json[key] = json[key].map(function(val) {\n return Number(val);\n });\n });\n\n return json;\n }", "title": "" }, { "docid": "927fc4239acd7937f932703594635f2b", "score": "0.5221258", "text": "function csvJSON(csvName) {\n fs.rename(__dirname + '/public/uploads/' + csvName, __dirname + '/public/csv/budgetdata.csv');\n\n}", "title": "" }, { "docid": "0807f47335916813512a53e51c18dea7", "score": "0.52206653", "text": "function parser() {\n csv()\n .fromFile(csvFilePath)\n .then(jsonObj => {\n async function addNew() {\n // console.log(jsonObj[1]);\n for (const row of jsonObj) {\n geoDataParse.features.forEach(e => {\n if (row.GEO === e.properties.GEO_ID) {\n e.properties.freshPer = parseFloat(row.freshPer);\n }\n });\n }\n }\n async function write() {\n fs.writeFileSync(\n \"revisedcounties2.geo.json\",\n JSON.stringify(geoDataParse)\n );\n console.log(\"*** *** *** *** ***\");\n }\n addNew().then(write());\n });\n}", "title": "" }, { "docid": "7794830510ba90d38344e91bea4822ac", "score": "0.5203199", "text": "function parseCSV() {\n Papa.parse(\n 'https://pkgstore.datahub.io/core/country-list/data_csv/data/d7c9d7cfb42cb69f4422dec222dbbaa8/data_csv.csv',\n {\n download: true,\n delimiter: ',',\n newline: '',\n skipEmptyLines: true,\n header: true,\n complete: function (results) {\n const countryCodes = results.data.reduce(function (obj, value) {\n obj[value.Code] = value.Name;\n return obj;\n }, {});\n cityCountry.textContent = `${weatherData.city}, ${\n countryCodes[weatherData.country]\n }`;\n },\n },\n );\n}", "title": "" }, { "docid": "fd912b96fb3d3298429b1a9e7da6dc79", "score": "0.5193895", "text": "function csvJSON(csv){\n \n var lines=csv.split(\"\\n\");\n \n result = [];\n \n user_database={};\n \n var headers=lines[0].split(\",\");\n \n for(var i=1;i<lines.length;i++){\n \n var obj = {};\n \n var currentline=lines[i].split(\",\");\n \n for(var j=0;j<headers.length;j++){\n \n obj[headers[j]] = currentline[j];\n \n if(j===0){\n \n var cust_id = currentline[j];\n \n }\n }\n result.push(obj);\n \n user_database[cust_id] = obj;\n \n }\n \n //return result; //JavaScript object\n return JSON.stringify(result); //JSON\n \n }", "title": "" }, { "docid": "b11879b68787dfacebdfc0c75f25d636", "score": "0.5178233", "text": "function preparsecsv(csv) {\n var obj = {}\n var arr = csv.split(\",\")\n obj.queue = arr.shift()\n obj.name = arr.shift()\n obj.timestamp = arr.shift()\n var rest = arr.join(\",\") // rest of message varies...\n obj.payload = stripquotes(rest)\n return obj\n}", "title": "" }, { "docid": "2681d9f61b7f591e0b5e577476c99208", "score": "0.5165749", "text": "async function readCSV(csvPath,data) {\n let rslt = [];\n const strm = fs.createReadStream(csvPath).pipe(csv());\n for await (const chunk of strm) {\n\tlet ticker = chunk[\"Ticker\"];\n\tlet aclass = chunk[\"Class\"];\n\tlet year = chunk[\"Start Year\"];\n\tlet fees = chunk[\"Fees\"];\n\tlet pri = chunk[\"Pri\"];\n\tif (data.classes[aclass] == undefined) {\n\t\tdata.classes[aclass] = [ticker];\n\t} else {\n\t\tdata.classes[aclass].push(ticker);\n\t}\n data.tickers[ticker] = {\n firstYear: year,\n fees: fees,\n pri: pri\n };\n }\n}", "title": "" }, { "docid": "10ebed6e776fb10d8a0a5700b16accf0", "score": "0.51621825", "text": "function getJSON() {\n let raspored = [];\n let niz1;\n if (!fs.existsSync('public/raspored.csv')) {\n return null;\n }\n let x = fs.readFileSync('public/raspored.csv');\n let datoteka = x.toString();\n niz1 = datoteka.split(\"\\n\");\n for (let i = 0; i < niz1.length; i++) {\n var data = niz1[i].split(\",\");\n var niz2 = { naziv: data[0], aktivnost: data[1], dan: data[2], pocetak: data[3], kraj: data[4] };\n raspored.push(niz2);\n }\n return raspored;\n}", "title": "" }, { "docid": "c6c9549a7494ce2ddd663d107c3268c3", "score": "0.5159499", "text": "function submit() {\n finished = true;\n let csvContent = \"data:text/csv;charset=utf-8,\"\n + data.map(e => e.join(\",\")).join(\"\\n\");\n let encodedUri = encodeURI(csvContent);\n let link = document.createElement(\"a\");\n link.setAttribute(\"href\", encodedUri);\n link.setAttribute(\"download\", \"stubs-data-\"+dateTime+\".csv\");\n document.body.appendChild(link); // Required for FF\n link.click(); // This will download the data file named \"my_data.csv\".\n}", "title": "" }, { "docid": "c95e79ce27208d590058fa2f3b26bcb2", "score": "0.5158795", "text": "function csvJSON(csv) {\n let lines = csv.split(\",\\n\")\n let result = []\n let headers = lines[0].split(\",\")\n for (let i = 1; i < lines.length; i++) {\n let obj = {}\n let currentline = lines[i].split(\",\")\n for (let j = 0; j < headers.length; j++) {\n obj[headers[j]] = currentline[j]\n }\n result.push(obj)\n }\n //return result; //JavaScript object\n return result //JSON\n}", "title": "" }, { "docid": "4bf11a54586c32b5005658f6eb5237c9", "score": "0.51585704", "text": "function uploadData() {\n // First serialize questions\n var data = {'questions': {}};\n for (var key in primaryQuestions) {\n data['questions'][key] = primaryQuestions[key]['response'];\n }\n data['bodyparts'] = bodyData;\n \n return $http.post('/api/survey/' + surveyId, data)\n .then(postComplete)\n .catch(function(message) {\n $log.error(message);\n throw message;\n });\n\n function postComplete(data, status, headers, config) {\n return data.data;\n }\n }", "title": "" }, { "docid": "f7d6b62b4ad263848d07b63db7063c78", "score": "0.51582736", "text": "async function validateAndImportData(jsonData) {\n switch (jsonData.versionNumber) {\n case '1.7':\n // Version 1.7 - User data and title filter\n wordFilter = jsonData.wordFilter;\n case '1.6':\n default:\n // Version 1.6 - User data only\n $.each(jsonData.userList, function(user, filters) {\n // Validate each user and filter\n $.each(filters, function(type, value) {\n if (value != 0 && value != 1) {\n throw \"Invalid value.\";\n }\n });\n userArray[user] = {\n 'subs': filters.subs,\n 'shouts': filters.shouts,\n 'coms': filters.coms,\n 'notifications': filters.notifications\n }\n });\n }\n}", "title": "" }, { "docid": "d63ef3d68924f4d8b4dfa223bb1930a3", "score": "0.5145972", "text": "function generateRequestCSV(num) {\r\n fs.readFile(inputCSV, function (err, out) {\r\n if (err) throw err;\r\n outTemp = out;\r\n parse(outTemp, { comment: '#' }, function (err, out) {\r\n //Set double \"for\" loop to automatically \"POST\" the whole CSV file\r\n for (let i = startLine; i <= maxLineTCX /* out.length-1 or maxLineTCX*/; i++) {\r\n setTimeout(function cb() {\r\n // TCX (More detailed and more rows than GPX)\r\n var dataStreamAussentemp = {\r\n \"phenomenonTime\": out[i][0],\r\n \"resultTime\": out[i][0],\r\n \"result\": out[i][1],\r\n \"Datastream\": { \"@iot.id\": 1 }\r\n }\r\n var dataStreamAulaTableau = {\r\n \"phenomenonTime\": out[i][0],\r\n \"resultTime\": out[i][0],\r\n \"result\": out[i][2],\r\n \"Datastream\": { \"@iot.id\": 2 }\r\n }\r\n var dataStreamAulaRTunten = {\r\n \"phenomenonTime\": out[i][0],\r\n \"resultTime\": out[i][0],\r\n \"result\": out[i][3],\r\n \"Datastream\": { \"@iot.id\": 3 }\r\n }\r\n var dataStreamAulaRToben = {\r\n \"phenomenonTime\": out[i][0],\r\n \"resultTime\": out[i][0],\r\n \"result\": out[i][4],\r\n \"Datastream\": { \"@iot.id\": 4 }\r\n }\r\n if (execute) {\r\n // Uncomment to Execute\r\n console.log('executing')\r\n postSTA(dataStreamAussentemp, i,'AussenTemp'); //DS:1\r\n postSTA(dataStreamAulaTableau, i,'AulaTableau'); //DS:2\r\n postSTA(dataStreamAulaRTunten, i,'AulaRTunten'); //DS:3\r\n postSTA(dataStreamAulaRToben, i,'AulaRToben'); //DS:4\r\n } else {\r\n //console.log(`dataStreamAussentemp [${i}] :` + JSON.stringify(dataStreamAussentemp));\r\n //console.log(`dataStreamAulaTableau [${i}] :` + JSON.stringify(dataStreamAulaTableau));\r\n //console.log(`dataStreamAulaRTunten [${i}] :` + JSON.stringify(dataStreamAulaRTunten));\r\n //console.log(`dataStreamAulaRToben [${i}] :` + JSON.stringify(dataStreamAulaRToben));\r\n //console.log('---------------------------------------------------lenght:')\r\n }\r\n }, 50 * (i - 0));\r\n }\r\n });\r\n });\r\n}", "title": "" }, { "docid": "bdad14fce02ba3b1330d3739d76866ee", "score": "0.514444", "text": "onDrop(files) {\n this.setState({ files });\n\n var file = files[0];\n\n const reader = new FileReader();\n reader.onload = () => {\n csv.parse(reader.result, (err, data) => {\n\n var userList = [];\n\n const firstUser = {\"Name\": data[1][0], \"Gender\": data[1][1], \"Ethnicity\": data[1][2], \"Region\": data[1][3], \"University\": data[1][4], \"Year\": data[1][5],\n \"PreviousMentor\": data[1][6], \"Car\": data[1][7], \"Languages\": data[1][8], \"ShirtSize\": data[1][9],\n \"MultipleDays\": data[1][10], \"Monday\": this.splitString(data[1][11]), \"Tuesday\": this.splitString(data[1][12]), \"Wednesday\": this.splitString(data[1][13]), \n \"Thursday\": this.splitString(data[1][14]), \"Friday\": this.splitString(data[1][15]),\n \"Program\": [\"WebJam\"], \"New\": true};\n\n userList.push(firstUser);\n\n fetch('https://apurva29.pythonanywhere.com/uploadinstructors', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n \n },\n body: JSON.stringify(firstUser)\n })\n\n for (var i = 2; i < data.length; i++) {\n const name = data[i][0];\n const gender = data[i][1];\n const ethnicity = data[i][2];\n const region = data[i][3];\n const university = data[i][4];\n const year = data[i][5];\n const returner = data[i][6];\n const car = data[i][7];\n const languages = data[i][8];\n const shirtsize = data[i][9];\n const multipledays = data[i][10];\n const Monday = data[i][11];\n const Tuesday = data[i][12];\n const Wednesday = data[i][13];\n const Thursday = data[i][14];\n const Friday = data[i][15];\n const newUser = {\"Name\": name, \"Gender\": gender, \"Ethnicity\": ethnicity, \"Region\": region, \"University\": university, \"Year\": year,\n \"PreviousMentor\": returner, \"Car\": car, \"Languages\": languages, \"ShirtSize\": shirtsize,\n \"MultipleDays\": multipledays, \"Monday\": this.splitString(Monday), \"Tuesday\": this.splitString(Tuesday), \"Wednesday\": this.splitString(Wednesday), \n \"Thursday\": this.splitString(Thursday), \"Friday\": this.splitString(Friday),\n \"Program\": [\"WebJam\"], \"New\": false};\n userList.push(newUser);\n\n fetch('https://apurva29.pythonanywhere.com/uploadinstructors', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n\n },\n body: JSON.stringify(newUser)\n })\n };\n });\n };\n\n reader.readAsBinaryString(file);\n }", "title": "" }, { "docid": "df839b9ec934ff159678c25ef2e50f45", "score": "0.51436853", "text": "handleImportCSVFileToRulesTable() {\n //import csv file data to rule table\n console.log('clicked on impoer button');\n this.fileReader = new FileReader();\n this.fileReader.readAsText(this.csvFiles);\n this.fileReader.onload = () => {\n this.fileContents = this.fileReader.result;\n this.fileContents = this.fileContents.split(\"\\r\\n\");\n console.log('splitted rows r and n are:'+ JSON.stringify(this.fileContents));\n let fileLength = this.fileContents.length - 1;\n let rows = [];\n let isValidFile = true;\n for (let i = 1; i < fileLength; i++) {\n let row = this.fileContents[i].split(\",\");\n let chipId = this.chipOptions.filter(chip => chip.label === row[0]);\n if (chipId[0] !== undefined) {\n let obj = {\n Id: null,\n TO_FTRF_Chip__c: chipId[0].value,\n DRC_Deck_Rule_Name__c: row[1],\n Comment_Reason_for_Waiver_Request__c: row[2]\n };\n rows.push(obj);\n } else if (chipId[0] === undefined) {\n isValidFile = false;\n }\n }\n console.log('isValidFile? '+isValidFile);\n console.log(\n \"extracted rows from imported csv file are:\" + JSON.stringify(rows)\n );\n\n if (isValidFile) {\n //delete existing deck rules from object\n if( this.drcRequestRules){\n console.log('this.drcRequestRules'+ this.drcRequestRules);\n // this.drcRequestRules.forEach(rule => this.deleteRecords(rule.Id));\n }\n \n //clear existing deck rules\n this.drcRequestRules = [];\n this.drcRequestRules = rows;\n this.importCSVModal = false;\n this.showImportCSVFileError = false;\n //Success toast message prams:title,variant,message\n let successMsg = this.fieldLabels.ImportCSV_File.Success_message__c;\n this.showToast(\"Success\", \"success\", successMsg);\n } else {\n this.importCSVModal = true;\n this.showImportCSVFileError = true;\n }\n console.log(\n \"drcRequestRules are:\" + JSON.stringify(this.drcRequestRules)\n );\n };\n }", "title": "" }, { "docid": "e67e89b2390e3381c737d38c6489c248", "score": "0.51422447", "text": "function upload(e) {\n var file = e.target.files[0];\n var reader = new FileReader();\n if (file) {\n reader.readAsText(file);\n reader.onload = function(e) {\n var csv = e.target.result;\n var data = Papa.parse(csv, {header : true, encoding: \"utf-8\", preview: 10});\n \n console.log(data.meta.fields);\n \n };\n }\n}", "title": "" }, { "docid": "cf43c23d1faafe15e8e157cf9b2017dd", "score": "0.51377285", "text": "function importJSONFile() {\n \n // 0. Initialization\n selected = 0;\n hidePropertiesViewAndEdit();\n \n // Import the file content as text\n loadFileContent();\n \n // Update the tables\n imported = true; // State that importation is attempted by the user\n updateApplicationTable(); \n addTableRowHandler();\n \n\n }", "title": "" }, { "docid": "81cfc98d1692188fc8997f67c1e13ac3", "score": "0.51341087", "text": "async function createCsvFile(data) {\n let csv = new ObjectsToCsv(data);\n \n // Save to file:\n await csv.toDisk(\"./questions.csv\");\n }", "title": "" }, { "docid": "ccf0354c58f8047065e24ccda842e73c", "score": "0.5125082", "text": "function extract_data(data)\n{\n var i;\n console.log(data);\n for (i = 0; i < question_length; i++) {\n quest.push(data.results[i].question);\n options.push(data.results[i].incorrect_answers[0]);\n options.push(data.results[i].correct_answer);\n options.push(data.results[i].incorrect_answers[2]);\n options.push(data.results[i].incorrect_answers[1]);\n correct_ans.push(data.results[i].correct_answer);\n prepareQuiz(quest, options, correct_ans, i);\n }\n\n}", "title": "" }, { "docid": "1257a3b6110c69270f609c7e59b125f8", "score": "0.51167303", "text": "function parseData(csv) {\n let data = [];\n for (let i = 1; i < csv.length; i++) {\n if (csv[i][3] !== undefined) {\n data.push({\n date: new Date(csv[i][0]),\n description: csv[i][1],\n original_description: csv[i][2],\n amount: csv[i][3] * (csv[i][4] === 'debit' ? -1 : 1),\n category: csv[i][5],\n account_name: csv[i][6],\n labels: csv[i][7],\n notes: csv[i][8]\n });\n }\n }\n return data;\n}", "title": "" }, { "docid": "284b43e5d104601a9c07a1038720f503", "score": "0.5111206", "text": "function createTrial() { //accordig to response\n\n var temp = \"\";\n\n\n for (i = 0; i < csvData.length; i++) {\n\n //create trial with the intro to the question\n var introToTrial = {\n type: 'instructions',\n pages: ['Pregunta ' + (i + 1)],\n show_clickable_nav: true\n }\n\n if (csvData[i].response_type == \"probabilities_qualitative\") { //create the trial of type \"gi\"\n //parse the responses and converts them to a list that jsPsych understands\n if (temp == \"\") {\n var temp = responses[i].split(/\\s\\s+/);\n for (j = 0; j < (temp.length / 2) - 1; j++) {\n temp[j] += \"<br>\" + temp[j + Math.floor(temp.length / 2)]\n }\n temp = temp.splice(0, (temp.length / 2));\n }\n\n var typeTrial = {\n type: \"survey-multi-choice\",\n data: {\n trialid: csvData[i].ID,\n trial_detail: csvData[i].response_type\n },\n questions: [{\n prompt: prompts[i],\n options: temp,\n required: true,\n horizontal: true\n }],\n on_finish: function(data) {\n console.log(\"QL\");\n }\n }\n\n } else if (csvData[i].response_type == \"sequential_guided\" || csvData[i].response_type == \"distributive\" || csvData[i].response_type == \"sequential_simple\" || csvData[i].response_type == \"chances\") {\n\n var typeTrial = {\n type: \"fill-in-blanks\",\n preamble: prompts[i],\n data: {\n trialid: csvData[i].ID,\n trial_detail: csvData[i].response_type\n },\n fill_in_type: \"number\",\n fill_in_text: responses[i]\n }\n } else if (csvData[i].response_type == \"probabilities_slider\") {\n\n var tempo = responses[i].split(\"\\n\");\n\n var typeTrial = {\n type: 'html-slider-response',\n data: {\n trialid: csvData[i].ID,\n trial_detail: csvData[i].response_type\n },\n stimulus: prompts[i] + \"<br>\" + tempo[0],\n required: true,\n labels: [tempo[1], tempo[2]],\n };\n } else if (csvData[i].response_type == \"relative_frequencies\" || csvData[i].response_type == \"relative_chances\") {\n\n var tempo = responses[i].split(\"\\n\");\n\n var typeTrial = {\n type: \"survey-multi-choiceOG\",\n data: {\n trialid: csvData[i].ID,\n trial_detail: csvData[i].response_type\n },\n questions: [{\n prompt: prompts[i] + \"<br>\" + tempo[0],\n options: [tempo[1], tempo[2]],\n required: true,\n horizontal: false\n }]\n }\n } else if (csvData[i].response_type == \"natural_frequencies\") {\n\n var typeTrial = {\n type: \"fill-in-blanksINC\",\n preamble: prompts[i],\n data: {\n trialid: csvData[i].ID,\n trial_detail: csvData[i].response_type\n },\n fill_in_type: \"number\",\n fill_in_text: responses[i],\n on_start: function(data) {\n console.log(responses);\n }\n }\n } else if (csvData[i].response_type == \"probabilities_quantitative\") {\n\n var typeTrial = {\n type: \"fill-in-blanks\",\n preamble: prompts[i],\n data: {\n trialid: csvData[i].ID,\n trial_detail: csvData[i].response_type\n },\n fill_in_type: \"number\",\n fill_in_text: responses[i],\n high_limit: 100,\n low_limit: 0\n }\n }\n\n typeTrial.data = Object.assign(typeTrial.data, csvData[i]);\n\n var temp_time = [introToTrial, typeTrial];\n\n if (csvData[i].relative_question != null && csvData[i].relative_question != \"\") {\n\n var tempo = relatives[i].split(\"\\n\");\n\n var opt_rel = {\n type: \"survey-multi-choiceOG\",\n data: {\n trialid: csvData[i].ID,\n trial_detail: csvData[i].relative_question\n },\n questions: [{\n prompt: tempo[0],\n options: [tempo[1], tempo[2]],\n required: true,\n horizontal: false\n }]\n }\n\n temp_time.push(opt_rel);\n }\n if (csvData[i].pregunta_seguridad == \"si\" || (csvData[i].pregunta_seguridad == null && askSure)) {\n survey_sure.data = {\n trialid: csvData[i].ID,\n trial_detail: \"seguridad\"\n };\n temp_time.push(survey_sure);\n }\n if (csvData[i].pregunta_dificultad == \"si\" || (csvData[i].pregunta_dificultad == null && askDifficulty)) {\n survey_difficult.data = {\n trialid: csvData[i].ID,\n trial_detail: \"dificultad\"\n };\n\n temp_time.push(survey_difficult);\n }\n\n createFollows(i, temp_time);\n //create a temporal timeline with the intro trial and the question trials\n //and append the temporal timeline to the definitive timeline\n var new_timeline = {\n timeline: temp_time\n }\n\n jsPsych.pauseExperiment();\n jsPsych.addNodeToEndOfTimeline(new_timeline, jsPsych.resumeExperiment)\n\n }\n}", "title": "" }, { "docid": "c0b138848574a19b1918def8e7db9070", "score": "0.5109313", "text": "function CSV2JSON(){\n/*Arrays que vão guardar infos importantes*/\n var json= [] //Array que vai guardar o texto final\n var identificadores = [] //Guarda os nomes dos campos\n \n/*Variáveis que recebem informações dos textos*/\n var texto=$('#original').val().trim() //Recebe o texto a ser transformado\n var tam = texto.length //Pega o tamanho do texto que será usado para percorrer\n \n var i=0 //contador para cada char da lista\n \n/*Array que é usada para separar palavras dentro de cada linha*/\n var palavra= []\n \n/*Define os identificadores usados no JSON*/\n while(texto[i]!=\"\\n\"){\n if(texto[i]!=\",\"){\n palavra.push(texto[i]) \n }else{\n identificadores.push(palavra.join(''))\n palavra=[]\n }\n i++\n }\n identificadores.push(palavra.join(''))\n palavra=[]\n i++\n \n /*Loop que verifica todas as char do texto*/\n while(i<tam){\n var aux=[]\n /*Separa as palavras da linha*/\n while(texto[i]!=\"\\n\" && i<tam){\n if(texto[i]!=\",\"){\n palavra.push(texto[i]) \n }else{\n aux.push(padronizaPalavra(palavra.join('')))\n palavra=[]\n }\n i++\n }\n aux.push(padronizaPalavra(palavra.join('')))\n palavra=[]\n var aux2 =[]\n /* Junta para cada elemento do json*/\n aux2.push('{')\n var string=\"\"\n for(var j=0; j<aux.length; j++){\n string += identificadores[j] + ':' + aux[j] + ','\n }\n string = string.split('')\n string.pop()\n aux2.push(string.join('')+'}')\n json.push(aux2.join(''))\n i++\n } \n \n /*Parte que faz o print no text Area Final*/\n string='['\n for(i=0;i<json.length;i++){\n string+=json[i]\n if(i!=json.length-1){\n string+=','\n }\n string+='\\n'\n }\n string+=']'\n $('#final').val(string)\n}", "title": "" }, { "docid": "b24cdf5d0fde6a893ba9bb2e117021a8", "score": "0.5102056", "text": "function importData() {\n const fileReader = new FileReader();\n fileReader.onload = function() {\n const data = JSON.parse(this.result);\n const sites = [].concat(...data.sessions.map(session => session.sites.map(site => site.uuid)))\n loadStorage('sessions')\n .then(sessions => sessions.concat(data.sessions).sort((a, b) => (a.start < b.start ? -1 : 1)))\n .then(sessions => saveStorage({ sessions }))\n .then(() => Promise.all(sites.map(site => saveStorage({ [site]: data[site] }))))\n .then(() => {\n window.location.reload();\n });\n };\n fileReader.readAsText(importInp.files[0]);\n}", "title": "" }, { "docid": "c762064068a6189cd6fbde2b1768f4c2", "score": "0.51009715", "text": "function parseSubgoalArray(){\n var userInput= getSubgoalArrayFromLocal();\n var entry = []; //corresponds to a single row in the csv\n var entries = [];\n\n for (var j in userInput) {\n var currI = userInput[j]; //Current Input\n\n entry = [sanitizeString(currI.name),\n sanitizeString(currI.why),\n currI.ynm[\"yes\"],\n currI.ynm[\"no\"],\n currI.ynm[\"maybe\"],\n currI.facetValues[\"motiv\"],\n currI.facetValues[\"info\"],\n currI.facetValues[\"selfE\"],\n currI.facetValues[\"risk\"],\n currI.facetValues[\"tinker\"],\n ];\n for(var i in currI.actions){\n //get new line and to the right part of csv\n entry.push(\"\\n, , , , , , , , ,\");\n\n //pre action question\n //console.log(\"action name\", currI.actions[i].preAction.why, currI.actions[i].postAction.why)\n entry.push(currI.actions[i].name);\n entry.push(sanitizeString(currI.actions[i].preAction.why));\n entry.push(currI.actions[i].preAction.ynm[\"yes\"]);\n entry.push(currI.actions[i].preAction.ynm[\"no\"]);\n entry.push(currI.actions[i].preAction.ynm[\"maybe\"]);\n entry.push(currI.actions[i].preAction.facetValues[\"motiv\"]);\n entry.push(currI.actions[i].preAction.facetValues[\"info\"]);\n entry.push(currI.actions[i].preAction.facetValues[\"self\"]);\n entry.push(currI.actions[i].preAction.facetValues[\"risk\"]);\n entry.push(currI.actions[i].preAction.facetValues[\"tinker\"]);\n\n //post action question\n entry.push(sanitizeString(currI.actions[i].postAction.why));\n entry.push(currI.actions[i].postAction.ynm[\"yes\"]);\n entry.push(currI.actions[i].postAction.ynm[\"no\"]);\n entry.push(currI.actions[i].postAction.ynm[\"maybe\"]);\n entry.push(currI.actions[i].postAction.facetValues[\"motiv\"]);\n entry.push(currI.actions[i].postAction.facetValues[\"info\"]);\n entry.push(currI.actions[i].postAction.facetValues[\"self\"]);\n entry.push(currI.actions[i].postAction.facetValues[\"risk\"]);\n entry.push(currI.actions[i].postAction.facetValues[\"tinker\"]);\n\n //url currently is about 4X as long as longest cell allowed in excel, so instead just downloading image as part of zip\n //entry.push('\\\"' +currI.actions[i].imgURL+'\\\"');\n\n var newName = currI.actions[i].name;\n if(currI.actions[i].name[0] == \"\\\"\"){\n newName = currI.actions[i].name.slice(1)\n }\n if(currI.actions[i].name[currI.actions[i].name.length-1] == \"\\\"\"){\n newName = newName.slice(0, newName.length-1)\n }\n\n downloadURI(currI.actions[i].imgURL, \"S\"+(1 + parseInt(j))+\"A\"+(1 + parseInt(i))+\"_\"+newName);\n }\n\n if (entry.length != 0) {\n entries.push(entry);\n }\n }\n return entries;\n}", "title": "" }, { "docid": "8640bb4c2b3c2047d58a97034220245f", "score": "0.50972986", "text": "function readPlain () {\r\n\tconst data=fs.readFileSync(\"input.csv\", \"utf-8\", function(err){console.log(err);});\r\n\tconst userFields = [\"id\", \"first_name\", \"last_name\",\"email\", \"gender\",\"ip_address\",\"color\",\"parentId\"];\r\n \tusers = data.split('\\n').slice(1).filter(Boolean).map(user=>{\r\n\t\tconst userParts =user.split(',');\r\n\t\tconst parts= userParts.map((part, index)=>({[userFields[index]]:part}));\r\n\t\treturn Object.assign({},...parts);\r\n\t});\t\r\n}", "title": "" }, { "docid": "f2d41387c5d4d2d05d745490f4c0162f", "score": "0.5082275", "text": "function loadData() {\n d3.dsv(',','data/languages_education_work.csv').then((dataLoaded) => {\n dataReasons = dataLoaded; \n drawGraph();\n });\n }", "title": "" }, { "docid": "fc1d5fa54660477b71e57a3c27107a71", "score": "0.5070498", "text": "function csvJSON(csv) {\n\n /*Remove Quotations & Commas(Commented out since homebrew dataset)*/\n /*var inQuote = 0;\n for (var i = 0; i < csv.length; i++) {\n if (csv[i] == '\\\"') {\n csv = csv.slice(0, i) + csv.slice(i + 1, csv.length);\n inQuote = inQuote * -1 + 1;\n i--;\n continue;\n }\n if (csv[i] == ',' && inQuote == 1) {\n csv = csv.slice(0, i) + csv.slice(i + 1, csv.length);\n i--;\n continue;\n }\n if (i < csv.length - 1 && inQuote == 0 && csv[i] == ',' && csv[i + 1] == ' ') {\n csv = csv.slice(0, i + 1) + csv.slice(i + 2, csv.length);\n i--;\n continue;\n }\n }*/\n\n /*Split into Array*/\n var lines = csv.split('\\n');\n var result = [];\n var headers = lines[0].split(',');\n\n /*Parse CSV to JSON*/\n for(var i = 1;i < lines.length; i++) {\n\t var obj = {};\n\t var currentline = lines[i].split(',');\n\t for(var j = 0;j < headers.length; j++) {\n\t\t obj[headers[j]] = currentline[j];\n\t }\n\t result.push(obj);\n }\n\n return JSON.stringify(result);\n}", "title": "" }, { "docid": "17f31be0dfc4b8b637c055c0b4f2c86d", "score": "0.5064314", "text": "function uploadCSV(csvFile){\n\n var formData = new FormData();\n formData.append(\"uploadCSV\", csvFile);\n\n var request = new XMLHttpRequest();\n\n request.onload = function(){\n\n var regex = /\\.csv$/;\n if(request.responseText == 'OK'){\n $('#importAlertMessage').text(\"import successful\");\n }else if(request.responseText != null && regex.test(request.responseText)){\n\n var updateCardGame = confirm(\"This card game already exists !\\nWould you overwrite it ?\");\n\n $.ajax({\n type: 'POST',\n url: '/updateCardGame',\n data: {\n update: updateCardGame ? \"yes\" : \"no\",\n csv: request.responseText\n },\n error: function(){\n $('#importAlertMessage').text(\"Request failed\");\n },\n success: function(response){\n if(response == 'OK'){\n $('#importAlertMessage').text(\"Import successful\");\n }else if(response == 'NO UPDATE'){\n $('#importAlertMessage').text(\"Data has not been updated\");\n }else{\n $('#importAlertMessage').text(\"Request failed\");\n }\n }\n });\n }else{\n $('#importAlertMessage').text(\"import has failed\");\n }\n }\n\n request.open(\"post\", \"/importCardGame\", true);\n request.send(formData);\n}", "title": "" }, { "docid": "a2a7fdc60ed2196124b4b9fdc2cb1e63", "score": "0.50572926", "text": "async function loadCSVHawkerData() {\n let response = await axios.get('data/dates-of-hawker-centres-closure.csv');\n let json = await csv().fromString(response.data);\n return json;\n}", "title": "" }, { "docid": "4c89d1882fdfa919d07d66ffd177be0a", "score": "0.5055176", "text": "function parseCSV () {\n\tvar csv = Assets.getText('room-temperatures.csv');\n\tvar secondIteration = false;\n\tvar rows = Papa.parse(csv, {\n\t\theader:true,\n\t\tskipEmptyLines:true,\n\t\tcomplete: function(results) {\n\t\t\tif (secondIteration) { return; }\n\t\t\telse { \n\t\t\t\tsecondIteration = true;\n\t\t\t\tinsertTSDP(results.data);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "e2ac9e14a7f415b7f7000c47f8b16ab0", "score": "0.5037018", "text": "function csvJSON(csv){\n var lines=csv.split(\"\\n\");\n var result = [];\n user_database={};\n var headers=lines[0].split(\",\");\n for(var i=1;i<lines.length;i++){\n var obj = {};\n var currentline=lines[i].split(\",\");\n for(var j=0;j<headers.length;j++){\n obj[headers[j]] = currentline[j];\n if(j===0){\n var cust_id = currentline[j];\n }\n }\n result.push(obj);\n user_database[cust_id] = obj;\n }\n //return result; //JavaScript object\n return JSON.stringify(result); //JSON\n }", "title": "" }, { "docid": "351433681a1ec909c54a4c9353b8cc5c", "score": "0.5025387", "text": "jsonToCSV(data) {\n var csvData = [];\n //Header\n if (this.title != null) {\n csvData.push(this.parseExtraData(this.title, \"${data}\\r\\n\"));\n }\n //Fields\n for (let key in data[0]) {\n csvData.push(key);\n csvData.push(\",\");\n }\n csvData.pop();\n csvData.push(\"\\r\\n\");\n //Data\n data.map(function(item) {\n for (let key in item) {\n let escapedCSV = '=\\\"' + item[key] + '\\\"'; // cast Numbers to string\n if (escapedCSV.match(/[,\"\\n]/)) {\n escapedCSV = '\"' + escapedCSV.replace(/\\\"/g, '\"\"') + '\"';\n }\n csvData.push(escapedCSV);\n csvData.push(\",\");\n }\n csvData.pop();\n csvData.push(\"\\r\\n\");\n });\n //Footer\n if (this.footer != null) {\n csvData.push(this.parseExtraData(this.footer, \"${data}\\r\\n\"));\n }\n return csvData.join(\"\");\n }", "title": "" }, { "docid": "12dad05d413c7b1010f660aa291f8d61", "score": "0.5017314", "text": "function loadQuestions() {\n\n\t\tfor ( var i=0; i < myQs.length; i++ ) {\n\t\t\tquestionArr.push( new Question( myQs[i].q, myQs[i].a, myQs[i].correctA ) );\n\t\t}\n\t\t//console.log(questionArr);\n\t}", "title": "" }, { "docid": "b0be7888a0acac319722aad087c7f116", "score": "0.49990642", "text": "function per(sourceCsv) {\n fileName=sourceCsv;\n $.get(\"data/\"+sourceCsv, function (data) {\n parser(data);\n });\n}", "title": "" }, { "docid": "ffdd32668fb5ab28eb286a0320e44146", "score": "0.499768", "text": "function importCSVData(docName){\n var data = [];\n var dataFile = new File(app.activeDocument.path + '/' + docName);\n dataFile.open('r');\n dataFile.readln(); // Skip first line\n while (!dataFile.eof) {\n var dataFileLine = dataFile.readln();\n\n var dataFilePieces = dataFileLine.split(';'); // change delimitor accordingly to your language\n data.push({\n name: dataFilePieces[0],\n description: dataFilePieces[1]\n });\n }\n dataFile.close();\n return data;\n}", "title": "" }, { "docid": "defd0b917d606f120e8feff683642b36", "score": "0.49847603", "text": "function loadQ() {\n var req = new XMLHttpRequest();\n req.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n var response = JSON.parse(this.responseText);\n document.getElementById(\"root\").innerHTML = response[0].question;\n }\n }\n req.open(\"GET\", \"data/08-03-2019.json\", true);\n req.send();\n}", "title": "" }, { "docid": "bb1fe263d83c403ccb9564ebdf98d9da", "score": "0.49823752", "text": "function setupData(){\n rawRecordsArray = csv.split('\\n');\n headerString = rawRecordsArray[0];\n //get recordsArray without header\n for(var i=1; i<rawRecordsArray.length; i++){\n recordsArray.push(rawRecordsArray[i])\n }\n //create titlesArray\n titlesArray = headerString.split(',');\n }", "title": "" }, { "docid": "c7ad44b40bba1f57d492d8be007977eb", "score": "0.49711424", "text": "function CSV2JSON(csv) { \n //convert csv format to array format \n var array = CSVToArray(csv)\n ,keyWord = [\n ['min','Min','min.','Min.','MIN','minimum','Minimum','MINIMUM','tmin','tMin','Tmin','TMin','TMIN','mintemp',\n 'minTemp','Mintemp','MinTemp','minimumtemp','minimumTemp','Minimumtemp','MinimumTemp',\n 'mintemperature','minTemperature','Mintemperature','MinTemperature','minimumtemperature',\n 'minimumTemperature','Minimumtemperature','MinimumTemperature'],\n ['max','Max','max.','Max.','MAX','maximum','Maximum','MAXIMUM','tmax','tMax','Tmax','TMax','TMAX','maxtemp',\n 'maxTemp','Maxtemp','MaxTemp','maximumtemp','maximumTemp','Maximumtemp','MaximumTemp',\n 'maxtemperature','maxTemperature','Maxtemperature','MaxTemperature','maximumtemperature',\n 'maximumTemperature','Maximumtemperature','MaximumTemperature'],\n ['Percipitation','percipitation','Ppt','ppt'],\n ['Date','date','Time','time']\n ]\n ,originalHeader = ['min_temp','max_temp','ppt','time']\n ,headerKey =[]\n ,heads=array[0];\n for (var headIterator = 0; headIterator < heads.length; headIterator++) { \n var key = heads[headIterator];\n tmp:for(var keyWordIterator = 0;keyWordIterator< keyWord.length;keyWordIterator++){\n for(var keyWordSubIterator = 0; keyWordSubIterator< keyWord[keyWordIterator].length; keyWordSubIterator++){\n if(key.indexOf(keyWord[keyWordIterator][keyWordSubIterator]) !== -1){\n headerKey[headIterator]=originalHeader[keyWordIterator];\n break tmp;\n };\n }\n }\n };\n var json=_.map(array,function(array_item,array_index){\n if(array_index!==0)\n return _.object(headerKey, array_item);\n }); \n return _.rest(json);\n }", "title": "" }, { "docid": "0041c86209fcdaed2d66995831731d98", "score": "0.49701855", "text": "function csvJSON(csv, fieldsToSelect){\n\n var lines=csv.split(\"\\n\");\n var result = [];\n var headers=lines[0].split(\",\");\n // Find location of required headers. -1 indicates data doesn't contain the header\n var indexesToSelect = fieldsToSelect.map(field => {\n return( headers.indexOf(field) );\n })\n for(var i=1; i<lines.length; i++){\n var obj = {};\n var currentline=lines[i].split(\",\");\n for(var j=0;j<headers.length;j++){\n if(indexesToSelect.includes(j))\n obj[headers[j]] = currentline[j];\n }\n // Add a unix date to the date from the date field\n // Only push data to the result set if it has a valid date.\n var datePosition = headers.indexOf('date');\n if (datePosition!=-1) {\n const date = currentline[datePosition];\n if (date!=\"\") {\n obj[\"unixDate\"] = new Date(date).getTime()/1000;\n result.push(obj);\n }\n }\n }\n return(result); //JSON\n}", "title": "" }, { "docid": "d43f1c14d7970c5aff54d3f571f9617d", "score": "0.49594685", "text": "function setup(jsonData){\n jsonData.forEach(ele => {renderQuestion(ele)});\n\n}", "title": "" }, { "docid": "bc16ec600db86b37abf1547f9ce7d347", "score": "0.49583578", "text": "function csvJSONAllFields(csv){\n\n var lines=csv.split(\"\\n\");\n var result = [];\n var headers=lines[0].split(\",\");\n for(var i=1; i<lines.length; i++){\n var obj = {};\n var currentline=lines[i].split(\",\");\n for(var j=0;j<headers.length;j++){\n obj[headers[j]] = currentline[j];\n }\n // Add a unix date to the date from the date field\n // Only push data to the result set if it has a valid date.\n var datePosition = headers.indexOf('date');\n if (datePosition!=-1) {\n const date = currentline[datePosition];\n if (date!=\"\") {\n obj[\"unixDate\"] = new Date(date).getTime()/1000;\n result.push(obj);\n }\n }\n }\n return(result); //JSON\n}", "title": "" }, { "docid": "c84a4e5acda7a277b05f7ad3eafa251c", "score": "0.49472648", "text": "function exportPoll(pollId) {\n const selectedPoll = polls.filter((x) => x.pollId === pollId)[0];\n\n //\tconsole.log(selectedPoll);\n //\tvar dataE = selectedPoll.questions;\n //\tvar exportAnswer = selectedPoll.answers;\n //\tconsole.log(dataE);\n const csvArray = [];\n //csvArray.push({question: \"Nombre de la pregunta\", answer: \"respuesta de la pregunta\"});\n selectedPoll.questions.map((questionInPoll) => {\n questionInPoll.answers.map((answerInQuestion) => {\n csvArray.push({\n INSIGHT: selectedPoll.pollName,\n PREGUNTA: questionInPoll.question,\n RESPUESTA: answerInQuestion.answer,\n });\n });\n });\n const items = csvArray;\n const replacer = (key, value) => (value === null ? \"\" : value); // specify how you want to handle null values here\n const header = Object.keys(items[0]);\n let csv = items.map((row) =>\n header\n .map((fieldName) => JSON.stringify(row[fieldName], replacer))\n .join(\",\")\n );\n csv.unshift(header.join(\",\"));\n csv = csv.join(\"\\r\\n\");\n\n //console.log(csv);\n // nombre del archivo\n fileName = selectedPoll.pollName + \".csv\";\n //console.log(fileName);\n\n // exportar archivo\n\n var hiddenElement = document.createElement(\"a\");\n hiddenElement.href =\n \"data:text/csv;charset=UTF-8,\" + \"\\uFEFF\" + encodeURI(csv);\n //hiddenElement.href = 'data:text/csv;charset=ANSI,' + encodeURI(csv);\n hiddenElement.target = \"_blank\";\n hiddenElement.download = fileName;\n hiddenElement.click();\n}", "title": "" }, { "docid": "6a3556690ce6abc6f1b4f51e1bf776f8", "score": "0.49383906", "text": "function generateQuiz(textdata,quiz){\n \n var quizList = JSON.parse(\"[\"+textdata.replace(/\\'/g,\"\\\"\")+\"]\");\n \n for(var key in quizList){\n sendQuestion(quizList[key],quiz);\n }\n}", "title": "" }, { "docid": "634c4d3f4a4eec3fa765087488c81824", "score": "0.49360162", "text": "async function languages() {\n await csv()\n .fromFile(language_url)\n .then((jsonObj) => {\n\n //array for holding all supported languages\n let language = [];\n\n for (i in jsonObj) {\n language.push(`${jsonObj[i].ISO6391code} \\n`);\n }\n console.log(boxen(chalk.green(language.join('')),\n { padding: 1, margin: '5,0,0,0', borderStyle: 'single', borderColor: 'green', backgroundColor: 'black', align: 'left' }));\n return 0;\n });\n}", "title": "" }, { "docid": "f2ba67af3de92a4818806fb95392f6a8", "score": "0.49358964", "text": "function csvJSON(csv){\n var lines=csv.split(\"\\n\");\n\n var result = [];\n\n var headers=lines[0].split(\",\");\n\n for(var i=1;i<lines.length;i++){\n\n\t var obj = {};\n\t var currentline=lines[i].split(\",\");\n\n\t for(var j=0;j<headers.length;j++){\n\t\t obj[headers[j]] = currentline[j];\n\t };\n\n\t result.push(obj);\n\n ;}\n\n //return result; //JavaScript object\n displayTimetable(result); //JSON\n}", "title": "" }, { "docid": "846e4228e57d8a4f63e1b73881c317b9", "score": "0.49334225", "text": "function parseFile(data) {\n let qs = data.split('\\n\\n');\n let result = {};\n for(let q of qs) {\n let qParsed = parseQuestion(q)\n result[qParsed['question']] = {'answers':qParsed['answers'],'correctAnswer':qParsed['correctAnswer']};\n }\n return result;\n}", "title": "" }, { "docid": "2fd0cafe4f128c8f3154cc7df8f269c5", "score": "0.49330541", "text": "async function getCsv(){\n const jsonArray = await csv().fromString(csvFilePath);\n this.setState({\n jsonArray: jsonArray,\n });\n }", "title": "" }, { "docid": "c1b491b80f2df4a5028185b42ee4973d", "score": "0.49318796", "text": "function csvJSON(csv) {\n var lines = csv.split(\"\\n\");\n\n var result = [];\n\n var headers = lines[0].split(\",\");\n\n for (var i = 1; i < lines.length; i++) {\n var obj = {};\n var currentline = lines[i].split(\",\");\n\n for (var j = 0; j < headers.length; j++) {\n obj[headers[j]] = currentline[j];\n }\n\n result.push(obj);\n }\n\n //return result; //JavaScript object\n return JSON.stringify(result); //JSON\n}", "title": "" }, { "docid": "b8e8a20d9e6f998c35f97ffc46c2e9df", "score": "0.4931742", "text": "function importQuestStatus(req, res) {\n console.log('importing')\n // console.log(req.query)\n // call get GoogleID to get the reference\n // google_user = user.findOne( {google_id: req.google_id})\n\n // user_type = usertype.find( {user_id: google_user._id})\n\n user.findOne({ google_id: req.query.google_id }, (err, user_doc) => {\n if (err || !user_doc) {\n console.log(\"No user found with getUser.\")\n res.json(JSON.stringify({ exists: false }))\n }\n else {\n classroom.findOne({ classroom_id: '311516886961' }, async (err, classdoc) => {\n if (user_doc.classes.filter(e => e.classroom_id === '311516886961').length > 0) {\n // // if it already exists\n console.log('classroom already added')\n }\n else {\n user_doc.classes.push({\n classroom_id: '311516886961',\n balance: 0,\n quests: []\n })\n }\n var index = user_doc.classes.findIndex(x => x.classroom_id == '311516886961')\n classdoc.quests.forEach(element => {\n if (user_doc.classes[index].quests.filter(e => e._id === element.id).length > 0) {\n // if it already exists\n console.log('quest already added')\n }\n else {\n console.log('adding quest')\n user_doc.classes[index].quests.push({\n _id: element.id,\n completed: false\n })\n }\n });\n await user_doc.save()\n // console.log(user_doc.completed_quests)\n res.json(user_doc.classes[index])\n })\n }\n\n })\n}", "title": "" }, { "docid": "5383534c0b055826a5c27ad9e631f5fb", "score": "0.49291894", "text": "function csvtojson(csv) {\n var lines = csv.split(\"\\n\");\n var result = [];\n\n var headers = lines[0].split(\",\");\n\n for (var i = 1; i < lines.length; i++) {\n var obj = {};\n var currentline = lines[i].split(\",\");\n\n for (var j = 0; j < headers.length; j++) {\n obj[headers[j]] = currentline[j];\n }\n\n result.push(obj);\n }\n\n return result; //JSON\n }", "title": "" }, { "docid": "c266b446bf174099edfbf9f95e0ef24e", "score": "0.49267176", "text": "function csvJSON(csv, asObject) {\n\n var lines = csv.split(\"\\n\");\n var result = [];\n var headers = lines[0].split(\",\");\n\n for (var i = 1; i < lines.length; i++) {\n var obj = {};\n var currentline = lines[i].split(\",\");\n for (var j = 0; j < headers.length; j++) {\n obj[headers[j]] = currentline[j];\n }\n result.push(obj);\n }\n\n if (asObject) {\n return result; //JavaScript object\n } else {\n return JSON.stringify(result); //JSON\n }\n\n }", "title": "" }, { "docid": "75e06656188b18d5200d46b05fa7d983", "score": "0.4926396", "text": "function parseCSV(csvFile) {\n if (csvFile.type !== 'application/vnd.ms-excel') {\n alert(\"Please use a CSV file\")\n return\n }\n var reader = new FileReader();\n reader.onload = function (fileData) {\n var ous = fileData.target.result.split(', ')\n ous.forEach(function (ou) {\n ou.split('\\n').forEach(function (ou) {\n courseInputElement.val(courseInputElement.val() + ou + \"\\n\")\n })\n })\n }\n reader.readAsText(csvFile, \"UTF-8\")\n}", "title": "" }, { "docid": "e38721f2da76c11f90605c7465dd9d1a", "score": "0.49262384", "text": "function readFile() {\n var rawFile = new XMLHttpRequest();\n //rawFile.overrideMimeType(\"application/json\");\n //rawFile.open('GET', \"./todoData.json\", true);\n rawFile.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == \"200\") {\n //Seccessfully load the JSON file, now parse the file into arrays\n var jsonData = JSON.parse(this.responseText);\n //Manipulate data loaded from the json file\n inputJson(jsonData);\n //return tbalelist;\n }\n };\n \n rawFile.open('GET', \"https://api.myjson.com/bins/d5p9u\", true);\n rawFile.send();\n}", "title": "" }, { "docid": "1abc483082398af57b857629d5ee5802", "score": "0.49253154", "text": "function csvJSON(csv) {\n\n\tvar lines = csv.split(\"\\n\");\n\tvar result = [];\n\tvar headers = lines[0].split(\",\");\n\n\tfor (var i = 1; i < lines.length-1; i++) {\n\t\tvar obj = {};\n\t\tvar currentline = lines[i].split(\",\");\n\n\t\tfor (var j = 0; j < headers.length; j++) {\n\t\t\tobj[headers[j]] = currentline[j];\n\t\t}\n\n\t\tresult.push(obj);\n\t}\n\n\treturn result; //JavaScript object\n\t//return JSON.stringify(result); //JSON\n}", "title": "" }, { "docid": "4fb28c43d15c5839260c8d6a4e8e2377", "score": "0.49240884", "text": "function prepareData () {\n if (document.querySelectorAll(\"tr.rich-table-row\").length != 0) {\n var numlinha = document.querySelectorAll(\"tr.rich-table-row\");\n for (let i = 0; i < numlinha.length; i++) {\n let texto = numlinha[i].innerText;\n while (texto.indexOf(\"\\t\") != -1) {texto = texto.replace(\"\\t\", \"\");}\n while (texto.indexOf(\"\\n\\n\\n\") != -1) {texto = texto.replace(\"\\n\\n\\n\", \",\");}\n while (texto.indexOf(\"\\n\\n\") != -1) {texto = texto.replace(\"\\n\\n\", \",\");}\n while (texto.indexOf(\"\\n\") != -1) {texto = texto.replace(\"\\n\", \",\");}\n resultado[i] = texto;\n resultado[i] = resultado[i].split(\",\");\n }\n var csv = ',Decisao,Processo,Exequente,Executado,Vara,Assunto,Ultimo Evento\\n';\n resultado.forEach(function (row) {\n csv += row.join(',');\n csv += \"\\n\";});\n download_csv(csv);\n exportCSV.innerText = \"Baixando..\";\n exportCSV.addEventListener(\"click\", ()=>{alert('Para baixar novamente, atualize a página.')}, true);\n\n }\n}", "title": "" }, { "docid": "0d44db402fb798e486b2a6c5bacb3890", "score": "0.49208647", "text": "function loadQuestion(){\n\t//requesting geoJSON of the questions to create the list of the question\n\tvar url = 'https://www.woravich-k.com:49154/getGeoJSON/question/geom'\n\tclient = new XMLHttpRequest();\n\t\n\tclient.open('GET', url);\n\tclient.onreadystatechange = dataResponse; \n\tclient.send();\n}", "title": "" } ]
c5065b525ade3773606f04188be03f75
show a message that the data has been saved
[ { "docid": "f5efcf5f6c89c09f93305e7b52244c8b", "score": "0.65648836", "text": "function warnDataSaved() {\n const divClass = 'div';\n var warnElement = document.createElement(divClass);\n warnElement.style.cssText = `width: 12em; height: 1.5em; margin: -0.75em 0 0 -6em; background-color: rgb(247,241,230); border: 0.1em solid rgb(217,176,151);\n border-radius: 0.5em; position: absolute; top: 50%; left: 50%; z-index: 10; padding: 1.5em; text-align: center;`;\n warnElement.innerHTML = 'Данные сохранены';\n document.body.append(warnElement);\n setTimeout(() => warnElement.remove(), 2000);\n }", "title": "" } ]
[ { "docid": "bb1406fb5deb374377c54623cc80bee6", "score": "0.7001761", "text": "function save(){\n \n }", "title": "" }, { "docid": "6fe6ff7ce896c833e8059707113a8642", "score": "0.6976482", "text": "function _updateSuccess() {\n vm.btnSaved = true;\n vm.btnSaveText = 'Saved!';\n toastr.success('Saved user info', 'Saved');\n }", "title": "" }, { "docid": "ac089fb1c4043b5600447a04e9fa1fb4", "score": "0.691693", "text": "function onSave() {\r\n\t$.jGrowl('Successfully saved diagnosis', {\r\n\t\tlife : 3000\r\n\t});\r\n\t$(\"$btnCancel\").click();\r\n}", "title": "" }, { "docid": "c8eb4b1dfd0a0fa1457608dc6381f9ba", "score": "0.6887482", "text": "function dialog_save(values) {\n\t\tconsole.log('Saving...');\n\t}", "title": "" }, { "docid": "4ece5df95c4db3cd49d10f7562e98df1", "score": "0.68766165", "text": "saveInline () {\n this.snack = true\n this.snackColor = 'success'\n this.snackText = 'Data saved'\n }", "title": "" }, { "docid": "108b5e79fa5eb88cba0385f985425204", "score": "0.685807", "text": "function Save() {\n if ($('#ab110AddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab110\",vm.ab110).then(function (data) {\n notify.showMessage('success', \"ab110 record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab110/\";\n });\n } else {\n dataContext.upDate(\"/api/ab110\", vm.ab110).then(function (data) {\n notify.showMessage('success', \"ab110 record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab110/\";\n });\n }\n }\n }", "title": "" }, { "docid": "1a9f7d35235a897207b747893d8f1d3b", "score": "0.6801549", "text": "showSaveMessage() {\n $('#save-time').text(`Saved to browser storage at ${new Date().toLocaleTimeString()}`);\n $('.save-time-container').show().delay(1000).fadeOut(2000);\n }", "title": "" }, { "docid": "ef8b01159dbbc5f1759517b2e601de93", "score": "0.66855294", "text": "saveSuccess(savedObject) {\n return () => {\n const text = `${savedObject} saved successfully`;\n this.addByText('success', text);\n };\n }", "title": "" }, { "docid": "16cc83092d05fa42387f22fabe92d721", "score": "0.6668823", "text": "function save() {\n\t\tsources.userFood.save({\n\t\t\tonSuccess: function(event) {\n\t\t\t\t$comp.hide();\n\t\t\t\tWAKL.qtyAddArea.setAndGotoQty();\n\t\t\t},\n\t\t\tonError: function(event) {\n\t\t\t\tcancel();\n\t\t\t\tWAKL.err.handler(event);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "b59674b62664de1089f19c5ff5f23186", "score": "0.66317546", "text": "save() {\n \n }", "title": "" }, { "docid": "989f666e1ae571bd1186733fbb270933", "score": "0.6626486", "text": "function saveCallback(data) {\n $scope.case.diagnosis_state = data.state;\n\n if (!$scope.diagnosis.isInScopeUnknown()) {\n // refreshing the logs\n postal.publish({\n channel : 'models',\n topic : 'Log.refresh'\n });\n }\n }", "title": "" }, { "docid": "52dd87e8f9635e7e71c8fe5f1a40b48a", "score": "0.66067684", "text": "function save(){\t\t \n\t\t frmGym.onsubmit = function(e){\n\t\t\t e.preventDefault();\n\t\t\t if(FormOk.hasChanged()){\n\t\t\t\t if(frmGymOk.isValid()){\t\n\t\t\t\t\t Play.sendRequest(e.target,function(){\n\t\t\t\t\t\t notify.wait('Loading...');\t\n\t\t\t\t\t\t btnSave.disabled = true; \n\t\t\t\t\t },function(xhr){\t\n\t\t\t\t\t\t btnSave.disabled = false;\n\t\t\t\t\t\t if(xhr.responseText === Constants.SUCCESS_REQUEST){\n\t\t\t\t\t\t\t notify.success('Your data gym has been saved successfully!');\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t notify.danger(xhr.responseText); \n\t\t\t\t\t\t }\t\t\t\t\t\t\n\t\t\t\t\t });\n\t\t\t\t }\t\n\t\t\t }else{\n\t\t\t\t notify.warning('No changes to save!!!'); \n\t\t\t }\t\t \n\t\t }\t\t\t \n\t}", "title": "" }, { "docid": "08d2a08a35b8fabac84a7a57934f2fe4", "score": "0.6570301", "text": "function saveForm(){\r\n\tconsole.log(\"Saving ...\");\r\n}", "title": "" }, { "docid": "bb0bf2a7d050757463151f5bee88d96d", "score": "0.65472484", "text": "function reportSaved(data) {\n\tif (data.errors) {\n\t\tfor (error in data.errors)\n\t\t\talertBefore(data.errors[error], '#group_'+error, 'report_alert', 'danger', '#report_problem');\n\t} else if (data.ok) {\n\t\t$('#id_url').val('');\n\t\t$('#id_ask').val('');\n\t\tdata['newer'] = true;\n\t\tdata['reports'] = data.report;\n\t\treportsReceived(data);\n\t}\n\tenableButtons(['#report_problem button']);\n}", "title": "" }, { "docid": "0063dbeaf831cbbec19e1d2eda9643b6", "score": "0.6491843", "text": "function onClickSave (e)\n\t{\n\t\tconsole.log('saving');\n\t\tlet packet = changes.reduce((packet, fid) => \n\t\t{\n\t\t\tpacket[fid] = crud.fields[fid].val();\n\t\t\treturn packet;\n\t\t}, Object.create(null)); \n\t\tchanges = [];\n\t\tsocket.emit('save', crud.id, item.getPK(), packet);\n\t\t//$('[data-crud-action=\"save\"]').addClass('disabled');\n\t\t$('#modal').modal('hide');\n\t}", "title": "" }, { "docid": "2b8db3f20b584488545cae5a28b3992f", "score": "0.6488389", "text": "function dirtyData() {\n madjax.fn.alert({\n 'status': false,\n 'message': basket.msg.dirtyData\n })\n}", "title": "" }, { "docid": "0547e727a1f56ce7ed60d75d8d45ddd3", "score": "0.64848167", "text": "function onClickSave(e) {\n\t\tconsole.log('saving');\n\t\tvar packet = changes.reduce(function (packet, fid) {\n\t\t\tpacket[fid] = crud.fields[fid].val();\n\t\t\treturn packet;\n\t\t}, Object.create(null));\n\t\tchanges = [];\n\t\tsocket.emit('save', crud.id, item.getPK(), packet);\n\t\t//$('[data-crud-action=\"save\"]').addClass('disabled');\n\t\t$('#modal').modal('hide');\n\t}", "title": "" }, { "docid": "60415ddda3084142da855e10eac62aca", "score": "0.6483256", "text": "function save()\n\t\t{\n\t\t\tconfirm(\"Are you sure you want to save this new open/close payroll schedule?\");\n\t\t}", "title": "" }, { "docid": "21d9389372d6bc0db4f7e5e74cce1e95", "score": "0.64592755", "text": "Save() {\n let serialized = JSON.stringify(this.records);\n localStorage.setItem(\"data\", serialized);\n this.message = `Data Saved, total records: ${this.records.length}`;\n console.log(this.message);\n console.log(serialized);\n this.EnableSave = false;\n return this.records.length;\n }", "title": "" }, { "docid": "22f62a1a841b97c39f77c8278e586767", "score": "0.64533365", "text": "function MLINKSTUD_save() {\n console.log(\"===== MLINKSTUD_save =====\");\n\n if (permit_dict.permit_crud && permit_dict.requsr_same_school) {\n\n const url_str = urls.url_student_enter_exemptions;\n const upload_dict = {mode: \"enter\",\n table: \"student\"};\n UploadChanges(upload_dict, url_str);\n };\n\n $(\"#id_mod_link_students\").modal(\"hide\");\n\n }", "title": "" }, { "docid": "7ce7ec173a16985140d75fe061321aa3", "score": "0.6437294", "text": "save(data) {}", "title": "" }, { "docid": "948533c9d8288892b184d008d93a0080", "score": "0.64254403", "text": "warningSave(){\n this.showModalSave=true\n }", "title": "" }, { "docid": "fa3e75a38cc39d02377ae9f06ed5686c", "score": "0.63974273", "text": "function handleSave() {\n setsave(!save);\n }", "title": "" }, { "docid": "55c02438780aa31c928f57b579fb664a", "score": "0.63887966", "text": "function saveDraft() {\n showNotification('The draft is saved.');\n draftIsSaved = true;\n}", "title": "" }, { "docid": "033fe114873d011c3b09a903cfb27ce1", "score": "0.6387565", "text": "function saveData() {\n if (vm.uiState.mode === pageMode.ADD) {\n insertData();\n }\n else if (vm.uiState.mode === pageMode.EDIT) {\n updateData();\n }\n }", "title": "" }, { "docid": "9480653b2b66cface57cf60af325cfd1", "score": "0.6351359", "text": "saveToCore() {\n this.set(\"saved\", true);\n }", "title": "" }, { "docid": "7e628fe459284b9374edc50625c34f59", "score": "0.6332258", "text": "function saveState(){\r\n console.log(\"Ao guardar: \" + seUpdated + \"|\" + seFecho)\r\n localStorage.setItem(\"seUpdated\", JSON.stringify(seUpdated));\r\n localStorage.setItem(\"seFecho\", JSON.stringify(seFecho));\r\n }", "title": "" }, { "docid": "c276e489cc6d3c47a73e4c38e76ed1df", "score": "0.63255167", "text": "function showSuccess(data) {\n $scope.errors.push({message: data + ' uploaded !'});\n }", "title": "" }, { "docid": "eb94c9ba19330363d55f361f782e2c93", "score": "0.6313041", "text": "function show_save_status(event_type, success) {\n success = typeof success !== 'undefined' ? success : false;\n if (success) {\n console.log(event_type + \" has been saved\");\n } else {\n console.log(event_type + \" failed to save\");\n }\n}", "title": "" }, { "docid": "1a3c20e560f745bed6da510ac30bd4ce", "score": "0.63097656", "text": "function alertEditSucess() {\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\ttitle : \"\",\n\t\t\t\t\t\t\ttext : \"Edit successfully.\",\n\t\t\t\t\t\t\ttype : \"success\",\n\t\t\t\t\t\t\ttimer : alertDuration,\n\t\t\t\t\t\t\tshowConfirmButton : false\n\t\t\t\t\t\t});\n\t\t\t\t\t}", "title": "" }, { "docid": "bd28aeb98338bd46b0f7ca3d23082256", "score": "0.6308525", "text": "save() {\r\n }", "title": "" }, { "docid": "8f23222f7107a33e46fbd66d0ae1095e", "score": "0.6299338", "text": "function SaveMessage(data){\n var PushID=acmTeamData.push();\n PushID.set(data).then(()=>{\n \n \n //Show alert \n document.querySelector('.alert').style.display='block';\n \n alert(\"Your registration has been sucessfully completed.... :)\");\n \n //Hide alert after 3 seconds\n setTimeout(()=>{\n document.querySelector('.alert').style.display='none';\n \n },3000);\n \n document.getElementById('formid').reset();\n });\n \n}", "title": "" }, { "docid": "330c0e21bd43a29c431a6b81a454cf9c", "score": "0.6297949", "text": "function save(contact_id) {\n if (!isValid())\n return;\n\n var flag = ((contact_id == null) ? true : false);\n var str = ((contact_id == null) ? 'Contato incluído' : 'Contato editado') + ' com sucesso!';\n\n $('#btn-md-save').attr('data-dismiss', 'modal');\n\n var contact = fill(JSON.parse(localStorage.getItem(contact_id)));\n addToStorage(contact);\n alert(str);\n if (flag)\n addToTable(contact);\n\n load();\n}", "title": "" }, { "docid": "14d0d4681335d7c74dbc790d5704b589", "score": "0.6296123", "text": "function saveToLocalStorage() {\n if (storage && $(\"#cmd-save\").prop('checked')) {\n console.log(\"SAVING\");\n\n $('#save-status').text(\"Saving...\");\n\n storage['ts_title'] = $('#title').val();\n storage['ts_subtitle'] = $('#subtitle').val();\n storage['ts_text'] = $('#text').val();\n\n setTimeout(function() {\n $('#save-status').text(\"Last saved @ \" + new Date().toLocaleTimeString());\n }, 750);\n }\n }", "title": "" }, { "docid": "5fe6766f20634e80edccbf343d8d3331", "score": "0.62796825", "text": "function alertUserToSocialChanges() {\n\t\t//$('#social-scripts2').html('<span class=\"warning\">Do you want to save your changes</span>');\t\n\t\t$(\"#edit-social\").text('Save Changes');\n\t\t$(\"#edit-social\").removeClass('btn btn-success');\n\t\t$(\"#edit-social\").removeClass('btn btn-info');\n\t\t$(\"#edit-social\").addClass('btn btn-warning');\n\t\t$(\"#edit-social\").fadeIn();\n\t\t}", "title": "" }, { "docid": "1cbb59e7daea08fbaf96959a87c4b635", "score": "0.6276681", "text": "function handleSave() {\n setLoading(true)\n props\n .addExpenditure(payload)\n .then(() => {\n setLoading(false)\n setAmount(\"\")\n setDate(\"\")\n setPayload([])\n setSaveButtonText(\"Saved!\")\n })\n .catch((error) => setError(error))\n }", "title": "" }, { "docid": "c774c09d467a7d74697f3f3b19070f60", "score": "0.6274516", "text": "savedCheckinInfo(){\n this.createAlert(\"Hier kannst du deine eingegebenen Daten ansehen {{checkInId}}\",\"Info\");\n }", "title": "" }, { "docid": "df0b4867b68d2f774e2a4119de0e84f1", "score": "0.62677795", "text": "function Save() {\n try {\n \n $(\"#btnInsertUpdateCompany\").trigger('click');\n }\n catch (e) {\n //this will show the error msg in the browser console(F12) \n console.log(e.message);\n return 0;\n }\n }", "title": "" }, { "docid": "f0868c808fd1f1969435eb110d74e905", "score": "0.6248299", "text": "function _save() {\n\t\t\ttry {\n\t\t\t\tvar is_make_changed = _check_if_exist_change();\n\t\t\t\tif (!is_make_changed) {\n\t\t\t\t\tif (_is_click_main_menu_btn) {// menu\n\t\t\t\t\t\t// menu\n\t\t\t\t\t\tself.close_all_window_and_return_to_menu();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (_is_click_back_btn) {\n\t\t\t\t\t\t\twin.close();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t_save_action();\n\t\t\t\t}\n\t\t\t} catch (err) {\n\t\t\t\tself.process_simple_error_message(err, window_source + ' - _save');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "eec28c554743bd7d5133a05f953b17c7", "score": "0.62296444", "text": "function showManageCompanySuccessAlert() {\n\t\t\t\tvar successMsg = $(\"#editCompanyModal\").attr(\"saveCompanyWithSuccess\");\n\t\t\t\t\n\t\t\t\tif(successMsg !== undefined) {\n\t\t\t\t\tdisplaySuccessMsg(successMsg);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "503aad023fc6aba3dbe0fcae98795fd8", "score": "0.62278104", "text": "function store_success_info(data){\n if(!data)\n data = \" Your data has been successfully stored!!\";\n swal({\n title:'Successfully Stored!',\n text: data,\n type: 'success',\n timer: 8000\n });\n}", "title": "" }, { "docid": "24dda3ada7410b1c33ef6b66af8d897b", "score": "0.62186474", "text": "function saveRes(){\r\n\tconsole.log(\"Saveing answers ...\");\r\n}", "title": "" }, { "docid": "48af05028b6203887883297d330e3a5f", "score": "0.61881405", "text": "function saveThisForm(){\n if (typeof $scope.configuration.formName === 'undefined') {\n toaster.pop({\n type: 'warning',\n timeout:2000,\n title: 'Form name is undefined',\n body: 'Form has not been saved.', \n showCloseButton: true\n });\n return false;\n }\n if ($scope.configuration.formName === '') {\n toaster.pop({\n type: 'warning',\n timeout:2000,\n title: 'Form name is required',\n body: 'Form has not been saved.', \n showCloseButton: true\n });\n return false;\n }\n toaster.pop({\n type: 'wait',\n timeout:10000,\n title: 'Form is being saved',\n body: 'Wait.', \n showCloseButton: true\n });\n\n \n toaster.clear(); \n toaster.pop({\n type: 'info',\n timeout:2000,\n title: 'Form would be saved if it were not a static example',\n body: '', \n showCloseButton: true\n }); \n return true;\n }", "title": "" }, { "docid": "57fb533251e87127a9eafb7386a6f1ef", "score": "0.6175972", "text": "static saveData() {\n let save = this.saveDataAsJson();\n if (novelData.novel.settings.saveMode === \"cookie\") {\n return this.saveCookie(\"novelData\",save,365);\n } else if (novelData.novel.settings.saveMode === \"text\") {\n return UI.showSaveNotification(save);\n }\n }", "title": "" }, { "docid": "6fdd6ecb6c9f80237041b9a4e8ca4909", "score": "0.6161796", "text": "function save()\n\t\t\t{\n\t\t\t\tvm.isSaving = true;\n\t\t\t\t$uibModalInstance.dismiss('cancel');\n\t\t\t\tconsole.log(\"feedbackProcess:\"+JSON.stringify(vm.feedback.fbSentiment));\n\t\n\t\t\t\t//getfdData.update(vm.feedback, onSaveSuccess, onSaveError);\n\t\t\t\t$http.post('http://ec2-52-55-236-26.compute-1.amazonaws.com:18098/sentiment',vm.feedback ,{\n\t\t\t\t\theaders : {\n\t\t\t\t\t\t'Content-Type' : 'application/json'\n\t\t\t\t\t}\n\t\n\t\t\t\t}).success(function(data) {\n\t\n\t $.UIkit.notify({\n\t message : 'Feedback Sentiment Save Successfully',\n\t status : 'success',\n\t timeout : 2000,\n\t pos : 'top-center'\n\t });\n\t\n\t\t\t\t}).error(function() {\n\t\t\t\t\t$scope.showgraph = false;\n\t\n\t\t\t\t});\n\t\n\t\t\t}", "title": "" }, { "docid": "1892348ff621117ebb65e355ffeae2e8", "score": "0.61579883", "text": "function save() {\n\t\tif(!angular.isUndefinedOrNull(vm.settings)) {\n\t\t\tSettingsDataService.save(vm.settings).$promise.then(function () {\n\t\t\t\trefreshSettings();\n\t\t\t\t$log.debug('Settings saved');\n\n\t\t\t\t$modal({\n\t\t\t\t\ttitle: 'Sikeres mentés',\n\t\t\t\t\tcontent: 'Sikeresen elmentettük a módosításokat!',\n\t\t\t\t\ttemplateUrl: Utils.getTemplateUrl('ModalWithFooter')\n\t\t\t\t});\n\t\t\t}).catch(function () {\n\t\t\t\t$modal({\n\t\t\t\t\ttitle: 'Hiba',\n\t\t\t\t\tcontent: 'Hiba történt a módosítások mentése közben!',\n\t\t\t\t\ttemplateUrl: Utils.getTemplateUrl('ModalWithFooter')\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "3870fd6d53ed0bb9e8061d1e37cbaf67", "score": "0.61455464", "text": "function saveForm() {\r\n var url = '/cat/' + $rootScope.cid + '/save';\r\n console.log($scope.data);\r\n\r\n //rating is required while fetching questions\r\n $rootScope.rating = $scope.data.rating;\r\n\r\n jaximus.saveDataSet(url,$scope.data)\r\n .success(function(data, status, headers, config) {\r\n console.log(data);\r\n if ( data.fid && data.type_id ) {\r\n $rootScope.fid = data.fid;\r\n jaximus.toastThis('Trip information saved.');\r\n $rootScope.$broadcast(\"loadQ\", data);\r\n }\r\n else {\r\n jaximus.toastThis('Save error. Please try agian later.');\r\n }\r\n })\r\n .error(function(data, status, headers, config) {\r\n jaximus.toastThis('Error. Please try again.');\r\n console.log('something went wrong.')\r\n });\r\n }", "title": "" }, { "docid": "2993b44c21bf3c65a30c5cbc518f0e90", "score": "0.614184", "text": "function saveShow(showData, onComplete) {\n if (!BST.isAdmin()) {\n return;\n }\n var data = convertDatesToStrings(showData);\n var path = Server.getPath();\n KIP.ajaxRequest(KIP.AjaxTypeEnum.POST, path, function (data) {\n if (data === \"not admin\") {\n _showNonAdminPopup();\n return;\n }\n if (onComplete) {\n onComplete(data);\n }\n }, function () { }, { type: \"showEdited\", showID: data.showTitle.id, showData: JSON.stringify(data) });\n }", "title": "" }, { "docid": "9b3c096211e819777154f78fa77d4d30", "score": "0.6120585", "text": "function save() {\n // console.log('Saving the unsatisfied.');\n\n var promise = CoursePlanService.update($scope.OmsCoursePlanVoForCreate);\n $scope.dataLoading = false;\n $scope.modal.hide();\n promise.then(function (OmsCoursePlanVoForCreate) {\n\n }, function (error) {\n //$scope.dataLoading = false;\n });\n\n }", "title": "" }, { "docid": "fb598e6f5c6e04fbc15edb61255d9459", "score": "0.61123055", "text": "function _onSave(){\n\n var title = ui.$noteTitle().val();\n var text = ui.$noteText().val();\n\n if(\n title && title.trim().length>0 &&\n text && text.trim().length>0\n ){\n if(_note) //updates\n _notesL[_note.index] = {\n title:ui.$noteTitle().val(),\n text:ui.$noteText().val()\n };\n else //add new one\n _notesL.push({\n id:_notesL.length,\n title:ui.$noteTitle().val(),\n text:ui.$noteText().val()\n });\n\n //saved, now reloads the list of notes\n _saveData(_stateList);\n }\n else\n alert(_notesLExtConfig.validationWarn);\n }", "title": "" }, { "docid": "06d52cd20e7bce38212ce9af0a338522", "score": "0.61112773", "text": "OnSaveClick() {\n\t\tvar i,\n\t\t\tthat = this,\n\t\t\tpromise,\n\t\t\tempDataSrc = this.$ds.EmployeeDS;\n\t\t\n\t\tif (empDataSrc.hasChanges()) {\n\t\t\tthis.EnableButtons(false, false);\n\t\t\tpromise = empDataSrc.sync();\n\t\t\t\n\t\t\tpromise.done(function () {\n\t\t\t\tconsole.log(\"Operation was successful!\");\n\t\t\t\tthat.EnableButtons(true, true);\n\t\t\t\t\n\t\t\t\tif (that.addMode === true) {\n\t\t\t\t\tthat.addMode = false;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tpromise.fail(function (xhr) {\n\t\t\t\tvar errors,\n\t\t\t\t\ti;\n\t\t\t\t\n\t\t\t\tthat.EnableButtons(false, true);\n\t\t\t\tif (that.addMode === true) {\n\t\t\t\t\tconsole.log(\"Create was NOT successful!\");\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"Update was NOT successful!\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\terrors = empDataSrc.transport.jsdo.getErrors();\n\t\t\t\t\n\t\t\t\tfor (i = 0; i < errors.length; i += 1) {\n\t\t\t\t\tconsole.log(errors[i].error);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}); // end promise.fail \n\t\t}\n\t}", "title": "" }, { "docid": "32ddb165550a8bb30c2e5001a05a21cd", "score": "0.6101988", "text": "get isSaving() {\n if (this.args.isSaving) {\n this.showSavingMessage.perform();\n }\n\n return this._isSaving;\n }", "title": "" }, { "docid": "4c2fa2c7228935c4131c0520147cf3f4", "score": "0.6100109", "text": "function saveButtonClicked() {\n \n // make a message to request the other student work\n var message = {\n messageType: \"saveButtonClicked\"\n };\n \n // send the message to request the other student work\n sendMessage(message);\n}", "title": "" }, { "docid": "c1edf50b2f15a65cebc1cffec58cc5b0", "score": "0.6089746", "text": "function saveNote() {\n console.log('Note saved!');\n}", "title": "" }, { "docid": "c47fc4984800afd517d5edafa923e2d4", "score": "0.60846746", "text": "function dirty(whatVariable){\n\tsaved = false\n\t$(\".save-state\").toggleClass('need-save', true)\n\t\t.text(\"Warning ! Data not saved\")\n}", "title": "" }, { "docid": "e65232c48f7020dd2e939eb1b82b8abe", "score": "0.6077428", "text": "function save(){\n\tid = -1;\n\t\n\tif (pos_comp != -1)//modificar\n\t\tid = positions[pos_comp].id;\n\t\t\n\t$(\"#btnGuardar\").hide();\n\t$(\"#mensajeTemporal\").show();\n\t$(\"#backImage\").css({cursor:\"wait\"});\n\t\n\t\n\t$(\"#idInmobiliaria\").val(id);\n\t\n\t\n\t$(\"#subirInmobiliaria\").ajaxSubmit({\n\t\tdataType: \"json\",\n\t\tsuccess: function(respuesta_json){\n\t\t\t$(\"#btnGuardar\").show();\n\t\t\t$(\"#mensajeTemporal\").hide();\n\t\t\t$(\"#backImage\").css({cursor:\"default\"});\n\t\t\t\n\t\t\tgotoURL(\"inmobiliaria.php\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "9c256e4b8ff484e8dbe9234709f9b10d", "score": "0.60740864", "text": "function saveModel() {\r\n\r\n var model = modelDao.getModel(model_reference_code);\r\n\r\n setLoadingDiv($('body'));\r\n\r\n modelDao.updateModelWithSubmodels(model, current_submodels,\r\n function (model) {\r\n unsetLoadingDiv($('body'));\r\n\r\n var overlay = $('#model_configuration_classic').parent(\".model_config_overlay\");\r\n overlay.hide();\r\n\r\n setMessagePopUp(\"positive\", \"message_data_saved_successfully\");\r\n renderModelUpdate(model);\r\n model_reference_code = null;\r\n },\r\n configuratorErrorHandler);\r\n}", "title": "" }, { "docid": "cd2b682fe98dc36eb48cc528648a159f", "score": "0.60726446", "text": "function doAfterSave(){\n\t\t\t//Clear local storage data\n\t\t\thouseStorageService.clear();\n\t\t\talert('La casa fue guardada exitosamente!!');\n\t\t\t$location.path('/');\n\t\t}", "title": "" }, { "docid": "bb36602a7f1d8f3ac4b63d3f8f8f68ca", "score": "0.6065435", "text": "showSavedLabel() { $(\"#form-saved-label\").show(); }", "title": "" }, { "docid": "0624e8885179eb90ad317bb1ac58cea0", "score": "0.6059076", "text": "function showMessageOk(info) {\n var alert = $mdDialog.alert()\n .title(info.tilte)\n .htmlContent(info.msj)\n .ariaLabel('save customer')\n .ok('OK');\n\n $mdDialog.show(alert);\n }", "title": "" }, { "docid": "a9dd949767f91ab2223725b89af33b27", "score": "0.60579026", "text": "function onSave() {\n const noteValues = getNotesValues();\n if (!isValidInputs(noteValues)) { return }\n const id = getId();\n const noteElement = generateNoteElement(noteValues, id);\n document.getElementById('notes-container').appendChild(noteElement);\n const notes = getFromStorage();\n notes[id] = { ...noteValues, id };\n setOnStorage(notes);\n}", "title": "" }, { "docid": "190b8fa9c1724bd708d982c1493a111e", "score": "0.604759", "text": "function fileSaved() {\n window.extensions.KJSLINT.Page.Controller.fileSaved();\n }", "title": "" }, { "docid": "6a87a81365ef8239a77ddfdfd19035bf", "score": "0.6044319", "text": "function onSave() {\n\tvar minutes = $.pick.getValue().getMinutes();\n\tvar hours = $.pick.getValue().getHours();\n\ttime = {\n\t\tminutes : minutes,\n\t\thours : hours,\n\t};\n\tdispatcher.on(\"closeAdd\", function onCloseAdd() {\n\t\tanimateClose();\n\t\tdispatcher.off(\"closeAdd\", onCloseAdd);\n\t});\n\tvar eventStr = \"saveAlarm\";\n\tif (isEdit) {\n\t\teventStr = \"updateAlarm\";\n\t}\n\tmainCont.trigger(eventStr, {\n\t\tsnooze : snooze,\n\t\tlabel : label,\n\t\trepeat : repeat,\n\t\ttime : time,\n\t\tvibration : vibration,\n\t\tsounds : sounds,\n\t\tshuffle : shuffle,\n\t\tisEdit : isEdit,\n\t});\n}", "title": "" }, { "docid": "4f545665cf3346469c1bac26e4eb4a37", "score": "0.6029725", "text": "function ModelsSaveStatus() {\n\t\t\t\tthis.modelsSaved = true;\n\t\t\t}", "title": "" }, { "docid": "afeae3c4bbed0d0ad499e414cfac0a89", "score": "0.60264945", "text": "saveContent () {\n\t\tlocalStorage.setItem(STORAGE_KEY, this.msg);\n\t}", "title": "" }, { "docid": "f06e453c18ff93d1e247d28885524854", "score": "0.6025176", "text": "handleSave() {\n }", "title": "" }, { "docid": "6457e30daa7578bfa5d144aa0201224b", "score": "0.60223174", "text": "function successUpdateFollowingOption(data) {\n refreshData(data) ? alert(\"Your changes have been saved.\") : {};\n}", "title": "" }, { "docid": "79752b93adb1ddaa73aa4724bf7229e4", "score": "0.6014322", "text": "function savePasswordError(data) {\n $scope.savePasswordMessage = data;\n $scope.savePasswordSuccessful = false;\n $scope.savePasswordShowMessage = true;\n //hide indicator\n $scope.onSubmitting = false;\n }", "title": "" }, { "docid": "284f5009ffb287399dfc132dba67e053", "score": "0.60085624", "text": "saveThumbNailSuccess() {\n store.state.status = {\n got: true\n };\n store.state.notification_text = 'ThumbNail successfully saved';\n store.state.notification_icon = 'info';\n store.state.notification_color = 'primary';\n }", "title": "" }, { "docid": "a5daf41ca3bd9bcadd79343c442d563b", "score": "0.6005326", "text": "function saveBookingInfo() {\n var urlLabel = {};\n _.each($scope.translatableLanguages, function(language) {\n urlLabel[language] = translateBookingInfoUrlLabels('reserve_places', language);\n });\n\n // Make sure all default values are set.\n EventFormData.bookingInfo = angular.extend({}, {\n url : '',\n urlLabel : urlLabel,\n email : '',\n phone : '',\n availabilityStarts :\n EventFormData.bookingInfo.availabilityStarts ?\n moment(EventFormData.bookingInfo.availabilityStarts).format() :\n '',\n availabilityEnds :\n EventFormData.bookingInfo.availabilityEnds ?\n moment(EventFormData.bookingInfo.availabilityEnds).format() :\n ''\n }, $scope.bookingModel);\n\n if (typeof EventFormData.bookingInfo.urlLabel !== 'string') {\n EventFormData.bookingInfo.urlLabel = formatBookingInfoUrlLabel(EventFormData.bookingInfo.urlLabel);\n } else {\n EventFormData.bookingInfo.urlLabel = formatBookingInfoUrlLabel(EventFormData.bookingInfo.urlLabel);\n }\n\n $scope.savingBookingInfo = true;\n $scope.bookingInfoError = false;\n\n var promise = eventCrud.updateBookingInfo(EventFormData);\n promise.then(function() {\n controller.eventFormSaved();\n $scope.bookingInfoCssClass = 'state-complete';\n $scope.savingBookingInfo = false;\n $scope.bookingInfoError = false;\n removeDuplicateContactBooking();\n }, function() {\n $scope.savingBookingInfo = false;\n $scope.bookingInfoError = true;\n });\n }", "title": "" }, { "docid": "68d245969a014e02ad8c069d2b5020c8", "score": "0.6002684", "text": "function toast_art_save()\n {\n $.toast({\n heading: 'NEW ARTICLE',\n text: 'A new article was successfuly saved! This modal will automatically closes.',\n showHideTransition: 'fade',\n icon: 'success',\n position: 'top-right',\n hideAfter: 3000\n });\n }", "title": "" }, { "docid": "66ec42f0233a80181f761ccc38e1082a", "score": "0.5996031", "text": "function save(){\n\tid = -1;\n\t\n\tif (pos_comp != -1)//modificar\n\t\tid = positions[pos_comp].id;\n\t\t\n\t$(\"#btnGuardar\").hide();\n\t$(\"#mensajeTemporal\").show();\n\t$(\"#backImage\").css({cursor:\"wait\"});\n\n\n\t$.ajax({\n\t\turl: \"lib_php/updAnunciosVencidos.php\",\n\t\ttype: \"POST\",\n\t\tdataType: \"json\",\n\t\tdata: {\n\t\t\tid: id,\n\t\t\tlimiteVigencia: $(\"#limiteVigencia\").val()\n\t\t}\n\t}).always(function(respuesta_json){\n\t\t$(\"#btnGuardar\").show();\n\t\t$(\"#mensajeTemporal\").hide();\n\t\t$(\"#backImage\").css({cursor:\"default\"});\n\t\t\n\t\t$(\"#resultados\").text(respuesta_json.mensaje);\n\t\tprincipalCerrarPopUp(anunciosVencidos_cerrarPopUp);\n\t\tconsultarTuplasExistentes(nombrePHPConsultar, isBorrarTuplas, arrayCamposConsulta);\n\t});\n}", "title": "" }, { "docid": "f95103767e3a9bda1cf3d95e518e3c04", "score": "0.59905815", "text": "function updateSavedStateMessage(state) {\n document.getElementById(\"saved-message\").innerHTML = \"Saved: \"\n + (state ? stateToString(state) : \"None\");\n}", "title": "" }, { "docid": "862ff2b7245fb4ffaa1e765e12e34c20", "score": "0.59796137", "text": "function Save()\n {\n win.name = JSON.stringify(store);\n }", "title": "" }, { "docid": "1a3eb444b7c55696abe2bf219dc30730", "score": "0.59755987", "text": "function savePasswordSuccessful(data) {\n if (data === '') {\n $scope.savePasswordSuccessful = true;\n $scope.savePasswordShowMessage = true;\n $scope.savePasswordMessage = 'Your password has been updated successful!';\n //reset form\n $scope.userpasswordform.$setPristine();\n //reset model\n $scope.passwordModel = angular.copy({ oldPassword: '', newPassword: '', confirmNewPassword: '' });\n }\n\n //hide indicator\n $scope.onSubmitting = false;\n }", "title": "" }, { "docid": "d6f62619ed2d153070e95678ebfcce7f", "score": "0.5971626", "text": "function saveData(msg, callback){\r\n\t\tData.snippets = Data.snippets.toArray();\r\n\t\t\r\n\t\tDB_save(function(){\r\n\t\t\tData.snippets = Folder.fromArray(Data.snippets);\r\n\t\t\tif(typeof msg === \"function\") msg();\r\n\t\t\telse if(typeof msg === \"string\") alert(msg);\r\n\t\t\tcheckRuntimeError();\r\n\t\t\t\r\n\t\t\tif(callback) callback();\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "cdf3bcf78560bbacd44f71087c614e50", "score": "0.5965316", "text": "function handlesave(){\n //fetchGeo();\n itemname = $(\"#itemname\").val()\n itemrating = $(\"#select-rating\").val()\n itemcategory = $(\"#select-category\").val()\n itemdescription = $(\"#itemdescription\").val()\n app.model.items.additem(itemname, itemrating, itemcategory, itemdescription, app.mylocation)\n $(\"#content_add\").hide().removeClass('leftin').removeClass('rightin')\n $(\"#content_\" + app.model.state.get('current')).show().addClass('rightin')\n $(\"#back\").toggleClass('hidden');\n $(\"#save\").toggleClass('hidden');\n $(\"#add\").toggleClass('hidden');\n }", "title": "" }, { "docid": "b82ec5d2efb1622de3c4939ce5cbfb1e", "score": "0.5957575", "text": "saveClick() {\n console.log('>>>>>saveClick>>>>>>>>',this.fields);\n this.template.querySelector('lightning-record-edit-form').submit(this.fields);\n this.isEdit = false;\n \n }", "title": "" }, { "docid": "488e78bfa966a11352e7eeba88199d84", "score": "0.59548867", "text": "function saveModify(){\n validation(\"\");\n if(Validator.numberOfInvalids === 0){ // if there are not errors.\n $(this).siblings().prop(\"disabled\", false);\n $(this).siblings().children().prop(\"disabled\", false);\n $(this).prevAll().show();\n $(this).hide();\n }\n }", "title": "" }, { "docid": "5b2c75ae6c0ef8813096ad89df066c57", "score": "0.5950215", "text": "save(){\n this.submitting = true;\n \n this.$http.post('/extra/api',this.model).then(function(response, status, header){\n this.$toastr.s(response.body.message,'Success'); \n this.submitting= false;\n\n this.fetchList();\n \n this.model.label ='';\n $('#ApiModal').modal('hide');\n }).catch(function(response, status,header){\n this.submitting= false;\n var data =[];\n var message =response.body.message;\n if(response.status == 500){\n data = \"We found exceptions, team currently fixing this issue\";\n }else{\n var data = Object.keys(response.body.errors).map(function(key,value){ \n return [response.body.errors[key][0]];\n });\n }\n this.$toastr.e(data.toString(), message); \n \n });\n }", "title": "" }, { "docid": "e830626f46d72af91d6bd7b313042989", "score": "0.59497523", "text": "function save(){\t\n\t// Converts all objects in a json map.\n\tvar json = JSON.stringify(init);\n\t// Makes the ajax petition.\n\t$.ajax({\n \turl: '/ws/processobjects/',\n \ttype: \"POST\",\n \tdata: json,\n \tsuccess: function (response) {\n \t\t// Ensenyem un popup conforme s'ha enviat correctament.\n \t\t$('#sendOk').show().delay(5000).fadeOut();\n \t}, \n\t\terror: function (response){\n\n\t\t\t// Ensenyem un popup conforme no s'ha pogut enviar la petició.\n\t\t\t$('#sendNotOk').show().delay(5000).fadeOut();\n\t\t},\n\t});\n}", "title": "" }, { "docid": "2bcc0101ae0ec1e2ad4af58d341181ef", "score": "0.5947056", "text": "function onConfirmSave(button){\n\t\t\tvar confirmSave;\n\t\t\tif (button == 1)\n\t\t\t\tconfirmSave = true;\n\t\t\telse\n\t\t\t\tconfirmSave = false;\n\t\t\tif (confirmSave){\n\t\t\t\tvar startTime = (new Date()).getTime();\n\t\t\t\tgpsLoading.style.visibility = \"visible\";\n\t\t\t\t$(\"#splash_image\").hide();\n\t\t\t\taccuracyInterval = setInterval(function(){checkAccuracy(startTime)}, 600); //allows GPS to zero-in\n\t\t\t}\n\t\t\telse if (!confirmSave){\n\t\t\t\tdeactivateLocation();\n\t\t\t\t$(\"#divSave\").show();\n\t\t\t\t$(\"#divSearch\").show();\n\t\t\t\t$(\"#divCancel\").hide();\n\t\t\n\t\t\n\t\t\t\t//btnSaveLocation.disabled = false;\n\t\t\t\t//btnFindCar.disabled = false;\n\t\t\t}\n\t}", "title": "" }, { "docid": "0f46f3a541d492ff52511e4fba8cc8af", "score": "0.5946939", "text": "function show_notif_update() {\n\t\tif ($(\"div.submit-container > span.notif\").length) return;\n\t\t$(\"div.submit-container\").append('<span class=\"notif text-red\">Tidak ada data yang berubah (tidak perlu save)</span>');\n\t\tsetTimeout(() => $(\"div.submit-container > span.notif\").remove(), 2500);\n\t}", "title": "" }, { "docid": "83ab6398133780ba5b1715fc9766e27d", "score": "0.5945224", "text": "function confirmSave(name) {\n // Set the global variables.\n confirmedSave = true;\n lastFailedSaveName = name;\n\n // Populate the error message.\n $('#save-error-message').text(\"'\" + name + \"'\" + ' is taken. Save again to overwrite the existing save.');\n\n // Bring focus to the save name field.\n $('#save-name').focus();\n}", "title": "" }, { "docid": "98c49dd3ae79b9739cd29c9a6d1f2fd1", "score": "0.59438866", "text": "function save() {\n localStorage && localStorage.setItem(key, Y.JSON.stringify(data));\n }", "title": "" }, { "docid": "9d9e972f8d240651fb82805b65114245", "score": "0.5940803", "text": "function saveForm(){\n const form = $$(film_form);\n if(form.isDirty()){\n if(!form.validate())\n return false;\n const newData = form.getValues();\n newData.year = newData.year.getFullYear();\n newData.rank = newData.id?newData.rank:\"#\";\n newData.id ? filmCollection.updateItem(newData.id, newData): filmCollection.add(newData);\n webix.message(\"Information is updated!\");\n cleanForm();\n }\n}", "title": "" }, { "docid": "cf83789efbeedae41dbf0638b8676b23", "score": "0.59283566", "text": "function showSaveResponse(response) {\n\tconsole.log(response);\n}", "title": "" }, { "docid": "e4b509e96de7923297cb07b4fd5412f6", "score": "0.5923916", "text": "async function onSave() {\n\tconst apiUrl = baseUrl + \"insert\";\n\n\tlet prevText = lastText;\n\n\t// Validation\n\tif (!lastText) {\n\t\tconst textareaDom = document.getElementById(\"main-text\");\n\t\tconst text = textareaDom.value;\n\n\t\tif (!text) return alert(\"テキストが入力されていません\");\n\n\t\t// if (text.length > 4000)\n\t\t// \treturn alert('文書が長すぎます');\n\n\t\tconsole.log(text);\n\n\t\tlastText = text;\n\n\t\tawait onSubmit(text);\n\n\t\tconsole.log(\"ended\");\n\t}\n\tif (texts.length == 1 && texts[0] === \"\")\n\t\treturn alert(\"エラーが発生しました\");\n\tif (pointer < 0 || pointer >= texts.length)\n\t\treturn alert(\"エラーが発生しました\");\n\tif (texts.length > 1000) return alert(\"文書が長すぎます\");\n\n\tif (!(name = window.prompt(\"保存する文書の名前を入力してください\"))) {\n\t\tlastText = prevText;\n\n\t\tif (!name) return alert(\"名前が空です\");\n\t\telse return;\n\t}\n\n\tif (name && name.length) {\n\t\tconst paramObj = {\n\t\t\tcontent: lastText,\n\t\t\tsplit_units: texts,\n\t\t\tcurrent_pos: pointer,\n\t\t\tname: name,\n\t\t};\n\t\tconst method = \"POST\";\n\t\tconst headers = {\n\t\t\tAccept: \"application/json\",\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t};\n\t\tconst body = JSON.stringify(paramObj);\n\n\t\tconsole.log(name);\n\n\t\tconsole.log(\"onSave\");\n\n\t\tawait fetch(apiUrl, { method: method, headers: headers, body: body }).then(\n\t\t\t(_) => {\n\t\t\t\twindow.location.href = baseUrl + \"list\";\n\t\t\t}\n\t\t);\n\t} else {\n\t\tlastText = prevText;\n\n\t\treturn alert(\"名前が空です\");\n\t}\n}", "title": "" }, { "docid": "3d173ffb77b3a15b23733ce52cf76ce5", "score": "0.5921354", "text": "finishSave() {\n }", "title": "" }, { "docid": "3c7bb817fc15dcd84c1227e96a976d65", "score": "0.592094", "text": "function suggestSave() {\n //ask user to confirm desire to save record before continuing\n\n var r = confirm (\"Would you like to save the current article first? Click OK to save to Cancel to proceed without saving.\");\n\n if (r == true) {\n //if they say yes, save current state of form and put into pouchDB\n //saveArticle includes form validation, saving, and resetting mode once saved\n saveArticle();\n } else {\n toast(\"Wow, you're a risk-taker! Okay, discarding edits without saving.\", \"blue\");\n //changing the hash will trigger the onhashchange listener\n location.hash = \"reset\";\n }\n\n }", "title": "" }, { "docid": "68f1386fb3d2be264c878c77780bff5b", "score": "0.5911965", "text": "function saveRecord() {\n var recordIdToSave = $('#selected-tool-div').attr('data-read-id');\n if (!savedTools.contains(recordIdToSave)) {\n savedTools.addTool(recordIdToSave);\n localStorageSetItem('savedTools', { \"toolSet\" : savedTools.toolSet, \"length\" : savedTools.length });\n toolCache.handleParsedData(recordIdToSave, savedTable.displayTool.bind(savedTable)); // populate divs\n }\n if (savedTools.getLength() > 0) {\n $('#saved-tools-tab').parent().attr(\"aria-hidden\", false);\n document.getElementById(\"saved-tools-tab\").click();\n $('#saved-tools-panel').attr(\"aria-hidden\", false);\n }\n}", "title": "" }, { "docid": "c546b610f3174c82032707b7e66bb01c", "score": "0.59093976", "text": "function ok() {\n //save view\n Appuser.prototype$patchAttributes({\"id\": $scope.data.thisUser.id}, $scope.data.thisUser).$promise\n .then(function(results){\n Logger.info('Saved User Profile');\n\n //close modal\n $uibModalInstance.close(results); \n })\n .catch(function(err){\n Logger.error('Error Saving User Details');\n })\n }", "title": "" }, { "docid": "efe12ab0260cd7dca16eee7613a2be17", "score": "0.5905383", "text": "function MDEC_Save(){\n console.log(\" === MDEC_Save =====\") ;\n console.log( \"mod_MEX_dict: \", mod_MEX_dict);\n\n if(permit_dict.permit_crud && permit_dict.requsr_role_admin){\n\n const upload_dict = {\n table: \"duo_exam\",\n mode: ((mod_MEX_dict.is_addnew) ? \"create\" : \"update\"),\n\n exam_pk: mod_MEX_dict.exam_pk,\n examyear_pk: mod_MEX_dict.examyear_pk,\n depbase_pk: mod_MEX_dict.depbase_pk,\n lvlbase_pk: el_MDEC_select_level.value,\n\n examtype: mod_MEX_dict.examtype,\n exam_pk: mod_MEX_dict.exam_pk,\n\n subject_pk: mod_MEX_dict.sel_subject_pk,\n subject_code: mod_MEX_dict.sel_subject_name,\n\n examperiod: mod_MEX_dict.examperiod,\n version: el_MDEC_input_version.value,\n secret_exam: el_MDEC_checkbox_secret_exam.checked,\n };\n UploadChanges(upload_dict, urls.url_exam_upload);\n };\n\n// --- hide modal\n $(\"#id_mod_duo_exam_create\").modal(\"hide\");\n }", "title": "" }, { "docid": "cdbffdd20e31ed43ec8428afa3eb76ff", "score": "0.5904731", "text": "function save(callback) {\n var id = $scope.data[$scope.action.options.key];\n GeneralModelService.saveWithFiles($scope.model.name, id, $scope.data)\n .then(function(response) {\n if (modalInstance) modalInstance.close();\n $rootScope.$broadcast('modelEditSaved');\n if (callback) callback(response);\n },\n function(error) {\n if (typeof error === 'object' && error.message) {\n alert(error.message);\n } else if (typeof error === 'object' && error.error && error.error.message) {\n alert(error.error.message);\n } else if (typeof error === 'object' && error.code) {\n switch (error.code) {\n case \"ER_DUP_ENTRY\": alert(\"There was a duplicate entry found. Please make sure the entry is unique.\"); break;\n }\n } else if (typeof error === 'object') {\n alert(JSON.stringify(error));\n } else {\n alert(error);\n }\n if (modalInstance) modalInstance.close();\n },\n function(status) {\n if (status.message) $scope.status = status.message;\n if (status.progress) $scope.progress = status.progress;\n });\n }", "title": "" }, { "docid": "d66f9053058518cdcd45627571820ca5", "score": "0.5896329", "text": "function handleSave(event) {\n event.preventDefault();\n\n API.save({\n title: this.title,\n author: this.author[0],\n description: this.description,\n thumbnail: this.thumbnail,\n link: this.link,\n })\n .then((res) => console.log(\"Book has been saved\"))\n .catch((err) => console.log(err));\n }", "title": "" }, { "docid": "fb6cc86467bdfdcf1adf41ab2f3d6ce5", "score": "0.5885735", "text": "function saveHandler() {\n data = {\"words\": words, \"comeAfter\": comeAfter, \"comeBefore\": comeBefore};\n saveDataToServer(\"http://127.0.0.1:9000/save\", data, saveCallBack);\n}", "title": "" }, { "docid": "d8dd58fd63e2cbd36081c22b7c8e83a8", "score": "0.588215", "text": "save() {\n get(this, 'user').save().then(() => {\n get(this, 'flashMessages').clearMessages().success('Profile updated successfully');\n });\n }", "title": "" }, { "docid": "f083c5a3dbcbc6f86df60a3360b307af", "score": "0.5878733", "text": "function savedata() {\n\t\n\tif($('.modified').length > 0) {\n\t\t$('.modified').each(function(e) {\n\t \t$tr = $(this);\n\t \t$tr.find('input:text').hide();\n\t \tif ($tr.find(':input').val() == '0') \n\t \t\t$.post(formPage + $tr.find(':input').serialize() + '&action=insert', function() { });\t \t\n\t \telse \n\t \t\t$.post(formPage + $tr.find(':input').serialize() + '&action=update', function() { });\n\t \t\n\t \t$tr.find('span').show(function() {\n\t \t\t$(this).text($(this).next('input').val()).next('input').remove();\n\t \t});\n\t \t$tr.css('background-color', '#F5E6DA').removeClass('modified').find('img').show();\n\t\t});\n\t}\n\t//load('action=ajax&page=1');\n}", "title": "" }, { "docid": "236e1667bbbe232fc5a7258b31c8ede8", "score": "0.5878456", "text": "save() {\n this.allowSaveState && this.context.save();\n }", "title": "" }, { "docid": "2bf9a1de3b0b870893b5c715514199f4", "score": "0.5876974", "text": "function save() {\n var toSave = [distractionText, musicText, isOn];\n chrome.storage.local.set({'savedContent': toSave});\n}", "title": "" } ]
872f562271f53d7848375bd7b2ee2ec6
All write methods here, a lot of them invokes the Graph methods but should generate corresponding events //////////////////////////////////////////////////////////////// the objected pushed should have a function called do and a function called undo
[ { "docid": "f7a0b61b09cb82694685e3642b0e72b8", "score": "0.58307964", "text": "push_into_undo_stack(undo_obj) {\n // we need to clean items for redo first\n for (var i = 0; i < this.undo_times; i++) {\n this.undo_stack.pop();\n }\n this.undo_times = 0;\n this.undo_stack.push(undo_obj);\n while (this.undo_stack.length > $hope.config.graph.undo_limits) {\n this.undo_stack.shift();\n }\n this.update_toolbar();\n }", "title": "" } ]
[ { "docid": "643a1c1ebc503cee47fb9efda210e1eb", "score": "0.672032", "text": "handle_action(action, data) {\n $hope.log(\"GraphView\", \"[Action]\", action, data);\n switch(action) {\n case \"graph/undo\": {\n let idx = this.undo_stack.length - this.undo_times - 1;\n if (idx >= 0) {\n this.undo_times ++; // eslint-disable-line\n this.undo_stack[idx].undo();\n this.update_toolbar();\n }\n }\n break;\n\n case \"graph/redo\": {\n let idx = this.undo_stack.length - this.undo_times;\n if (this.undo_times > 0) {\n this.undo_times --; // eslint-disable-line\n this.undo_stack[idx].do();\n this.update_toolbar();\n }\n }\n break;\n\n case \"graph/copy\":\n this.copy();\n break;\n\n case \"graph/paste\":\n this.paste();\n break;\n\n case \"graph/move\":\n if (data.phase === \"start\") {\n let undo_obj = {\n action: \"graph/move\",\n start_offset: _.clone(this.offset),\n start_scale: this.zoom_scale,\n undo: () => {\n this.offset = undo_obj.start_offset;\n this.zoom_scale = undo_obj.start_scale;\n this.emit(\"graph\", {id: this.id, type: \"graph\", event: \"moved\"});\n }\n }; \n this.push_into_undo_stack(undo_obj);\n this.move(data.ddx, data.ddy);\n } else if (data.phase === \"end\") { // point to redo\n let undo_obj = $hope.check(_.last(this.undo_stack), \"Graph\",\n \"graph/move didn't find the start undo_obj\");\n $hope.check(undo_obj.action === \"graph/move\", \"Graph\", \n \"graph/move is not matched with start\");\n this.move(data.ddx, data.ddy);\n undo_obj.end_offset = _.clone(this.offset);\n undo_obj.end_scale = this.zoom_scale;\n undo_obj.do = () => {\n this.offset = undo_obj.end_offset;\n this.zoom_scale = undo_obj.end_scale;\n this.emit(\"graph\", {id: this.id, type: \"graph\", event: \"moved\"});\n };\n } else {\n this.move(data.ddx, data.ddy);\n }\n break;\n\n case \"graph/zoom\":\n this.zoom(data.ratio, data.x, data.y);\n break;\n\n case \"graph/fit\": {\n let undo_obj = {\n saved_offset: _.clone(this.offset),\n saved_scale: this.zoom_scale,\n do: () => this.fit(),\n undo: () => {\n this.offset = undo_obj.saved_offset;\n this.zoom_scale = undo_obj.saved_scale;\n this.emit(\"graph\", {id: this.id, type: \"graph\", event: \"scaled\"});\n }\n };\n this.push_into_undo_stack(undo_obj);\n undo_obj.do();\n }\n break;\n\n case \"graph/autolayout\": {\n let undo_obj = {\n saved_positions: {},\n saved_offset: _.clone(this.offset),\n saved_scale: this.zoom_scale,\n do: () => this.autolayout(),\n undo: () => {\n this.offset = undo_obj.saved_offset;\n this.zoom_scale = undo_obj.saved_scale;\n _.forOwn(undo_obj.saved_positions, (n, id) => {\n this.get(\"node\", id).$set_position(n);\n });\n this.set_modified();\n this.emit(\"graph\", {id: this.id, type: \"graph\", event: \"autolayouted\"});\n }\n };\n _.forOwn(this.graph.nodes, n => {\n undo_obj.saved_positions[n.id] = _.clone(n.$get_position());\n });\n this.push_into_undo_stack(undo_obj);\n undo_obj.do();\n }\n break;\n\n case \"graph/create/node\": {\n if (!this.is_editing()) {\n return;\n }\n let o = this.create(\"node\", data.node, data.styles, data.binding);\n let undo_obj = {\n do: () => this.add(o),\n undo: () => this.remove(\"node\", o.id)\n };\n this.push_into_undo_stack(undo_obj);\n }\n break;\n\n case \"graph/remove/node\":\n this._remove_items_action([this.get(\"node\", data.id)]);\n break;\n case \"graph/change/node\":\n this.change(\"node\", data.id, data.node);\n break;\n case \"graph/move/node\": {\n let o = this.get(\"node\", data.id);\n if (!o) {\n return;\n } \n if (data.phase === \"start\") { // point to restore\n let undo_obj = {\n action: \"graph/move/node\",\n node: o,\n start_pos: _.clone(o.$get_position()),\n undo: () => {\n o.$set_position(undo_obj.start_pos);\n this.set_modified();\n this.emit(\"node\", {id: o.id, type: \"node\", event: \"moved\"});\n }\n };\n this.push_into_undo_stack(undo_obj);\n this.move_node(data.id, data.dx, data.dy);\n } else if (data.phase === \"end\") { // point to redo\n let undo_obj = $hope.check(_.last(this.undo_stack), \"Graph\",\n \"graph/move/node didn't find the start undo_obj\");\n $hope.check(undo_obj.action === \"graph/move/node\" &&\n o === undo_obj.node, \"Graph\", \"graph/move/node not matched with start\");\n this.move_node(data.id, data.dx, data.dy);\n undo_obj.end_pos = _.clone(o.$get_position());\n undo_obj.do = () => {\n o.$set_position(undo_obj.end_pos);\n this.set_modified();\n this.emit(\"node\", {id: o.id, type: \"node\", event: \"moved\"});\n };\n } else {\n this.move_node(data.id, data.dx, data.dy);\n }\n }\n break;\n\n case \"graph/merge_styles/node\":\n this.merge_styles(\"node\", data.id, data.styles);\n break; \n case \"graph/resize/node\":\n this.resize_node(data.id, data.size);\n break;\n\n case \"graph/create/edge\":\n this._create_edge(data.edge);\n break;\n\n case \"graph/remove/edge\": {\n let o = this.create(\"edge\", data.id);\n let undo_obj = {\n do: () => this.remove(o),\n undo: () => this.add(\"edge\", o.id)\n };\n this.push_into_undo_stack(undo_obj);\n }\n break;\n\n case \"graph/change/edge\":\n this.change(\"edge\", data.id, data.edge);\n break;\n case \"graph/merge_styles/edge\":\n this.merge_styles(\"edge\", data.id, data.styles);\n break; \n\n case \"graph/unselect/all\":\n this.unselect_all();\n break;\n case \"graph/select/node\":\n this.select(\"node\", data.id, true, data.is_multiple_select);\n break;\n case \"graph/unselect/node\":\n this.select(\"node\", data.id, false);\n break;\n case \"graph/select/edge\":\n this.select(\"edge\", data.id, true, data.is_multiple_select);\n break;\n case \"graph/unselect/edge\":\n this.select(\"edge\", data.id, false);\n break;\n case \"graph/remove/selected\":\n this._remove_items_action(this.selected_nodes, this.selected_edges);\n break;\n\n case \"graph/select/port\":\n this.select_port(data.id, data.name, data.type);\n break;\n\n case \"graph/animate/edge\":\n this._animate(\"edge\", data.id, true);\n break;\n\n case \"graph/unanimate/edge\":\n this._animate(\"edge\", data.id, false);\n break;\n\n case \"graph/animate/node\":\n this._animate(\"node\", data.id, true);\n break;\n\n case \"graph/unanimate/node\":\n this._animate(\"node\", data.id, false);\n break;\n\n case \"graph/step\":\n this.step(data.type);\n break;\n }\n\n $hope.app.stores.ide.update_navigator();\n }", "title": "" }, { "docid": "dd13821266949f100d5f3a8779674085", "score": "0.6268108", "text": "function undoIt(ev) {\n if (undo.length == 0) {\n alert(\"Nothing to undo!\");\n }\n else {\n var oops = undo.pop(); //get what to undo\n if (oops == 'e') {\n //remove edge from array\n var bye_edge = edges.pop();\n start_coords = nodeID(bye_edge.coords[0]).coords;\n end_coords = nodeID(bye_edge.coords[1]).coords;\n remove_edges(start_coords, end_coords, bye_edge.coords[0], bye_edge.coords[1]);//remove photo\n redo.push(['e', bye_edge]); //add to redo\n } \n\n else if (oops == 'n') {\n //remove node from array\n var bye_node = nodes.pop();\n remove_nodes(bye_node.coords);//remove node from drawing\n redo.push(['n', bye_node]);//add to redo\n } \n\n else if (oops[0] == 'dn') { //undo delete node\n var removed = oops[1];\n var removed_edges = oops[2];\n\n //add node and edges back to arrays\n nodes.push(removed);\n for (var i = 0; i < removed_edges.length; i++) {\n edges.push(removed_edges[i]);\n draw_edge(nodeID(removed_edges[i].coords[0]).coords[0], nodeID(removed_edges[i].coords[0]).coords[1], nodeID(removed_edges[i].coords[1]).coords[0], nodeID(removed_edges[i].coords[1]).coords[1], 'black', 2); //redraw edge\n }\n\n draw_node(removed.coords[0], removed.coords[1], radius, colorFind(removed.id, false), 1); \n \n //add to redo\n redo.push(['dn', removed.id]); \n }\n\n else if (oops[0] == 'de') { //undo delete edge\n var removed = oops[1];\n edges.push(removed);\n draw_edge(nodeID(removed.coords[0]).coords[0], nodeID(removed.coords[0]).coords[1], nodeID(removed.coords[1]).coords[0], nodeID(removed.coords[1]).coords[1], 'black', 2); //redraw edge\n\n //add to redo\n redo.push(['de', removed]);\n }\n\n else { //undoing resize\n var node_id = oops[0];\n var coords = oops[1]; //coordinates to reset the node to\n var connected_edges = oops[2];\n var old_coords = nodeID(node_id).coords;\n //remove new drawings\n for (var i = 0; i < connected_edges.length; i++) {\n remove_edges(nodeID(connected_edges[i]).coords, old_coords, connected_edges[i], node_id); \n }\n remove_nodes(old_coords);\n //add new drawings\n for (var i = 0; i < connected_edges.length; i++) { //draw edges\n draw_edge(nodeID(connected_edges[i]).coords[0], nodeID(connected_edges[i]).coords[1], \n coords[0], coords[1], 'black', 2); \n }\n for (var i = 0; i < connected_edges.length; i++) { //draw nodes\n draw_node(nodeID(connected_edges[i]).coords[0], nodeID(connected_edges[i]).coords[1], radius, colorFind(connected_edges[i],false), 1); \n }\n\n draw_node(coords[0], coords[1], radius, colorFind(node_id,false), 1);\n \n nodeID(node_id).coords = coords; //update coords of node\n\n //push to redo\n redo.push([node_id, old_coords, connected_edges]); //node id, old coordinates, connect_id[]\n }\n img_update();\n }\n}", "title": "" }, { "docid": "d4731f7b169779b2435a50ba871726f4", "score": "0.5934582", "text": "doUndo() {\n\n this.outEvtUndo();\n }", "title": "" }, { "docid": "4b90008aefaf4cbbf09b46b48c30e20a", "score": "0.5887005", "text": "applyUndo(e)\n {\n const graph = this.controller.getGraph();\n const node = graph.getNodeByElementID(e.eventData.nodeID);\n if (!node) throw new Error('Unable to find target in graph');\n\n node.setNodeLabel(e.eventData.prevLabel);\n node.setNodeCustom(e.eventData.prevCustom);\n }", "title": "" }, { "docid": "654c071059a6648e1044e3280c451a54", "score": "0.5834492", "text": "function handlePushedObject(object) {\n triggerEvents('sync', object);\n }", "title": "" }, { "docid": "e5286d97211c734b6c16cfb40d9a4cf5", "score": "0.58182955", "text": "function saveAndPush() {\n console.log(\"save and push\");\n save();\n push();\n}", "title": "" }, { "docid": "fe335dcabd4213d96453784d2df7cc12", "score": "0.5764635", "text": "function save() {\n // clear the redo stack\n redo = [];\n $('#redo').prop('disabled', true);\n // initial call won't have a state\n if (state) {\n undo.push(state);\n $('#undo').prop('disabled', false);\n }\n state = JSON.stringify(canvas);\n }", "title": "" }, { "docid": "8c3cab6f7f27c92b9b0a65282b30baba", "score": "0.57296747", "text": "applyUndo(e)\n {\n const graph = this.controller.getGraph();\n let node = null;\n for(const nodeID of e.eventData.nodeIDs)\n {\n node = graph.getNodeByElementID(nodeID);\n if (!node) throw new Error('Unable to find target in graph');\n\n node.x -= e.eventData.dx;\n node.y -= e.eventData.dy;\n }\n }", "title": "" }, { "docid": "7bfe31a412a999629d07eff095dfb7fd", "score": "0.5722958", "text": "function onObjectAdded(event) {\n\tredrawBorder();\n\tvar obj_index;\n\tfor (var i in canvas.getObjects()) {\n\t\tif (canvas.item(i) == event.target ) {\n\t\t\tobj_index = i;\n\t\t}\n\t}\n\n\tvar o = canvas.getObjects();\n\tif (replayFlag === false) {\n\t\tundoHist.push({\n\t\t\t\"action\": \"add\",\n\t\t\t// \"itemNums\": [o.length - 1]\n\t\t\t\"itemNums\": [obj_index]\n\t\t});\n\t\tredoHist = [];\n\t}\n}", "title": "" }, { "docid": "a20cfd044fcf8e7887c543b689c8d9ef", "score": "0.5658305", "text": "applyUndo(e)\n {\n const graph = this.controller.getGraph();\n const nodeIndex = graph.getNodeIndexByID(e.eventData.nodeID);\n if (nodeIndex < 0) throw new Error(\"Unable to find target in graph\");\n const node = graph.nodes[nodeIndex];\n if (e.eventData.prevCustom)\n {\n node.setCustomLabel(e.eventData.prevLabel);\n }\n else\n {\n node.setLabel(e.eventData.prevLabel);\n }\n }", "title": "" }, { "docid": "933773b8b7ceaf460e6918215cc7c5ce", "score": "0.5603826", "text": "mUp(e){\n // creating undo button\n if(Button.selectedShape == \"Undo\"){\n this.objectSet.pop(); //remove latest object added to objectSet\n Button.selectedShape =\"\"; //universal \n }\n\n // creating reset button\n else if(Button.selectedShape == \"Reset\"){\n this.objectSet = []; //clear objectSet\n Button.selectedShape =\"\"; //universal\n }\n\n var objectColour = Swatch.selectedcolour; //setting objectColour to colour of chosen swatch by user\n if(this.mouseDown == true && this.insideBoundary == true){ //pushed shapes will appear only if mouse is down inside boundary box\n this.dx = mini_Button.selectedW; //link width figure to variable to be included in the line class\n this.degrees = mini_Button.selectedD; //link degrees figure to variable to be included in the rotate class\n if(Button.selectedShape == \"Rectangle\"){\n var rect = new Rectangle(this.xMouseStart, this.yMouseStart, this.dw, this.dh, objectColour);\n this.objectSet.push(rect);} //pushing shape into objectSet to appear on canvas when conditions are true\n\n else if(Button.selectedShape == \"Ellipse\"){\n var ellip = new Ellipse(this.xMouseStart, this.yMouseStart, this.dw, this.dh, objectColour);\n this.objectSet.push(ellip);} //pushing shape into objectSet to appear on canvas when conditions are true\n\n else if(Button.selectedShape == \"Diamond\"){\n var diam = new Diamond(this.xMouseStart, this.yMouseStart, this.dw, this.dh, objectColour);\n this.objectSet.push(diam);} //pushing shape into objectSet to appear on canvas when conditions are true\n\n else if(Button.selectedShape == \"Line\"){\n var line = new Line(this.xMouseStart, this.yMouseStart, this.xMouse, this.yMouse, this.dx, objectColour);\n this.objectSet.push(line);} //pushing shape into objectSet to appear on canvas when conditions are true\n\n else if(Button.selectedShape == \"Circle\"){\n var circ = new Circle(this.xMouseStart, this.yMouseStart, this.xMouse, this.yMouse, objectColour);\n this.objectSet.push(circ);} //pushing shape into objectSet to appear on canvas when conditions are true\n\n else if(Button.selectedShape == \"Square\"){\n var squar = new Square(this.xMouseStart, this.yMouseStart, this.dw, this.dh, objectColour);\n this.objectSet.push(squar);} //pushing shape into objectSet to appear on canvas when conditions are true\n\n else if (Button.selectedShape == \"Rotation\"){\n var rotate = new Rotate(this.xMouse, this.yMouse, this.xMouseStart, this.yMouseStart, this.dw, this.dh, this.degrees, objectColour);\n this.objectSet.push(rotate);} //pushing shape into objectSet to appear on canvas when conditions are true\n \n // create rectangle -- crete instance of the rectangle with the parameters\n // push this new object into the array (which will be constantly looped through in the \n // update function\n \n }\n this.mouseDown = false; //mouseDown set to false if not inside boundary\n}", "title": "" }, { "docid": "cb99fd888ebeff10204064383fe3af09", "score": "0.5599793", "text": "_saveUndoCheckpoint () {\n this.saveUndoCheckpoint();\n }", "title": "" }, { "docid": "61a7b75cee5696904c62630212f64fc6", "score": "0.55894715", "text": "function undo() {\n graphEditor.getInteractionHandler().undo();\n}", "title": "" }, { "docid": "16e2a02cac5c874f18bda7c743338f50", "score": "0.55278206", "text": "onSketchPaneBeforeUp () {\n if (!this.sketchPane.paintingKnockout) {\n this.emit('addToUndoStack')\n }\n }", "title": "" }, { "docid": "5ffbb5a0fdbc88a1cd559b7c635dc50e", "score": "0.5526903", "text": "function UndoEvent() {\n this.needPush = true;\n this.finished = true;\n this.keep = false;\n this.isCommit = false;\n}", "title": "" }, { "docid": "281ec84ed8f732db8959f5a6311353d3", "score": "0.55137354", "text": "function setup_undo() {\r\n\r\n svg = document.getElementById(\"svg\")\r\n undo.push(svg.innerHTML)\r\n document.getElementById(\"undo\").onclick = (e) => {\r\n if (e.button === 0) {\r\n if (undo.length > 1) {\r\n svg.innerHTML = undo[undo.length - 2]\r\n redo.push(undo.pop())\r\n actualizare_storage()\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "ea04f1dc5167e44c7badcf63b50d867b", "score": "0.5497418", "text": "constructor (os, model, contents, opContents) {\n this._model = model.id\n this.os = os\n this.map = Y.utils.copyObject(model.map)\n this.contents = contents\n this.opContents = opContents\n this.eventHandler = new Y.utils.EventHandler(op => {\n var oldValue\n // key is the name to use to access (op)content\n var key = op.struct === 'Delete' ? op.key : op.parentSub\n\n // compute oldValue\n if (this.opContents[key] != null) {\n let prevType = this.opContents[key]\n oldValue = () => {// eslint-disable-line\n return new Promise((resolve) => {\n this.os.requestTransaction(function *() {// eslint-disable-line\n var type = yield* this.getType(prevType)\n resolve(type)\n })\n })\n }\n } else {\n oldValue = this.contents[key]\n }\n // compute op event\n if (op.struct === 'Insert') {\n if (op.left === null) {\n var value\n // TODO: what if op.deleted??? I partially handles this case here.. but need to send delete event instead. somehow related to #4\n if (op.opContent != null) {\n value = () => {// eslint-disable-line\n return new Promise((resolve) => {\n this.os.requestTransaction(function *() {// eslint-disable-line\n var type = yield* this.getType(op.opContent)\n resolve(type)\n })\n })\n }\n delete this.contents[key]\n if (op.deleted) {\n delete this.opContents[key]\n } else {\n this.opContents[key] = op.opContent\n }\n } else {\n value = op.content[0]\n delete this.opContents[key]\n if (op.deleted) {\n delete this.contents[key]\n } else {\n this.contents[key] = op.content[0]\n }\n }\n this.map[key] = op.id\n if (oldValue === undefined) {\n this.eventHandler.callEventListeners({\n name: key,\n object: this,\n type: 'add',\n value: value\n })\n } else {\n this.eventHandler.callEventListeners({\n name: key,\n object: this,\n oldValue: oldValue,\n type: 'update',\n value: value\n })\n }\n }\n } else if (op.struct === 'Delete') {\n if (Y.utils.compareIds(this.map[key], op.target)) {\n delete this.opContents[key]\n delete this.contents[key]\n this.eventHandler.callEventListeners({\n name: key,\n object: this,\n oldValue: oldValue,\n type: 'delete'\n })\n }\n } else {\n throw new Error('Unexpected Operation!')\n }\n })\n }", "title": "" }, { "docid": "1148479987d8afae81b714b84ca34a98", "score": "0.5470773", "text": "saveData(e) {\n this.editorManager.undoRedoManager.saveData(e);\n }", "title": "" }, { "docid": "9df953878f2dd691267a0435f059c282", "score": "0.5470105", "text": "studentACStack() {\n console.log(1);\n this.get('undoNameStack').pushObject(\"admissionComments\");\n var tempstudent = this.get('currentStudent').get('admissionComments');\n this.get('undoStack').pushObject(tempstudent);\n }", "title": "" }, { "docid": "ed8f9ef50bfed45c62a3917cf3102987", "score": "0.54576206", "text": "mUp(e){\n //console.log(\"mouse up event\");\n \n // create the drag and drop rectangle if mouseDown is true\n if (this.mouseDown == true){\n if (Button.Shape == \"Rectangle\"){\n // rectangle object is created, using the dimesions of the draw guide\n var temp= new Rectangle(this.xMouseStart, this.yMouseStart, this.w, this.h, Swatch.Colour );\n // add new object to object list\n this.ObjectSet.push(temp);\n }else if(Button.Shape == \"Ellipse\"){\n // ellipse object is created, using the dimesions of the draw guide\n var temp = new Ellipse(this.xMouseStart, this.yMouseStart, this.w, this.h, Swatch.Colour );\n //console.log(temp)\n // add new object to object list\n this.ObjectSet.push(temp); \n }\n else if(Button.Shape == \"Triangle\"){\n // triangle object is created, using the dimesions of the draw guide\n var temp = new Triangle(this.xMouseStart, this.yMouseStart, this.w, this.h, Swatch.Colour);\n //console.log(temp)\n // add new object to object list\n this.ObjectSet.push(temp); \n }\n else if(Button.Shape == \"Polygon\"){\n // polygon object is created, using the dimesions of the draw guide\n var temp = new Polygon(this.xMouseStart + this.w/2, this.yMouseStart + this.h/2, this.h, this.w, Polygon_buttons.Sides, Swatch.Colour);\n // add new object to object list\n this.ObjectSet.push(temp); \n }\n else if(Button.Shape == \"Line\"){\n // line object is created, using the dimesions of the draw guide\n var temp = new Line(this.xMouseStart, this.yMouseStart, this.xMouse, this.yMouse, 10, Swatch.Colour);\n // add new object to object list\n this.ObjectSet.push(temp); \n }\n else if(Button.Shape == \"Diamond\"){\n // diamond object is created, using the dimesions of the draw guide\n var temp = new Diamond(this.xMouseStart, this.yMouseStart, this.w, this.h, Swatch.Colour);\n // add new object to object list\n this.ObjectSet.push(temp); \n }\n \n }\n\n //console.log(temp)\n this.mouseDown = false;\n \n\n }", "title": "" }, { "docid": "01b56114be62a7db6cc885a55e1865c0", "score": "0.54493827", "text": "function Undo() {\n this.undoItem = null;\n this.curItem = null;\n this.action = \"\";\n this.isUndo = false;\n this.undoIndex = 0;\n\n this.runUndo = function() {\n var option = this.action.split( '-' );\n if( option.length == 2 ) {\n switch( option[0] ) {\n case \"add\":\n this.undoAdd( option[1], \"-R\" );\n break;\n case \"delete\":\n this.undoDelete( option[1], \"-R\" );\n break;\n case \"move\":\n this.undoMove( option[1], \"-R\" );\n break;\n default:\n break;\n }\n }\n };\n\n this.runRedo = function() {\n var option = this.action.split( '-' );\n if( option.length == 3 ) {\n switch( option[0] ) {\n case \"add\":\n this.undoAdd( option[1] );\n break;\n case \"delete\":\n this.undoDelete( option[1] );\n //#TODO: should there be a break here? I put it in, needs to be tested.\n break;\n case \"move\":\n this.undoMove( option[1] );\n break;\n }\n }\n };\n\n this.undoMove = function( action, undoKey ) {\n if( isNull( undoKey ) ) {\n undoKey = \"\";\n }\n this.action = \"move-\" + action + undoKey;\n var json;\n if( action == \"background\" ) {\n json = JSON.parse( this.undoItem );\n this.undoItem = '{\"left\":\"' + g_selBackground.get( 'left' ) + '\",';\n this.undoItem += '\"top\":\"' + g_selBackground.get( 'top' ) + '\"}';\n g_selBackground.set( 'left', parseFloat( json.left ) );\n g_selBackground.set( 'top', parseFloat( json.top ) );\n setDistances();\n } else {\n json = JSON.parse( this.undoItem );\n this.setUndoItem( this.curItem );\n this.curItem.set( 'left', parseFloat( json.left ) * default_zoom / page_zoom + g_selBackground.get( 'left' ) );\n this.curItem.set( 'top', parseFloat( json.top ) * default_zoom / page_zoom + g_selBackground.get( 'top' ) );\n this.curItem.set( 'scaleX', parseFloat( json.scaleX ) * default_zoom / page_zoom );\n this.curItem.set( 'scaleY', parseFloat( json.scaleY ) * default_zoom / page_zoom );\n this.curItem.setAngle( parseFloat( json.angle ) );\n }\n canvas.renderAll();\n };\n\n this.undoDelete = function( action, undoKey ) {\n if( isNull( undoKey ) ) {\n undoKey = \"\";\n }\n this.action = \"delete-\" + action + undoKey;\n var json;\n // redo\n if( undoKey == \"\" ) {\n this.setUndoItem( this.curItem );\n canvas.remove( this.curItem );\n }\n //undo\n else {\n json = JSON.parse( this.undoItem );\n this.loadData( json );\n }\n };\n\n this.undoAdd = function( action, undoKey ) {\n if( isNull( undoKey ) ) {\n undoKey = \"\";\n }\n this.action = \"add-\" + action + undoKey;\n var json;\n if( action == \"text\" || action == \"trinket\" ) {\n json = JSON.parse( this.undoItem );\n $( '#addTextBox' ).hide();\n if( undoKey == \"\" ) {\n this.loadData( json );\n this.undoItem = \"{}\";\n } else {\n this.setUndoItem( this.curItem );\n canvas.remove( this.curItem );\n }\n } else if( action == \"border\" ) {\n json = JSON.parse( this.undoItem );\n this.setUndoItem( this.curItem );\n canvas.remove( this.curItem );\n this.loadData( json );\n } else if( action == \"filter\" ) {\n var selObj = this.curItem;\n json = JSON.parse( this.undoItem );\n this.setUndoItem( this.curItem );\n var filter;\n if( this.curItem.type == \"group\" ) {\n var items = selObj.getObjects();\n selObj = items[1];\n filter = json.items[1].filter;\n } else {\n filter = json.filter;\n }\n removeFilter( selObj );\n setFilters( selObj, filter );\n } else if( action == \"background\" ) {\n json = JSON.parse( this.undoItem );\n this.setUndoItem( g_selBackground );\n canvas.remove( g_selBackground );\n g_selBackground = null;\n json.type = \"group\";\n this.curItem = this.loadData( json );\n } else if( action == \"backgroundColor\" ) {\n canvas.backgroundColor = g_UndoObject.undoItem;\n g_UndoObject.undoItem = g_UndoObject.curItem;\n g_UndoObject.curItem = canvas.backgroundColor;\n canvas.renderAll();\n } else if( action == \"backgroundImage\" ) {\n canvas.setBackgroundImage( g_UndoObject.undoItem, canvas.renderAll.bind( canvas ) );\n g_UndoObject.undoItem = g_UndoObject.curItem;\n g_UndoObject.curItem = canvas.backgroundImage.src;\n }\n };\n\n this.loadData = function( item ) {\n var back_posx = g_selBackground.get( 'left' );\n var back_posy = g_selBackground.get( 'top' );\n if( item.type == \"text\" ) {\n var text = new fabric.Text( unescape( item.text ), {\n fontFamily: item.fontFamily,\n fill: item.fill,\n left: parseFloat( item.left ) * default_zoom / page_zoom + back_posx,\n top: parseFloat( item.top ) * default_zoom / page_zoom + back_posy,\n angle: item.angle,\n scaleX: parseFloat( item.scaleX ) * default_zoom / page_zoom,\n scaleY: parseFloat( item.scaleY ) * default_zoom / page_zoom\n } );\n text.textAlign = item.textAlign;\n canvas.insertAt( text, this.undoIndex );\n $( '#addTextBox' ).hide();\n } else if( item.type == \"image\" ) {\n var imgObj = null;\n var index = this.undoIndex;\n fabric.Image.fromURL( item.src, function( obj ) {\n obj.set( 'left', parseFloat( item.left ) * default_zoom / page_zoom + back_posx );\n obj.set( 'top', parseFloat( item.top ) * default_zoom / page_zoom + back_posy );\n obj.set( 'scaleX', parseFloat( item.scaleX ) * default_zoom / page_zoom );\n obj.set( 'scaleY', parseFloat( item.scaleY ) * default_zoom / page_zoom );\n obj.setAngle( item.angle );\n setFilters( obj, item.filter );\n canvas.insertAt( obj, index );\n } );\n } else if( item.type == \"group\" ) {\n var objarray = [];\n imgObj = loadGroup( objarray, 0, item, this.undoIndex );\n }\n return canvas.item( this.undoIndex );\n };\n this.setUndoItem = function( item ) {\n if( isNull( item ) ) {\n this.undoItem = \"\";\n return;\n }\n var type = item.type;\n if( type == \"image\" ) {\n this.undoItem = getImageToJson( item );\n } else if( type == \"text\" ) {\n this.undoItem = getTextToJson( item );\n } else if( type == \"group\" ) {\n this.undoItem = getGroupToJson( item );\n }\n this.undoIndex = canvas.getObjects().indexOf( item );\n };\n this.setCurItem = function( item ) {\n this.curItem = item;\n };\n}", "title": "" }, { "docid": "1aa0d12b1f0e72a5a57df4f67360a113", "score": "0.5437431", "text": "function setup_redo() {\r\n document.getElementById(\"redo\").onclick = (e) => {\r\n if (e.button === 0) {\r\n if (redo.length > 0) {\r\n svg.innerHTML = redo[redo.length - 1]\r\n undo.push(redo.pop())\r\n }\r\n }\r\n actualizare_storage()\r\n }\r\n}", "title": "" }, { "docid": "b6222f6cfe594559e08999faa18d313e", "score": "0.543404", "text": "function RedoEvent() {\n this.needPush = true;\n this.finished = true;\n this.keep = false;\n this.isCommit = false;\n}", "title": "" }, { "docid": "7e1aa9e67c3f988882906717ea2df121", "score": "0.54048884", "text": "studentRCStack() {\n console.log(1);\n this.get('undoNameStack').pushObject(\"registrationComments\");\n var tempstudent = this.get('currentStudent').get('registrationComments');\n this.get('undoStack').pushObject(tempstudent);\n }", "title": "" }, { "docid": "a948a4798b04a622c673581bd8037389", "score": "0.5403428", "text": "emit(obj) {\n this.queue.push(obj);\n this.maybeFlushQueue();\n }", "title": "" }, { "docid": "37bf42d0c48399e59281ea254a0c2820", "score": "0.53767586", "text": "function vm_saveundo() {\n ;;;if (memmap.length != self.endmem) {\n ;;; fatal_error(\"Memory length was incorrect before saveundo.\"); //assert\n ;;;}\n\n var snapshot = {};\n snapshot.ram = memmap.slice(ramstart);\n snapshot.endmem = self.endmem;\n snapshot.pc = self.pc;\n snapshot.stack = [];\n for (var i = 0; i < stack.length; i++) {\n snapshot.stack[i] = clone_stackframe(stack[i]);\n }\n\n snapshot.heapstart = heapstart;\n snapshot.usedlist = usedlist.slice(0);\n snapshot.freelist = freelist.slice(0);\n\n undostack.push(snapshot);\n if (undostack.length > 10) {\n undostack.shift();\n }\n}", "title": "" }, { "docid": "82f6155504794b942cf563ca42d3df83", "score": "0.5371785", "text": "performUndo() {\n console.log(\"perform undo\")\n const u = this.undo\n if (u.buf.length == 0) throw new StoreError(\"undo buffer is empty\")\n const m = u.buf.pop()\n u.at = null\n this.qMutation(null, m.mutation)\n }", "title": "" }, { "docid": "5bbed9d71f4537c2d81a7876347abc5e", "score": "0.5366012", "text": "function cmdUndo() {\n\tif( UndoStack.length > 0 ) {\n\t\tvar redoInfo = getUndo();\n\t\tvar undoInfo = UndoStack.pop();\n\t\tapplyUndo(undoInfo);\n\t\tRedoStack.push(redoInfo);\n\t\tpaper.view.draw();\n\t}\n}", "title": "" }, { "docid": "b21f3da8bdbc5b3afd2c29f3e3700216", "score": "0.53061044", "text": "update_board (e) {\n // update board's position\n if(e.change) this.board.update(e.change);\n\n // remove old markers from the board\n if(this.state.temp_marks) this.board.removeObject(this.state.temp_marks);\n\n // init array for new objects\n var add = [];\n\n // add current move marker\n if(e.node.move && this.state.markLastMove) {\n if(e.node.move.pass){\n\n }else{\n add.push({\n type: \"CR\",\n x: e.node.move.x,\n y: e.node.move.y\n });\n }\n }\n\n // add variation letters\n if(e.node.children.length > 1 && this.state.displayVariations) {\n for(let i = 0; i < e.node.children.length; i++) {\n if(e.node.children[i].move && !e.node.children[i].move.pass)\tadd.push({\n type: \"LB\",\n text: String.fromCharCode(65+i),\n x: e.node.children[i].move.x,\n y: e.node.children[i].move.y,\n c: this.board.theme.variationColor || \"rgba(0,32,128,0.8)\"\n });\n }\n }\n\n // add other markup\n if(e.node.markup) {\n for(let i in e.node.markup) {\n for(let j = 0; j < add.length; j++) {\n if(e.node.markup[i].x == add[j].x && e.node.markup[i].y == add[j].y) {\n add.splice(j,1);\n j--;\n }\n }\n }\n add = add.concat(e.node.markup);\n }\n\n // add new markers on the board\n this.state.temp_marks = add;\n this.board.addObject(add);\n }", "title": "" }, { "docid": "61d3db6a9335930d269b5ce5036711d1", "score": "0.53059447", "text": "studentAAStack() {\n console.log(1);\n this.get('undoNameStack').pushObject(\"admissionAverage\");\n var tempstudent = this.get('currentStudent').get('admissionAverage');\n this.get('undoStack').pushObject(tempstudent);\n }", "title": "" }, { "docid": "de15da6f7fcd59c849a5262325fe4d10", "score": "0.5305376", "text": "studentBOAStack() {\n console.log(1);\n this.get('undoNameStack').pushObject(\"basisOfAdmission\");\n var tempstudent = this.get('currentStudent').get('basisOfAdmission');\n this.get('undoStack').pushObject(tempstudent);\n }", "title": "" }, { "docid": "f39fccb00c75d427ca70dd49df9b828c", "score": "0.52956563", "text": "function _overwrite(args, t) {\n\t var previous = _stack[_index].graph;\n\t if (_index > 0) {\n\t _index--;\n\t _stack.pop();\n\t }\n\t _stack = _stack.slice(0, _index + 1);\n\t var actionResult = _act(args, t);\n\t _stack.push(actionResult);\n\t _index++;\n\t return change(previous);\n\t }", "title": "" }, { "docid": "7d1c2316db6d6ef6609f0e51634a8050", "score": "0.5289291", "text": "undo_pre(ctx) {\n this._undo = G.create_undo_file();\n }", "title": "" }, { "docid": "64d2fa5b0b9ac4edf0533988abdaa7fa", "score": "0.52884364", "text": "function snapshot() {\n oldData.push(JSON.parse(JSON.stringify(data)));\n $('#undo').prop('disabled', false); // enable undo button\n }", "title": "" }, { "docid": "838966466220151db7bf171038bb90b6", "score": "0.52694625", "text": "applyUndo(e)\n {\n //TODO: when formatting edges change an edge different than this one, it does not revert them.\n const graph = this.controller.getGraph();\n const edge = graph.getEdgeByElementID(e.eventData.edgeID);\n if (!edge) throw new Error('Unable to find target in graph');\n\n graph.deleteEdge(edge);\n }", "title": "" }, { "docid": "86ec2f83f9085ec47af84733d222b57e", "score": "0.5267646", "text": "pushUndo(tagline, mutation) {\n const now = Date.now()\n const u = this.undo\n if (u.at && u.buf.length > 0 && now-u.at < 60000 && tagline == u.buf[u.buf.length-1].tagline)\n {\n // coalesce FIXME: should also coalesce mutations that update the same thing...\n //console.log(\"undo coalesce\")\n u.buf[u.buf.length-1].mutation = [ ...mutation, ...u.buf[u.buf.length-1].mutation ]\n } else {\n // std push\n u.at = now\n u.buf.push({tagline, mutation})\n while (u.buf.length > 10) u.buf.shift()\n }\n }", "title": "" }, { "docid": "868ebe45bb87b83cd2562ef39f716d45", "score": "0.5265845", "text": "save() {\n socket._.emit('req-save', {\n d: game.board.getData(),\n m: game.board.getMoved(),\n t: game.taken\n });\n }", "title": "" }, { "docid": "4f49eec3bbaa314ae6b757c427457336", "score": "0.5254016", "text": "mMove(e){\n this.xMouse = e.offsetX;\n this.yMouse = e.offsetY;\n\n //console.log(\"mouse move event\");\n\n // \n if(this.mouseDown == true && this.inBoundsCheck(this.xMouse, this.yMouse, this.Dx, this.Dy, this.Dw, this.Dh) && Button.Shape == \"Brush\"){\n if (Circle_buttons.Value == \"S\"){\n // line object is created, using the dimesions of the draw guide\n var temp = new Brush(this.xMouse, this.yMouse, 10, Swatch.Colour);\n // add new object to object list\n this.ObjectSet.push(temp);\n }\n else if (Circle_buttons.Value == \"M\"){\n // line object is created, using the dimesions of the draw guide\n var temp = new Brush(this.xMouse, this.yMouse, 15, Swatch.Colour);\n // add new object to object list\n this.ObjectSet.push(temp);\n }\n else if (Circle_buttons.Value == \"L\"){\n // line object is created, using the dimesions of the draw guide\n var temp = new Brush(this.xMouse, this.yMouse, 20, Swatch.Colour);\n // add new object to object list\n this.ObjectSet.push(temp);\n }\n else{\n // line object is created, using the dimesions of the draw guide\n var temp = new Brush(this.xMouse, this.yMouse, 15, Swatch.Colour);\n // add new object to object list\n this.ObjectSet.push(temp);\n }\n\n }\n }", "title": "" }, { "docid": "f989503ebf8811ed8b5608a0f46ac0e5", "score": "0.52356684", "text": "applyRedo(e)\n {\n const graph = this.controller.getGraph();\n let edge = graph.getEdgeByElementID(e.postData.edgeID);\n\n const from = graph.getNodeByElementID(e.postData.fromID);\n if (!from) throw new Error('Trying to create a sourceless edge');\n const to = graph.getNodeByElementID(e.postData.toID) || null;\n\n if (!edge)\n {\n edge = graph.createEdge(from, to, e.postData.edgeID);\n }\n else\n {\n edge.setEdgeFrom(from);\n edge.changeDestinationNode(to);\n }\n\n edge.setEdgeLabel(e.postData.label);\n edge.setQuadraticRadians(e.postData.quad.radians);\n edge.setQuadraticLength(e.postData.quad.length);\n }", "title": "" }, { "docid": "393d4207898af72d3ab295d308c5aadc", "score": "0.5230594", "text": "undo() {}", "title": "" }, { "docid": "88879542c41d1ca0e721504e4249ec64", "score": "0.5225678", "text": "studentLNStack() {\n console.log(1);\n this.get('undoNameStack').pushObject(\"lastName\");\n var tempstudent = this.get('currentStudent').get('lastName');\n this.get('undoStack').pushObject(tempstudent);\n }", "title": "" }, { "docid": "f6e66a9c5fce86127539b06fcea6527f", "score": "0.52237135", "text": "trigger(event) {\r\n if(this.fsm.states[this.state].transitions[event]!=null){\r\n this._undo.push(this.state);\r\n this.state = this.fsm.states[this.state].transitions[event];\r\n this._redo=[];\r\n }\r\n else throw Error();\r\n }", "title": "" }, { "docid": "bc0c577bf0669d6acdf9c338af984855", "score": "0.5195794", "text": "undo() {\n if (this.game != undefined) {\n if (this.game.moveCounter == 0)\n return;\n if (this.playingOption == \"Bot v Bot\")\n return;\n if (this.checkForMovement() == 1)\n return;\n let translation = [];\n let position = this.pieceMoves[this.game.moveCounter - 1][\"position\"];\n this.graph.piecePositions[this.pieceMoves[this.game.moveCounter - 1][\"id\"] - 1] = position;\n translation[0] = this.pieceMoves[this.game.moveCounter - 1][\"animation\"].translates[2][2];\n translation[1] = -this.pieceMoves[this.game.moveCounter - 1][\"animation\"].translates[2][1];\n translation[2] = -this.pieceMoves[this.game.moveCounter - 1][\"animation\"].translates[2][0];\n let undoAnimation = new PieceAnimation(translation);\n this.themes[this.selectedTheme].XML.components['piece' + this.pieceMoves[this.game.moveCounter - 1][\"id\"]][\"animation\"] = undoAnimation;\n this.themes[this.selectedTheme].XML.animations['movement' + this.pieceMoves[this.game.moveCounter - 1][\"id\"]] = undoAnimation;\n this.game.undo();\n if (this.playingOption == \"Player v Bot\") {\n position = this.pieceMoves[this.game.moveCounter - 1][\"position\"];\n this.graph.piecePositions[this.pieceMoves[this.game.moveCounter - 1][\"id\"] - 1] = position;\n translation[0] = this.pieceMoves[this.game.moveCounter - 1][\"animation\"].translates[2][2];\n translation[1] = -this.pieceMoves[this.game.moveCounter - 1][\"animation\"].translates[2][1];\n translation[2] = -this.pieceMoves[this.game.moveCounter - 1][\"animation\"].translates[2][0];\n let undoAnimation2 = new PieceAnimation(translation);\n this.themes[this.selectedTheme].XML.components['piece' + this.pieceMoves[this.game.moveCounter - 1][\"id\"]][\"animation\"] = undoAnimation2;\n this.themes[this.selectedTheme].XML.animations['movement' + this.pieceMoves[this.game.moveCounter - 1][\"id\"]] = undoAnimation2;\n this.game.undo();\n }\n else {\n if (this.redTurn) {\n this.redTurn = false;\n this.greenTurn = true;\n }\n else if (this.greenTurn) {\n this.redTurn = true;\n this.greenTurn = false;\n }\n }\n }\n }", "title": "" }, { "docid": "00c908bbaec37da18a05b4c9ad75eefd", "score": "0.5189295", "text": "trigger(event) {\r\n let current = this.getState();\r\n if(this.states[current].transitions.hasOwnProperty(event)){\r\n this.redoBuffer = [];\r\n this.undoBuffer.push(this.initial);\r\n this.initial = this.states[current].transitions[event];\r\n }\r\n else throw new Error('error');\r\n }", "title": "" }, { "docid": "8e4c6c91728fab0ca86e8a74c645e47a", "score": "0.51791084", "text": "function push() {\n var lastState = newState(),\n i;\n\n copyModelState(lastState);\n list[listState.index+1] = lastState;\n\n // Drop the oldest state if we went over the max list size\n if (list.length > listState.maxSize) {\n list.splice(0,1);\n listState.startCounter++;\n } else {\n listState.index++;\n }\n listState.counter = listState.index + listState.startCounter;\n\n // Send push request to external objects defining TickHistoryCompatible Interface.\n for (i = 0; i < externalObjects.length; i++) {\n externalObjects[i].push();\n }\n\n invalidateFollowingState();\n listState.length = list.length;\n }", "title": "" }, { "docid": "65b8b068f3f9f5008fdae99939207a8f", "score": "0.51783663", "text": "function ObjectMover() {\n $U.extend(this, new ObjectConstructor()); //Héritage\n var draggedObject = null;\n this.getCode = function() {\n return \"objectmover\";\n };\n\n // Retourne 0 pour un outil standard, 1 pour un outil de changement de propriété\n this.getType = function() {\n return 1;\n };\n\n this.isAcceptedInitial = function(o) {\n return true;\n };\n\n this.createObj = function(zc, ev) {\n draggedObject = null;\n };\n\n this.selectCreatePoint = function(zc, ev) {};\n\n var x0 = 0,\n y0 = 0;\n this.preview = function(ev, zc) {\n if (draggedObject) {\n draggedObject.dragTo(zc.mouseX(ev) + x0, zc.mouseY(ev) + y0);\n zc.getConstruction().compute();\n } else {\n draggedObject = this.getC(0);\n if ((draggedObject) && (draggedObject.getFamilyCode() === \"point\")) {\n x0 = draggedObject.getX() - zc.mouseX(ev);\n y0 = draggedObject.getY() - zc.mouseY(ev);\n } else {\n x0 = 0;\n y0 = 0;\n }\n if (draggedObject) draggedObject.startDrag(zc.mouseX(ev) + x0, zc.mouseY(ev) + y0);\n }\n\n };\n\n\n}", "title": "" }, { "docid": "39dbe49f18d98bfcf10de15192ee65b7", "score": "0.5174222", "text": "trigger(event) {\r\n this.state = this.config.states[this.state].transitions[event];\r\n this.undoStack.push(this.state);\r\n this.redoStack.length = 0;\r\n }", "title": "" }, { "docid": "766f495349369fb88a03def1915c36e7", "score": "0.51707244", "text": "function saveUndo(undoInfo) {\n\tUndoStack.push(undoInfo);\n\tRedoStack = [];\n}", "title": "" }, { "docid": "30bc548a520fd3f7fb746edfbe55d845", "score": "0.51589155", "text": "saveState() {\n if (!this.expressionNodes) return;\n // TODO: DML save and restore the environment as well.\n var board = this.expressionNodes().map((n) => n.clone());\n board = board.filter((n) => !(n instanceof ExpressionEffect));\n var toolbox = this.toolboxNodes().map((n) => n.clone());\n this.stateStack.push( { 'board':board, 'toolbox':toolbox } );\n }", "title": "" }, { "docid": "f2fdae28fb599cdd98e8bc876c91479f", "score": "0.51579565", "text": "function emitEvent(layer_num) {\n if (!isLoadDataLocal) {\n let json = canvas.getObjects();\n canvas.item(json.length - 1).clone(async (lastObject) => {\n if (lastObject) {\n lastObject.stroke = getColor();\n lastObject.strokeWidth = getPencil();\n lastObject.objectID = \"\";\n console.log(lastObject)\n let data = {\n w: w,\n h: h,\n 'drawing': drawing,\n 'color': getColor(),\n 'id': id,\n 'userID': userID,\n 'objectID': randomID(),\n 'username': username,\n 'spessremo': getPencil(),\n 'room': stanza,\n 'layer': layer_num - 3,\n data: lastObject\n };\n // console.log(data);\n //console.log(data);\n pool_data.push(data);\n socket.emit('drawing', data);\n canvas.item(json.length - 1).set({\n objectID: data.objectID,\n userID: userID\n })\n if (canvas.item(json.length - 1)._objects /* && canvas.item(json.length - 1)._objects.length > 2 && canvas.item(json.length - 1)._objects[0].type != 'image' */) {\n addPort(canvas.item(json.length - 1), canvas, data.objectID);\n }\n canvas.requestRenderAll();\n }\n })\n }\n }", "title": "" }, { "docid": "3bdbad39f8e36d3cb419234daa582b72", "score": "0.5146656", "text": "function saveAsPreviousCommandDetails(command){\n User.setProperty('previousCommand', command,'Object');\n}", "title": "" }, { "docid": "ee725ce88ee7fa1588f5bd1ee3eac046", "score": "0.5143567", "text": "function saveCanvas(ev) {\n console.log(\"test\")\n var sor = new SOR();\n sor.objName = \"model\";\n sor.vertices = oldlines;\n sor.indexes = []\n for (let i=0;i<oldlines.length;i++){\n for (let j=0;j<oldlines[i].length;j++){\n sor.indexes.push(oldlines[i][j])\n }\n }\n saveFile(sor);\n}", "title": "" }, { "docid": "3bfdb294350fb6d15e8d26fec3d6b463", "score": "0.5141084", "text": "function createChange(name, op, obj) {\n self.changes.push({\n name: name,\n operation: op,\n obj: JSON.parse(JSON.stringify(obj))\n });\n }", "title": "" }, { "docid": "3bfdb294350fb6d15e8d26fec3d6b463", "score": "0.5141084", "text": "function createChange(name, op, obj) {\n self.changes.push({\n name: name,\n operation: op,\n obj: JSON.parse(JSON.stringify(obj))\n });\n }", "title": "" }, { "docid": "3bfdb294350fb6d15e8d26fec3d6b463", "score": "0.5141084", "text": "function createChange(name, op, obj) {\n self.changes.push({\n name: name,\n operation: op,\n obj: JSON.parse(JSON.stringify(obj))\n });\n }", "title": "" }, { "docid": "edb558d86664b7b51c7c4132410e4bfe", "score": "0.51340806", "text": "function addUndo(elem){\n undo.push(elem);\n}", "title": "" }, { "docid": "9a6ed8dd32730d26c22e6f91487aa181", "score": "0.512854", "text": "applyRedo(e)\n {\n const graph = this.controller.getGraph();\n let node = null;\n for(const nodeID of e.eventData.nodeIDs)\n {\n node = graph.getNodeByElementID(nodeID);\n if (!node) throw new Error('Unable to find target in graph');\n\n node.x += e.eventData.dx;\n node.y += e.eventData.dy;\n }\n }", "title": "" }, { "docid": "371cbda4bab50acbbeb533fbd60d4c32", "score": "0.51275975", "text": "function undo(){\n\tvar id = undothis[0][0];\n\tvar type = undothis[0][1];\n\tvar param = undothis[0][2];\n\tvar val = undobuffer[0][param];\n\t//console.log(\"undo to\"+\" \"+id+\" \"+type+\" \"+param+\" \"+val);\n\t\n\tlivid[type][id][param]=val;\n\t//send old value back to controller:\n\tobToSx();\n\t//**SCHEDULE THIS\n\t/*\n\tfor(i in cmds[type]){\n\t\tcmdout(cmds[type][i]);\n\t}\n\t*/\n\tsomesysex(cmds[type]);\n\t//update interface:\n\tgetid(type+\"_\"+id);\n}", "title": "" }, { "docid": "93b55a820e498aba0f86f82a59c0b278", "score": "0.5127296", "text": "push() {\n\t\tthis.saveData.push([...this.traversed]);\n\t}", "title": "" }, { "docid": "0946ebec25cdcd62d10bbc0673ca05de", "score": "0.51203763", "text": "onSketchPaneDown () {\n if (this.sketchPane.paintingKnockout) {\n if (this.isMultiLayerOperation) {\n this.emit('addToUndoStack', this.visibleLayersIndices)\n } else {\n this.emit('addToUndoStack')\n }\n }\n }", "title": "" }, { "docid": "85cdcb6f2f398ae2e1a2d9f4a1bd09a9", "score": "0.5118347", "text": "function redo() {\n graphEditor.getInteractionHandler().redo();\n}", "title": "" }, { "docid": "4d5d062925d9c9c6cb0bf6c0eb84adb1", "score": "0.51134783", "text": "function commitMouseUndo() {\n\tif( mouseUndo !== undefined ) {\n\t\tsaveUndo(mouseUndo);\n\t\tmouseUndo = undefined;\n\t}\n}", "title": "" }, { "docid": "989e88e9fdca7c2482e10a7061ea96ff", "score": "0.5112855", "text": "push(newNode) {\n \n }", "title": "" }, { "docid": "20ff2ed025671bbff51d83d11a435e32", "score": "0.51127964", "text": "pushUndo(cb) {\n return _undo.push(cb);\n }", "title": "" }, { "docid": "a8a64b21c24be954c41c250b1a7b34cb", "score": "0.5111968", "text": "studentFNStack() {\n console.log(1);\n this.get('undoNameStack').pushObject(\"firstName\");\n var tempstudent = this.get('currentStudent').get('firstName');\n this.get('undoStack').pushObject(tempstudent);\n }", "title": "" }, { "docid": "6b18cd2e7c29f352172efbd303d7547b", "score": "0.51062715", "text": "applyRedo(e)\n {\n const graph = this.controller.getGraph();\n const node = graph.getNodeByElementID(e.eventData.nodeID);\n if (!node) throw new Error('Unable to find target in graph');\n\n node.setNodeLabel(e.eventData.nextLabel);\n node.setNodeCustom(true);\n }", "title": "" }, { "docid": "ed00c18938eca98e2423820528851919", "score": "0.51057017", "text": "function createChange(name, op, obj) {\n self.changes.push({\n name: name,\n operation: op,\n obj: JSON.parse(JSON.stringify(obj))\n });\n }", "title": "" }, { "docid": "bb85e14429154d68ea2958fec2178b0f", "score": "0.510229", "text": "function brushed() {\n\t\n\t// * TO-DO *\n\n}", "title": "" }, { "docid": "adcae3dfef12252377ec40846559e9c3", "score": "0.5099251", "text": "function save () {\r\n\tcreateArray();\r\n\r\n\tif (_selectedBlueprint)\r\n\t{\r\n\t\tsaveJSON();\r\n\t\treturn true;\r\n\t}\r\n\r\n\tif(_currentlyChanging != null)\r\n\t{\r\n\t\tif (_currentlyChanging == \"collide\")\r\n\t\t{\r\n\t\t\t_selectedObject.setOnCollide($(\"#text\").val());\r\n\t\t\to[\"functs\"][\"OnCollide\"] = $(\"#text\").val();\r\n\t\t}\r\n\t\telse if(_currentlyChanging == \"init\")\r\n\t\t{\r\n\t\t\t_selectedObject.setOnInit($(\"#text\").val());\r\n\t\t\to[\"functs\"][\"OnInit\"] = $(\"#text\").val();\r\n\t\t}\r\n\t\telse if(_currentlyChanging == \"update\"){\r\n\t\t\t_selectedObject.setOnUpdate($(\"#text\").val());\r\n\t\t\t\r\n\t\t\to[\"functs\"][\"OnUpdate\"] = $(\"#text\").val();\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\talert(\"error on save: not sure what callback we are creating\");\r\n\t}\r\n}", "title": "" }, { "docid": "80124b965b413494b7d4379dddb06c7f", "score": "0.50979954", "text": "function HistoryStateEditCanvas () {\n this.canvasState = currentLayer.context.getImageData(0, 0, canvasSize[0], canvasSize[1]);\n this.layerID = currentLayer.id;\n\n this.undo = function () {\n var stateLayer = getLayerByID(this.layerID);\n var currentCanvas = stateLayer.context.getImageData(0, 0, canvasSize[0], canvasSize[1]);\n stateLayer.context.putImageData(this.canvasState, 0, 0);\n\n this.canvasState = currentCanvas;\n redoStates.push(this);\n\n stateLayer.updateLayerPreview();\n };\n\n this.redo = function () {\n console.log(\"YEET\");\n var stateLayer = getLayerByID(this.layerID);\n var currentCanvas = stateLayer.context.getImageData(0, 0, canvasSize[0], canvasSize[1]);\n\n stateLayer.context.putImageData(this.canvasState, 0, 0);\n\n this.canvasState = currentCanvas;\n undoStates.push(this);\n\n stateLayer.updateLayerPreview();\n };\n\n //add self to undo array\n saveHistoryState(this);\n}", "title": "" }, { "docid": "2a9f09539cc2e34d66877818aa5bbf3a", "score": "0.50903636", "text": "undo() {\n if (this[_transactions].length !== 0) {\n throw new Error(\"Cannot undo while the transaction is not committed or rolled back\");\n }\n const command = this[_undo].pop();\n if (typeof command !== \"undefined\") {\n command.undo(); // exception safety: does not add a command if the undo fails\n this[_redo].push(command);\n } else {\n throw new Error(\"There is nothing to undo\");\n }\n }", "title": "" }, { "docid": "9e3bc6d4ff833a9d05a33ca7c62f5eef", "score": "0.5061005", "text": "function undo() {\n\n // Restore previous task and order data\n data = JSON.parse(JSON.stringify(oldData.pop()));\n\n // Rebuild task list in DOM and store data in localstorage\n buildDOMList();\n storeData();\n\n $('#undo-wrapper').hide(); // Hide undo message\n\n // Disable undo button if there's nothing left in the stack\n if (oldData.length == 0) {\n $('#undo').prop('disabled', true);\n }\n\n setState();\n\n }", "title": "" }, { "docid": "769c5cae122e5be27f3d4e8d25e095c8", "score": "0.5050744", "text": "_createChange(name, op, obj, old) {\n this.changes.push({\n name,\n operation: op,\n obj: op === \"U\" && !this.disableDeltaChangesApi ? this._getChangeDelta(obj, old) : JSON.parse(JSON.stringify(obj))\n });\n }", "title": "" }, { "docid": "8af75fe68c2de7697bc2225360153918", "score": "0.5048633", "text": "_storeUndo() {\n this._undos.addNewState(this._resourceSet.copy());\n }", "title": "" }, { "docid": "d207e3084b0eeaab2ad15ba7e4e4abeb", "score": "0.5042491", "text": "_onSet(event) {\n let hasChange = event.value !== event.oldValue\n if (!hasChange) {\n return false\n }\n let diffuseChange = false\n \n // Type: value, a common assignation\n if (event.type === 'value') {\n this.emit('propchange', {\n type: 'propchange',\n fullname: event.fullpath,\n name: event.name,\n oldValue: event.oldValue,\n value: event.value,\n external: false\n })\n diffuseChange = true\n } else if (event.type === 'array') { // Type array, an array was changed\n diffuseChange = true\n } else if (event.type === 'arrayvalue') { // Type arrayvalue, a value in the array changed\n diffuseChange = false\n this.emit('propchange', {\n type: 'propchange',\n fullname: event.fullpath,\n name: event.name,\n oldValue: event.oldValue,\n value:event.value,\n index: event.index,\n added: event.added,\n removed: event.removed,\n external: false\n })\n }\n if (event.value === event.oldValue) {\n diffuseChange = false\n }\n if (!diffuseChange) {\n return\n }\n \n // Emitting change only if we have a \"value\" or \"array\" event\n this.emit('change', {\n type: 'change',\n fullname: event.fullpath,\n name: event.name,\n oldValue: event.oldValue,\n value: event.value,\n external: false\n })\n // Same for saving\n if (fs && this.options.autosave) {\n if (fs.existsSync(this.file)) {\n try {\n fs.accessSync(this.file, fs.constants.W_OK)\n }\n catch (err) {\n return this._error(`Counldn't write to file ${this.file}: ${err}`, err)\n }\n }\n log(`> Writing changes to file ${this.file}`)\n this.writing = true\n fs.writeFile(this.file, JSON.stringify(this._data, null, this.options.spacer), (err) => {\n if (err) {\n return this._error(`Counldn't write to file ${this.file}: ${err}`, err)\n }\n this.lastFileStat = fs.statSync(this.file)\n })\n }\n }", "title": "" }, { "docid": "c30dc6314f4847ad95598a9d7d4d0a45", "score": "0.5030792", "text": "saveMove(message) {\r\n // if add; add the new move to the history and redraw available moves\r\n // to restore\r\n if (message.action === \"add\") {\r\n this.setState({\r\n history: this.state.history.concat([{\r\n squares: message.squares\r\n }])\r\n });\r\n } else { // if restore; just replace the history with new state\r\n this.setState({\r\n history: message.history\r\n });\r\n }\r\n }", "title": "" }, { "docid": "799a5ea8794e1f975bc36c21b2ae59f6", "score": "0.50145924", "text": "function addNodeAndLink(e, obj) {\n\t\tvar adornment = obj.part;\n\t\tvar diagram = e.diagram;\n\t\tdiagram.startTransaction(\"Add State\");\n\n\t\t// get the node data for which the user clicked the button\n\t\tvar fromNode = adornment.adornedPart;\n\t\tvar fromData = fromNode.data;\n\t\t\n\t\t// create a new \"State\" data object, positioned off to the right of the adorned Node\n\t\tvar toData = { \n\t\t\ttext: \"new\" \n\t\t};\n\t\t\n\t\tvar p = fromNode.location.copy();\n\t\tp.x += 200;\n\t\ttoData.loc = go.Point.stringify(p); // the \"loc\" property is a string, not a Point object\n\t\t\n\t\t// add the new node data to the model\n\t\tvar model = diagram.model;\n\t\tmodel.addNodeData(toData);\n\n\t\t// create a link data from the old node data to the new node data\n\t\tvar linkdata = {\n\t\t\tfrom: model.getKeyForNodeData(fromData), // or just: fromData.id\n\t\t\tto: model.getKeyForNodeData(toData),\n\t\t\ttext: \"transition\"\n\t\t};\n\t\t\n\t\t// and add the link data to the model\n\t\tmodel.addLinkData(linkdata);\n\n\t\t// select the new Node\n\t\tvar newnode = diagram.findNodeForData(toData);\n\t\tdiagram.select(newnode);\n\n\t\tdiagram.commitTransaction(\"Add State\");\n\n\t\t// if the new node is off-screen, scroll the diagram to show the new node\n\t\tdiagram.scrollToRect(newnode.actualBounds);\n }", "title": "" }, { "docid": "cb26470303b906f16f5cafcedc424a7a", "score": "0.501211", "text": "function saveHistoryState (state) {\n //get current canvas data and save to undoStates array\n undoStates.push(state);\n\n //limit the number of states to settings.numberOfHistoryStates\n if (undoStates.length > settings.numberOfHistoryStates) {\n undoStates = undoStates.splice(-settings.numberOfHistoryStates, settings.numberOfHistoryStates);\n }\n\n //there is now definitely at least 1 undo state, so the button shouldnt be disabled\n document.getElementById('undo-button').classList.remove('disabled');\n\n //there should be no redoStates after an undoState is saved\n redoStates = [];\n}", "title": "" }, { "docid": "3c03752aaefdcb1a33a17d150f5824a8", "score": "0.5011964", "text": "push(data) {\n let newNode = new Node(data);\n newNode.down = this.top;\n this.top = newNode;\n }", "title": "" }, { "docid": "3c5f8392cda2139bfc018a6869309192", "score": "0.50049555", "text": "async undo() {\r\n if(this.canUndo()) {\r\n const item = this.history[this.historyPointer--];\r\n await item.undo();\r\n\r\n this.emitEvent('undo', this, item);\r\n } else {\r\n console.warn('[HistoryManager]: Attempting to undo but no undo item available');\r\n }\r\n }", "title": "" }, { "docid": "673cdba33f9e22ebaab56b8b628caa6c", "score": "0.50001", "text": "write( text ) {\n var changes = [{field:'wrote',value:text}];\n VRSPACE.sendMyChanges(changes);\n this.myChangeListeners.forEach( (listener) => listener(changes));\n }", "title": "" }, { "docid": "ef932a76db2cef5f25d90a2f9b6ad9dc", "score": "0.49941847", "text": "function undoMove() {\n\n arr[kingsY][kingsX] = enemyKing; //pushed King to properspot\n arr[permY][permX] = currObj; //pushed Obj to properspot\n drawBoard();\n moveCount++;\n alert(\"Check\");\n }", "title": "" }, { "docid": "232340f6705ec0074e96d8fd68ef93ef", "score": "0.49927405", "text": "addOperation(operation) {\n\n\t\tlet { currentHistoryNode, undos, redos } = this.state;\n\n\t\tredos = new List();\n\t\tundos = undos.push(currentHistoryNode);\n\n\t\tconst newHistoryNode = new HistoryNode({\n\t\t\tparentNode: currentHistoryNode,\n\t\t\tname: operation.tool.name,\n\t\t\toperation,\n\t\t});\n\t\tcurrentHistoryNode.childNodes.push(newHistoryNode);\n\t\tcurrentHistoryNode = newHistoryNode;\n\n\t\tthis.setState(\n\t\t\t{\n\t\t\t\tcurrentHistoryNode: currentHistoryNode,\n\t\t\t\tundos: undos,\n\t\t\t\tredos: redos,\n\t\t\t},\n\t\t\tthis.save.bind(this),\n\t\t);\n\t}", "title": "" }, { "docid": "8f870a0520d0f8359c95c521d947c6c2", "score": "0.49921829", "text": "function cmdRedo() {\n\tif( RedoStack.length > 0 ) {\n\t\tvar undoInfo = getUndo();\n\t\tvar redoInfo = RedoStack.pop();\n\t\tapplyUndo(redoInfo);\n\t\tUndoStack.push(undoInfo);\n\t\tpaper.view.draw();\n\t}\n}", "title": "" }, { "docid": "3415c466cfc4f72122fae419a5fee804", "score": "0.4990276", "text": "doClear() {\n\n /*\n * Delegate this to the instance-retriever\n */\n this.outEvtGraphCleared();\n }", "title": "" }, { "docid": "15b3fb2f8b607f03752af15fa762cb02", "score": "0.49893123", "text": "undoTransaction() {\n console.log(\"am i even called\");\n console.log(this.oldDesc);\n this.app.handleDescUpdate(this.id, this.oldDesc);\n }", "title": "" }, { "docid": "e4b4a74918cef3529070be2624a39048", "score": "0.49866557", "text": "changedObjects() { this.events.emit('change.objects'); }", "title": "" }, { "docid": "28948b6c535fe64b89ec983d2e9504b3", "score": "0.49795577", "text": "_undoChange(change) {\n let index = 0;\n let serializer = this._serializer;\n switch (change.type) {\n case 'add':\n Object(algorithm_lib[\"each\"])(change.newValues, () => {\n this.remove(change.newIndex);\n });\n break;\n case 'set':\n index = change.oldIndex;\n Object(algorithm_lib[\"each\"])(change.oldValues, value => {\n this.set(index++, serializer.fromJSON(value));\n });\n break;\n case 'remove':\n index = change.oldIndex;\n Object(algorithm_lib[\"each\"])(change.oldValues, value => {\n this.insert(index++, serializer.fromJSON(value));\n });\n break;\n case 'move':\n this.move(change.newIndex, change.oldIndex);\n break;\n default:\n return;\n }\n }", "title": "" }, { "docid": "5d12f1b234aae2f13696e65ab107ff82", "score": "0.49772012", "text": "_redoChange(change) {\n let index = 0;\n let serializer = this._serializer;\n switch (change.type) {\n case 'add':\n index = change.newIndex;\n Object(algorithm_lib[\"each\"])(change.newValues, value => {\n this.insert(index++, serializer.fromJSON(value));\n });\n break;\n case 'set':\n index = change.newIndex;\n Object(algorithm_lib[\"each\"])(change.newValues, value => {\n this.set(change.newIndex++, serializer.fromJSON(value));\n });\n break;\n case 'remove':\n Object(algorithm_lib[\"each\"])(change.oldValues, () => {\n this.remove(change.oldIndex);\n });\n break;\n case 'move':\n this.move(change.oldIndex, change.newIndex);\n break;\n default:\n return;\n }\n }", "title": "" }, { "docid": "5da458e4ab911d6f3f83aecd68dca252", "score": "0.49721667", "text": "function onObjectModified() {\n \n // deselecting groups after modify prevents\n // some problems related to relative positioning.\n // i'll get to the bottom of this one day, but this works \n // around it for now.\n if(canvas.getActiveGroup()){\n\tcanvas.deactivateAll();\n }\n \n if (replayFlag === false) { // i.e. user modified something..\n\tvar itemProps = [];\n\tfor (var i in selectedObject) {\n\t itemProps.push({\n\t\t\"itemNum\": selectedObject[i].itemNum,\n\t\t\"left\": selectedObject[i].left,\n\t\t\"top\": selectedObject[i].top,\n\t\t\"scaleX\": selectedObject[i].scaleX,\n\t\t\"scaleY\": selectedObject[i].scaleY,\n\t\t\"angle\": selectedObject[i].angle,\n\t\t\"flipX\": selectedObject[i].flipX,\n\t\t\"flipY\": selectedObject[i].flipY,\n\t\t\"fill\": selectedObject[i].fill,\n\t\t\"stroke\": selectedObject[i].stroke,\n\t });\n\t}\n\n\t// get current object properties \n\tonObjectSelected();\n\n\tundoHist.push({\n\t \"action\": \"modify\",\n\t \"itemProps\": itemProps\n\t});\n\tredoHist = [];\n }\n}", "title": "" }, { "docid": "d0f71d668b560c227b5bce2ab8a26438", "score": "0.4971718", "text": "function undo() {\n if (!gGame.isOn) return;\n if (!gPlayedMoves.length) return;\n var currMove = gPlayedMoves.pop();\n for (var i = 0; i < currMove.changedCells.length; i++) {\n var currCell = currMove.changedCells[i];\n if (currMove.action === 'marked') {\n cellMarked(currCell.elCell, currCell.i, currCell.j, true);\n } else { // CurrMove.action === 'clicked'\n unShowCell(gBoard, currCell.elCell, currCell.i, currCell.j);\n }\n }\n}", "title": "" }, { "docid": "f9ff53c9153b592adb77503c20c54df5", "score": "0.4957526", "text": "changeState(state) {\r\n this.state = state;\r\n this.undoStack.push(this.state);\r\n this.redoStack.length = 0;\r\n }", "title": "" }, { "docid": "91da298c69051ccfdc52db3b884760c2", "score": "0.4954683", "text": "sendToBack() {\n this.depth = -9999;\n }", "title": "" }, { "docid": "2551989a037f80c5d36baab9940eb334", "score": "0.49543676", "text": "function cmdUndo () {\n // alert(\"in cmdUndo()\");\n\n if (g.server != \"serveCSM\") {\n alert(\"cmdUndo is not implemented for \"+g.server);\n return;\n }\n\n g.socketUt.send(\"undo;\");\n\n // update the UI\n activateBuildButton();\n}", "title": "" }, { "docid": "dfc8740d894be501e04988ba9c376dab", "score": "0.49533305", "text": "onUndo () { this.$refs.omPivotTable.doUndo() }", "title": "" }, { "docid": "c0392056e1637e50aac6d4ff8156b266", "score": "0.49529114", "text": "function push() {\n if (liData.todo) {\n var obj = JSON.stringify(liData);\n data.todo.unshift(obj);\n }\n dataObject();\n}", "title": "" }, { "docid": "c826db7728bcbb260ca669cd2b0a0770", "score": "0.4949071", "text": "save() {\r\n undo.push(angular.copy(this.score.score));\r\n }", "title": "" }, { "docid": "b4fe7722ada826bc4405f795c530ed17", "score": "0.4945898", "text": "function moveForward() {\n _callWrite(\"forward\");\n}", "title": "" }, { "docid": "21974f8752bed230ab1c0e68dedb1db7", "score": "0.49350846", "text": "addNode(obj) {\n const attrs = this.getChartState()\n attrs.data.push(obj)\n\n // Update state of nodes and redraw graph\n this.updateNodesState()\n return this\n }", "title": "" }, { "docid": "ad4a5e822688c78c177c10b01ce14ae8", "score": "0.4928846", "text": "function changeData(args) {\n // console.log(\"change data called\");\n if(args.length >= 3){\n var type = args[0];\n var event = args[1];\n var affectedItem = args[2];\n var msgValid = args[3];\n if(msgValid == undefined) {\n msgValid = \"ok\";\n }\n if(type === 'node') {\n if(event === 'add'){\n\n // var result = create_AE([affectedItem.label,affectedItem.id,affectedItem.description]);\n // console.log(\"result = \"+result);\n // if(result == 'ok'){\n if(msgValid == \"ok\") {\n data.nodes[affectedItem.id] = affectedItem; //change the data\n }\n //TODO if couldn't find pid?\n else {\n console.log(msgValid);\n }\n // }\n // else if(result == 'error'){\n // console.log(\"Cannot create AE in SDL Server.\");\n // return \"error\";\n // }\n // else {\n // console.log(\"no result defined\");\n // }\n }\n else if(event === 'remove'){\n //affectedItem is an array of selected nodes, and referring edges and rules\n var itemId;\n for(itemId in affectedItem.nodes)\n {\n console.log(\"#\"+affectedItem.nodes[itemId]);\n console.log(data.nodes);\n delete data.nodes[affectedItem.nodes[itemId]];\n }\n for(itemId in affectedItem.edges){\n delete data.edges[affectedItem.edges[itemId]];\n }\n for(itemId in affectedItem.rules){\n delete data.rules[affectedItem.rules[itemId]];\n }\n }\n else if(event === 'update'){\n data.nodes[affectedItem.id] = affectedItem;\n }\n }\n\n\n if(msgValid == \"ok\") {\n\n //publish the change data event\n session.publish(\"sdlSCI.data.onChangeObj\", args);\n\n //write data to external file data.txt\n var data_json = JSON.stringify(data);\n\n fs.writeFile(data_path, '', function(err) {\n if(err) {\n return console.log(err);\n }\n });\n\n fs.writeFile(data_path, data_json, function(err) {\n if(err) {\n return console.log(err);\n }\n });\n\n return 'ok';\n }\n\n\n }\n else {\n console.log('3 args needed for function changeDate');\n }\n }", "title": "" } ]
960dfa39908904d1762177b3d71fbbd0
encode method ABI object with values in an array, output bytecode
[ { "docid": "a46ef1534e2d85ed04a2412d1e2d107f", "score": "0.5704561", "text": "function encodeMethod(method, values) {\n var paramsEncoded = encodeParams(utils.getKeys(method.inputs, 'type'), values).substring(2);\n\n return '' + encodeSignature(method) + paramsEncoded;\n}", "title": "" } ]
[ { "docid": "0592cb93c38fb2ba4803f52b0abd346f", "score": "0.59556973", "text": "function encodeMethod(method, values) {\n var signature = method.name + '(' + utils.getKeys(method.inputs, 'type').join(',') + ')';\n var signatureEncoded = '0x' + new Buffer(utils.keccak256(signature), 'hex').slice(0, 4).toString('hex');\n var paramsEncoded = encodeParams(utils.getKeys(method.inputs, 'type'), values).substring(2);\n\n return '' + signatureEncoded + paramsEncoded;\n}", "title": "" }, { "docid": "0592cb93c38fb2ba4803f52b0abd346f", "score": "0.59556973", "text": "function encodeMethod(method, values) {\n var signature = method.name + '(' + utils.getKeys(method.inputs, 'type').join(',') + ')';\n var signatureEncoded = '0x' + new Buffer(utils.keccak256(signature), 'hex').slice(0, 4).toString('hex');\n var paramsEncoded = encodeParams(utils.getKeys(method.inputs, 'type'), values).substring(2);\n\n return '' + signatureEncoded + paramsEncoded;\n}", "title": "" }, { "docid": "0592cb93c38fb2ba4803f52b0abd346f", "score": "0.59556973", "text": "function encodeMethod(method, values) {\n var signature = method.name + '(' + utils.getKeys(method.inputs, 'type').join(',') + ')';\n var signatureEncoded = '0x' + new Buffer(utils.keccak256(signature), 'hex').slice(0, 4).toString('hex');\n var paramsEncoded = encodeParams(utils.getKeys(method.inputs, 'type'), values).substring(2);\n\n return '' + signatureEncoded + paramsEncoded;\n}", "title": "" }, { "docid": "0592cb93c38fb2ba4803f52b0abd346f", "score": "0.59556973", "text": "function encodeMethod(method, values) {\n var signature = method.name + '(' + utils.getKeys(method.inputs, 'type').join(',') + ')';\n var signatureEncoded = '0x' + new Buffer(utils.keccak256(signature), 'hex').slice(0, 4).toString('hex');\n var paramsEncoded = encodeParams(utils.getKeys(method.inputs, 'type'), values).substring(2);\n\n return '' + signatureEncoded + paramsEncoded;\n}", "title": "" }, { "docid": "0592cb93c38fb2ba4803f52b0abd346f", "score": "0.59556973", "text": "function encodeMethod(method, values) {\n var signature = method.name + '(' + utils.getKeys(method.inputs, 'type').join(',') + ')';\n var signatureEncoded = '0x' + new Buffer(utils.keccak256(signature), 'hex').slice(0, 4).toString('hex');\n var paramsEncoded = encodeParams(utils.getKeys(method.inputs, 'type'), values).substring(2);\n\n return '' + signatureEncoded + paramsEncoded;\n}", "title": "" }, { "docid": "0592cb93c38fb2ba4803f52b0abd346f", "score": "0.59556973", "text": "function encodeMethod(method, values) {\n var signature = method.name + '(' + utils.getKeys(method.inputs, 'type').join(',') + ')';\n var signatureEncoded = '0x' + new Buffer(utils.keccak256(signature), 'hex').slice(0, 4).toString('hex');\n var paramsEncoded = encodeParams(utils.getKeys(method.inputs, 'type'), values).substring(2);\n\n return '' + signatureEncoded + paramsEncoded;\n}", "title": "" }, { "docid": "0592cb93c38fb2ba4803f52b0abd346f", "score": "0.59556973", "text": "function encodeMethod(method, values) {\n var signature = method.name + '(' + utils.getKeys(method.inputs, 'type').join(',') + ')';\n var signatureEncoded = '0x' + new Buffer(utils.keccak256(signature), 'hex').slice(0, 4).toString('hex');\n var paramsEncoded = encodeParams(utils.getKeys(method.inputs, 'type'), values).substring(2);\n\n return '' + signatureEncoded + paramsEncoded;\n}", "title": "" }, { "docid": "0592cb93c38fb2ba4803f52b0abd346f", "score": "0.59556973", "text": "function encodeMethod(method, values) {\n var signature = method.name + '(' + utils.getKeys(method.inputs, 'type').join(',') + ')';\n var signatureEncoded = '0x' + new Buffer(utils.keccak256(signature), 'hex').slice(0, 4).toString('hex');\n var paramsEncoded = encodeParams(utils.getKeys(method.inputs, 'type'), values).substring(2);\n\n return '' + signatureEncoded + paramsEncoded;\n}", "title": "" }, { "docid": "453667ee5fd184292c35f4492ec2d4e3", "score": "0.56231344", "text": "getCodeBytes()\n {\n let str = this.getJavaClass().getCodeBytesSync();\n return str.split(\",\");\n }", "title": "" }, { "docid": "46880403f94145f402b0259462534ac3", "score": "0.5447183", "text": "function solidityToABI(methodInterface) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n // count open and clsoed\n var methodABIObject = {};\n\n // not a string\n if (typeof methodInterface !== 'string') {\n throw new Error('Method interface must be a string, currently ' + (typeof methodInterface === 'undefined' ? 'undefined' : _typeof(methodInterface)));\n }\n\n // empty string\n if (methodInterface.length === 0) {\n throw new Error('Solidity method interface must have a length greater than zero, currently ' + methodInterface.length);\n }\n\n // count open brackets, closed brackets, colon count, outpouts and invalid characters\n var openBrackets = (methodInterface.match(/\\(/g) || []).length;\n var closedBrackets = (methodInterface.match(/\\)/g) || []).length;\n var colonCount = (methodInterface.match(/:/g) || []).length;\n var hasOutputs = openBrackets === 2 && closedBrackets === 2 && colonCount === 1;\n var hasInvalidCharacters = methodInterface.replace(/([A-Za-z0-9\\_\\s\\,\\:(\\)]+)/g, '').trim().length > 0; // eslint-disable-line\n\n // invalid characters\n if (hasInvalidCharacters) {\n throw new Error('Invalid Solidity method interface, your method interface contains invalid chars. Only letters, numbers, spaces, commas, underscores, brackets and colons.');\n }\n\n // method ABI object assembly\n methodABIObject.name = methodInterface.slice(0, methodInterface.indexOf('('));\n methodABIObject.type = options.type || 'function';\n\n // add payable\n if (methodABIObject.type === 'function') {\n methodABIObject.payable = options.payable || false;\n }\n\n // constant\n methodABIObject.constant = options.constant || true;\n var methodInputsString = methodInterface.slice(methodInterface.indexOf('(') + 1, methodInterface.indexOf(')')).trim();\n var methodOutputString = (hasOutputs && methodInterface.slice(methodInterface.lastIndexOf('(') + 1, methodInterface.lastIndexOf(')')) || '').trim();\n methodABIObject.inputs = buildInputsArray(methodInputsString);\n methodABIObject.outputs = buildInputsArray(methodOutputString);\n\n // check open brackets\n if (methodABIObject.name === '' || typeof methodABIObject.name === 'undefined') {\n throw new Error('Invalid Solidity method interface, no method name');\n }\n\n // check open brackets\n if (openBrackets !== 1 && openBrackets !== 2) {\n throw new Error('Invalid Solidity method interface, too many or too little open brackets in solidity interface, currenlty only ' + openBrackets + ' open brackets!');\n }\n\n // check open brackets\n if (openBrackets !== 1 && openBrackets !== 2) {\n throw new Error('Invalid Solidity method interface, too many or too little open brackets in solidity interface!');\n }\n\n // check closed brackets\n if (closedBrackets !== 1 && closedBrackets !== 2) {\n throw new Error('Invalid Solidity method interface, too many or too little closed brackets in solidity interface!');\n }\n\n // check colon count\n if (colonCount !== 0 && colonCount !== 1) {\n throw new Error('Invalid Solidity method interface, to many or too little colons.');\n }\n\n // return method abi object\n return methodABIObject;\n}", "title": "" }, { "docid": "280cd726577a2f8de63c04c5a3393a49", "score": "0.5437276", "text": "function encodeAbi(input, allocations) {\n //errors can't be encoded\n if (input.kind === \"error\") {\n debug(\"input: %O\", input);\n if (input.error.kind === \"IndexedReferenceTypeError\") {\n //HACK: errors can't be encoded, *except* for indexed reference parameter errors.\n //really this should go in a different encoding function, not encodeAbi, but I haven't\n //written that function yet. I'll move this case when I do.\n return conversion_1.Conversion.toBytes(input.error.raw, evm_1.EVM.WORD_SIZE);\n }\n else {\n return undefined;\n }\n }\n let bytes;\n //TypeScript can at least infer in the rest of this that we're looking\n //at a value, not an error! But that's hardly enough...\n switch (input.type.typeClass) {\n case \"mapping\":\n case \"magic\":\n //neither of these can go in the ABI\n return undefined;\n case \"uint\":\n case \"int\":\n return conversion_1.Conversion.toBytes(input.value.asBN, evm_1.EVM.WORD_SIZE);\n case \"enum\":\n return conversion_1.Conversion.toBytes(input.value.numericAsBN, evm_1.EVM.WORD_SIZE);\n case \"bool\": {\n bytes = new Uint8Array(evm_1.EVM.WORD_SIZE); //is initialized to zeroes\n if (input.value.asBoolean) {\n bytes[evm_1.EVM.WORD_SIZE - 1] = 1;\n }\n return bytes;\n }\n case \"bytes\":\n bytes = conversion_1.Conversion.toBytes(input.value.asHex);\n switch (input.type.kind) {\n case \"static\":\n let padded = new Uint8Array(evm_1.EVM.WORD_SIZE); //initialized to zeroes\n padded.set(bytes);\n return padded;\n case \"dynamic\":\n return padAndPrependLength(bytes);\n }\n case \"address\":\n return conversion_1.Conversion.toBytes(input.value.asAddress, evm_1.EVM.WORD_SIZE);\n case \"contract\":\n return conversion_1.Conversion.toBytes(input.value.address, evm_1.EVM.WORD_SIZE);\n case \"string\": {\n let coercedInput = input;\n switch (coercedInput.value.kind) {\n case \"valid\":\n bytes = stringToBytes(coercedInput.value.asString);\n break;\n case \"malformed\":\n bytes = conversion_1.Conversion.toBytes(coercedInput.value.asHex);\n break;\n }\n return padAndPrependLength(bytes);\n }\n case \"function\": {\n switch (input.type.visibility) {\n case \"internal\":\n return undefined; //internal functions can't go in the ABI!\n case \"external\":\n let coercedInput = input;\n let encoded = new Uint8Array(evm_1.EVM.WORD_SIZE); //starts filled w/0s\n let addressBytes = conversion_1.Conversion.toBytes(coercedInput.value.contract.address); //should already be correct length\n let selectorBytes = conversion_1.Conversion.toBytes(coercedInput.value.selector); //should already be correct length\n encoded.set(addressBytes);\n encoded.set(selectorBytes, evm_1.EVM.ADDRESS_SIZE); //set it after the address\n return encoded;\n }\n }\n case \"fixed\":\n case \"ufixed\":\n let bigValue = input.value.asBig;\n let shiftedValue = conversion_1.Conversion.shiftBigUp(bigValue, input.type.places);\n return conversion_1.Conversion.toBytes(shiftedValue, evm_1.EVM.WORD_SIZE);\n case \"array\": {\n let coercedInput = input;\n if (coercedInput.reference !== undefined) {\n return undefined; //circular values can't be encoded\n }\n let staticEncoding = encodeTupleAbi(coercedInput.value, allocations);\n switch (input.type.kind) {\n case \"static\":\n return staticEncoding;\n case \"dynamic\":\n let encoded = new Uint8Array(evm_1.EVM.WORD_SIZE + staticEncoding.length); //leave room for length\n encoded.set(staticEncoding, evm_1.EVM.WORD_SIZE); //again, leave room for length beforehand\n let lengthBytes = conversion_1.Conversion.toBytes(coercedInput.value.length, evm_1.EVM.WORD_SIZE);\n encoded.set(lengthBytes); //and now we set the length\n return encoded;\n }\n }\n case \"struct\": {\n let coercedInput = input;\n if (coercedInput.reference !== undefined) {\n return undefined; //circular values can't be encoded\n }\n return encodeTupleAbi(coercedInput.value.map(({ value }) => value), allocations);\n }\n case \"tuple\": {\n //WARNING: This case is written in a way that involves a bunch of unnecessary recomputation!\n //(That may not be apparent from this one line, but it's true)\n //I'm writing it this way anyway for simplicity, to avoid rewriting the encoder\n //However it may be worth revisiting this in the future if performance turns out to be a problem\n return encodeTupleAbi(input.value.map(({ value }) => value), allocations);\n }\n }\n}", "title": "" }, { "docid": "9f2da5212c9a30cfe9bcb810326e1703", "score": "0.54084843", "text": "function encodeABI(world, fnABI, fnParams) {\n if (fnParams.length == 0) {\n return world.web3.eth.abi.encodeFunctionSignature(fnABI);\n }\n else {\n const regex = /(\\w+)\\(([\\w,\\[\\]]+)\\)/;\n const res = regex.exec(fnABI);\n if (!res) {\n throw new Error(`Expected ABI signature, got: ${fnABI}`);\n }\n const [_, fnName, fnInputs] = res;\n const jsonInterface = {\n name: fnName,\n inputs: fnInputs.split(',').map(i => ({ name: '', type: i }))\n };\n // XXXS\n return world.web3.eth.abi.encodeFunctionCall(jsonInterface, fnParams);\n }\n}", "title": "" }, { "docid": "88cf0ba86dca0144c577a633115d69e0", "score": "0.5363141", "text": "function abiEncodeTransactionPayload(payload) {\n payload.signature = payload.signature || [];\n return prefixHex(Buffer.concat([\n ethereumjsAbi.methodID(payload.name, payload.signature),\n ethereumjsAbi.rawEncode(payload.signature, payload.params)\n ]).toString(\"hex\"));\n}", "title": "" }, { "docid": "dbfce42661c041e7576e5d0c98b8d87f", "score": "0.5337749", "text": "function abiEncodeTransactionPayload(payload) {\n payload.signature = payload.signature || [];\n return prefixHex(Buffer.concat([ethereumjsAbi.methodID(payload.name, payload.signature), abiEncodeData(payload)]).toString(\"hex\"));\n}", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "6f9b20b99f937ec383ec871feae56929", "score": "0.53370947", "text": "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "title": "" }, { "docid": "5782c85a91e506447caa921d848839e4", "score": "0.53270674", "text": "encodeFunctionResult(functionFragment, values) {\n if (typeof (functionFragment) === \"string\") {\n functionFragment = this.getFunction(functionFragment);\n }\n return hexlify(this._abiCoder.encode(functionFragment.outputs, values || []));\n }", "title": "" }, { "docid": "2099f6ec153d1f7a27eaae2766bad27e", "score": "0.5271428", "text": "encode(obj) {\n let encoder = new Encoder(this);\n encoder.encode(obj);\n return encoder.output();\n }", "title": "" }, { "docid": "1c4ffa55cc2d78f9ef63247a299537ba", "score": "0.5196542", "text": "function array(encoder, value) {\n\t var length = value.length;\n\t var type = (length < 16) ? (0x90 + length) : (length <= 0xFFFF) ? 0xdc : 0xdd;\n\t token[type](encoder, length);\n\t\n\t var encode = encoder.codec.encode;\n\t for (var i = 0; i < length; i++) {\n\t encode(encoder, value[i]);\n\t }\n\t }", "title": "" }, { "docid": "3dbaee603130e84878896b56b241d734", "score": "0.51643175", "text": "pack():Array {\n }", "title": "" }, { "docid": "0df38185fe3a0e4109801b893275dc46", "score": "0.51446164", "text": "function RawCode() {\r\n this.value = 0;\r\n this.address = 0;\r\n this.compare = 0;\r\n this.hasCompare = 0;\r\n }", "title": "" }, { "docid": "4c496134fed117e2bbfa76abf73f1878", "score": "0.51365083", "text": "function encodeArray(array, proto, offset, buffer, protos){\n\tvar i = 0;\n\tif(util.isSimpleType(proto.type)){\n\t\toffset = writeBytes(buffer, offset, encodeTag(proto.type, proto.tag));\n\t\toffset = writeBytes(buffer, offset, codec.encodeUInt32(array.length));\n\t\tfor(i = 0; i < array.length; i++){\n\t\t\toffset = encodeProp(array[i], proto.type, offset, buffer);\n\t\t}\n\t}else{\n\t\tfor(i = 0; i < array.length; i++){\n\t\t\toffset = writeBytes(buffer, offset, encodeTag(proto.type, proto.tag));\n\t\t\toffset = encodeProp(array[i], proto.type, offset, buffer, protos);\n\t\t}\n\t}\n\n\treturn offset;\n}", "title": "" }, { "docid": "4c496134fed117e2bbfa76abf73f1878", "score": "0.51365083", "text": "function encodeArray(array, proto, offset, buffer, protos){\n\tvar i = 0;\n\tif(util.isSimpleType(proto.type)){\n\t\toffset = writeBytes(buffer, offset, encodeTag(proto.type, proto.tag));\n\t\toffset = writeBytes(buffer, offset, codec.encodeUInt32(array.length));\n\t\tfor(i = 0; i < array.length; i++){\n\t\t\toffset = encodeProp(array[i], proto.type, offset, buffer);\n\t\t}\n\t}else{\n\t\tfor(i = 0; i < array.length; i++){\n\t\t\toffset = writeBytes(buffer, offset, encodeTag(proto.type, proto.tag));\n\t\t\toffset = encodeProp(array[i], proto.type, offset, buffer, protos);\n\t\t}\n\t}\n\n\treturn offset;\n}", "title": "" }, { "docid": "695774ebbc9484766f03e80651dd80ed", "score": "0.51085126", "text": "function array(encoder, value) {\n var length = value.length;\n var type = (length < 16) ? (0x90 + length) : (length <= 0xFFFF) ? 0xdc : 0xdd;\n token[type](encoder, length);\n\n var encode = encoder.codec.encode;\n for (var i = 0; i < length; i++) {\n encode(encoder, value[i]);\n }\n }", "title": "" }, { "docid": "695774ebbc9484766f03e80651dd80ed", "score": "0.51085126", "text": "function array(encoder, value) {\n var length = value.length;\n var type = (length < 16) ? (0x90 + length) : (length <= 0xFFFF) ? 0xdc : 0xdd;\n token[type](encoder, length);\n\n var encode = encoder.codec.encode;\n for (var i = 0; i < length; i++) {\n encode(encoder, value[i]);\n }\n }", "title": "" }, { "docid": "cdbd61ac0bc660e725048781532b7d76", "score": "0.50987154", "text": "function augment (arr) {\n arr._isBuffer = true\n\n arr.write = BP.write\n arr.toString = BP.toString\n arr.toJSON = BP.toJSON\n arr.copy = BP.copy\n arr.slice = BP.slice\n arr.readUInt8 = BP.readUInt8\n arr.writeUInt8 = BP.writeUInt8\n\n return arr\n}", "title": "" }, { "docid": "e9a5e6dcf6ba66bc94e33ee88a330b79", "score": "0.50934076", "text": "function encodeArray(array, proto, offset, buffer, protos) {\n var i = 0;\n if (util.isSimpleType(proto.type)) {\n offset = writeBytes(buffer, offset, encodeTag(proto.type, proto.tag));\n offset = writeBytes(buffer, offset, codec.encodeUInt32(array.length));\n for (i = 0; i < array.length; i++) {\n offset = encodeProp(array[i], proto.type, offset, buffer);\n }\n }\n else {\n for (i = 0; i < array.length; i++) {\n offset = writeBytes(buffer, offset, encodeTag(proto.type, proto.tag));\n offset = encodeProp(array[i], proto.type, offset, buffer, protos);\n }\n }\n return offset;\n }", "title": "" }, { "docid": "db616340c1805bf3dc9f8a1816ca4b35", "score": "0.50746185", "text": "function encodeArray(array, proto, offset, buffer, protos) {\n var i = 0;\n\n if (util.isSimpleType(proto.type)) {\n offset = writeBytes(buffer, offset, encodeTag(proto.type, proto.tag));\n offset = writeBytes(buffer, offset, codec.encodeUInt32(array.length));\n\n for (i = 0; i < array.length; i++) {\n offset = encodeProp(array[i], proto.type, offset, buffer);\n }\n } else {\n for (i = 0; i < array.length; i++) {\n offset = writeBytes(buffer, offset, encodeTag(proto.type, proto.tag));\n offset = encodeProp(array[i], proto.type, offset, buffer, protos);\n }\n }\n\n return offset;\n }", "title": "" }, { "docid": "ca7de429663fc8cc9fa91dd599128262", "score": "0.5068985", "text": "function encodeFunctionTxData(functionName, types, args) {\n const fullName = `${functionName}(${types.join()})`;\n const signature = CryptoJS.SHA3(fullName, {\n outputLength: 256,\n }).toString(CryptoJS.enc.Hex).slice(0, 8);\n const dataHex = signature + coder.encodeParams(types, args);\n return `0x${dataHex}`;\n}", "title": "" }, { "docid": "0485d6f48bf93ace0149e121f09df0f5", "score": "0.50638163", "text": "function writeUnit(ir)\n {\n // Get the code block for this code unit\n var codeBlock = ir.runtime.cb;\n\n assert (\n codeBlock !== undefined,\n 'code block not found'\n );\n\n // Get all the child functions for this code unit\n var funcs = [ir].concat(ir.getChildrenList());\n\n // Update the total number of functions written\n numFuncs += funcs.length;\n\n //\n // TODO: locate tachyon main function.\n // ir.getChild('tachyon_main');\n //\n // Need offset of the \"normal\" entry point for the function.\n //\n // use getEntryPoint()? does not give you label\n\n\n\n\n\n // TODO: write bytes for current function to code array\n\n\n\n\n\n // TODO: write/encode linkable (required) values to code array\n //\n // For required values, need to know:\n // - What offset is this at in the code block?\n // - Each link object is associated with a label\n // - What is being linked?\n // - If function, which entry point/label?\n // - If string, ref to string const, which string is it?\n // - What value goes in the hole\n // - Relative or absolute address\n // - Number of bits (type, eg: long or byte or short)\n\n\n\n\n\n\n\n }", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" }, { "docid": "015928282195763a0f0a9aab822512b7", "score": "0.50159645", "text": "function Encoder() {}", "title": "" } ]
92432d58b03e1a4a6df094819e6fb41d
Setup GL resources for a nontexture depth buffer
[ { "docid": "656a213fb9c545399e21b45e27483b26", "score": "0.6712144", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\tvar isCube = ( renderTarget.isWebGLCubeRenderTarget === true );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget, false );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget, false );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindFramebuffer( 36160, null );\n\n\t}", "title": "" } ]
[ { "docid": "12dded7cf7d8db648d5f237097b572ab", "score": "0.70203334", "text": "function initializeBuffers() {\n // Tell WebGL how to convert from clip space to pixels\n gl.viewport(0, 0, gl.canvas.width, gl.canvas.height);\n // Clear canvas\n gl.clear(gl.COLOR_BUFFER_BIT);\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n\n gl.useProgram(shaderProgram); \n // Set window resolution\n gl.uniform2f(gl.getUniformLocation(shaderProgram, \"u_resolution\"), gl.canvas.width, gl.canvas.height);\n}", "title": "" }, { "docid": "fa7a50aaa80f6f7fe8ddef0449327a58", "score": "0.6953264", "text": "initMainPath() {\n\n const device = this.device;\n const self = this;\n\n // WebGL 2 depth layer just copies existing color or depth\n this.layer = new Layer({\n enabled: false,\n name: \"Depth\",\n id: LAYERID_DEPTH,\n\n onDisable: function () {\n self.releaseRenderTarget(this.depthRenderTarget);\n this.depthRenderTarget = null;\n\n self.releaseRenderTarget(this.colorRenderTarget);\n this.colorRenderTarget = null;\n },\n\n onPreRenderOpaque: function (cameraPass) { // resize depth map if needed\n\n /** @type {import('../../framework/components/camera/component.js').CameraComponent} */\n const camera = this.cameras[cameraPass];\n\n if (camera.renderSceneColorMap) {\n\n // allocate / resize existing RT as needed\n if (self.shouldReallocate(this.colorRenderTarget, camera.renderTarget?.colorBuffer, true)) {\n self.releaseRenderTarget(this.colorRenderTarget);\n const format = self.getSourceColorFormat(camera.renderTarget?.colorBuffer);\n this.colorRenderTarget = self.allocateRenderTarget(this.colorRenderTarget, camera.renderTarget, device, format, false, true, false);\n }\n\n // copy color from the current render target\n DebugGraphics.pushGpuMarker(device, 'GRAB-COLOR');\n\n const colorBuffer = this.colorRenderTarget.colorBuffer;\n\n if (device.isWebGPU) {\n\n device.copyRenderTarget(camera.renderTarget, this.colorRenderTarget, true, false);\n\n // generate mipmaps\n device.mipmapRenderer.generate(this.colorRenderTarget.colorBuffer.impl);\n\n } else {\n\n device.copyRenderTarget(device.renderTarget, this.colorRenderTarget, true, false);\n\n // generate mipmaps\n device.activeTexture(device.maxCombinedTextures - 1);\n device.bindTexture(colorBuffer);\n device.gl.generateMipmap(colorBuffer.impl._glTarget);\n }\n\n DebugGraphics.popGpuMarker(device);\n\n // assign unifrom\n self.setupUniform(device, false, colorBuffer);\n }\n\n if (camera.renderSceneDepthMap) {\n\n let useDepthBuffer = true;\n let format = PIXELFORMAT_DEPTHSTENCIL;\n if (device.isWebGPU) {\n const numSamples = camera.renderTarget?.samples ?? device.samples;\n\n // when depth buffer is multi-sampled, instead of copying it out, we use custom shader to resolve it\n // to a R32F texture, used as a color attachment of the render target\n if (numSamples > 1) {\n format = PIXELFORMAT_R32F;\n useDepthBuffer = false;\n }\n }\n\n // reallocate RT if needed\n if (self.shouldReallocate(this.depthRenderTarget, camera.renderTarget?.depthBuffer)) {\n self.releaseRenderTarget(this.depthRenderTarget);\n this.depthRenderTarget = self.allocateRenderTarget(this.depthRenderTarget, camera.renderTarget, device, format, useDepthBuffer, false, true);\n }\n\n // copy depth\n DebugGraphics.pushGpuMarker(device, 'GRAB-DEPTH');\n device.copyRenderTarget(device.renderTarget, this.depthRenderTarget, false, true);\n DebugGraphics.popGpuMarker(device);\n\n // assign uniform\n self.setupUniform(device, true, useDepthBuffer ? this.depthRenderTarget.depthBuffer : this.depthRenderTarget.colorBuffer);\n }\n },\n\n onPostRenderOpaque: function (cameraPass) {\n }\n });\n }", "title": "" }, { "docid": "0e8c749d7426933c022e1a7bc2317790", "score": "0.6900271", "text": "setUpWebGLBuffers(){\n this.webglPosBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.webglPosBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.posBuffer), gl.STATIC_DRAW);\n this.webglPosBuffer.itemSize = 3;\n this.webglPosBuffer.numItems = this.posBuffer.length / 3;\n\n if (this.normalBuffer){\n this.webglNormalBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.webglNormalBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.normalBuffer), gl.STATIC_DRAW);\n this.webglNormalBuffer.itemSize = 3;\n this.webglNormalBuffer.numItems = this.normalBuffer.length / 3;\n }\n\n if (this.tangentBuffer){\n this.webglTangentBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.webglTangentBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.tangentBuffer), gl.STATIC_DRAW);\n this.webglTangentBuffer.itemSize = 3;\n this.webglTangentBuffer.numItems = this.tangentBuffer.length / 3;\n }\n\n if (this.colorBuffer){\n this.webglColorBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.webglColorBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.colorBuffer), gl.STATIC_DRAW);\n this.webglColorBuffer.itemSize = 3;\n this.webglColorBuffer.numItems = this.colorBuffer.length / 3;\n }\n\n if (this.textureBuffer){\n this.webglTextureBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, this.webglTextureBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.textureBuffer), gl.STATIC_DRAW);\n this.webglTextureBuffer.itemSize = 2;\n this.webglTextureBuffer.numItems = this.textureBuffer.length / 2;\n }\n\n this.webglIndexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.webglIndexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.indexBuffer), gl.STATIC_DRAW);\n this.webglIndexBuffer.itemSize = 1;\n this.webglIndexBuffer.numItems = this.indexBuffer.length;\n }", "title": "" }, { "docid": "7a64dadbf9217b7282959d99f67f2f08", "score": "0.67862177", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\t\tvar isCube = ( renderTarget.isWebGLCubeRenderTarget === true );\n\n\t\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\t\tif ( isCube ) { throw new Error( 'target.depthTexture not supported in Cube render targets' ); }\n\n\t\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t\t} else {\n\n\t\t\t\tif ( isCube ) {\n\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_gl.bindFramebuffer( 36160, null );\n\n\t\t}", "title": "" }, { "docid": "f555334dc528e749f8afe85934c1a478", "score": "0.6782403", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\n\t\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\t\tif ( isCube ) { throw new Error( 'target.depthTexture not supported in Cube render targets' ); }\n\n\t\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t\t} else {\n\n\t\t\t\tif ( isCube ) {\n\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_gl.bindFramebuffer( 36160, null );\n\n\t\t}", "title": "" }, { "docid": "f555334dc528e749f8afe85934c1a478", "score": "0.6782403", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\n\t\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\t\tif ( isCube ) { throw new Error( 'target.depthTexture not supported in Cube render targets' ); }\n\n\t\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t\t} else {\n\n\t\t\t\tif ( isCube ) {\n\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_gl.bindFramebuffer( 36160, null );\n\n\t\t}", "title": "" }, { "docid": "907d3b9ed7fa20ab5edcbcf1ceda371f", "score": "0.67757803", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\t\tvar isCube = ( renderTarget.isWebGLCubeRenderTarget === true );\n\n\t\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\t\tif ( isCube ) { throw new Error( 'target.depthTexture not supported in Cube render targets' ); }\n\n\t\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t\t} else {\n\n\t\t\t\tif ( isCube ) {\n\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget, false );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget, false );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_gl.bindFramebuffer( 36160, null );\n\n\t\t}", "title": "" }, { "docid": "5520965658864c32c3679c92c8fe6631", "score": "0.676296", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\n\t\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t\t} else {\n\n\t\t\t\tif ( isCube ) {\n\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_gl.bindFramebuffer( 36160, null );\n\n\t\t}", "title": "" }, { "docid": "46602a4aa7a23522381cd3087fce2570", "score": "0.67494893", "text": "function setupDepthRenderbuffer(renderTarget) {\n var renderTargetProperties = properties.get(renderTarget);\n\n var isCube = renderTarget.isWebGLRenderTargetCube === true;\n\n if (renderTarget.depthTexture) {\n if (isCube)\n throw new Error(\n \"target.depthTexture not supported in Cube render targets\"\n );\n\n setupDepthTexture(\n renderTargetProperties.__webglFramebuffer,\n renderTarget\n );\n } else {\n if (isCube) {\n renderTargetProperties.__webglDepthbuffer = [];\n\n for (var i = 0; i < 6; i++) {\n _gl.bindFramebuffer(\n 36160,\n renderTargetProperties.__webglFramebuffer[i]\n );\n renderTargetProperties.__webglDepthbuffer[\n i\n ] = _gl.createRenderbuffer();\n setupRenderBufferStorage(\n renderTargetProperties.__webglDepthbuffer[i],\n renderTarget\n );\n }\n } else {\n _gl.bindFramebuffer(\n 36160,\n renderTargetProperties.__webglFramebuffer\n );\n renderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n setupRenderBufferStorage(\n renderTargetProperties.__webglDepthbuffer,\n renderTarget\n );\n }\n }\n\n _gl.bindFramebuffer(36160, null);\n }", "title": "" }, { "docid": "7ce81c4c8414ea3987e98a2e08b5c3db", "score": "0.6719579", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindFramebuffer( 36160, null );\n\n\t}", "title": "" }, { "docid": "7ce81c4c8414ea3987e98a2e08b5c3db", "score": "0.6719579", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindFramebuffer( 36160, null );\n\n\t}", "title": "" }, { "docid": "7ce81c4c8414ea3987e98a2e08b5c3db", "score": "0.6719579", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindFramebuffer( 36160, null );\n\n\t}", "title": "" }, { "docid": "811e8c12ee680a95d6ced79c68fe3067", "score": "0.6717285", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\n\t\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t\t} else {\n\n\t\t\t\tif ( isCube ) {\n\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t\t}", "title": "" }, { "docid": "811e8c12ee680a95d6ced79c68fe3067", "score": "0.6717285", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\n\t\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t\t} else {\n\n\t\t\t\tif ( isCube ) {\n\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t\t}", "title": "" }, { "docid": "811e8c12ee680a95d6ced79c68fe3067", "score": "0.6717285", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\n\t\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t\t} else {\n\n\t\t\t\tif ( isCube ) {\n\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t\t}", "title": "" }, { "docid": "811e8c12ee680a95d6ced79c68fe3067", "score": "0.6717285", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\n\t\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t\t} else {\n\n\t\t\t\tif ( isCube ) {\n\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t\t}", "title": "" }, { "docid": "a89f42e13fda039659fd4b6958d030af", "score": "0.6711099", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\t\n\t\t\t\tvar renderTargetProperties = properties.get( renderTarget );\n\t\n\t\t\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\t\n\t\t\t\tif ( renderTarget.depthTexture ) {\n\t\n\t\t\t\t\tif ( isCube ) throw new Error('target.depthTexture not supported in Cube render targets');\n\t\n\t\t\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\t\n\t\t\t\t} else {\n\t\n\t\t\t\t\tif ( isCube ) {\n\t\n\t\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\t\n\t\t\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\t\n\t\t\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\t\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t} else {\n\t\n\t\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\t\n\t\t\t\t\t}\n\t\n\t\t\t\t}\n\t\n\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\t\n\t\t\t}", "title": "" }, { "docid": "f046ebe0b8b077cdffef0113c83a1b3b", "score": "0.6705501", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\t\tvar isCube = ( (renderTarget && renderTarget.isWebGLRenderTargetCube) );\n\n\t\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\t\tif ( isCube ) throw new Error('target.depthTexture not supported in Cube render targets');\n\n\t\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t\t} else {\n\n\t\t\t\tif ( isCube ) {\n\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t\t}", "title": "" }, { "docid": "274749f4178c720a8731e267c2ab87b5", "score": "0.670292", "text": "createRenderBuffers() {\n // Create Texture\n this.texture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, this.texture);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.canvas.width, this.canvas.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n // Create frame buffer\n this.frameBuffer = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0);\n }", "title": "" }, { "docid": "22f7e726d52ea2be69c86abbe33c2ccd", "score": "0.67019266", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n \t\tvar renderTargetProperties = properties.get( renderTarget );\n\n \t\tvar isCube = ( renderTarget.isWebGLCubeRenderTarget === true );\n\n \t\tif ( renderTarget.depthTexture ) {\n\n \t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n \t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n \t\t} else {\n\n \t\t\tif ( isCube ) {\n\n \t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n \t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n \t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer[ i ] );\n \t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n \t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget, false );\n\n \t\t\t\t}\n\n \t\t\t} else {\n\n \t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer );\n \t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n \t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget, false );\n\n \t\t\t}\n\n \t\t}\n\n \t\t_gl.bindFramebuffer( 36160, null );\n\n \t}", "title": "" }, { "docid": "74eb21d9e4c5099cc6a16a55490905a9", "score": "0.6700133", "text": "constructor(gl) {\r\n this._gl = gl;\r\n this.onLoss = new _util_event_emitter__WEBPACK_IMPORTED_MODULE_10__[\"VoidEventEmitter\"]();\r\n this._contextLostListener = (e) => {\r\n e.preventDefault();\r\n this.onLoss.fire();\r\n };\r\n gl.canvas.addEventListener('webglcontextlost', this._contextLostListener);\r\n this._capabilities = new _capabilities__WEBPACK_IMPORTED_MODULE_5__[\"default\"](gl);\r\n const vaoExt = gl.getExtension('OES_vertex_array_object');\r\n if (!vaoExt) {\r\n throw new Error('OES_vertex_array_object is required.');\r\n }\r\n this._vaoExt = vaoExt;\r\n if (!gl.getExtension('OES_standard_derivatives')) {\r\n throw new Error('OES_standard_derivatives is required.');\r\n }\r\n const defaultRenderTarget = this._boundRenderTarget =\r\n this._defaultRenderTarget =\r\n new DefaultRenderTarget(gl);\r\n const boundState = this._boundRenderState = new _state__WEBPACK_IMPORTED_MODULE_6__[\"default\"]();\r\n this._unpackPremultiplyAlpha = false;\r\n // Default viewport and scissor rectangle sizes are equal to the size of\r\n // the canvas of the WebGL context. But we have no way of knowing them in\r\n // RenderState's constructor. So we're fixing them here.\r\n boundState.scissorWidth = boundState.viewportWidth =\r\n defaultRenderTarget.getWidth();\r\n boundState.scissorHeight = boundState.viewportHeight =\r\n defaultRenderTarget.getHeight();\r\n const quadBuffer = this._quadVertexBuffer =\r\n new _gl_buffer__WEBPACK_IMPORTED_MODULE_1__[\"default\"](gl, gl.ARRAY_BUFFER, gl.STATIC_DRAW);\r\n quadBuffer.bind();\r\n gl.bufferData(gl.ARRAY_BUFFER, QUAD_VERTEX_DATA, gl.STATIC_DRAW);\r\n this._quadVao = this.createVao(QUAD_ATTRIB_MAPPING, quadBuffer, null);\r\n gl.bindBuffer(gl.ARRAY_BUFFER, null);\r\n this._boundProgram = null;\r\n this._boundVao = null;\r\n this._boundTextures = new Array(this._capabilities.getMaxCombinedTextureImageUnits());\r\n this._boundTextures.fill(null);\r\n this._boundTextureUnit = 0;\r\n }", "title": "" }, { "docid": "934224b40c855ba97b5cea9b25ef5477", "score": "0.6697233", "text": "function setupDepthRenderbuffer(renderTarget) {\n\n\t\tvar renderTargetProperties = properties.get(renderTarget);\n\n\t\tvar isCube = renderTarget.isWebGLRenderTargetCube === true;\n\n\t\tif (renderTarget.depthTexture) {\n\n\t\t\tif (isCube) throw new Error('target.depthTexture not supported in Cube render targets');\n\n\t\t\tsetupDepthTexture(renderTargetProperties.__webglFramebuffer, renderTarget);\n\t\t} else {\n\n\t\t\tif (isCube) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor (var i = 0; i < 6; i++) {\n\n\t\t\t\t\t_gl.bindFramebuffer(_gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[i]);\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[i] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage(renderTargetProperties.__webglDepthbuffer[i], renderTarget);\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer(_gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer);\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage(renderTargetProperties.__webglDepthbuffer, renderTarget);\n\t\t\t}\n\t\t}\n\n\t\t_gl.bindFramebuffer(_gl.FRAMEBUFFER, null);\n\t}", "title": "" }, { "docid": "64af523a79725fac6ee10def15dcdceb", "score": "0.6689908", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\tif ( isCube ) throw new Error('target.depthTexture not supported in Cube render targets');\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t}", "title": "" }, { "docid": "64af523a79725fac6ee10def15dcdceb", "score": "0.6689908", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\tif ( isCube ) throw new Error('target.depthTexture not supported in Cube render targets');\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t}", "title": "" }, { "docid": "64af523a79725fac6ee10def15dcdceb", "score": "0.6689908", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\tif ( isCube ) throw new Error('target.depthTexture not supported in Cube render targets');\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t}", "title": "" }, { "docid": "0fb5d232aaf9410e29661524ee5bd81d", "score": "0.66763973", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t}", "title": "" }, { "docid": "0fb5d232aaf9410e29661524ee5bd81d", "score": "0.66763973", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t}", "title": "" }, { "docid": "0fb5d232aaf9410e29661524ee5bd81d", "score": "0.66763973", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t}", "title": "" }, { "docid": "0fb5d232aaf9410e29661524ee5bd81d", "score": "0.66763973", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t}", "title": "" }, { "docid": "0fb5d232aaf9410e29661524ee5bd81d", "score": "0.66763973", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t}", "title": "" }, { "docid": "0fb5d232aaf9410e29661524ee5bd81d", "score": "0.66763973", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t}", "title": "" }, { "docid": "0fb5d232aaf9410e29661524ee5bd81d", "score": "0.66763973", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t}", "title": "" }, { "docid": "8ebe66441d2c7aca328b872f584d0b63", "score": "0.66724366", "text": "function setupRenderBufferStorage( renderbuffer, renderTarget, isMultisample ) {\n\n \t\t_gl.bindRenderbuffer( 36161, renderbuffer );\n\n \t\tif ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) {\n\n \t\t\tvar glInternalFormat = 33189;\n\n \t\t\tif ( isMultisample ) {\n\n \t\t\t\tvar depthTexture = renderTarget.depthTexture;\n\n \t\t\t\tif ( depthTexture && depthTexture.isDepthTexture ) {\n\n \t\t\t\t\tif ( depthTexture.type === FloatType ) {\n\n \t\t\t\t\t\tglInternalFormat = 36012;\n\n \t\t\t\t\t} else if ( depthTexture.type === UnsignedIntType ) {\n\n \t\t\t\t\t\tglInternalFormat = 33190;\n\n \t\t\t\t\t}\n\n \t\t\t\t}\n\n \t\t\t\tvar samples = getRenderTargetSamples( renderTarget );\n\n \t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n \t\t\t} else {\n\n \t\t\t\t_gl.renderbufferStorage( 36161, glInternalFormat, renderTarget.width, renderTarget.height );\n\n \t\t\t}\n\n \t\t\t_gl.framebufferRenderbuffer( 36160, 36096, 36161, renderbuffer );\n\n \t\t} else if ( renderTarget.depthBuffer && renderTarget.stencilBuffer ) {\n\n \t\t\tif ( isMultisample ) {\n\n \t\t\t\tvar samples = getRenderTargetSamples( renderTarget );\n\n \t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, 35056, renderTarget.width, renderTarget.height );\n\n \t\t\t} else {\n\n \t\t\t\t_gl.renderbufferStorage( 36161, 34041, renderTarget.width, renderTarget.height );\n\n \t\t\t}\n\n\n \t\t\t_gl.framebufferRenderbuffer( 36160, 33306, 36161, renderbuffer );\n\n \t\t} else {\n\n \t\t\tvar glFormat = utils.convert( renderTarget.texture.format );\n \t\t\tvar glType = utils.convert( renderTarget.texture.type );\n \t\t\tvar glInternalFormat = getInternalFormat( renderTarget.texture.internalFormat, glFormat, glType );\n\n \t\t\tif ( isMultisample ) {\n\n \t\t\t\tvar samples = getRenderTargetSamples( renderTarget );\n\n \t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n \t\t\t} else {\n\n \t\t\t\t_gl.renderbufferStorage( 36161, glInternalFormat, renderTarget.width, renderTarget.height );\n\n \t\t\t}\n\n \t\t}\n\n \t\t_gl.bindRenderbuffer( 36161, null );\n\n \t}", "title": "" }, { "docid": "32f41c96d494cc68dfe9c4cca2ee9ce5", "score": "0.66625726", "text": "function initPicking() {\n //Creates texture\n colorTexture = gl.createTexture();\n gl.bindTexture(gl.TEXTURE_2D, colorTexture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, frameWidth, frameHeight, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n\n //Creates framebuffer\n fb = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, fb);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, colorTexture, 0);\n gl.bindTexture(gl.TEXTURE_2D, colorTexture);\n gl.enable(gl.DEPTH_TEST);\n\n // create renderbuffer\n depthBuffer = gl.createRenderbuffer();\n gl.bindRenderbuffer(gl.RENDERBUFFER, depthBuffer);\n\n // allocate renderbuffer\n gl.renderbufferStorage(\n gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, frameWidth, frameHeight); \n\n // attach renderbuffer\n gl.framebufferRenderbuffer(\n gl.FRAMEBUFFER,\n gl.DEPTH_ATTACHMENT,\n gl.RENDERBUFFER,\n depthBuffer);\n\n if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) != gl.FRAMEBUFFER_COMPLETE) {\n alert(\"Failed to initialize framebuffer.\");\n return;\n }\n}", "title": "" }, { "docid": "9e384b415eb036405c25560cb7151911", "score": "0.6657355", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\tconst isCube = ( renderTarget.isWebGLCubeRenderTarget === true );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget, false );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget, false );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindFramebuffer( 36160, null );\n\n\t}", "title": "" }, { "docid": "9e384b415eb036405c25560cb7151911", "score": "0.6657355", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\tconst isCube = ( renderTarget.isWebGLCubeRenderTarget === true );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget, false );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget, false );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindFramebuffer( 36160, null );\n\n\t}", "title": "" }, { "docid": "112f213f2d9dfdc9632fb85b649b8032", "score": "0.6656511", "text": "function initShaders() {\n \n // Create the shader program\n shTexture = new Shader(\"Object to texture space\", \"textureSpaceObjectRender-vs\", \"textureSpaceObjectRender-fs\");\n shTexture.compileShader(gl);\n shTexture.bind(gl);\n\n\n // Create normal rendering shader program\n shaderNormal = new Shader(\"Normal Rendering\", \"shader-vs\", \"shader-fs\");\n shaderNormal.compileShader(gl);\n shaderNormal.bind(gl);\n\n\n //Create Texture Full screen shader\n shaderTextureFS = new Shader(\"Normal Rendering\", \"textureRender-vs\", \"textureRender-fs\");\n shaderTextureFS.compileShader(gl);\n shaderTextureFS.bind(gl);\n\n //Create Texture for Color flat rendering\n shaderFlatColor = new Shader(\"Flat color Rendering\", \"flatcolor-vs\", \"flatcolor-fs\");\n shaderFlatColor.compileShader(gl);\n shaderFlatColor.bind(gl);\n\n //Create Texture for Color flat rendering\n shaderPaint = new Shader(\"Paint Rendering\", \"paint-vs\", \"paint-fs\");\n shaderPaint.compileShader(gl);\n shaderPaint.bind(gl);\n\n}", "title": "" }, { "docid": "baa265d76816c3b6e686039e17419c22", "score": "0.66476023", "text": "prepareForRendering(gl) {\n\n }", "title": "" }, { "docid": "5188bd9d7ce23f978367c29f189d88cd", "score": "0.6631726", "text": "function setupDepthRenderbuffer(renderTarget) {\n const renderTargetProperties = properties.get(renderTarget);\n\n const isCube = renderTarget.isWebGLCubeRenderTarget === true;\n\n if (renderTarget.depthTexture) {\n if (isCube) throw new Error('target.depthTexture not supported in Cube render targets');\n\n setupDepthTexture(renderTargetProperties.__webglFramebuffer, renderTarget);\n } else if (isCube) {\n renderTargetProperties.__webglDepthbuffer = [];\n\n for (let i = 0; i < 6; i++) {\n state.bindFramebuffer(_gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[i]);\n renderTargetProperties.__webglDepthbuffer[i] = _gl.createRenderbuffer();\n setupRenderBufferStorage(renderTargetProperties.__webglDepthbuffer[i], renderTarget, false);\n }\n } else {\n state.bindFramebuffer(_gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer);\n renderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n setupRenderBufferStorage(renderTargetProperties.__webglDepthbuffer, renderTarget, false);\n }\n\n state.bindFramebuffer(_gl.FRAMEBUFFER, null);\n }", "title": "" }, { "docid": "354fec1d38c6123598c64226f5953d26", "score": "0.6631053", "text": "function setupDepthRenderbuffer( renderTarget ) {\r\n\r\n\t\t\tvar renderTargetProperties = properties.get( renderTarget );\r\n\r\n\t\t\tvar isCube = ( renderTarget instanceof THREE.WebGLRenderTargetCube );\r\n\r\n\t\t\tif ( isCube ) {\r\n\r\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\r\n\r\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\r\n\r\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\r\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\r\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\r\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\r\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\r\n\r\n\t\t\t}\r\n\r\n\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\r\n\r\n\t\t}", "title": "" }, { "docid": "b50e0384904b2a30709c0a0deb650925", "score": "0.66250294", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\tconst isCube = ( renderTarget.isWebGLCubeRenderTarget === true );\n\n\t\tif ( renderTarget.depthTexture && ! renderTargetProperties.__autoAllocateDepthBuffer ) {\n\n\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\tstate.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget, false );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tstate.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget, false );\n\n\t\t\t}\n\n\t\t}\n\n\t\tstate.bindFramebuffer( 36160, null );\n\n\t}", "title": "" }, { "docid": "b50e0384904b2a30709c0a0deb650925", "score": "0.66250294", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\t\tconst isCube = ( renderTarget.isWebGLCubeRenderTarget === true );\n\n\t\tif ( renderTarget.depthTexture && ! renderTargetProperties.__autoAllocateDepthBuffer ) {\n\n\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\tstate.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget, false );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tstate.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget, false );\n\n\t\t\t}\n\n\t\t}\n\n\t\tstate.bindFramebuffer( 36160, null );\n\n\t}", "title": "" }, { "docid": "a160b62ce838868c1e8c4cbe5e66a3f5", "score": "0.6614606", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\tvar isCube = ( renderTarget instanceof fm.WebGLRenderTargetCube );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\tif ( isCube ) throw new Error('target.depthTexture not supported in Cube render targets');\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t}", "title": "" }, { "docid": "e6b67405661722b7fab01635ccc1d461", "score": "0.66102934", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tconst renderTargetProperties = properties.get( renderTarget );\n\n\t\tconst isCube = ( renderTarget.isWebGLCubeRenderTarget === true );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\tif ( isCube ) throw new Error( 'target.depthTexture not supported in Cube render targets' );\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget, false );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget, false );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t}", "title": "" }, { "docid": "95e1e7deb7a2f551e11905ad4b95f07b", "score": "0.659107", "text": "function init(resources) {\n\n //create a GL context\n gl = createContext(canvasWidth, canvasHeight);\n\n //in WebGL / OpenGL3 we have to create and use our own shaders for the programmable pipeline\n //create the shader program\n shaderProgram = createProgram(gl, resources.texture_vs, resources.texture_fs);\n\n lineDrawProgram = createProgram(gl, resources.staticcolor_vs, resources.staticcolor_fs);\n\n /*set buffers for cube*/\n initBuffer();\n\n /*create scene graph*/\n rootNode = new ShaderSGNode(shaderProgram);\n\n createLightNodes(resources);\n createRiver(resources);\n createRails(resources);\n createBridge(resources);\n createPrism(resources);\n createPerson(resources);\n createBillboardedPeople(resources);\n createBillBoards(resources);\n createStations(resources);\n createLandScape(resources);\n createTram(resources);\n createEyePoint(resources);\n\n //register keyboard events\n window.addEventListener(\"keyup\", keyUp, false);\n window.addEventListener(\"keydown\", keyDown, false);\n window.addEventListener(\"mousemove\", mouseMoved, false);\n window.addEventListener(\"mouseup\", mouseUp, false);\n window.addEventListener(\"mousedown\", mouseDown, false);\n}", "title": "" }, { "docid": "a395b62d93e5f4be5540f21a7bcbf5d9", "score": "0.6588141", "text": "function setupDepthRenderbuffer( renderTarget ) {\r\n\t\r\n\t\t\tvar renderTargetProperties = properties.get( renderTarget );\r\n\t\r\n\t\t\tvar isCube = ( renderTarget instanceof THREE.WebGLRenderTargetCube );\r\n\t\r\n\t\t\tif ( renderTarget.depthTexture ) {\r\n\t\r\n\t\t\t\tif ( isCube ) throw new Error('target.depthTexture not supported in Cube render targets');\r\n\t\r\n\t\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\r\n\t\r\n\t\t\t} else {\r\n\t\r\n\t\t\t\tif ( isCube ) {\r\n\t\r\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\r\n\t\r\n\t\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\r\n\t\r\n\t\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\r\n\t\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\r\n\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\r\n\t\r\n\t\t\t\t\t}\r\n\t\r\n\t\t\t\t} else {\r\n\t\r\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\r\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\r\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\r\n\t\r\n\t\t\t\t}\r\n\t\r\n\t\t\t}\r\n\t\r\n\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\r\n\t\r\n\t\t}", "title": "" }, { "docid": "cc436036aeb7d89be3f8f92cbde17156", "score": "0.65646386", "text": "function prepareGlVariables() {\n context.aVertexPositionId = gl.getAttribLocation(context.shaderProgram, \"aVertexPosition\");\n context.aVertexNormalId = gl.getAttribLocation(context.shaderProgram, \"aVertexNormal\");\n context.aVertexColorId = gl.getAttribLocation(context.shaderProgram, \"aVertexColor\");\n context.aVertexTextureCoordId = gl.getAttribLocation(context.shaderProgram, \"aVertexTextureCoord\");\n\n context.uProjectionMatId = gl.getUniformLocation(context.shaderProgram, \"uProjectionMat\");\n context.uModelMatId = gl.getUniformLocation(context.shaderProgram, \"uModelMat\");\n context.uNormalMatId = gl.getUniformLocation(context.shaderProgram, \"uNormalMat\");\n\n // Lighting\n context.uEnableLightingId = gl.getUniformLocation(context.shaderProgram, \"uEnableLighting\");\n context.uLightPositionId = gl.getUniformLocation(context.shaderProgram, \"uLightPosition\");\n context.uLightColorId = gl.getUniformLocation(context.shaderProgram, \"uLightColor\");\n\n\n context.uIsTextureDrawingId = gl.getUniformLocation(context.shaderProgram, \"uIsTextureDrawing\");\n context.uSamplerId = gl.getUniformLocation(context.shaderProgram, \"uSampler\");\n}", "title": "" }, { "docid": "954a75445016652bfc625f456aa67721", "score": "0.6562467", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\tvar isCube = ( renderTarget instanceof THREE.WebGLRenderTargetCube );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\tif ( isCube ) throw new Error('target.depthTexture not supported in Cube render targets');\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t}", "title": "" }, { "docid": "954a75445016652bfc625f456aa67721", "score": "0.6562467", "text": "function setupDepthRenderbuffer( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\n\t\tvar isCube = ( renderTarget instanceof THREE.WebGLRenderTargetCube );\n\n\t\tif ( renderTarget.depthTexture ) {\n\n\t\t\tif ( isCube ) throw new Error('target.depthTexture not supported in Cube render targets');\n\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\n\n\t\t} else {\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\n\n\t}", "title": "" }, { "docid": "2980e17a3746c604b0e893e1e2c34ec5", "score": "0.65507865", "text": "function setupDepthRenderbuffer( renderTarget ) {\r\n\r\n\t\tvar renderTargetProperties = properties.get( renderTarget );\r\n\r\n\t\tvar isCube = ( renderTarget instanceof THREE.WebGLRenderTargetCube );\r\n\r\n\t\tif ( renderTarget.depthTexture ) {\r\n\r\n\t\t\tif ( isCube ) throw new Error('target.depthTexture not supported in Cube render targets');\r\n\r\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\r\n\r\n\t\t} else {\r\n\r\n\t\t\tif ( isCube ) {\r\n\r\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\r\n\r\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\r\n\r\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\r\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\r\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\r\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\r\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\r\n\r\n\t}", "title": "" }, { "docid": "2980e17a3746c604b0e893e1e2c34ec5", "score": "0.65507865", "text": "function setupDepthRenderbuffer( renderTarget ) {\r\n\r\n\t\tvar renderTargetProperties = properties.get( renderTarget );\r\n\r\n\t\tvar isCube = ( renderTarget instanceof THREE.WebGLRenderTargetCube );\r\n\r\n\t\tif ( renderTarget.depthTexture ) {\r\n\r\n\t\t\tif ( isCube ) throw new Error('target.depthTexture not supported in Cube render targets');\r\n\r\n\t\t\tsetupDepthTexture( renderTargetProperties.__webglFramebuffer, renderTarget );\r\n\r\n\t\t} else {\r\n\r\n\t\t\tif ( isCube ) {\r\n\r\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\r\n\r\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\r\n\r\n\t\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[ i ] );\r\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[ i ] = _gl.createRenderbuffer();\r\n\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer[ i ], renderTarget );\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer );\r\n\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\r\n\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthbuffer, renderTarget );\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, null );\r\n\r\n\t}", "title": "" }, { "docid": "dae307491d7e86ed8f7c7ff8fa20a528", "score": "0.65462935", "text": "function initVertexBuffers() {\n\tbuildCarousel();\t//Build carousel vertex and normal arrays\n\t//Construct vertex array with vertex coordinates and 3 colour components for all parts to draw\n\tvar vertexInfo = C_VERTICES;\n\tvertexInfo = vertexInfo.concat(D_VERTICES);\n\tvertexInfo = vertexInfo.concat(BAR_VERTICES);\n\tvertexInfo = vertexInfo.concat(B_VERTICES);\n\tvertexInfo = vertexInfo.concat(H_VERTICES);\n\t//Construct normal array with normal vectors for all components\n\tvar normInfo = C_NORMALS;\n\tnormInfo = normInfo.concat(D_NORMALS);\n\tnormInfo = normInfo.concat(BAR_NORMALS);\n\tnormInfo = normInfo.concat(B_NORMALS);\n\tnormInfo = normInfo.concat(H_NORMALS); \n\t\n\t//Convert to Float32Array objects\n\tvar vertices = new Float32Array(vertexInfo);\n\tvar normals = new Float32Array(normInfo);\n\t\n\t//Create Vertex buffer\n\tvar vertexColorbuffer = gl.createBuffer(); \n\tif (!vertexColorbuffer) {\n\t\tconsole.log('Failed to create vertexColor buffer object....');\n\t\treturn -1;\n\t}\n\t\n\t// Write the vertex coordinates and color to the buffer object\n\tgl.bindBuffer(gl.ARRAY_BUFFER, vertexColorbuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n\t\n\tvar FSIZE = vertices.BYTES_PER_ELEMENT;\n\t\n\t// Assign the buffer object to a_Position and enable the assignment\n\tvar a_Position = gl.getAttribLocation(gl.program, 'a_Position');\n\tif(a_Position < 0) {\n\t\tconsole.log('Failed to get the storage location of a_Position');\n\t\treturn -1;\n\t}\n\tgl.vertexAttribPointer(a_Position, 3, gl.FLOAT, false, FSIZE*6, 0);\n\tgl.enableVertexAttribArray(a_Position); \n\t\n\t//Get location of attribute variable\n\tvar a_Color = gl.getAttribLocation(gl.program, 'a_Color');\n\tif(a_Color < 0) {\n\t\tconsole.log('Failed to get the storage location of a_Color');\n\t\treturn -1;\n\t}\n\t//Send data to attribute variable\n\tgl.vertexAttribPointer(a_Color, 3, gl.FLOAT, false, FSIZE * 6, FSIZE * 3);\n\tgl.enableVertexAttribArray(a_Color);\n\t\n\tvar normalsbuffer = gl.createBuffer(); \n\tif (!normalsbuffer) {\n\t\tconsole.log('Failed to create normals buffer object....');\n\t\treturn -1;\n\t}\n\t// Write the normal components to the buffer object\n\tgl.bindBuffer(gl.ARRAY_BUFFER, normalsbuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, normals, gl.STATIC_DRAW);\n\t\n\t// Assign the buffer object to a_Position and enable the assignment\n\tvar a_Normal = gl.getAttribLocation(gl.program, 'a_Normal');\n\tif(a_Normal < 0) {\n\t\tconsole.log('Failed to get the storage location of a_Normal');\n\t\treturn -1;\n\t}\n\tgl.vertexAttribPointer(a_Normal, 3, gl.FLOAT, false, 0, 0);\n\tgl.enableVertexAttribArray(a_Normal); \n\t\n\treturn 1;\n}", "title": "" }, { "docid": "ccc248c61f7919ff880d2257622dbc94", "score": "0.65419596", "text": "function setupBuffers() {\n setupTerrainBuffers();\n}", "title": "" }, { "docid": "bfe575d62a346262ea227f9249778c3e", "score": "0.65194213", "text": "function initGL() {\r\n var canvas = document.getElementById(\"webGLcanvas\");\r\n canvas.width = window.innerWidth - 20;\r\n canvas.height = Math.floor(window.innerHeight - 0.2 * window.innerHeight);\r\n try {\r\n gl = canvas.getContext(\"experimental-webgl\");\r\n gl.viewportWidth = canvas.width;\r\n gl.viewportHeight = canvas.height;\r\n } catch (e) {\r\n }\r\n if (!gl) {\r\n alert(\"cannot initialize webGL\");\r\n }\r\n\r\n // programInfo = webglUtils.createProgramInfo(gl, [\"shader-vs\", \"shader-fs\"]);\r\n // program = programInfo.program;\r\n\r\n fragprogram = initShaders(\"perfrag-shader-fs\", \"perfrag-shader-vs\");\r\n vertprogram = initShaders(\"shader-fs\", \"shader-vs\");\r\n // gl.clearColor(1, 1,1, 1);\r\n gl.clearColor(0.1, 0.1, 0.1, 1);\r\n gl.enable(gl.DEPTH_TEST);\r\n\r\n fpsInterval = 1000 / 15;\r\n then = Date.now();\r\n startTime = then;\r\n initTexture();\r\n var loadingModels = [\"dolphins.ply\", \"fracttree.ply\"];\r\n LoadPLY(loadingModels);\r\n setTimeout(() => {\r\n // console.log(fragprogram)\r\n // console.log(vertprogram)\r\n animate();\r\n }, 100);\r\n}", "title": "" }, { "docid": "04a298a1aaf18f8579eb4ae81a908625", "score": "0.64882183", "text": "function initBuffers(gl, model) {\n\n // Fill the data arrays.\n if(model == \"funnel\") {\n // n, m, umin, umax, vmin, vmax\n var funnel =[18, 15, 0, 1, -3, 2*Math.PI];\n createVertex.vertexFunnel(funnel);\n\n } else if(model == \"ei\") {\n // n, m, umin, umax, vmin, vmax\n var egg = [15, 256, -1.0, 2.0, 0.0, 2*Math.PI];\n createVertex.vertexEgg(egg);\n\n } else if(model == \"pseudosphere\") {\n // n, m, umin, umax, vmin, vmax\n var pseudosphere = [20, 40, -Math.PI, Math.PI, 0.1, 3.05];\n createVertex.vertexPseudosphere(pseudosphere);\n\n } else if(model == \"torus\") {\n // n, m, umin, umax, vmin, vmax\n var torus = [60, 60, -2*Math.PI, 2*Math.PI, -2*Math.PI, 2*Math.PI];\n createVertex.vertexTorus(torus);\n\n } else {\n return;\n }\n\n // Setup position vertex buffer object.\n vboPos = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, vboPos);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n // Bind vertex buffer to attribute variable.\n posAttrib = gl.getAttribLocation(shaderProgram, 'pos');\n gl.vertexAttribPointer(posAttrib, 3, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray(posAttrib);\n\n // Setup constant color.\n colAttrib = gl.getAttribLocation(shaderProgram, 'col');\n\n // Setup lines index buffer object.\n iboLines = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, iboLines);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER,\n indicesLines, gl.STATIC_DRAW);\n iboLines.numberOfElements = indicesLines.length;\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\n\n // Setup tris index buffer object.\n iboTris = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, iboTris);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indicesTris, gl.STATIC_DRAW);\n iboTris.numberOfElements = indicesTris.length;\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\n}", "title": "" }, { "docid": "0a41580267ba50892e2680891e5b3a85", "score": "0.64790165", "text": "function setupGLParams() {\n gl.enable(gl.DEPTH_TEST);\n \n gl.enable(gl.BLEND);\n \n //gl.enable(gl.CULL_FACE);\n gl.cullFace(gl.BACK);\n \n ElementIndexUint = gl.getExtension(\"OES_element_index_uint\");\n VertexArrayObjects = gl.getExtension(\"OES_vertex_array_object\");\n}", "title": "" }, { "docid": "06acd5ca052e476d55e81416cef767d7", "score": "0.64605474", "text": "loadBuffers()\r\n {\r\n // Specify the vertex coordinates\r\n this.VertexPositionBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexPositionBuffer); \r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.vBuffer), gl.STATIC_DRAW);\r\n this.VertexPositionBuffer.itemSize = 3;\r\n this.VertexPositionBuffer.numItems = this.numVertices;\r\n console.log(\"Loaded \", this.VertexPositionBuffer.numItems, \" vertices\");\r\n \r\n // Specify normals to be able to do lighting calculations\r\n this.VertexNormalBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexNormalBuffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.nBuffer),\r\n gl.STATIC_DRAW);\r\n this.VertexNormalBuffer.itemSize = 3;\r\n this.VertexNormalBuffer.numItems = this.numVertices;\r\n console.log(\"Loaded \", this.VertexNormalBuffer.numItems, \" normals\");\r\n\r\n this.VertexColorBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ARRAY_BUFFER, this.VertexColorBuffer);\r\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(this.cBuffer),\r\n gl.STATIC_DRAW);\r\n this.VertexColorBuffer.itemSize = 3;\r\n this.VertexColorBuffer.numItems = this.numVertices;\r\n \r\n // Specify faces of the terrain \r\n this.IndexTriBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexTriBuffer);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.fBuffer),\r\n gl.STATIC_DRAW);\r\n this.IndexTriBuffer.itemSize = 1;\r\n this.IndexTriBuffer.numItems = this.fBuffer.length;\r\n console.log(\"Loaded \", this.numFaces, \" triangles\");\r\n \r\n //Setup Edges \r\n this.IndexEdgeBuffer = gl.createBuffer();\r\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.IndexEdgeBuffer);\r\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint32Array(this.eBuffer),\r\n gl.STATIC_DRAW);\r\n this.IndexEdgeBuffer.itemSize = 1;\r\n this.IndexEdgeBuffer.numItems = this.eBuffer.length;\r\n \r\n console.log(\"triangulatedPlane: loadBuffers\");\r\n }", "title": "" }, { "docid": "03cbe1240f510af8d7f4e6237cdc7297", "score": "0.64484787", "text": "function setupRenderBufferStorage( renderbuffer, renderTarget, isMultisample ) {\n\n\t\t\t_gl.bindRenderbuffer( 36161, renderbuffer );\n\n\t\t\tif ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) {\n\n\t\t\t\tvar glInternalFormat = 33189;\n\n\t\t\t\tif ( isMultisample ) {\n\n\t\t\t\t\tvar depthTexture = renderTarget.depthTexture;\n\n\t\t\t\t\tif ( depthTexture && depthTexture.isDepthTexture ) {\n\n\t\t\t\t\t\tif ( depthTexture.type === FloatType ) {\n\n\t\t\t\t\t\t\tglInternalFormat = 36012;\n\n\t\t\t\t\t\t} else if ( depthTexture.type === UnsignedIntType ) {\n\n\t\t\t\t\t\t\tglInternalFormat = 33190;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tvar samples = getRenderTargetSamples( renderTarget );\n\n\t\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.renderbufferStorage( 36161, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t}\n\n\t\t\t\t_gl.framebufferRenderbuffer( 36160, 36096, 36161, renderbuffer );\n\n\t\t\t} else if ( renderTarget.depthBuffer && renderTarget.stencilBuffer ) {\n\n\t\t\t\tif ( isMultisample ) {\n\n\t\t\t\t\tvar samples$1 = getRenderTargetSamples( renderTarget );\n\n\t\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples$1, 35056, renderTarget.width, renderTarget.height );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.renderbufferStorage( 36161, 34041, renderTarget.width, renderTarget.height );\n\n\t\t\t\t}\n\n\n\t\t\t\t_gl.framebufferRenderbuffer( 36160, 33306, 36161, renderbuffer );\n\n\t\t\t} else {\n\n\t\t\t\tvar glFormat = utils.convert( renderTarget.texture.format );\n\t\t\t\tvar glType = utils.convert( renderTarget.texture.type );\n\t\t\t\tvar glInternalFormat$1 = getInternalFormat( renderTarget.texture.internalFormat, glFormat, glType );\n\n\t\t\t\tif ( isMultisample ) {\n\n\t\t\t\t\tvar samples$2 = getRenderTargetSamples( renderTarget );\n\n\t\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples$2, glInternalFormat$1, renderTarget.width, renderTarget.height );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_gl.renderbufferStorage( 36161, glInternalFormat$1, renderTarget.width, renderTarget.height );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t_gl.bindRenderbuffer( 36161, null );\n\n\t\t}", "title": "" }, { "docid": "7ca9ca6ffd08964670b97c0c2b1d8ec7", "score": "0.6440314", "text": "function setupTerrainBuffers() {\n \n\tvar vTerrain=[];\n\tvar fTerrain=[];\n\tvar nTerrain=[];\n\tvar eTerrain=[];\n\tvar cTerrain=[]; // initialize the array with the color values\n\tvar gridN=128;\n\n\tvar numT = terrainFromIteration(gridN, -2,2,-2,2, vTerrain,fTerrain,nTerrain,cTerrain); // pass in color values into the terrain generator\n\t//var numT = planeFromSubdivision(gridN, -1,1,-1,1, vTerrain,fTerrain,nTerrain);\n\tconsole.log(\"Generated \", numT, \" triangles\");\n\n\ttVertexPositionBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, tVertexPositionBuffer); \n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vTerrain), gl.STATIC_DRAW);\n\ttVertexPositionBuffer.itemSize = 3;\n\t//tVertexPositionBuffer.numItems = (gridN+1)*(gridN+1);\n\ttVertexPositionBuffer.numItems = numT*3;\n\n\t// Specify normals to be able to do lighting calculations\n\ttVertexNormalBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, tVertexNormalBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(nTerrain), gl.STATIC_DRAW);\n\ttVertexNormalBuffer.itemSize = 3;\n\t//tVertexNormalBuffer.numItems = (gridN+1)*(gridN+1);\n\ttVertexNormalBuffer.numItems = numT*3;\n\n\t// Specify faces of the terrain \n\ttIndexTriBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, tIndexTriBuffer);\n\tgl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(fTerrain), gl.STATIC_DRAW);\n\ttIndexTriBuffer.itemSize = 1;\n\ttIndexTriBuffer.numItems = numT*3;\n\n\t// Specify the color of each vertex based off of cTerrain\n\ttvertexColorBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, tvertexColorBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(cTerrain), gl.STATIC_DRAW);\n\ttvertexColorBuffer.itemSize = 3;\n\ttvertexColorBuffer.numItems = numT*3;\n\n\t//Setup Edges\n\tgenerateLinesFromIndexedTriangles(fTerrain,eTerrain); \n\ttIndexEdgeBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, tIndexEdgeBuffer);\n\tgl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(eTerrain), gl.STATIC_DRAW);\n\ttIndexEdgeBuffer.itemSize = 1;\n\ttIndexEdgeBuffer.numItems = eTerrain.length; \n}", "title": "" }, { "docid": "dde31908b6293ee3344d3e46de6c1883", "score": "0.6439959", "text": "function initialize(){\n\tgl = canvas.getContext('webgl', {preserveDrawingBuffer: true});\n\tif (!gl) {\n\t\treturn;\n\t}\n\t\n\tgl.enable(gl.CULL_FACE);\n\tgl.enable(gl.DEPTH_TEST);\n\t\n\tprogram = createProgram(gl, compileShader(gl, VSHADER_SOURCE, gl.VERTEX_SHADER), compileShader(gl, FSHADER_SOURCE, gl.FRAGMENT_SHADER));\n\tgl.useProgram(program);\n\n\tspecOn = gl.getUniformLocation(program, \"useSpecular\"); //Specular Bool\n\tpersOn = gl.getUniformLocation(program, \"useOrtho\"); //Ortho/Perspective bool\n\tshadingOn = gl.getUniformLocation(program, \"uShadeOn\"); //shading bool\n\tspotLightOn = gl.getUniformLocation(program, \"uspotLightOn\"); //spotlight bool\n\ttextureOn = gl.getUniformLocation(program, \"uTextureOn\");//texture\n\tuseTextureLocation = gl.getUniformLocation(program, \"useTexture\"); //Texture bool\n\tuseProceduralTexture = gl.getUniformLocation(program, \"uProceduralOn\");\n\t\n\tpositionLocation = gl.getAttribLocation(program, \"a_position\"); //positions\n\tnormalLocation = gl.getAttribLocation(program, \"a_normal\");\t//normal\n\ttextureLocation = gl.getAttribLocation(program, \"a_texture\"); //texture\n\n\tlightColorLocation = gl.getUniformLocation(program, \"u_lightColor\");\n\tspecularColorLocation = gl.getUniformLocation(program, \"u_specularColor\");\n\t\n\tworldLocation = gl.getUniformLocation(program, \"u_world\");\n\tworldViewProjectionLocation = gl.getUniformLocation(program, \"u_worldViewProjection\");\n\tcolorLocation = gl.getUniformLocation(program, \"u_color\");\n\tworldInverseTransposeLocation = gl.getUniformLocation(program, \"u_worldInverseTranspose\");\n\t\n\tshininessLocation = gl.getUniformLocation(program, \"u_shininess\");\n\tlightWorldPositionLocation = gl.getUniformLocation(program, \"u_lightWorldPosition\");\n\tviewWorldPositionLocation = gl.getUniformLocation(program, \"u_viewWorldPosition\");\n\t\n\tlightWorldPositionLocation2 = gl.getUniformLocation(program, \"u_spotLightPosition\");//don't need?\n\tboxCenterPosition = gl.getUniformLocation(program, \"u_boxCenterPosition\");//Position of spotlight\n}", "title": "" }, { "docid": "ac439db64b7e1578df15f60e9f578b46", "score": "0.6433451", "text": "function setupDepthTexture( framebuffer, renderTarget ) {\n\n \t\tvar isCube = ( renderTarget && renderTarget.isWebGLCubeRenderTarget );\n \t\tif ( isCube ) throw new Error( 'Depth Texture with cube render targets is not supported' );\n\n \t\t_gl.bindFramebuffer( 36160, framebuffer );\n\n \t\tif ( ! ( renderTarget.depthTexture && renderTarget.depthTexture.isDepthTexture ) ) {\n\n \t\t\tthrow new Error( 'renderTarget.depthTexture must be an instance of THREE.DepthTexture' );\n\n \t\t}\n\n \t\t// upload an empty depth texture with framebuffer size\n \t\tif ( ! properties.get( renderTarget.depthTexture ).__webglTexture ||\n \t\t\t\trenderTarget.depthTexture.image.width !== renderTarget.width ||\n \t\t\t\trenderTarget.depthTexture.image.height !== renderTarget.height ) {\n\n \t\t\trenderTarget.depthTexture.image.width = renderTarget.width;\n \t\t\trenderTarget.depthTexture.image.height = renderTarget.height;\n \t\t\trenderTarget.depthTexture.needsUpdate = true;\n\n \t\t}\n\n \t\tsetTexture2D( renderTarget.depthTexture, 0 );\n\n \t\tvar webglDepthTexture = properties.get( renderTarget.depthTexture ).__webglTexture;\n\n \t\tif ( renderTarget.depthTexture.format === DepthFormat ) {\n\n \t\t\t_gl.framebufferTexture2D( 36160, 36096, 3553, webglDepthTexture, 0 );\n\n \t\t} else if ( renderTarget.depthTexture.format === DepthStencilFormat ) {\n\n \t\t\t_gl.framebufferTexture2D( 36160, 33306, 3553, webglDepthTexture, 0 );\n\n \t\t} else {\n\n \t\t\tthrow new Error( 'Unknown depthTexture format' );\n\n \t\t}\n\n \t}", "title": "" }, { "docid": "ef887c582760b816bd044142c26979c5", "score": "0.6426081", "text": "constructor(description) {\n this.primitiveType = description.type || gl.POINTS; // Default of points makes sense for computation\n if (description.vertexArray) { // Use a pre-defined VertexArray object (copies its attributes/structure, shares the buffer)\n this.units = description.vertexArray.units;\n this.struct = { fields: description.vertexArray.struct.fields, layout: description.vertexArray.struct.layout };\n this.struct.byteSize = description.vertexArray.struct.byteSize;\n this.vertexBuffers = description.vertexArray.vertexBuffers;\n } else {\n this.units = description.units; // Or build an array for this computer\n this.struct = {\n fields: description.struct,\n layout: Object.entries(description.struct).map(([field, type], i) => Object.assign({field: field}, Util.glTypes[type]))\n };\n // Fill up byte-wise layout information\n this.bytesSoFar = 0;\n this.struct.layout.forEach(field => {field.offset = this.bytesSoFar; this.bytesSoFar += field.bytes; });\n this.struct.byteSize = this.bytesSoFar;\n }\n if (description.divisor) this.divisor = description.divisor; // If this is being used as an instance array\n this.uniforms = description.uniforms || {}; // pointer to object containing the values for the uniforms (pulled by name)\n if (description.uniformBlock) this.uniformBlock = description.uniformBlock; // pointer to a UniformBuffer object to use for uniforms\n if (description.uniformBlocks) this.uniformBlocks = description.uniformBlocks; // array of UniformBuffer object to use for uniforms\n // If capturing a texture, setup the capture framebuffer\n if (description.textureOut) { // TODO: allow supplying the texture buffers? not sure it's really needed\n this.textureOut = description.textureOut; // something truthy (will create buffers) or an array of textures\n this.frameBuffer = gl.createFramebuffer();\n if (description.textureFeedback) {\n this.textureFeedback = description.textureFeedback; // setup configured feedback texture\n }\n }\n if (description.initialize) { // if initialize: Call it for every unit sub-buffer\n let markTime = Date.now();\n this.initialData = new ArrayBuffer(this.units * this.struct.byteSize);\n for (let i = 0; i < this.units; i++) description.initialize(i, new Uint8Array(this.initialData, i * this.struct.byteSize, this.struct.byteSize));\n if (Util.logger) Util.logger(\"initialized \"+this.units+\" objects in \"+(Date.now()-markTime)+\" ms\");\n }\n if (description.initializeObject) { // Initialize with objects created by a closure given the index that returns an object with properties for each value\n let markTime = Date.now();\n this.initialData = new ArrayBuffer(this.units * this.struct.byteSize);\n let dataview = new DataView(this.initialData);\n for (let i = 0; i < this.units; i++) {\n let off = i * this.struct.byteSize; // Offset to the unit data\n let newdata = description.initializeObject(i);\n this.struct.layout.forEach(f => { f.setFunction(dataview, off + f.offset, newdata[f.field]); });\n }\n if (Util.logger) Util.logger(\"initialized \"+this.units+\" objects in \"+(Date.now()-markTime)+\" ms\");\n }\n if (description.initializeBuffer) {\n if (description.initializeBuffer instanceof ArrayBuffer && description.initializeBuffer.byteLength === this.units * this.struct.byteSize) {\n this.initialData = description.initializeBuffer;\n } else {\n Util.logger(\"Cannot initialize with buffer instanceof ArrayBuffer \"+(description.initializeBuffer instanceof ArrayBuffer ? \"yes bytelength=\"+description.initializeBuffer.byteLength+\" bytelength s/b:\"+this.units * this.struct.byteSize : \"not an ArrayBuffer \"));\n }\n }\n if (description.instanceArray) this.instanceArray = description.instanceArray; // Instancing will only apply on rendering but each vertex buffer needs it\n if (description.instanceComputer) { // Instancing will only apply on rendering but each vertex buffer needs it\n this.instanceArray = description.instanceComputer; // it resembles an instance array enough for this\n this.instanceComputer = description.instanceComputer; // step will be called on this at the appropriate time if this is set\n this.instanceComputer.divisor = this.instanceComputer.divisor || 1; // default to one if divisor not specified\n }\n // Setup the double buffers for the vertex arrays\n // if no initial data in description, assume buffers will be given later (before the first step if you want it to work)\n // attributes for instance arrays must be setup right after the vertex arrays as they will use next attribute locations\n if (this.initialData) {\n this.vertexBuffers = [Util.buildVertexBuffer(this.struct, this.initialData, this.instanceArray, 0),\n Util.buildVertexBuffer(this.struct, this.initialData, this.instanceArray, 1)];\n }\n if (description.preStep) {\n if (description.preStep instanceof Function) {\n this.preStep = description.preStep;\n } else {\n console.error(\"preStep is not a function, please give a function to call before step\");\n }\n }\n if (description.updateStep) { // update step is optional, it will just render\n this.updateUniforms = description.updateStep.params;\n let uniformBlocks = \"\";\n if (this.uniformBlock) { // TODO: should depracate, can just use the array version\n uniformBlocks = \"\\nlayout(std140) uniform ublock {\\n\"\n + Util.declarationList(\"\", Util.prefixKeys(\"u_\", this.uniformBlock.struct.fields))\n + \"\\n}\"+(this.uniformBlock.name ? this.uniformBlock.name : \"\")+\";\\n\";\n }\n if (this.uniformBlocks) {\n uniformBlocks = this.uniformBlocks.map((b,i) =>\n \"\\nlayout(std140) uniform ublocks\"+i+\" {\\n\"\n + Util.declarationList(\"\", Util.prefixKeys(\"u_\", b.struct.fields))\n + \"\\n}\"+(b.name ? b.name : \"\")+\";\\n\").join(\"\\n\\n\");\n }\n this.updateShaderCode = description.updateStep.glsl;\n let ofields = Util.prefixKeys(\"o_\", this.struct.fields); // so we can add one for texture out if needed\n if (this.textureOut) ofields[\"textureColor\"] = \"vec4\"; // If capturing a texture with textureOut, must have a textureColor output\n this.updateShaderCodeVertex = Util.buildShaderCode(gl.VERTEX_SHADER, // Takes in unit struct and output new values for the unit struct\n Util.prefixKeys(\"u_\", this.updateUniforms), // uniforms\n Util.prefixKeys(\"i_\", this.struct.fields), // inputs\n ofields, // outputs\n uniformBlocks+this.updateShaderCode // code\n );\n this.updateShaderCodeFragment = Util.buildShaderCode(gl.FRAGMENT_SHADER, // Default constant fragment shader (has no effect on the feedback transform) - but may output a texture\n {}, // uniforms\n this.textureOut ? {textureColor: \"vec4\"} : {}, // inputs\n {fragColor: \"vec4\"}, // outputs\n this.textureOut ? `void main() {fragColor=textureColor;}` : `void main() {fragColor=vec4(1.,1.,1.,1.);}` // fragment may not be used because RASTERIZER_DISCARD\n );\n this.updateShaderVertex = Util.buildShader(gl.VERTEX_SHADER, this.updateShaderCodeVertex);\n this.updateShaderFragment = Util.buildShader(gl.FRAGMENT_SHADER, this.updateShaderCodeFragment);\n if (webgl_debug_shaders) {\n this.updateShaderCodeVertexLines = Util.numberedLines(this.updateShaderCodeVertex);\n this.updateShaderCodeFragmentLines = Util.numberedLines(this.updateShaderCodeFragment);\n this.updateShaderCodeVertexTranslated = webgl_debug_shaders.getTranslatedShaderSource(this.updateShaderVertex);\n this.updateShaderCodeFragmentTranslated = webgl_debug_shaders.getTranslatedShaderSource(this.updateShaderFragment);\n }\n this.updateProgram = Util.buildProgram(this.updateShaderVertex,this.updateShaderFragment);\n if (this.updateProgram) {\n Object.keys(this.struct.fields).map((name, i) => gl.bindAttribLocation(this.updateProgram, i, \"i_\" + name));\n if (this.instanceArray) Object.keys(this.instanceArray.struct.fields).map((name, i) => gl.bindAttribLocation(this.renderProgram, this.struct.layout.length+i, name));\n gl.transformFeedbackVaryings(this.updateProgram, Object.keys(this.struct.fields).map(name => \"o_\" + name), gl.INTERLEAVED_ATTRIBS);\n gl.linkProgram(this.updateProgram);\n if (!gl.getProgramParameter(this.updateProgram, gl.LINK_STATUS)) {\n let log = gl.getProgramInfoLog(this.updateProgram);\n if (log) {\n let error = \"Error linking update program \" + log;\n if (Util.logger) Util.logger(error); else console.error(error);\n console.error(\"Shader code(vertex):\\n\" + this.updateShaderCodeVertexLines+\"\\nShader code(fragment):\\n\" + this.updateShaderCodeFragmentLines);\n throw error;\n }\n }\n // Get uniform locations (note, if not used in the code, the uniform location will return null but this seems to be ok)\n if (this.updateUniforms) {\n this.updateUniformLocations = Object.entries(this.updateUniforms).reduce((o, [k, v]) => (Object.assign(o, {[k]: gl.getUniformLocation(this.updateProgram, \"u_\" + k)})), {});\n }\n // If a uniform block is being used, get its index and bind it\n if (this.uniformBlock) {\n gl.uniformBlockBinding(this.updateProgram, gl.getUniformBlockIndex(this.updateProgram,\"ublock\"), 0);\n }\n // If uniform blocks are being used, get its index and bind it\n if (this.uniformBlocks) {\n this.uniformBlocks.map((b,i) => gl.uniformBlockBinding(this.updateProgram, gl.getUniformBlockIndex(this.updateProgram,\"ublocks\"+i), i) );\n }\n this.transformFeedback = gl.createTransformFeedback();\n }\n }\n // Render step is optional, so just update\n if (description.renderStep) {\n let uniformBlocks = \"\";\n if (this.uniformBlock) {\n uniformBlocks = \"\\nlayout(std140) uniform ublock {\\n\"\n + Util.declarationList(\"\", Util.prefixKeys(\"u_\", this.uniformBlock.struct.fields))\n + \"\\n}\"+(this.uniformBlock.name ? this.uniformBlock.name : \"\")+\";\\n\";\n }\n if (this.uniformBlocks) {\n uniformBlocks = this.uniformBlocks.map((b,i) =>\n \"\\nlayout(std140) uniform ublocks\"+i+\" {\\n\"\n + Util.declarationList(\"\", Util.prefixKeys(\"u_\", b.struct.fields))\n + \"\\n}\"+(b.name ? b.name : \"\")+\";\\n\").join(\"\\n\\n\");\n }\n this.renderUniforms = description.renderStep.params;\n this.renderViewport = description.renderStep.viewport;\n this.renderShaderCode = description.renderStep.glsl;\n this.renderFragCode = description.renderStep.fragment ? uniformBlocks + description.renderStep.fragment : `void main() { fragColor = vertexColor;}`;\n this.renderFragUniforms = description.renderStep.fragmentParams; // || {vertexColor: \"vec4\"};\n this.renderFragIn = description.renderStep.fragmentIn || {vertexColor: \"vec4\"};\n this.renderFragOut = description.renderStep.fragmentOut || {fragColor: \"vec4\"};\n this.renderShaderCodeVertex = Util.buildShaderCode(gl.VERTEX_SHADER, // Takes in unit struct and output new values for the unit struct\n Util.prefixKeys(\"u_\", this.renderUniforms), // uniforms\n this.instanceArray ? Util.prefixKeys(\"i_\", Object.assign({},this.struct.fields,this.instanceArray.struct.fields)) : Util.prefixKeys(\"i_\", this.struct.fields ), // inputs\n this.instanceArray ? Object.assign({},Util.prefixKeys(\"v_\", this.instanceArray.struct.fields),{vertexColor: \"vec4\"}) : {vertexColor: \"vec4\"}, // outputs\n uniformBlocks+this.renderShaderCode // code\n );\n this.renderShaderCodeFragment = Util.buildShaderCode(gl.FRAGMENT_SHADER, // Default constant fragment shader (has no effect on the feedback transform) - but may output a texture\n Util.prefixKeys(\"u_\", this.renderFragUniforms), // uniforms\n this.instanceArray ? Object.assign({},this.renderFragIn,Util.prefixKeys(\"v_\", this.instanceArray.struct.fields)) : this.renderFragIn, // inputs this.renderFragIn,\n this.renderFragOut, // outputs\n this.renderFragCode // code\n );\n this.renderShaderVertex = Util.buildShader(gl.VERTEX_SHADER, this.renderShaderCodeVertex);\n this.renderShaderFragment = Util.buildShader(gl.FRAGMENT_SHADER, this.renderShaderCodeFragment);\n if (webgl_debug_shaders) { // capture translated if we can for troubleshooting down the line\n this.renderShaderCodeVertexLines = Util.numberedLines(this.renderShaderCodeVertex);\n this.renderShaderCodeFragmentLines = Util.numberedLines(this.renderShaderCodeFragment);\n this.renderShaderCodeVertexTranslated = webgl_debug_shaders.getTranslatedShaderSource(this.renderShaderVertex);\n this.renderShaderCodeFragmentTranslated = webgl_debug_shaders.getTranslatedShaderSource(this.renderShaderFragment);\n }\n this.renderProgram = Util.buildProgram(this.renderShaderVertex,this.renderShaderFragment);\n if (this.renderProgram) {\n Object.keys(this.struct.fields).map((name, i) => gl.bindAttribLocation(this.renderProgram, i, \"i_\"+name));\n if (this.instanceArray) Object.keys(this.instanceArray.struct.fields).map((name, i) => gl.bindAttribLocation(this.renderProgram, this.struct.layout.length+i, \"i_\"+name) );\n gl.linkProgram(this.renderProgram);\n if (!gl.getProgramParameter(this.renderProgram, gl.LINK_STATUS)) {\n let log = gl.getProgramInfoLog(this.renderProgram);\n if (log) {\n let error = \"Error linking render program \" + log;\n if (Util.logger) Util.logger(error); else console.error(error);\n console.error(\"Shader code(vertex):\\n\" + this.renderShaderCodeVertexLines+\"\\nShader code(fragment):\\n\" + this.renderShaderCodeFragmentLines);\n throw error;\n }\n }\n // Get uniform locations (note, if not used in the code, the uniform location will return null but this seems to be ok)\n if (this.renderUniforms) this.renderUniformLocations = Object.entries(this.renderUniforms).reduce((o, [k, v]) => (Object.assign(o, {[k]: gl.getUniformLocation(this.renderProgram, \"u_\" + k)})), {});\n // Get fragment uniform locations (note, if not used in the code, the uniform location will return null but this seems to be ok)\n if (this.renderFragUniforms) this.renderFragUniformLocations = Object.entries(this.renderFragUniforms).reduce((o, [k, v]) => (Object.assign(o, {[k]: gl.getUniformLocation(this.renderProgram, \"u_\" + k)})), {});\n // If a uniform block is being used, get its index and bind it\n if (this.uniformBlock) gl.uniformBlockBinding(this.renderProgram, gl.getUniformBlockIndex(this.renderProgram, \"ublock\"), 0);\n if (this.uniformBlocks) this.uniformBlocks.map((b, i) => gl.uniformBlockBinding(this.renderProgram, gl.getUniformBlockIndex(this.renderProgram, \"ublocks\" + i), i));\n }\n }\n if (this.textureOut) { // Setup the output textures for double buffering,\n this.textureWidth = description.textureWidth || Util.data2d(this.units);\n this.textureHeight = description.textureHeight || this.textureWidth;\n if (this.textureOut instanceof Array) {\n if (Util.logger) Util.logger(\"using output texture of \"+this.textureWidth+\" x \"+this.textureHeight);\n this.textureBuffers = this.textureOut;\n } else {\n if (Util.logger) Util.logger(\"creating output texture of \"+this.textureWidth+\" x \"+this.textureHeight);\n this.textureBuffers = [Util.buildTextureOut(this.textureWidth, this.textureHeight), Util.buildTextureOut(this.textureWidth, this.textureHeight)];\n }\n this.lastTextureOut = this.textureBuffers[1];\n if (this.textureFeedback) this.uniforms[this.textureFeedback] = this.lastTextureOut; // update the uniforms for the feedbackTexture\n }\n this.iteration = 0;\n }", "title": "" }, { "docid": "3d7ff351b32c5be72218abcfaf614a30", "score": "0.6415246", "text": "function setupRenderBufferStorage ( renderbuffer, renderTarget ) {\r\n\t\r\n\t\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, renderbuffer );\r\n\t\r\n\t\t\tif ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) {\r\n\t\r\n\t\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_COMPONENT16, renderTarget.width, renderTarget.height );\r\n\t\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer );\r\n\t\r\n\t\t\t} else if ( renderTarget.depthBuffer && renderTarget.stencilBuffer ) {\r\n\t\r\n\t\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_STENCIL, renderTarget.width, renderTarget.height );\r\n\t\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer );\r\n\t\r\n\t\t\t} else {\r\n\t\r\n\t\t\t\t// FIXME: We don't support !depth !stencil\r\n\t\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.RGBA4, renderTarget.width, renderTarget.height );\r\n\t\r\n\t\t\t}\r\n\t\r\n\t\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, null );\r\n\t\r\n\t\t}", "title": "" }, { "docid": "2dd2b53ae63c20ecce2abd689da87d4a", "score": "0.6404827", "text": "function setupRenderBufferStorage( renderbuffer, renderTarget ) {\n\n\t\t_gl.bindRenderbuffer( 36161, renderbuffer );\n\n\t\tif ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) {\n\n\t\t\t_gl.renderbufferStorage( 36161, 33189, renderTarget.width, renderTarget.height );\n\t\t\t_gl.framebufferRenderbuffer( 36160, 36096, 36161, renderbuffer );\n\n\t\t} else if ( renderTarget.depthBuffer && renderTarget.stencilBuffer ) {\n\n\t\t\t_gl.renderbufferStorage( 36161, 34041, renderTarget.width, renderTarget.height );\n\t\t\t_gl.framebufferRenderbuffer( 36160, 33306, 36161, renderbuffer );\n\n\t\t} else {\n\n\t\t\t// FIXME: We don't support !depth !stencil\n\t\t\t_gl.renderbufferStorage( 36161, 32854, renderTarget.width, renderTarget.height );\n\n\t\t}\n\n\t\t_gl.bindRenderbuffer( 36161, null );\n\n\t}", "title": "" }, { "docid": "82fde6e64403732973c9c4e200f776f8", "score": "0.6385126", "text": "function setupRenderTarget( renderTarget ) {\n\n\t\t\tvar renderTargetProperties = properties.get( renderTarget );\n\t\t\tvar textureProperties = properties.get( renderTarget.texture );\n\n\t\t\trenderTarget.addEventListener( 'dispose', onRenderTargetDispose );\n\n\t\t\ttextureProperties.__webglTexture = _gl.createTexture();\n\n\t\t\tinfo.memory.textures ++;\n\n\t\t\tvar isCube = ( renderTarget.isWebGLCubeRenderTarget === true );\n\t\t\tvar isMultisample = ( renderTarget.isWebGLMultisampleRenderTarget === true );\n\t\t\tvar isMultiview = ( renderTarget.isWebGLMultiviewRenderTarget === true );\n\t\t\tvar supportsMips = isPowerOfTwo( renderTarget ) || isWebGL2;\n\n\t\t\t// Setup framebuffer\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\trenderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer();\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer = _gl.createFramebuffer();\n\n\t\t\t\tif ( isMultisample ) {\n\n\t\t\t\t\tif ( isWebGL2 ) {\n\n\t\t\t\t\t\trenderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer();\n\t\t\t\t\t\trenderTargetProperties.__webglColorRenderbuffer = _gl.createRenderbuffer();\n\n\t\t\t\t\t\t_gl.bindRenderbuffer( 36161, renderTargetProperties.__webglColorRenderbuffer );\n\n\t\t\t\t\t\tvar glFormat = utils.convert( renderTarget.texture.format );\n\t\t\t\t\t\tvar glType = utils.convert( renderTarget.texture.type );\n\t\t\t\t\t\tvar glInternalFormat = getInternalFormat( renderTarget.texture.internalFormat, glFormat, glType );\n\t\t\t\t\t\tvar samples = getRenderTargetSamples( renderTarget );\n\t\t\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglMultisampledFramebuffer );\n\t\t\t\t\t\t_gl.framebufferRenderbuffer( 36160, 36064, 36161, renderTargetProperties.__webglColorRenderbuffer );\n\t\t\t\t\t\t_gl.bindRenderbuffer( 36161, null );\n\n\t\t\t\t\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\t\t\t\t\trenderTargetProperties.__webglDepthRenderbuffer = _gl.createRenderbuffer();\n\t\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthRenderbuffer, renderTarget, true );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_gl.bindFramebuffer( 36160, null );\n\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( isMultiview ) {\n\n\t\t\t\t\tvar width = renderTarget.width;\n\t\t\t\t\tvar height = renderTarget.height;\n\t\t\t\t\tvar numViews = renderTarget.numViews;\n\n\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer );\n\n\t\t\t\t\tvar ext = extensions.get( 'OVR_multiview2' );\n\n\t\t\t\t\tinfo.memory.textures += 2;\n\n\t\t\t\t\tvar colorTexture = _gl.createTexture();\n\t\t\t\t\t_gl.bindTexture( 35866, colorTexture );\n\t\t\t\t\t_gl.texParameteri( 35866, 10240, 9728 );\n\t\t\t\t\t_gl.texParameteri( 35866, 10241, 9728 );\n\t\t\t\t\t_gl.texImage3D( 35866, 0, 32856, width, height, numViews, 0, 6408, 5121, null );\n\t\t\t\t\text.framebufferTextureMultiviewOVR( 36160, 36064, colorTexture, 0, 0, numViews );\n\n\t\t\t\t\tvar depthStencilTexture = _gl.createTexture();\n\t\t\t\t\t_gl.bindTexture( 35866, depthStencilTexture );\n\t\t\t\t\t_gl.texParameteri( 35866, 10240, 9728 );\n\t\t\t\t\t_gl.texParameteri( 35866, 10241, 9728 );\n\t\t\t\t\t_gl.texImage3D( 35866, 0, 35056, width, height, numViews, 0, 34041, 34042, null );\n\t\t\t\t\text.framebufferTextureMultiviewOVR( 36160, 33306, depthStencilTexture, 0, 0, numViews );\n\n\t\t\t\t\tvar viewFramebuffers = new Array( numViews );\n\t\t\t\t\tfor ( var i = 0; i < numViews; ++ i ) {\n\n\t\t\t\t\t\tviewFramebuffers[ i ] = _gl.createFramebuffer();\n\t\t\t\t\t\t_gl.bindFramebuffer( 36160, viewFramebuffers[ i ] );\n\t\t\t\t\t\t_gl.framebufferTextureLayer( 36160, 36064, colorTexture, 0, i );\n\n\t\t\t\t\t}\n\n\t\t\t\t\trenderTargetProperties.__webglColorTexture = colorTexture;\n\t\t\t\t\trenderTargetProperties.__webglDepthStencilTexture = depthStencilTexture;\n\t\t\t\t\trenderTargetProperties.__webglViewFramebuffers = viewFramebuffers;\n\n\t\t\t\t\t_gl.bindFramebuffer( 36160, null );\n\t\t\t\t\t_gl.bindTexture( 35866, null );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Setup color buffer\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\tstate.bindTexture( 34067, textureProperties.__webglTexture );\n\t\t\t\tsetTextureParameters( 34067, renderTarget.texture, supportsMips );\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, 36064, 34069 + i );\n\n\t\t\t\t}\n\n\t\t\t\tif ( textureNeedsGenerateMipmaps( renderTarget.texture, supportsMips ) ) {\n\n\t\t\t\t\tgenerateMipmap( 34067, renderTarget.texture, renderTarget.width, renderTarget.height );\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindTexture( 34067, null );\n\n\t\t\t} else if ( ! isMultiview ) {\n\n\t\t\t\tstate.bindTexture( 3553, textureProperties.__webglTexture );\n\t\t\t\tsetTextureParameters( 3553, renderTarget.texture, supportsMips );\n\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, 36064, 3553 );\n\n\t\t\t\tif ( textureNeedsGenerateMipmaps( renderTarget.texture, supportsMips ) ) {\n\n\t\t\t\t\tgenerateMipmap( 3553, renderTarget.texture, renderTarget.width, renderTarget.height );\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindTexture( 3553, null );\n\n\t\t\t}\n\n\t\t\t// Setup depth and stencil buffers\n\n\t\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\t\tsetupDepthRenderbuffer( renderTarget );\n\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "724920ca42fd4932a29e8537152bc652", "score": "0.6384696", "text": "createBuffers() {\n\t\tif(this.positionBuffer ===undefined && this.vertices !==undefined)\n\t\t{\n\t\t\t//console.log(\"no position and vertice buffer made,creating \",this.name);\n\t\t\tthis.positionBuffer=gl.createBuffer();\n\t\t\tthis.positionBufferItemSize=3;\n\t\t\tthis.positionBufferNumItems=(this.vertices.length)/(this.positionBufferItemSize);\n\t\n\t\t}\n\t\t\n\t\tif(this.colorBuffer===undefined)\n\t\t{\n\t\t\t//console.log(\"no color buffer has been made, creating now \",this.name);\n\t\t\tthis.colorBuffer= gl.createBuffer();\n\t\t\tthis.colorBufferItemSize=4;\n\t\t\tconsole.log(\"color length\",this.getColor().length);\n\t\t\tthis.colorBufferNumItems=(this.color.length)/(this.colorBufferItemSize);\n\t\t}\n\t}", "title": "" }, { "docid": "76a39e2ff8f729206663abc1793c1a94", "score": "0.6383691", "text": "function setupDepthTexture ( framebuffer, renderTarget ) {\r\n\t\r\n\t\t\tvar isCube = ( renderTarget instanceof THREE.WebGLRenderTargetCube );\r\n\t\t\tif ( isCube ) throw new Error('Depth Texture with cube render targets is not supported!');\r\n\t\r\n\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\r\n\t\r\n\t\t\tif ( !( renderTarget.depthTexture instanceof THREE.DepthTexture ) ) {\r\n\t\r\n\t\t\t\tthrow new Error('renderTarget.depthTexture must be an instance of THREE.DepthTexture');\r\n\t\r\n\t\t\t}\r\n\t\r\n\t\t\t// upload an empty depth texture with framebuffer size\r\n\t\t\tif ( !properties.get( renderTarget.depthTexture ).__webglTexture ||\r\n\t\t\t\t\trenderTarget.depthTexture.image.width !== renderTarget.width ||\r\n\t\t\t\t\trenderTarget.depthTexture.image.height !== renderTarget.height ) {\r\n\t\t\t\trenderTarget.depthTexture.image.width = renderTarget.width;\r\n\t\t\t\trenderTarget.depthTexture.image.height = renderTarget.height;\r\n\t\t\t\trenderTarget.depthTexture.needsUpdate = true;\r\n\t\t\t}\r\n\t\r\n\t\t\t_this.setTexture2D( renderTarget.depthTexture, 0 );\r\n\t\r\n\t\t\tvar webglDepthTexture = properties.get( renderTarget.depthTexture ).__webglTexture;\r\n\t\t\t_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 );\r\n\t\r\n\t\t}", "title": "" }, { "docid": "5134a39ba17a50e5bb0abcd9d363c5f0", "score": "0.63829184", "text": "function setupBuffers() {\n myTerrain = new Terrain(600,-10,10,-10,10);\n myTerrain.loadBuffers();\n}", "title": "" }, { "docid": "515640dad2da6e15e27e7cde2f2131fd", "score": "0.63765264", "text": "function setupRenderTarget( renderTarget ) {\n\n\t\t\tvar renderTargetProperties = properties.get( renderTarget );\n\t\t\tvar textureProperties = properties.get( renderTarget.texture );\n\n\t\t\trenderTarget.addEventListener( 'dispose', onRenderTargetDispose );\n\n\t\t\ttextureProperties.__webglTexture = _gl.createTexture();\n\n\t\t\t_infoMemory.textures ++;\n\n\t\t\tvar isCube = ( (renderTarget && renderTarget.isWebGLRenderTargetCube) );\n\t\t\tvar isTargetPowerOfTwo = isPowerOfTwo( renderTarget );\n\n\t\t\t// Setup framebuffer\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\trenderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer();\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer = _gl.createFramebuffer();\n\n\t\t\t}\n\n\t\t\t// Setup color buffer\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture );\n\t\t\t\tsetTextureParameters( _gl.TEXTURE_CUBE_MAP, renderTarget.texture, isTargetPowerOfTwo );\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i );\n\n\t\t\t\t}\n\n\t\t\t\tif ( renderTarget.texture.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_CUBE_MAP );\n\t\t\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, null );\n\n\t\t\t} else {\n\n\t\t\t\tstate.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture );\n\t\t\t\tsetTextureParameters( _gl.TEXTURE_2D, renderTarget.texture, isTargetPowerOfTwo );\n\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D );\n\n\t\t\t\tif ( renderTarget.texture.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_2D );\n\t\t\t\tstate.bindTexture( _gl.TEXTURE_2D, null );\n\n\t\t\t}\n\n\t\t\t// Setup depth and stencil buffers\n\n\t\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\t\tsetupDepthRenderbuffer( renderTarget );\n\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "a46a5593bf826bda93fdfd7f6c6d34c6", "score": "0.63674384", "text": "function setupRenderTarget( renderTarget ) {\n\n\t\t\tvar renderTargetProperties = properties.get( renderTarget );\n\t\t\tvar textureProperties = properties.get( renderTarget.texture );\n\n\t\t\trenderTarget.addEventListener( 'dispose', onRenderTargetDispose );\n\n\t\t\ttextureProperties.__webglTexture = _gl.createTexture();\n\n\t\t\tinfo.memory.textures ++;\n\n\t\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\t\t\tvar isMultisample = ( renderTarget.isWebGLMultisampleRenderTarget === true );\n\t\t\tvar isMultiview = ( renderTarget.isWebGLMultiviewRenderTarget === true );\n\t\t\tvar supportsMips = isPowerOfTwo( renderTarget ) || isWebGL2;\n\n\t\t\t// Setup framebuffer\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\trenderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer();\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer = _gl.createFramebuffer();\n\n\t\t\t\tif ( isMultisample ) {\n\n\t\t\t\t\tif ( isWebGL2 ) {\n\n\t\t\t\t\t\trenderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer();\n\t\t\t\t\t\trenderTargetProperties.__webglColorRenderbuffer = _gl.createRenderbuffer();\n\n\t\t\t\t\t\t_gl.bindRenderbuffer( 36161, renderTargetProperties.__webglColorRenderbuffer );\n\t\t\t\t\t\tvar glFormat = utils.convert( renderTarget.texture.format );\n\t\t\t\t\t\tvar glType = utils.convert( renderTarget.texture.type );\n\t\t\t\t\t\tvar glInternalFormat = getInternalFormat( glFormat, glType );\n\t\t\t\t\t\tvar samples = getRenderTargetSamples( renderTarget );\n\t\t\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglMultisampledFramebuffer );\n\t\t\t\t\t\t_gl.framebufferRenderbuffer( 36160, 36064, 36161, renderTargetProperties.__webglColorRenderbuffer );\n\t\t\t\t\t\t_gl.bindRenderbuffer( 36161, null );\n\n\t\t\t\t\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\t\t\t\t\trenderTargetProperties.__webglDepthRenderbuffer = _gl.createRenderbuffer();\n\t\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthRenderbuffer, renderTarget, true );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_gl.bindFramebuffer( 36160, null );\n\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( isMultiview ) {\n\n\t\t\t\t\tvar width = renderTarget.width;\n\t\t\t\t\tvar height = renderTarget.height;\n\t\t\t\t\tvar numViews = renderTarget.numViews;\n\n\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer );\n\n\t\t\t\t\tvar ext = extensions.get( 'OVR_multiview2' );\n\n\t\t\t\t\tinfo.memory.textures += 2;\n\n\t\t\t\t\tvar colorTexture = _gl.createTexture();\n\t\t\t\t\t_gl.bindTexture( 35866, colorTexture );\n\t\t\t\t\t_gl.texParameteri( 35866, 10240, 9728 );\n\t\t\t\t\t_gl.texParameteri( 35866, 10241, 9728 );\n\t\t\t\t\t_gl.texImage3D( 35866, 0, 32856, width, height, numViews, 0, 6408, 5121, null );\n\t\t\t\t\text.framebufferTextureMultiviewOVR( 36160, 36064, colorTexture, 0, 0, numViews );\n\n\t\t\t\t\tvar depthStencilTexture = _gl.createTexture();\n\t\t\t\t\t_gl.bindTexture( 35866, depthStencilTexture );\n\t\t\t\t\t_gl.texParameteri( 35866, 10240, 9728 );\n\t\t\t\t\t_gl.texParameteri( 35866, 10241, 9728 );\n\t\t\t\t\t_gl.texImage3D( 35866, 0, 35056, width, height, numViews, 0, 34041, 34042, null );\n\t\t\t\t\text.framebufferTextureMultiviewOVR( 36160, 33306, depthStencilTexture, 0, 0, numViews );\n\n\t\t\t\t\tvar viewFramebuffers = new Array( numViews );\n\t\t\t\t\tfor ( var i = 0; i < numViews; ++ i ) {\n\n\t\t\t\t\t\tviewFramebuffers[ i ] = _gl.createFramebuffer();\n\t\t\t\t\t\t_gl.bindFramebuffer( 36160, viewFramebuffers[ i ] );\n\t\t\t\t\t\t_gl.framebufferTextureLayer( 36160, 36064, colorTexture, 0, i );\n\n\t\t\t\t\t}\n\n\t\t\t\t\trenderTargetProperties.__webglColorTexture = colorTexture;\n\t\t\t\t\trenderTargetProperties.__webglDepthStencilTexture = depthStencilTexture;\n\t\t\t\t\trenderTargetProperties.__webglViewFramebuffers = viewFramebuffers;\n\n\t\t\t\t\t_gl.bindFramebuffer( 36160, null );\n\t\t\t\t\t_gl.bindTexture( 35866, null );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Setup color buffer\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\tstate.bindTexture( 34067, textureProperties.__webglTexture );\n\t\t\t\tsetTextureParameters( 34067, renderTarget.texture, supportsMips );\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, 36064, 34069 + i );\n\n\t\t\t\t}\n\n\t\t\t\tif ( textureNeedsGenerateMipmaps( renderTarget.texture, supportsMips ) ) {\n\n\t\t\t\t\tgenerateMipmap( 34067, renderTarget.texture, renderTarget.width, renderTarget.height );\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindTexture( 34067, null );\n\n\t\t\t} else if ( ! isMultiview ) {\n\n\t\t\t\tstate.bindTexture( 3553, textureProperties.__webglTexture );\n\t\t\t\tsetTextureParameters( 3553, renderTarget.texture, supportsMips );\n\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, 36064, 3553 );\n\n\t\t\t\tif ( textureNeedsGenerateMipmaps( renderTarget.texture, supportsMips ) ) {\n\n\t\t\t\t\tgenerateMipmap( 3553, renderTarget.texture, renderTarget.width, renderTarget.height );\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindTexture( 3553, null );\n\n\t\t\t}\n\n\t\t\t// Setup depth and stencil buffers\n\n\t\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\t\tsetupDepthRenderbuffer( renderTarget );\n\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "379551b164903adb28b4a7c6533f968b", "score": "0.6364661", "text": "function setupRenderTarget( renderTarget ) {\n\n\t\t\tvar renderTargetProperties = properties.get( renderTarget );\n\t\t\tvar textureProperties = properties.get( renderTarget.texture );\n\n\t\t\trenderTarget.addEventListener( 'dispose', onRenderTargetDispose );\n\n\t\t\ttextureProperties.__webglTexture = _gl.createTexture();\n\n\t\t\tinfo.memory.textures ++;\n\n\t\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\t\t\tvar isMultisample = ( renderTarget.isWebGLMultisampleRenderTarget === true );\n\t\t\tvar supportsMips = isPowerOfTwo( renderTarget ) || capabilities.isWebGL2;\n\n\t\t\t// Setup framebuffer\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\trenderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer();\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer = _gl.createFramebuffer();\n\n\t\t\t\tif ( isMultisample ) {\n\n\t\t\t\t\tif ( capabilities.isWebGL2 ) {\n\n\t\t\t\t\t\trenderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer();\n\t\t\t\t\t\trenderTargetProperties.__webglColorRenderbuffer = _gl.createRenderbuffer();\n\n\t\t\t\t\t\t_gl.bindRenderbuffer( 36161, renderTargetProperties.__webglColorRenderbuffer );\n\t\t\t\t\t\tvar glFormat = utils.convert( renderTarget.texture.format );\n\t\t\t\t\t\tvar glType = utils.convert( renderTarget.texture.type );\n\t\t\t\t\t\tvar glInternalFormat = getInternalFormat( glFormat, glType );\n\t\t\t\t\t\tvar samples = getRenderTargetSamples( renderTarget );\n\t\t\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglMultisampledFramebuffer );\n\t\t\t\t\t\t_gl.framebufferRenderbuffer( 36160, 36064, 36161, renderTargetProperties.__webglColorRenderbuffer );\n\t\t\t\t\t\t_gl.bindRenderbuffer( 36161, null );\n\n\t\t\t\t\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\t\t\t\t\trenderTargetProperties.__webglDepthRenderbuffer = _gl.createRenderbuffer();\n\t\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthRenderbuffer, renderTarget, true );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_gl.bindFramebuffer( 36160, null );\n\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Setup color buffer\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\tstate.bindTexture( 34067, textureProperties.__webglTexture );\n\t\t\t\tsetTextureParameters( 34067, renderTarget.texture, supportsMips );\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, 36064, 34069 + i );\n\n\t\t\t\t}\n\n\t\t\t\tif ( textureNeedsGenerateMipmaps( renderTarget.texture, supportsMips ) ) {\n\n\t\t\t\t\tgenerateMipmap( 34067, renderTarget.texture, renderTarget.width, renderTarget.height );\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindTexture( 34067, null );\n\n\t\t\t} else {\n\n\t\t\t\tstate.bindTexture( 3553, textureProperties.__webglTexture );\n\t\t\t\tsetTextureParameters( 3553, renderTarget.texture, supportsMips );\n\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, 36064, 3553 );\n\n\t\t\t\tif ( textureNeedsGenerateMipmaps( renderTarget.texture, supportsMips ) ) {\n\n\t\t\t\t\tgenerateMipmap( 3553, renderTarget.texture, renderTarget.width, renderTarget.height );\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindTexture( 3553, null );\n\n\t\t\t}\n\n\t\t\t// Setup depth and stencil buffers\n\n\t\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\t\tsetupDepthRenderbuffer( renderTarget );\n\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "6736c7facfabef6b304646f3f568a85c", "score": "0.6363785", "text": "initBuffers(gl)\n {\n const positions = this.positions;\n\n const positionBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(positions), gl.STATIC_DRAW);\n\n const textureCoordBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, textureCoordBuffer);\n const textureCoordinates = this.texcoord;\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(textureCoordinates), gl.STATIC_DRAW);\n\n const indexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\n const ind = this.indices;\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(ind), gl.STATIC_DRAW);\n\n return {\n position: positionBuffer,\n textureCoord: textureCoordBuffer,\n indices: indexBuffer,\n };\n }", "title": "" }, { "docid": "9c56524e212ddf082a430b9b95acf679", "score": "0.63623047", "text": "function setupRenderBufferStorage( renderbuffer, renderTarget, isMultisample ) {\n\n\t\t_gl.bindRenderbuffer( 36161, renderbuffer );\n\n\t\tif ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) {\n\n\t\t\tvar glInternalFormat = 33189;\n\n\t\t\tif ( isMultisample ) {\n\n\t\t\t\tvar depthTexture = renderTarget.depthTexture;\n\n\t\t\t\tif ( depthTexture && depthTexture.isDepthTexture ) {\n\n\t\t\t\t\tif ( depthTexture.type === FloatType ) {\n\n\t\t\t\t\t\tglInternalFormat = 36012;\n\n\t\t\t\t\t} else if ( depthTexture.type === UnsignedIntType ) {\n\n\t\t\t\t\t\tglInternalFormat = 33190;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar samples = getRenderTargetSamples( renderTarget );\n\n\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.renderbufferStorage( 36161, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\t\t\t_gl.framebufferRenderbuffer( 36160, 36096, 36161, renderbuffer );\n\n\t\t} else if ( renderTarget.depthBuffer && renderTarget.stencilBuffer ) {\n\n\t\t\tif ( isMultisample ) {\n\n\t\t\t\tvar samples = getRenderTargetSamples( renderTarget );\n\n\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, 35056, renderTarget.width, renderTarget.height );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.renderbufferStorage( 36161, 34041, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\n\t\t\t_gl.framebufferRenderbuffer( 36160, 33306, 36161, renderbuffer );\n\n\t\t} else {\n\n\t\t\tvar glFormat = utils.convert( renderTarget.texture.format );\n\t\t\tvar glType = utils.convert( renderTarget.texture.type );\n\t\t\tvar glInternalFormat = getInternalFormat( renderTarget.texture.internalFormat, glFormat, glType );\n\n\t\t\tif ( isMultisample ) {\n\n\t\t\t\tvar samples = getRenderTargetSamples( renderTarget );\n\n\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.renderbufferStorage( 36161, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindRenderbuffer( 36161, null );\n\n\t}", "title": "" }, { "docid": "9c56524e212ddf082a430b9b95acf679", "score": "0.63623047", "text": "function setupRenderBufferStorage( renderbuffer, renderTarget, isMultisample ) {\n\n\t\t_gl.bindRenderbuffer( 36161, renderbuffer );\n\n\t\tif ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) {\n\n\t\t\tvar glInternalFormat = 33189;\n\n\t\t\tif ( isMultisample ) {\n\n\t\t\t\tvar depthTexture = renderTarget.depthTexture;\n\n\t\t\t\tif ( depthTexture && depthTexture.isDepthTexture ) {\n\n\t\t\t\t\tif ( depthTexture.type === FloatType ) {\n\n\t\t\t\t\t\tglInternalFormat = 36012;\n\n\t\t\t\t\t} else if ( depthTexture.type === UnsignedIntType ) {\n\n\t\t\t\t\t\tglInternalFormat = 33190;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar samples = getRenderTargetSamples( renderTarget );\n\n\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.renderbufferStorage( 36161, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\t\t\t_gl.framebufferRenderbuffer( 36160, 36096, 36161, renderbuffer );\n\n\t\t} else if ( renderTarget.depthBuffer && renderTarget.stencilBuffer ) {\n\n\t\t\tif ( isMultisample ) {\n\n\t\t\t\tvar samples = getRenderTargetSamples( renderTarget );\n\n\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, 35056, renderTarget.width, renderTarget.height );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.renderbufferStorage( 36161, 34041, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\n\t\t\t_gl.framebufferRenderbuffer( 36160, 33306, 36161, renderbuffer );\n\n\t\t} else {\n\n\t\t\tvar glFormat = utils.convert( renderTarget.texture.format );\n\t\t\tvar glType = utils.convert( renderTarget.texture.type );\n\t\t\tvar glInternalFormat = getInternalFormat( renderTarget.texture.internalFormat, glFormat, glType );\n\n\t\t\tif ( isMultisample ) {\n\n\t\t\t\tvar samples = getRenderTargetSamples( renderTarget );\n\n\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.renderbufferStorage( 36161, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindRenderbuffer( 36161, null );\n\n\t}", "title": "" }, { "docid": "ec3abb5b93e336fa1792cad4a17e2845", "score": "0.63527244", "text": "function init() {\n gl.clearColor(1,1,1,1);\n gl.enable(gl.DEPTH_TEST);\n \n gl.viewport(0,0,canvasGL.width,canvasGL.height);\n}", "title": "" }, { "docid": "a7e3c846af1fb46bc6f6c6f19b42e05d", "score": "0.6343486", "text": "function setupRenderTarget( renderTarget ) {\n\n\t\t\tvar renderTargetProperties = properties.get( renderTarget );\n\t\t\tvar textureProperties = properties.get( renderTarget.texture );\n\n\t\t\trenderTarget.addEventListener( 'dispose', onRenderTargetDispose );\n\n\t\t\ttextureProperties.__webglTexture = _gl.createTexture();\n\n\t\t\tinfo.memory.textures ++;\n\n\t\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\t\t\tvar isMultisample = ( renderTarget.isWebGLMultisampleRenderTarget === true );\n\t\t\tvar isMultiview = ( renderTarget.isWebGLMultiviewRenderTarget === true );\n\t\t\tvar supportsMips = isPowerOfTwo( renderTarget ) || capabilities.isWebGL2;\n\n\t\t\t// Setup framebuffer\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer = [];\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\trenderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer();\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer = _gl.createFramebuffer();\n\n\t\t\t\tif ( isMultisample ) {\n\n\t\t\t\t\tif ( capabilities.isWebGL2 ) {\n\n\t\t\t\t\t\trenderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer();\n\t\t\t\t\t\trenderTargetProperties.__webglColorRenderbuffer = _gl.createRenderbuffer();\n\n\t\t\t\t\t\t_gl.bindRenderbuffer( 36161, renderTargetProperties.__webglColorRenderbuffer );\n\t\t\t\t\t\tvar glFormat = utils.convert( renderTarget.texture.format );\n\t\t\t\t\t\tvar glType = utils.convert( renderTarget.texture.type );\n\t\t\t\t\t\tvar glInternalFormat = getInternalFormat( glFormat, glType );\n\t\t\t\t\t\tvar samples = getRenderTargetSamples( renderTarget );\n\t\t\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglMultisampledFramebuffer );\n\t\t\t\t\t\t_gl.framebufferRenderbuffer( 36160, 36064, 36161, renderTargetProperties.__webglColorRenderbuffer );\n\t\t\t\t\t\t_gl.bindRenderbuffer( 36161, null );\n\n\t\t\t\t\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\t\t\t\t\trenderTargetProperties.__webglDepthRenderbuffer = _gl.createRenderbuffer();\n\t\t\t\t\t\t\tsetupRenderBufferStorage( renderTargetProperties.__webglDepthRenderbuffer, renderTarget, true );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t_gl.bindFramebuffer( 36160, null );\n\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( isMultiview ) {\n\n\t\t\t\t\tvar width = renderTarget.width;\n\t\t\t\t\tvar height = renderTarget.height;\n\t\t\t\t\tvar numViews = renderTarget.numViews;\n\n\t\t\t\t\t_gl.bindFramebuffer( 36160, renderTargetProperties.__webglFramebuffer );\n\n\t\t\t\t\tvar ext = extensions.get( 'OVR_multiview2' );\n\n\t\t\t\t\tinfo.memory.textures += 2;\n\n\t\t\t\t\tvar colorTexture = _gl.createTexture();\n\t\t\t\t\t_gl.bindTexture( 35866, colorTexture );\n\t\t\t\t\t_gl.texParameteri( 35866, 10240, 9728 );\n\t\t\t\t\t_gl.texParameteri( 35866, 10241, 9728 );\n\t\t\t\t\t_gl.texImage3D( 35866, 0, 32856, width, height, numViews, 0, 6408, 5121, null );\n\t\t\t\t\text.framebufferTextureMultiviewOVR( 36160, 36064, colorTexture, 0, 0, numViews );\n\n\t\t\t\t\tvar depthStencilTexture = _gl.createTexture();\n\t\t\t\t\t_gl.bindTexture( 35866, depthStencilTexture );\n\t\t\t\t\t_gl.texParameteri( 35866, 10240, 9728 );\n\t\t\t\t\t_gl.texParameteri( 35866, 10241, 9728 );\n\t\t\t\t\t_gl.texImage3D( 35866, 0, 35056, width, height, numViews, 0, 34041, 34042, null );\n\t\t\t\t\text.framebufferTextureMultiviewOVR( 36160, 33306, depthStencilTexture, 0, 0, numViews );\n\n\t\t\t\t\tvar viewFramebuffers = new Array( numViews );\n\t\t\t\t\tfor ( var i = 0; i < numViews; ++ i ) {\n\n\t\t\t\t\t\tviewFramebuffers[ i ] = _gl.createFramebuffer();\n\t\t\t\t\t\t_gl.bindFramebuffer( 36160, viewFramebuffers[ i ] );\n\t\t\t\t\t\t_gl.framebufferTextureLayer( 36160, 36064, colorTexture, 0, i );\n\n\t\t\t\t\t}\n\n\t\t\t\t\trenderTargetProperties.__webglColorTexture = colorTexture;\n\t\t\t\t\trenderTargetProperties.__webglDepthStencilTexture = depthStencilTexture;\n\t\t\t\t\trenderTargetProperties.__webglViewFramebuffers = viewFramebuffers;\n\n\t\t\t\t\t_gl.bindFramebuffer( 36160, null );\n\t\t\t\t\t_gl.bindTexture( 35866, null );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Setup color buffer\n\n\t\t\tif ( isCube ) {\n\n\t\t\t\tstate.bindTexture( 34067, textureProperties.__webglTexture );\n\t\t\t\tsetTextureParameters( 34067, renderTarget.texture, supportsMips );\n\n\t\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, 36064, 34069 + i );\n\n\t\t\t\t}\n\n\t\t\t\tif ( textureNeedsGenerateMipmaps( renderTarget.texture, supportsMips ) ) {\n\n\t\t\t\t\tgenerateMipmap( 34067, renderTarget.texture, renderTarget.width, renderTarget.height );\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindTexture( 34067, null );\n\n\t\t\t} else if ( ! isMultiview ) {\n\n\t\t\t\tstate.bindTexture( 3553, textureProperties.__webglTexture );\n\t\t\t\tsetTextureParameters( 3553, renderTarget.texture, supportsMips );\n\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, 36064, 3553 );\n\n\t\t\t\tif ( textureNeedsGenerateMipmaps( renderTarget.texture, supportsMips ) ) {\n\n\t\t\t\t\tgenerateMipmap( 3553, renderTarget.texture, renderTarget.width, renderTarget.height );\n\n\t\t\t\t}\n\n\t\t\t\tstate.bindTexture( 3553, null );\n\n\t\t\t}\n\n\t\t\t// Setup depth and stencil buffers\n\n\t\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\t\tsetupDepthRenderbuffer( renderTarget );\n\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "7952887894cf40f5a5da0515a8477701", "score": "0.6335972", "text": "function initBuffers() {\t\n\t\n\t// Coordinates Cube\n\t\t\n\tcubeVertexPositionBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, cubeVertexPositionBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n\tcubeVertexPositionBuffer.itemSize = 3;\n\tcubeVertexPositionBuffer.numItems = vertices.length / 3;\t\n\t\n\t// Coordinates Parede\n\t\n\tParedeVertexPositionBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, ParedeVertexPositionBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(verticesParede63), gl.STATIC_DRAW);\n\tParedeVertexPositionBuffer.itemSize = 3;\n\tParedeVertexPositionBuffer.numItems = verticesParede63.length / 3;\t\n\n\t// Colors Cube\n\t\t\n\tcubeVertexColorBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, cubeVertexColorBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors), gl.STATIC_DRAW);\n\tcubeVertexColorBuffer.itemSize = 3;\n\tcubeVertexColorBuffer.numItems = vertices.length / 3;\n\t//Colors Background\n\tbackVertexColorBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, backVertexColorBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors1), gl.STATIC_DRAW);\n\tbackVertexColorBuffer.itemSize = 3;\n\tbackVertexColorBuffer.numItems = vertices.length / 3;\n\t//Colors Background2\n\tback2VertexColorBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, back2VertexColorBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colors2), gl.STATIC_DRAW);\n\tback2VertexColorBuffer.itemSize = 3;\n\tback2VertexColorBuffer.numItems = vertices.length / 3;\n\n\t// Colors Parede\n\t\n\tParedeVertexColorBuffer = gl.createBuffer();\n\tgl.bindBuffer(gl.ARRAY_BUFFER, ParedeVertexColorBuffer);\n\tgl.bufferData(gl.ARRAY_BUFFER, new Float32Array(colorsp63), gl.STATIC_DRAW);\n\tParedeVertexColorBuffer.itemSize = 3;\n\tParedeVertexColorBuffer.numItems = verticesParede63.length / 3;\t\n\n\t// Vertex indices Cube\n\t\n cubeVertexIndexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, cubeVertexIndexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(cubeVertexIndices), gl.STATIC_DRAW);\n cubeVertexIndexBuffer.itemSize = 1;\n cubeVertexIndexBuffer.numItems = 36;\n \n\n\t// Vertex indices Parede\n\t\n ParedeVertexIndexBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, ParedeVertexIndexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(parede63VertexIndx), gl.STATIC_DRAW);\n ParedeVertexIndexBuffer.itemSize = 1;\n ParedeVertexIndexBuffer.numItems = 72;\n}", "title": "" }, { "docid": "6e06860494bd7007b3d1dcbdef6d44b3", "score": "0.6318082", "text": "initFallbackPath() {\n\n const self = this;\n const device = this.device;\n const scene = this.scene;\n\n // WebGL 1 depth layer renders the same objects as in World, but with RGBA-encoded depth shader to get depth\n this.layer = new Layer({\n enabled: false,\n name: \"Depth\",\n id: LAYERID_DEPTH,\n shaderPass: SHADER_DEPTH,\n\n onEnable: function () {\n\n // create RT without textures, those will be created as needed later\n this.depthRenderTarget = new RenderTarget({\n name: 'depthRenderTarget-webgl1',\n depth: true,\n stencil: device.supportsStencil,\n autoResolve: false,\n graphicsDevice: device\n });\n\n // assign it so the render actions knows to render to it\n // TODO: avoid this as this API is deprecated\n this.renderTarget = this.depthRenderTarget;\n },\n\n onDisable: function () {\n\n // only release depth texture, but not the render target itself\n this.depthRenderTarget.destroyTextureBuffers();\n this.renderTarget = null;\n\n self.releaseRenderTarget(this.colorRenderTarget);\n this.colorRenderTarget = null;\n },\n\n onPostCull: function (cameraPass) {\n\n /** @type {import('../../framework/components/camera/component.js').CameraComponent} */\n const camera = this.cameras[cameraPass];\n\n if (camera.renderSceneDepthMap) {\n\n // reallocate RT if needed\n if (!this.depthRenderTarget?.colorBuffer || self.shouldReallocate(this.depthRenderTarget, camera.renderTarget?.depthBuffer)) {\n this.depthRenderTarget?.destroyTextureBuffers();\n this.depthRenderTarget = self.allocateRenderTarget(this.depthRenderTarget, camera.renderTarget, device, PIXELFORMAT_RGBA8, false, false, true);\n\n // assign it so the render actions knows to render to it\n // TODO: avoid this as this API is deprecated\n this.renderTarget = this.depthRenderTarget;\n }\n\n // Collect all rendered mesh instances on the layers prior to the depth layer.\n // Store them in a visible list of instances on the depth layer.\n const culledDepthInstances = this.getCulledInstances(camera.camera);\n const depthOpaque = culledDepthInstances.opaque;\n depthOpaque.length = 0;\n\n const layerComposition = scene.layers;\n const subLayerEnabled = layerComposition.subLayerEnabled;\n const isTransparent = layerComposition.subLayerList;\n\n // can't use self.defaultLayerWorld.renderTarget because projects that use the editor override default layers\n const rt = layerComposition.getLayerById(LAYERID_WORLD).renderTarget;\n\n const layers = layerComposition.layerList;\n for (let i = 0; i < layers.length; i++) {\n const layer = layers[i];\n\n // only use the layers before the depth layer\n if (layer === this) break;\n\n if (layer.renderTarget !== rt || !layer.enabled || !subLayerEnabled[i]) continue;\n if (layer.cameras.indexOf(camera) < 0) continue;\n\n // visible instances for the camera for the layer\n const transparent = isTransparent[i];\n const layerCulledInstances = layer.getCulledInstances(camera.camera);\n const layerMeshInstances = transparent ? layerCulledInstances.transparent : layerCulledInstances.opaque;\n\n // copy them to a visible list of the depth layer\n const count = layerMeshInstances.length;\n for (let j = 0; j < count; j++) {\n const drawCall = layerMeshInstances[j];\n\n // only collect meshes that update the depth\n if (drawCall.material?.depthWrite && !drawCall._noDepthDrawGl1) {\n depthOpaque.push(drawCall);\n }\n }\n }\n }\n },\n\n onPreRenderOpaque: function (cameraPass) {\n\n /** @type {import('../../framework/components/camera/component.js').CameraComponent} */\n const camera = this.cameras[cameraPass];\n\n if (camera.renderSceneColorMap) {\n\n // reallocate RT if needed\n if (self.shouldReallocate(this.colorRenderTarget, camera.renderTarget?.colorBuffer)) {\n self.releaseRenderTarget(this.colorRenderTarget);\n const format = self.getSourceColorFormat(camera.renderTarget?.colorBuffer);\n this.colorRenderTarget = self.allocateRenderTarget(this.colorRenderTarget, camera.renderTarget, device, format, false, false, false);\n }\n\n // copy out the color buffer\n DebugGraphics.pushGpuMarker(device, 'GRAB-COLOR');\n\n // initialize the texture\n const colorBuffer = this.colorRenderTarget._colorBuffer;\n if (!colorBuffer.impl._glTexture) {\n colorBuffer.impl.initialize(device, colorBuffer);\n }\n\n // copy framebuffer to it\n device.bindTexture(colorBuffer);\n const gl = device.gl;\n gl.copyTexImage2D(gl.TEXTURE_2D, 0, colorBuffer.impl._glFormat, 0, 0, colorBuffer.width, colorBuffer.height, 0);\n\n // stop the device from updating this texture further\n colorBuffer._needsUpload = false;\n colorBuffer._needsMipmapsUpload = false;\n\n DebugGraphics.popGpuMarker(device);\n\n // assign unifrom\n self.setupUniform(device, false, colorBuffer);\n }\n\n if (camera.renderSceneDepthMap) {\n // assign unifrom\n self.setupUniform(device, true, this.depthRenderTarget.colorBuffer);\n }\n },\n\n onDrawCall: function () {\n // writing depth to color render target, force no blending and writing to all channels\n device.setBlendState(BlendState.NOBLEND);\n },\n\n onPostRenderOpaque: function (cameraPass) {\n\n /** @type {import('../../framework/components/camera/component.js').CameraComponent} */\n const camera = this.cameras[cameraPass];\n\n if (camera.renderSceneDepthMap) {\n // just clear the list of visible objects to avoid keeping references\n const culledDepthInstances = this.getCulledInstances(camera.camera);\n culledDepthInstances.opaque.length = 0;\n }\n }\n });\n }", "title": "" }, { "docid": "af8144f5b6d2ee59ecf86c074831571e", "score": "0.63156205", "text": "function main() {\n canvas = document.getElementById(\"canv\");\n if (!canvas) {\n console.log(\"Failed to retrieve the <canvas> element!\");\n return false;\n }\n\n gl = getWebGLContext(canvas);\n if (!gl) {\n console.log(\"Failed to get the rendering context for WebGL!\");\n return false;\n }\n\n normShaders = createShader(gl, NORM_VSHADER, NORM_FSHADER);\n texShaders = createShader(gl, TEXTURE_VSHADER, TEXTURE_FSHADER);\n\n if(initGLSLVariables() < 0) {\n console.log('Failed to initialize GLSL variables');\n return false;\n }\n\n attributeBuffer = gl.createBuffer();\n if (!attributeBuffer) {\n console.log(\"Failed to create buffers!\");\n return false;\n }\n attribColorBuffer = gl.createBuffer();\n if(!attribColorBuffer) {\n console.log(\"Failed to create color buffer!\");\n return false;\n }\n attribNormBuffer = gl.createBuffer();\n if(!attribNormBuffer) {\n console.log(\"Failed to create normal buffer!\");\n return false;\n }\n\n useShader(gl, normShaders);\n gl.enable(gl.DEPTH_TEST);\n\n scene = new Scene();\n\n let image = new Image();\n if(!image) {\n console.log(\"Failed to create new image object!\");\n return false\n }\n image.onload = function() {\n let data = getImagePixelData(image); \n createMap(data, image.width, image.height);\n }\n image.src = mapSrc;\n\n let fogColor = new Float32Array([0.137, 0.231, 0.423]);\n fogDist = new Float32Array([1, fogRange]);\n eyeArray = new Float32Array([g_eyeX, g_eyeY, g_eyeZ, 1.0]);\n\n useShader(gl, normShaders);\n gl.uniform3fv(u_FogColor, fogColor);\n gl.uniform2fv(u_FogDist, fogDist);\n gl.uniform4fv(u_Eye, eyeArray);\n\n blitz = new Blitz(1.0, 0.5, 15.0);\n let br = 244/255;\n let bg = 217/255;\n let bb = 66/255;\n blitz.addCubeToBlitz(0.8, 0.0, 0.6, 0.0, br, bg, bb, 1, 1, 1);\n blitz.addCubeToBlitz(0.2, 0.1, 0.1, 0.2, br, bg, bb, 1, 1, 1);\n blitz.addCubeToBlitz(0.2, 0.1, 0.1,-0.2, br, bg, bb, 1, 1, 1);\n blitz.addCubeToBlitz(0.4, 0.0, 1.2, 0.0, br-0.1, bg-0.1, bb, 1, 1, 1);\n blitz.addCubeToBlitz(0.3, 0.0, 0.6, 0.55, br, bg, bb+1, 1, 1, 1);\n blitz.addCubeToBlitz(0.3, 0.0, 0.6,-0.55, br, bg, bb+1, 1, 1, 1);\n scene.addGeometry(blitz);\n\n let treasure = new Cube(0.6, 6.0, 0.8, 2.0, 150/255, 100/255, 200/255, 1, 1, 1);\n scene.addGeometry(treasure);\n treasure = new Cube(0.5, 23.0, 0.8, 2.0, 200/255, 60/255, 30/255, 1, 1, 1)\n scene.addGeometry(treasure);\n treasure = new Cube(0.5, 26.0, 0.8, 4.0, 5/255, 5/255, 5/255, 1, 1, 1)\n scene.addGeometry(treasure);\n \n canvas.onmousedown = function(ev) {\n let evx = ev.clientX, evy = ev.clientY;\n let rect = ev.target.getBoundingClientRect();\n if(rect.left <= evx && evx < rect.right && rect.top <= evy && evy < rect.bottom) {\n let x_in_canvas = evx - rect.left, y_in_canvas = rect.bottom - evy;\n let picked = check(gl, x_in_canvas, y_in_canvas);\n if(picked == 1) alert('You found the purple heart!');\n if(picked == 2) alert('You found the blood box!')\n if(picked == 3) alert('You found the dark soul!')\n }\n }\n\n camera = new Camera();\n initEventHandelers();\n\n tick();\n}", "title": "" }, { "docid": "462e665e1cb4dd29557061a974d537fd", "score": "0.63135374", "text": "function init() {\n\n\t// Get canvas and setup WebGL context\n canvas = document.getElementById(\"gl-canvas\");\n\tgl = canvas.getContext('webgl');\n\t\n\t// Configure viewport\n\tgl.viewport(0,0,canvas.width,canvas.height);\n\tgl.clearColor(0.95,0.95,0.95,1.0);\n\tgl.enable(gl.DEPTH_TEST);\t\t\n\n\t// Init shader program via additional function and bind it\n\tprogram = initShaders(gl, \"vertex-shader\", \"fragment-shader\");\n\tgl.useProgram(program);\n\n\t// Save attribute location to address them\n\tpointLoc = gl.getAttribLocation(program, \"vPosition\");\n\tmodelMatrixLoc = gl.getUniformLocation(program, \"modelMatrix\");\n\t\n\n\tviewMatrixLoc = gl.getUniformLocation(program, \"viewMatrix\");\n\tprojectionMatrixLoc = gl.getUniformLocation(program, \"projectionMatrix\");\n\n\t// TODO: Hier die Speicherlocations der Normalmatrix, die Materialkoeffizienten und die Lichtintensitäten in die globalen Variablen speichern\n\tnormalLoc = gl.getAttribLocation(program, \"vNormal\");\n\tnormalMatrixLoc = gl.getUniformLocation(program, \"normalMatrix\");\n\tlightPositionLoc = gl.getUniformLocation(program, \"lightPosition\");\n\tIaLoc = gl.getUniformLocation(program, \"Ia\");\n\tIdLoc = gl.getUniformLocation(program, \"Id\");\n\tIsLoc = gl.getUniformLocation(program, \"Is\");\n\tkaLoc = gl.getUniformLocation(program, \"ka\");\n\tkdLoc = gl.getUniformLocation(program, \"kd\");\n\tksLoc = gl.getUniformLocation(program, \"ks\");\n\tspecularExponentLoc = gl.getUniformLocation(program, \"n\");\n\t\n\n\t// Set view matrix\n\t/*\n\teye = vec3.fromValues(0.0, -0.75, 0.48);\n\ttarget = vec3.fromValues(0.0, 0.0, 0.47); //unsere alten Werte\n\tup = vec3.fromValues(0.0, 1.0, 0.0);\n\t*/\n\n\teye = vec3.fromValues(0.0, -0.75, -0.5);\n\ttarget = vec3.fromValues(0.0, -0.75, 0.0); //unsere neuen Werte\n\tup = vec3.fromValues(0.0, 1.0, 0.0);\n\n\tviewMatrix = mat4.create();\n\tmat4.lookAt(viewMatrix, eye, target, up);\n\n // Set projection matrix\n\tprojectionMatrix = mat4.create();\n\tmat4.perspective(projectionMatrix, Math.PI * 0.4, canvas.width / canvas.height, 0.1, 100);\n\n\t// Save uniform location and save the projection matrix into it\n\tgl.uniformMatrix4fv(projectionMatrixLoc, false, projectionMatrix);\n\n\t// TODO: Setze hier die Lichteigenschaften I als Uniform-Variablen\n\tgl.uniform3fv(lightPositionLoc, [0.5, -0.5, 0.5]); //Licht vorne Links!\n\tgl.uniform4fv(IaLoc, [0.3, 0.3, 0.3, 1.0]);\n\tgl.uniform4fv(IdLoc, [0.8, 0.8, 0.8, 1.0]);\n\tgl.uniform4fv(IsLoc, [0.2, 0.2, 0.2, 1.0]);\n\t\n\tdocument.addEventListener(\"keydown\", keydown);\n\tdocument.addEventListener(\"keyup\", keyup);\n\tdocument.addEventListener(\"mousemove\", changeView);\n\tcanvas.onmousedown = function() {\n canvas.requestPointerLock();\n\t}\n\n\t// Specify vertices\n\t\n\t/*\n\tlet cube1 = new Cube({x: -2, y: -1, z: -2}, {x: 2, y: -0.5, z: 2}, {r: 0.3, g: 0.0, b: 0.0, a: 1.0}, {r: 0.5, g: 0.0, b: 0.0, a: 1.0}, {r: 1.0, g: 1.0, b: 1.0, a: 1.0});\n\tobjects.push(cube1);\n\n\tlet cube2 = new Cube({x: -0.5, y: -0.5, z: -0.5}, {x: 0.5, y: 0.5, z: 0.5}, {r: 0.0, g: 0.3, b: 0.0, a: 1.0}, {r: 0.0, g: 0.5, b: 0.0, a: 1.0}, {r: 1.0, g: 1.0, b: 1.0, a: 1.0});\n\tcube2.SetPositionAndOrientation({x: -0.5, y: 0, z: -1}, {x: 180, y: 45, z: 90});\n\tobjects.push(cube2);\n\n\tlet cube3 = new Cube({x: -0.5, y: -0.5, z: -0.5}, {x: 0.5, y: 0.5, z: 0.5}, {r: 0.0, g: 0.0, b: 0.3, a: 1.0}, {r: 0.0, g: 0.0, b: 0.5, a: 1.0}, {r: 1.0, g: 1.0, b: 1.0, a: 1.0});\n\tcube3.SetPositionAndOrientation({x: 0.5, y: 1, z: 0}, {x: 0, y: 0, z: 45});\n\tobjects.push(cube3);\n\t*/\n\n\t\n\t//Troposphäre\n\tlet Troposphäre = new Cube({x: -1.0, y: -1.0, z: -1.0},{x: 1.0, y: 1.0, z: 1.0}, {r:0.529,g: 0.808,b: 0.922,a: 1.0}, {r:0.0, g:0.0, b:0.0, a:1.0}, {r:0.0, g:0.0, b:0.0, a:1.0});\n\tobjects.push(Troposphäre);\n\t\n\t//Ozean\n\tlet Ozean = new Cube({x: -1.0, y: -0.99, z: -1.0},{x: 1, y: -0.98, z: 1.0}, {r:0.0, g:1.0, b:1.0, a:1.0}, {r:0.0, g:0.8, b:0.8, a:1.0}, {r:0.0, g:0.6, b:0.6, a:1.0});\t//rumspielen!\n\tobjects.push(Ozean);\n\n\t//Strand\n\tlet Strand = new Cube({x: -0.5, y: -0.98, z: -0.5},{x: 0.5, y: -0.97, z: 0.5}, {r:1.0, g:1.0, b:0.0, a:1.0}, {r:1.0, g:1.0, b:0.0, a:1.0}, {r:0.6, g:0.6, b:0.0, a:1.0}); //rumspielen!\n\tobjects.push(Strand);\n\t\n\t\n\t//Palmenstamm\n\t\n\tlet Palmenstamm1 = new Pyramidenstumpf({x: -0.04, y: -0.99, z: -0.04},{x: 0.04, y: -0.95, z: 0.04});\n\tobjects.push(Palmenstamm1);\n\t\n\tlet Palmenstamm2 = new Pyramidenstumpf({x: -0.04, y: -0.95, z: -0.04},{x: 0.04, y: -0.91, z: 0.04});\n\tobjects.push(Palmenstamm2);\n\n\tlet Palmenstamm3 = new Pyramidenstumpf({x: -0.04, y: -0.91, z: -0.04},{x: 0.04, y: -0.87, z: 0.04});\n\tobjects.push(Palmenstamm3);\n\n\tlet Palmenstamm4 = new Pyramidenstumpf({x: -0.04, y: -0.87, z: -0.04},{x: 0.04, y: -0.83, z: 0.04});\n\tobjects.push(Palmenstamm4);\n\n\tlet Palmenstamm5 = new Pyramidenstumpf({x: -0.04, y: -0.83, z: -0.04},{x: 0.04, y: -0.79, z: 0.04});\n\tobjects.push(Palmenstamm5);\n\n\tlet Palmenstamm6 = new Pyramidenstumpf({x: -0.04, y: -0.79, z: -0.04},{x: 0.04, y: -0.75, z: 0.04});\n\tobjects.push(Palmenstamm6);\n\n\tlet Palmenstamm7 = new Pyramidenstumpf({x: -0.04, y: -0.75, z: -0.04},{x: 0.04, y: -0.71, z: 0.04});\n\tobjects.push(Palmenstamm7);\n\t\n\t/*\n\tlet TestStamm = new Pyramidenstumpf({x: -0.04, y: -0.90, z: -0.04},{x:0.04,y:-0.80,z:0.04})\n\tTestStamm.SetPositionAndOrientation({x: -0.0, y: 0.3, z:0.0}); //zum Testen diesen Block ein wenig hin und her schieben!\n\tobjects.push(TestStamm);\n\t*/\n\n\t//Palmenblätter\n\tlet Palmenblatt1 = new Cube({x: -0.04, y: -0.715, z: -0.2},{x: 0.04, y: -0.705, z: 0.2}, {r:0.0, g:0.8 ,b:0.0, a:1.0}, {r:0.0, g:0.9, b:0.0, a:1.0}, {r:0.0, g:0.1, b:0.0, a:1.0});\n\tobjects.push(Palmenblatt1);\n\n\tlet Palmenblatt2 = new Cube({x: -0.2, y: -0.715, z: -0.04},{x: 0.2, y: -0.705, z: 0.04}, {r:0.0, g:0.8 ,b:0.0, a:1.0}, {r:0.0, g:0.9,b:0.0, a:1.0}, {r:0.0, g:0.1, b:0.0, a:1.0});\n\tobjects.push(Palmenblatt2);\n\n\t\n\n\t// Render\n\tgameLoop();\n}", "title": "" }, { "docid": "db767dc21b2cf18a1d54d5369603f1bb", "score": "0.63110167", "text": "function initWorldPoints(program) {\n\n gl.enable(gl.DEPTH_TEST);\n gl.depthFunc(gl.LEQUAL);\n gl.enable(gl.POLYGON_OFFSET_FILL);\n gl.polygonOffset(1.0, 2.0);\n\n modelViewMatrixLoc = gl.getUniformLocation( program, \"modelViewMatrix\" ); \n projectionMatrixLoc = gl.getUniformLocation( program, \"projectionMatrix\" );\n normalMatrixLoc = gl.getUniformLocation( program, \"normalMatrix\" );\n\n ambientProductLoc = gl.getUniformLocation(program, \"ambientProduct\");\n diffuseProductLoc = gl.getUniformLocation(program, \"diffuseProduct\");\n specularProductLoc = gl.getUniformLocation(program, \"specularProduct\");\t\n lightPositionLoc = gl.getUniformLocation(program, \"lightPosition\");\n shininessLoc = gl.getUniformLocation(program, \"shininess\");\n\n vBuffer = gl.createBuffer();\n gl.bindBuffer( gl.ARRAY_BUFFER, vBuffer);\n \n var vPosition = gl.getAttribLocation( program, \"vPosition\");\n gl.vertexAttribPointer( vPosition, 4, gl.FLOAT, false, 0, 0);\n gl.enableVertexAttribArray( vPosition); \n \n nBuffer = gl.createBuffer();\n gl.bindBuffer( gl.ARRAY_BUFFER, nBuffer);\n \n var vNormal = gl.getAttribLocation( program, \"vNormal\" );\n gl.vertexAttribPointer( vNormal, 4, gl.FLOAT, false, 0, 0 );\n gl.enableVertexAttribArray( vNormal);\n\n\n canvas.onmousedown = handleMouseDown;\n document.onmouseup = handleMouseUp;\n document.onmousemove = handleMouseMove;\n}", "title": "" }, { "docid": "02f3763ecc62460981611b0dbbf0c497", "score": "0.6307297", "text": "function setupRenderBufferStorage( renderbuffer, renderTarget ) {\n\t\n\t\t\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, renderbuffer );\n\t\n\t\t\t\tif ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) {\n\t\n\t\t\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_COMPONENT16, renderTarget.width, renderTarget.height );\n\t\t\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer );\n\t\n\t\t\t\t} else if ( renderTarget.depthBuffer && renderTarget.stencilBuffer ) {\n\t\n\t\t\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_STENCIL, renderTarget.width, renderTarget.height );\n\t\t\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer );\n\t\n\t\t\t\t} else {\n\t\n\t\t\t\t\t// FIXME: We don't support !depth !stencil\n\t\t\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.RGBA4, renderTarget.width, renderTarget.height );\n\t\n\t\t\t\t}\n\t\n\t\t\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, null );\n\t\n\t\t\t}", "title": "" }, { "docid": "6392568874541a653603afee25654d10", "score": "0.6296807", "text": "function setupBuffers() {\r\n loadVerticesLogo();\r\n loadColorsLogo();\r\n}", "title": "" }, { "docid": "5c7e7ab2f5de812ec9a44b128060d214", "score": "0.62896234", "text": "function setupRenderTarget( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\t\tvar textureProperties = properties.get( renderTarget.texture );\n\n\t\trenderTarget.addEventListener( 'dispose', onRenderTargetDispose );\n\n\t\ttextureProperties.__webglTexture = _gl.createTexture();\n\n\t\tinfo.memory.textures ++;\n\n\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\t\tvar isTargetPowerOfTwo = isPowerOfTwo( renderTarget );\n\n\t\t// Setup framebuffer\n\n\t\tif ( isCube ) {\n\n\t\t\trenderTargetProperties.__webglFramebuffer = [];\n\n\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer();\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\trenderTargetProperties.__webglFramebuffer = _gl.createFramebuffer();\n\n\t\t}\n\n\t\t// Setup color buffer\n\n\t\tif ( isCube ) {\n\n\t\t\tstate.bindTexture( 34067, textureProperties.__webglTexture );\n\t\t\tsetTextureParameters( 34067, renderTarget.texture, isTargetPowerOfTwo );\n\n\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, 36064, 34069 + i );\n\n\t\t\t}\n\n\t\t\tif ( textureNeedsGenerateMipmaps( renderTarget.texture, isTargetPowerOfTwo ) ) {\n\n\t\t\t\tgenerateMipmap( 34067, renderTarget.texture, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\t\t\tstate.bindTexture( 34067, null );\n\n\t\t} else {\n\n\t\t\tstate.bindTexture( 3553, textureProperties.__webglTexture );\n\t\t\tsetTextureParameters( 3553, renderTarget.texture, isTargetPowerOfTwo );\n\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, 36064, 3553 );\n\n\t\t\tif ( textureNeedsGenerateMipmaps( renderTarget.texture, isTargetPowerOfTwo ) ) {\n\n\t\t\t\tgenerateMipmap( 3553, renderTarget.texture, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\t\t\tstate.bindTexture( 3553, null );\n\n\t\t}\n\n\t\t// Setup depth and stencil buffers\n\n\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\tsetupDepthRenderbuffer( renderTarget );\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "b08c509992539f9889995dc8409b4ce6", "score": "0.6288091", "text": "function setUpBuffers(){\n \"use strict\";\n rectangleObject.buffer = gl.createBuffer();\n var vertices = [\n -0.5, -0.5,\n 0.5, -0.5,\n 0.5, 0.5,\n -0.5, 0.5];\n gl.bindBuffer(gl.ARRAY_BUFFER, rectangleObject.buffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n}", "title": "" }, { "docid": "5baca5bb1800c88772f6fe3e718bd6bf", "score": "0.62862235", "text": "function setUpBuffers() {\n \"use strict\";\n rectangleObject.buffer = gl.createBuffer();\n var vertices = [-0.5, -0.5, 0.5, -0.5, 0.5, 0.5, -0.5, 0.5];\n gl.bindBuffer(gl.ARRAY_BUFFER, rectangleObject.buffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n}", "title": "" }, { "docid": "7ca0582e733b4e4df4768d8c1df2a82f", "score": "0.6280192", "text": "function setupRenderTarget( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\t\tvar textureProperties = properties.get( renderTarget.texture );\n\n\t\trenderTarget.addEventListener( 'dispose', onRenderTargetDispose );\n\n\t\ttextureProperties.__webglTexture = _gl.createTexture();\n\n\t\tinfoMemory.textures ++;\n\n\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\t\tvar isTargetPowerOfTwo = isPowerOfTwo( renderTarget );\n\n\t\t// Setup framebuffer\n\n\t\tif ( isCube ) {\n\n\t\t\trenderTargetProperties.__webglFramebuffer = [];\n\n\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer();\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\trenderTargetProperties.__webglFramebuffer = _gl.createFramebuffer();\n\n\t\t}\n\n\t\t// Setup color buffer\n\n\t\tif ( isCube ) {\n\n\t\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture );\n\t\t\tsetTextureParameters( _gl.TEXTURE_CUBE_MAP, renderTarget.texture, isTargetPowerOfTwo );\n\n\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i );\n\n\t\t\t}\n\n\t\t\tif ( renderTarget.texture.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_CUBE_MAP );\n\t\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, null );\n\n\t\t} else {\n\n\t\t\tstate.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture );\n\t\t\tsetTextureParameters( _gl.TEXTURE_2D, renderTarget.texture, isTargetPowerOfTwo );\n\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D );\n\n\t\t\tif ( renderTarget.texture.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_2D );\n\t\t\tstate.bindTexture( _gl.TEXTURE_2D, null );\n\n\t\t}\n\n\t\t// Setup depth and stencil buffers\n\n\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\tsetupDepthRenderbuffer( renderTarget );\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "7ca0582e733b4e4df4768d8c1df2a82f", "score": "0.6280192", "text": "function setupRenderTarget( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\t\tvar textureProperties = properties.get( renderTarget.texture );\n\n\t\trenderTarget.addEventListener( 'dispose', onRenderTargetDispose );\n\n\t\ttextureProperties.__webglTexture = _gl.createTexture();\n\n\t\tinfoMemory.textures ++;\n\n\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\t\tvar isTargetPowerOfTwo = isPowerOfTwo( renderTarget );\n\n\t\t// Setup framebuffer\n\n\t\tif ( isCube ) {\n\n\t\t\trenderTargetProperties.__webglFramebuffer = [];\n\n\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer();\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\trenderTargetProperties.__webglFramebuffer = _gl.createFramebuffer();\n\n\t\t}\n\n\t\t// Setup color buffer\n\n\t\tif ( isCube ) {\n\n\t\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture );\n\t\t\tsetTextureParameters( _gl.TEXTURE_CUBE_MAP, renderTarget.texture, isTargetPowerOfTwo );\n\n\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i );\n\n\t\t\t}\n\n\t\t\tif ( renderTarget.texture.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_CUBE_MAP );\n\t\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, null );\n\n\t\t} else {\n\n\t\t\tstate.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture );\n\t\t\tsetTextureParameters( _gl.TEXTURE_2D, renderTarget.texture, isTargetPowerOfTwo );\n\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D );\n\n\t\t\tif ( renderTarget.texture.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_2D );\n\t\t\tstate.bindTexture( _gl.TEXTURE_2D, null );\n\n\t\t}\n\n\t\t// Setup depth and stencil buffers\n\n\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\tsetupDepthRenderbuffer( renderTarget );\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "2d4ae1b4eeffc7670abc54d0c025d265", "score": "0.62768817", "text": "function setupRenderBufferStorage( renderbuffer, renderTarget, isMultisample ) {\n\n\t\t_gl.bindRenderbuffer( 36161, renderbuffer );\n\n\t\tif ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) {\n\n\t\t\tlet glInternalFormat = 33189;\n\n\t\t\tif ( isMultisample ) {\n\n\t\t\t\tconst depthTexture = renderTarget.depthTexture;\n\n\t\t\t\tif ( depthTexture && depthTexture.isDepthTexture ) {\n\n\t\t\t\t\tif ( depthTexture.type === FloatType ) {\n\n\t\t\t\t\t\tglInternalFormat = 36012;\n\n\t\t\t\t\t} else if ( depthTexture.type === UnsignedIntType ) {\n\n\t\t\t\t\t\tglInternalFormat = 33190;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tconst samples = getRenderTargetSamples( renderTarget );\n\n\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.renderbufferStorage( 36161, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\t\t\t_gl.framebufferRenderbuffer( 36160, 36096, 36161, renderbuffer );\n\n\t\t} else if ( renderTarget.depthBuffer && renderTarget.stencilBuffer ) {\n\n\t\t\tif ( isMultisample ) {\n\n\t\t\t\tconst samples = getRenderTargetSamples( renderTarget );\n\n\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, 35056, renderTarget.width, renderTarget.height );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.renderbufferStorage( 36161, 34041, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\n\t\t\t_gl.framebufferRenderbuffer( 36160, 33306, 36161, renderbuffer );\n\n\t\t} else {\n\n\t\t\tconst glFormat = utils.convert( renderTarget.texture.format );\n\t\t\tconst glType = utils.convert( renderTarget.texture.type );\n\t\t\tconst glInternalFormat = getInternalFormat( renderTarget.texture.internalFormat, glFormat, glType );\n\n\t\t\tif ( isMultisample ) {\n\n\t\t\t\tconst samples = getRenderTargetSamples( renderTarget );\n\n\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.renderbufferStorage( 36161, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindRenderbuffer( 36161, null );\n\n\t}", "title": "" }, { "docid": "6ad1ef708ca2e0680f407ddbad86309d", "score": "0.6271363", "text": "function setupDepthTexture( framebuffer, renderTarget ) {\n\t\n\t\t\t\tvar isCube = ( renderTarget && renderTarget.isWebGLRenderTargetCube );\n\t\t\t\tif ( isCube ) throw new Error('Depth Texture with cube render targets is not supported!');\n\t\n\t\t\t\t_gl.bindFramebuffer( _gl.FRAMEBUFFER, framebuffer );\n\t\n\t\t\t\tif ( !( renderTarget.depthTexture && renderTarget.depthTexture.isDepthTexture ) ) {\n\t\n\t\t\t\t\tthrow new Error('renderTarget.depthTexture must be an instance of THREE.DepthTexture');\n\t\n\t\t\t\t}\n\t\n\t\t\t\t// upload an empty depth texture with framebuffer size\n\t\t\t\tif ( !properties.get( renderTarget.depthTexture ).__webglTexture ||\n\t\t\t\t\t\trenderTarget.depthTexture.image.width !== renderTarget.width ||\n\t\t\t\t\t\trenderTarget.depthTexture.image.height !== renderTarget.height ) {\n\t\t\t\t\trenderTarget.depthTexture.image.width = renderTarget.width;\n\t\t\t\t\trenderTarget.depthTexture.image.height = renderTarget.height;\n\t\t\t\t\trenderTarget.depthTexture.needsUpdate = true;\n\t\t\t\t}\n\t\n\t\t\t\tsetTexture2D( renderTarget.depthTexture, 0 );\n\t\n\t\t\t\tvar webglDepthTexture = properties.get( renderTarget.depthTexture ).__webglTexture;\n\t\n\t\t\t\tif ( renderTarget.depthTexture.format === DepthFormat ) {\n\t\n\t\t\t\t\t_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 );\n\t\n\t\t\t\t} else if ( renderTarget.depthTexture.format === DepthStencilFormat ) {\n\t\n\t\t\t\t\t_gl.framebufferTexture2D( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0 );\n\t\n\t\t\t\t} else {\n\t\n\t\t\t\t\tthrow new Error('Unknown depthTexture format')\n\t\n\t\t\t\t}\n\t\n\t\t\t}", "title": "" }, { "docid": "4a92377a35831cabbc15aa99c402276c", "score": "0.6270955", "text": "function setupRenderTarget( renderTarget ) {\n\n\t\tvar renderTargetProperties = properties.get( renderTarget );\n\t\tvar textureProperties = properties.get( renderTarget.texture );\n\n\t\trenderTarget.addEventListener( 'dispose', onRenderTargetDispose );\n\n\t\ttextureProperties.__webglTexture = _gl.createTexture();\n\n\t\t_infoMemory.textures ++;\n\n\t\tvar isCube = ( renderTarget.isWebGLRenderTargetCube === true );\n\t\tvar isTargetPowerOfTwo = isPowerOfTwo( renderTarget );\n\n\t\t// Setup framebuffer\n\n\t\tif ( isCube ) {\n\n\t\t\trenderTargetProperties.__webglFramebuffer = [];\n\n\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\trenderTargetProperties.__webglFramebuffer[ i ] = _gl.createFramebuffer();\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\trenderTargetProperties.__webglFramebuffer = _gl.createFramebuffer();\n\n\t\t}\n\n\t\t// Setup color buffer\n\n\t\tif ( isCube ) {\n\n\t\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture );\n\t\t\tsetTextureParameters( _gl.TEXTURE_CUBE_MAP, renderTarget.texture, isTargetPowerOfTwo );\n\n\t\t\tfor ( var i = 0; i < 6; i ++ ) {\n\n\t\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer[ i ], renderTarget, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i );\n\n\t\t\t}\n\n\t\t\tif ( renderTarget.texture.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_CUBE_MAP );\n\t\t\tstate.bindTexture( _gl.TEXTURE_CUBE_MAP, null );\n\n\t\t} else {\n\n\t\t\tstate.bindTexture( _gl.TEXTURE_2D, textureProperties.__webglTexture );\n\t\t\tsetTextureParameters( _gl.TEXTURE_2D, renderTarget.texture, isTargetPowerOfTwo );\n\t\t\tsetupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D );\n\n\t\t\tif ( renderTarget.texture.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_2D );\n\t\t\tstate.bindTexture( _gl.TEXTURE_2D, null );\n\n\t\t}\n\n\t\t// Setup depth and stencil buffers\n\n\t\tif ( renderTarget.depthBuffer ) {\n\n\t\t\tsetupDepthRenderbuffer( renderTarget );\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "19b7253daa1e7f42dd07df5b914e3f7c", "score": "0.62704253", "text": "function init() {\n try {\n canvas = document.getElementById(\"glcanvas\");\n // canvas.width = window.innerWidth;\n // canvas.height = window.innerHeight * 0.7;\n gl = canvas.getContext(\"webgl\");\n if (!gl) {\n gl = canvas.getContext(\"experimental-webgl\");\n }\n if (!gl) {\n throw \"Could not create WebGL context.\";\n }\n // gl = WebGLDebugUtils.makeDebugContext(gl, undefined, logAndValidate);\n var vshaderSource = getTextContent(\"vshaderBox\");\n var fshaderSource = getTextContent(\"fshaderBox\");\n prog_Box = createProgram(gl, vshaderSource, fshaderSource);\n\n vshaderSource = getTextContent(\"vshader\");\n fshaderSource = getTextContent(\"fshader\");\n prog = createProgram(gl, vshaderSource, fshaderSource);\n\n vshaderSource = getTextContent(\"vGshader\");\n fshaderSource = getTextContent(\"fGshader\");\n progSmoke = createProgram(gl, vshaderSource, fshaderSource);\n\n vshaderSource = getTextContent(\"vshaderBoxShadow\");\n fshaderSource = getTextContent(\"fshaderBoxShadow\");\n prog_shadow = createProgram(gl, vshaderSource, fshaderSource);\n\n vshaderSource = getTextContent(\"vshaderBoxShadowGen\");\n fshaderSource = getTextContent(\"fshaderBoxShadowGen\");\n prog_shadow_gen = createProgram(gl, vshaderSource, fshaderSource);\n\n gl.enable(gl.DEPTH_TEST);\n\n initframebuffer();\n\n\n rotator = new SimpleRotator(canvas, draw);\n rotator.setView([0,0,1], [0,1,0], 30);\n\n oldmodelview = rotator.getViewMatrix();\n\n\n skybox = new Cube(200);\n orbuculum = new Sphere(8);\n\n if(toggle)skybox.link(gl, prog_Box);\n else skybox.link(gl, prog_shadow);\n skybox.upload(gl);\n orbuculum.link(gl, prog);\n orbuculum.upload(gl);\n\n //generateShadowMap();\n\n for (let p = 0; p < Math.floor(numParticles / 2); p++) {\n var particle = new Square(30, [0.1, 0.4, 0.8, 1.0]);\n particle.randQ = quat.fromValues(0, 0, 1, Math.random() - 1);\n quat.normalize(particle.randQ, particle.randQ);\n particle.randV = vec3.fromValues(40*(Math.random()-1) + 40, 30*(Math.random()-1) - 10, 20*(Math.random()-1));\n particle.randS = vec3.fromValues(1, 1, 1);\n particle.modelTransform = mat4.create();\n particle.link(gl, progSmoke)\n particle.upload(gl);\n smokeParticles.push(particle);\n }\n\n for (let p = 0; p < Math.floor(numParticles); p++) {\n var particle = new Square(30, [0.1, 0.4, 0.8, 1.0]);\n particle.randQ = quat.fromValues(0, 0, 1, Math.random() - 1);\n quat.normalize(particle.randQ, particle.randQ);\n particle.randV = vec3.fromValues(40*(Math.random()-1), 30*(Math.random()-1) - 10, 20*(Math.random()-1));\n particle.randS = vec3.fromValues(1, 1, 1);\n particle.modelTransform = mat4.create();\n particle.link(gl, progSmoke)\n particle.upload(gl);\n smokeParticles.push(particle);\n }\n\n\n }\n catch(e) {\n document.getElementById(\"message\").innerHTML = e;\n return;\n }\n}", "title": "" }, { "docid": "eecb2b09618274100a4596874e79016f", "score": "0.6268196", "text": "function setupRenderBufferStorage ( renderbuffer, renderTarget ) {\r\n\r\n\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, renderbuffer );\r\n\r\n\t\tif ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) {\r\n\r\n\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_COMPONENT16, renderTarget.width, renderTarget.height );\r\n\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer );\r\n\r\n\t\t} else if ( renderTarget.depthBuffer && renderTarget.stencilBuffer ) {\r\n\r\n\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_STENCIL, renderTarget.width, renderTarget.height );\r\n\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer );\r\n\r\n\t\t} else {\r\n\r\n\t\t\t// FIXME: We don't support !depth !stencil\r\n\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.RGBA4, renderTarget.width, renderTarget.height );\r\n\r\n\t\t}\r\n\r\n\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, null );\r\n\r\n\t}", "title": "" }, { "docid": "eecb2b09618274100a4596874e79016f", "score": "0.6268196", "text": "function setupRenderBufferStorage ( renderbuffer, renderTarget ) {\r\n\r\n\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, renderbuffer );\r\n\r\n\t\tif ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) {\r\n\r\n\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_COMPONENT16, renderTarget.width, renderTarget.height );\r\n\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer );\r\n\r\n\t\t} else if ( renderTarget.depthBuffer && renderTarget.stencilBuffer ) {\r\n\r\n\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.DEPTH_STENCIL, renderTarget.width, renderTarget.height );\r\n\t\t\t_gl.framebufferRenderbuffer( _gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer );\r\n\r\n\t\t} else {\r\n\r\n\t\t\t// FIXME: We don't support !depth !stencil\r\n\t\t\t_gl.renderbufferStorage( _gl.RENDERBUFFER, _gl.RGBA4, renderTarget.width, renderTarget.height );\r\n\r\n\t\t}\r\n\r\n\t\t_gl.bindRenderbuffer( _gl.RENDERBUFFER, null );\r\n\r\n\t}", "title": "" }, { "docid": "308196fd22ca0ec97f9eea7533771ab0", "score": "0.6263369", "text": "function setupRenderTarget(renderTarget) {\n var renderTargetProperties = properties.get(renderTarget);\n var textureProperties = properties.get(renderTarget.texture);\n\n renderTarget.addEventListener(\"dispose\", onRenderTargetDispose);\n\n textureProperties.__webglTexture = _gl.createTexture();\n\n info.memory.textures++;\n\n var isCube = renderTarget.isWebGLRenderTargetCube === true;\n var isMultisample =\n renderTarget.isWebGLMultisampleRenderTarget === true;\n var supportsMips =\n isPowerOfTwo(renderTarget) || capabilities.isWebGL2;\n\n // Setup framebuffer\n\n if (isCube) {\n renderTargetProperties.__webglFramebuffer = [];\n\n for (var i = 0; i < 6; i++) {\n renderTargetProperties.__webglFramebuffer[\n i\n ] = _gl.createFramebuffer();\n }\n } else {\n renderTargetProperties.__webglFramebuffer = _gl.createFramebuffer();\n\n if (isMultisample) {\n if (capabilities.isWebGL2) {\n renderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer();\n renderTargetProperties.__webglColorRenderbuffer = _gl.createRenderbuffer();\n\n _gl.bindRenderbuffer(\n 36161,\n renderTargetProperties.__webglColorRenderbuffer\n );\n var glFormat = utils.convert(renderTarget.texture.format);\n var glType = utils.convert(renderTarget.texture.type);\n var glInternalFormat = getInternalFormat(glFormat, glType);\n var samples = getRenderTargetSamples(renderTarget);\n _gl.renderbufferStorageMultisample(\n 36161,\n samples,\n glInternalFormat,\n renderTarget.width,\n renderTarget.height\n );\n\n _gl.bindFramebuffer(\n 36160,\n renderTargetProperties.__webglMultisampledFramebuffer\n );\n _gl.framebufferRenderbuffer(\n 36160,\n 36064,\n 36161,\n renderTargetProperties.__webglColorRenderbuffer\n );\n _gl.bindRenderbuffer(36161, null);\n\n if (renderTarget.depthBuffer) {\n renderTargetProperties.__webglDepthRenderbuffer = _gl.createRenderbuffer();\n setupRenderBufferStorage(\n renderTargetProperties.__webglDepthRenderbuffer,\n renderTarget,\n true\n );\n }\n\n _gl.bindFramebuffer(36160, null);\n } else {\n console.warn(\n \"THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.\"\n );\n }\n }\n }\n\n // Setup color buffer\n\n if (isCube) {\n state.bindTexture(34067, textureProperties.__webglTexture);\n setTextureParameters(34067, renderTarget.texture, supportsMips);\n\n for (var i = 0; i < 6; i++) {\n setupFrameBufferTexture(\n renderTargetProperties.__webglFramebuffer[i],\n renderTarget,\n 36064,\n 34069 + i\n );\n }\n\n if (\n textureNeedsGenerateMipmaps(\n renderTarget.texture,\n supportsMips\n )\n ) {\n generateMipmap(\n 34067,\n renderTarget.texture,\n renderTarget.width,\n renderTarget.height\n );\n }\n\n state.bindTexture(34067, null);\n } else {\n state.bindTexture(3553, textureProperties.__webglTexture);\n setTextureParameters(3553, renderTarget.texture, supportsMips);\n setupFrameBufferTexture(\n renderTargetProperties.__webglFramebuffer,\n renderTarget,\n 36064,\n 3553\n );\n\n if (\n textureNeedsGenerateMipmaps(\n renderTarget.texture,\n supportsMips\n )\n ) {\n generateMipmap(\n 3553,\n renderTarget.texture,\n renderTarget.width,\n renderTarget.height\n );\n }\n\n state.bindTexture(3553, null);\n }\n\n // Setup depth and stencil buffers\n\n if (renderTarget.depthBuffer) {\n setupDepthRenderbuffer(renderTarget);\n }\n }", "title": "" }, { "docid": "3f1cadabfd82a454fe3425715091f03d", "score": "0.62625366", "text": "function setupRenderBufferStorage( renderbuffer, renderTarget, isMultisample ) {\n\n\t\t_gl.bindRenderbuffer( 36161, renderbuffer );\n\n\t\tif ( renderTarget.depthBuffer && ! renderTarget.stencilBuffer ) {\n\n\t\t\tlet glInternalFormat = 33189;\n\n\t\t\tif ( isMultisample ) {\n\n\t\t\t\tconst depthTexture = renderTarget.depthTexture;\n\n\t\t\t\tif ( depthTexture && depthTexture.isDepthTexture ) {\n\n\t\t\t\t\tif ( depthTexture.type === FloatType ) {\n\n\t\t\t\t\t\tglInternalFormat = 36012;\n\n\t\t\t\t\t} else if ( depthTexture.type === UnsignedIntType ) {\n\n\t\t\t\t\t\tglInternalFormat = 33190;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tconst samples = getRenderTargetSamples( renderTarget );\n\n\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.renderbufferStorage( 36161, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\t\t\t_gl.framebufferRenderbuffer( 36160, 36096, 36161, renderbuffer );\n\n\t\t} else if ( renderTarget.depthBuffer && renderTarget.stencilBuffer ) {\n\n\t\t\tif ( isMultisample ) {\n\n\t\t\t\tconst samples = getRenderTargetSamples( renderTarget );\n\n\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, 35056, renderTarget.width, renderTarget.height );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.renderbufferStorage( 36161, 34041, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\n\t\t\t_gl.framebufferRenderbuffer( 36160, 33306, 36161, renderbuffer );\n\n\t\t} else {\n\n\t\t\tconst texture = renderTarget.texture;\n\n\t\t\tconst glFormat = utils.convert( texture.format );\n\t\t\tconst glType = utils.convert( texture.type );\n\t\t\tconst glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType );\n\n\t\t\tif ( isMultisample ) {\n\n\t\t\t\tconst samples = getRenderTargetSamples( renderTarget );\n\n\t\t\t\t_gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t} else {\n\n\t\t\t\t_gl.renderbufferStorage( 36161, glInternalFormat, renderTarget.width, renderTarget.height );\n\n\t\t\t}\n\n\t\t}\n\n\t\t_gl.bindRenderbuffer( 36161, null );\n\n\t}", "title": "" }, { "docid": "30aac6de5d2a5de32a77f47ffa5c9398", "score": "0.6249684", "text": "function init()\n{\n //ask DOM object for canvas for the particular ID\n canvas = document.querySelector(\"#glCanvas\");\n if(canvas == null)\n {\n alert(\"failed to load canvas\");\n return;\n }\n\n \n //get webgl context from canvas\n gl = canvas.getContext(\"webgl\");\n \n if(gl === null)\n {\n alert(\"opengl context not found\");\n return;\n }\n\n //prepare shaders\n const vsSource = `\n attribute vec4 aVertexPosition;\n attribute vec4 aVertexColor;\n\n uniform mat4 uModelViewMatrix;\n uniform mat4 uProjectionMatrix;\n\n varying lowp vec4 vColor;\n\n void main()\n {\n gl_Position = uProjectionMatrix * uModelViewMatrix * aVertexPosition;\n vColor = aVertexColor;\n }`;\n\n const fsSource = `\n varying lowp vec4 vColor;\n void main(){\n gl_FragColor = vColor;\n }\n `;\n\n //Initialize a shader program\n const shaderProgram = initShaderProgram(gl,vsSource,fsSource);\n\n const programInfo = {\n program : shaderProgram,\n attribLocations: {\n vertexPosition: gl.getAttribLocation(shaderProgram,\"aVertexPosition\"), \n vertexColor: gl.getAttribLocation(shaderProgram,\"aVertexColor\"), \n \n },\n uniformLocations: {\n projectionMatrix: gl.getUniformLocation(shaderProgram, \"uProjectionMatrix\"),\n modelViewMatrix: gl.getUniformLocation(shaderProgram, \"uModelViewMatrix\"),\n\n },\n\n };\n\n\n //build all the data \n const buffers = initBuffers();\n\n render(programInfo,buffers);\n\n \n //Add listers for event driven window\n window.addEventListener(\"keydown\",keyDown,false);\n window.addEventListener(\"click\",mouseDown,false);\n window.addEventListener(\"resize\",resize,false);\n\n //some fullscreen globals need initialization based on the current browser\n \n document.fullscreenElement = document.fullscreenElement || document.mozFullscreenElement || document.msFullscreenElement || document.webkitFullscreenDocument;\n document.exitFullscreen = document.exitFullscreen || document.mozExitFullscreen || document.msExitFullscreen || document.webkitExitFullscreen;\n\n}", "title": "" }, { "docid": "69ed38f5d196b1cdc692ed34033764ed", "score": "0.6249482", "text": "draw({\n logPriority, // Probe log priority, enables Model to do more integrated logging\n\n drawMode = _luma_gl_constants__WEBPACK_IMPORTED_MODULE_0___default.a.TRIANGLES,\n vertexCount,\n offset = 0,\n start,\n end,\n isIndexed = false,\n indexType = _luma_gl_constants__WEBPACK_IMPORTED_MODULE_0___default.a.UNSIGNED_SHORT,\n isInstanced = false,\n instanceCount = 0,\n\n vertexArray = null,\n transformFeedback,\n framebuffer,\n parameters = {},\n\n // Deprecated\n uniforms,\n samplers\n }) {\n if (uniforms || samplers) {\n // DEPRECATED: v7.0 (deprecated earlier but warning not properly implemented)\n _utils__WEBPACK_IMPORTED_MODULE_10__[\"log\"].deprecated('Program.draw({uniforms})', 'Program.setUniforms(uniforms)')();\n this.setUniforms(uniforms || {});\n }\n\n if (logPriority !== undefined) {\n const fb = framebuffer ? framebuffer.id : 'default';\n const message =\n `mode=${Object(_webgl_utils__WEBPACK_IMPORTED_MODULE_8__[\"getKey\"])(this.gl, drawMode)} verts=${vertexCount} ` +\n `instances=${instanceCount} indexType=${Object(_webgl_utils__WEBPACK_IMPORTED_MODULE_8__[\"getKey\"])(this.gl, indexType)} ` +\n `isInstanced=${isInstanced} isIndexed=${isIndexed} ` +\n `Framebuffer=${fb}`;\n _utils__WEBPACK_IMPORTED_MODULE_10__[\"log\"].log(logPriority, message)();\n }\n\n // TODO - move vertex array binding and transform feedback binding to withParameters?\n Object(_utils__WEBPACK_IMPORTED_MODULE_10__[\"assert\"])(vertexArray);\n\n this.gl.useProgram(this.handle);\n\n // Note: async textures set as uniforms might still be loading.\n // Now that all uniforms have been updated, check if any texture\n // in the uniforms is not yet initialized, then we don't draw\n if (!this._areTexturesRenderable()) {\n return false;\n }\n\n vertexArray.bindForDraw(vertexCount, instanceCount, () => {\n if (framebuffer !== undefined) {\n parameters = Object.assign({}, parameters, {framebuffer});\n }\n\n if (transformFeedback) {\n const primitiveMode = Object(_webgl_utils_attribute_utils__WEBPACK_IMPORTED_MODULE_9__[\"getPrimitiveDrawMode\"])(drawMode);\n transformFeedback.begin(primitiveMode);\n }\n\n this._bindTextures();\n\n Object(_context__WEBPACK_IMPORTED_MODULE_7__[\"withParameters\"])(this.gl, parameters, () => {\n // TODO - Use polyfilled WebGL2RenderingContext instead of ANGLE extension\n if (isIndexed && isInstanced) {\n this.gl.drawElementsInstanced(drawMode, vertexCount, indexType, offset, instanceCount);\n } else if (isIndexed && Object(_webgl_utils__WEBPACK_IMPORTED_MODULE_8__[\"isWebGL2\"])(this.gl) && !isNaN(start) && !isNaN(end)) {\n this.gl.drawRangeElements(drawMode, start, end, vertexCount, indexType, offset);\n } else if (isIndexed) {\n this.gl.drawElements(drawMode, vertexCount, indexType, offset);\n } else if (isInstanced) {\n this.gl.drawArraysInstanced(drawMode, offset, vertexCount, instanceCount);\n } else {\n this.gl.drawArrays(drawMode, offset, vertexCount);\n }\n });\n\n if (transformFeedback) {\n transformFeedback.end();\n }\n });\n\n return true;\n }", "title": "" }, { "docid": "64470e22b11892caf8c4f6c7b8aff83a", "score": "0.62404263", "text": "function initShaders( )\n{\n\n var fragmentShader = getShader( gl, \"shader-fs\" );\n var vertexShader = getShader( gl, \"shader-vs\" );\n\n shaderProgram = gl.createProgram( );\n\n gl.attachShader( shaderProgram, vertexShader );\n gl.attachShader( shaderProgram, fragmentShader );\n gl.linkProgram( shaderProgram );\n\n if ( !gl.getProgramParameter( shaderProgram, gl.LINK_STATUS ) )\n {\n\n console.error( \"Could not initialize shaders.\" );\n\n }\n\n gl.useProgram( shaderProgram );\n\n // Acquire handles to shader program variables in order to pass data to the shaders.\n\n shaderProgram.vertexPositionAttribute = gl.getAttribLocation( shaderProgram, \"aVertexPosition\" );\n gl.enableVertexAttribArray( shaderProgram.vertexPositionAttribute );\n\n shaderProgram.vertexColorAttribute = gl.getAttribLocation( shaderProgram, \"aVertexColor\" );\n gl.enableVertexAttribArray( shaderProgram.vertexColorAttribute );\n\n shaderProgram.vertexNormalAttribute = gl.getAttribLocation( shaderProgram, \"aVertexNormal\" );\n gl.enableVertexAttribArray( shaderProgram.vertexNormalAttribute );\n\n shaderProgram.pMatrixUniform = gl.getUniformLocation( shaderProgram, \"uPMatrix\" );\n shaderProgram.mvMatrixUniform = gl.getUniformLocation( shaderProgram, \"uMVMatrix\" );\n shaderProgram.nMatrixUniform = gl.getUniformLocation( shaderProgram, \"uNMatrix\" );\n\n shaderProgram.useLightingUniform = gl.getUniformLocation( shaderProgram, \"uUseLighting\" );\n\n shaderProgram.alphaBlendingEnabled = gl.getUniformLocation( shaderProgram, \"uAlphaBlendingEnabled\" );\n\n shaderProgram.normalMapEnabled = gl.getUniformLocation( shaderProgram, \"uNormalMap\" );\n\n shaderProgram.perspectiveProjection = gl.getUniformLocation( shaderProgram, \"uPerspectiveProjection\" );\n\n shaderProgram.showDepth = gl.getUniformLocation( shaderProgram, \"uShowDepth\" );\n shaderProgram.showNormals = gl.getUniformLocation( shaderProgram, \"uShowNormals\" );\n shaderProgram.showPosition = gl.getUniformLocation( shaderProgram, \"uShowPosition\" );\n\n shaderProgram.ambientColorUniform = gl.getUniformLocation( shaderProgram, \"uAmbientColor\" );\n\n shaderProgram.pointLightingLocationUniform = gl.getUniformLocation( shaderProgram, \"uPointLightingLocation\" );\n shaderProgram.pointLightingColorUniform = gl.getUniformLocation( shaderProgram, \"uPointLightingColor\" );\n\n shaderProgram.pointLightingLocationUniform1 = gl.getUniformLocation( shaderProgram, \"uPointLightingLocation1\" );\n shaderProgram.pointLightingColorUniform1 = gl.getUniformLocation( shaderProgram, \"uPointLightingColor1\" );\n\n}", "title": "" } ]
19661e35c714616ee60ea2a688de248b
Algorithm to detect collision in 2D games from
[ { "docid": "61895c98d7222a761779ffaf61f0aa0c", "score": "0.688339", "text": "function collision(pX, pY, eX, eY) {\n\t //pRect is the player, eRect is the enemy\n\t var pRect = {\n\t x: pX,\n\t y: pY,\n\t width: 68,\n\t height: 76\n\t };\n\t var eRect = {\n\t x: eX,\n\t y: eY,\n\t width: 100,\n\t height: 68\n\t };\n\n\t if (pRect.x < eRect.x + eRect.width &&\n\t pRect.x + pRect.width > eRect.x &&\n\t pRect.y < eRect.y + eRect.height &&\n\t pRect.height + pRect.y > eRect.y) {\n\t // collision detected!\n\t\t\tcount--;\n\t\t\tsplash(count);\t\t\t\n\t player.home();\n\t }\n\t}", "title": "" } ]
[ { "docid": "94c93e41378e80a67138a6d2c8fc7b42", "score": "0.76258796", "text": "function collision(x0, y0, w0, h0, x2, y2, w1, h1){\n x1 = x0 + w0;\n y1 = y0 + h0;\n x3 = x2 + w1;\n y3 = y2 + h1;\n return !(x1<x2 || x3<x0 || y1<y2 || y3<y0);\n}", "title": "" }, { "docid": "687085344a9580fbeab907fa6f53e3b2", "score": "0.7536712", "text": "function checkCollision(){\n\n return;\n\n mapObjects.forEach(function(i){\n\n if (recCollide(hero, i) && (i.type != 'bucket')){\n self.y = i.y;\n // } else if (recCollide(hero, i) && ( (i.y + y.height) >= ( hero.y-hero.height) )){\n // // trying to detect ceiling\n\n // console.log('tagged');\n\n } else if (recCollide(hero, i) && (i.type == 'bucket')){\n winGame();\n }\n });\n }", "title": "" }, { "docid": "1ae2bd05f092fb04d298b33fa193c677", "score": "0.74823225", "text": "function detectParticleCollision(particle1, particle2) {\r\n\tvar col = {};\r\n\tcol.collided = false;\r\n\tcol.plane = {x: false, y: false};\r\n\t// x collision\r\n\tif (particle1.position.x - particle1.size/2 <= particle2.position.x + particle2.size/2 && particle1.position.x + particle1.size/2 >= particle2.position.x - particle2.size/2 && particle1.position.y - particle1.size/2 <= particle2.position.y + particle2.size/2 && particle1.position.y + particle1.size/2 >= particle2.position.y - particle2.size/2) {\r\n\t\t// collision\r\n\t\tcol.collided = true;\r\n\t}\r\n\t//if (particle1.position.y - particle1.size/2 <= particle2.position.y + particle2.size/2 && particle1.position.y + particle1.size/2 >= particle2.position.y - particle2.size/2) {\r\n\t\t// y collision\r\n\t\t//col.y = true;\r\n\t// }\r\n\t// compare center positions to get the plane of colision\r\n\tif (Math.abs(particle1.position.x - particle2.position.x) > Math.abs(particle1.position.y - particle2.position.y)) {\r\n\t\tcol.plane.x = true;\r\n\t}\r\n\telse {\r\n\t\tcol.plane.y = true;\r\n\t}\r\n\treturn col;\r\n}", "title": "" }, { "docid": "427f1e5fe57fdcd805127089ca55d1b0", "score": "0.7432276", "text": "function objectCollision(obj1, obj2){\r\n var valueCollidedObj = [0, 0, false];\r\n \r\n \r\n if(gameObjects[obj1] !== undefined && gameObjects[obj1].length !== 0 && gameObjects[obj2] !== undefined && gameObjects[obj2].length !== 0) {\r\n for(var i in gameObjects[obj1]){\r\n if(gameObjects[obj1][i] !== undefined && !gameObjects[obj1][i].offScreen){\r\n for(var j in gameObjects[obj2]){\r\n if(gameObjects[obj2][j] !== undefined && !gameObjects[obj2][j].offScreen) {\r\n if(gameObjects[obj1][i].x + 20 < gameObjects[obj2][j].x + gameObjects[obj2][j].width &&\r\n gameObjects[obj1][i].x + gameObjects[obj1][i].width - 10 > gameObjects[obj2][j].x && \r\n gameObjects[obj1][i].y < gameObjects[obj2][j].y + gameObjects[obj2][j].height &&\r\n gameObjects[obj1][i].y + gameObjects[obj1][i].height > gameObjects[obj2][j].y) {\r\n\r\n gameObjects[obj1][i].collided = true;\r\n valueCollidedObj[0] = gameObjects[obj1][i];\r\n \r\n gameObjects[obj2][j].collided = true;\r\n valueCollidedObj[1] = gameObjects[obj2][j];\r\n \r\n valueCollidedObj[2] = true;\r\n break;\r\n }\r\n else{\r\n gameObjects[obj1][i].collided = false;\r\n gameObjects[obj2][j].collided = false;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n \r\n\treturn valueCollidedObj;\r\n}", "title": "" }, { "docid": "081d9b7b5da683b40f3da78c304814a4", "score": "0.7375218", "text": "function checkCollision(x1,y1,h1,w1,x2,y2,h2,w2)\n{\n\n if (x1 < x2 + w2 && x1 + w1 > x2 && y1 < y2 + h2 && y1 + h1 > y2)\n {\n return true; \n }\n else\n {\n return false; \n } \n}", "title": "" }, { "docid": "d7db1c7d71c5f2b19c5cb2c703e59ae1", "score": "0.7350667", "text": "function collisionDetection(object1,object2) {\n if (object1.x < object2.x + object2.width && \n object1.x + object1.width > object2.x &&\n object1.y < object2.y + object2.height && \n object1.y + object1.height > object2.y) \n {\n return true;\n }\n}", "title": "" }, { "docid": "6436a60f8d2baa5f91fb8333badfb9fb", "score": "0.7325469", "text": "function collision(a, b) {\r\n return a.x < (b.x + b.width) && (a.x + a.width) > b.x\r\n && a.y < (b.y + b.height) && (a.y + a.height) > b.y;\r\n}", "title": "" }, { "docid": "e18b56a5f215da574abcbf2d1aa7c893", "score": "0.7308819", "text": "static collision(player, opponent) {\n\n const rect1 = {\n x: parseInt(player.playerCar.style.left),\n y: parseInt(player.playerCar.style.top),\n };\n const rect2 = {\n x: parseInt(opponent.enemyCar.style.left),\n y: parseInt(opponent.enemyCar.style.top),\n };\n const width = 80;\n const height = 160;\n if (\n rect1.x < rect2.x + width &&\n rect1.x + width > rect2.x &&\n rect1.y < rect2.y + height &&\n rect1.y + height > rect2.y\n ) {\n GameContainer.gameOver();\n }\n }", "title": "" }, { "docid": "64d07d6f28ae72af2d71a4ef5d70e795", "score": "0.73018575", "text": "detectCollision() {}", "title": "" }, { "docid": "6ea603b374e4c51e901dff0e8bc752fb", "score": "0.72726643", "text": "wallCollision() {\n var p2change = new Vector(this.p1.x, this.p1.y);\n var p3change = new Vector(this.p1.x, this.p1.y);\n p2change.subtract(this.p2);\n p3change.subtract(this.p3);\n if (this.p1.x > game.width && this.p2.x > game.width && this.p3.x > game.width) {\n this.p1.x = 0;\n this.p2 = new Vector(this.p1.x, this.p1.y);\n this.p2.add(p2change);\n this.p3 = new Vector(this.p1.x, this.p1.y);\n this.p3.add(p3change);\n } else if (this.p1.x < 0 && this.p2.x < 0 && this.p3.x < 0) {\n this.p1.x = game.width;\n\n this.p2 = new Vector(this.p1.x, this.p1.y);\n this.p2.add(p2change);\n this.p3 = new Vector(this.p1.x, this.p1.y);\n this.p3.add(p3change);\n }\n if (this.p1.y > game.height && this.p2.y > game.height && this.p3.y > game.height) {\n this.p1.y = 0;\n\n this.p2 = new Vector(this.p1.x, this.p1.y);\n this.p2.add(p2change);\n this.p3 = new Vector(this.p1.x, this.p1.y);\n this.p3.add(p3change);\n } else if (this.p1.y < 0 && this.p2.y < 0 && this.p3.y < 0) {\n this.p1.y = game.height;\n\n this.p2 = new Vector(this.p1.x, this.p1.y);\n this.p2.add(p2change);\n this.p3 = new Vector(this.p1.x, this.p1.y);\n this.p3.add(p3change);\n }\n }", "title": "" }, { "docid": "566720542daf204abd7dd56aecb6a528", "score": "0.72398597", "text": "function collision(a, b, c, d) {\r\n var parallel = (a.x - b.x) * (c.y - d.y) - (a.y - b.y) * (c.x - d.x);\r\n if (parallel == 0) {\r\n if (a.y == c.y) {\r\n if (a.x <= d.x && b.x >= c.x)\r\n return 1;\r\n return 0;\r\n }\r\n if (a.x == c.x) {\r\n if (a.y <= d.y && b.y >= c.y)\r\n return 1;\r\n return 0;\r\n }\r\n return 0;\r\n } else {\r\n var px = ((a.x * b.y - a.y * b.x) * (c.x - d.x) - (a.x - b.x) * (c.x * d.y - c.y * d.x)) / parallel;\r\n var py = ((a.x * b.y - a.y * b.x) * (c.y - d.y) - (a.y - b.y) * (c.x * d.y - c.y * d.x)) / parallel;\r\n\r\n var k1 = (px - a.x) / (b.x - a.x);\r\n var k2 = (px - c.x) / (d.x - c.x);\r\n var k3 = (py - a.y) / (b.y - a.y);\r\n var k4 = (py - c.y) / (d.y - c.y);\r\n\r\n if ((k1 >= 0 && k1 <= 1) || isNaN(k1)) {\r\n if ((k2 >= 0 && k2 <= 1) || isNaN(k2)) {\r\n if ((k3 >= 0 && k3 <= 1) || isNaN(k3)) {\r\n if ((k4 >= 0 && k4 <= 1) || isNaN(k4)) {\r\n return 1;\r\n } else {\r\n return 0;\r\n }\r\n } else {\r\n return 0;\r\n }\r\n } else {\r\n return 0;\r\n }\r\n } else {\r\n return 0;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "24e5a95a18e5deb3916298e2596a1ba7", "score": "0.7236455", "text": "function collisionTest(a, b) {\n return a.x < b.x + b.w && a.x + a.w > b.x &&\n a.y < b.y + b.h && a.y + a.h > b.y;\n}", "title": "" }, { "docid": "edab8699214e5d7637005b0ba8c2aa56", "score": "0.72352093", "text": "function detectCollision(x1,y1,r1,x2,y2,r2) {\r\n\t\tvar dist2 = ((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));\r\n\t\tif(dist2 <= ((r2+r1)*(r2+r1)))\r\n\t\t\treturn true;\r\n\t\treturn false;\r\n\r\n\t}", "title": "" }, { "docid": "4c1db1551a4c609aba0866ab2bbe9990", "score": "0.7224189", "text": "function collision(px, py, pw, ph, ex, ey, ew, eh) {\n return (Math.abs(px -ex)*2 <pw +ew) && (Math.abs(py -ey)*2 < ph + eh);\n}", "title": "" }, { "docid": "543d484600ceafc48eacce78f195b503", "score": "0.7223793", "text": "function collides(obj1, obj2) {\n return obj1.left < obj2.left + obj2.width &&\n obj1.left + obj1.width > obj2.left &&\n obj1.top < obj2.top + obj2.height &&\n obj1.top + obj1.height > obj2.top;\n}", "title": "" }, { "docid": "59e95bd680531d30f3ead49d5987f353", "score": "0.7219837", "text": "function collisionDetection() {\n\tfor(var c=0; c<brickColumnCount; c++) {\n\t\tfor(var r=0; r<brickRowCount; r++) {\n\t\t\tvar b = bricks[c][r];\n\t\t\tif(b.status == 1) {\n\t\t\t\tif(x > b.x && x < b.x+brickWidth && y > b.y && y < b.y+brickHeight) {\n\t\t\t\t\tdy = -dy;\n\t\t\t\t\tb.status = 0;\n\t\t\t\t\tscore++;\n\t\t\t\t\tif(score == brickRowCount*brickColumnCount) {\n\t\t\t\t\t\talert(\"YOU WIN, CONGRATULATIONS!\");\n\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "87ddd57aad028b3472e295ff41e803eb", "score": "0.7218433", "text": "function checkCollision(x1, y1, h1, w1, x2, y2, h2, w2) {\n return x1 < x2 + w2 && x1 + w1 > x2 && y1 < y2 + h2 && y1 + h1 > y2;\n}", "title": "" }, { "docid": "ee20d386f9760d338df8a3641d4e50ca", "score": "0.72163826", "text": "function do_sprite_collisions() {\n\t\tvar nr_sprites = curr_drawinfo[next_lineno].nr_sprites;\n\t\tvar first = curr_drawinfo[next_lineno].first_sprite_entry;\n\t\tvar collision_mask = clxmask[clxcon >> 12];\n\t\tvar bplres = bplcon0_res;\n\t\tvar ddf_left = thisline_decision.plfleft * 2 << bplres;\n\t\tvar hw_diwlast = coord_window_to_diw_x(thisline_decision.diwlastword);\n\t\tvar hw_diwfirst = coord_window_to_diw_x(thisline_decision.diwfirstword);\n\n\t\tif (clxcon_bpl_enable == 0) {\n\t\t\tclxdat |= 0x1FE;\n\t\t\treturn;\n\t\t}\n\n\t\tfor (var i = 0; i < nr_sprites; i++) {\n\t\t\t//struct sprite_entry *e = curr_sprite_entries + first + i;\n\t\t\tvar e = curr_sprite_entries[first + i];\n\t\t\tvar minpos = e.pos;\n\t\t\tvar maxpos = e.max;\n\t\t\tvar minp1 = minpos >> sprite_buffer_res;\n\t\t\tvar maxp1 = maxpos >> sprite_buffer_res;\n\n\t\t\tif (maxp1 > hw_diwlast)\n\t\t\t\tmaxpos = hw_diwlast << sprite_buffer_res;\n\t\t\tif (maxp1 > thisline_decision.plfright * 2)\n\t\t\t\tmaxpos = thisline_decision.plfright * 2 << sprite_buffer_res;\n\t\t\tif (minp1 < hw_diwfirst)\n\t\t\t\tminpos = hw_diwfirst << sprite_buffer_res;\n\t\t\tif (minp1 < thisline_decision.plfleft * 2)\n\t\t\t\tminpos = thisline_decision.plfleft * 2 << sprite_buffer_res;\n\n\t\t\tfor (var j = minpos; j < maxpos; j++) {\n\t\t\t\tvar sprpix = spixels[e.first_pixel + j - e.pos] & collision_mask;\n\t\t\t\tvar match = true;\n\n\t\t\t\tif (sprpix == 0)\n\t\t\t\t\tcontinue;\n\n\t\t\t\tvar offs = ((j << bplres) >> sprite_buffer_res) - ddf_left;\n\t\t\t\tsprpix = sprite_ab_merge[sprpix & 255] | (sprite_ab_merge[sprpix >> 8] << 2);\n\t\t\t\tsprpix <<= 1;\n\n\t\t\t\tvar ldata = line_data[next_lineno];\n\n\t\t\t\t/* Loop over number of playfields. */\n\t\t\t\tfor (var k = 1; k >= 0; k--) {\n\t\t\t\t\t//#ifdef AGA\n\t\t\t\t\tvar planes = (SAEV_config.chipset.mask & SAEC_Config_Chipset_Mask_AGA) ? 8 : 6;\n\t\t\t\t\t/*#else\n\t\t\t\t\tvar planes = 6;\n\t\t\t\t\t#endif*/\n\t\t\t\t\tif (bplcon0 & 0x400)\n\t\t\t\t\t\tmatch = true;\n\t\t\t\t\tfor (var l = k; match && l < planes; l += 2) {\n\t\t\t\t\t\tvar t = 0;\n\t\t\t\t\t\tif (l < thisline_decision.nr_planes) {\n\t\t\t\t\t\t\t//uae_u32 *ldata = (uae_u32 *)(line_data[next_lineno] + 2 * l * MAX_WORDS_PER_LINE);\n\t\t\t\t\t\t\t//uae_u32 word = ldata[offs >> 5];\n\t\t\t\t\t\t\tvar word = ldata[MAX_WORDS_PER_LINE_FULL * l + (offs >> 5)];\n\n\t\t\t\t\t\t\tt = (word >>> (31 - (offs & 31))) & 1;\n\t\t\t\t\t\t\t/*#if 0 //debug: draw collision mask\n\t\t\t\t\t\t\tif (1) {\n\t\t\t\t\t\t\t\tfor (var m = 0; m < 5; m++) {\n\t\t\t\t\t\t\t\t\tldata = (uae_u32 *)(line_data[next_lineno] + 2 * m * MAX_WORDS_PER_LINE);\n\t\t\t\t\t\t\t\t\tldata[(offs >> 5) + 1] |= 15 << (31 - (offs & 31));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t#endif*/\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (clxcon_bpl_enable & (1 << l)) {\n\t\t\t\t\t\t\tif (t != ((clxcon_bpl_match >> l) & 1))\n\t\t\t\t\t\t\t\tmatch = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (match) {\n\t\t\t\t\t\t/*#if 0 // debug: mark lines where collisions are detected\n\t\t\t\t\t\tif (0) {\n\t\t\t\t\t\t\tfor (var l = 0; l < 5; l++) {\n\t\t\t\t\t\t\t\tuae_u32 *ldata = (uae_u32 *)(line_data[next_lineno] + 2 * l * MAX_WORDS_PER_LINE);\n\t\t\t\t\t\t\t\tldata[(offs >> 5) + 1] |= 15 << (31 - (offs & 31));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t#endif*/\n\t\t\t\t\t\tclxdat |= sprpix << (k * 4);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "acf57fbe101739ccaaae83f0ab05663c", "score": "0.71996003", "text": "isCollided(){\n\n //Focus on the closest/yet-passed obstacle set\n const currentObstacle = this.mapController.focusedObstacle;\n const character = this.characterController.characterSprite;\n\n //** NTS: Still need to balance the hitbox boundary **\n const minXOffset = 0 * this.scaleFactor;\n const minYOffset = 25 * this.scaleFactor;\n const maxXOffset = 45 * this.scaleFactor;\n const maxYOffset = 20 * this.scaleFactor;\n\n const minCharacterY = (character.y - character.height / 2) + minYOffset;\n const maxCharacterY = (character.y + character.height / 2) - maxYOffset;\n const minCharacterX = (character.x - character.width / 2) + minXOffset;\n const maxCharacterX = (character.x + character.width / 2) - maxXOffset;\n\n const minGapY = currentObstacle.y + (currentObstacle.height / 2) - (this.mapController.obstacleData.gap * this.scaleFactor / 2);\n const maxGapY = currentObstacle.y + (currentObstacle.height / 2) + (this.mapController.obstacleData.gap * this.scaleFactor / 2);\n const minObstacleX = currentObstacle.x;\n const maxObstacleX = currentObstacle.x + currentObstacle.width;\n\n let inXBound = false;\n let inYBound = true;\n\n if((maxCharacterX > minObstacleX && maxCharacterX < maxObstacleX) || (minCharacterX > minObstacleX && minCharacterX < maxObstacleX)){\n\n inXBound = true;\n\n if((minCharacterY > minGapY && minCharacterY < maxGapY) && (maxCharacterY > minGapY && maxCharacterY < maxGapY))\n inYBound = false; //Check whether the players is in the Y range of the gap between the poles (safe-zone) rather than on the obstacles like for X range\n\n }\n\n //Shift the focus to the next set of obstacle poles once passed\n if(character.x > maxObstacleX)\n this.mapController.collisionTestIndex++;\n\n return inXBound && inYBound;\n\n }", "title": "" }, { "docid": "104e3fde93800836fc175261aece5e9e", "score": "0.7196979", "text": "function checkCollisions() {\n // Check collision between player and enemy\n allEnemies.forEach(function(enemy) {\n // Condition checks whether player's most left of right pixel is\n // between enemy's most left and right pixel and\n // it checks the vertical position, on which if player and enemy\n // object are at the same row they would differ 12px vertically\n if ((player.x + 17 > enemy.x && player.x + 17 < enemy.x + 100 || player.x + 84 > enemy.x && player.x + 84 < enemy.x + 100) && player.y === enemy.y - 12) {\n data.lives -= 1;\n player.x = 202;\n player.y = 382;\n }\n });\n\n // Check collision between player and gem\n allGems.forEach(function(gem) {\n if (player.x === gem.x && player.y === gem.y - 3) {\n // Dissapear gem and add points to score\n gem.x = undefined;\n gem.y = undefined;\n data.score += gem.points;\n // Show gem after certain amount of random time and depends on gem's points\n setTimeout(function() {\n gem.update();\n }, Math.round(Math.random() * gem.points) * 1000 + 1000);\n }\n });\n\n // Check collision between player and life\n if (player.x === life.x && player.y === life.y - 26) {\n // Dissapear life and add lives by 1\n life.x = undefined;\n life.y = undefined;\n data.lives += 1;\n // Show life after certain amount of random time\n setTimeout(function() {\n life.update();\n }, Math.round(Math.random() * 50) * 1000);\n }\n}", "title": "" }, { "docid": "678b4fc5e2dbccd549c9d78e79159126", "score": "0.7185629", "text": "checkCollide() {\n // Checks for collision with top/bottom wall\n if (this.y >= canvasH - this.w / 2 || this.y <= this.w / 2) {\n return true;\n }\n\n for (let i = 0; i < pipes.length; i++) {\n let other = pipes[i];\n // Checks for passing between pipes\n // If this is a top pipe and pt available\n // Increment score if yes\n if (i % 2 == 0 && !other.ptAdded) {\n if (\n (this.x > other.x - other.w / 2 && this.x < other.x + other.w / 2) &&\n (this.y > other.y + other.h / 2 && this.y < other.y + other.h / 2 + pipeH)) {\n score++;\n other.ptAdded = true;\n pointSnd.play();\n }\n }\n\n // Checks for collision with pipe\n if (\n // A-top < B-bot\n (this.y - this.h / 2 < other.y + other.h / 2) &&\n // A-bot > B-top\n (this.y + this.h / 2 > other.y - other.h / 2) &&\n // A-right > B-left\n (this.x + this.w / 2 > other.x - other.w / 2) &&\n // A-left < B-right\n (this.x - this.w / 2 < other.x + other.w / 2))\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "65ea1efb2374e2419d5dc1c818df32ab", "score": "0.7184265", "text": "function collideswith(d, b) {\n\treturn d.x <= (b.x + 32)\n\t&& b.x <= (d.x + 32)\n\t&& d.y <= (b.y + 32)\n\t&& b.y <= (d.y + 32)\n }", "title": "" }, { "docid": "b0ec5f089efef3f24b89e7fbceca50bd", "score": "0.7174316", "text": "function detectCollision(obst, roadster) {\n if (obst.x < roadster.x + roadster.width &&\n obst.x + obst.width > roadster.x &&\n obst.y < roadster.y + roadster.height &&\n obst.y + obst.height > roadster.y) {\n crash.play()\n roadster.img = roadster.explosion;\n gameOver = true;\n gameRunning = true\n }\n // if (gameOver && gameRunning) {\n\n // }\n\n} // end detectCollision", "title": "" }, { "docid": "8ae5ff6f2ba93c550e73fa2ca0698706", "score": "0.7170871", "text": "collision() {\n let result = false;\n for (var xt = this.pos[0]-int(this.speed[0]<0)*tileSize; xt > this.pos[0]-(this.occupiedTiles[0] - int(this.speed[0]>0))*tileSize; xt-=tileSize) {\n for (var yt = this.pos[1]; yt > this.pos[1]-this.occupiedTiles[1]*tileSize; yt-=tileSize) {\n let curGrid = gridFromPos([xt,yt]);\n if(isGridInListOfGrids(curGrid,main.gridPos)) {\n xt = this.pos[0]-this.occupiedTiles[0]*tileSize;\n yt = this.pos[1]-this.occupiedTiles[1]*tileSize;\n result = true;\n }\n }\n }\n return result;\n }", "title": "" }, { "docid": "6bc47e3e655d202032a3a7caf40e4f50", "score": "0.71687204", "text": "collision() {\n let surfX1 = surfer.x;\n let surfX2 = surfer.x + surfer.width;\n let surfY1 = surfer.y;\n let surfY2 = surfer.y + surfer.height;\n\n if (\n this.x < surfX2 &&\n this.x + this.width > surfX1 &&\n this.y < surfY2 &&\n this.y + this.height > surfY1\n ) {\n // This will happen to our shark on collision\n gameBoard.highscore();\n gameBoard.reset();\n surfer.reset();\n this.sound();\n }\n }", "title": "" }, { "docid": "53521367bcfcc4415443aa245563b6ee", "score": "0.71557915", "text": "function checkCollision(obj1, obj2){\n return obj1.y + obj1.height >= obj2.clientY\n && obj1.y <= obj2.clientY\n && obj1.x + obj1.width >= obj2.clientX\n && obj1.x <= obj2.clientX\n}", "title": "" }, { "docid": "b9be0e231ea73ab2230ee3020e65036b", "score": "0.7146144", "text": "checkForCollision(gameObjectOneKey, gameObjectTwoKey, velocity) {\n let gameObjectOne = this.objects[gameObjectOneKey];\n let gameObjectTwo = this.objects[gameObjectTwoKey];\n\n if (!(gameObjectOne && gameObjectTwo)) {\n console.log(`[checkForCollision] Warning: Game object with key of either '${gameObjectOneKey}' or '${gameObjectTwoKey} does not exist.'`);\n return;\n }\n\n let bbOne = gameObjectOne.boundingBox(); // must be a scalar\n\n if (bbOne.constructor !== BoundingBox) {\n console.log(\"[checkForCollision] Warning: bbOne must be an instance of BoundingBox.\");\n return;\n }\n\n // Take current velocity into account when checking for collisions.\n bbOne.offsetBy(velocity);\n\n let bbTwo = gameObjectTwo.boundingBox(); // can be an array of BoundingBox\n\n let bbTwoArr;\n if (bbTwo.constructor === Array) {\n bbTwoArr = bbTwo;\n } else {\n bbTwoArr = [bbTwo];\n }\n\n for (let bbTwoIndex = 0; bbTwoIndex < bbTwoArr.length; bbTwoIndex++) {\n let bbTwo = bbTwoArr[bbTwoIndex];\n\n // Check if BoundingBox is invalid so we don't get a false positive.\n if (isNaN(bbTwo.x) || isNaN(bbTwo.y) || isNaN(bbTwo.width) || isNaN(bbTwo.height)) {\n continue;\n }\n\n if (this.checkBoundingBoxCollision(bbOne, bbTwo)) {\n //ctx.fillStyle = 'green';\n //ctx.fillRect(bbTwo.x, bbTwo.y, bbTwo.width, bbTwo.height);\n\n //ctx.fillStyle = 'purple';\n //ctx.fillRect(bbOne.x, bbOne.y, bbOne.width, bbOne.height);\n\n return true;\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "eed85b3c19283063975f52e0aaae5022", "score": "0.7098654", "text": "function checkCollision(x1, y1, h1, w1, x2, y2, h2, w2) {\n return x1<x2+w2 && x1+w1>x2 && y1<y2+h2 && y1+h1>y2;\n}", "title": "" }, { "docid": "358194ce1cc97f6189c2f3976f4172c6", "score": "0.7086152", "text": "function ObjectsCollided(object1, object2)\n{\n // Currently unused\n if(object1.HitboxType == \"Rect\" && object2.HitboxType == \"Rect\")\n {\n object1_moved = GetMovedHitbox(object1, object1.TransX, object1.TransY, object1.Rotation);\n object2_moved = GetMovedHitbox(object2, object2.TransX, object2.TransY, object2.Rotation);\n\n upperleft1 = object1_moved[0];\n bottomright1 = object1_moved[1];\n upperleft2 =object2_moved[0];\n bottomright2 = object2_moved[1];\n\n return (upperleft1[0] < bottomright2[0] &&\n bottomright1[0] > upperleft2[0] &&\n bottomright1[1] < upperleft2[1] &&\n upperleft1[1] > bottomright2[1]);\n }\n // Detecting collision between player and spike\n else if(object1.HitboxType == \"Rect\", object2.HitboxType == \"Triangle\")\n {\n // Rotating to a up-down orientation for simplicity\n object1_moved = GetMovedHitbox(object1, object1.TransX, object1.TransY, object1.Rotation);\n object2_moved = GetMovedHitbox(object2, object2.TransX, object2.TransY, object2.Rotation);\n\n upperleft = object1_moved[0];\n bottomright = object1_moved[1];\n upperright = vec2(bottomright[0], upperleft[1]);\n bottomleft = vec2(upperleft[0], bottomright[1]);\n\n for(var i=0; i < object2_moved.length; ++i)\n {\n var obj_start = object2_moved[i];\n var j;\n if((i+1) >= object2_moved.length)\n j = 0;\n else\n j = i+1;\n\n var obj_end = object2_moved[j];\n\n var intersection = (\n Intersects(obj_start, obj_end, bottomleft, bottomright) ||\n Intersects(obj_start, obj_end, bottomright, upperright) ||\n Intersects(obj_start, obj_end, upperleft, upperright) ||\n Intersects(obj_start, obj_end, upperleft, bottomleft)\n );\n\n if(intersection)\n {\n return true;\n }\n }\n return false;\n }\n}", "title": "" }, { "docid": "9cca61f4bbb31d021ce66e413435930e", "score": "0.70713663", "text": "function checkCollisions() {\n allEnemies.forEach(function(enemyinarray) {\n if (enemyinarray.yLoc < player.height + player.yLoc &&\n enemyinarray.height + enemyinarray.yLoc > player.yLoc &&\n enemyinarray.xLoc < player.width + player.xLoc &&\n enemyinarray.width + enemyinarray.xLoc > player.xLoc) {\n var el = document.getElementById('game');\n el.innerHTML = NOTICE_GAME_OVER;\n var elb = document.getElementById('game1');\n elb.innerHTML = NOTICE_RESTART; \n/* On impact, player is moved off canvas as far as possible;\n*/\n player.xLoc = 10000;\n player.yLoc = 10000;\n }\n });\n}", "title": "" }, { "docid": "aa59cd60ec01aac7b995d6ecacfa1e55", "score": "0.7071271", "text": "function collisionDetection(){\n for(var c = 0; c < brickColumnCount; c++){\n for(var r = 0; r < brickRowCount; r++){\n var b = bricks[c][r];\n if(b.status == 1){\n if(y + ballRadius > b.y && y - ballRadius < b.y + brickHeight && x + ballRadius > b.x && x - ballRadius < b.x + brickWidth){\n if((y < b.y && dy >= 0) || (y > b.y + brickHeight && dy < 0)){\n dy = -dy\n }\n if ((x < b.x && dx >= 0) || (x > b.x + brickWidth && dx < 0)){\n dx = -dx\n }\n b.status = 0;\n score++;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "04bfc3868014d19f05e4cedb13aa7878", "score": "0.70588756", "text": "collision(){\n // 6 point boundary\n if (this.x - this.halfsize < 6 || this.x + this.halfsize > 1174) {\n this.velX = -this.velX;\n }\n if (this.y - this.halfsize < 6 || this.y + this.halfsize > 894) {\n this.velY = -this.velY;\n }\n\n }", "title": "" }, { "docid": "6750f8bdb13f81f94f70240bc3381bdc", "score": "0.70384514", "text": "function calculateCollisions(){\n for (i=0; i<objectList.length; i++) {\n //1 for projectiles\n if (objectList[i].type_id == 1) {\n //Calculate the change in position\n if (objectList[i].position[1] < -2) {\n objectList[i].alive = false;\n }\n for (j=0; j<objectList.length; j++) {\n if (objectList[j].type_id == 2) {\n if ( length( subtract( objectList[i].position, objectList[j].position) ) < 1.1 ){\n points++;\n scoreboard.innerHTML = points;\n objectList[i].alive = false;\n objectList[j].alive = false;\n break;\n }\n }\n }\n }\n //2 for enemies\n else if (objectList[i].type_id == 2){\n if (length( subtract( objectList[i].position, vec3(0,0,0)) ) < 2.0) {\n timeSpeed = 0.0;\n scoreboard.innerHTML = \"Game Over! Your score was: \" + points;\n gameOver = true;\n document.exitPointerLock();\n }\n }\n //3 for shrapnel\n else if (objectList[i].type_id == 3) {\n if (objectList[i].position[1] < -2) {\n objectList[i].alive = false;\n }\n }\n }\n}", "title": "" }, { "docid": "e64bd8905564a5777ac5a988dcc8ae31", "score": "0.70219696", "text": "function playerCollision() {\r\n var player_xw = player_x + player_w,\r\n player_yh = player_y + player_h;\r\n for (var i = 0; i < enemies.length; i++) {\r\n if (player_x > enemies[i][0] && player_x < enemies[i][0] + enemy_w && player_y > enemies[i][1] && player_y < enemies[i][1] + enemy_h) {\r\n checkLives();\r\n }\r\n if (player_xw < enemies[i][0] + enemy_w && player_xw > enemies[i][0] && player_y > enemies[i][1] && player_y < enemies[i][1] + enemy_h) {\r\n checkLives();\r\n }\r\n if (player_yh > enemies[i][1] && player_yh < enemies[i][1] + enemy_h && player_x > enemies[i][0] && player_x < enemies[i][0] + enemy_w) {\r\n checkLives();\r\n }\r\n if (player_yh > enemies[i][1] && player_yh < enemies[i][1] + enemy_h && player_xw < enemies[i][0] + enemy_w && player_xw > enemies[i][0]) {\r\n checkLives();\r\n }\r\n }\r\n}", "title": "" }, { "docid": "a3f7aa7d87fd320ce0148acdba13a6ab", "score": "0.70152867", "text": "playerAndEnemyCollision() {\n this.collision= [];\n for(let i =0; i < this.game.EnemyArray.length; i++) {\n let dx=(this.x + 48 /2)-(this.game.EnemyArray[i].x + 48/2);\n let dy=(this.y + 48 /2) - (this.game.EnemyArray[i].y + 48 /2);\n let width=(48 + 48) / 2;\n let height=(48 + 48) / 2;\n let crossWidth=width*dy;\n let crossHeight=height*dx;\n if(Math.abs(dx)<=width && Math.abs(dy)<=height){\n if(crossWidth>crossHeight){\n this.collision.push((crossWidth>(-crossHeight))?1:2);\n }else{\n this.collision.push((crossWidth>-(crossHeight))? this.game.EnemyArray[i].x +48 : 4);\n } \n }\n }\n return this.collision;\n}", "title": "" }, { "docid": "3ce59c604b7ab92444d297c000c4dcab", "score": "0.70094836", "text": "checkCollision(x,y,width,height,direction,map){\n if (direction == \"up\"){\n if(map[(Math.floor(x/50))+(Math.floor((y-1)/50))*25] == 4){\n if (puzzleMap[level][stage] === 0){\n return 4;\n }\n else{\n return 0;\n }\n }\n else if(map[(Math.floor(x/50))+(Math.floor((y-1)/50))*25] == 5){\n return 5;\n }\n else if(map[(Math.floor(x/50))+(Math.floor((y-1)/50))*25] === 0 && y -5 > 0){\n return 0;\n }\n else{\n return 1;\n }\n }\n else if (direction == \"down\"){\n if(map[(Math.floor(x/50))+(Math.floor((y+height)/50))*25] == 4 || map[(Math.floor((x+width-5)/50))+(Math.floor((y+height)/50))*25] == 4){\n if (puzzleMap[level][stage] === 0){\n return 4;\n }\n else{\n return 0;\n }\n }\n else if(map[(Math.floor(x/50))+(Math.floor((y+height)/50))*25] == 5 || map[(Math.floor((x+width-5)/50))+(Math.floor((y+height)/50))*25] == 5){\n return 5;\n }\n else if (map[(Math.floor(x/50))+(Math.floor((y+height)/50))*25] === 0 && map[(Math.floor((x+width-5)/50))+(Math.floor((y+height)/50))*25] === 0){\n return 0;\n }\n else{\n return 1;\n }\n }\n else if (direction == \"left\"){\n if (map[(Math.floor((x)/50))+(Math.floor(y/50))*25] == 4 || map[(Math.floor((x-1)/50))+(Math.floor((y+height-1)/50))*25] == 4) {\n if (puzzleMap[level][stage] === 0){\n return 4;\n }\n else{\n return 0;\n }\n }\n else if (map[(Math.floor((x)/50))+(Math.floor(y/50))*25] == 5 || map[(Math.floor((x-1)/50))+(Math.floor((y+height-1)/50))*25] == 5) {\n return 5;\n }\n else if (map[(Math.floor((x)/50))+(Math.floor(y/50))*25] == 3 || map[(Math.floor((x-1)/50))+(Math.floor((y+height-1)/50))*25] == 3) {\n return 3;\n }\n else if (map[(Math.floor((x)/50))+(Math.floor(y/50))*25] === 0 && map[(Math.floor((x-1)/50))+(Math.floor((y+height-1)/50))*25] === 0) {\n return 0;\n }\n else{\n return 1;\n }\n }\n else if (direction == \"right\"){\n if(map[(Math.floor((x+width)/50))+(Math.floor(y/50))*25] == 4 || map[(Math.floor((x+width)/50))+(Math.floor((y+height-1)/50))*25] == 4){\n if (puzzleMap[level][stage] === 0){\n return 4;\n }\n else{\n return 0;\n }\n }\n else if(map[(Math.floor((x+width)/50))+(Math.floor(y/50))*25] == 5 || map[(Math.floor((x+width)/50))+(Math.floor((y+height-1)/50))*25] == 5){\n return 5;\n }\n else if(map[(Math.floor((x+width)/50))+(Math.floor(y/50))*25] == 3 || map[(Math.floor((x+width)/50))+(Math.floor((y+height-1)/50))*25] == 3){\n return 3;\n }\n else if (map[(Math.floor((x+width)/50))+(Math.floor(y/50))*25] === 0 && map[(Math.floor((x+width)/50))+(Math.floor((y+height-1)/50))*25] === 0){\n return 0;\n }\n else{\n return 1;\n }\n }\n }", "title": "" }, { "docid": "476e5608fccfba498a8000a310f02b90", "score": "0.70043176", "text": "function collides()\n {\n if (leftBall < leftDefender + widthDefender &&\n leftBall + widthBall > leftDefender &&\n topBall < topDefender + heightDefender &&\n topBall + heightBall > topDefender) return true; \n }", "title": "" }, { "docid": "2383ae32447004304fbef1a3bea1e36e", "score": "0.7003968", "text": "function shipCollision() {\n let ship_xw = ship_x + ship_w,\n ship_yh = ship_y + ship_h;\n\n for (let i = 0; i < enemies.length; i++) {\n if (ship_x > enemies[i][0] && ship_x < enemies[i][0] + enemy_w && ship_y > enemies[i][1] && ship_y < enemies[i][1] + enemy_h) {\n checkLives();\n explode(ship_xw, ship_yh);\n }\n if (ship_xw < enemies[i][0] + enemy_w && ship_xw > enemies[i][0] && ship_y > enemies[i][1] && ship_y < enemies[i][1] + enemy_h) {\n checkLives();\n explode(ship_xw, ship_yh);\n }\n if (ship_yh > enemies[i][1] && ship_yh < enemies[i][1] + enemy_h && ship_x > enemies[i][0] && ship_x < enemies[i][0] + enemy_w) {\n checkLives();\n explode(ship_xw, ship_yh);\n }\n if (ship_yh > enemies[i][1] && ship_yh < enemies[i][1] + enemy_h && ship_xw < enemies[i][0] + enemy_w && ship_xw > enemies[i][0]) {\n checkLives();\n explode(ship_xw, ship_yh);\n }\n }\n}", "title": "" }, { "docid": "4445735af4dcba690abbc3ec1225a30c", "score": "0.7003893", "text": "function collides(x1, y1, x2, y2, w, h){\n\tvar w1 = w;\n\tvar w2 = w;\n\tvar h1 = h;\n\tvar h2 = h;\n\tif (((x1 <= x2+w2 && x1 >=x2) && (y1 <= y2+h2 && y1 >= y2)) ||\n ((x1+w1 <= x2+w2 && x1+w1 >= x2) && (y1 <= y2+h2 && y1 >= y2)) ||\n ((x1 <= x2+w2 && x1 >=x2) && (y1+h1 <= y2+h2 && y1+h1 >= y2)) ||\n ((x1+w1 <= x2+w2 && x1+w1 >= x2) && (y1+h1 <= y2+h2 && y1+h1 >= y2))){\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "ffc41f0bfcd90590016258b76b489a3f", "score": "0.6994577", "text": "detectCollision() {\n this.hit = collideRectCircle(box.posX, box.posY, box.width, box.width, this.x, this.y, 64, 64);\n }", "title": "" }, { "docid": "62419e120b75e7beb0b727edacb2f7b9", "score": "0.69891775", "text": "function _detectCollision () {\n // if(!collisionDetectionOn || _collisionPairs.length <= 0) {\n // return;\n // }\n\n var pair;\n for (var i in _collisionPairs) {\n pair = _collisionPairs[i];\n \n for(var j in pair.group1) {\n for (var k in pair.group2) {\n if(isColliding(pair.group1[j], pair.group2[k])) {\n if(pair.group1[j].onCollision !== undefined) {\n pair.group1[j].onCollision(pair.group2[k]);\n }\n\n if(pair.group2[k].onCollision !== undefined) {\n pair.group2[k].onCollision(pair.group1[j]);\n }\n }\n }\n }\n }\n\n //setTimeout(_detectCollision, 1000/60);\n }", "title": "" }, { "docid": "91578b75643ccc846c1c8e8006e13330", "score": "0.6986431", "text": "function shipCollision() {\n var ship_xw = ship_x + ship_w,\n ship_yh = ship_y + ship_h;\n\n for (let i = 0; i < enemies.length; i++) {\n if (ship_x > enemies[i][0] && ship_x < enemies[i][0] + enemy_w && ship_y > enemies[i][1] && ship_y < enemies[i][1] + enemy_h) {\n checkLives();\n explode(ship_xw, ship_yh);\n }\n if (ship_xw < enemies[i][0] + enemy_w && ship_xw > enemies[i][0] && ship_y > enemies[i][1] && ship_y < enemies[i][1] + enemy_h) {\n checkLives();\n explode(ship_xw, ship_yh);\n }\n if (ship_yh > enemies[i][1] && ship_yh < enemies[i][1] + enemy_h && ship_x > enemies[i][0] && ship_x < enemies[i][0] + enemy_w) {\n checkLives();\n explode(ship_xw, ship_yh);\n }\n if (ship_yh > enemies[i][1] && ship_yh < enemies[i][1] + enemy_h && ship_xw < enemies[i][0] + enemy_w && ship_xw > enemies[i][0]) {\n checkLives();\n explode(ship_xw, ship_yh);\n }\n }\n}", "title": "" }, { "docid": "72a73c917c92abb76f3d7ce3f1da668e", "score": "0.6977052", "text": "static checkCollision(obj1, obj2){\n var test = false;\n if(obj1.x + obj1.width > obj2.x && obj1.x < obj2.x + obj2.width && obj1.y + obj1.height > obj2.y && obj1.y < obj2.y + obj2.height){\n test = true;\n }\n return test;\n }", "title": "" }, { "docid": "b35bf638876828e0e76479366bf48fc9", "score": "0.69765866", "text": "checkCollision() {\n //collision with the blocks\n var that = this;\n var arrayY = [];\n var bottomColls = blocks.filter(function (block) {\n if(Math.abs(block.x + block.w/2 - that.x - that.w / 2) < collisionRange)\n {\n var a = block.dirY ? block.dirY : 0;\n return ((block.y + block.h / 2) - (that.y + that.h / 2) <= that.h / 2 + block.h / 2 - a + that.speedY) &&\n ((block.y + block.h / 2) - (that.y + that.h / 2)) >= that.h / 2 + block.h / 2 - that.speedY + a\n && Math.abs((block.x + block.w / 2) - (that.x + that.w / 2)) < that.w / 2 + block.w / 2 + that.speedX;\n }\n });\n bottomColls.forEach(function (block) { arrayY.push(block.y) });\n\n var index = arrayY.indexOf(Math.min(...arrayY))\n var bottom = bottomColls[index];\n\n var rightColls = blocks.filter(function (block) {\n if(Math.abs(block.x + block.w/2 - that.x - that.w / 2) < collisionRange)\n {\n var b = bottom ? !(block.x === bottom.x && block.y === bottom.y && block.w === bottom.w && block.h === bottom.h) : true;\n return ((block.x + block.w / 2) - (that.x + that.w / 2) <= that.w / 2 + block.w / 2 + that.speedX) &&\n ((block.x + block.w / 2) - (that.x + that.w / 2) >= that.w / 2 + block.w / 2 - that.speedX)\n && Math.abs((block.y + block.h / 2) - (that.y + that.h / 2)) < that.h / 2 + block.h / 2 - that.speedY && b;\n }\n });\n\n var leftColls = blocks.filter(function (block) {\n if(Math.abs(block.x + block.w/2 - that.x - that.w / 2) < collisionRange)\n {\n var b = bottom ? !(block.x === bottom.x && block.y === bottom.y && block.w === bottom.w && block.h === bottom.h) : true;\n return ((that.x + that.w / 2) - (block.x + block.w / 2) <= that.w / 2 + block.w / 2 + that.speedX) &&\n ((that.x + that.w / 2) - (block.x + block.w / 2)) >= that.w / 2 + block.w / 2 - that.speedX\n && Math.abs((block.y + block.h / 2) - (that.y + that.h / 2)) < that.h / 2 + block.h / 2 - that.speedY && b;\n }\n });\n\n var right = rightColls[0];\n var left = leftColls[0];\n\n var up = blocks.find(function (block) {\n if(Math.abs(block.x + block.w/2 - that.x - that.w / 2) < collisionRange)\n {\n var l = left ? !(left.x === block.x && left.y === block.y && left.w === block.w && left.h === block.h) : true;\n var r = right ? !(right.x === block.x && right.y === block.y && right.w === block.w && right.h === block.h) : true;\n return ((that.y + that.h / 2) - (block.y + block.h / 2) <= that.h / 2 + block.h / 2) &&\n ((that.y + that.h / 2) - (block.y + block.h / 2)) >= that.h / 2 + block.h / 2 + that.speedY\n && Math.abs((block.x + block.w / 2) - (that.x + that.w / 2)) < that.w / 2 + block.w / 2 - 2 * that.speedX && r && l;\n }\n });\n\n if (bottom) {\n this.collision.down = true;\n this.downCollBlock = bottom;\n this.y = bottom.y - this.h;\n\n if (bottom.type === \"Horizontal\") {\n if (bottom.dirX < 0) {\n if (!this.collision.left) {\n this.x += bottom.dirX;\n }\n }\n else {\n if (!this.collision.right) {\n this.x += bottom.dirX;\n }\n }\n }\n else if (bottom.type === \"Sand\")\n bottom.break();\n }\n else\n this.collision.down = false;\n\n\n if (up)\n this.collision.up = true;\n else\n this.collision.up = false;\n\n if (right) {\n this.collision.right = true;\n if (!this.collision.left && right.type === \"Horizontal\")\n this.x = right.x - this.w\n }\n else\n this.collision.right = false;\n\n if (left) {\n this.collision.left = true;\n if (!this.collision.right && left.type === \"Horizontal\")\n this.x = left.x + left.w;\n }\n else {\n this.collision.left = false;\n }\n\n if (this.collision.left && this.collision.right && this.collision.down && !player.dead) {\n this.die();\n }\n\n //ADDED BY VARDAN\n for (let c in coins) {\n if(Math.abs(coins[c].x + coins[c].w/2 - that.x - that.w / 2) < collisionRange)\n {\n if (that.x + that.w > coins[c].x && that.x < coins[c].x + coins[c].w && that.y + that.h > coins[c].y && that.y < coins[c].y + coins[c].h) {\n coins.splice(coins.indexOf(coins[c]), 1);\n player.eatenCoins++;\n //ADDED BY VARDAN\n cup.checkAvailablity();\n break;\n }\n }\n }\n\n //MATTER OF INVESTIGATION: This can be optimized: a. Instead of checking availabilit\n //collision with the cup (lock)\n //EDITED BY VARDAN\n if (cup.available) {\n if(Math.abs(cup.x + cup.w/2 - that.x - that.w / 2) < collisionRange)\n {\n if (this.x + this.w > cup.x && this.x < cup.x + cup.w && this.y + this.h > cup.y && this.y < cup.y + cup.h ) {\n //checks which level has the player passed\n gameStarted = false;\n if (levelsPassed > 3 || input) {\n playerWon = true;\n }\n else if (levelsPassed === 3 && !input && currentLvl === levelsPassed) {\n playerWonTemp = true;\n }\n else {\n playerWonTemp = true;\n }\n if (levelsPassed < 3 && !input) {\n playerWonTemp = true;\n }\n }\n }\n }\n }", "title": "" }, { "docid": "1fdffceed7164ac1a02768237c83d73e", "score": "0.696979", "text": "function collision($div1, $div2) {\n // calculate the breadth and height of our car\n var x1 = $div1.offset().left;\n var y1 = $div1.offset().top;\n var h1 = $div1.outerHeight(true);\n var w1 = $div1.outerWidth(true);\n var b1 = y1 + h1;\n var r1 = x1 + w1;\n // calculate the breadth and height of opponent colliding car\n var x2 = $div2.offset().left;\n var y2 = $div2.offset().top;\n var h2 = $div2.outerHeight(true);\n var w2 = $div2.outerWidth(true);\n var b2 = y2 + h2;\n var r2 = x2 + w2;\n // check if they collide\n if (b1 < y2 || b2 < y1 || r1 < x2 || r2 < x1) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "5816ad85640e1987d33111dc70436874", "score": "0.696526", "text": "function collide(s1, s2, breakOnFirstHit = false) {\n const [w, h] = s2.dims;\n const [x, y] = s2.pos;\n\n // assumes map to be s1 at 0, 0 origin\n const hits = [];\n const iData1 = s1.ctx.getImageData(x, y, w, h);\n const d1 = iData1.data;\n const iData2 = s2.ctx.getImageData(0, 0, w, h);\n const d2 = iData2.data;\n\n for (let yi = 0; yi < h; ++yi) {\n for (let xi = 0; xi < w; ++xi) {\n const i0 = (yi * w + xi) * 4 + 3;\n const a = d1[i0];\n const b = d2[i0];\n if (a & b) {\n //console.log(`pos: [${xi}, ${yi}] | a: ${a} | b: ${b}`);\n hits.push([xi + x, yi + y]);\n if (breakOnFirstHit) {\n return hits;\n }\n }\n }\n }\n\n return hits;\n}", "title": "" }, { "docid": "dc356b0de9bf4b0fa8646cddc9519508", "score": "0.6960587", "text": "detectCollision() {\n for (let i = 1; i < this.track.nodes.length; i++) {\n let node0 = this.track.nodes[i-1];\n let node1 = this.track.nodes[i];\n \n // Check for intersection of car rect with two track edges.\n if (lineRectIntersect(\n node0.leftX, node0.leftY, node1.leftX, node1.leftY,\n this.width, this.length, this.x, this.y, this.angle) ||\n lineRectIntersect(\n node0.rightX, node0.rightY, node1.rightX, node1.rightY,\n this.width, this.length, this.x, this.y, this.angle)) {\n this.collided = true;\n return;\n }\n }\n\n this.collided = false;\n }", "title": "" }, { "docid": "9baec5f908bd130d98e9ebc632dae8f6", "score": "0.6959795", "text": "function collisionCheck(x,y,width,height,obj) //parameters must be the x, y, width, and height of first object\n{\t\t\t\t\t\t\t\t\t\t\t //in order to account for vertical and horizontal velocity, merely the instance of the second object is needed\n\treturn (x < obj.x + obj.width &&\n\t\t x + width > obj.x &&\n\t\t y < obj.y + obj.height &&\n\t\t y + height > obj.y); //returns true if any side of the first square is intersecting with any side of the second square\n}", "title": "" }, { "docid": "6784264397581a61a63bfcaf2b25d547", "score": "0.69583225", "text": "function checkCollision(x,y)\n{\n //console.log(\"Check col:\"+grid[x][y]);\n //if( grid[x][y] == 1 )\n // return 1;\n for(var i in Entity.List)\n {\n if( Number(Entity.List[i].attr('x')) == x && Number(Entity.List[i].attr('y')) == y )\n {\n if( Entity.List[i].attr('type') == \"corpse\" )\n continue;\n \n if( Entity.List[i].css('display') == \"none\" )\n continue;\n \n if( Entity.List[i].attr('type') == \"player\" )\n continue;\n \n //It's a hostile NPC, attack it\n if( Entity.List[i].attr('hostile') == \"1\")\n {\n if( frame-player.weapondelay > player.lastattack )\n {\n setTarget(i);\n meleeAttack(x,y);\n player.lastattack = frame;\n } \n return 1;\n }\n if( Entity.List[i].attr('type') == \"merchant\" )\n {\n openTradeWithMerchant(i);\n return 1;\n }\n return 1; \n }\n }\n return 0;\n}", "title": "" }, { "docid": "727f5442bc04704fc58cdc5739c55211", "score": "0.6950174", "text": "function collisionDetection() {\n for (let c = 0; c < brickColumnCount; c++) {\n for (let r = 0; r < brickRowCount; r++) {\n let b = bricks[c][r];\n //involve brick status the status is 1\n //if collision happens it is active\n //using b through out the formula will keep bricks active\n if (b.status == 1) {\n if (\n x > b.x &&\n x < b.x + brickWidth &&\n y > b.y &&\n y < b.y + brickHeight\n ) {\n dy = -dy;\n //if collision occurs set the status of brick to 0, it will not be painted on screen\n b.status = 0;\n score++;\n if (score == brickRowCount * brickColumnCount) {\n alert(\"Winner Winner, CONGRATS!. That's right, it\\'s not over until I win\");\n document.location.reload();\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "e8218cc8a25d227cc0c3ed537a8352ad", "score": "0.6946761", "text": "function collide(l1, l2) {\n\t\t \tvar r1 = { left: l1.x, top: l1.y, right: l1.x+l1.width, bottom: l1.y+l1.height };\n\t\t \tvar r2 = { left: l2.x, top: l2.y, right: l2.x+l2.width, bottom: l2.y+l2.height };\n\t \t\t\t \n\t \t\t\t return !(r2.left > r1.right || \n\t\t\t\t r2.right < r1.left || \n\t\t\t\t r2.top > r1.bottom ||\n\t\t\t\t r2.bottom < r1.top);\n\t\t }", "title": "" }, { "docid": "23f88113de7916f611f3035eac5b06e9", "score": "0.6940684", "text": "function collide() {\r\n if ((block.getBoundingClientRect().left - player.getBoundingClientRect().left) <= (96-16) && block.getBoundingClientRect().bottom == player.getBoundingClientRect().bottom) {\r\n console.log('PERDU');\r\n gameOver();\r\n }\r\n}", "title": "" }, { "docid": "a080b1a78c161785c3009d3572a18522", "score": "0.6939039", "text": "function isColliding(thing1, thing2){\n if((thing1.y + thing1.height) < (thing2.y) || (thing1.y > (thing2.y + thing2.height)) || ((thing1.x + thing1.width) < thing2.x) || (thing1.x > (thing2.x + thing2.width))){ \n return false;\n }\n else{ \n return true;\n }\n}", "title": "" }, { "docid": "995b8b57f32b24baeb6ac7caba78d1c7", "score": "0.69330883", "text": "function detectCollision() {\n let justusCollider = justus.getBoundingClientRect();\n let bombCollider = bomb.getBoundingClientRect();\n let diamondCollider = diamond.getBoundingClientRect();\n\n if ((justusCollider.left < bombCollider.left + justusCollider.width)\n && (justusCollider.left + justusCollider.width > bombCollider.left)\n && (justusCollider.top < bombCollider.top + bombCollider.height)\n && (justusCollider.height + justusCollider.top > bombCollider.top)) {\n\n if (justus.firstElementChild.className == \"justus-shield\") {\n shieldBombCollision();\n } else {\n onBombCollision(justusCollider, bombCollider);\n }\n } else if ((justusCollider.left < diamondCollider.left + justusCollider.width)\n && (justusCollider.left + justusCollider.width > diamondCollider.left)\n && (justusCollider.top < diamondCollider.top + diamondCollider.height)\n && (justusCollider.height + justusCollider.top > diamondCollider.top)) {\n\n assembleShield();\n\n }\n\n }", "title": "" }, { "docid": "e6ac875a0566ff278b78039dbb3697f1", "score": "0.69230044", "text": "function collisionDetection(x, y) {\n for (var c = 0; c < defaults.brickColumnCount; c++) {\n for (var r = 0; r < defaults.brickRowCount; r++) {\n var b = bricks[c][r];\n if (b.show) {\n if ((x + defaults.ballRadius) >= b.x\n && x - defaults.ballRadius <= b.x+defaults.brickWidth\n && y >= (b.y - defaults.ballRadius)\n && y <= b.y+defaults.brickHeight+defaults.ballRadius) {\n if (!state.powerUpFalling) {\n state.powerUpCounter++;\n }\n if (state.powerUpCounter >= defaults.powerUpActivateCount) powerUp();\n if (y < b.y + defaults.brickHeight + 2) { // if collision occurs on side of brick\n state.dx = -state.dx;\n } else { // collision occurred on top or bottom\n state.dy = -state.dy;\n }\n b.show = false;\n state.score += 100;\n if (state.score === defaults.brickRowCount*defaults.brickColumnCount*100) {\n pauseHandler(true, false);\n if (state.stage < Object.keys(window.stages).length) {\n state.stage++;\n } else {\n state.stage = 1;\n }\n ctx.beginPath();\n ctx.fillStyle = 'white';\n ctx.textAlign = 'center';\n ctx.fontStyle = '36px Arial';\n ctx.fillText('Click to go to next stage', canvas.width/2, canvas.height/2 - 20);\n ctx.fill();\n bricks = window.stages['stage' + state.stage]();\n x = canvas.width/2;\n y = canvas.height - 30;\n state.dx = defaults.dx;\n state.dy = defaults.dy;\n }\n }\n }\n }\n }\n }", "title": "" }, { "docid": "229f5d741ec789fa102b8aa00b9ae642", "score": "0.6918066", "text": "function gameCollision (xx1 ,yy1 ,xx2 ,yy2 ,llx ,lly, i ){\n\n getDistance(xx1 ,yy1 ,xx2 ,yy2,i);\n collisionAction(xx1 ,yy1 ,xx2 ,yy2,i);\n getDistance2(llx ,lly ,xx2 ,yy2,i);\n lazerCollision(llx ,lly ,xx2 ,yy2,i);\n \n \n \n c.drawImage(ship ,ship_x ,ship_y , shipWidth[i] ,ship_height );\n\n for(let i = 0;i < enemies.length;i ++){\n c.drawImage(enemies[i] ,Enemyposition_x[i] ,Enemyposition_y[i] ,enemyWidth[i] ,enemyHeight );\n }\n}", "title": "" }, { "docid": "ebb57fea4165551078cb74ffb31de20d", "score": "0.69096065", "text": "checkCollision() {\r\n if (player.player_x < this.x + 51 &&\r\n player.player_x + 51 > this.x &&\r\n player.player_y < this.y + 40 &&\r\n player.player_y + 40 > this.y) {\r\n player.player_x = 202;\r\n player.player_y = 405;\r\n }\r\n\r\n }", "title": "" }, { "docid": "66de83d27766ac876206f2983895a1f4", "score": "0.69096065", "text": "function checkForCollision() {\n // check for collisions with the obstacleWall\n if (helicopter.y <= obstacleWall.y + OBSTACLE_WALL_HEIGHT && \n helicopter.y + HELICOPTER_HEIGHT >= obstacleWall.y && \n helicopter.x + HELICOPTER_WIDTH >= obstacleWall.x &&\n helicopter.x <= obstacleWall.x + OBSTACLE_WALL_WIDTH) {\n return true;\n }\n\n for (var i = 0; i < caveWalls.length; i++) {\n var topWall = caveWalls[i].topWall;\n var bottomWall = caveWalls[i].bottomWall;\n\n // stop checking for collisions with caveWalls that are in\n // front of the helicopter.\n if (caveWalls[i].x >= helicopter.x + HELICOPTER_WIDTH) {\n return false;\n }\n\n var topWallY = pixelPropToNum(topWall, 'top') + pixelPropToNum(topWall, 'height');\n var bottomWallY = pixelPropToNum(bottomWall, 'top');\n\n if (helicopter.y <= topWallY || helicopter.y + HELICOPTER_HEIGHT >= bottomWallY) {\n return true;\n }\n }\n\n return false;\n}", "title": "" }, { "docid": "b4d6c70720cbc38fdfdb0ab597a3484a", "score": "0.69094515", "text": "collisions() {\n gameBall.check.collision.hasPlayerMissed();\n gameBall.check.collision.hasCpuMissed();\n gameBall.check.collision.hasBoundaryHit();\n }", "title": "" }, { "docid": "905b50eea67dbd3a316581f3ebfefee7", "score": "0.69093287", "text": "function detectEntityCollision() {\n\n const playerX = player.getBoundingClientRect().x;\n const playerY = player.getBoundingClientRect().y;\n\n const powerUpArray = [...document.querySelectorAll('.power-up')];\n const hazardArray = [...document.querySelectorAll('.hazard')];\n\n\n // set collision radius for mobile\n if ('ontouchstart' in document.documentElement) {\n for (let i = 0; i < powerUpArray.length; i++) {\n const powerUpX = powerUpArray[i].getBoundingClientRect().x;\n const powerUpY = powerUpArray[i].getBoundingClientRect().y;\n \n \n if ( (Math.abs((playerX - powerUpX) + 10) < 20) && (Math.abs((playerY - powerUpY) + 10) < 20) ) {\n powerUpArray[i].remove();\n score += 100;\n }\n }\n \n for (let i = 0; i < hazardArray.length; i++) {\n const hazardX = hazardArray[i].getBoundingClientRect().x;\n const hazardY = hazardArray[i].getBoundingClientRect().y;\n \n if ( (Math.abs((playerX - hazardX) + 10) < 17) && (Math.abs((playerY - hazardY) + 10) < 17) ) {\n player.remove();\n hazardArray.map((hazard) => hazard.remove());\n powerUpArray.map((power) => power.remove());\n\n startHazardInterval(false);\n startPowerUpInterval(false);\n \n document.querySelector('.game-over').style.display = 'unset';\n document.querySelector('.play-again').addEventListener('click', () => {\n window.location.reload(false);\n });\n }\n }\n } else if ( !('ontouchstart' in document.documentElement) ) {\n for (let i = 0; i < powerUpArray.length; i++) {\n const powerUpX = powerUpArray[i].getBoundingClientRect().x;\n const powerUpY = powerUpArray[i].getBoundingClientRect().y;\n \n \n if ( (Math.abs((playerX - powerUpX) + 50) < 60) && (Math.abs((playerY - powerUpY) + 50) < 60) ) {\n powerUpArray[i].remove();\n score += 100;\n }\n }\n \n for (let i = 0; i < hazardArray.length; i++) {\n const hazardX = hazardArray[i].getBoundingClientRect().x;\n const hazardY = hazardArray[i].getBoundingClientRect().y;\n \n if ( (Math.abs((playerX - hazardX) + 50) < 60) && (Math.abs((playerY - hazardY) + 50) < 60) ) {\n player.remove();\n hazardArray.map((hazard) => hazard.remove());\n powerUpArray.map((power) => power.remove());\n\n startHazardInterval(false);\n startPowerUpInterval(false);\n \n document.querySelector('.game-over').style.display = 'unset';\n document.querySelector('.play-again').addEventListener('click', () => {\n window.location.reload(false);\n });\n }\n }\n }\n\n \n\n}", "title": "" }, { "docid": "ec19e69fdae1a4dec525e292f74a2467", "score": "0.69091326", "text": "function checkCollision(a, b)\n{\n if (!(a instanceof Entity))\n return false;\n if (!(b instanceof Entity))\n return false;\n \n var rect1 = {x: a.pos.x, y: a.pos.y, width: a.width, height: a.height}\n var rect2 = {x: b.pos.x, y: b.pos.y, width: b.width, height: b.height}\n \n if (rect1.x < rect2.x + rect2.width &&\n rect1.x + rect1.width > rect2.x &&\n rect1.y < rect2.y + rect2.height &&\n rect1.y + rect1.height > rect2.y)\n {\n return true;\n }\n return false; \n}", "title": "" }, { "docid": "c7d106597dc08ce2262baa6086a87143", "score": "0.69069666", "text": "function collides(posX1, posY1, width1, height1, posX2, posY2, width2, height2) {\n\n if (posX1 < (posX2 + width2) && (posX1 + width1) > posX2 &&\n posY1 < (posY2 + height2) && (posY1 + height1) > posY2) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "667ddcb4cf81b207bc3ac3877ffc6a96", "score": "0.69031787", "text": "collision() {\n\n\t\tvar collisions,\n\t\t\t// Get the obstacles array from our world\n\t\t\tobstacles = this.grid.getTilesMesh();\n \n\t\t\n // We reset the raycaster to this direction\n this.raycaster.set(this.mesh.position, this.ray);\n // Test if we intersect with any obstacle mesh\n collisions = this.raycaster.intersectObjects(obstacles);\n // And disable that direction if we do\n if (collisions.length > 0) {\n var id = collisions[0].object.tile.id;\n var split = id.split(\",\");\n this.grid.updateTileTeam(new GridPosition(split[0],split[1]), this.team);\n\n Debug.log(\"collision \" + id);\n }\n\n\t}", "title": "" }, { "docid": "e486f7b375b7b326d061bebd6a03e429", "score": "0.6882823", "text": "checkCollision(actorA, actorB) {\n return (actorA.px < actorB.px + actorB.width &&\n actorA.px + actorA.width > actorB.px &&\n actorA.py < actorB.py + actorB.height &&\n actorA.py + actorA.height > actorB.py)\n }", "title": "" }, { "docid": "85eb5168ea2853b335320b9fdb7f8656", "score": "0.68787897", "text": "function checkCollision(x1, y1, w1, h1, x2, y2, w2, h2) {\n // rectangle 1 is to the left of rectangle #2\n if (x1+w1 < x2) {\n console.log(\"LEFT\");\n return false;\n }\n // rectangle 1 is to the right of rectangle #2\n if (x1 > x2+w2) {\n console.log(\"RIGHT\");\n return false;\n }\n // rectangle 1 is above rectangle #2\n if (y1+h1 < y2) {\n console.log(\"ABOVE\");\n return false;\n }\n // rectangle 1 is below rectangle #2\n if (y1 > y2+h2) {\n console.log(\"BELOW\");\n return false;\n }\n\n // if we got here we failed all of the tests above - the rectangles\n // must be intersecting\n return true;\n}", "title": "" }, { "docid": "6baebce8837dd39458ac950463f50b80", "score": "0.68724465", "text": "function checkCollision() {\n for(var i=0; i<nParticles; i++) {\n for(var j=0; j<nParticles; i++) {\n if(i!=j) {\n var distance = p5.Vector.dist(\n particles[i].position,\n particles[j].position\n );\n if(distance < particleSize) {\n if(particles[i].counter == 0) {\n particles[i].direction.rotate(Math.random());\n particles[i].counter = maxCounter;\n }\n \n if(particles[j].counter == 0) {\n particles[j].direction.rotate(Math.random());\n particles[j].counter = maxCounter;\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "f82a4cda57bc216d6d2ceac9f4ffa561", "score": "0.68698424", "text": "function checkCollisions() {\n let result = 0;\n allEnemies.forEach(function(collision) {\n if (player.x < collision.x + collision.width &&\n player.x + player.width > collision.x &&\n player.y < collision.y + collision.height &&\n player.height + player.y > collision.y) {\n result = 1;\n }\n });\n return result;\n}", "title": "" }, { "docid": "52e2e68a811333342da0d694662e8c3c", "score": "0.68698406", "text": "function collisionDetection(ax, ay, aw, ah, bx, by, bw, bh) {\n /*\n If a(object 1) and b(object 2) are within each other's boundaries,\n they are colliding. The returned calculated conditional basically states:\n if object 1's x-position is within object 2's x-boundaries (x-position+width)\n and object 2's y-position is within object 2's y-boundaries (y-position+height)\n and vice versa for object 2. We check if it is within object 1's boundaries\n */\n return (ax < bx + bw && ax + aw > bx && ay < by + bh && ah + ay > by);\n}", "title": "" }, { "docid": "a324710b699b81f62e69726d6f4dc1e5", "score": "0.686818", "text": "function collisions() {\n collisonBords(ballon);\n\n equipes.forEach((eq) => {\n eq.joueurs.forEach((e) => {\n // Touche le cote droit\n collisonBords(e);\n });\n });\n\n let collision = false;\n\n // Pour toutes les equipes\n equipes.forEach((e) => {\n // Pour chaque joueur de chaque équipe\n e.joueurs.forEach((j) => {\n if (__WEBPACK_IMPORTED_MODULE_5__managers_GestionnaireCollision__[\"a\" /* default */].cercleCercle(j, ballon, j.rayon(), ballon.rayon())) {\n gererCollision(j, ballon);\n collision = true;\n }\n\n // Pour chaque équipe\n equipes.forEach((e2) => {\n // Chaque joueur de chaque équipe\n e2.joueurs.forEach((j2) => {\n if (j.x === j2.x && j.y === j2.y) {\n return;\n }\n\n if (__WEBPACK_IMPORTED_MODULE_5__managers_GestionnaireCollision__[\"a\" /* default */].cercleCercle(j, j2, j.rayon(), j2.rayon())) {\n collision = true;\n gererCollision(j, j2);\n }\n });\n });\n });\n });\n\n if (collision) {\n soundsManager.collisionJoueurs();\n }\n\n if (__WEBPACK_IMPORTED_MODULE_5__managers_GestionnaireCollision__[\"a\" /* default */].pointDansRectangle(map.cageGauche, ballon.centre())) {\n score.DROITE += 1;\n reset();\n soundsManager.but();\n } else if (__WEBPACK_IMPORTED_MODULE_5__managers_GestionnaireCollision__[\"a\" /* default */].pointDansRectangle(map.cageDroite, ballon.centre())) {\n score.GAUCHE += 1;\n reset();\n soundsManager.but();\n }\n }", "title": "" }, { "docid": "837171dbd242481c4e0f7f49ecee52f3", "score": "0.68660975", "text": "function detectCollisions() {\n\tfor (var a = 0; a < objects.length; a++) {\n\t\tfor (var b =0 ; b < objects.length; b++) {\n\t\t\tif (b != a) {\n\t\t\t\tresults.innerHTML += '<li>'+objects[a].color+' intersects '+objects[b].color+'? '+objects[a].intersect(objects[b])+'</li>';\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "055e58c1aed66acd00922426df73b657", "score": "0.68644273", "text": "function detectCollisions() {\r\n // Get the user's current collision area.\r\n var bounds = {\r\n xMin: rotationPoint.position.x - box.geometry.parameters.width / 2,\r\n xMax: rotationPoint.position.x + box.geometry.parameters.width / 2,\r\n yMin: rotationPoint.position.y - box.geometry.parameters.height / 2,\r\n yMax: rotationPoint.position.y + box.geometry.parameters.height / 2,\r\n zMin: rotationPoint.position.z - box.geometry.parameters.width / 2,\r\n zMax: rotationPoint.position.z + box.geometry.parameters.width / 2,\r\n };\r\n\r\n // Run through each object and detect if there is a collision.\r\n for ( var index = 0; index < collisions.length; index ++ ) {\r\n\r\n if (collisions[ index ].type == 'collision' ) {\r\n if ( ( bounds.xMin <= collisions[ index ].xMax && bounds.xMax >= collisions[ index ].xMin ) &&\r\n ( bounds.yMin <= collisions[ index ].yMax && bounds.yMax >= collisions[ index ].yMin) &&\r\n ( bounds.zMin <= collisions[ index ].zMax && bounds.zMax >= collisions[ index ].zMin) ) {\r\n // We hit a solid object! Stop all movements.\r\n stopMovement();\r\n\r\n // Move the object in the clear. Detect the best direction to move.\r\n if ( bounds.xMin <= collisions[ index ].xMax && bounds.xMax >= collisions[ index ].xMin ) {\r\n // Determine center then push out accordingly.\r\n var objectCenterX = ((collisions[ index ].xMax - collisions[ index ].xMin) / 2) + collisions[ index ].xMin;\r\n var playerCenterX = ((bounds.xMax - bounds.xMin) / 2) + bounds.xMin;\r\n var objectCenterZ = ((collisions[ index ].zMax - collisions[ index ].zMin) / 2) + collisions[ index ].zMin;\r\n var playerCenterZ = ((bounds.zMax - bounds.zMin) / 2) + bounds.zMin;\r\n\r\n // Determine the X axis push.\r\n if (objectCenterX > playerCenterX) {\r\n rotationPoint.position.x -= 0.01;\r\n } else {\r\n rotationPoint.position.x += 0.01;\r\n }\r\n }\r\n if ( bounds.zMin <= collisions[ index ].zMax && bounds.zMax >= collisions[ index ].zMin ) {\r\n // Determine the Z axis push.\r\n if (objectCenterZ > playerCenterZ) {\r\n rotationPoint.position.z -= 0.01;\r\n } else {\r\n rotationPoint.position.z += 0.01;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "31feca1bfc2e2ee666f27fd9178ed1f1", "score": "0.6861593", "text": "function collisionDetection() {\n for (let c = 0; c < brickColumnCount; c++) {\n for (let r = 0; r < brickRowCount; r++) {\n let b = bricks[c][r];\n if (b.status === 1) {\n if (x > b.x && x < b.x + brickWidth && y > b.y && y < b.y + brickHeight) {\n dy = -dy;\n b.status = 0;\n score++;\n impact.play();\n randomColor = getHexDecRandomColor();\n if (score == brickRowCount * brickColumnCount) {\n setTimeout(() => {\n alert(\"C'est gagné, Bravo!\");\n document.location.reload();\n }, 1000);\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "ff0be087768b941f0c8e2f7904b15adb", "score": "0.6860732", "text": "function do_playfield_collisions() {\n\t\tvar bplres = bplcon0_res;\n\t\tvar ddf_left = thisline_decision.plfleft * 2 << bplres;\n\t\tvar hw_diwlast = coord_window_to_diw_x(thisline_decision.diwlastword);\n\t\tvar hw_diwfirst = coord_window_to_diw_x(thisline_decision.diwfirstword);\n\t\tvar collided, minpos, maxpos;\n\t\t//#ifdef AGA\n\t\tvar planes = (SAEV_config.chipset.mask & SAEC_Config_Chipset_Mask_AGA) ? 8 : 6;\n\t\t/*#else\n\t\tvar planes = 6;\n\t\t#endif*/\n\n\t\tif (clxcon_bpl_enable == 0) {\n\t\t\tclxdat |= 1;\n\t\t\treturn;\n\t\t}\n\t\tif (clxdat & 1)\n\t\t\treturn;\n\n\t\tcollided = false;\n\t\tminpos = thisline_decision.plfleft * 2;\n\t\tif (minpos < hw_diwfirst)\n\t\t\tminpos = hw_diwfirst;\n\t\tmaxpos = thisline_decision.plfright * 2;\n\t\tif (maxpos > hw_diwlast)\n\t\t\tmaxpos = hw_diwlast;\n\n\t\tvar ldata = line_data[next_lineno];\n\n\t\tfor (var i = minpos; i < maxpos && !collided; i += 32) {\n\t\t\t//var offs = ((i << bplres) - ddf_left) >> 3;\n\t\t\tvar offs = ((i << bplres) - ddf_left) >> 5;\n\t\t\tvar total = 0xffffffff;\n\t\t\tfor (var j = 0; j < planes; j++) {\n\t\t\t\tvar ena = (clxcon_bpl_enable >> j) & 1;\n\t\t\t\tvar match = (clxcon_bpl_match >> j) & 1;\n\t\t\t\tvar t = 0xffffffff;\n\t\t\t\tif (ena) {\n\t\t\t\t\tif (j < thisline_decision.nr_planes) {\n\t\t\t\t\t\t//t = *(uae_u32 *)(line_data[next_lineno] + offs + 2 * j * MAX_WORDS_PER_LINE);\n\t\t\t\t\t\tt = ldata[MAX_WORDS_PER_LINE_FULL * j + offs];\n\t\t\t\t\t\tt = (t ^ ((match & 1) - 1) >>> 0) >>> 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tt = ((match & 1) - 1) >>> 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttotal &= t;\n\t\t\t}\n\t\t\tif (total) {\n\t\t\t\tcollided = true;\n\t\t\t\t/*#if 0\n\t\t\t\t{\n\t\t\t\t\tfor (var k = 0; k < 1; k++) {\n\t\t\t\t\t\tuae_u32 *ldata = (uae_u32 *)(line_data[next_lineno] + offs + 2 * k * MAX_WORDS_PER_LINE);\n\t\t\t\t\t\t*ldata ^= 0x5555555555;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t#endif*/\n\t\t\t}\n\t\t}\n\t\tif (collided)\n\t\t\tclxdat |= 1;\n\t}", "title": "" }, { "docid": "799820e2edf213aa3d7b0210d4bcadd1", "score": "0.68554443", "text": "function detectCollision(newX, newY, isPlayer){\r\n // Determine if player is moving offscreen or into a wall (if isPlayer is set to false the creature is amonster and does not go through doors)\r\n \r\n // Determine what tiles the 4 corners of the player is touching\r\n if(backgroundMap.length === 0){ return; }\r\n let frontSideTile = Math.floor((newY - player.bufHeight + 12)/32) + 1;\r\n let backSideTile = Math.floor((newY + player.hitHeight - player.bufHeight + 4)/32) + 1;\r\n let leftSideTile = Math.floor((newX + player.bufWidth)/32) + 1;\r\n let rightSideTile = Math.floor((newX + player.hitWidth - player.bufWidth)/32) + 1;\r\n\r\n if(backgroundMap.length === 0){ return; }\r\n // Determine what the front number of each tile is\r\n let classTopRight = Math.floor(backgroundMap[frontSideTile][rightSideTile]);\r\n let classTopLeft = Math.floor(backgroundMap[frontSideTile][leftSideTile]);\r\n let classBotRight = Math.floor(backgroundMap[backSideTile][rightSideTile]);\r\n let classBotLeft = Math.floor(backgroundMap[backSideTile][leftSideTile]);\r\n\r\n if(backgroundMap.length === 0){ return; }\r\n // Determine what the decimal number of each tile is\r\n let typeTopRight = Number(backgroundMap[frontSideTile][rightSideTile].toString().split(\".\")[1]);\r\n let typeTopLeft = Number(backgroundMap[frontSideTile][leftSideTile].toString().split(\".\")[1]);\r\n let typeBotRight = Number(backgroundMap[backSideTile][rightSideTile].toString().split(\".\")[1]);\r\n let typeBotLeft = Number(backgroundMap[backSideTile][leftSideTile].toString().split(\".\")[1]);\r\n // console.log(leftSideTile, rightSideTile);\r\n\r\n // Determine whether it is ground/obstacle/door\r\n if(classTopRight != 0 || classTopLeft != 0 || classBotRight != 0 || classBotLeft != 0){ // Non-ground tile\r\n\r\n if((classTopRight == 2 || classBotRight == 2|| classTopLeft == 2 || classBotLeft == 2) && isPlayer){ // Player touching a door \r\n // Determine what edge passed through the door and pass along the corresponding arguements\r\n clearInterval(drawingMonsterInterval);\r\n for(let i=0; i<intervals.length; i++){ clearInterval(intervals[i]); }\r\n intervals = [];\r\n if(classTopLeft == 2 && classTopRight == 2){\r\n determineNextRoom(typeTopRight);\r\n return true;\r\n }\r\n else if(classTopRight == 2 && classBotRight == 2) {\r\n determineNextRoom(typeBotRight);\r\n return true;\r\n }\r\n else if(classBotLeft == 2 && classTopLeft == 2) {\r\n determineNextRoom(typeTopLeft);\r\n return true;\r\n }\r\n else if(classBotLeft == 2 && classBotRight == 2) {\r\n determineNextRoom(typeBotLeft);\r\n return true;\r\n }\r\n }\r\n if((classTopRight == 6 || classBotRight == 6 || classTopLeft == 6 || classBotLeft == 6) && isPlayer){ // PLayer on top of pit\r\n player.speed = 0;\r\n if(classTopRight == 6){ return \"fall\" + frontSideTile + \"|\" + rightSideTile; }\r\n else if(classBotRight == 6){ return \"fall\" + backSideTile + \"|\" + rightSideTile; }\r\n else if(classTopLeft == 6){ return \"fall\" + frontSideTile + \"|\" + leftSideTile; }\r\n else if(classBotLeft == 6){ return \"fall\" + backSideTile + \"|\" + leftSideTile; }\r\n \r\n }\r\n\r\n // Corner Check \r\n // Characters will be able to enter the approximately 1/3 of the tile that is ground\r\n if(typeTopRight == 11 || typeTopLeft == 12){ // walking up into a corner\r\n if(backgroundMap[frontSideTile][leftSideTile] != 1 && backgroundMap[frontSideTile][rightSideTile] != 1){ // check that link is not inside a hill\r\n if((newY + player.bufHeight) > (frontSideTile * 32 -16)){ // Allow link to enter the first y-half of the corner\r\n if(typeTopRight == 11){ // check which corner (11 or 12) link is entering and allow him to walk the first x-half of the corner \r\n if((newX + player.hitWidth - player.bufWidth) < (rightSideTile * 32 -5)){ // allow link to walk on the area that is ground\r\n return true;\r\n }\r\n }\r\n if(typeTopLeft == 12){\r\n if((newX + player.bufWidth) > (leftSideTile * 32 - 32 + 10)){ // allow link to walk on the area that is ground\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n } // end of if statement for corners facing down\r\n else if(typeBotRight == 13 || typeBotLeft == 14){ // walking down into a corner\r\n if(backgroundMap[backSideTile][rightSideTile] != 1 && backgroundMap[backSideTile][leftSideTile] != 1){ // check that link is not inside a hill\r\n if((newY + player.hitHeight - player.bufHeight) < (backSideTile * 32 - 16)){ // Allow link to enter the first y-half of the corner\r\n if(typeBotRight == 13){ // check which corner (11 or 12) link is entering and allow him to walk the first x-half of the corner \r\n if((newX + player.hitWidth - player.bufWidth) < (rightSideTile * 32 -10)){ // allow link to walk on the area that is ground\r\n return true;\r\n }\r\n }\r\n if(typeBotLeft == 14){\r\n if((newX + player.bufWidth) > (leftSideTile * 32 - 32 + 10)){ // allow link to walk on the area that is ground\r\n return true;\r\n }\r\n }\r\n }\r\n }\r\n } // end of if statement for corners facing up;\r\n\r\n \r\n //If not a corner or door but is a non-terrain tile\r\n return false;\r\n } \r\n return true;\r\n}", "title": "" }, { "docid": "fc9722f0c00e47d6164293e3a5b80642", "score": "0.68423176", "text": "function checkCollision() {\n wallCollision(); // collision with wall\n snakeCollision(); // collision with snake (self)\n powerUpCollision(); // collision with powerups\n}", "title": "" }, { "docid": "ec9a7ffe36d20e50a7a52dafe0de772b", "score": "0.68406165", "text": "checkCollisions() {\r\n\t\tif (gameParams.hasCoins) {\r\n\t\t\tfor (var i = 0; i < this.coins.length; i++)\r\n\t\t\t\tthis.coins[i].collides(this.pos, createVector(this.pos.x + this.size, this.pos.y + this.size));\r\n\t\t}\r\n\t\tfor (var i = 0; i < gameParams.dots.length; i++) {\r\n\t\t\tif (gameParams.dots[i].collides(this.pos, createVector(this.pos.x + this.size, this.pos.y + this.size))) {\r\n\t\t\t\tthis.fading = true;\r\n\t\t\t\tthis.dead = true;\r\n\t\t\t\tthis.deathByDot = true;\r\n\t\t\t\tthis.deathAtStep = this.brain.step;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (gameParams.winArea.collision(this.pos, createVector(this.pos.x + this.size, this.pos.y + this.size))) {\r\n\t\t\tif (!gameParams.hasCoins)\r\n\t\t\t\tthis.reachedGoal = true;\r\n\t\t\telse if (gameParams.hasCoins) {\r\n\t\t\t\tvar flag = false;\r\n\t\t\t\tfor (var i = 0; i < this.coins.length; i++) {\r\n\t\t\t\t\tif (!this.coins[i].taken) {\r\n\t\t\t\t\t\tflag = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (!flag)\r\n\t\t\t\t\tthis.reachedGoal = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (var i = 0; i < this.shortGoals.length; i++) {\r\n\t\t\tthis.shortGoals[i].collision(this.pos, createVector(this.pos.x + this.size, this.pos.y + this.size));\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "0ec4ea4728f1ec48ae78c27f6d4689ae", "score": "0.6836305", "text": "function collisionDetection() {\n\t\tfor(c=0; c<brickColumnCount; c++) {\n\t\t\tfor(r=0; r<brickRowCount; r++) {\n\t\t\t\tvar b = bricks[c][r];\n\t\t\t\tif(b.status == 1) {\n\t\t\t\t\tif(x > b.x && x < b.x+brickWidth && y > b.y && y < b.y+brickHeight) {\n\t\t\t\t\t\tdy = -dy;\n\t\t\t\t\t\tb.status = 0;\n// Adding the score inside this function will increase 1 to the score every time a brick is hit \n\t\t\t\t\t\tscore++;\n// With this condition if every brick is hit a message will appear. Through a simple calculation, 'score' can know if there is some brick left, if is not, then it'll show a message, there the user will have the option to reload the game \n\t\t\t\t\t\tif(score == brickRowCount*brickColumnCount) {\n\t\t\t\t\t\t\talert(\"YOU WON!\");\n\t\t\t\t\t\t\tdocument.location.reload();\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": "53aa57ec5b0b12670cf02ab4996b5d79", "score": "0.68362796", "text": "function collisionChecker() {\n\t //collition between block and bird\n \tfor (var i =0 ; i < blocks.length ; i++){\n \t\tif (blocks[i].x < (bird.x + bird.size/2) &\n \t\t blocks[i].x > (bird.x - bird.size/2 - blocks[i].width) &\n \t\t (bird.y <= blocks[i].open - blocks[i].openSize + bird.size/2\n \t\t | bird.y >= blocks[i].open + blocks[i].openSize - bird.size/2 ) ) {\n\t\tgameover();\n \t\t}\n\t}\n\t//bird fall to the ground \n\tif (bird.y > height-10\n\t\t) {\n\t\tgameover();\n\t\t}\n}", "title": "" }, { "docid": "82557f9c345b60e9dd1a52595ca68d36", "score": "0.683426", "text": "function collide(r1, r2, s1, s2) {\r\n if (r1 > s1 && r1 < s2) {\r\n return(s2 - r1);\r\n } else if (r2 > s1 && r2 < s2) {\r\n return(s1 - r2);\r\n }\r\n return(0);\r\n}", "title": "" }, { "docid": "73e2ed32f62cefba9af927983b6c1e0f", "score": "0.68300873", "text": "handleCollision() {\n }", "title": "" }, { "docid": "9383eac13f6d7a8b34948f1133b96e8c", "score": "0.6827515", "text": "function isInCollision(obj1, obj2) {\n if (obj1.x < obj2.x + obj2.width &&\n obj1.x + obj1.width > obj2.x &&\n obj1.y < obj2.y + obj2.height &&\n obj1.y + obj1.height > obj2.y) {\n obj1.isColliding = true;\n obj2.isColliding = true;\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "7fa456fa893ef73b16a4869ada0e3c53", "score": "0.6825448", "text": "static abSatCollision (\n { \n aX, aY, aRotation, aWidth = null, aHeight = null, aSides = null, \n aRadius = null, aIsRect = false, bX, bY, bRotation, bWidth = null, \n bHeight = null, bSides = null, bRadius = null, bIsRect = false,\n } = {}, \n drawCollider = false, \n ) {\n const aAxis = this.instance._getAxis(aX, aY, aRotation, aWidth, aHeight, aIsRect, aRadius, aSides);\n const bAxis = this.instance._getAxis(bX, bY, bRotation, bWidth, bHeight, bIsRect, bRadius, bSides);\n for (let i = 0; i < aAxis.length; i++) {\n const aa = aAxis[i];\n const ab = aAxis[i ? i - 1 : aAxis.length - 1];\n if (drawCollider) Canvas.createLine({ fromX: aa.x, fromY: aa.y, toX: ab.x, toY: ab.y, color: 'green' });\n for (let j = 0; j < bAxis.length; j++) {\n const ba = bAxis[j];\n const bb = bAxis[j ? j - 1 : bAxis.length - 1];\n if (this.lineCollision(aa.x, aa.y, ab.x, ab.y, ba.x, ba.y, bb.x, bb.y)) {\n return { \n a: { axisA: aa, axisB: ab },\n b: { axisA: ba, axisB: bb }\n };\n }\n }\n }\n return;\n }", "title": "" }, { "docid": "c6a15b67dfaf4db1ab0d05c96cceebf0", "score": "0.6809849", "text": "detectCollision(x_center, y_center) {\n this.flowers.forEach((item, index) => {\n let coinX1 = item.x - this.defaultFlowerHotSize;\n let coinX2 = item.x + this.defaultFlowerHotSize;\n let coinY1 = item.y - this.defaultFlowerHotSize;\n let coinY2 = item.y + this.defaultFlowerHotSize;\n\n if ((x_center >= coinX1 && x_center <= coinX2) && (y_center >= coinY1 && y_center < coinY2)) {\n if (item.exitFlower) {\n this.numberOfExitFlowers--;\n this.foundExitFlowers++;\n if (this.playSound) {\n this.audioSource2.play();\n }\n } else {\n this.numberOfFlowers--;\n this.foundFlowers++;\n if (this.playSound) {\n this.audioSource1.play();\n }\n }\n\n this.levelManager.addPoints(item.value);\n this.flowers.splice(index, 1);\n }\n })\n }", "title": "" }, { "docid": "6cba4ea07197ab066fc97e3ead4dd100", "score": "0.68044263", "text": "checkCollision(e)\n {\n var collides = false;\n\n if (this.x < e.x + e.width &&\n this.x + this.width > e.x &&\n this.y < e.y + e.height &&\n this.height + this.y > e.y)\n {\n collides = true;\n }\n else\n {\n collides = false;\n }\n\n return collides;\n }", "title": "" }, { "docid": "3ae964de0bfd0a254e5628cfd52024db", "score": "0.6791616", "text": "playerAndWallsCollision() {\n this.collision= [];\n for(let i =0; i < this.game.walls.allWalls.length; i++) {\n let dx=(this.x + 47 /2)-(this.game.walls.allWalls[i].x + 16/2);\n let dy=(this.y + 47 /2) - (this.game.walls.allWalls[i].y + 16 /2);\n let width=(47 + 16) / 2;\n let height=(47 + 16) / 2;\n let crossWidth=width*dy;\n let crossHeight=height*dx;\n if(Math.abs(dx)<=width && Math.abs(dy)<=height){\n if(crossWidth>crossHeight){\n this.collision.push((crossWidth>(-crossHeight))?{side:1 ,place:this.game.walls.allWalls[i].y + 16 }:{side:2 ,place:this.game.walls.allWalls[i].x - 48 });\n }else{\n this.collision.push((crossWidth>-(crossHeight))? {side:3 ,place:this.game.walls.allWalls[i].x + 16 } : {side:4 ,place:this.game.walls.allWalls[i].y -48 });\n } \n }\n }\n return this.collision;\n}", "title": "" }, { "docid": "a18aa7b1b6bdb1b6ba3130a2e179bbe5", "score": "0.6773935", "text": "static collision(player, ladder) {\n let x = -1;\n let y = -1;\n\n for(let j = 0; j < 4; j++) { // four corners to check for each sprite\n switch(j) {\n case 0:\n x = player.x;\n y = player.y;\n break;\n case 1:\n x = player.x + 48 * player.size;\n y = player.y;\n break;\n case 2:\n x = player.x + 48 * player.size;\n y = player.y + 48 * player.size;\n break;\n case 3:\n x = player.x;\n y = player.y + 48 * player.size;\n break;\n }\n \n if(x >= ladder.x && x <= ladder.x + 48 * player.size) { // within x bounds\n if(y >= ladder.y && y <= ladder.y + 48 * player.size) { // and within y bounds\n ml.logger.debug(`Player at (${player.x}, ${player.y}) collided with ladder at (${ladder.x}, ${ladder.y})`, ml.tags.ladder);\n return true;\n }\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "f21ee0b9f9036f5b2c9fde9d2fa67a87", "score": "0.67696506", "text": "function collision(r1, r2) {\n return !(r2.left > r1.right\n || r2.right < r1.left\n || r2.top > r1.bottom\n || r2.bottom < r1.top);\n}", "title": "" }, { "docid": "3bd6e1ed7894055b555bb7f6d9883eaa", "score": "0.67691714", "text": "function checkCollisions(){\n allEnemies.forEach(function(enemy){\n if (player.y === enemy.y &&\n player.x < enemy.x + 101 &&\n player.x + 101 > enemy.x){\n colision = true;\n }\n });\n }", "title": "" }, { "docid": "3bd6e1ed7894055b555bb7f6d9883eaa", "score": "0.67691714", "text": "function checkCollisions(){\n allEnemies.forEach(function(enemy){\n if (player.y === enemy.y &&\n player.x < enemy.x + 101 &&\n player.x + 101 > enemy.x){\n colision = true;\n }\n });\n }", "title": "" }, { "docid": "42df849646c4f27a9de679827cbe5b5b", "score": "0.6768582", "text": "function collisionDetection() {\n // for (let i = 0; i < obXCoors.length; i++) {\n // console.log(obXCoors[i])\n // if (player.x === obXCoors) {\n // console.log(\"hit\")\n // }\n // }\n // // console.log(player.x)\n // for (let i = 0; i < obXCoors.length; i++) {\n // let objLoc = obXCoors[i]\n // // console.log(obXCoors)\n // // if (player.x == objLoc && player.jumping == false) {\n // // console.log(\"player hit a brick\")\n // // }\n // let playerNoDecimal = Math.trunc(player.x)\n // if (playerNoDecimal === objLoc && player.jumping === false) {\n // console.log(\"player hit a brick\")\n // }\n\n // }\n\n if (health > 0) {\n\n // For loop to loop through the object locations, and if the player runs into one, deduct health\n for (let i = 0; i < obXCoors.length; i++) {\n let object = obXCoors[i];\n let playerNoDecimal = Math.trunc(player.x)\n // console.log(playerNoDecimal)\n if (playerNoDecimal == (object - 10) && player.jumping === false) {\n // console.log(\"hit\")\n health = health - 20\n // healthDisplay.textContent = `Your Health: ${health}`\n }\n\n }\n } else {\n\n const gradient = context.createLinearGradient(0, 500, 0, 0)\n gradient.addColorStop(0, \"black\")\n gradient.addColorStop(1, \"red\")\n context.fillStyle = gradient\n context.fillRect(0, 0, 800, 250)\n\n context.font = \"75px Arial\";\n context.fillStyle = \"white\"\n // context.textAlign = \"center\"\n context.fillText(\"GAME OVER\", 100, 150);\n\n\n }\n // console.log(obXCoors)\n\n // let playerNoDecimal = Math.trunc(player.x)\n // if (playerNoDecimal == obXCoors) {\n // console.log(\"player hit a brick\")\n // }\n\n // if (player.x == obXCoor) {\n // console.log(\"hit\")\n // }\n\n\n\n}", "title": "" }, { "docid": "660365dded1aceeba445d6113b058aa2", "score": "0.6765867", "text": "function collision($div1, $div2){\n var x1 = $div1.offset().left;\n var y1 = $div1.offset().top;\n var h1 = $div1.outerHeight(true);\n var w1 = $div1.outerWidth(true);\n var b1 = y1 + h1;\n var r1 = x1 + w1;\n var x2 = $div2.offset().left;\n var y2 = $div2.offset().top;\n var h2 = $div2.outerHeight(true);\n var w2 = $div2.outerWidth(true);\n var b2 = y2 + h2;\n var r2 = x2 + w2;\n\n if (b1 < y2 || y1 > b2 || r1 < x2 || x1 > r2) return false;\n return true;\n }", "title": "" }, { "docid": "e02a0d8a09774fd0b3d875d8f647c083", "score": "0.67551166", "text": "function collision(objA, objB) {\n objA_center = objA.getAnchor();\n objB_center = objB.getAnchor();\n x_axis = objA.image.width/2 + objB.image.width/2;\n y_axis = objA.image.height/2 + objB.image.height/2;\n if(x_axis <= getDistance(objA_center[0], 0, objB_center[0], 0) || y_axis <= getDistance(0, objA_center[1], 0, objB_center[1])) {\n return false;\n } else return true;\n}", "title": "" }, { "docid": "3e7b61186e85d20e3e14db4ccf683410", "score": "0.6751421", "text": "function collisions(){\r\n \t/*hero floor*/\r\n \tif(hero.yPosition + hero.objectHeight > stageHeight){\r\n \t\thero.yPosition -= hero.yVelocity * 0.75;\r\n \t\thero.yVelocity = 0;\r\n \t\thero.inAir = false;\r\n \t}\r\n \t/*Hero level*/\r\n \tfor(var i=0; i<levelArray.length; i++){\r\n \t\tapplyCollision(seperatingAxis(hero,levelArray[i]));\r\n \t}\r\n}", "title": "" }, { "docid": "a6caebefeb40abc650c1c981725f183f", "score": "0.6750564", "text": "function checkCollide(){\n\tvar number = -1;\n\tfor(var i=0;i<rects.length;i++){\n\t\tif(rects[i].centerX < 0){\n\t\t\tcontinue;\n\t\t}\n\t\tif(ball.centerX > (rects[i].centerX - rectWidth / 2 )\n\t\t\t&& ball.centerX < (rects[i].centerX + rectWidth / 2)\n\t\t\t&& ball.centerY > (rects[i].centerY - rectHeight / 2 - ball.radius)\n\t\t\t&& ball.centerY < (rects[i].centerY + rectHeight /2 + ball.radius)){\n\t\t\tnumber = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn number;\n}", "title": "" }, { "docid": "9074cc1a71b9dc1043c38abab89b6fa3", "score": "0.6749795", "text": "function collision($div1, $div2){\n var x1 = $div1.offset().left;\n var y1 = $div1.offset().top;\n var h1 = $div1.outerHeight(true);\n var w1 = $div1.outerWidth(true); \n var b1 = y1 + h1;\n var r1 = x1 + w1;\n var x2 = $div2.offset().left;\n var y2 = $div2.offset().top;\n var h2 = $div2.outerHeight(true);\n var w2 = $div2.outerWidth(true);\n var b2 = y2 + h2;\n var r2 = x2 + w2;\n\n if(b1 < y2 || y1 > b2 || r1 < x2 || x1 > r2) return false;\n return true;\n \n }", "title": "" }, { "docid": "e471862d488085c18379f0cff39964ea", "score": "0.67485", "text": "collision() {\n\t\tfor (var proj of this.projs) {\n\t\t\tfor (var ship of this.actors.concat(this.player)) {\n\t\t\t\tif (proj.type.type == \"guided\" && ship != proj.target) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (proj.sender.ai.govt && ship.ai.govt\n\t\t\t\t\t&& proj.sender.ai.govt == ship.ai.govt) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( ship.className == 'Ship' && proj.sender !== ship) { // can't shoot self\n\t\t\t\t\tvar dist = Vector.distance(proj.x, proj.y, ship.x, ship.y);\n\t\t\t\t\tif (dist < 20) {\n\t\t\t\t\t\tship.hit(proj);\n\t\t\t\t\t\tproj.die();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "a721624730a7e458f7e69eaea98d34d9", "score": "0.6742668", "text": "function collision($div1, $div2) {\n var x1 = $div1.offset().left;\n var y1 = $div1.offset().top;\n var h1 = $div1.outerHeight(true);\n var w1 = $div1.outerWidth(true);\n var b1 = y1 + h1;\n var r1 = x1 + w1;\n var x2 = $div2.offset().left;\n var y2 = $div2.offset().top;\n var h2 = $div2.outerHeight(true);\n var w2 = $div2.outerWidth(true);\n var b2 = y2 + h2;\n var r2 = x2 + w2;\n\n return !(b1 < y2 || y1 > b2 || r1 < x2 || x1 > r2);\n}", "title": "" }, { "docid": "1b412cd1874aea93fa143d563167078a", "score": "0.6742124", "text": "function collide() {\n\t\tfor (var k = 0, iterations = 4, strength = 0.5; k < iterations; ++k) {\n\t\t\tfor (var i = 0, n = nodes.length; i < n; ++i) {\n\t\t\t\tfor (var a = nodes[i], j = i + 1; j < n; ++j) {\n\t\t\t\t\tvar b = nodes[j],\n\t\t\t\t\tx = a.x + a.vx - b.x - b.vx,\n\t\t\t\t\ty = a.y + a.vy - b.y - b.vy,\n\t\t\t\t\tlx = Math.abs(x),\n\t\t\t\t\tly = Math.abs(y),\n\t\t\t\t\tr = a.r + b.r;\n\t\t\t\t\tif (lx < r && ly < r) {\n\t\t\t\t\t\tif (lx > ly) {\n\t\t\t\t\t\t\tlx = (lx - r) * (x < 0 ? -strength : strength);\n\t\t\t\t\t\t\ta.vx -= lx, b.vx += lx;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tly = (ly - r) * (y < 0 ? -strength : strength);\n\t\t\t\t\t\t\ta.vy -= ly, b.vy += ly;\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": "c66e60a0d878b41dff20be4386dddbdf", "score": "0.67371196", "text": "function detectCollision(playerX, playerY, objectX, objectY, type) {\n let radius = 0;\n\n if (type === \"good\") {\n radius = goodThing.radius;\n } else {\n radius = enemy.radius;\n }\n\n //https://developer.mozilla.org/en-US/docs/Games/Techniques/2D_collision_detection\n if (playerX < objectX + radius &&\n playerX + player.size + radius > objectX &&\n playerY < objectY + radius &&\n playerY + player.size > objectY) {\n //collision\n console.log(\"hit\");\n if (type === \"good\") {\n score = score + 5;\n console.log(\"good thing hit\");\n } else {\n lives--;\n if (lives === 0) {\n gameOver = true;\n }\n console.log(lives);\n }\n return true;\n }\n}", "title": "" }, { "docid": "c4ebe1fcc6cd3c4375a3cd636b6b1067", "score": "0.6726579", "text": "function collision($div1, $div2){\n var x1 = $div1.offset().left;\n var y1 = $div1.offset().top;\n var h1 = $div1.outerHeight(true);\n var w1 = $div1.outerWidth(true);\n var b1 = y1 + h1;\n var r1 = x1 + w1;\n var x2 = $div2.offset().left;\n var y2 = $div2.offset().top;\n var h2 = $div2.outerHeight(true);\n var w2 = $div2.outerWidth(true);\n var b2 = y2 + h2;\n var r2 = x2 + w2;\n\n if (b1 < y2 || y1 > b2 || r1 < x2 || x1 > r2) return false;\n return true;\n }", "title": "" } ]
4a29a7cc64c057cdd6c06818c704ab4d
parallelExecMosaic Expected to be called, with the Mosaic instance as the context (`this` needs to bound to the Mosaic instance). This uses web workers.
[ { "docid": "b181f567e8fdaa55fa1bd3b4bf15a440", "score": "0.7797801", "text": "function parallelExecMosaic() {\n var self = this;\n var rowsDone = 0;\n var WORKER_COUNT = window.WORKER_COUNT\n\n // divide tile-rows among all worker instances\n for (var i = 0; i < WORKER_COUNT; i++) {\n var worker = initWorker(\"/js/img-tools-worker.js\");\n worker.mosaicInstance = self;\n\n // num of tile-rows for the current worker\n var rowsInIter = (i !== WORKER_COUNT - 1 ? Math.floor((self.maxY + 1) / WORKER_COUNT) :\n (Math.floor((self.maxY + 1) / WORKER_COUNT) + (self.maxY + 1) % WORKER_COUNT));\n\n // worker payload\n var tileTaskArr = [];\n\n // iterate through those tile-rows and construct the payload for the worker\n for (var q = rowsDone; q < rowsDone + rowsInIter; q++) {\n for (var p = 0; p <= self.maxX; p++) {\n\n var tileImgData = self.getTileDataAt(p, q);\n if (tileImgData) {\n tileImgData = tileImgData.data;\n tileTaskArr.push({\n tileImgData: tileImgData,\n x: p,\n y: q\n });\n }\n }\n }\n\n // the cpu intensive process of computing avgTileColor will done inside a worker\n worker.postMessage({\n tileArr: tileTaskArr\n });\n // increment the num of rows sent away as payload.\n rowsDone += rowsInIter;\n }\n }", "title": "" } ]
[ { "docid": "d1377447f187615c6ab198822f8777ab", "score": "0.59864646", "text": "function simpleExecMosaic() {\n var self = this;\n var rowsDone = 0;\n\n var handler = function(x, y) {\n var tileImgData = self.getTileDataAt(x, y);\n if (tileImgData) {\n\n tileImgData = tileImgData.data;\n \n // mocking worker-postMessage..\n messageHandler.call({\n mosaicInstance: self\n }, {\n data: {\n svgUrl: getSvgUrl(tileImgData, x, y),\n x: x,\n y: y\n }\n });\n }\n };\n\n for (var j = 0; j <= self.maxY; j++) {\n for (var i = 0; i <= self.maxX; i++) {\n handler(i, j);\n }\n }\n }", "title": "" }, { "docid": "35a309948e1dd6ba760d2e1e885945d3", "score": "0.5667573", "text": "run() {\n this.forkWorkers()\n }", "title": "" }, { "docid": "c5d5cb8f0d169aaad14a1e08076c772a", "score": "0.5625964", "text": "run() {\n const workForever = (id) => {\n logger.info('Starting worker %s', id);\n\n const config = deepCopy(this.config);\n\n config.workdir = Path.join(this.config.workdir, `${id}`);\n\n if (this.stopped) {\n return id;\n }\n\n return this.pool.exec('work', [config])\n .then(() => {\n logger.info('Worker %s exited gracefully', id);\n return id;\n })\n .catch((error) => {\n logger.error('Worker %s died...', id, error);\n return workForever(id);\n });\n };\n\n const ids = Array.from(Array(this.processes).keys());\n\n // offload a function to a worker\n return Promise.map(ids, workForever)\n .then(() => logger.info('All workers finished'))\n .then(() => this.pool.terminate());\n }", "title": "" }, { "docid": "cef44d4673de54b2b190ab77c538c4d2", "score": "0.55570734", "text": "parallelExecute() {\n if (this.state === BatchStates.Error) {\n return;\n }\n if (this.completed >= this.operations.length) {\n this.emitter.emit(\"finish\");\n return;\n }\n while (this.actives < this.concurrency) {\n const operation = this.nextOperation();\n if (operation) {\n operation();\n }\n else {\n return;\n }\n }\n }", "title": "" }, { "docid": "cef44d4673de54b2b190ab77c538c4d2", "score": "0.55570734", "text": "parallelExecute() {\n if (this.state === BatchStates.Error) {\n return;\n }\n if (this.completed >= this.operations.length) {\n this.emitter.emit(\"finish\");\n return;\n }\n while (this.actives < this.concurrency) {\n const operation = this.nextOperation();\n if (operation) {\n operation();\n }\n else {\n return;\n }\n }\n }", "title": "" }, { "docid": "70f4783221874372319756d7f0e34302", "score": "0.5234451", "text": "async _run() {\n const jobsCount = TaskQueue.count(this.inMemoryOnly)\n const hasJobs = jobsCount > 0\n const wantedWorkers = Math.min(this._cpus, jobsCount)\n const availableWorkers = this._getAvailableWorkers(wantedWorkers)\n await this._dispatchJobs(availableWorkers)\n }", "title": "" }, { "docid": "74a93085a8ee3ae201a6b6c869d89b97", "score": "0.5109749", "text": "runWorkers () {\n }", "title": "" }, { "docid": "5405b440548215e9e093aa42365a5f93", "score": "0.50405", "text": "forkWorkers() {\n for (var i = 0; i < this.numWorkers; i++) {\n this.requestNewWorker()\n }\n }", "title": "" }, { "docid": "285189cdb4412988f56ce0e066d72805", "score": "0.50346947", "text": "createProcesses() {\n Object.keys(this.workers).forEach(type => {\n const env = {\n 'type': type,\n 'verbose': config.verbose,\n };\n this.workers[type] = this.fork(type, env);\n });\n }", "title": "" }, { "docid": "99beeed91ab466bca3c4c19e839c28b1", "score": "0.5033371", "text": "function _parallelUploadTest(resize) {\n\t\tvar fileIndex = 0, numComplete = 0, uploadObj = uploadStart(\"parallelUploadTest\");\n\t\tuploadSetNumFiles(uploadObj, filesToUpload.length);\n\t\t\n\t\tvar runUpload = function(currentFile) {\n\t\t\tvar fileObj = fileStart(uploadObj, currentFile, fileIndex++);\n\t\t\tfileUploadStart(uploadObj, fileObj);\n\n\t\t\tBrowserPlus.FileTransfer.upload({\n\t\t\t\tfiles: { \"file\": currentFile },\n\t\t\t\turl: UPLOAD_URL,\n\t\t\t\tprogressCallback: function(p) {\n\t\t\t\t\tfileUploadProgress(uploadObj, fileObj, p);\n\t\t\t\t}\n\t\t\t}, function(r) {\n\t\t\t\tfileUploadEnd(uploadObj, fileObj);\n\t\t\t\t// are we all done!?\n\t\t\t\tnumComplete += 1;\n\t\t\t\tif (numComplete == filesToUpload.length) {\n\t\t\t\t\tuploadEnd(uploadObj);\n\t\t\t\t\tstartNextUploadTest();\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n if (resize === RESIZE_YES) {\n\t\t resizeImages(function(files) {\n for (var i = 0; i < files.length; i++) {\n\t\t\t runUpload(files[i]);\n\t\t }\n\t });\n } else {\n for (var i = 0; i < filesToUpload.length; i++) {\n runUpload(filesToUpload[i]);\n }\n }\n\t}", "title": "" }, { "docid": "ca797a9a6e842cadfca2ee5fea38825f", "score": "0.49535385", "text": "function parallel() {\n var tasks = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n tasks[_i] = arguments[_i];\n }\n // tslint:disable-next-line:no-null-keyword\n var flattenTasks = _flatten(tasks).filter(function (task) { return task !== null && task !== undefined; });\n for (var _a = 0, flattenTasks_1 = flattenTasks; _a < flattenTasks_1.length; _a++) {\n var task_3 = flattenTasks_1[_a];\n _trackTask(task_3);\n }\n return {\n // tslint:disable-next-line:no-any\n execute: function (buildConfig) {\n return new Promise(function (resolve, reject) {\n var promises = [];\n for (var _i = 0, flattenTasks_2 = flattenTasks; _i < flattenTasks_2.length; _i++) {\n var task_4 = flattenTasks_2[_i];\n promises.push(_executeTask(task_4, buildConfig));\n }\n // Use promise all to make sure errors are propagated correctly\n Promise.all(promises).then(resolve, reject);\n });\n }\n };\n}", "title": "" }, { "docid": "f151151b86697f6b323df5d95c320569", "score": "0.49285197", "text": "async runIteration() {\n let workerTypes = this.loadWorkerTypes();\n\n await Promise.all(this.managers.map(manager => {\n return manager.preIterationCleanup(workerTypes);\n }));\n\n let requests = await Promise.all(workerTypes.map(this.determineRequests));\n\n let submissions = await Promise.all(requests.map(this.submitRequests));\n\n await Promise.all(this.managers.map(manager => {\n return manager.postIterationCleanup(workerTypes);\n }));\n }", "title": "" }, { "docid": "44295e11044c5172cb2e86a2b3737216", "score": "0.49180698", "text": "function WorkerPool(script) {\n // The level of concurrency, or, the number of web\n // workers to create. This uses the\n // \"hardwareConcurrency\" property if it exists.\n // Otherwise, it defaults to 4, since this is\n // a reasonable guess at the most common CPU topology.\n var concurrency = navigator.hardwareConcurrency || 4;\n // The worker instances themselves are stored in a Map,\n // as keys. We'll see why in a moment.\n var workers = (this.workers = new Map());\n // The queue exists for messages that are posted while,\n // all workers are busy. So this may never actually be\n // used.\n var queue = (this.queue = []);\n // Used below for creating the worker instances, and\n // adding event listeners.\n var worker;\n for (var i = 0; i < concurrency; i++) {\n worker = new Worker(script);\n worker.addEventListener(\n \"message\",\n function(e) {\n // We use the \"get()\" method to lookup the\n // \"resolve()\" function of the promise. The\n // worker is the key. We call the resolver with\n // the data returned from the worker, and\n // can now reset this to null. This is important\n // because it signifies that the worker is free\n // to take on more work.\n workers.get(this)(e.data);\n workers.set(this, null);\n // If there's queued data, we get the first\n // \"data\" and \"resolver\" from the queue. Before\n // we call \"postMessage()\" with the data, we\n // update the \"workers\" map with the new\n // \"resolve()\" function.\n if (queue.length) {\n var [data, resolver] = queue.shift();\n workers.set(this, resolver);\n this.postMessage(data);\n }\n }.bind(worker)\n );\n // This is the initial setting of the worker, as a\n // key, in the \"workers\" map. It's value is null,\n // meaning there's no resolve function, and it can\n // take on work.\n this.workers.set(worker, null);\n }\n }", "title": "" }, { "docid": "9d45be4b4996a96d1f6027b125ee54f1", "score": "0.49090323", "text": "async function runMediasoupWorkers()\n{\n\tconst { numWorkers } = config.mediasoup;\n\n\tlogger.info('running %d mediasoup Workers...', numWorkers);\n\n\tfor (let i = 0; i < numWorkers; ++i)\n\t{\n\t\tconst worker = await mediasoup.createWorker(\n\t\t\t{\n\t\t\t\tlogLevel : config.mediasoup.workerSettings.logLevel,\n\t\t\t\tlogTags : config.mediasoup.workerSettings.logTags,\n\t\t\t\trtcMinPort : Number(config.mediasoup.workerSettings.rtcMinPort),\n\t\t\t\trtcMaxPort : Number(config.mediasoup.workerSettings.rtcMaxPort)\n\t\t\t});\n\n\t\tworker.on('died', () =>\n\t\t{\n\t\t\tlogger.error(\n\t\t\t\t'mediasoup Worker died, exiting in 2 seconds... [pid:%d]', worker.pid);\n\n\t\t\tsetTimeout(() => process.exit(1), 2000);\n\t\t});\n\n\t\tmediasoupWorkers.push(worker);\n\n\t\t// Create a WebRtcServer in this Worker.\n\t\tif (process.env.MEDIASOUP_USE_WEBRTC_SERVER !== 'false')\n\t\t{\n\t\t\t// Each mediasoup Worker will run its own WebRtcServer, so those cannot\n\t\t\t// share the same listening ports. Hence we increase the value in config.js\n\t\t\t// for each Worker.\n\t\t\tconst webRtcServerOptions = utils.clone(config.mediasoup.webRtcServerOptions);\n\t\t\tconst portIncrement = mediasoupWorkers.length - 1;\n\n\t\t\tfor (const listenInfo of webRtcServerOptions.listenInfos)\n\t\t\t{\n\t\t\t\tlistenInfo.port += portIncrement;\n\t\t\t}\n\n\t\t\tconst webRtcServer = await worker.createWebRtcServer(webRtcServerOptions);\n\n\t\t\tworker.appData.webRtcServer = webRtcServer;\n\t\t}\n\n\t\t// Log worker resource usage every X seconds.\n\t\tsetInterval(async () =>\n\t\t{\n\t\t\tconst usage = await worker.getResourceUsage();\n\n\t\t\tlogger.info('mediasoup Worker resource usage [pid:%d]: %o', worker.pid, usage);\n\t\t}, 120000);\n\t}\n}", "title": "" }, { "docid": "c2beec257b61d3b329191ff006583009", "score": "0.48582864", "text": "isProcessableParallel() {\n return false;\n }", "title": "" }, { "docid": "d2f57727e392ed98b3b4de3d79e8046d", "score": "0.4801759", "text": "async function parallelcalculation() {\n var jobs = [];\n\n var j1 = current.value;\n var j2 = stepSize.value;\n var j = parseFloat(j1) + parseFloat(j2);\n\n while (j < maxWindow) {\n jobs.push(j - 1);\n j = j + parseFloat(stepSize.value);\n }\n\n var k = parseFloat(j1) - parseFloat(j2);\n while (k > 0) {\n jobs.push(k - 1);\n k = k - parseFloat(stepSize.value);\n }\n\n for (var i = 0; i < maxWindow; i++) {\n jobs.push(i);\n }\n\n let results = jobs.map(async (job) => await calculateCorrelation(job, windowSize.value));\n /* for (const result of results) {\n finalResults.push(await result);\n }*/\n }", "title": "" }, { "docid": "51ec35e73b943d6205787706512dc9ae", "score": "0.478728", "text": "function masterProcess() {\n console.log('Master %s is running', process.pid);\n\n /**\n * Creating workers in same number as number of cores the running machine is.\n */\n for (let i = 0; i < numCPUs; i++) {\n console.log('Forking process number ... %s.....%s', i, process.pid);\n /**\n * cluster.fork() to create worker, which is a based on child process fork() functionality \n */\n cluster.fork();\n }\n\n /**\n * Event Handler which fires everytime a new worker created. \n */\n cluster.on('online', (worker) => {\n console.log('Worker ' + worker.process.pid + ' is online');\n });\n\n /**\n * Event Handler which fires everytime a worker/process is exit or disconnected.\n */\n cluster.on('exit', (worker) => {\n console.log('The worker has exit..%s', worker.id);\n /**\n * Creating a new worker \n */\n cluster.fork();\n });\n}", "title": "" }, { "docid": "f8016358ca24ca0ed9319ae79d51592b", "score": "0.4773753", "text": "function spawn(i){\n workers[i] = cluster.fork();\n\n workers[i].on('exit', (code, signal) => {\n spawn(i);\n });\n }", "title": "" }, { "docid": "b177776e3dfc6202d62fb595bb52e0b7", "score": "0.47277924", "text": "function ejecutar(){\n Concurrent.Thread.create(caballo,\"inputCaballo1\",\"metrosRecorridos1\",100000);\n Concurrent.Thread.create(caballo,\"inputCaballo2\",\"metrosRecorridos2\",100000);\n Concurrent.Thread.create(caballo,\"inputCaballo3\",\"metrosRecorridos3\",100000);\n }", "title": "" }, { "docid": "c5b4f96fbe22f2f77ef66bfc73e87795", "score": "0.4699808", "text": "createWorkers(){\n\n //Guardo la estructura de procesos en una matriz [workerId][gidRequest].\n for (let i = 0; i <= config.workers-1; i++)\n cluster.fork();\n \n for (const id in cluster.workers){\n\n //Agrego handler.\n cluster.workers[id].on('message',this.onChildMsg);\n \n //Armo el id del proceso.\n const workerId = this.getWorkerId(id,cluster.workers[id].process.pid);\n\n //Guardo el worker.\n db.saveProcess(workerId);\n \n //Agrego property.\n cluster.workers[id].idWorker = workerId;\n\n }\n\n }", "title": "" }, { "docid": "9c402e26d394de0e9366693779314b7c", "score": "0.46955475", "text": "function WorkerPool( script ) {\n\t\tvar SELF = this,\n\t\t\tqueue_running = false,\n\t\t\tworking_workers = 0,\n\t\t\tworkers = [],\n\t\t\tjobs = [];\n\n\t\tfunction run_job( e, worker ) {\n\t\t\tif ( undefined === worker ) {\n\t\t\t\tworker = get_worker();\n\t\t\t}\n\n\t\t\tworking_workers -= 1;\n\t\t\tworking_workers = Math.max( working_workers, 0 );\n\n\t\t\tif ( jobs.length > 0 && ! worker ) {\n\t\t\t\twindow.console.log( 'no worker' );\n\t\t\t\tsetTimeout( run_job, 1 );\n\t\t\t\treturn;\n\t\t\t} else if ( jobs.length > 0 ) {\n\t\t\t\tvar job = jobs.pop();\n\t\t\t\tworking_workers++;\n\t\t\t\tworker.postMessage( job );\n\t\t\t} else if ( 0 === working_workers) {\n\t\t\t\t// All jobs done\n\t\t\t\tqueue_running = false;\n\t\t\t\t$document.trigger( 'menehune.complete' );\n\n\t\t\t\t// Respawn workers\n\t\t\t\t//SELF.spawn( workers.length );\n\t\t\t}\n\t\t}\n\n\t\t$document.on( 'menehune.available', run_job );\n\n\t\t/**\n\t\t * Get the next available worker.\n\t\t *\n\t\t * @returns {Menehune|bool} False if no workers available.\n\t\t */\n\t\tfunction get_worker() {\n\t\t\tfor ( var i = 0, l = workers.length; i < l; i ++ ) {\n\t\t\t\tif ( workers[i].available ) {\n\t\t\t\t\treturn workers[i];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\t/**\n\t\t * Add a new job to the worker queue.\n\t\t *\n\t\t * @param {object} job\n\t\t */\n\t\tSELF.do = function ( job ) {\n\t\t\tjobs.push( job );\n\t\t};\n\n\t\t/**\n\t\t * Process all queued jobs. When complete, fire the passed-in callback.\n\t\t *\n\t\t * @param {function} callback\n\t\t */\n\t\tSELF.runQueue = function ( callback ) {\n\t\t\tif ( queue_running ) {\n\t\t\t\tthrow 'Queue is already running!';\n\t\t\t}\n\n\t\t\tqueue_running = true;\n\n\t\t\tfor ( var i = 0, l = workers.length; i < l; i++ ) {\n\t\t\t\trun_job();\n\t\t\t}\n\n\t\t\t$document.off( 'menehune.return' );\n\t\t\t$document.on( 'menehune.return', function ( e, data ) {\n\t\t\t\tworking_workers--;\n\n\t\t\t\tcallback.apply( this, [ data ] );\n\t\t\t} );\n\t\t};\n\n\t\t/**\n\t\t * Set up common (i.e. global) data and constants for all worker objects.\n\t\t *\n\t\t * @param {object} data\n\t\t */\n\t\tSELF.setCommonData = function ( data ) {\n\t\t\tfor ( var i = 0, l = workers.length; i < l; i++ ) {\n\t\t\t\tvar worker = workers[i];\n\n\t\t\t\tworker.postMessage( {\n\t\t\t\t\tjob: 'setData',\n\t\t\t\t\tdata: data\n\t\t\t\t} );\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Spawn a certain number of workers.\n\t\t *\n\t\t * @param {number} number\n\t\t */\n\t\tSELF.spawn = function( number ) {\n\t\t\tnumber = number || 1;\n\n\t\t\t// First, kill all the workers!\n\t\t\tSELF.kill();\n\n\t\t\tfor ( var i = 0; i < number; i++ ) {\n\t\t\t\tworkers.push( new Minion( script ) );\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * Kill all the workers\n\t\t */\n\t\tSELF.kill = function() {\n\t\t\twhile( workers.length > 0 ) {\n\t\t\t\tvar worker = workers.pop();\n\n\t\t\t\tworker.terminate();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "5b2c466c4efc3c0f9ea84897978458c8", "score": "0.46839184", "text": "function startBenchmark() {\n while(numberOfRunningInstances != 0){\n workOnTasks();\n setRunningProcessInstances();\n }\n}", "title": "" }, { "docid": "bedfa7e70eeb9cf19b92cd94a2d34128", "score": "0.46693337", "text": "function Parallel(task) {\n var callbacks = {};\n return function(args, next) {\n var id = JSON.stringify(args)\n if (callbacks[id]) {\n return callbacks[id].push(next);\n }\n callbacks[id] = [\n next\n ];\n task(args, function() {\n var args = arguments;\n $.each(callbacks[id], function(i, next) {\n next.apply(null, args);\n });\n delete callbacks[id];\n });\n };\n}", "title": "" }, { "docid": "a714dc433d3857aecc464f3aa1fa408f", "score": "0.4659545", "text": "initiate(url){\n console.log(`\\nKicking off with base url ${url} \\n`);\n \n //create workers\n for(let i=0; i<maxConcurrent; i++){\n let worker = new Worker();\n this.workers.set(worker, IDLE);\n }\n\n //start distributing\n this.pushToTaskQueue([url]);\n this.distribute();\n }", "title": "" }, { "docid": "b52b716a89f95c9ef45c72a42abafaf6", "score": "0.46423405", "text": "function startWorker(){\n for(var i = 0; i < WORKER_NUMBER; i++){\n var c = cp.fork(WORKER_PATH);\n childMng.push(c);\n }\n output('start workers: ' + WORKER_NUMBER);\n/*\n setInterval(function(){\n inspect(childMng.getStatus());\n childMng.updateStatus();\n },WORKER_HEART_BEAT);\n */\n}", "title": "" }, { "docid": "34294f2c0bbd0f7129efc777e3d9e8ba", "score": "0.4607485", "text": "function parallel() {\n var _this3 = this;\n\n var config = this.config,\n URLs = this.URLs;\n var fetchOptions = config.fetchOptions,\n template = config.template,\n target = config.target;\n template = resolveToArray(template, URLs.length, 'template');\n target = resolveToArray(target, URLs.length, 'target');\n var method = fetchOptions.method || methods$1.GET;\n var requestPromises = URLs.map(function (URL, index) {\n return new Promise(function (resolve, reject) {\n doRequest(URL, method, fetchOptions).then(function (res) {\n return res.json();\n }).then(function (data) {\n renderAjaxData.apply(_this3, [template[index], target[index], data, resolve, reject]);\n })[\"catch\"](function (error) {\n renderError.apply(_this3, [_this3.templateMap[template[index]], target[index], error, reject]);\n });\n });\n });\n URLs.length = 0;\n return requestPromises;\n }", "title": "" }, { "docid": "3090477e0072431a831d4468f96557e7", "score": "0.4605221", "text": "async function mosaic() {\n const mosaicOutput = document.querySelector(\".mosaico-output\")\n const ctx = mosaicOutput.getContext(\"2d\")\n const loader = document.querySelector(\".loader\")\n const { data } = await axios.get(\"/api/urls\")\n const imagesUrls = Object.values(data).map(img => 'https://sonhospossiveistenda.com.br' + img.image)\n\n console.log(\"imagesUrls\", imagesUrls)\n\n let logo = \"images/nova-marca-tenda.jpg\"\n\n var totalRowsAndCols = Math.round(Math.sqrt(imagesUrls.length))\n\n console.log(\"imagesUrls.length: \", imagesUrls.length)\n console.log(\"totalRowsAndCols: \", totalRowsAndCols)\n\n const options = {\n rowsAndCols: totalRowsAndCols,\n squareAlpha: 10,\n squareEffect: \"soft-light\",\n hoverSize: 200,\n pixelated: true\n }\n\n const maxWidth = Math.min(1000, window.innerWidth)\n const generatedImage = new Image()\n\n let squareWidth = Math.ceil(maxWidth / options.rowsAndCols)\n let imgAspectRatio\n let samples\n let generatedImageSamples\n\n function reset() {\n ctx.clearRect(0, 0, mosaicOutput.width, mosaicOutput.height)\n ctx.drawImage(generatedImage, 0, 0)\n ctx.fillStyle = \"#F3F3F3\"\n }\n\n function number2hex(number) {\n const hex = number.toString(16)\n return (hex.length === 1 ? \"0\" : \"\") + hex\n }\n\n function getTileColors(image, size) {\n const canvas = document.createElement(\"canvas\")\n const context = canvas.getContext(\"2d\")\n\n canvas.width = size\n canvas.height = (size * image.height) / image.width\n\n context.drawImage(\n image,\n 0,\n 0,\n image.width,\n image.height,\n 0,\n 0,\n canvas.width,\n canvas.height\n )\n\n const data = Array.from(\n context.getImageData(0, 0, canvas.width, canvas.height).data\n )\n\n let colors = []\n\n for (let i = 0; i < data.length; i += 4) {\n colors[i / 4] = `rgba(${data[i]}, ${data[i + 1]}, ${\n data[i + 2]\n }, 1)`\n }\n\n return colors\n }\n\n function render() {\n loader.classList.add(\"active\")\n mosaicOutput.classList.remove(\"active\")\n generatedImageSamples = []\n\n const rowsAndCols = options.rowsAndCols\n const rowsAndCols_Y = (options.rowsAndCols_Y = Math.floor(\n rowsAndCols * imgAspectRatio\n ))\n\n squareWidth = Math.ceil(maxWidth / rowsAndCols)\n ctx.clearRect(0, 0, mosaicOutput.width, mosaicOutput.height)\n\n var colors = getTileColors(input, rowsAndCols)\n\n setTimeout(function () {\n for (var i = 0; i < rowsAndCols; i++) {\n for (var j = 0; j < rowsAndCols_Y; j++) {\n requestAnimationFrame(\n (function (i, j) {\n return () => {\n const x = i * squareWidth\n const y = j * squareWidth\n\n if (options.pixelated) {\n const color = colors[i + j * rowsAndCols]\n\n ctx.fillStyle = color\n ctx.fillRect(\n x,\n y,\n squareWidth,\n squareWidth\n )\n }\n\n ctx.globalAlpha = options.squareAlpha\n ctx.globalCompositeOperation = options.squareEffect\n\n const randomSample =\n samples[\n Math.floor(\n makeUniqueRandom(samples.length)\n )\n ]\n\n\n generatedImageSamples[\n i + j * rowsAndCols\n ] = randomSample\n\n ctx.drawImage(\n randomSample,\n x,\n y,\n squareWidth,\n squareWidth\n )\n\n ctx.globalCompositeOperation = \"source-over\"\n ctx.globalAlpha = 1\n\n if (\n i === rowsAndCols - 1 &&\n j === rowsAndCols_Y - 1\n ) {\n loader.classList.remove(\"active\")\n mosaicOutput.classList.add(\"active\")\n\n generatedImage.src = mosaicOutput.toDataURL()\n }\n }\n })(i, j)\n )\n }\n }\n }, 4)\n }\n\n function Asset(url) {\n return new Promise(function (resolve, reject) {\n const img = new Image()\n\n img.onload = () => resolve(img)\n img.onerror = () => reject(img)\n img.src = url\n })\n }\n\n const input = new Image()\n\n input.onload = () => {\n imgAspectRatio = input.height / input.width\n mosaicOutput.width = mosaicOutput.style.width = maxWidth\n mosaicOutput.height = mosaicOutput.style.height =\n Math.floor(options.rowsAndCols * imgAspectRatio) * squareWidth\n\n Promise.all(imagesUrls.map(Asset))\n .then(function (images) {\n samples = images\n\n render()\n\n mosaicOutput.addEventListener(\"mouseout\", function (e) {\n reset()\n })\n\n let diff = null\n mosaicOutput.addEventListener(\n \"mousemove\",\n function (e) {\n const x =\n Math.floor(e.offsetX / squareWidth) * squareWidth\n const y =\n Math.floor(e.offsetY / squareWidth) * squareWidth\n\n requestAnimationFrame(() => {\n reset()\n\n ctx.fillRect(\n x * squareWidth,\n y * squareWidth,\n squareWidth,\n squareWidth\n )\n\n const img =\n generatedImageSamples[\n x / squareWidth +\n (y / squareWidth) * options.rowsAndCols\n ]\n var hoverSize = options.hoverSize * 2\n\n ctx.fillStyle = \"#FFFFFF\"\n\n if (!img) {\n return\n }\n\n const ratio = hoverSize / squareWidth\n let diffY = (diff =\n ((1 - ratio) * squareWidth) / 2)\n\n if (\n x + diff + squareWidth * ratio >\n mosaicOutput.width\n ) {\n diff =\n mosaicOutput.width -\n squareWidth * ratio -\n x\n }\n\n if (x + diff < 0) {\n diff = -x\n }\n\n if (\n y + diff + squareWidth * ratio >\n mosaicOutput.height\n ) {\n diffY =\n mosaicOutput.height -\n squareWidth * ratio -\n y\n }\n\n if (y + diffY < 0) {\n diffY = -y\n }\n\n ctx.drawImage(\n img,\n x + diff,\n y + diffY,\n squareWidth * ratio,\n squareWidth * ratio\n )\n })\n },\n false\n )\n })\n .catch(console.error)\n }\n input.src = logo\n}", "title": "" }, { "docid": "e1d534c66dc21e8c44b70158c37f3377", "score": "0.46047366", "text": "function loadAsync() {\n\t\t\tvar funcs = [getScriptsFunc(scriptsToLoad), getImagesFunc(imagesToLoad)];\n\t\t\tasync.parallelLimit(funcs, maxThreads, function(err, result) {\n\t\t\t\tif (onDone) onDone(err);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "513a240beaff1c9cdc06228cbc6070c4", "score": "0.45918375", "text": "async function main() {\n\n\n const stubTasks = range(50).map(n => () => delay(500).then(() => `#${n} completed`))\n\n return runInParallel(stubTasks, 5, res => {console.log(res)})\n}", "title": "" }, { "docid": "805e02cb5a5f4cdaf755ea6c63f5e99c", "score": "0.45868707", "text": "function worker() {\n // deleting obsolete data\n executed = executed.filter(obj => obj.executedAt + 1000 > Date.now());\n\n // running available requests\n for (let q in queue) {\n // max 2 request in 1 sec. for one client\n if (queue.hasOwnProperty(q) && executed.filter(obj => obj.client === queue[q].client).length < 2) {\n // remember for control API restrictions\n executed.push({\n client: queue[q].client,\n executedAt: Date.now(),\n });\n // execute request\n queue[q].callback();\n // exclude repeated request\n queue[q] = null;\n }\n }\n\n // clear queue\n queue = queue.filter(obj => obj);\n setTimeout(worker, 300);\n}", "title": "" }, { "docid": "a2e149c82936126c67ed9fa3a03f2dc7", "score": "0.45826754", "text": "async function parallelize(operation, data, concurrency) {\n const results = [];\n let index = 0;\n const wrapper = async (i) => {\n results.push(await operation(data[i]));\n if (index < data.length) {\n await wrapper(index++);\n }\n };\n const promises = [];\n for (; index < data.length && index < concurrency; index++) {\n promises.push(wrapper(index));\n }\n await Promise.all(promises);\n return results;\n}", "title": "" }, { "docid": "0023d4c767059e9c3f354d50f941fc07", "score": "0.45783097", "text": "function h$run(a) {\n ;\n var t = h$fork(a, false);\n h$startMainLoop();\n return t;\n}", "title": "" }, { "docid": "14f4e5e84e3a7961c7bd9d4d1077c98b", "score": "0.45774472", "text": "function dedicatedWorkerTest(script)\n{\n var worker = new Worker(script);\n supportTestRunnerMessagesOnPort(worker);\n\n fetch_tests_from_worker(worker);\n}", "title": "" }, { "docid": "d9ca042e4410bade86741e4fbc127033", "score": "0.4556221", "text": "function h$run(a) {\n ;\n var t = h$fork(a, false);\n h$startMainLoop();\n return t;\n}", "title": "" }, { "docid": "89815c1fbe8e27b29a621be57097a74e", "score": "0.45557088", "text": "function coordinateWorkers(lines, onCompletion) {\n var cpuCount = os.cpus().length;\n var subResults = [];\n var completedWorkerCount = 0;\n\n // Split the lines into chunks that can be processed by each worker.\n var chunkedLines = chunkifier.chunkify(lines, cpuCount);\n var workerCount = chunkedLines.length;\n\n for (var i = 0; i < workerCount; i++) {\n\n // For each core/CPU (up to number of line chunks), create a new process in worker mode.\n var worker = cluster.fork();\n\n // Send the lines to be processed to the new worker.\n worker.send(chunkedLines[i]);\n\n worker.on('message', function workerFinished(workerResult) {\n // When a worker sends a message to the master, that worker has finished.\n worker.kill();\n completedWorkerCount++;\n if (workerResult.error !== null) {\n // An error occurred. Stop application and output error.\n endApplicationWithError(workerResult.error);\n }\n\n // Otherwise, add worker's data result to subResults\n subResults.push(workerResult.data);\n // If all the workers are finished, run the completion function.\n if (completedWorkerCount == workerCount) {\n onCompletion(subResults);\n }\n });\n }\n}", "title": "" }, { "docid": "93e5ecb944f0845e655bd9b89cf90243", "score": "0.45400345", "text": "function forkWorker() {\n\n var worker = cluster.fork();\n\n worker.on('message', function (msg) {\n\n if (msg.cmd) {\n\n if (msg.cmd == 'workerStarted') {\n\n runningWorkers++;\n\n if (runningWorkers === parseInt(totalWorkers)) {\n console.log(\"Calipso configured for: \".green + (global.process.env.NODE_ENV || 'development') + \" environment.\".green);\n console.log(\"Calipso server running \".green + runningWorkers + \" workers, listening on port: \".green + port);\n }\n\n }\n\n }\n\n });\n\n}", "title": "" }, { "docid": "644147acfa0bb1eeb8cd042e60a1ffad", "score": "0.4525489", "text": "async function distribute() {\n // Running Promises in parallel\n const listOfPromises = listOfOptions.map(asyncOperation);\n // Harvesting\n return await Promise.all(listOfPromises);\n}", "title": "" }, { "docid": "968752fe345e073670f4302efc02c538", "score": "0.45246375", "text": "function multitask() {\n\n // Merge task-specific and/or target-specific options with these defaults.\n var options = this.options({});\n\n // Iterate over all specified file groups.\n this.files.forEach(function(f) {\n // Concat specified files.\n var src = f.src.filter(function(filepath) {\n // Warn on and remove invalid source files (if nonull was set).\n if (!grunt.file.exists(filepath)) {\n grunt.log.warn('Source file \"' + filepath + '\" not found.');\n return false;\n } else {\n return true;\n }\n }).map(function(filepath) {\n // Read file source.\n return grunt.file.read(filepath);\n }).join('\\n');\n\n // Crushing, cleaning and minifying\n src = minify(clean(crush(src)));\n\n // Write the destination file.\n grunt.file.write(f.dest, src);\n\n // Print a success message.\n grunt.log.writeln('File \"' + f.dest + '\" created.');\n });\n }", "title": "" }, { "docid": "954d6e4f189c568c05d16a596b23239b", "score": "0.45155013", "text": "testMasterToWorkers() {\n let name = \"testMasterToWorkers\";\n let descr = \"master -> workers\";\n let timeout = this.timeout(1000, name);\n\n this.printTest(name, descr);\n\n t(name);\n this.bridge.to('*').emit(name, null, () => {\n clearTimeout(timeout);\n !timeout._called && this.printResult(name, t(name));\n });\n }", "title": "" }, { "docid": "417a49a9c9ed7cef1139aa7506e3d409", "score": "0.45105734", "text": "function ImageWorkerManager() {\n \n //////////////////////////////////////////////////////////////\n // ImageMetadata object constructor\n function ImageMetadata(imageCanvas) {\n this.isProcessing = false;\n this.canvas = imageCanvas;\n this.width = 0;\n this.height = 0;\n }\n\n //////////////////////////////////////////////////////////////\n // Private ImageWorkerManager properties\n var workerThread = null;\n var imageMetadataMap = {};\n \n //////////////////////////////////////////////////////////////\n // Private ImageWorkerManager methods\n function ensureInitialized() {\n // Lazy-initialize web worker thread\n if (workerThread == null) {\n workerThread = new Worker(scriptRootURIPath + \"KinectWorker-1.8.0.js\");\n workerThread.addEventListener(\"message\", function (event) {\n var imageName = event.data.imageName;\n if (!imageMetadataMap.hasOwnProperty(imageName)) {\n return;\n }\n var metadata = imageMetadataMap[imageName];\n \n switch (event.data.message) {\n case \"imageReady\":\n // Put ready image data in associated canvas\n var canvasContext = metadata.canvas.getContext(\"2d\");\n canvasContext.putImageData(event.data.imageData, 0, 0);\n metadata.isProcessing = false;\n break;\n \n case \"notProcessed\":\n metadata.isProcessing = false;\n break;\n }\n });\n }\n }\n\n //////////////////////////////////////////////////////////////\n // Public ImageWorkerManager methods\n \n // Send named image data to be processed by worker thread\n // .processImageData(imageName, imageBuffer, width, height)\n //\n // imageName: Name of image to process\n // imageBuffer: ArrayBuffer containing image data\n // width: width of image corresponding to imageBuffer data\n // height: height of image corresponding to imageBuffer data\n this.processImageData = function (imageName, imageBuffer, width, height) {\n ensureInitialized();\n \n if (!imageMetadataMap.hasOwnProperty(imageName)) {\n // We're not tracking this image, so no work to do\n return;\n }\n var metadata = imageMetadataMap[imageName];\n \n if (metadata.isProcessing || (width <= 0) || (height <= 0)) {\n // Don't send more data to worker thread when we are in the middle\n // of processing data already.\n // Also, Only do work if image data to process is of the expected size\n return;\n }\n \n metadata.isProcessing = true;\n\n if ((width != metadata.width) || (height != metadata.height)) {\n // Whenever the image width or height changes, update image tracking metadata\n // and canvas ImageData associated with worker thread\n \n var canvasContext = metadata.canvas.getContext(\"2d\");\n var imageData = canvasContext.createImageData(width, height);\n metadata.width = width;\n metadata.height = height;\n metadata.canvas.width = width;\n metadata.canvas.height = height;\n\n workerThread.postMessage({ \"message\": \"setImageData\", \"imageName\": imageName, \"imageData\": imageData });\n }\n \n workerThread.postMessage({ \"message\": \"processImageData\", \"imageName\": imageName, \"imageBuffer\": imageBuffer });\n };\n\n // Associate specified image name with canvas ImageData object for future usage by\n // worker thread\n // .setImageData(imageName, canvas)\n //\n // imageName: Name of image stream to associate with ImageData object\n // canvas: Canvas to bind to user viewer stream\n this.setImageData = function (imageName, canvas) {\n ensureInitialized();\n\n if (canvas != null) {\n var metadata = new ImageMetadata(canvas);\n imageMetadataMap[imageName] = metadata;\n } else if (imageMetadataMap.hasOwnProperty(imageName)) {\n // If specified canvas is null but we're already tracking image data,\n // remove metadata associated with this image.\n delete imageMetadataMap[imageName];\n }\n };\n }", "title": "" }, { "docid": "ba6af6ec0deddb7791ae385c37d82e53", "score": "0.4497046", "text": "async exec (args, { Compose }) {\n // Code goes here\n }", "title": "" }, { "docid": "6e7c3ad5b33a524b0a534193d4207300", "score": "0.4481705", "text": "function doProcessExportRemotely()\n {\n //.prevents Highcharts service restriction of\n //.too many requests\n var AJAX_CLOUD_SERVICE_DELAY = 10000;\n\n //var AJAX_CLOUD_SERVICE_DELAY = 1;\n\n var ajaxesForPromice = [];\n var counter = 0;\n runNextAjax();\n return;\n\n //===================================\n // //\\\\ delayed ajax to cloud-service\n //===================================\n function runNextAjax()\n {\n var chartRack = contCharts[counter];\n ajaxesForPromice.push(\n $.ajax({\n type: 'POST',\n url: 'http://export.highcharts.com/',\n data: JSON.stringify({\n infile: chartRack.options,\n b64: true,\n constr: 'Chart',\n scale: 2\n }),\n dataType: 'text',\n contentType: \"application/json\"\n })\n );\n //ccc( AJAX_CLOUD_SERVICE_DELAY + ' ' + counter + ' sent ', chartRack );\n counter++;\n if( counter < contCharts.length ) {\n setTimeout( runNextAjax, AJAX_CLOUD_SERVICE_DELAY );\n } else {\n runPromise();\n } \n }\n //===================================\n // \\\\// delayed ajax to cloud-service\n //===================================\n\n\n function runPromise()\n {\n Promise.all( ajaxesForPromice ).then( values => {\n values.forEach( function( value, vix ) {\n insertImage( values[vix], vix, 'data:image/png;base64,' );\n }); \n continueAfterChartsLoaded();\n }); \n }\n }", "title": "" }, { "docid": "439b0c284cc3521e65cb06eec0cbb881", "score": "0.44738683", "text": "async run() {\n for (let par of this._combinations) {\n this._results.push({\n params: par,\n results: await this._run_callback(par)\n });\n }\n }", "title": "" }, { "docid": "6c4d4cacbd86a77ab9ddb7cde31c7101", "score": "0.4446024", "text": "function doMosaic(e){\n // check if tile setting are valid. Do nothing if not\n if(TILE_WIDTH < 1 || TILE_HEIGHT < 1){\n console.error('Invalid TILE size.')\n return\n }\n\n // get image\n var img = document.getElementById('img-orig');\n\n // initialize mosaic instance\n var m = new Mosaic(img, e);\n\n // initialize position of mosaic\n m.initMosaic();\n\n // produce mosaic\n m.mosaic(); \n}", "title": "" }, { "docid": "13b5a8643602e7a83f2442ee66bd147a", "score": "0.44425067", "text": "function init() {\n\tif (verbose) { \n\t\tconsole.log('Root directory set to ' + directory);\n\t\tconsole.log('Child processes set to ' + child_processes);\n\t}\n\tconsole.log('Spawning ' + child_processes +' workers...');\n\n\tfor (var i = 0; i < child_processes; i++) {\n\t\tvar worker = cluster.fork();\n\t\tif (verbose) console.log('Worker ' + worker.pid + ' online!');\n\n\t\tworker.on('message', function(msg) {\n\t\t\t// Master receieved message from a worker, examine message contents.\n\t\t\tif (msg.ready) {\n\t\t\t\tif (++readyCount === workers.length) {\n\t\t\t\t\tif (verbose) console.log(\"All workers indicated they're ready, sending start signal...\");\n\t\t\t\t\tworkers.forEach(function(worker) {\n\t\t\t\t\t\tworker.send( { start: true, fullMode: fullMode, verbose: verbose } );\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t} else if (msg.data) {\n\t\t\t\t//console.log(msg.data.ticker || msg.data, msg.data.date || '');\n\t\t\t\tcount++;\n\t\t\t\t// TODO: write back to DB\n\n\t\t\t} else if (msg.done) {\n\t\t\t\tconsole.log('Worker ' + msg.done + ' signaled that it is finished.');\n\t\t\t\tif (--readyCount === 0) {\n\t\t\t\t\tconsole.log('All workers finished!');\n\t\t\t\t\t// Sometimes we have to wait briefly for the master process to catch up.\n\t\t\t\t\tsetInterval(function() {\n\t\t\t\t\t\tif (count === filePaths.length) { \n\t\t\t\t\t\t\tconsole.log('Finished successfully!');\n\t\t\t\t\t\t\tworkers.forEach(function(worker) {\n\t\t\t\t\t\t\t\tif (verbose) console.log('Killing worker ' + worker.pid);\n\t\t\t\t\t\t\t\tworker.kill();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tprocess.exit(0); \n\t\t\t\t\t\t} else { console.log('Waiting for async calls to finish... ('+count+')'); }\n\t\t\t\t\t}, 1000);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tworkers.push(worker);\n\t}\n}", "title": "" }, { "docid": "1c95bd9457aa8b10774499841a2265a0", "score": "0.44328085", "text": "function executeInCellResultProcessingQueue(context_id, fun) {\n RCloud.session.invoke_context_callback('function_call', context_id, fun);\n }", "title": "" }, { "docid": "230f12b00e47bcf3cfbd75a426d40bd4", "score": "0.44098634", "text": "processQueue() {\n let { parallelUploads: parallelUploads } = this.options;\n let processingLength = this.getUploadingFiles().length;\n let i = processingLength;\n // There are already at least as many files uploading than should be\n if (processingLength >= parallelUploads) return;\n let queuedFiles = this.getQueuedFiles();\n if (!(queuedFiles.length > 0)) return;\n if (this.options.uploadMultiple) // The files should be uploaded in one request\n return this.processFiles(queuedFiles.slice(0, parallelUploads - processingLength));\n else while(i < parallelUploads){\n if (!queuedFiles.length) return;\n // Nothing left to process\n this.processFile(queuedFiles.shift());\n i++;\n }\n }", "title": "" }, { "docid": "4929ca6f0e41dddde02e169f974a9503", "score": "0.43942693", "text": "function reduceAllPar_(as, f) {\n return core.mapM_(core.makeManagedReleaseMap(T.parallel), parallelReleaseMap => T.provideSome_(T.reduceAllPar_(NA.map_(as, _ => T.map_(_.effect, _ => _.get(1))), f), r => Tp.tuple(r, parallelReleaseMap)));\n}", "title": "" }, { "docid": "9380d381d06ccc93a0b73d3316d6dcb2", "score": "0.43781105", "text": "async submitForm(e) {\n e.preventDefault();\n\n let formData = new FormData(e.target);\n const resizedImage = await resizeImage(formData.get('file'), 320, 240);\n formData.append(\"image\", dataURItoBlob(resizedImage));\n\n this.props.addTask(formData);\n }", "title": "" }, { "docid": "a1b23600fb344ff5ff715692ccf74dbd", "score": "0.43759957", "text": "startOptimization() {\n this.worker.postMessage({'cmd': 'start', 'courses': this.courses, 'maxHours': this.maxHours});\n }", "title": "" }, { "docid": "d64b07dd92647fa9e7cfb35bfca667ed", "score": "0.43694532", "text": "testMasterToWorkersStress(count) {\n let name = \"testMasterToWorkersStress\";\n let descr = \"master -> workers\";\n let timeout = this.timeout(1000, name);\n\n this.printTest(name, descr);\n\n t(name);\n\n let done = 0;\n for(let i = 0; i < count; i++)\n {\n ((i) => {\n setTimeout(() => {\n this.bridge.to('*').emit(name, null, () => {\n if (++done === count )\n {\n clearTimeout(timeout);\n !timeout._called && this.printResult(name, t(name));\n }\n });\n }, i)\n })(i);\n }\n }", "title": "" }, { "docid": "15be4bac42c0e20c4a4bf2d5ee405ad6", "score": "0.43652704", "text": "function h$run(a) {\n ;\n var t = h$forkThread(a, false);\n h$startMainLoop();\n return t;\n}", "title": "" }, { "docid": "15be4bac42c0e20c4a4bf2d5ee405ad6", "score": "0.43652704", "text": "function h$run(a) {\n ;\n var t = h$forkThread(a, false);\n h$startMainLoop();\n return t;\n}", "title": "" }, { "docid": "9f5559d193456c294e9bbb52d9d6b921", "score": "0.43648988", "text": "function startClients() {\n for (var i = 0; i < options.concurrency; i++) {\n\n makeRequest();\n\n }\n }", "title": "" }, { "docid": "6da7978e027e8b8e419c9765135ece72", "score": "0.4361547", "text": "function job(){\n // console.log('Watch dog job start');\n WatchDog.isWorking = true;\n Zeus.getMonitWorkers(function (err ,workers){\n if (err) {\n console.log(err);\n }\n mAsync.eachSeries(workers, function (worker, next){\n var memory = parseInt(worker.memory / 1024 / 1024);\n var workerDB = Zeus.AppDatabase[worker.appName].workers[worker.id];\n // 0 for not based on max memory to restart\n if (workerDB.titanEnv.MAX_MEMORY != 0){\n // max memory is not 0\n if (memory > workerDB.titanEnv.MAX_MEMORY){\n Zeus.killWorkerWithId(worker.appName, worker.id, function (err){\n if (err){\n // kill worker errored\n return next(err);\n } else {\n // kill worker success\n Zeus.startWorkerWithId(worker.appName, worker.id, function (err){\n if (err){\n // start worker errored\n return next(err);\n } else {\n // start worker success\n return next(null);\n }\n });\n }\n });\n } else {\n return next(null);\n }\n } else {\n return next(null);\n }\n }, function (err, result){\n if (err){\n console.log(err);\n }\n // console.log('Watch dog job end');\n WatchDog.isWorking = false;\n })\n });\n }", "title": "" }, { "docid": "45c51fc3eb455dbab7240ae17bfa006f", "score": "0.43556273", "text": "function runPromise()\n {\n Promise.all( ajaxesForPromice ).then( values => {\n values.forEach( function( value, vix ) {\n insertImage( values[vix], vix, 'data:image/png;base64,' );\n }); \n continueAfterChartsLoaded();\n }); \n }", "title": "" }, { "docid": "8fec390b595b7bf001d306e58e3ae9e4", "score": "0.4349248", "text": "startProcess() {\n const { cid, execArgv } = this\n const argv = process.argv.slice(2)\n\n const runnerEnv = Object.assign({}, process.env, this.config.runnerEnv, {\n WDIO_WORKER: true\n })\n\n if (this.config.outputDir) {\n runnerEnv.WDIO_LOG_PATH = path.join(this.config.outputDir, `wdio-${cid}.log`)\n }\n\n log.info(`Start worker ${cid} with arg: ${argv}`)\n const childProcess = this.childProcess = child.fork(path.join(__dirname, 'run.js'), argv, {\n cwd: process.cwd(),\n env: runnerEnv,\n execArgv,\n stdio: ['inherit', 'pipe', 'pipe', 'ipc']\n })\n\n childProcess.on('message', this._handleMessage.bind(this))\n childProcess.on('error', this._handleError.bind(this))\n childProcess.on('exit', this._handleExit.bind(this))\n\n /* istanbul ignore if */\n if (!process.env.JEST_WORKER_ID) {\n childProcess.stdout.pipe(new RunnerTransformStream(cid)).pipe(stdOutStream)\n childProcess.stderr.pipe(new RunnerTransformStream(cid)).pipe(stdErrStream)\n }\n\n return childProcess\n }", "title": "" }, { "docid": "c3d416401a68d72bcb823bb6cdadc7d1", "score": "0.4339738", "text": "async exec() {\n this.logger.info({tasks: listTaskNames(this.tasks)}, `CallSession:exec starting ${this.tasks.length} tasks`);\n while (this.tasks.length && !this.callGone) {\n const taskNum = ++this.taskIdx;\n const stackNum = this.stackIdx;\n const task = this.tasks.shift();\n this.logger.info(`CallSession:exec starting task #${stackNum}:${taskNum}: ${task.name}`);\n try {\n const resources = await this._evaluatePreconditions(task);\n this.currentTask = task;\n await task.exec(this, resources);\n this.currentTask = null;\n this.logger.info(`CallSession:exec completed task #${stackNum}:${taskNum}: ${task.name}`);\n } catch (err) {\n this.currentTask = null;\n if (err.message.includes(BADPRECONDITIONS)) {\n this.logger.info(`CallSession:exec task #${stackNum}:${taskNum}: ${task.name}: ${err.message}`);\n }\n else {\n this.logger.error(err, `Error executing task #${stackNum}:${taskNum}: ${task.name}`);\n break;\n }\n }\n }\n\n // all done - cleanup\n this.logger.info('CallSession:exec all tasks complete');\n this._onTasksDone();\n this._clearResources();\n\n if (!this.isConfirmCallSession && !this.isSmsCallSession) sessionTracker.remove(this.callSid);\n }", "title": "" }, { "docid": "7f6dea69efc213cc69a8a1d9695df2c7", "score": "0.43230522", "text": "resizeImages () {\n // @@@ future feature: consider combining all the promises and using\n // Promise.all() to better handle things?\n [...this.elements].forEach(this.calculateImages, this);\n }", "title": "" }, { "docid": "46cce88f2e5fd69b1e9fe213cdb78fbc", "score": "0.42979887", "text": "async do() {\n if (this.operations.length === 0) {\n return Promise.resolve();\n }\n this.parallelExecute();\n return new Promise((resolve, reject) => {\n this.emitter.on(\"finish\", resolve);\n this.emitter.on(\"error\", (error) => {\n this.state = BatchStates.Error;\n reject(error);\n });\n });\n }", "title": "" }, { "docid": "46cce88f2e5fd69b1e9fe213cdb78fbc", "score": "0.42979887", "text": "async do() {\n if (this.operations.length === 0) {\n return Promise.resolve();\n }\n this.parallelExecute();\n return new Promise((resolve, reject) => {\n this.emitter.on(\"finish\", resolve);\n this.emitter.on(\"error\", (error) => {\n this.state = BatchStates.Error;\n reject(error);\n });\n });\n }", "title": "" }, { "docid": "9c6d0f2912b21340d5fe3163d679971c", "score": "0.42696878", "text": "function worker() {\n // alert('worker called');\n try {\n $\n .ajax({\n url: gMaterialGroupMappingsPageURI,\n cache: false,\n data: {\n 'pageNumber': '1',\n 'fileUploading': 'true'\n },\n success: function (data, textStatus, jqXHR) {\n if (jqXHR.responseText != '') {\n // alert('return from call');\n\n var responseArray = jqXHR.responseText.split('@@@');\n gPagesAvailable = responseArray[1];\n gPageNumber = responseArray[2];\n gPageSize = responseArray[3];\n gTotalRecords = responseArray[4];\n gProcessFailed = responseArray[7];\n cmTotalRecords = responseArray[8];\n cmProcessedCount = responseArray[9];\n\n if (responseArray[6] == \"true\") {\n $(\"#lblDownloadErrorReportLink\").show();\n $(\"#downloadErrorReportLink\").show();\n $(\"#downloadErrorReportLink\").attr(\n 'href',\n 'view-material-group-error-report?fileHandle='\n + responseArray[5]);\n } else {\n $(\"#lblDownloadErrorReportLink\").hide();\n $(\"#downloadErrorReportLink\").hide();\n }\n\n $(\"#cmDownloadProcessedReportLink\").show();\n $(\"#cmLblDownloadProcessedReportLink\").show();\n\n if (typeof gPagesAvailable !== 'undefined'\n && gPagesAvailable > 0) {\n $('#material_group_mappings_section').empty();\n $('#material_group_mappings_section').append(\n responseArray[0]);\n\n if ((gTotalRecords - gPageSize - 1) < 0) {\n $('#customCatergoryPager').hide();\n } else {\n if ($(\"#customCatergoryPager\")\n .is(':hidden')) {\n $(\"#customCatergoryPager\").show();\n }\n // $('span#material_group_mapping_current_page_num').html('Page\n // '+ 1 + ' of ' + gPagesAvailable);\n }\n $('#materialGroupBottomData').show();\n\n // if(pageNum > 1){\n // $(\"#material_group_mapping_prev_page\").removeClass(\"btn-prev\").addClass(\"btn-prev-second\");\n // }else if(pageNum == 1){\n // $(\"#material_group_mapping_prev_page\").removeClass(\"btn-prev-second\").addClass(\"btn-prev\");\n // }\n var begingRecord = (gTotalRecords > 0) ? (1 - 1)\n * gPageSize + 1\n : 0;\n var endRecord = (1) * gPageSize;\n\n endRecord = (endRecord > gTotalRecords) ? gTotalRecords\n : endRecord;\n\n // $('#material_group_mapping_current_record_range').html('Showing\n // Records: ' + begingRecord + '- ' + endRecord\n // + ' of ' + gTotalRecords);\n $('#materialGroupMappingData').show();\n $('#material_group_mappings_section').show();\n $('#info-section2').hide();\n $(\"#materialGroupFile\").remove();\n $(\"#materialGroupFileDiv\")\n .html(\n \"<input type='file' style='cursor: pointer;' name='materialGroupFile' id='materialGroupFile'/>\");\n jcf.customForms.replaceAll();\n jcf.customForms.refreshAll();\n gPageNumber = 1;\n } else {\n\n // alert('inside else');\n $('#info-section2').show();\n $('#info-section2').empty();\n $('#info-section2').html(responseArray[0]);\n if (gProcessFailed) {\n $('#info-section2-loading').hide();\n }\n }\n paginationInTransit = false;\n\n }\n },\n complete: function () {\n\n if (!gPagesAvailable\n && (!gProcessFailed || gProcessFailed == false)) {\n setTimeout(worker, 5000);\n }\n }\n });\n } catch (exp) {\n alert(exp)\n }\n}", "title": "" }, { "docid": "0adeeabf22ec678994c76595b60f2df4", "score": "0.4253769", "text": "function eachWorker(cb) {\n // Go through all workers\n for (var id in cluster.workers) {\n if (cluster.workers.hasOwnProperty(id)) {\n cb(cluster.workers[id]);\n }\n }\n}", "title": "" }, { "docid": "b5924f338523f1e8f1d17e6cd4d3a997", "score": "0.42515868", "text": "function run() {\n //setup new jobs if any\n setupNewJobs();\n\n //process all other active jobs\n processJobs();\n\n //finalize completed jobs\n finalizeJobs();\n }", "title": "" }, { "docid": "744c6a06b8d9f720e4ae44210ccb690a", "score": "0.42490724", "text": "function executeTasks() {\n var tasks = Array.prototype.concat.apply([], arguments);\n var task = tasks.shift();\n task(function() {\n if (tasks.length > 0) {\n executeTasks.apply(this, tasks);\n }\n });\n}", "title": "" }, { "docid": "6e48c1fb6dcc695bffd28987893fd7ee", "score": "0.4240117", "text": "doCPUWork(time) {\n const process = this.peek(); // peek process\n process.executeProcess(time); // call execute process passing in input time/ time slice\n this.manageTimeSlice(process, time); // call manage time slice to call the bookkeeping of the time\n }", "title": "" }, { "docid": "59b2221b42104ea18106044549517073", "score": "0.42398843", "text": "async process(item)\n {\n // lock\n if(this.workerCount+1 >= this.limit)\n {\n // console.log(\"WorkerPool.process()\",\"LOCKING\",\"this.workerCount\",this.workerCount);\n this.lock = Promises.resolvablePromise();\n }\n else \n // console.log(\"WorkerPool.process()\",\"NOT locking\",\"this.workerCount\",this.workerCount);\n \n this.workerCount++;\n var id = this.workerCount;\n // if(this.name) console.log(this.name,\"Worker\",id,\"START\",\"count\",this.workerCount);\n var result;\n try\n {\n result = await this.worker(item);\n }\n catch(error)\n {\n result = {type:'error',error,item};\n }\n this.workerCount--;\n // if(this.name) console.log(this.name,\"Worker\",id,\"DONE\",\"count\",this.workerCount);\n\n // unlock\n if(this.lock)\n {\n this.lock.resolve();\n this.lock = undefined;\n }\n\n return result;\n }", "title": "" }, { "docid": "f343a45e801e8360c70fe110ca7acdb9", "score": "0.42130288", "text": "function multiThread () {\n console.log('!!!! start test worker !!!!')\n // var worker = new Worker('/worker.js') // eslint-disable-line no-undef\n setTimeout(() => {\n sendQueryToWorker('querymsg').then((resp) => {\n console.log('bg main receive')\n console.log(resp)\n })\n }, 20000)\n}", "title": "" }, { "docid": "cb6c3effcb3960c009b287e538c12a5d", "score": "0.4206806", "text": "static metricAllConcurrentExecutions(props) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudwatch_MetricOptions(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.metricAllConcurrentExecutions);\n }\n throw error;\n }\n // Mini-FAQ: why max? This metric is a gauge that is emitted every\n // minute, so either max or avg or a percentile make sense (but sum\n // doesn't). Max is more sensitive to spiky load changes which is\n // probably what you're interested in if you're looking at this metric\n // (Load spikes may lead to concurrent execution errors that would\n // otherwise not be visible in the avg)\n return this.metricAll('ConcurrentExecutions', { statistic: 'max', ...props });\n }", "title": "" }, { "docid": "f14c4e89f9ab33b09856e079b6c6e0a7", "score": "0.4204924", "text": "async exec () {\n const { context, results, parameters } = this\n const start = process.hrtime()\n\n const { test } = context\n if (typeof test.beforeAll === 'function') test.beforeAll.call(this, this.beforeAll)\n if (typeof test.afterAll === 'function') test.afterAll.call(this, this.afterAll)\n\n const { driver, client } = test.options\n\n // TODO: log more of the client\n const logContext = {\n driver,\n mode: context.mode,\n browser: client.browser.name,\n ' width': client.width,\n ' height': client.height,\n attempt: this.attempt > 1 ? chalk.bold(chalk.red(this.attempt)) : this.attempt,\n }\n\n let { description } = context.test\n if (typeof description === 'function') description = description.call(this)\n\n if (description && typeof description === 'string') {\n this._log(`${chalk.underline(context.test.filename)}: ${description.trim()}`)\n } else {\n this._log(`${chalk.underline(context.test.filename)}:`)\n }\n\n this._log(` config:`)\n Object.keys(logContext).forEach((key) => {\n this._log(` ${key}: ${logContext[key]}`)\n })\n\n if (parameters) {\n this._log(` parameters:`)\n Object.keys(parameters).forEach((key) => {\n this._log(` ${key}: ${parameters[key]}`)\n })\n }\n\n this._log(' steps:')\n\n await this.runTest()\n\n const success = results.every(result => result.skip || result.success)\n\n const elapsedTime = getElapsedTime(start)\n const time = `(${logElapsedTime(elapsedTime)})`\n this._log(` ${chalk.bold(success ? chalk.green('✔ PASS ' + time) : chalk.red('✕ FAIL ' + time))}`)\n this._log('')\n\n if (!context.runnerOptions.stream) console.log(this._logs.join('\\n'))\n\n return {\n context,\n results,\n success,\n elapsedTime,\n }\n }", "title": "" }, { "docid": "b03c4cc11a8b73acf6dbf1922dd807c0", "score": "0.41976297", "text": "function _exec () {\n var self = this;\n\n //the end\n if (this._ops.length < 1) {\n\n //call end callback\n if (typeof (this._endFn) == 'function')\n this._endFn.call(this);\n\n if (this._options.cleanup === true) {\n //and remove all classes\n if (this._classNames.length > 0) {\n //get all added class names\n for (var i = 0; i <= this._classNames.length;i++) {\n //and remove all existing class names from target element\n var currentClassName = this._classNames[0];\n _removeClass.call(this, currentClassName);\n }\n }\n }\n\n //end of the queue\n return;\n }\n\n //get current operation\n var thisOp = this._ops[0];\n\n setTimeout(function () {\n\n thisOp.fn.apply(self, thisOp.args);\n\n if (thisOp.fn.name != '_then') {\n //increase executed operations count\n self._executedOps++;\n }\n }, thisOp.wait || 0);\n\n //set previous operation name\n this._currentOp = thisOp;\n\n //remove current operation from operations list\n this._ops.splice(0, 1);\n }", "title": "" }, { "docid": "9a4967f33eb9d7334e84436f2b07b908", "score": "0.41879192", "text": "async function init_remote_cluster(name, browserURL, tabs, timeout) {\n let puppeteer_cluster = await Cluster.launch({\n concurrency: Cluster.CONCURRENCY_REMOTE_PAGE,\n maxConcurrency: tabs,\n puppeteerOptions: {\n headless: true,\n ignoreHTTPSErrors: true,\n browserURL: browserURL,\n },\n //monitor: true,\n timeout: timeout\n })\n\n workers[workers.length] = puppeteer_cluster;\n\n metadata[workers.length-1] = {\n id: workers.length-1,\n name: name,\n url: browserURL,\n total_tabs: tabs,\n timeout: timeout,\n queued: 0\n }\n}", "title": "" }, { "docid": "d9ae32921e662b8e31d68a35f3e81107", "score": "0.41846412", "text": "function startOfflineStreamProcessors() {\n for (var i = 0; i < offlineStreamProcessors.length; i++) {\n offlineStreamProcessors[i].start();\n }\n }", "title": "" }, { "docid": "89081fb5dad777a5d7b5be8f01030094", "score": "0.41799998", "text": "function CreateWorkers(url, message, size) {\n size = size || 4\n var worker = [],\n instances = [];\n\n function handler(id) {\n return function(e) {\n message(this.context, e, function(r) {\n worker[id].busy = false; /* release worker */\n instances[id](r);\n });\n }\n }\n\n function create(i) {\n var w;\n w = new Worker(url);\n w.id = i;\n w.busy = false;\n w.postMessage = w.webkitPostMessage || w.postMessage;\n w.onmessage = handler(i);\n return w;\n }\n for (var i = 0; i < size; i++) {\n worker.push(null);\n }\n return new MegaQueue(function(task, done) {\n for (var i = 0; i < size; i++) {\n if (worker[i] === null) worker[i] = create(i);\n if (!worker[i].busy) break;\n }\n worker[i].busy = true;\n instances[i] = done;\n $.each(task, function(e, t) {\n if (e == 0) {\n worker[i].context = t;\n } else if (t.constructor === Uint8Array && typeof MSBlobBuilder !== 'function') {\n worker[i].postMessage(t.buffer, [\n t.buffer\n ]);\n } else {\n worker[i].postMessage(t);\n }\n });\n }, size);\n}", "title": "" }, { "docid": "4946fcbe289e808d22357b659c2b1936", "score": "0.417989", "text": "function WorkerPool(size) {\n var workers = 0,\n jobs = [];\n\n // url: the URL of the worker script.\n // msg: the initial message to pass to the worker.\n // cb: the callback to recieve messages from postMessage.\n // return true from cb to dismiss the worker and advance the queue.\n // ctx: the context for cb.apply.\n this.queueJob = function(url, msg, cb, ctx) {\n var job = {\n 'url': url,\n 'msg': msg,\n 'cb': cb,\n 'ctx': ctx\n };\n jobs.push(job);\n if (workers < size) {\n nextJob();\n }\n };\n\n function nextJob() {\n if (jobs.length) {\n (function() {\n var job = jobs.shift(),\n worker = new Worker(job.url);\n workers++;\n worker.addEventListener('message', function(e) {\n if (job.cb.call(job.ctx, e.data, worker)) {\n worker.terminate();\n delete worker;\n workers--;\n nextJob();\n };\n }, false);\n worker.postMessage(job.msg);\n })();\n }\n }\n\n return this;\n}", "title": "" }, { "docid": "4635622fffa2477e0eed7f963902a2d4", "score": "0.4179884", "text": "function createParallelIfNeeded(option){if(option.parallel){return;}var hasParallelSeries=false;zrUtil.each(option.series,function(seriesOpt){if(seriesOpt && seriesOpt.type === 'parallel'){hasParallelSeries = true;}});if(hasParallelSeries){option.parallel = [{}];}}", "title": "" }, { "docid": "8044e7e8e8ff7cb290165b9d5939063a", "score": "0.41794172", "text": "function executeOperationsParallel(operations, callback) {\n callback = arguments[arguments.length - 1];\n var promises = [];\n for (var i = 0; i < operations.length; i++) {\n var operation = operations[i];\n promises.push(operation.fnc.apply(this, operation.args));\n }\n\n asyncish(() => {\n Promise.all(promises)\n .then((operations) => {\n callback(null, operations)\n })\n .catch(callback);\n });\n\n if (typeof callback !== 'function') {\n return new Promise(function (resolve, reject) {\n callback = function (e, r) { e ? reject(e) : resolve(r) };\n })\n }\n\n }", "title": "" }, { "docid": "b44d6bd4ed261172dc2eac910e6a272c", "score": "0.41792703", "text": "function abondonMpu() {\n async.waterfall([\n next => {\n const initiateMpuParams = {\n Bucket: bucket,\n Key: multipartKey,\n Metadata: {\n importance: 'extreme',\n ranking: 'high',\n },\n };\n s3Client.createMultipartUpload(initiateMpuParams, (err, data) => {\n if (err) {\n console.log('err:', err);\n return next(err);\n }\n console.log('data:', data);\n const uploadId = data.UploadId;\n console.log('uploadId', uploadId);\n return next(null, uploadId);\n });\n },\n (uploadId, next) => {\n const abortParams = {\n Bucket: bucket,\n Key: multipartKey,\n UploadId: uploadId,\n };\n s3Client.abortMultipartUpload(abortParams, (err, data) => {\n if (err) {\n console.log('err:', err);\n return next(err);\n }\n console.log('data:', data);\n return next(null);\n });\n },\n next => {\n const listMpuParams = {\n Bucket: bucket,\n };\n s3Client.listMultipartUploads(listMpuParams, (err, data) => {\n if (err) {\n console.log('err:', err);\n return next(err);\n }\n console.log('data:', data);\n return next(null);\n });\n },\n ],\n err => {\n if (err) console.log('err:', err);\n else console.log('all aborted');\n });\n}", "title": "" }, { "docid": "67febd7a51fa691b3f9683f587924057", "score": "0.41699445", "text": "function initialiseWorkers() {\n while(workers.length) {\n var worker = workers.pop();\n worker.terminate(); // need some error condition here\n\n }\n\n for (var k = 0; k < workercount; k++) {\n var myWorker = new Worker(\"worker.js\");\n myWorker.onmessage = function (e) {\n // get data back - we get a ReturnThing\n recordFinished(e.data.name);\n iterationTotalCount+=e.data.iterationCount;\n renderImageSection(e.data.name, new Uint8ClampedArray(e.data.arr));\n }\n workers.push(myWorker);\n }\n}", "title": "" }, { "docid": "29412b92edabb3d746b89d8a8b008d03", "score": "0.4156342", "text": "function execTasksWithInterLeave(tasks, callback) {\n //let's give others some time to process.\n //Context Switch BEFORE Heavy Computation\n process.nextTick(function() {\n //Heavy Computation\n async.parallel(tasks, function(err, info) {\n //Context Switch AFTER Heavy Computation\n process.nextTick(function() {\n callback(err, info);\n });\n });\n });\n}", "title": "" }, { "docid": "188e899fcf8a8706611cf371922f6991", "score": "0.41507304", "text": "dispatchAsync() {\r\n this._dispatch(true, this, arguments);\r\n }", "title": "" }, { "docid": "bb9baec67f18903f2730afe37379b7d0", "score": "0.4150387", "text": "async mainLoop() {\n return new Promise((resolve) => {\n forEachLimit(\n Array.from({ length: this.asyncPage }, (_, k) => k + 1),\n this.asyncTasks,\n async (item) => {\n const body = await this.buildRequest(item);\n\n let totalResultCount = body.match(/\"totalResultCount\":\\w+(.[0-9])/gm);\n\n if (totalResultCount) {\n this.totalProducts = totalResultCount[0].split(\n 'totalResultCount\":'\n )[1];\n }\n this.grabProduct(body, item);\n },\n () => {\n resolve();\n }\n );\n });\n }", "title": "" }, { "docid": "90ab19a2127b6ec2927ffe1170b2e84c", "score": "0.41474003", "text": "async function executeParallelAsyncTasks() {\n const [valueA, valueB, valueC] = await Promise.all([functionA(), functionB(), functionC()])\n doSomethingWith(valueA)\n doSomethingElseWith(valueB)\n doAnotherThingWith(valueC)\n}", "title": "" }, { "docid": "d36d32a58f99f182625893637c9ecc68", "score": "0.41454807", "text": "async function monitoreoTiempoReal(req = request, res = response) {\n//https://www.digitalocean.com/community/tutorials/how-to-launch-child-processes-in-node-js-es\n//Pagina para validar el comando fork para comunicacion bilateral\n //obtener los parametros de entrada \n // const {fechaInicio,fechaFin, numClientes, tiempoSeg, tamanioPaquete, URL } = req.body;\n const body = req.body;\n parametroModel = guardarParametros(body);\n // console.log(\"el id del los parametros ingrasados es\"+ parametroModel._id);\n latenciaModel = crearLatencia(parametroModel._id);\n\n //Ejecutar comando\n ejecutarMonitoreo(body,parametroModel._id );\n\n\n //ping(tamanioPaquete, URL);\n //https://www.npmjs.com/package/net-ping\n\n // res.json({\n // msg: \"get API\",\n // parametro\n // });\n // Documentacion\n // https://elabismodenull.wordpress.com/2017/03/28/el-manejo-de-streams-en-nodejs/\n // ########## SOCKET IO##########\n\n}", "title": "" }, { "docid": "ca9789ac54013074dae1e29607209977", "score": "0.41451722", "text": "function InlineWorkerFactory(){\n\t}", "title": "" }, { "docid": "d83681f1570d519066a65d239ca9788b", "score": "0.41353", "text": "testMasterToWorker() {\n let name = \"testMasterToWorker\";\n let descr = \"master -> worker\";\n let timeout = this.timeout(1000, name);\n\n this.printTest(name, descr);\n\n t(name);\n this.bridge.to(1).emit(name, null, () => {\n clearTimeout(timeout);\n !timeout._called && this.printResult(name, t(name));\n });\n }", "title": "" }, { "docid": "3b6724dfe520693d23bfde66800cf03d", "score": "0.41328", "text": "function WorkerPool() {\n\t this.active = {};\n\t}", "title": "" }, { "docid": "0a3ff3229622944776934eceb434c550", "score": "0.41316295", "text": "function start() {\n if (cluster.isMaster) {\n var numCPUs = require('os').cpus().length;\n // Fork workers.\n for (var i = 0; i < numCPUs; i++) {\n var worker = cluster.fork();\n workers.push(worker);\n }\n\n // Handle workers exiting\n cluster.on('exit', function (worker, code, signal) {\n if (worker.suicide === true) {\n console.log(\"Cleanly exiting..\");\n process.exit(0);\n } else {\n var msg = \"Worker: \" + worker.process.pid + \" has died!! Respawning..\";\n console.error(msg);\n var newWorker = cluster.fork();\n for (var i = 0; i < workers.length; i++) {\n if (workers[i] && workers[i].id === worker.id) workers.splice(i);\n }\n workers.push(newWorker);\n }\n });\n } else {\n startWorker();\n }\n}", "title": "" }, { "docid": "2f6cbcedffca6290142e8959a7fbff1c", "score": "0.41257963", "text": "function main() {\n init();\n worker();\n}", "title": "" }, { "docid": "a7c205cfc419cb15995e65ce4ee02250", "score": "0.41200894", "text": "async process () {\n this.context.resolveCacheLoaderOptions()\n this.watchSourceFiles()\n this.watchUserConfig()\n this.watchFrontmatter()\n this.setupDebugTip()\n await this.resolvePort()\n await this.resolveHost()\n this.prepareWebpackConfig()\n return this\n }", "title": "" }, { "docid": "bf422dc6c1f7d7225faa201ae1efeaa2", "score": "0.41135612", "text": "t5 () {\n return WorkerWrapper.run((arg1, arg2) => `Run ${arg1} and ${arg2}`)\n .then(result => {\n resultEl.innerHTML = result\n return result\n })\n .catch(err => err)\n }", "title": "" }, { "docid": "2bc80034870a33bb8836e54c6e5d502d", "score": "0.41113362", "text": "runTests() {\n return __awaiter(this, void 0, void 0, function* () {\n let done = plugins.smartq.defer();\n // print some info\n plugins.beautylog.log(`---------------------------------------------\\n`\n + `-------------------- tapbuffer ----------------------\\n`\n + `-----------------------------------------------------`);\n plugins.beautylog.info(`received ${this.testableFiles.length} modulefile(s) for testing`);\n plugins.beautylog.info(`received ${this.testFiles.length} test files`);\n plugins.beautylog.info(`Coverage will be provided by istanbul`);\n // handle testableFiles\n let testableFilesMessage = {};\n for (let file of this.testableFiles) {\n testableFilesMessage[file.path] = file.contents.toString();\n }\n // handle testFiles\n let testFilesMessage = {};\n for (let file of this.testFiles) {\n testFilesMessage[file.path] = file.contents.toString();\n }\n // prepare injection handoff\n let testableFilesJson = JSON.stringify(testableFilesMessage);\n let testFilesJson = JSON.stringify(testFilesMessage);\n let parentEnv = JSON.stringify(process.env);\n let parentShellPath = (yield plugins.smartshell.execSilent(`echo $PATH`)).stdout;\n parentShellPath = parentShellPath.replace(/\\r?\\n|\\r/g, ''); // remove end of line\n plugins.smartipc.startSpawnWrap(plugins.path.join(__dirname, 'spawnhead.js'), [], {\n 'TESTABLEFILES_JSON': testableFilesJson,\n 'TESTFILES_JSON': testFilesJson,\n 'PARENT_ENV': parentEnv\n });\n let testPromiseArray = [];\n let testCounter = 0;\n for (let testFile of this.testFiles) {\n testCounter++;\n let testThread = new plugins.smartipc.ThreadSimple(testFile.path, [], { silent: true, env: { TESTNUMBER: `${testCounter.toString()}` } });\n let parsedPath = plugins.path.parse(testFile.path);\n console.log('=======');\n plugins.beautylog.log(`-------------- ${parsedPath.name} --------------`);\n console.log('=======');\n let testPromise = testThread.run().then((childProcess) => {\n let done = plugins.smartq.defer();\n childProcess.stdout.pipe(tapMochaReporter('list'));\n childProcess.on('exit', function () {\n done.resolve();\n });\n return done.promise;\n });\n // wait for tests to complete if not running parallel\n if (!this.testConfig.parallel) {\n yield testPromise;\n }\n testPromiseArray.push(testPromise);\n }\n Promise.all(testPromiseArray).then(() => __awaiter(this, void 0, void 0, function* () {\n let Collector = new plugins.istanbul.Collector();\n let Reporter = new plugins.istanbul.Reporter();\n let fileArray = yield plugins.smartfile.fs.fileTreeToObject(process.cwd(), 'coverage/**/coverage-final.json');\n if (this.testConfig.coverage) {\n // remap the output\n let remapArray = [];\n for (let smartfile of fileArray) {\n remapArray.push(smartfile.path);\n }\n let remapCoverage = plugins.remapIstanbul_load(remapArray);\n let remappedCollector = plugins.remapIstanbul_remap(remapCoverage, {\n readFile: (filePath) => {\n let localSmartfile = this.testableFiles.find(itemArg => {\n if (itemArg.path === filePath) {\n return true;\n }\n });\n return localSmartfile.contents.toString();\n }\n });\n let remappedJsonPath = plugins.path.resolve('coverage-final.json');\n yield plugins.remapIstanbul_write(remappedCollector, 'json', remappedJsonPath);\n Collector.add(plugins.smartfile.fs.toObjectSync(remappedJsonPath));\n yield plugins.smartfile.fs.remove(remappedJsonPath);\n Reporter.addAll(['text', 'lcovonly']);\n Reporter.write(Collector, true, () => {\n let lcovInfo = plugins.smartfile.fs.toStringSync(plugins.path.join(process.cwd(), 'coverage/lcov.info'));\n plugins.smartfile.fs.removeSync(plugins.path.join(process.cwd(), 'coverage'));\n done.resolve(lcovInfo);\n });\n }\n })).catch(err => {\n console.log(err);\n });\n return yield done.promise;\n });\n }", "title": "" }, { "docid": "699c043290e770c7420ad32a7b64a617", "score": "0.4105513", "text": "get parallel() {\n let total = parseInt(this.vars.PERCY_PARALLEL_TOTAL, 10);\n if (!Number.isInteger(total)) total = null;\n\n // no nonce if no total\n let nonce = total && (() => {\n if (this.vars.PERCY_PARALLEL_NONCE) {\n return this.vars.PERCY_PARALLEL_NONCE;\n }\n\n switch (this.ci) {\n case 'travis':\n return this.vars.TRAVIS_BUILD_NUMBER;\n case 'jenkins-prb':\n return this.vars.BUILD_NUMBER;\n case 'jenkins':\n return this.vars.BUILD_TAG?.split('').reverse().join('').substring(0, 60);\n case 'circle':\n return this.vars.CIRCLE_WORKFLOW_ID || this.vars.CIRCLE_BUILD_NUM;\n case 'codeship':\n return this.vars.CI_BUILD_NUMBER || this.vars.CI_BUILD_ID;\n case 'drone':\n return this.vars.DRONE_BUILD_NUMBER;\n case 'semaphore':\n return this.vars.SEMAPHORE_WORKFLOW_ID ||\n `${this.vars.SEMAPHORE_BRANCH_ID}/${this.vars.SEMAPHORE_BUILD_NUMBER}`;\n case 'buildkite':\n return this.vars.BUILDKITE_BUILD_ID;\n case 'heroku':\n return this.vars.HEROKU_TEST_RUN_ID;\n case 'gitlab':\n return this.vars.CI_PIPELINE_ID;\n case 'azure':\n return this.vars.BUILD_BUILDID;\n case 'appveyor':\n return this.vars.APPVEYOR_BUILD_ID;\n case 'probo':\n return this.vars.BUILD_ID;\n case 'bitbucket':\n return this.vars.BITBUCKET_BUILD_NUMBER;\n case 'github':\n return this.vars.GITHUB_RUN_ID;\n }\n })();\n\n return {\n total: total || null,\n nonce: nonce || null\n };\n }", "title": "" }, { "docid": "c7003db6cbb7447c0c8d26cd40277216", "score": "0.4099803", "text": "async run(onSuccess=null, onError=null, onCancel=null) {\n assert(this._state === 'new'); // requests run once\n log.debug(`[${this._id}]: running request`); \n try {\n this._state = 'running';\n this._time.executed = Date.now();\n const res = await this._client.execute(this);\n this._result = {error: false, response: res}; \n // Axios success response\n // `data` is the response that was provided by the server\n // `status` is the HTTP status code from the server response\n // `statusText` is the HTTP status message from the server response\n // `headers` the HTTP headers; e.g. `response.headers['content-type']`\n // `config` is the config that was provided to `axios` for the request\n // `request` is the request that generated this response\n this._time.finished = Date.now();\n this._state = 'success';\n log.debug(`[${this._id}]: success`);\n }\n catch (err) {\n const requestSent = Boolean(err.request);\n const responseReceived = Boolean(err.response);\n this._result = { \n error: err,\n requestSent: requestSent,\n responseReceived: responseReceived, \n response: (responseReceived) ? err.response:null }; \n // Axios error response\n // code (string)\n // message\n // config\n // request\n // response\n // stack\n // toJSON()\n this._state = (this._canceled) ? 'canceled':'error';\n this._time.finished = Date.now();\n log.error(`[${this._id}]: error (requestSent=${requestSent}, responseReceived=${responseReceived}): ${err.message}`);\n }\n finally {\n assert(this._state !== 'running');\n assert(this._state !== 'new');\n assert(this._result);\n assert(this._time.finished>0 && this._time.executed>0);\n assert(this._time.finished >= this._time.executed);\n this._time.durationMillisec = (this._time.finished - this._time.executed);\n switch (this._state) {\n case 'success':\n onSuccess && onSuccess(this);\n break;\n case 'error':\n onError && onError(this);\n break;\n case 'canceled':\n onCancel && onCancel(this);\n break;\n default:\n log.error(`[${this._id}]: illegal final state ${this._state}`);\n break; \n }\n log.debug(`[${this._id}]: complete: state=${this._state}, duration (msec): ${this._time.durationMillisec}`);\n return this._result; \n }\n }", "title": "" }, { "docid": "69846ef59cf5833b25386c937f9c8d8b", "score": "0.4095745", "text": "fork() {\n if (!cluster.isMaster) {\n throw new Error('fork must be called on master only');\n }\n\n if (this.started) {\n this._log('Worker already started');\n\n return;\n }\n\n this._log('fork');\n\n this.started = true;\n this.worker = cluster.fork(this.config.env);\n this._listen();\n }", "title": "" }, { "docid": "cc3fb69faf5ee13f6bb4c9ae89c3c343", "score": "0.409274", "text": "spawn() {\n Object.keys(this.tasks).forEach((key) => {\n this.start(key);\n });\n }", "title": "" }, { "docid": "0649cd6f7a1968e7db4583e8c5097161", "score": "0.40900096", "text": "function globalWorker(param) {\n\n\tconst funcName = '[Sellerise: globalWorker]';\n\n\twork = true;\n\tamznRequestId = param.amznRequestId;\n\n\tscanOrderPages(param)\n\t.then(function(orders){\n\n\t\tif(orders.length == 0){\n\t\t\trequestProgressEvent('up-to-date');\n\t\t\trequestFinishEvent('scan-order-pages');\n\t\t\treturn true;\n\t\t}\n\t\tif(!work){ return false; }\n\t\treturn requestOrdersReview(param.host, orders);\n\t})\n\t.then(function(result){\n\t\t// console.log('work done')\n\t})\n\t.catch(function(err) {\n \t\t// console.log(funcName, err);\n });\n}", "title": "" }, { "docid": "9f46e7fd86aee59201582b8163f5506d", "score": "0.40855932", "text": "async function main () {\n notifier.configure(notifiersConfiguration)\n await fileProcessor.startProcessing(flags)\n if (uploads) {\n for (const uploadUser in uploads) {\n const uploaderDetail = uploads[uploadUser]\n if (uploaderDetail.enabled) {\n const res = await uploader.startUploadProcess(uploadUser, uploaderDetail, flags)\n notifier.notify(res, flags)\n }\n }\n }\n return 'Process Completed at ' + new Date()\n}", "title": "" }, { "docid": "9428a63e27c35723a2a3eaf08b51662e", "score": "0.40851766", "text": "function main() {\n\t// init low-level things first (synchronously)\n\tconfig.init(cluster.isMaster);\n\tif (config.get('debug').stackTraceLimit) {\n\t\tError.stackTraceLimit = config.get('debug:stackTraceLimit');\n\t}\n\theartbeatInt = config.get('net:heartbeat:interval', 0);\n\theartbeatTimeout = config.get('net:heartbeat:timeout', 0);\n\tlogging.init();\n\tmetrics.init();\n\t// then actually fork workers, resp. defer to worker module there\n\tif (cluster.isMaster) runMaster();\n\telse worker.run();\n}", "title": "" }, { "docid": "505bd79cfad09435ac401962ab211d95", "score": "0.40803897", "text": "function ImageQueueRequester(maxQueuedElements) {\n var self = new Emitter(this);\n var processedImages = new Array();\n var worker = new Worker('src/app/Media/Video/ImageProcessWorker.js');\n var play = false;\n var numberOfRequestsInProcess = 0;\n\n worker.addEventListener('message', function (e) {\n\n e.data.image = new Uint8Array(e.data.imageInArrayBuffer);\n processedImages.push(e.data);\n\n console.log('VideoSource: FullImage received, queue at capacity: ' + (processedImages.length * 100) / maxQueuedElements);\n self.emit('capacity_consumed_in_percentage', (processedImages.length * 100) / maxQueuedElements);\n //if (processedImages.length > maxQueuedElements) {\n // throw 'how the fuck';\n //}\n if (processedImages.length == maxQueuedElements) {\n self.emit('full');\n }\n \n numberOfRequestsInProcess--;\n console.log('VideoSource: Number of request in progress : ' + numberOfRequestsInProcess);\n if (play) {\n self.requestImageIfNeeded();\n }\n\n if (play == false && numberOfRequestsInProcess == 0) {\n self.emit('stoped');\n }\n }, false);\n\n\n self.consume = function () {\n setTimeout(self.requestImageIfNeeded, 20);\n\n return processedImages.shift();\n };\n\n self.requestImageIfNeeded = function () {\n if (numberOfRequestsInProcess < maxQueuedElements && processedImages.length < maxQueuedElements) {\n numberOfRequestsInProcess++;\n worker.postMessage({ cmd: 'processImageAhead'});\n }\n };\n\n self.start = function () {\n play = true;\n self.requestImageIfNeeded();\n }\n\n self.requestStop = function () {\n play = false;\n if (numberOfRequestsInProcess == 0) {\n self.emit('stoped');\n }\n }\n\n self.addFrame = function (frame) {\n worker.postMessage({ cmd: 'addFrame', args: frame });\n }\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": "b0cc94c95f073375bf24013c6a92b09a", "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": "2b660d69b985da5cf9746bd1aa20485a", "score": "0.7300052", "text": "_read() {\r\n\t\tthis._readingPaused = false\r\n\t\tsetImmediate(this._onReadable.bind(this))\r\n\t}", "title": "" }, { "docid": "36954bace936995643dfb2159db18efc", "score": "0.6974782", "text": "_onReadable() {\r\n\t\t// Read all the data until one of two conditions is met\r\n\t\t// 1. there is nothing left to read on the socket\r\n\t\t// 2. reading is paused because the consumer is slow\r\n\t\twhile (!this._readingPaused) {\r\n\t\t\t// First step is reading the 32-bit integer from the socket\r\n\t\t\t// and if there is not a value, we simply abort processing\r\n\t\t\tlet lenBuf = this._socket.read(4)\r\n\t\t\tif (!lenBuf) return\r\n\r\n\t\t\t// Now that we have a length buffer we can convert it\r\n\t\t\t// into a number by reading the UInt32BE value\r\n\t\t\t// from the buffer.\r\n\t\t\tlet len = lenBuf.readUInt32LE()\r\n\t\t\t// ensure that we don't exceed the max size of 256KiB\r\n\t\t\tif (len > 2 ** 18) {\r\n\t\t\t\tthis.socket.destroy(new Error('Max length exceeded'))\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t\t// With the length, we can then consume the rest of the body.\r\n\t\t\tlet body = this._socket.read(len)\r\n\r\n\t\t\t// If we did not have enough data on the wire to read the body\r\n\t\t\t// we will wait for the body to arrive and push the length\r\n\t\t\t// back into the socket's read buffer with unshift.\r\n\t\t\tif (!body) {\r\n\t\t\t\tthis._socket.unshift(lenBuf)\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\t\t\t// Try to parse the data and if it fails destroy the socket.\r\n\t\t\tlet json\r\n\t\t\ttry {\r\n\t\t\t\tlet message = Buffer.from(body).toString('utf8')\r\n\t\t\t\tif (this.encrypted) {\r\n\t\t\t\t\tmessage = decrypt(this.shkey, message)\r\n\t\t\t\t}\r\n\t\t\t\tjson = JSON.parse(message)\r\n\t\t\t} catch (ex) {\r\n\t\t\t\tthis._socket.destroy()\r\n\t\t\t\treturn\r\n\t\t\t}\r\n\r\n\t\t\t// Push the data into the read buffer and capture whether\r\n\t\t\t// we are hitting the back pressure limits\r\n\t\t\tlet pushOk = this.push(json)\r\n\r\n\t\t\t// When the push fails, we need to pause the ability to read\r\n\t\t\t// messages because the consumer is getting backed up.\r\n\t\t\tif (!pushOk) this._readingPaused = true\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "e914602b9b639e9cea78158dc61c1275", "score": "0.6769168", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state)}}", "title": "" }, { "docid": "c5eec4afd3df3b429322dc2886b1c567", "score": "0.6744609", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "c5eec4afd3df3b429322dc2886b1c567", "score": "0.6744609", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;processNextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "b9507326e6c08977d9affa20e7d6c660", "score": "0.67427224", "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.67427224", "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": "71fc27c40faa8edcede65719ec275077", "score": "0.6721973", "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\n\tif(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.\n\tif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\n\tif(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "e3f466b9409f5a0a6936eb1ccc14c5b7", "score": "0.6689743", "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\n if(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.\n if(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;// Don't have enough\n if(!state.ended){state.needReadable=true;return 0;}return state.length;}// you can override either this method, or the async _read(n) below.", "title": "" }, { "docid": "b3bd062cd0a7cb4a4a9c093337370117", "score": "0.6663656", "text": "function $SYhk$var$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 = $SYhk$var$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": "e565f8ee7bda70dbfad6d8128ad68d46", "score": "0.6653636", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;pna.nextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "18427f2d3d1c867c901f2b6538e7ac86", "score": "0.661804", "text": "function maybeReadMore(stream,state){if(!state.readingMore){state.readingMore=true;process.nextTick(maybeReadMore_,stream,state);}}", "title": "" }, { "docid": "b7c85b0955a19dad7964dc867fbf85be", "score": "0.6567068", "text": "function $Fj4k$var$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 = $Fj4k$var$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": "9bb4ffd43e78855babfd661b34bb455d", "score": "0.6501023", "text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0)}", "title": "" }, { "docid": "5a71ad436419063f53a02dfa66b013fc", "score": "0.65002793", "text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}", "title": "" }, { "docid": "5a71ad436419063f53a02dfa66b013fc", "score": "0.65002793", "text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}", "title": "" }, { "docid": "609351c71b640a50894a5c0984fa2a9d", "score": "0.6484555", "text": "function needMoreData(state){return!state.ended&&(state.needReadable||state.length<state.highWaterMark||state.length===0);}// backwards compatibility.", "title": "" }, { "docid": "c6e08050558e13ac46b3de2340fb8da9", "score": "0.64682436", "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)\n return state.buffer.head.data.length;\n else return state.length;\n } // If we're asking for more than the current hwm, then raise the hwm.\n\n if (n > state.highWaterMark)\n 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": "a81349fe9b6a8135e3389bd25e00ec97", "score": "0.6466185", "text": "function howMuchToRead(n,state){if(n<=0||state.length===0&&state.ended)return 0;if(state.objectMode)return 1;if(n!==n){\n// Only flow one buffer at a time\nif(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.\nif(n>state.highWaterMark)state.highWaterMark=computeNewHighWaterMark(n);if(n<=state.length)return n;\n// Don't have enough\nif(!state.ended){state.needReadable=true;return 0}return state.length}", "title": "" }, { "docid": "7930264f2e16cba8a3b729d3cc2c90a8", "score": "0.6383739", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "61b8a6581ba338fdf59af527a571dc55", "score": "0.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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.6382004", "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": "70715f2a0bf707809ab80c27076f02ad", "score": "0.6352916", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "5a0cbac0cff5e5c0fc8a4b29a050b527", "score": "0.6352643", "text": "function howMuchToRead$1(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$1(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": "64206293ec74f224b6e3a9eaae07c78c", "score": "0.6345609", "text": "function needMoreData(state) {\n return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n }", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63339925", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63339925", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63339925", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63339925", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63339925", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63339925", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63339925", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63339925", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63339925", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63339925", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63339925", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63339925", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63339925", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63339925", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63339925", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "676c7976342185eeaabf2a0331abfb90", "score": "0.63339925", "text": "function maybeReadMore(stream, state) {\n\t if (!state.readingMore) {\n\t state.readingMore = true;\n\t process.nextTick(function() {\n\t maybeReadMore_(stream, state);\n\t });\n\t }\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.6331444", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.6331444", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.6331444", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" }, { "docid": "46a6eb6d86fdf2edfa75f37b0ff41155", "score": "0.6331444", "text": "function needMoreData(state) {\n\t return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n\t}", "title": "" } ]
fd7c3cb469b30fb23bba9eddea91052d
When working on async work, the reconciler asks the renderer if it should yield execution. For DOM, we implement this with requestIdleCallback.
[ { "docid": "93e7582d09174d1089ab96a46bf179f0", "score": "0.0", "text": "function shouldYield() {\n if (deadline === null) {\n return false;\n }\n if (deadline.timeRemaining() > timeHeuristicForUnitOfWork) {\n // Disregard deadline.didTimeout. Only expired work should be flushed\n // during a timeout. This path is only hit for non-expired work.\n return false;\n }\n deadlineDidExpire = true;\n return true;\n }", "title": "" } ]
[ { "docid": "3d4a2d0a4fc12a9b141f0048fa927791", "score": "0.5916731", "text": "waitUntilIdle() {\n if (!this._beginFrameCompleteCallback)\n return Promise.resolve();\n return new Promise(resolve => this._idleCallback = resolve);\n }", "title": "" }, { "docid": "07d460f4682e47875a148e6f5b9cdde5", "score": "0.5876082", "text": "function AsyncRenderer() {\n const batch = []\n function flush() {\n console.timeStamp('START asyncRender.flush()')\n const nodes = []\n for (let i = 0, next; i < batch.length; i++) {\n next = batch[i]\n next.node._id = null\n asyncRule.apply(next.node)\n next.render.call(next.parent, next.node)\n nodes.push(next.node)\n }\n console.timeStamp('FINISH asyncRender.flush()')\n batch.length = 0\n frame.once('render', () => {\n console.log('asyncRender: ', nodes)\n console.timeStamp('asyncRender.reveal()')\n const event = {bubbles: false}\n for (let i = 0, node; i < nodes.length; i++) {\n node = nodes[i]\n asyncRule.peel(node)\n $(node).trigger('render', event)\n }\n })\n }\n return {\n schedule(node, parent, render) {\n node._id = batch.length\n batch[node._id] = {node, parent, render}\n if (node._id == 0) {\n setTimeout(flush)\n }\n },\n unschedule(node) {\n if (node._id != null) {\n batch[node._id] = null\n node._id = null\n }\n }\n }\n}", "title": "" }, { "docid": "1fddf25c194644b135f5aa053bb95a03", "score": "0.57292396", "text": "static idle() {\n let onload = new Promise(resolve => {\n if(document.readyState !== \"complete\") {\n window.addEventListener(\"load\", () => resolve(), { once: true });\n } else {\n resolve();\n }\n });\n\n if(!(\"requestIdleCallback\" in window)) {\n // run immediately\n return onload;\n }\n\n // both idle and onload\n return Promise.all([\n new Promise(resolve => {\n requestIdleCallback(() => {\n resolve();\n });\n }),\n onload,\n ]);\n }", "title": "" }, { "docid": "610cd39f6b22d8ec4f501fc7c67c8e54", "score": "0.55817854", "text": "function requestWork(root,expirationTime){addRootToSchedule(root,expirationTime);if(isRendering){// Prevent reentrancy. Remaining work will be scheduled at the end of\n// the currently rendering batch.\nreturn;}if(isBatchingUpdates){// Flush work at the end of the batch.\nif(isUnbatchingUpdates){// ...unless we're inside unbatchedUpdates, in which case we should\n// flush it now.\nnextFlushedRoot=root;nextFlushedExpirationTime=Sync;performWorkOnRoot(root,Sync,false);}return;}// TODO: Get rid of Sync and use current time?\nif(expirationTime===Sync){performSyncWork();}else{scheduleCallbackWithExpiration(expirationTime);}}", "title": "" }, { "docid": "78e4781a20696df791fe073e4c084890", "score": "0.55633533", "text": "function requestWork(root: FiberRoot, expirationTime: ExpirationTime) {\n // 将 root 加入调度中\n addRootToSchedule(root, expirationTime);\n if (isRendering) {\n // Prevent reentrancy. Remaining work will be scheduled at the end of\n // the currently rendering batch.\n return;\n }\n // 判断是否需要批量更新\n // 当我们触发事件回调时,其实回调会被 batchedUpdates 函数封装一次\n // 这个函数会把 isBatchingUpdates 设为 true,也就是说我们在事件回调函数内部\n // 调用 setState 不会马上触发 state 的更新及渲染,只是单纯创建了一个 updater,然后在这个分支 return 了\n // 只有当整个事件回调函数执行完毕后恢复 isBatchingUpdates 的值,并且执行 performSyncWork\n // 想必很多人知道在类似 setTimeout 中使用 setState 以后 state 会马上更新,如果你想在定时器回调中也实现批量更新,\n // 就可以使用 batchedUpdates 将你需要的代码封装一下\n if (isBatchingUpdates) {\n // Flush work at the end of the batch.\n // 判断是否不需要批量更新\n if (isUnbatchingUpdates) {\n // ...unless we're inside unbatchedUpdates, in which case we should\n // flush it now.\n nextFlushedRoot = root;\n nextFlushedExpirationTime = Sync;\n performWorkOnRoot(root, Sync, false);\n }\n return;\n }\n\n // TODO: Get rid of Sync and use current time?\n // 判断优先级是同步还是异步,异步的话需要调度\n if (expirationTime === Sync) {\n performSyncWork();\n } else {\n // 函数核心是实现了 requestIdleCallback 的 polyfill 版本\n // 因为这个函数浏览器的兼容性很差\n // 具体作用可以查看 MDN 文档 https://developer.mozilla.org/zh-CN/docs/Web/API/Window/requestIdleCallback\n // 这个函数可以让浏览器空闲时期依次调用函数,这就可以让开发者在主事件循环中执行后台或低优先级的任务,\n // 而且不会对像动画和用户交互这样延迟敏感的事件产生影响\n scheduleCallbackWithExpirationTime(root, expirationTime);\n }\n}", "title": "" }, { "docid": "13b101b8ca4f70096f12ec0ec734456e", "score": "0.55536723", "text": "function requestWork(root,expirationTime){addRootToSchedule(root,expirationTime);if(isRendering){// Prevent reentrancy. Remaining work will be scheduled at the end of\n// the currently rendering batch.\nreturn;}if(isBatchingUpdates){// Flush work at the end of the batch.\nif(isUnbatchingUpdates){// ...unless we're inside unbatchedUpdates, in which case we should\n// flush it now.\nnextFlushedRoot=root;nextFlushedExpirationTime=Sync;performWorkOnRoot(root,Sync,false);}return;}// TODO: Get rid of Sync and use current time?\nif(expirationTime===Sync){performSyncWork();}else{scheduleCallbackWithExpirationTime(root,expirationTime);}}", "title": "" }, { "docid": "8981521e54daff869f55bac1ff6e0049", "score": "0.554916", "text": "function requestWork(root,expirationTime){addRootToSchedule(root,expirationTime);if(isRendering){// Prevent reentrancy. Remaining work will be scheduled at the end of\n// the currently rendering batch.\nreturn;}if(isBatchingUpdates){// Flush work at the end of the batch.\nif(isUnbatchingUpdates){// ...unless we're inside unbatchedUpdates, in which case we should\n// flush it now.\nnextFlushedRoot=root;nextFlushedExpirationTime=Sync;performWorkOnRoot(root,Sync,true);}return;}// TODO: Get rid of Sync and use current time?\nif(expirationTime===Sync){performSyncWork();}else{scheduleCallbackWithExpirationTime(root,expirationTime);}}", "title": "" }, { "docid": "ca898f475af7075a5644bcfaee892e9e", "score": "0.55034304", "text": "function onRequestAnimationFrame(cb) {\n if (vrDisplay && vrDisplay.isPresenting) {\n submitNextFrame = true;\n return vrDisplay.requestAnimationFrame(cb);\n } else {\n return windowRaf(cb);\n }\n }", "title": "" }, { "docid": "4a4898de157db3b393bceb9963ce7be7", "score": "0.5462158", "text": "_render() {\n\t\tthis.isRenderingInProgress = true;\n\t\tthis.disableObservers();\n\t\tthis._renderer.render();\n\t\tthis.enableObservers();\n\t\tthis.isRenderingInProgress = false;\n\t}", "title": "" }, { "docid": "f3a8420fd3685673a956a8e05a466ada", "score": "0.5445256", "text": "function shouldYield(){if(deadline===null){return false;}if(deadline.timeRemaining()>timeHeuristicForUnitOfWork){// Disregard deadline.didTimeout. Only expired work should be flushed\n// during a timeout. This path is only hit for non-expired work.\nreturn false;}deadlineDidExpire=true;return true;}// TODO: Not happy about this hook. Conceptually, renderRoot should return a", "title": "" }, { "docid": "f3a8420fd3685673a956a8e05a466ada", "score": "0.5445256", "text": "function shouldYield(){if(deadline===null){return false;}if(deadline.timeRemaining()>timeHeuristicForUnitOfWork){// Disregard deadline.didTimeout. Only expired work should be flushed\n// during a timeout. This path is only hit for non-expired work.\nreturn false;}deadlineDidExpire=true;return true;}// TODO: Not happy about this hook. Conceptually, renderRoot should return a", "title": "" }, { "docid": "ff6b93027dba497fd985ca89f4e76c8c", "score": "0.543166", "text": "_render() {\n\t\tthis._renderingInProgress = true;\n\t\tthis.disableObservers();\n\t\tthis._renderer.render();\n\t\tthis.enableObservers();\n\t\tthis._renderingInProgress = false;\n\t}", "title": "" }, { "docid": "14e3f45cb07d097c4cb8b3f144fbb6db", "score": "0.5381278", "text": "renderedCallback() {\n console.log(\"Parent renderedCallback() called\");\n }", "title": "" }, { "docid": "82e1bb9d44d521aa35312d9b87ecee5d", "score": "0.53743047", "text": "function requestWork(root,expirationTime){addRootToSchedule(root,expirationTime);if(isRendering){// Prevent reentrancy. Remaining work will be scheduled at the end of\n\t// the currently rendering batch.\n\treturn;}if(isBatchingUpdates){// Flush work at the end of the batch.\n\tif(isUnbatchingUpdates){// ...unless we're inside unbatchedUpdates, in which case we should\n\t// flush it now.\n\tnextFlushedRoot=root;nextFlushedExpirationTime=Sync;performWorkOnRoot(root,Sync,false);}return;}// TODO: Get rid of Sync and use current time?\n\tif(expirationTime===Sync){performSyncWork();}else{scheduleCallbackWithExpirationTime(root,expirationTime);}}", "title": "" }, { "docid": "a4c2195da0e1ed8d2070d76326f0f916", "score": "0.53267384", "text": "function workLoop(deadline) {\n let shouldYield = false;\n while (nextUnitOfWork && !shouldYield) {\n nextUnitOfWork = performUnitOfWork(nextUnitOfWork);\n // Check is there's time left.\n shouldYield = deadline.timeRemaining() < 1;\n }\n\n // Commit the whole fiber tree to the DOM,\n // if there is no next unit of work and\n // the work-in-progress root exists.\n if (!nextUnitOfWork && wipRoot) {\n commitRoot();\n }\n\n // Schedule another idle callback.\n requestIdleCallback(workLoop);\n}", "title": "" }, { "docid": "5b308f275f4780448b4c1efe8be0e211", "score": "0.53141683", "text": "_run(cb) {\n cb();\n }", "title": "" }, { "docid": "5b308f275f4780448b4c1efe8be0e211", "score": "0.53141683", "text": "_run(cb) {\n cb();\n }", "title": "" }, { "docid": "bc0693e08732f735675d0f5cec466f74", "score": "0.53031486", "text": "waitForRenderer() {\n return new Promise((resolve) => {\n setTimeout(() => {\n if (this.rendererReady) {\n resolve('okay');\n } else {\n resolve(this.waitForRenderer());\n }\n }, this.notifyWait);\n });\n }", "title": "" }, { "docid": "4bdeddb14073735a0cada84cfcf4e9d7", "score": "0.52696353", "text": "render() {\n var _arguments2 = arguments,\n _this = this;\n\n return _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(function* () {\n var options = _arguments2.length > 0 && _arguments2[0] !== undefined ? _arguments2[0] : {};\n\n _this.start(_objectSpread({\n enableRedraw: true,\n ignoreAnimation: true,\n ignoreMouse: true\n }, options));\n\n yield _this.ready();\n\n _this.stop();\n })();\n }", "title": "" }, { "docid": "fd677891773731a03e9df8bd3feba822", "score": "0.5262415", "text": "function run(Component, initial) {\n IOWindow.run();\n\n (function step(model0, t, initial) {\n const model1 = Reconciler.reconcile(model0, t);\n const dom = Component.render(model1, t);\n IORenderer.run('app', dom);\n\n requestAnimationFrame((t) => { \n step(model1, t, false); \n });\n }(initial, 0, true));\n}", "title": "" }, { "docid": "232907f2b239632e5c45d691ca31a0f1", "score": "0.5259161", "text": "function __gwt_latchAndLaunch() {\n var ready = true;\n \n // Are there any compilations still pending?\n if (ready && !__gwt_moduleControlBlocks.isReady()) {\n // Yes, we're still waiting on one or more compilations.\n ready = false;\n }\n\n // Has the host html onload event fired?\n if (ready && !__gwt_isHostPageLoaded) {\n // No, the host html page hasn't fully loaded.\n ready = false;\n }\n \n // Are we ready to run user code?\n if (ready) {\n // Yes: run entry points.\n __gwt_moduleControlBlocks.run();\n } else {\n // No: try again soon.\n window.setTimeout(__gwt_latchAndLaunch, __gwt_retryWaitMillis);\n }\n}", "title": "" }, { "docid": "674a6e45e2bed7ec3ff63a7eca4d606e", "score": "0.52510625", "text": "schedule__v ()\n {\n if (this.assure_b && document.visibilityState === 'hidden') return void Promise.resolve().then( this.run__v )\n //>\n if ( !this.handle_n ) this.handle_n = requestIdleCallback( this.run__v )\n }", "title": "" }, { "docid": "62c0912c40c4ce23a2ebc9c98ab4b802", "score": "0.5247429", "text": "request_render() {\n this.request_paint();\n }", "title": "" }, { "docid": "fc76249b8d19cf17e4e6b2748ce20531", "score": "0.52336013", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n }", "title": "" }, { "docid": "94458673c2706251caa02e79e81a75ec", "score": "0.5215659", "text": "_waitOnWork(callback = undefined) {\n return new Promise(resolve => {\n const wait = () => {\n if (callback == null || callback(this._component)) {\n resolve();\n } else {\n setTimeout(wait, 10);\n }\n };\n setTimeout(wait);\n });\n }", "title": "" }, { "docid": "3bd8f3595b56d8f82f55ad46387fa946", "score": "0.52097976", "text": "_sleep() { return new Promise(requestAnimationFrame); }", "title": "" }, { "docid": "6162ad6f6055918e79a41f68f93d7b0c", "score": "0.5194543", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n }", "title": "" }, { "docid": "efe153718cdf6c32dcc843ad88c4f4a2", "score": "0.5191271", "text": "function wrappedCb() {\n Dep.activeComputation = wrappedCb\n cb()\n Dep.activeComputation = null\n }", "title": "" }, { "docid": "00b7fb5b9f33b923af75aea27515e3ac", "score": "0.5168766", "text": "_suspendCallback() {\n // do nothing\n }", "title": "" }, { "docid": "276313f1fc7b1097bd9c901bf8a3bbea", "score": "0.51650685", "text": "[Symbol.asyncIterator]() {\n return this.ao_fork()}", "title": "" }, { "docid": "feeb2d179a8605de15ce4079469a198e", "score": "0.51520574", "text": "_makeNextRequest() {\n this._waiting = true;\n this._testem.emit(this._request, this._browserId);\n }", "title": "" }, { "docid": "39c2bd4ac44bd890976ac3b00370eb7d", "score": "0.5128739", "text": "requestRender() {\n if (this.configData.cesiumParams.requestRenderMode)\n this.cesiumViewer.scene.requestRender();\n }", "title": "" }, { "docid": "4967b5f3eeff7ad347dd0b99e75ace45", "score": "0.51058304", "text": "function resume() {\n renderer.resume();\n}", "title": "" }, { "docid": "d7fbaa09dc6b93bc56f43e713a82544f", "score": "0.5105741", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n }", "title": "" }, { "docid": "d7fbaa09dc6b93bc56f43e713a82544f", "score": "0.5105741", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n }", "title": "" }, { "docid": "d7fbaa09dc6b93bc56f43e713a82544f", "score": "0.5105741", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n }", "title": "" }, { "docid": "d7fbaa09dc6b93bc56f43e713a82544f", "score": "0.5105741", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n }", "title": "" }, { "docid": "d7fbaa09dc6b93bc56f43e713a82544f", "score": "0.5105741", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n }", "title": "" }, { "docid": "d7fbaa09dc6b93bc56f43e713a82544f", "score": "0.5105741", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n }", "title": "" }, { "docid": "d7fbaa09dc6b93bc56f43e713a82544f", "score": "0.5105741", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n }", "title": "" }, { "docid": "d7fbaa09dc6b93bc56f43e713a82544f", "score": "0.5105741", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n }", "title": "" }, { "docid": "d7fbaa09dc6b93bc56f43e713a82544f", "score": "0.5105741", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n }", "title": "" }, { "docid": "d7fbaa09dc6b93bc56f43e713a82544f", "score": "0.5105741", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n workInProgress = performUnitOfWork(workInProgress);\n }\n }", "title": "" }, { "docid": "e0ea06b0369939c42086c39ea20af2dd", "score": "0.51057076", "text": "awake() {\n return (async() => {\n await super.awake();\n\n if(!this.isLoader)\n Engine.container.appendChild(this.dom);\n })();\n }", "title": "" }, { "docid": "162b0bb9ca57dce28c7c3f0b2bfbb356", "score": "0.5101998", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n }", "title": "" }, { "docid": "162b0bb9ca57dce28c7c3f0b2bfbb356", "score": "0.5101998", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n }", "title": "" }, { "docid": "162b0bb9ca57dce28c7c3f0b2bfbb356", "score": "0.5101998", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n }", "title": "" }, { "docid": "162b0bb9ca57dce28c7c3f0b2bfbb356", "score": "0.5101998", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n }", "title": "" }, { "docid": "6788294cc62e0c39986cf69cbbbd2a64", "score": "0.5094846", "text": "callback() {\n return __awaiter(this, void 0, void 0, function* () {\n return {};\n });\n }", "title": "" }, { "docid": "4d19f5793d102068870350b0fdfd5a0c", "score": "0.50942916", "text": "function ensureExecutionAfterAjaxRequest(callback) {\n\t\tif (!requestOngoing) {\n\t\t\tcallback();\n\t\t} else {\n\t\t\tonCompleteCallbacks.push(callback);\n\t\t}\n\t}", "title": "" }, { "docid": "a2f9d56b5cc9129af8afce41a1ac5268", "score": "0.5070745", "text": "callOnceWhenIdle(cb) {\n if (this.count === 0) {\n cb();\n } else {\n this.callbacks.push(cb);\n }\n }", "title": "" }, { "docid": "1aa7509965dfbfd0b1cfc47fbd532a89", "score": "0.50648326", "text": "function workLoop(deadline) {\n // shouldYeild: when true, we should stop working and let browser continue\n // main tasks. Initially is false so that we execute at least 1 unit of work\n var shouldYeild = false;\n\n while (nextUnitOfWork != null && !shouldYeild) {\n nextUnitOfWork = performUnitOfWork(nextUnitOfWork);\n shouldYeild = deadline.timeRemaining() < 1;\n }\n\n if (nextUnitOfWork == null && wipRoot != null) {\n commitRoot();\n }\n\n requestIdleCallback(workLoop);\n}", "title": "" }, { "docid": "c6b413f19644fe92c1fe5070bab2611b", "score": "0.5057988", "text": "async renderedCallback() {\n if (this._hasRendered) {\n return;\n }\n try {\n this._hasRendered = true;\n //await showSpinner(this);\n await this.init();\n } catch (e) {\n //processError(this, e);\n } finally {\n //hideSpinner(this);\n }\n }", "title": "" }, { "docid": "554299d2f4ab2ba9b122d86dad1f74ae", "score": "0.5054837", "text": "function enterModificationReal() {\r\n suspendEvents += 1;\r\n }", "title": "" }, { "docid": "7aadd94e31a089937679253229639a97", "score": "0.50492793", "text": "function cb() {// ...\n }", "title": "" }, { "docid": "2b0cbcadacef9a419b0807c55b0495ce", "score": "0.5047794", "text": "function onIdleA(boundCallBack) {\n 'use strict';\n\n onIdle(function() {\n boundCallBack();\n });\n}", "title": "" }, { "docid": "dc0ad9b7834c7d25600db24909175ce6", "score": "0.5037752", "text": "async fn() {\n const wait = () => new Promise(resolve => setTimeout(resolve, 500));\n const render = async function * () {\n yield '<html><body><div><ul>';\n await wait();\n for(let i = 0; i < 10; i++) {\n yield `<li>${i}</li>`;\n await wait();\n }\n yield '</ul></div>';\n };\n const response = await callPage(async () => {\n return render();\n }, {}, {});\n const decoder = new TextDecoder();\n for await(let chunk of response.body) {\n console.log(decoder.decode(chunk));\n }\n }", "title": "" }, { "docid": "bb3a9e0a9ff32d7449d4defa6e224751", "score": "0.5031702", "text": "async _render() {\n }", "title": "" }, { "docid": "92c57b63e63ab7759e977876d75fa2d5", "score": "0.50312006", "text": "function doCallback() {\n if (callback) callback();\n }", "title": "" }, { "docid": "9c39991bfb6089db69700f5b7eea5dc4", "score": "0.5030212", "text": "function enterModificationReal() {\n suspendEvents += 1;\n }", "title": "" }, { "docid": "792172b3dd649b2776562b3f6724108f", "score": "0.5024099", "text": "function renderLoop() {\n\t\t\tvar last;\n\t\t\t// Only process the last event, probably its accurate\n\t\t\tif (renderQueue.length > 0) {\n\t\t\t // which events do we need to render?\n\t\t\t\tvar res = {};\n renderQueue.forEach(function(t) {\n res[t.name] = t;\n });\n \n TAP_ENABLED = false;\n Object.keys(res).forEach(function(k) {\n last = res[k];\n SelectionHandler.observe(null, last.name, JSON.stringify(last.data));\n });\n TAP_ENABLED = true;\n\t\t\t\t\n\t\t\t\trenderQueue = [];\n\t\t\t}\n\n\t\t\tcontentWindow.requestAnimationFrame(function() {\n\t\t\t\t// on next frame, make sure position is correct (only for middle)\n\t\t\t\tif (last && last.name === 'TextSelection:Move' && last.data.handleType === 'MIDDLE') {\n\t\t\t\t\tif (SelectionHandler._activeType !== SelectionHandler.TYPE_NONE) {\n\t\t\t\t\t\tSelectionHandler._positionHandles();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// and LOOP!\n\t\t\t\trenderLoop();\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "af4d23c0bf0874a1542a6e108b752051", "score": "0.5022121", "text": "async function main() {\n var isContinue = true\n var page = 1\n while (isContinue){\n console.log(\"Running on page\", page)\n isContinue = await fetchManagers(page)\n page+=1 \n }\n}", "title": "" }, { "docid": "df74d77be5454d9f7165a64a90e275a0", "score": "0.50199157", "text": "_renderOpened() {\n this._finishRenderOpened();\n }", "title": "" }, { "docid": "e9fcc9e170c47ad9ca5cf0571c7b1fcd", "score": "0.5011647", "text": "function flushToDom() {\n var oldDebounceRendering = n.debounceRendering; // orig\n var callbackQ = [];\n function execCallbackSync(callback) {\n callbackQ.push(callback);\n }\n n.debounceRendering = execCallbackSync;\n O(v(FakeComponent, {}), document.createElement('div'));\n while (callbackQ.length) {\n callbackQ.shift()();\n }\n n.debounceRendering = oldDebounceRendering;\n }", "title": "" }, { "docid": "25fc23add218e892b1080d84ec6b8540", "score": "0.5010918", "text": "render() {\n let that = this;\n let tmp = this.generateStaticView(this.thread);\n tmp.then(tmp => {\n $id('main').innerHTML = tmp;\n that.bind();\n });\n }", "title": "" }, { "docid": "6564849433331b7a7183794483dc2185", "score": "0.50106144", "text": "detachedCallback() {}", "title": "" }, { "docid": "6564849433331b7a7183794483dc2185", "score": "0.50106144", "text": "detachedCallback() {}", "title": "" }, { "docid": "6564849433331b7a7183794483dc2185", "score": "0.50106144", "text": "detachedCallback() {}", "title": "" }, { "docid": "6564849433331b7a7183794483dc2185", "score": "0.50106144", "text": "detachedCallback() {}", "title": "" }, { "docid": "effd179b727084e8d645a04ac49603ca", "score": "0.50096905", "text": "callback() {}", "title": "" }, { "docid": "1104c02b82a230e2bbbd9ab99735bf19", "score": "0.49980232", "text": "function processAsyncRequests() {\n\n if (processingAsync) {\n return;\n }\n\n if (_(asyncRequests).isEmpty()) {\n return;\n }\n\n var request = asyncRequests.shift();\n var r = request.url;\n var q = request.query;\n var h = request.callback;\n if (r === 'query') {\n console.log(q);\n }\n processingAsync = true;\n Lecture.onRequestTriggered(r, q);\n var beforeTime = Date.now();\n\n $.ajax({\n type: 'POST',\n url: r,\n data: {\n query: q\n },\n async: true,\n error: function() {\n processingAsync = false;\n alert(\"Server did not respond!\");\n },\n success: function(rawResponse) {\n var response = new PeaCoqResponse(rawResponse);\n\n var afterTime = Date.now();\n\n processingAsync = false;\n\n Editor.onResponse(r, q, response);\n if (Globals.activeProofTree) {\n Globals.activeProofTree.onResponse(r, q, response);\n }\n\n processAsyncRequests();\n\n h(response);\n\n }\n });\n\n}", "title": "" }, { "docid": "cd52632022be09abcf0b6c09b1e7cfda", "score": "0.4986682", "text": "_becomeIdle() {\n this.s_idle();\n this.q_wantInput();\n }", "title": "" }, { "docid": "1094eadbd2d094c64ff77be64926c43e", "score": "0.49791774", "text": "function enterModificationReal() {\n suspendEvents += 1;\n }", "title": "" }, { "docid": "cc31cdacd5d4f822d93f532e2002c891", "score": "0.4979098", "text": "forceRender() {\n this._scope.$evalAsync(_.noop);\n }", "title": "" }, { "docid": "075f0ef9798c884148e5dfad4b7aaf4d", "score": "0.49718136", "text": "function callback() {\n\t}", "title": "" }, { "docid": "8905aac73d345205187916bb050eba9b", "score": "0.49663153", "text": "rendered(callback){\n this.ready = callback;\n }", "title": "" }, { "docid": "8905aac73d345205187916bb050eba9b", "score": "0.49663153", "text": "rendered(callback){\n this.ready = callback;\n }", "title": "" }, { "docid": "8905aac73d345205187916bb050eba9b", "score": "0.49663153", "text": "rendered(callback){\n this.ready = callback;\n }", "title": "" }, { "docid": "bd1deecd20a9b4debc919169ebf34fba", "score": "0.49641442", "text": "_done() {\n return null;\n }", "title": "" }, { "docid": "49dc0e8974356fa0e0c68ea96c46fccc", "score": "0.49624094", "text": "async startAnimationLoop() {\n if (document.readyState === 'loading')\n await new Promise(resolve => setTimeout(resolve))\n\n if (this.animationLoopStarted) return\n\n this.animationLoopStarted = true\n\n let timestamp = null\n\n while (this.animationLoopStarted) {\n timestamp = await this.animationFrame()\n\n this.runRenderTasks(timestamp)\n\n // wait for the next microtask before continuing so that SkateJS\n // updated methods (or any other microtask handlers) have a\n // chance to handle changes before the next renderNodes call.\n //\n // TODO add test to make sure behavior size change doesn't\n // happen after render\n await Promise.resolve()\n\n this.renderNodes(timestamp)\n\n // If no tasks are left, stop the animation loop.\n if (!this.allRenderTasks.length)\n this.animationLoopStarted = false\n }\n }", "title": "" }, { "docid": "d33cd11a5da65f06770cc5a9c5e8f6cf", "score": "0.49604988", "text": "function main() {\n\t\t\ttry {\n if (moDecArmed) {\n render(which);\n }\n\t\t\t} catch(e) {\n\t\t\t\tconsole.log(e);\n\t\t\t\treturn;\n\t\t\t}\n\n // asks browser to call this function on \n // new animation frame. \n raf(main.bind(this));\n\t\t}", "title": "" }, { "docid": "b263b1224738fcaa60f73d71edc8d0f9", "score": "0.49455675", "text": "async waitReady()\r\n\t{\r\n\t}", "title": "" }, { "docid": "79b417c9907889279a45d5f924df7b83", "score": "0.4934921", "text": "forceRender() {}", "title": "" }, { "docid": "941fc7edc634e5858bf5e73c42b86410", "score": "0.49317864", "text": "function aloop(fn) {\n Html.Window.setReqAnimFrame();\n (function loop() {\n if (! loop.cancel) {\n fn(function(onfinish) {\n loop.cancel = 1;\n })\n Html.Window.reqAnimFrame(loop);\n }\n })();\n}", "title": "" }, { "docid": "0f899532251dc4a24bf1fe12a2a9b36f", "score": "0.49281546", "text": "function callback() {\r\n }", "title": "" }, { "docid": "12e7b6f958a1f8e540267b08672fc292", "score": "0.49237996", "text": "function next() {\n console.timeEnd('updateDOM');\n if (++count === TOTAL_CYCLE_COUNT) {\n done();\n } else {\n process.nextTick(runNext);\n // setTimeout(runNext, 200);\n // runNext();\n }\n }", "title": "" }, { "docid": "3dcbbdb4a76669554e76f3232dff3aaf", "score": "0.49212837", "text": "async run() {\n // Implement this method and do some work here.\n return null;\n }", "title": "" }, { "docid": "3dcbbdb4a76669554e76f3232dff3aaf", "score": "0.49212837", "text": "async run() {\n // Implement this method and do some work here.\n return null;\n }", "title": "" }, { "docid": "3c59aba29b7d260c76f8863aa70fdb57", "score": "0.49188566", "text": "function main() {\n if(!running) {\n return;\n }\n\n var now = Date.now();\n var dt = (now - then) / 1000.0;\n\n update(dt);\n render();\n\n then = now;\n requestAnimFrame(main);\n }", "title": "" }, { "docid": "4eeff596658e783d2afac18ac63c3045", "score": "0.49146128", "text": "refresh() {\n this.needsUpdate = true;\n if (this.deferred) {\n if (!this.renderloopActive) {\n this.setuprenderloop();\n }\n } else {\n this.render();\n }\n }", "title": "" }, { "docid": "4eeff596658e783d2afac18ac63c3045", "score": "0.49146128", "text": "refresh() {\n this.needsUpdate = true;\n if (this.deferred) {\n if (!this.renderloopActive) {\n this.setuprenderloop();\n }\n } else {\n this.render();\n }\n }", "title": "" }, { "docid": "5c927a1a4f44a79a8deae7a92ee2eb7e", "score": "0.49012408", "text": "mutatedAttributesCallback() {\n if (this.container_) {\n this.scheduleRender_();\n }\n }", "title": "" }, { "docid": "554152a77775aee6d81e658c2e971101", "score": "0.48939005", "text": "function doNonBlockingLoop(array) {\n array.forEach(function (item) {\n setTimeout(function () {\n // do some browser work\n // like getting data from a database, requesting a page, etc.\n console.log(item);\n }, 0);\n });\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.48887217", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.48887217", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.48887217", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.48887217", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.48887217", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.48887217", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.48887217", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" }, { "docid": "6e38e4de4f22b88a71aeadcd2a2e145f", "score": "0.48887217", "text": "function workLoopSync() {\n // Already timed out, so perform work without checking if we need to yield.\n while (workInProgress !== null) {\n performUnitOfWork(workInProgress);\n }\n}", "title": "" } ]
f8cc75b4f7567b617f5e669954e64442
Returns a ref that is immediately updated with the new value
[ { "docid": "ad3852096010a7b63ad1b727cfbfbf73", "score": "0.6575261", "text": "function useUpdatedRef(value) {\n var valueRef = (0, _react.useRef)(value);\n valueRef.current = value;\n return valueRef;\n}", "title": "" } ]
[ { "docid": "fa2f3438f9dbf28ba271516266545b8b", "score": "0.6976267", "text": "function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n }", "title": "" }, { "docid": "d635ba33815d804166591d76e575f6da", "score": "0.6848316", "text": "function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}", "title": "" }, { "docid": "d635ba33815d804166591d76e575f6da", "score": "0.6848316", "text": "function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}", "title": "" }, { "docid": "d635ba33815d804166591d76e575f6da", "score": "0.6848316", "text": "function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}", "title": "" }, { "docid": "d635ba33815d804166591d76e575f6da", "score": "0.6848316", "text": "function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}", "title": "" }, { "docid": "d635ba33815d804166591d76e575f6da", "score": "0.6848316", "text": "function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}", "title": "" }, { "docid": "d635ba33815d804166591d76e575f6da", "score": "0.6848316", "text": "function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}", "title": "" }, { "docid": "d635ba33815d804166591d76e575f6da", "score": "0.6848316", "text": "function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}", "title": "" }, { "docid": "d635ba33815d804166591d76e575f6da", "score": "0.6848316", "text": "function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}", "title": "" }, { "docid": "d635ba33815d804166591d76e575f6da", "score": "0.6848316", "text": "function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}", "title": "" }, { "docid": "d635ba33815d804166591d76e575f6da", "score": "0.6848316", "text": "function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}", "title": "" }, { "docid": "d635ba33815d804166591d76e575f6da", "score": "0.6848316", "text": "function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}", "title": "" }, { "docid": "d635ba33815d804166591d76e575f6da", "score": "0.6848316", "text": "function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}", "title": "" }, { "docid": "d635ba33815d804166591d76e575f6da", "score": "0.6848316", "text": "function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}", "title": "" }, { "docid": "14038aed0536e3bf2c684a3bafc76b71", "score": "0.67235386", "text": "function useUpdatedRef(value) {\n var valueRef = React.useRef(value);\n valueRef.current = value;\n return valueRef;\n}", "title": "" }, { "docid": "d3a9269b0bf1236c6e3270e16d7a75ea", "score": "0.6704408", "text": "function createRef() {\n var refObject = (function (element) {\n refObject.current = element;\n });\n // This getter is here to support the deprecated value prop on the refObject.\n Object.defineProperty(refObject, 'value', {\n get: function () {\n return refObject.current;\n }\n });\n refObject.current = null;\n return refObject;\n}", "title": "" }, { "docid": "2ed50c0f688ccdbf75e99fa4a5b7bba3", "score": "0.66763043", "text": "function useUpdatedRef$1(value) {\n\t var valueRef = (0, _react.useRef)(value);\n\t valueRef.current = value;\n\t return valueRef;\n\t}", "title": "" }, { "docid": "8fc99fdf9630d13c39a821555359815b", "score": "0.6519988", "text": "UpdateValue()\n {\n this.value = this.GetValueAt();\n }", "title": "" }, { "docid": "930ea35df16d989444c3f87b7a289c69", "score": "0.6488133", "text": "function assignRef(ref, value) {\n if (ref == null) return;\n\n if ((0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_0__.isFunction)(ref)) {\n ref(value);\n return;\n }\n\n try {\n // @ts-ignore\n ref.current = value;\n } catch (error) {\n throw new Error(\"Cannot assign value '\" + value + \"' to ref '\" + ref + \"'\");\n }\n}", "title": "" }, { "docid": "34da9b29f1b54a56575d6968c641049b", "score": "0.6484448", "text": "function useUpdatedRef(value) {\n var valueRef = Object(__WEBPACK_IMPORTED_MODULE_0_react__[\"useRef\"])(value);\n valueRef.current = value;\n return valueRef;\n}", "title": "" }, { "docid": "9a9a453e8744c329e2a9a92f56aa7282", "score": "0.6473148", "text": "function assignRef(ref, value) {\n if (ref == null) return;\n\n if (isFunction(ref)) {\n ref(value);\n } else {\n try {\n ref.current = value;\n } catch (error) {\n throw new Error(\"Cannot assign value \\\"\" + value + \"\\\" to ref \\\"\" + ref + \"\\\"\");\n }\n }\n}", "title": "" }, { "docid": "79fb82d3368f529eff98f1976fc9c0bd", "score": "0.6441827", "text": "function useUpdatedRef(value) {\n var valueRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(value);\n valueRef.current = value;\n return valueRef;\n}", "title": "" }, { "docid": "79fb82d3368f529eff98f1976fc9c0bd", "score": "0.6441827", "text": "function useUpdatedRef(value) {\n var valueRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(value);\n valueRef.current = value;\n return valueRef;\n}", "title": "" }, { "docid": "b965812a0aaff7f19bcf6d5ce687e8b2", "score": "0.64319086", "text": "function useUpdatedRef(value) {\n var valueRef = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useRef\"])(value);\n valueRef.current = value;\n return valueRef;\n}", "title": "" }, { "docid": "b965812a0aaff7f19bcf6d5ce687e8b2", "score": "0.64319086", "text": "function useUpdatedRef(value) {\n var valueRef = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useRef\"])(value);\n valueRef.current = value;\n return valueRef;\n}", "title": "" }, { "docid": "b965812a0aaff7f19bcf6d5ce687e8b2", "score": "0.64319086", "text": "function useUpdatedRef(value) {\n var valueRef = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useRef\"])(value);\n valueRef.current = value;\n return valueRef;\n}", "title": "" }, { "docid": "b965812a0aaff7f19bcf6d5ce687e8b2", "score": "0.64319086", "text": "function useUpdatedRef(value) {\n var valueRef = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useRef\"])(value);\n valueRef.current = value;\n return valueRef;\n}", "title": "" }, { "docid": "b965812a0aaff7f19bcf6d5ce687e8b2", "score": "0.64319086", "text": "function useUpdatedRef(value) {\n var valueRef = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useRef\"])(value);\n valueRef.current = value;\n return valueRef;\n}", "title": "" }, { "docid": "1eb315993b7565c99f7ef9a2c77c452b", "score": "0.63312113", "text": "function assignRef(ref, value) {\n if (ref == null) return;\n\n if ((0, _assertion.isFunction)(ref)) {\n ref(value);\n return;\n }\n\n try {\n //@ts-ignore\n ref.current = value;\n } catch (error) {\n throw new Error(\"Cannot assign value '\" + value + \"' to ref '\" + ref + \"'\");\n }\n}", "title": "" }, { "docid": "fafd33992d437bddc6266a598b4f0f4a", "score": "0.6316139", "text": "function createRef() {\r\n var refObject = {\r\n current: null\r\n }\r\n\r\n {\r\n Object.seal(refObject)\r\n }\r\n\r\n return refObject\r\n }", "title": "" }, { "docid": "2826d726a7ed7abfaaabef0d87bb83fa", "score": "0.63113284", "text": "function assignRef(ref, value) {\n if (ref == null) return;\n\n if (typeCheck_dist_reachUtilsTypeCheck.isFunction(ref)) {\n ref(value);\n } else {\n try {\n ref.current = value;\n } catch (error) {\n throw new Error(\"Cannot assign value \\\"\" + value + \"\\\" to ref \\\"\" + ref + \"\\\"\");\n }\n }\n}", "title": "" }, { "docid": "cc0695706ab36efd3f9ecbbf9f99e957", "score": "0.62890404", "text": "function useCommittedRef(value) {\n var ref = React.useRef(value);\n React.useEffect(function () {\n ref.current = value;\n }, [value]);\n return ref;\n }", "title": "" }, { "docid": "c037414349ae45db843880cf6b59c896", "score": "0.6277646", "text": "get ref() {\n return !ref ? {} : ref;\n }", "title": "" }, { "docid": "a38c321a2ada829c2b940cde7dfe2cbb", "score": "0.6234451", "text": "function createRef() {\n var refObject = {\n current: null,\n };\n\n {\n Object.seal(refObject);\n }\n\n return refObject;\n }", "title": "" }, { "docid": "9de8aed0ee767cf352da5f16ee704efa", "score": "0.6223622", "text": "function useCommittedRef(value) {\n var ref = React.useRef(value);\n React.useEffect(function () {\n ref.current = value;\n }, [value]);\n return ref;\n}", "title": "" }, { "docid": "49a6ac9bf63ec55751e01874b2856901", "score": "0.6222171", "text": "function createRef() {\n var refObject = {\n current: null\n };\n\n {\n Object.seal(refObject);\n }\n\n return refObject;\n }", "title": "" }, { "docid": "be3aea7331cd4250ab8e9f30f1bae3f7", "score": "0.6217892", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "f0aa64a40a345d018a032bbbc1dd7f89", "score": "0.61971647", "text": "function createRef() {\n var refObject = {\n current: null,\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "b1c66a863c78a569c00b0b9f3913f933", "score": "0.61962605", "text": "function createRef() {\n var refObject = {\n current: null\n };\n\n {\n Object.seal(refObject);\n }\n\n return refObject;\n }", "title": "" }, { "docid": "b1c66a863c78a569c00b0b9f3913f933", "score": "0.61962605", "text": "function createRef() {\n var refObject = {\n current: null\n };\n\n {\n Object.seal(refObject);\n }\n\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.6194404", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "49d3dd45f00b3cc9e87643f202cfab34", "score": "0.6184509", "text": "function MakeRef() {\n return { value: false };\n}", "title": "" }, { "docid": "49d3dd45f00b3cc9e87643f202cfab34", "score": "0.6184509", "text": "function MakeRef() {\n return { value: false };\n}", "title": "" }, { "docid": "49d3dd45f00b3cc9e87643f202cfab34", "score": "0.6184509", "text": "function MakeRef() {\n return { value: false };\n}", "title": "" }, { "docid": "b395d499e1028456b34b6fa8bc62ca47", "score": "0.61760634", "text": "function createRef() {\n\t var refObject = {\n\t current: null\n\t };\n\t {\n\t Object.seal(refObject);\n\t }\n\t return refObject;\n\t }", "title": "" }, { "docid": "80cf29e92a6bcb8b73fa720501beb1a2", "score": "0.61583006", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "778428f0a08b2ae406fb2f4734fd2973", "score": "0.61518884", "text": "function fillRef(ref, node) {\n if (typeof ref === 'function') {\n ref(node);\n } else if (_typeof(ref) === 'object' && ref && 'current' in ref) {\n ref.current = node;\n }\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" }, { "docid": "c62443de706a670abe2f994370118bbb", "score": "0.61238974", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n}", "title": "" } ]
d39ff9b8620b2a34d751492ce9acf186
add a reply to a comment
[ { "docid": "12bd3b49036d09297fe10e5ac1d53ddf", "score": "0.71209633", "text": "addReply({ params, body}, res) {\n Comment.findOneAndUpdate(\n { _id: params.commentId },\n { $push: { replies: body }},\n { new: true, runValidators: true }\n )\n .then(dbPizzaData => {\n if(!dbPizzaData) {\n res.status(404).json({ message: 'No 🍕 found with this Id!' });\n return;\n }\n res.json(dbPizzaData);\n })\n .catch(err => res.json(err));\n }", "title": "" } ]
[ { "docid": "87275ee999a12742748ab63666d50d7d", "score": "0.76854557", "text": "async addReply(conId, comment, posterId) {\n if (!conId || !ObjectId.isValid(conId)) throw \"you must provide a valid id\";\n if (!posterId || !typeof posterId === \"string\")\n throw \"you must provide a poster id\";\n if (!comment || !typeof comment === \"string\")\n throw \"you must provide a comment\";\n\n const replyCon = await this.getConById(conId);\n let commentsArray = replyCon.commentsArray;\n const replyComment = {\n posterId: posterId,\n comment: comment\n };\n commentsArray.push(replyComment);\n let updateData = {\n commentsArray: commentsArray\n };\n\n const conCollection = await conversation();\n const updatedInfo = await conCollection.updateOne(\n { _id: ObjectId(conId) },\n dot.flatten(updateData)\n );\n if (updatedInfo.modifiedCount === 0) throw \"can not add reply successful\";\n return this.getConById(conId);\n }", "title": "" }, { "docid": "958e2db667dd62df6c68a4bf2dc7ddd0", "score": "0.7411788", "text": "function addComment(comment, reply) {\r\n let replyCalled = false;\r\n let proceedCounter = 0;\r\n\r\n function replyOnce(err, result) {\r\n if (!replyCalled) {\r\n replyCalled = true;\r\n reply(err, result);\r\n }\r\n }\r\n\r\n isCommentingEnabled(comment.post, (err, enabled) => {\r\n if (err) return replyOnce(err)\r\n if (!enabled) return replyOnce(new Error('Commenting is disabled.'));\r\n\r\n return proceed();\r\n });\r\n\r\n isUserAllowedToComment(comment.user, (err, result) => {\r\n if (err) return replyOnce(err)\r\n if (!result) {\r\n return replyOnce(\r\n new Error('The user is not allowed to comment on this post.')\r\n );\r\n }\r\n\r\n return proceed();\r\n });\r\n\r\n function proceed() {\r\n proceedCounter++;\r\n\r\n if (proceedCounter == 2) {\r\n // this will run after both function above are finnished\r\n insertComment(comment.post, comment.user, comment.message, (err, result) => {\r\n if (err) return reply(err);\r\n\r\n return replyOnce(null, result.record);\r\n });\r\n }\r\n }\r\n}", "title": "" }, { "docid": "e0b0ff10040d9d3da3207577621fb16e", "score": "0.724212", "text": "function addReply(reply) {\n var commentId = reply.commentId\n var postId = reply.postId\n\n var newReply = {\n _id: UtilService.makeId(12),\n postId: reply.postId,\n commentId: reply.commentId,\n txt: reply.txt,\n // snippet: {\n // lang: reply.snippet.lang,\n // html: newComment.snippet.html,\n // css: newComment.snippet.css,\n // code: newComment.snippet.code\n // },\n createdAt: Date.now(),\n creator: reply.creator\n }\n\n\n return mongoService.connect()\n .then(db => db.collection('posts').updateOne({ _id: new ObjectId(postId), \"comments._id\": commentId }, { $push: { \"comments.$.replies\": newReply } }))\n .then(res => {\n console.log('result::::::::::::', res);\n\n var addedReply = res\n return addedReply;\n })\n}", "title": "" }, { "docid": "1ffcec75f3121bb820edc10fc2c31a1c", "score": "0.72024536", "text": "function replyToComment()\r\n{ \r\n var id = this.getAttribute('commentId');\r\n var comment = document.getElementById('c' + id);\r\n var username = comment.getAttribute('username');\r\n var commentField = document.getElementById('comment');\r\n\r\n if (commentField.value.length > 0) {\r\n commentField.value += \"\\n\\n\";\r\n }\r\n commentField.value += '@' + username + ': ';\r\n\r\n // original digg handler\r\n setupcreply(id, username);\r\n \r\n // why is this necessary? because we can't return from greasemonkey?\r\n window.setTimeout(\"document.getElementById('comment').focus()\", 100);\r\n \r\n return false;\r\n}", "title": "" }, { "docid": "b9c9de00de2d0c74a7894c71d6173d2f", "score": "0.708616", "text": "async addReply(comment, postID, commentID, authToken) {\n return addReply(client.baseURL, comment, postID, commentID, authToken);\n }", "title": "" }, { "docid": "8b17d8229b7385e5cb1c7fc4ed812251", "score": "0.6935588", "text": "function writeNewReply(userInput, newpost){\n\t\tnewpost.style.display = \"flex\";\n\t\tvar textNode = document.createTextNode(userInput);\n\t\tvar origin = document.getElementsByClassName(\"commentSkeleton\")[0].childNodes[3];\n\t\torigin.insertBefore(textNode, origin.childNodes[3]);\n\t\tdocument.getElementsByClassName(\"commentSkeleton\")[0].className = \"comment media\";\n\t\taddListenersLikes();\n\t}", "title": "" }, { "docid": "bb81319dc32b932752070bf219f2ee2f", "score": "0.6662754", "text": "function addComment(pid, commentText) {\n return new Promise(function(resolve, reject) {\n if(typeof pid === 'undefined' || pid === null) { reject(); return; }\n if(typeof commentText !== 'string' || commentText.trim() === '') { reject(); return; }\n\n $.post({\n url: `https://${location.hostname}/posts/${pid}/comments`,\n data: {\n 'fkey': fkey,\n 'comment': commentText,\n }\n })\n .done(resolve)\n .fail(reject);\n });\n }", "title": "" }, { "docid": "19543d01cb3e8e5a1acf57de60845240", "score": "0.6640471", "text": "function replyEvent() {\n let comments = document.querySelectorAll('.comments-view .comment-body')\n\n comments.forEach(comment => {\n let replyBtn = comment.querySelector('.reply-btn');\n replyBtn.addEventListener('click', event => {\n event.preventDefault();\n\n reply(comment)\n })\n })\n}", "title": "" }, { "docid": "cddd179f4978b6bb03d9bd35145f6d7b", "score": "0.6582685", "text": "function initReply(reply, parentId)\r\n{\r\n var parent = $('c' + parentId);\r\n reply = initComment(reply);\r\n reply.setAttribute('parentId', parentId);\r\n return reply;\r\n}", "title": "" }, { "docid": "c0921ca017f8dc85e50070e6c76c2938", "score": "0.65825427", "text": "function reply_to_this_comment(replyButton,userName){\n\n console.log(\"222yippie!!!!\");\n\n //get comment\n //commentBlock is the entirety of this particular comment. \n var commentBlock = $(replyButton).parent();\n\n //if it exists (that is, there is a history, and it's not an original, stand alone comment) aka we're replying to someone\n //elses reply. \n // if(commentBlock.children(\".loc_of_comment_in_forum\").length){\n // //get the user name and val and append it to the already existing string. \n // var new_history = commentBlock.children(\".loc_of_comment_in_forum\").value + \"@\" + userName + \"*\" + commentBlock.children(\".edit_comment\").attr(\"id\").substr(1);\n\n // }\n // //if there is no history (standalone comment )\n // else{\n // var new_history = userName + \"*\" + commentBlock.children(\".edit_comment\").attr(\"id\").substr(1);\n\n // }\n\n var temp_loc_of_comment_in_forum = commentBlock.children(\".hiddenHistoryValue\").attr('value');\n\n console.log(\"userName is: \" + userName);\n\n console.log(commentBlock);\n\n console.log(\"temp_loc_of_comment_in_forum is: \" + temp_loc_of_comment_in_forum);\n\n commentBlock.append(comment_object_body(\"reply\",userName,temp_loc_of_comment_in_forum));\n\n //commentBlock.append(replyCommentBlock(userName,history_string));\n\n}", "title": "" }, { "docid": "1a952c89335ca2e518c4db0214f19c34", "score": "0.6572066", "text": "function addDiscussionCommentReply(\n courseId,\n discussionId,\n commentId,\n contentObject,\n isUserAnonymous\n ) {\n const data = Course.generateDiscussionCommentReplyJSON(\n null,\n currentUser.uid,\n userObject.name,\n contentObject,\n new Date().valueOf(),\n [],\n userObject.isInstructor,\n isUserAnonymous\n );\n Course.addDiscussionCommentReply(courseId, discussionId, commentId, data);\n }", "title": "" }, { "docid": "c5be1bfa272e45ef1b3d84bdf459f14e", "score": "0.65598935", "text": "function postComment(response, param) {\n updater_comments.start(response, param);\n}", "title": "" }, { "docid": "41d72ed91186affbda3b2fc23085fedc", "score": "0.6516104", "text": "function setReplyTo(reply_button) {\n let container = $(reply_button).closest('.comments__thread-container')[0];\n let id = container.dataset.id;\n let username = container.getElementsByClassName('comment__user-name')[0].textContent;\n let form = document.getElementsByClassName('comments__form')[0];\n let reply_to = $(form).find('[name=\"reply_to\"]');\n if (reply_to.length) {\n reply_to[0].setAttribute('value', id);\n } else {\n $(form).prepend('<input name=\"reply_to\" type=\"hidden\" value=\"' + id + '\">');\n }\n let textarea = form.getElementsByClassName('comments__form__text-field')[0];\n textarea.setAttribute('placeholder', 'Ваш ответ пользователю ' + username);\n //form.parentNode.removeChild(form);\n let comment_to_reply = container.getElementsByClassName('comment')[0];\n container.insertBefore(form, comment_to_reply.nextSibling)\n /*$('html, body').animate({\n scrollTop: $(\"#comments\").offset().top - 2 * getRemSize()\n }, 500);*/\n $(form).scrollintoview({duration: 500});\n textarea.focus();\n}", "title": "" }, { "docid": "41c5616d657ba237a74664d6916d81ef", "score": "0.6508378", "text": "function PostComment() {\n var message = commentBuffer.shift();\n var encryptedMessage = EncryptMessage(message, true);\n SendMessage(encryptedMessage);\n}", "title": "" }, { "docid": "525a6081337bb096b9e59d364bde6cba", "score": "0.64917225", "text": "function addComment (req, res) {\n var comment = {\n userId: req.user.userId,\n text: req.body.text,\n subjectId: req.params.res_id,\n created: new Date()\n };\n\n promiseResponse(commentStore.save(comment), res);\n}", "title": "" }, { "docid": "05f1f82535dfaa118af70e69a7200600", "score": "0.64804184", "text": "function setupcreply(parentid, parentusername) {\r\n var info = document.getElementById('cforminfo');\r\n var baseurl = window.location.href.replace(/(\\?.+)?\\#.*$/i, '');\r\n info.innerHTML = 'Replying to comment by '+parentusername+' (<a href=\"'+baseurl+'#creplyform\" onclick=\"return(cancelcreply())\">cancel</a>)';\r\n info.style.display = '';\r\n document.getElementById('cformreplyto').value = parentid;\r\n var creturn = document.getElementById('cformreturn');\r\n creturn.value = creturn.value.replace(/\\#.*$/i,'')+'#c'+parentid;\r\n document.getElementById('comment').focus();\r\n}", "title": "" }, { "docid": "3bd33a87ec0746e28262defef4d0595c", "score": "0.64751047", "text": "_addComment(comment, options, callback) {\n var ticketModel = options.ticketModel;\n\n ticketModel.comments.push(comment);\n\n callback(null, comment, options);\n }", "title": "" }, { "docid": "d20f6e22e00411a0853e37ba8edc39ff", "score": "0.63710755", "text": "function openReply() {\n if (typeof variables['reply'] !== 'undefined') {\n let elem = document.getElementsByClassName('comment-' + variables['reply'])[0];\n elem.classList.remove('d-none');\n elem.parentElement.children[(elem.parentElement.children.length - 1)].classList.add('d-none');\n elem.children[(elem.children.length - 2)].scrollIntoView();\n }\n}", "title": "" }, { "docid": "fcf1187e60fc0aff6caf952cf25ff073", "score": "0.63206476", "text": "function postComment(commentText, chirp) {\n\n var chirpIndex = vm.chirps.indexOf(chirp);\n\n ChirpFactory.postComment(commentText, chirp.ChirpId).then(function(response) {\n\n vm.chirps[chirpIndex].Comments.push(response.data);\n toastr.success('Comment Successfully Posted!');\n },\n function(error) {\n if (typeof error === 'object') {\n toastr.error('There was an error: ' + error.data);\n } else {\n toastr.info(error);\n }\n });\n }", "title": "" }, { "docid": "a362652a865fa528f83006f492e3b138", "score": "0.6295713", "text": "function addcomment() {\r\n}", "title": "" }, { "docid": "a362652a865fa528f83006f492e3b138", "score": "0.6295713", "text": "function addcomment() {\r\n}", "title": "" }, { "docid": "e1424be5ed05852f7bfb9e9f761bd1d4", "score": "0.6273459", "text": "function addComment(text) {\n return {\n type: ADD_COMMENT,\n text,\n id: uuid.v4()\n }\n}", "title": "" }, { "docid": "7800f6a1fde04282f899d6938b164879", "score": "0.6252198", "text": "function makeNewComment(author, post, message) {\r\n var origPost = posts.find(function (ogPOST) {\r\n if (ogPOST.id == post) {\r\n return ogPOST;\r\n }\r\n });\r\n\r\n var commentsNum = origPost.comments.length + 1;\r\n if (message.length > 0) {\r\n origPost.comments.push({\r\n id: commentsNum,\r\n author: author,\r\n message: message,\r\n });\r\n\r\n buildPostList();\r\n }\r\n\r\n $(document).scrollTop();\r\n}", "title": "" }, { "docid": "961704be80fdcc2d461d2ddf2d777279", "score": "0.6242503", "text": "function updateReplyCounter(e){\n\t\tvar commentReplyOriginal = e.target.parentNode.parentNode.parentNode.parentNode.previousSibling.previousSibling.childNodes[3].innerHTML;\n\t\tvar splitString = commentReplyOriginal.split(\" \");\n\t\tif (splitString[0] === \"Reply\"){\n\t\t\tvar addedReplyNum = 1\n\t\t\treturn addedReplyNum\n\t\t}\n\t\telse {\n\t\t\tvar replyNum = parseInt(splitString[0]);\n\t\t\tvar addedReplyNum = replyNum + 1;\n\t\t\treturn addedReplyNum;\n\t\t}\n\t}", "title": "" }, { "docid": "908b67d364fc93236261fa26362bbbaf", "score": "0.62412584", "text": "function addComment(name, comment) {\n $.post(\"/api/feedback\", {\n name: name,\n comment: comment\n })\n .then(() => {\n alert(\"Thank you for your suggestion!\");\n })\n .catch();\n }", "title": "" }, { "docid": "0ae2a29eaea4b2060105e7f9ccb51eb7", "score": "0.62243956", "text": "function addComment(postId, text) {\n\tlet url = 'https://graph.facebook.com/v2.8/' + postId + '/comments';\n\trequest({\n\t\turl: url,\n\t\tqs: {access_token:token},\n\t\tmethod: 'POST',\n\t\tjson: {\n\t\t\tmessage: text,\n\t\t}\n\t}, function(error, response, body) {\n\t\tif (error) {\n\t\t\tconsole.log('Error posting comment to page from addComment fn: ', error)\n\t\t} else if (response.body.error) {\n\t\t\tconsole.log('Error from addComment fn: ', response.body.error)\n\t\t} else {\n //console.log(\"Comment to \" + postId + \" was added!\")\n\t\t}\n\t})\n}", "title": "" }, { "docid": "89b87c3f48d63bd42b1e3377bc068a25", "score": "0.618453", "text": "function addComment(data) {\n socket.emit('new-comment', data);\n}", "title": "" }, { "docid": "a82e1114c5a7f460a40d9eba990d5387", "score": "0.61813885", "text": "function addComments(comment){\r\n var defer = $q.defer();\r\n $http.post(apiUrl + 'comments', comment)\r\n .then(\r\n function(response){\r\n defer.resolve(response); \r\n },\r\n function(err){\r\n defer.reject(err.data.message);\r\n toastr.error(error.data);\r\n }\r\n );\r\n return defer.promise;\r\n }", "title": "" }, { "docid": "5f5b018b2f7137b122462306f6c71139", "score": "0.61756516", "text": "function ParseAddEventComment(eventId, owner, content, option) {\n var Comment = Parse.Object.extend(\"Comment\");\n var comment = new Comment;\n var currentUser = Parse.User.current();\n comment.set(\"eventId\", eventId);\n comment.set(\"owner\",owner);\n comment.set(\"ownerName\",currentUser.get(\"name\"));\n comment.set(\"content\",content);\n if ((\"replyToUserId\" in option) && (option.replyToUserId != null)) {\n comment.set(\"replyToUserId\", option.replyToUserId);\n }\n comment.save(null, {\n success: function(comment) {\n option.displayNewComment(comment);\n ParseUpdateEventCommentNumber(1, eventId, option);\n },\n error: function(comment, error){\n option.errorFunction(\"Error: \" + error.code + \" \" + error.message);\n }\n });\n}", "title": "" }, { "docid": "97e144deab23964335583ef562cc2e4d", "score": "0.6164664", "text": "async add_comment(postId, text) {\n var address = await this.props.nos.getAddress();\n console.log(address);\n \n var operation = \"Comment\";\n var args = [address, postId, text];\n var invoke = {\n scriptHash,\n operation,\n args};\n //encodeArgs: false };\n\n var txid = await this.props.nos.invoke(invoke);\n\n // DEBUG\n console.log(txid);\n }", "title": "" }, { "docid": "97e144deab23964335583ef562cc2e4d", "score": "0.6164664", "text": "async add_comment(postId, text) {\n var address = await this.props.nos.getAddress();\n console.log(address);\n \n var operation = \"Comment\";\n var args = [address, postId, text];\n var invoke = {\n scriptHash,\n operation,\n args};\n //encodeArgs: false };\n\n var txid = await this.props.nos.invoke(invoke);\n\n // DEBUG\n console.log(txid);\n }", "title": "" }, { "docid": "a0ea29741cce0683fbf755d172a07655", "score": "0.6152168", "text": "function addComment(){\n\tlet comment_input = $(\"#new-comment\")[0]\n\tlet comment = comment_input.value;\n\tlet event_id = parseInt($(\".js-next\").attr(\"data-id\"));\n\tlet user_id = parseInt($(\".event-title\").attr(\"user-id\"));\n\tlet commentData = {comment: { event_id: event_id, note: comment, user_id: user_id }};\n\n\t$.post(`/events/${event_id}/comments`, commentData, function(result) {\n\t\tcomment_input.value = \"\";\n\n\t\tcommentData = result[\"data\"][\"attributes\"];\n\t\tlet id = result[\"data\"][\"id\"];\n\t\tvar comment = new Comment(id, event_id, commentData[\"email\"], commentData[\"note\"]);\n\t\t\n\t\tif ($(\".no-comment\").length){\n\t\t\t$(\".comments-table\").html(comment.newComment());\n\t\t}\n\t\telse {\n\t\t\t$(\".comments-table\").append(comment.newComment());\n\t\t}\n\t});\n}", "title": "" }, { "docid": "a0259c8f95b49d4bacdfecfec752c152", "score": "0.61438304", "text": "function setUpSkeletonReply(userInput, e){\n\t\tvar skeleton = document.getElementsByClassName(\"commentSkeleton\")[0];\n\t\tvar cloneSkeleton = skeleton.cloneNode(true);\n\t\tvar replyClass = e.target.parentNode.parentNode.parentNode.parentNode\n\t\tvar newPost = replyClass.insertBefore(cloneSkeleton, e.target.parentNode.parentNode.parentNode);\n\t\twriteNewReply(userInput, newPost);\n\t}", "title": "" }, { "docid": "3ca87e78756e4cb971e388c635e6eeb2", "score": "0.61161596", "text": "function addComment(userID, comment) {\r\n var record = {\r\n id: \"randomID\",\r\n userID,\r\n text: comment\r\n };\r\n\r\n // var elements = buildCommentElement(record);\r\n // commentsList.appendChild(elements)\r\n}", "title": "" }, { "docid": "517996fe86dbe8a50ba965575d60cc69", "score": "0.611022", "text": "function addComment(comment, postId ){\n return {\n type: ADD_COMMENT,\n payload: { comment, postId }\n }\n}", "title": "" }, { "docid": "05217d1aca82313ebc067bfea568d200", "score": "0.61093795", "text": "function reply_to_post (pid) {\n var npc = $('#new_post_content')[0];\n npc.value += \">>\" + parseInt(pid) + \" \";\n npc.focus();\n}", "title": "" }, { "docid": "56774aea3a902e145b0c60fa72b84110", "score": "0.6102777", "text": "function pushReplyComment(comments, lastComment, isCommenter) {\n var isNotified = false;\n angular.forEach(comments, function (comment, index) {\n if(comment.id == lastComment.parent_id) {\n // Check whether to show in real time.\n if (comment.showRel || isCommenter) {\n var existingComment = [];\n if(comment.child_comment.length > 0) {\n comment.child_comment.forEach(function(v) {\n existingComment.push(v.id);\n })\n }\n // Push the reply to child comment.\n if (existingComment.indexOf(lastComment.id) === -1) {\n comment.child_comment.unshift(lastComment);\n // Highlight new comment if parent node expanded.\n if (!isCommenter) {\n isNotified = true;\n setTimeout(function() {\n // Add class for background\n var commentNode = $('#pc' + lastComment.id);\n addAndRemoveBackground(commentNode, 5000);\n }, 100);\n }\n }\n }\n else {\n isNotified = true;\n // Add class for background\n var parentNode = $('#pc' + lastComment.parent_id);\n addAndRemoveBackground(parentNode, 5000);\n }\n comment.count_child = lastComment.parentCommentTotalchildPost;\n }\n else {\n if(comment.child_comment.length > 0) {\n isNotified = pushReplyComment(comment.child_comment, lastComment, isCommenter);\n }\n }\n });\n return isNotified;\n }", "title": "" }, { "docid": "f4b7985d06b11b303236bb31996139e6", "score": "0.61010873", "text": "function replySubmit(e){\n\t\tif (e.target.parentNode.childNodes[1].value == \"\"){\n\t\t\talert(\"The text box is currently empty! Type in your comment and I'll submit it for you.\");\n\t\t\te.preventDefault();\n\t\t}\n\t\telse {\n\t\t\tvar newReplyNum = updateReplyCounter(e);\n\t\t\tvar newString = newReplyString(newReplyNum);\n\t\t\te.target.parentNode.parentNode.parentNode.parentNode.previousSibling.previousSibling.childNodes[3].innerHTML = newString;\n\t\t\te.preventDefault();\n\t\t\tgetReply(e);\n\t\t\te.target.parentNode.reset();\n\t\t}\n\t}", "title": "" }, { "docid": "fc5b558b503af86bbebc512bbf621ac8", "score": "0.60732657", "text": "function addMessage(usrinfo, date, message) {\n var messageObject = {\n usrinfo: usrinfo,\n date: date,\n message: message,\n }\n itemCommentsRef.push(messageObject)\n}", "title": "" }, { "docid": "6002583a688d46f110e5fe796a56a77a", "score": "0.6071962", "text": "function addComment(message) {\r\n const commentGoesHere = message.parentNode.previousElementSibling;\r\n const newComment = document.createElement(\"div\");\r\n newComment.className = 'main-wrapper-middle-static-publication-written-comments';\r\n newComment.innerHTML = \"\\<img src=\\\"images/profile-1.jpg\\\" alt=\\\"profile pic\\\" class=\\\"profile-pic\\\"\\> \\<div class=\\\"main-wrapper-middle-static-publication-written-comments-text\\\"\\> \\<p class=\\\"written-comment-name\\\">Maria Santos\\</p\\> \\<p class=\\\"written-comment-text\\\"\\> \"+ message.value + \"\\</p\\>\";\r\n commentGoesHere.append(newComment);\r\n newComment.style.animation = \"fadeIn 0.5s linear forwards\";\r\n message.value = \"\";\r\n}", "title": "" }, { "docid": "112e092f0e0a8e5b50bd6618d1f9acfd", "score": "0.6063208", "text": "function reply(req, res, next) {\n _findMessageById(req, function(err, parentMessage) {\n if (err) {\n next();\n } else {\n var parentId = parentMessage.messageId;\n _createMessage(req, parentId, function(err, message) {\n if (!err) {\n req.data = { \n id: message.messageId,\n result: {\n success: true,\n status: 200\n }\n };\n }\n next();\n });\n }\n });\n}", "title": "" }, { "docid": "bd14820614a273a4971ee71065118cc0", "score": "0.604989", "text": "function updateReply() {\n\tif ( STORE.currentQuestion >= STORE.answered.length ) {\n\t\t$('.answer-reply').html(`<p></p>`);\n\t\treturn;\n\t}\n\tconsole.log(`Question: ${STORE.currentQuestion} Expected answer: ${STORE.questions[STORE.asked[STORE.currentQuestion]].correctAnswer}, answer: ${STORE.answered[STORE.currentQuestion]}`);\n\tif ( STORE.questions[STORE.asked[STORE.currentQuestion]].correctAnswer === STORE.answered[STORE.currentQuestion] ) {\n\t\t$('.answer-reply').html(`<p>${correctMessage(STORE.asked[STORE.currentQuestion])}</p>`);\n\t} else {\n\t\t$('.answer-reply').html(`<p>${incorrectMessage(STORE.asked[STORE.currentQuestion])}</p>`);\n\t}\n}", "title": "" }, { "docid": "e058b88b4c6c2bbd6360f1e01c2e0962", "score": "0.60397416", "text": "async function replyQuestion(id) {\n const answer = document.getElementById(`input-reply-${id}`).value\n\n setButtonAnimation(id)\n setLoading(true)\n\n try {\n await api.put(`/announcements/${match.params.id}/answer`, {\n questionID: id,\n answer\n })\n toast.success(\"Pergunta respondida com sucesso\")\n setRefresh(!refresh)\n } catch (err) {\n toast.error(\"Falha ao responder pergunta: \" + err.response.data.message)\n }\n\n setLoading(false)\n }", "title": "" }, { "docid": "f73bf1e61a20e37796097485ea34de3e", "score": "0.60357136", "text": "function postReply(tweet){\n\n\tT.post('statuses/update', {status: tweet.finalText, in_reply_to_status_id: tweet.tweetID}, function (err, data, response) {\n\t\tif(!err){\n\t\t\tconsole.log(\"Reply correcto :)\");\n\t\t}else{\n\t\t\tconsole.log(\"Retrying Reply :(\");\n\t\t\tconsole.log(err);\n\t\t\treplayIt();\n\t\t}\t\t\n\t});\n}", "title": "" }, { "docid": "acfc4bdee575f147ac2a8493f3210d8b", "score": "0.6032876", "text": "addComment() {\r\n const pseudo = document.getElementById(\"pseudo\").value;\r\n const comment = document.getElementById(\"comment\").value;\r\n document.getElementById(\"commentsList\").innerHTML = \"\";\r\n this.comments.push(new Commentaire(this, {\r\n author_name:pseudo,\r\n rating:parseFloat(document.forms[0].rating.value),\r\n text:comment\r\n }));\r\n this.renderAllComments();\r\n app.hideModal();\r\n }", "title": "" }, { "docid": "c61bd5b93b111b595c6896ef896be6b8", "score": "0.6017968", "text": "function sendQuickReplyMessage(message) {\n if(message.senderID != undefined && message.text != undefined) {\n message.message = {text : message.text, type: \"quickreplies\", quickreplies: message.choices};\n save(message);\n }\n}", "title": "" }, { "docid": "4d6b7434efef4e2f1469e1891cd9addf", "score": "0.59928876", "text": "function addComment(type, content, line) {\n this.addComments(type, [{\n type: line ? \"CommentLine\" : \"CommentBlock\",\n value: content\n }]);\n}", "title": "" }, { "docid": "f1e7333948cd21eb42d83565e5c0a2b0", "score": "0.59876424", "text": "@DBDecorators.table(tables.Content)\n static async addComment(contentId, {user, message}) {\n\n // Append new comment\n let commentId = await rethinkdb.uuid();\n await this.table.get(contentId).update({\n comments: rethinkdb.row('comments').prepend({\n id: commentId,\n userId: user.id,\n message: message,\n createdAt: new Date()\n })\n }).run();\n\n // Fetch contents's latest state and return.\n return await Content.get(contentId);\n }", "title": "" }, { "docid": "c244840c8b1d8752b883bca385f39ac0", "score": "0.5985233", "text": "function replyBtnClick(e) {\r\n\te.preventDefault(); //stop default action\r\n\tvar $notification = $(this).parents('.notification'); //notification that has been clicked\r\n\tif ($notification.hasClass('notification_reply') || $notification.hasClass('notification_reblog') || $notification.hasClass('notification_follower')) {\r\n\t\t//replies and reblogs have additional text we should include\r\n\t\tvar $text = $notification.find('.notification_sentence');\r\n\t\tvar text = '<blockquote>'+$text.html()+'</blockquote>\\n<p>&nbsp;</p>';\r\n\t\t}\r\n\telse {\r\n\t\t//everything else can be stripped down to bare minimum\r\n\t\tvar $text = $notification.find('div.hide_overflow');\r\n\t\tvar text = '<blockquote>'+$text.html()+'</blockquote>\\n<p>&nbsp;</p>';\r\n\t\t}\r\n\tvar $newtextpost = $('#new_post_label_text'); //new text post button \r\n\t//calling for text post editor\r\n\t//vvv taken from posts.js on Tumblr\r\n\tvar urlparams = unsafeWindow.Tumblr.PostForms.parse_url_params($newtextpost.attr('href'));\r\n\tunsafeWindow.Tumblr.PostForms.create({\r\n\t\t\ttype: $newtextpost.data('post-type'),\r\n\t\t\tendpoint: $newtextpost.data('post-endpoint'),\r\n\t\t\tattach_to: '#new_post',\r\n\t\t\tprevious_content_selector: '#post_buttons',\r\n\t\t\tmode: unsafeWindow.Tumblr.PostForms.mode,\r\n\t\t}, urlparams);\r\n\t//^^^ taken from posts.js on Tumblr\r\n\t//I have no idea how to pre-add text to editor, so we'll have to wait for it to appear...\r\n\twaitForSelector('.mceIframeContainer iframe', true, function() {\r\n\t\t//and add the text into it\r\n\t\tvar $post = $('.mceIframeContainer iframe').contents().find('#tinymce');\r\n\t\t$post.html(text);\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "99edd5272d3fc9619fa202e8b4788a7d", "score": "0.5978385", "text": "addReplyButton() {\n const replyButton = this.elementPrototypes.replyButton.cloneNode(true);\n replyButton.firstChild.onclick = () => {\n this.addReply();\n };\n\n // Sections may have \"#\" in the code as a placeholder for a vote. In this case, we must create\n // the comment form in the <ol> tag.\n const isVotePlaceholder = (\n this.lastElementInFirstChunk.tagName === 'OL' &&\n this.lastElementInFirstChunk.childElementCount === 1 &&\n this.lastElementInFirstChunk.children[0].classList.contains('mw-empty-elt')\n );\n\n let tag;\n let createUl = false;\n if (this.lastElementInFirstChunk.classList.contains('cd-commentLevel')) {\n const tagName = this.lastElementInFirstChunk.tagName;\n if (\n tagName === 'UL' ||\n (\n tagName === 'OL' &&\n // Check if this is indeed a numbered list with replies as list items, not a numbered list\n // as part of the user's comment that has their signature technically inside the last\n // item.\n (\n this.lastElementInFirstChunk.querySelectorAll('ol > li').length === 1 ||\n this.lastElementInFirstChunk.querySelectorAll('ol > li > .cd-signature').length > 1\n )\n )\n ) {\n tag = 'li';\n } else if (tagName === 'DL') {\n tag = 'dd';\n } else {\n tag = 'li';\n createUl = true;\n }\n } else {\n tag = 'li';\n if (!isVotePlaceholder) {\n createUl = true;\n }\n }\n\n const replyWrapper = document.createElement(tag);\n replyWrapper.className = 'cd-replyWrapper';\n replyWrapper.appendChild(replyButton);\n\n // Container contains wrapper that contains element ^_^\n let replyContainer;\n if (createUl) {\n replyContainer = document.createElement('ul');\n replyContainer.className = 'cd-commentLevel cd-sectionButtonContainer';\n replyContainer.appendChild(replyWrapper);\n\n this.lastElementInFirstChunk.parentElement.insertBefore(\n replyContainer,\n this.lastElementInFirstChunk.nextElementSibling\n );\n } else {\n this.lastElementInFirstChunk.appendChild(replyWrapper);\n }\n\n /**\n * Reply button on the bottom of the first chunk of the section.\n *\n * @type {JQuery|undefined}\n */\n this.$replyButton = $(replyButton);\n\n /**\n * Link element contained in the reply button element.\n *\n * @type {JQuery|undefined}\n */\n this.$replyButtonLink = $(replyButton.firstChild);\n\n /**\n * Reply button wrapper.\n *\n * @type {JQuery|undefined}\n */\n this.$replyWrapper = $(replyWrapper);\n\n /**\n * Reply button container if present. It may be wrapped around the reply button wrapper.\n *\n * @type {JQuery|undefined}\n */\n this.$replyContainer = replyContainer && $(replyContainer);\n }", "title": "" }, { "docid": "83743bdd2f6d907d36763946c435a1f1", "score": "0.5969504", "text": "function add_comment(id){\n\tvar comment = $('#comment_'+id).val();\n\n//Comment ID is the time hash\n\tvar previous_comments = $('#comments_postid_'+id).html();\n\tvar new_comment = '<p class=\"comment\" id=\"comment_idtime\">'+comment+'</p><hr />';\n\t//var hoursandminutes = time.split(':');\n\t//var hnm = hoursandminutes[1];\n\n// Add DateTime As Comment Identifier\n\tvar sub_info = 'hnm' + '<a href=\"#\" onclick=\"\">Fan</a><hr />';\n\t$('#comments_postid_'+id).html(previous_comments + new_comment + sub_info);\n\t\n\tsave_comment(id, comment);\n}", "title": "" }, { "docid": "e06475a52ac1bb660a4b587624d7e14f", "score": "0.596878", "text": "createReply (n, callback) {\n\t\tconst data = this.nrCommentFactory.getRandomNRCommentData();\n\t\tObject.assign(data, {\n\t\t\taccountId: this.nrCommentData.accountId,\n\t\t\tobjectId: this.nrCommentData.objectId,\n\t\t\tobjectType: this.nrCommentData.objectType,\n\t\t\tparentPostId: this.nrCommentResponse.post.id\n\t\t});\n\t\tthis.doApiRequest(\n\t\t\t{\n\t\t\t\tmethod: 'post',\n\t\t\t\tpath: `/nr-comments`,\n\t\t\t\tdata,\n\t\t\t\trequestOptions: {\n\t\t\t\t\theaders: {\n\t\t\t\t\t\t'X-CS-NewRelic-Secret': this.apiConfig.sharedSecrets.commentEngine,\n\t\t\t\t\t\t'X-CS-NewRelic-AccountId': data.accountId\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tcallback\n\t\t);\n\t}", "title": "" }, { "docid": "94cc309719f70ac192c8c3e3a3204ee6", "score": "0.5965267", "text": "function commentQuestion(questionId, comment, authorId) {\n if (comment && comment.length > 1000) {\n return Promise.reject(new Error('TOO_LONG_COMMENT'));\n }\n return Question.findOne({_id: questionId, status: 1})\n .then(function(question) {\n if (!question) {\n throw new Error('QUESTION_DOES_NOT_EXIST');\n }\n if (!question.comments) {\n question.comments = [];\n }\n question.comments.push({\n text: comment,\n author: authorId\n });\n return question.save();\n })\n .then(question => question.populateQuestion());\n}", "title": "" }, { "docid": "8292fe457fc9b2dae00f68f51d9c0024", "score": "0.5961455", "text": "comment(author, text) {\n // L'opérateur de mise à jour [`$push`](http://docs.mongodb.org/manual/reference/operator/update/push/#up._S_push)\n // permet l'ajout à une propriété tableau. Rappel : l`appel de `.exec()` sans argument sur un objet `Query` de\n // Mongoose le transforme en promesse.\n return this.update({ $push: { comments: { author, text } } })\n }", "title": "" }, { "docid": "bed57abfa0c07d1a9c75146dc21c3e45", "score": "0.5956567", "text": "function addComment(commentForm, post){\n commentForm.submit(function(e){\n e.preventDefault();\n let url = `/users/feed/post/post-comment/?post=${post._id}`;\n \n $.ajax({\n type: 'post',\n url: url,\n data: commentForm.serialize(),\n success: function (data){\n \n let newComment = createComment(data.comment,data.user,data.post);\n commentForm.find('textarea').val(\"\");\n toggleLike($(' .toggle-like',newComment));\n delComment($(` #deleteComment-button-${data.comment._id}`,newComment));\n changeCommentCount($(`#comment-span-${data.post._id}`),data.post);\n addNoty(data.message);\n return;\n },\n error: function (err){\n console.log(err.responseText);\n }\n });\n\n });\n }", "title": "" }, { "docid": "474162e7c0f9b5b2d30dc7ec106faeb6", "score": "0.59500957", "text": "function createNewCommentForm() {\n var yourcomment_id = \"yourcomment_\" + review_id + \"_\" +\n context_type;\n if (sectionId) {\n yourcomment_id += \"_\" + sectionId;\n }\n\n yourcomment_id += \"-draft\";\n\n $(\"<li/>\")\n .addClass(\"reply-comment draft editor\")\n .attr(\"id\", yourcomment_id + \"-item\")\n .append($(\"<dl/>\")\n .append($(\"<dt/>\")\n .append($(\"<label/>\")\n .attr(\"for\", yourcomment_id)\n .append($(\"<a/>\")\n .attr(\"href\", gUserURL)\n .text(gUserFullName)\n )\n )\n .append('<dd><pre id=\"' + yourcomment_id + '\"/></dd>')\n )\n )\n .appendTo(commentsList);\n\n var yourcommentEl = $(\"#\" + yourcomment_id);\n createCommentEditor(yourcommentEl);\n yourcommentEl.inlineEditor(\"startEdit\");\n\n addCommentLink.hide();\n }", "title": "" }, { "docid": "a69e256e879198f3defeaadb50cd4cae", "score": "0.5939732", "text": "function addComment(comment) {\n if (model.currUser) {\n postService\n .addComment(comment, model.currUser, model.postId)\n .then(function () {\n // $location.url(\"/boards/\" + model.boardId + \"/post/\" + model.postId);\n $route.reload();\n });\n } else {\n alert('Must be signed in to comment.');\n }\n }", "title": "" }, { "docid": "b837c856c553977ce265e26be5685b49", "score": "0.59376305", "text": "addComment(apiId, comment) {\n return this.client.then((client) => {\n const payload = { apiId };\n return client.apis.Comments.addCommentToAPI(\n payload,\n { requestBody: comment },\n this._requestMetaData()\n );\n });\n }", "title": "" }, { "docid": "b491b64f51a59b75077557bb7a2be15c", "score": "0.5932019", "text": "function attach_replyhax(form)\n{\n if(!form.threadid||form.threadid.getAttribute('value')=='0')return;\n // add some snazzy reply form behavior that vaguely resembles a particular video hosting site\n form.style.display = 'none';\n var tdiv = document.createElement('div');\n var toggle = document.createElement('textarea');\n toggle.appendChild(document.createTextNode('Reply to this thread...'));\n toggle.setAttribute('cols', 64);\n toggle.setAttribute('rows', 2);\n toggle.style.opacity = '0.5';\n tdiv.appendChild(toggle);\n toggle.targetForm = form;\n toggle.onfocus = function() {\n this.targetForm.style.display = '';\n var text = this.targetForm.getElementsByTagName('textarea');\n if (text.length) text[0].focus();\n this.parentNode.parentNode.removeChild(this.parentNode); // delete the whole div\n };\n form.parentNode.insertBefore(tdiv, form);\n}", "title": "" }, { "docid": "2c0fe595f1d67b74130e04bc38cf1ec3", "score": "0.59083945", "text": "addComment(comment, transcriptGuid) {\n var transcriptDiagnosis = transcriptGuid ?\n this.attachToEncounter(transcriptGuid) :\n this.createDefaultTranscriptDiagnosis();\n set(transcriptDiagnosis, 'comment', comment);\n }", "title": "" }, { "docid": "82db666191938eb23d41edc07fd6d23b", "score": "0.5900982", "text": "function replyLinks(id)\r\n{\r\n var cline = document.createElement('div');\r\n cline.setAttribute('class', 'c-line');\r\n cline.appendChild(replyLinkTo(id));\r\n cline.appendChild(document.createTextNode(' - '));\r\n cline.appendChild(quoteLinkTo(id));\r\n return cline;\r\n}", "title": "" }, { "docid": "0fb31a3623bfe759b2c2a7471a5207a7", "score": "0.5892778", "text": "function postComment() {\n \n restApi.postFeedback(feedbackCtrl.objectMessage)\n .success(function (data) {\n })\n .error(function (error) {\n $scope.status = 'Unable to load customer data: ' + error.message;\n });\n }", "title": "" }, { "docid": "7cec21a3bc58152e569bb5b6a936ccb8", "score": "0.58841056", "text": "function enhanceComments()\r\n{\r\n var comment, commentNodes, replyNodes, reply, origReplyLink, bodyInside;\r\n var i, j;\r\n\r\n // iterate through parent comments\r\n commentNodes = findNodes('//div[@class=\"comment\"]/ol/li[@class!=\"\"]');\r\n for (i = 0; i < commentNodes.snapshotLength; i++)\r\n {\r\n comment = initComment(commentNodes.snapshotItem(i));\r\n \r\n bodyInside = $('cbody-inside-' + comment.getAttribute('commentId'));\r\n origReplyLink = findNode('div[@class=\"c-line\"]', bodyInside);\r\n bodyInside.removeChild(origReplyLink.singleNodeValue);\r\n \r\n bodyInside.appendChild(replyLinks(comment.getAttribute('commentId')));\r\n \r\n replyNodes = findNodes('ol/li', comment);\r\n if (replyNodes.snapshotLength > 0)\r\n {\r\n for (j = 0; j < replyNodes.snapshotLength; j++)\r\n {\r\n reply = initReply(replyNodes.snapshotItem(j), comment.getAttribute('commentId')); \r\n bodyInside = $('cbody-inside-' + reply.getAttribute('commentId'));\r\n bodyInside.appendChild(replyLinks(reply.getAttribute('commentId')));\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "180cdb220b6c9f339528e16bd0f65b0a", "score": "0.58830047", "text": "function repliesFunction(replyData, formReply) {\n const newReplyContainer = document.createElement(\"div\");\n const newReplyMessage = document.createElement(\"p\");\n newReplyMessage.textContent = `Anonymous reply: ${replyData.reply}`;\n newReplyContainer.append(newReplyMessage);\n formReply.append(newReplyContainer);\n}", "title": "" }, { "docid": "daad566c6656e8eb58db11b0485338fa", "score": "0.58806777", "text": "function replyMessage(req, res, next) {\n console.log(req.body.reply);\n\n var message_details = {\n from: req.user.email,\n message: req.body.reply\n }\n\n User.findOneAndUpdate({\n email: req.query.receiver\n }, {\n $push: { // appends to the messages array\n messages: message_details\n }\n }, {\n safe: true,\n upsert: true\n },\n function(err, model) {\n if (err) {\n console.log(err);\n return res.send(err);\n } else {\n res.redirect('/listMessages' + '?message=' + 'Replied to Message Successfully!')\n }\n });\n}", "title": "" }, { "docid": "e7ee0679c8c47338381cda247b237210", "score": "0.5862592", "text": "add(comment, taskId) {\n return this._$http({\n url: `${this._AppConstants.api}/comment`,\n method: 'POST',\n headers: {\n Authorization: this._JWT.get()\n },\n data: { comment: comment, task: taskId }\n }).then((res) => res.data);\n\n }", "title": "" }, { "docid": "7b11a327916d90e91dfb3334bc79e21e", "score": "0.58587444", "text": "_onAddCommentClicked() {\n const comment = this.model.createGeneralComment(\n undefined,\n RB.UserSession.instance.get('commentsOpenAnIssue'));\n\n this._generalCommentsCollection.add(comment);\n this._bodyBottomView.$el.show();\n this._commentViews[this._commentViews.length - 1]\n .inlineEditorView.startEdit();\n\n return false;\n }", "title": "" }, { "docid": "29d3863b3c859b3b7374b11d620fce5f", "score": "0.5847443", "text": "async postCommentReaction(options) {\n throw new Error('501 Not Implemented');\n }", "title": "" }, { "docid": "2f28eff3a5ed21e156ce63eb20604b18", "score": "0.5846123", "text": "function replyToTweetById(replyTo, reply, id){\n\tvar replyMessage = \"@\" + replyTo + \" \" + reply;\n\tbot.post(\"statuses/update\", {status: replyMessage,\n\t\tin_reply_to_status_id: id},\n\t\tfunction(err, data, response) {\n\t\t\tif(err){\n\t\t\t\tconsole.log(err);\n\t\t\t} else {\n\t\t\t\tconsole.log(data);\n\t\t\t}\n\t\t}\n\t)\n}", "title": "" }, { "docid": "5567298e5adaa05f47b04f2dddc62c7c", "score": "0.58422214", "text": "function handle_replyto_click(evt) {\n if(quick_reply_active) {\n Event.stop(evt);\n return;\n }\n\n quick_reply_active = true;\n\n var elm = Event.element(evt);\n\n var reply_form = $('add_comment_form');\n var form_action = $('form-action');\n var form_replyto = $('form-replyto');\n var form_message = $('JSMessage');\n\n\n // Get the replyTo name and id from the comment we clicked on\n //\n tmp = elm.up('table');\n\n var replyto_id_raw = tmp.id;\n var replyto_id = tmp.id.replace('cid:', '');\n var replyto_name = $(tmp).getElementsByClassName('replyto-name')[0].innerHTML;\n var replyto_text = $(tmp).getElementsByClassName('comment_text')[0].innerHTML;\n\n // Change the reply form title, \"replyto\" and \"action\" input fields\n //\n var new_form_title = '<div><span class=\"replyto-close\" onclick=\"javascript:cancel_reply(event)\">[Cancel]</span> Replying to: <em class=\"replyto-target\" title=\"Click here to scroll to the original comment\" onclick=\"javascript:$(\\''+replyto_id_raw+'\\').scrollTo();\"><strong>' + replyto_name + '</strong></em></div><hr width=\"100%\" style=\"clear: both\" /><br />';\n\n form_action.value = 'replyto';\n form_replyto.value = replyto_id;\n\n // Quote the original poster\n //\n var reply_table = reply_form.down('.replyto_comment');\n var quote_html = '<div class=\"bbcode bbcode_quote\" id=\"reply-op-preview\" style=\"text-align: left; margin-bottom: 15px;\">'+new_form_title + replyto_text + '</div>';\n\n new Insertion.Top(reply_table, quote_html);\n reply_table.removeClassName('hidden');\n\n\n // Focus the reply form\n //\n reply_form.scrollTo();\n form_message.focus();\n\n\n // Stop the click event from propagating further, e.g cancel a link click.\n //\n Event.stop(evt);\n}", "title": "" }, { "docid": "37093747a65a82ba1b7036c871a1ce04", "score": "0.5839787", "text": "function addNewComment() {\r\n hideAll();\r\n var newComment = {};\r\n newComment.topicId = document.getElementById('comment_topic_id').value;\r\n newComment.text = document.getElementById('comment_text').value;\r\n var xmlhttp = new XMLHttpRequest();\r\n xmlhttp.open(\"POST\", url + \"/\" + newComment.topicId, true);\r\n xmlhttp.onreadystatechange = function () {\r\n if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {\r\n displayTopic(newComment.topicId);\r\n }\r\n };\r\n xmlhttp.send(JSON.stringify(newComment));\r\n document.getElementById('new_comment').reset();\r\n }", "title": "" }, { "docid": "1e17775eccf288f8c61d24bf47c54e5a", "score": "0.5837442", "text": "function Reply() {\n debug('Go get some Replies!');\n}", "title": "" }, { "docid": "529cc2166dbf8726e0cce8adbd9ed7ff", "score": "0.58372605", "text": "function quoteLinkTo(id)\r\n{\r\n var link = document.createElement('a');\r\n link.href = '#creplyform';\r\n link.className = 'c-reply';\r\n link.innerHTML = '[quote]';\r\n link.addEventListener('click', quoteComment, false);\r\n \r\n // store the comment id for easy acces in quoteComment\r\n link.setAttribute('commentId', id);\r\n return link;\r\n}", "title": "" }, { "docid": "89eefa648be3721c66a9019de441bbca", "score": "0.5834349", "text": "function addRecipeReply(result)\n{\n\tif(result) spawnModal(\"Submission Success\", \"<p>Your recipe has found its new home at Phood Buddy</p>\", \"https://phood-buddy.com/recipe.html?\" + result, false);\n\telse spawnModal(\"Submission Failed\", \"<p>Your recipe wasn't submitted. Double check your inputs</p>\", \"https://phood-buddy.com/create-recipe.html\", false);\n}", "title": "" }, { "docid": "bde7697efa6fdf02ff63752e1a5fec40", "score": "0.58262336", "text": "function newReplyButton(pid){\n\tvar reply_btn = document.createElement(\"button\");\n\treply_btn.classList.add(\"post-reply-btn\");\n\treply_btn.textContent = \"Reply\";\n\treply_btn.onclick = function() {\n\t\tgetUser(cid, uid, \"displaypicture\", function(code){ // get user display pic\n\t\t\tvar input = newForumTextArea(pid+\"|\", code);\n\t\t\tinput.classList.add(\"post-reply\");\n\t\t\tvar parent = reply_btn.parentNode.parentNode;\n\t\t\tif(parent.parentNode.getAttribute(\"id\") != \"forum-area\")\n\t\t\t\tparent.parentNode.insertBefore(input, parent.nextSibling);\n\t\t\telse\n\t\t\t\tparent.insertBefore(input, parent.children[3]);\n\t\t\tinput.getElementsByTagName(\"textarea\")[0].focus();\n\t\t});\n\t};\n\t\n\treturn reply_btn;\n}", "title": "" }, { "docid": "4767520812054ac548197575b458e809", "score": "0.58251524", "text": "function newComment(user,index,text){\n var comment={};\n comment.createdBy=user;\n comment.createdAt=new Date();\n comment.text=text; \n messages[index].comments.push(comment);\n console.log(comment);\n}", "title": "" }, { "docid": "32454ac6c1cc48a7638a3663c97e4993", "score": "0.58185333", "text": "function createReplyButton(newPost, formReply) {\n const replyButton = document.createElement(\"button\");\n replyButton.setAttribute('class', 'replyBtn')\n replyButton.textContent = \"Reply\";\n replyButton.addEventListener(\"click\", hiddenForm);\n function hiddenForm() {\n formReply.style.visibility == \"hidden\"\n ? (formReply.style.visibility = \"visible\")\n : (formReply.style.visibility = \"hidden\");\n }\n newPost.appendChild(replyButton);\n}", "title": "" }, { "docid": "120b4eafe039123202dce5647f1b46c6", "score": "0.58171844", "text": "function postComment(article,comment_id) {\n\t// For \"Forum\" style threaded comments\n\tif (viewing_thread !== undefined) {\n\t\tcomment_id = viewing_thread;\n\t\t//replace_box = \"showReply\" + comment_id;\n\t\ttext = $('#commentText').val();\n\t} else {\n\t\tif (comment_id) {\n\t\t\ttext = $('#reply' + comment_id).val();\n\t\t\t//replace_box = \"showReply\" + comment_id;\n\t\t} else {\n\t\t\ttext = $('#commentText').val();\n\t\t\t//replace_box = \"bd_comment_box\";\n\t\t}\n\t}\n\tjs_path_put = functions_path + \"/ajax.php\";\n\tsend_data = \"action=post_comment&article=\" + article + \"&comment=\" + text + \"&comment_id=\" + comment_id;\n \t$.post(js_path_put, send_data, function(theResponse) {\n\t\tvar returned = theResponse.split('+++');\n\t\tif (returned['0'] == \"1\") {\n\t\t\t$('#bd_no_comments').hide();\n\t\t\t$('#commentText').val('');\n\t\t\tcloseError();\n\t\t\t// Tree style or primary comment?\n\t\t\tif (viewing_thread === undefined) {\n\t\t\t\tif (comment_id) {\n\t\t\t\t\tsub_com_put = \"bd_com_overall\" + comment_id;\n\t\t\t\t\tfinal_put = '<div id=\"subcommentsX\" class=\"bd_discussion_bubble\"><div id=\"bd_com_overallX\" class=\"bd_com_overall\">' + returned['1'] + '</div></div>';\n\t\t\t\t\t$('#' + sub_com_put).append(final_put).fadeIn('150');\n\t\t\t\t\tcancelReply(comment_id);\n\t\t\t\t} else {\n\t\t\t\t\t$('#bd_all_comments').append(returned['1']).hide().fadeIn('150');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar text_value = $('#currentReplies' + viewing_thread).html();\n\t\t\t\tvar cur_replies = parseInt(text_value);\n\t\t\t\tcur_replies += 1;\n\t\t\t\t$('#bd_all_comments').append(returned['1']).hide().fadeIn('150');\n\t\t\t\t$('#currentReplies' + viewing_thread).html(cur_replies);\n\t\t\t}\n\t\t} else {\n\t\t\tprocess_error(theResponse);\n\t\t}\n \t});\n \treturn false;\n}", "title": "" }, { "docid": "7b7921696663b53008d96b062b6e6ec2", "score": "0.5814208", "text": "function reply_to_post(title, username, postid){\n document.getElementById('reply_to_title').innerHTML = title; //displays the title of the post being replied to\n document.getElementById('reply_to_user').innerHTML = username; //displays the username attached to the user being replied to\n // var the_text = document.getElementById(postid).querySelector(\".postBody .message\").innerText; //pulls the body from the post that is replied to\n // document.getElementById('the_post_body').innerHTML = \"<p class='replyPara'>\" + username + \": \" + the_text + \"</p>\"; //displays the body from the post that is replied to\n document.getElementById('reply_to_post').value = postid; //sets the secret reply field value to whatever the post id is of the post being replied to. This is used when inserting to the database to add to the parent id\n}", "title": "" }, { "docid": "1ff4af7016e173e38ece34bfb01ef138", "score": "0.5812368", "text": "function setupReplies(wrapper) {\n// Detache zu klonenden Reply Form Container\nreply_form_container = $('#form_reply_comment_container').detach().show();\n// Setup Reply buttons\nwrapper.find('.comment_reply').show();\nwrapper.find('.comment_reply a').click(function(evt) {\ndisplayReplyForm($(this).parents('.detail_comment_item'));\nevt.preventDefault();\n});\n// Setup Replies\nreply_headers = wrapper.find('h4.reply_header');\nreply_headers.append(' <span>anzeigen</span>');\nreply_headers.css({'cursor':'pointer'});\nreply_texts = wrapper.find('p.comment_reply_text');\n// Alle Antworten und Button ein-, bzw. ausblenden\nif (reply_texts.length > 0) {\nbtn_all_replies.show();\nif (btn_all_replies.hasClass('show_replies')) {\nhideAllReplyTexts();\n} else {\nshowAllReplyTexts();\n}\n} else {\nbtn_all_replies.hide();\n}\n// Einzelne Antworten Einblenden.\nreply_headers.click(function() {\nvar $elem = $(this);\n$elem.next('p.comment_reply_text').slideDown({\nduration: \"slow\",\ncomplete: function() {\n$elem.find('span').text('');\n$elem.css({'cursor':'inherit'});\n$elem.addClass('open');\nif (reply_headers.filter('.open').length > 0) {\nbtn_all_replies.text(btn_all_replies_labels.hide_msg);\nbtn_all_replies.removeClass('show_replies');\n} else {\nbtn_all_replies.text(btn_all_replies_labels.show_msg);\nbtn_all_replies.addClass('show_replies');\n}\n}\n});\n});\n}", "title": "" }, { "docid": "53faa115f24d4290def7a2926cd5060f", "score": "0.58102906", "text": "createComment() {\n \n }", "title": "" }, { "docid": "331ddd019340dc3acd833b63fa949368", "score": "0.5776467", "text": "function addAnswer ({ authedUser, qid, answer }) {\n return {\n type: ADD_ANSWER,\n authedUser, \n qid, \n answer\n }\n}", "title": "" }, { "docid": "bcca2e027ffc1d91928d281e7a2e2f8b", "score": "0.57751995", "text": "function updateComment(c) {\n var xml = c.responseXML;\n var error = xml.getElementsByTagName('error').item(0).firstChild.data;\n var msg = xml.getElementsByTagName('msg').item(0).firstChild.data;\n var id = xml.getElementsByTagName('id').item(0).firstChild.data;\n var f = document.getElementById(id);\n var d = document.createElement('div');\n d.setAttribute('class', 'comment');\n d.setAttribute('id', id);\n if (error == 0)\n d.ondblclick = new Function(\"editComment('\" + id + \"');\");\n d.appendChild(document.createTextNode(msg));\n var z = f.parentNode;\n z.replaceChild(d, f);\n document.addcomment.body.disabled = false;\n document.addcomment.onsubmit = '';\n}", "title": "" }, { "docid": "64ad285b148da06ee3987ccb032ef956", "score": "0.57687116", "text": "function addComment (blogId, comment) {\n $.ajax({\n \"method\": \"POST\",\n \"url\": \"add_comment/\",\n \"data\": {\"blogId\": blogId, \"comment\": comment},\n \"success\": function (data) {\n //update the DOM and hide the comment\n $(\"#post-comment-\" + blogId + \" p\").hide();\n $(\"#get-comments-\" + blogId + \" p\").hide();\n $(\"#blog-commenting-\" + blogId).toggle(\"fast\");\n }\n })\n }", "title": "" }, { "docid": "64ad285b148da06ee3987ccb032ef956", "score": "0.57687116", "text": "function addComment (blogId, comment) {\n $.ajax({\n \"method\": \"POST\",\n \"url\": \"add_comment/\",\n \"data\": {\"blogId\": blogId, \"comment\": comment},\n \"success\": function (data) {\n //update the DOM and hide the comment\n $(\"#post-comment-\" + blogId + \" p\").hide();\n $(\"#get-comments-\" + blogId + \" p\").hide();\n $(\"#blog-commenting-\" + blogId).toggle(\"fast\");\n }\n })\n }", "title": "" }, { "docid": "8b6de58f07d3aec5606ec8caa696d36d", "score": "0.57630545", "text": "function addReplies(nodeId, allCommentObj, objToBePushed) {\n \n angular.forEach(allCommentObj, function(value,index){\n\n if(value.id == nodeId) {\n var existingComment = [];\n if(value.child_comment.length > 0) {\n value.child_comment.forEach(function(v) {\n existingComment.push(v.id);\n })\n }\n if (objToBePushed.length > 0) {\n // Push the reply to child comment.\n angular.forEach(objToBePushed, function(v, k) {\n if (existingComment.indexOf(v.id) === -1) {\n value.child_comment.push(v);\n value.showRel = true;\n }\n });\n }\n else {\n value.showRel = true;\n }\n }\n else {\n if(value.child_comment.length > 0) {\n addReplies(nodeId, value.child_comment, objToBePushed);\n }\n } \n }); \n return allCommentObj; \n }", "title": "" }, { "docid": "e01d4e6f20f5aeee1e48c39bfec39b78", "score": "0.574934", "text": "addComment(cardId, taskListId){\n // prepare comment content\n let now = new Date();\n let newCommentToAdd = new Comment(this.javascriptDateObjectToISOString(now), this.data.newComment);\n\n // add comment to card \n this.data.currentProject.taskLists[taskListId].cards[cardId].comments.push(newCommentToAdd);\n\n // reset field\n this.data.newComment = \"\";\n }", "title": "" }, { "docid": "d2dbecd32e776f9487c79ca5f9a5970f", "score": "0.57460743", "text": "postComment(comments) {\n this.post('comments', {\n comments,\n });\n }", "title": "" }, { "docid": "d769a99b4a5f69a1160a40a556d20d72", "score": "0.5731682", "text": "function addNote() {\n fetchNotes();\n }", "title": "" }, { "docid": "66407cafaa4a4e110b6856a747ff2ba8", "score": "0.5731424", "text": "static submitComment(id, comment) {\n let user = this.getUser();\n\n firebase.database().ref('recipes/' + id).push({\n uid: user.uid,\n displayName: user.displayName,\n comment: comment\n })\n }", "title": "" }, { "docid": "d32ec22a3312d44f7d16227213240c2f", "score": "0.5731401", "text": "async addCon(itemId, posterId, comment) {\n if (!itemId || !ObjectId.isValid(itemId))\n throw \"you must provide a valid id\";\n if (!posterId || typeof posterId !== \"string\")\n throw \"you must provide a poster id\";\n if (!comment || typeof comment !== \"string\")\n throw \"you must provide a comment\";\n\n const commentsArray = [];\n\n let newComment = {\n posterId: posterId,\n comment: comment\n };\n commentsArray.push(newComment);\n\n let newCon = {\n itemId: itemId,\n commentsArray: commentsArray //store all the reply of this comment, which form the conversation.\n };\n const conCollection = await conversation();\n const insertInfo = await conCollection.insertOne(newCon);\n if (insertInfo.insertedCount === 0) throw \"can not add conversation\";\n const newId = insertInfo.insertedId;\n const con = await this.getConById(newId);\n return con;\n }", "title": "" }, { "docid": "9e1f04a5eb83a4eefff8c636cf596b99", "score": "0.57208997", "text": "function addComment(articleId, comment, res)\n{\n console.log(\"Add comment\", articleId);\n db.Comments.create({articleId, comment})\n .then(function(dbItem) {\n //console.log(\"Chain update\",dbItem);\n db.Articles.updateOne({\n articleId: articleId\n },\n {\n $set: {\n hasComment : true\n },\n $push: {\n comments : dbItem._id\n }\n },\n function(error, edited) {\n if (error) {\n res.json( { articleId,\n action : \"Add\",\n status : \"Error\",\n error });\n }\n else {\n res.json( { articleId,\n action : \"Add\",\n status : \"ok\" });\n };\n }\n );\n });\n }", "title": "" }, { "docid": "a559ab27077ecc0fe7b05fde6e4ad300", "score": "0.57053566", "text": "function bindReplyLinks() {\n\n\t\t\t$('body').on('click', '[data-action=reply]', function(e) {\n\n\t\t\t\te.preventDefault();\n\n\t\t\t\tvar $reply = $(this);\n\n\t\t\t\t// get comment being replied to\n\t\t\t\tvar $comment = $reply.closest('div.commentWrapper');\n\n\t\t\t\t// get comment id and set in talkback form\n\t\t\t\tvar commentId = $reply.data('comment-id');\n\t\t\t\tif (commentId != '') {\n\t\t\t\t\t$talkbackForm.find('[name=parent_content_id]').val(commentId);\n\t\t\t\t}\n\n\t\t\t\t// get commment thread id and set in talkback form\n\t\t\t\tvar commentThreadId = $reply.data('comment-thread');\n\t\t\t\tif (commentThreadId != '') {\n\t\t\t\t\t$talkbackForm.find('[name=comment_thread]').val(commentThreadId);\n\t\t\t\t}\n\n\t\t\t\t// move talkback form below selected comment\n\t\t\t\t$talkbackForm.slideUp(function() {\n\t\t\t\t\t$talkbackForm.insertAfter($comment);\n\t\t\t\t\t$talkbackForm.slideDown(function() {\n\t\t\t\t\t\t$('html, body').animate({\n\t\t\t\t\t\t\tscrollTop: $talkbackForm.offset().top - 150\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t});\n\n\t\t}", "title": "" }, { "docid": "6fa456bdb1fe1ddab0e66725d3cd9120", "score": "0.56953776", "text": "function handleComments(msg) {\n const div = document.querySelector('div')\n const p = document.createElement('p')\n if(msg !== ''){\n p.textContent = msg\n div.appendChild(p)\n }\n}", "title": "" }, { "docid": "2ef9538e6b567854e219f0a8213860c8", "score": "0.569391", "text": "function add_comment() {\n\t// Get the CSRF token from the \"csrftoken\" cookie\n\t// We will need to pass it as an argument to the POST request\n\tvar csrftoken = jQuery(\"[name=csrfmiddlewaretoken]\").val();\n\n\t$.ajax({\n\t\t// We should always perform this when we make an ajax request\n\t\tbeforeSend: function(xhr, settings) {\n\t\t\tif (!csrfSafeMethod(settings.type) && !this.crossDomain) {\n\t\t\t\txhr.setRequestHeader(\"X-CSRFToken\", csrftoken);\n\t\t\t}\n\t\t},\n\t\t// URL endpoint. This will actually look like:\n\t\t// /blog/post-12/add_comment/\n\t\ttype : \"POST\",\n\t\t// data dictionary sent with the post request\n\t\t// The data names should be same as the default\n\t\t// django is using in teh forms\n\t\tdata : { \n\t\t\ttext : $('#id_text').val(),\n\t\t\tpost : $('#id_post').val()\n\t\t},\n\n\t\t// handle a successful response\n\t\tsuccess : function(json) {\n\t\t\t// remove the value from the input textfield\n\t\t\t$(\"#id_text\").val('');\n\t\t\t// Append the comment at the end of the list of comments in the DOM\n\t\t\t$(\"#comments-list\").append(\" \\\n\t\t\t\t\t<li> \\\n\t\t\t\t\t\t<div class='commenterImage'> \\\n\t\t\t\t\t\t\t<img src='/media/\" + json.commenter_image + \"'/> \\\n\t\t\t\t\t\t</div> \\\n\t\t\t\t\t\t<div class='commentText'> \\\n\t\t\t\t\t\t\t<p class=''>\" + json.text + \"</p> \\\n\t\t\t\t\t\t</div> \\\n\t\t\t\t\t\t<span class='date sub-text'>on \" + json.date + \"</span> \\\n\t\t\t\t\t</li> \\\n\t\t\t\");\n\t\t\t// Increment the comments number\n\t\t\t$(\"#comments-count a\").text('Comments ' + json.comments_count);\n\t\t},\n\n\t\t// handle a non-successful response\n\t\terror : function(xhr,errmsg,err) {\n\t\t\t// add the error to the DOM\n\t\t\t$('#results').html(\"<div class='alert-box alert radius' data-alert>Oops! We have encountered an error: \"+errmsg+\n\t\t\t\t\" <a href='#' class='close'>&times;</a></div>\");\n\t\t\t// provide a bit more info about the error to the console\n\t\t\tconsole.log(xhr.status + \": \" + xhr.responseText);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "a8e87c05a2757aa312b611c5b7f2361e", "score": "0.5689819", "text": "static addComment(req, res) {\n console.log(\"adding comment\");\n //or $set\n Blog.update({_id:req.params.id}, { $push: { \"comments\":{\"subject\": req.body.subject, \"comment\": req.body.comment }}}, function (err, post) {\n if (err) return res.status(500).send(err);\n // redirect the user to a GET route. We'll go back to the INDEX.\n res.redirect(\"/\");\n\n });\n }", "title": "" }, { "docid": "b0f108b2f025424678ce76f0e7aa6cc7", "score": "0.56825995", "text": "function writeNewComment(userInput, newpost){\n\t\tnewpost.style.display = \"flex\";\n\t\tvar textNode = document.createTextNode(userInput);\n\t\tvar origin = document.getElementsByClassName(\"commentSkeleton\")[0].childNodes[3];\n\t\torigin.insertBefore(textNode, origin.childNodes[3]);\n\t\tdocument.getElementsByClassName(\"commentSkeleton\")[0].className = \"comment media\";\n\t\taddListenersLikes();\n\t}", "title": "" }, { "docid": "80202120abd848590d996fd665372282", "score": "0.56814635", "text": "function addCommentToList(e){\n const textInput = document.getElementById('addCommentInput');\n if(e.keyCode === 13){\n db.getDB('posts').then((res) => {\n let currentPostIndex = (sessionStorage.getItem('currentPost')) - 1;\n let comments = res[currentPostIndex].coments;\n let data = {\n id: comments.length + 1,\n class: `c-${comments.length + 1}`,\n userAvatar: \"img/usersAvatar/avatar.jpg\",\n userName: \"mohsen.coder\",\n replyTo: \"\",\n text: textInput.value,\n time: new Date().getTime(),\n likes: 0,\n isAdminLiked: 'no',\n isMainComment: 'yes',\n subComments:[]\n };\n comments.push(data);\n\n // add new comment to database\n const result = JSON.stringify(res);\n localStorage.setItem('posts',result);\n viewAllComments(sessionStorage.getItem('currentPost'));\n });\n\n }\n \n}", "title": "" }, { "docid": "b8aaf64b189efb4ebfa424c375d60158", "score": "0.5680642", "text": "createComment(card, comment) {\n\t\t\n\t\treturn this.$http.post(this.cardUrls.createComment, {\n\t\t\tcardId: card.id,\n\t\t\ttext: comment.text\n\t\t}).then((response) => {\n\t\t\tif (response.status == 200 || response.status == 201) {\n\t\t\t\tcard.comments.push(response.data);\n\t\t\t\treturn response.data;\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "3dce6920a096af8abf7e7e85bb9b3128", "score": "0.5678049", "text": "function editreplyfunction(data)\n{\n\tconsole.log(data);\n\tvar myreply = $(data).attr('rel');\n\tconsole.log(myreply);\n\tvar breakit = myreply.split('-')\n \t var myreplywords = breakit[1];\n \t var myreplyid = breakit[3];\n \t var mycontentid = breakit[2];\n \t console.log(myreplyid);\n\t$('textarea#editreplytextbox-'+myreplyid).show();\t\n\t$('textarea#editreplytextbox-'+myreplyid).val(myreplywords);\t\n\n}", "title": "" } ]
09c3d8b767d7e6df5df8248086d726fa
Adds patient from file using fs.writeFile and stringifies patients.
[ { "docid": "b66a3d4bceffbbc437166280bf6fb9de", "score": "0.7046266", "text": "function addToPatientFile(fileLocation, patientInfo) {\n fs.readFile(fileLocation, function(err, jsonData) {\n let patients = (jsonData.length == 0) ? [] : JSON.parse(jsonData);\n patients.push({\n \"patient\": patientInfo.patient,\n \"doctor\": patientInfo.doctor,\n \"room\": patientInfo.room,\n \"time\": patientInfo.time\n })\n\n fs.writeFile(fileLocation, JSON.stringify(patients), function() {\n console.log(\"File written.\");\n });\n });\n}", "title": "" } ]
[ { "docid": "02490df5997b6cb60d5a561865497cca", "score": "0.6178231", "text": "function addToTxt(){\n fs.writeFile('reminder.txt', '', function(err){\n if(err) throw err;\n console.log(\"Replaced\");\n });\n\n for(let i = 0; i < jobSchedule.length; i++){\n fs.appendFile('reminder.txt', jobSchedule[i]+ \"\\r\\n\", function(err){\n if(err) throw err;\n console.log(\"Added\");\n });\n }\n}", "title": "" }, { "docid": "c12defcd7bf979f51aae09a64d89778b", "score": "0.56786954", "text": "writeFile(file) {\n fs.writeFileSync(this.path, JSON.stringify(file, null, 2))\n }", "title": "" }, { "docid": "9dabdfb2edda3bbe77aeb38358dd4867", "score": "0.5630283", "text": "function deletePatientFromFile(fileLocation, patientName) {\n fs.readFile(fileLocation, function(err, jsonData) {\n if (jsonData.length == 0) {\n return;\n }\n let patients = JSON.parse(jsonData);\n patients = patients.filter((patient) => {\n return patient.patient != patientName\n });\n\n fs.writeFile(fileLocation, JSON.stringify(patients), function() {\n console.log(\"Deleted patient\");\n });\n });\n}", "title": "" }, { "docid": "f5bd4fdbdb389d6f646cff41769c8126", "score": "0.5450133", "text": "appendToFile() {\n console.log(\"appending to file\");\n const txt = \n `${this.title}: ${this.name} \\n\n ID: ${this.id} \\n\n Email: ${this.email} \\n\n Github: ${this.github}\\n\n ----------------------------\\n`;\n\n //append team.txt with txt defined above\n fs.appendFile(`./output/team.txt`, txt, \"utf8\", (err) => {\n if (err) throw err;\n })\n }", "title": "" }, { "docid": "beb7972f7e50b4e1169d2a8becfeee56", "score": "0.54226416", "text": "function writeToFile(fileName, data) {\n // file = readme\n // data = content\n // var stringQuestions;\n\n // for(var i =0; i < data.length; i++) {\n // stringQuestions += '\\n' + data[i]; \n // }\n\n fs.writeFile(fileName, data, function(err){\n\n if(err) {\n console.log(err);\n }\n console.log('success');\n\n })\n}", "title": "" }, { "docid": "2dc54e35f396af6032db73290b75be63", "score": "0.5403499", "text": "function saveToFile() {\n\n // Write to file call\n fs.writeFile(dbNotes, JSON.stringify(allNotes, null, 4), (errWrite) => {\n if (errWrite) throw errWrite;\n });\n}", "title": "" }, { "docid": "028d756abf9ee470372a8f47350f3e5b", "score": "0.53999346", "text": "function writeToFile(fileName, data) {}", "title": "" }, { "docid": "028d756abf9ee470372a8f47350f3e5b", "score": "0.53999346", "text": "function writeToFile(fileName, data) {}", "title": "" }, { "docid": "2343800ecbc0d6f7c4489ca318976027", "score": "0.5353654", "text": "function write(){\n return map(function(file, cb){\n fs.writeFile(file.path, String(file.contents), function(){\n cb(null, file);\n });\n });\n}", "title": "" }, { "docid": "7a47967b3c5b1852e3f6a4e13af84ef5", "score": "0.5352361", "text": "write_to_file(file, data){\n fs.writeFileSync(`${this.output_directory}/${file}`, data);\n }", "title": "" }, { "docid": "be64959d77a068ab4e692bedef6c7bea", "score": "0.534576", "text": "function writeData(testfile, data) {\n fs.writeFile(testfile, data, (err) => {\n if (err) throw err;\n });\n fixNameString(testfile, dev);\n }", "title": "" }, { "docid": "dda8170489d759af44b5d0429f32c221", "score": "0.52983177", "text": "function writeClientToFile(clientToWrite){\n fs.appendFile('clients.dat', JSON.stringify(clientToWrite)+\"\\n\",function (err) {\n if (err) throw err;\n });\n}", "title": "" }, { "docid": "b1f0dcc127cd3bb87f56bbea4002a1a6", "score": "0.5280038", "text": "async writeFile(note){\n note.id = uniqid()\n console.log('about to write this note to db.json ', note)\n const notes = await this.getNotes()\n notes.push(note)\n console.log('notes ', notes)\n return fs.writeFileSync(\"db/db.json\", JSON.stringify(notes)), err => {\n if (err) throw err;\n }\n}", "title": "" }, { "docid": "62446ef92ff318a627a3fead3c104d34", "score": "0.5252329", "text": "function fillFile(file, buffer){\n console.log(buffer.fill(9));\n // console.log(letters);\n buffer = Buffer.allocUnsafe(100).fill(str);\n console.log(buffer); // changeString(names);\n\n fs.writeFile(file, buffer, function(err){\n if(err){\n return console.log(err);\n }\n else{\n console.log(\"The file was created\");\n }\n })\n\n}", "title": "" }, { "docid": "9c7a2220532a162709b6fc230d1ec24c", "score": "0.5231826", "text": "function writeFile()\n {\n fs.writeFile('../json/memories.json', jsonString, err => {\n if (err) {\n console.log('Error writing file', err)\n } else {\n console.log('Successfully wrote file')\n }\n })\n }", "title": "" }, { "docid": "594aa70badd5ffc6d4afc164290797a8", "score": "0.5222917", "text": "function save_text(file_name,info_text) {var ds; if (flow_path.indexOf('/') !== -1) ds = '/'; else ds = '\\\\';\nif (!file_name) {save_text_count++; file_name = flow_path + ds + 'text' + save_text_count.toString() + '.txt';}\nvar fs = require('fs'); fs.write(file_name, info_text, 'w');}", "title": "" }, { "docid": "74863ad51ef41af2384ca14168305e30", "score": "0.52170277", "text": "function writeToFile(fileName, answers) {\n return fs.writeFileSync(fileName, answers);\n \n \n}", "title": "" }, { "docid": "3ccf6548bce62a9dc00bf63836629890", "score": "0.5203221", "text": "function saveToFile() {\r\n\r\n var data = [];\r\n\r\n //get the phonebook in a string//\r\n convertPhoneBookToJson(root, data);\r\n\r\n //write to file//\r\n fs.writeFileSync('myFile.txt', JSON.stringify(data));\r\n\r\n}", "title": "" }, { "docid": "9393c2543b81ebda3fe8cfda63bbb85d", "score": "0.51957136", "text": "function writeToFile(filename, string){\r\n\tfs.writeFile(filename, string, function(err) {\r\n\t\tif(err) {\r\n\t\t\tconsole.log(err);\r\n\t\t} else {\r\n\t\t\t//console.log(\"The file was saved!\");\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "d1a2bff42d1e895f4ef1d7f522decafb", "score": "0.51758343", "text": "async write(pathToFile, { randomise = false }) {\n const rendered = cards.map(card => mustache.render(this.template, card));\n if (randomise) {\n rendered.sort((a, b) => (a < 'j' ? -1 : 1));\n }\n console.log('\"\"\" RENDERED', rendered);\n await fsPromises\n .writeFile(pathToFile, rendered.join('\\n'), 'utf8')\n .then(() =>\n console.log(`Written ${rendered.length} records to ${pathToFile}`),\n );\n }", "title": "" }, { "docid": "f0c8892894a24a4ed6b2102ae216d6a6", "score": "0.517253", "text": "write(line) {\n fs.appendFile(this._fullName, '\\n' + line, function (err) {\n if (err) {\n console.log(\"Write log failed: \" + JSON.stringify(err));\n console.log(\"Failed log: \" + line)\n }\n });\n }", "title": "" }, { "docid": "16ff9b4bb69befd650da66e7cc3773c4", "score": "0.51661515", "text": "async function uploadPatientReport({patientId, uuid, reportFile, fileType}){\n\n const endpoint = fileType === 'PPE_FILETYPE_BIOMARKER_REPORT' ? '/api/reports' : '/api/otherDocuments'\n const newFile = {\n uploadedBy: uuid,\n fileName: reportFile.name,\n uploadedFileType: fileType,\n description: \"\",\n dateUploaded: Date.now(),\n fileGUID: createUUID()\n }\n\n console.log(\"uploadPatientReport data sent to server:\", \n `\\nnewFile:`, newFile\n )\n\n // first: identify the user\n const userData = await fetchUser({patientId})\n\n // attach\n newFile.patientId = userData.id\n\n // upload the report\n return await fetch(endpoint,{\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(newFile)\n })\n .then(handleResponse)\n .then(resp => resp)\n .catch(handleErrorMsg('Unable to upload file.'))\n}", "title": "" }, { "docid": "f7b4013e15bc71e2a656e913ded88524", "score": "0.515335", "text": "_updateFile() {\n let jsonString = JSON.stringify(this.data);\n fs.writeFileSync(this.path, jsonString);\n }", "title": "" }, { "docid": "d77532b4afd358171e443db556092540", "score": "0.5137099", "text": "function writeToFile(fileName, data) {\n fs.writeFile( fileName, data,err=>{\n if (err) throw err;\n console.log('File has been successfully made') \n\n })\n\n\n}", "title": "" }, { "docid": "f009c7cd7842851162668c28430cafbe", "score": "0.51343596", "text": "function writeToFile(fileName, data) {\n \n}", "title": "" }, { "docid": "387d74f25fa89d9fcf76a81cd0059291", "score": "0.5133365", "text": "function putContents(file, str) {\n\t\tif (file.exists()) {\n\t\t\tfile.remove(null);\n\t\t}\n\t\tvar fos = Components.classes[\"@mozilla.org/network/file-output-stream;1\"].\n\t\tcreateInstance(Components.interfaces.nsIFileOutputStream);\n\t\tfos.init(file, 0x02 | 0x08 | 0x20, 0o664, 0); // write, create, truncate\n\n\t\tvar os = Components.classes[\"@mozilla.org/intl/converter-output-stream;1\"].\n\t\tcreateInstance(Components.interfaces.nsIConverterOutputStream);\n\t\tos.init(fos, \"UTF-8\", 4096, \"?\".charCodeAt(0));\n\t\tos.writeString(str);\n\t\tos.close();\n\n\t\tfos.close();\n\t}", "title": "" }, { "docid": "241c0443cd016506b35a483396eba3da", "score": "0.51327175", "text": "function writeFile() {\n fs.writeFile(\"team.html\", render(employees), function (err) {\n if (err) {\n return console.log(err);\n }\n console.log(\"Successfully created file.\");\n });\n}", "title": "" }, { "docid": "3c4b5081512aad111382c44e2d7399b4", "score": "0.51185995", "text": "function updateFile(object){\n if (!fs.existsSync(file)){\n // if there is no tennisPartners.json file create one\n fs.writeFileSync(file, \"[\" + JSON.stringify(object) + \"]\");\n // else read the existing file\n } else {\n fs.readFile(file, 'utf-8', (err, data) => {\n if (err) {\n console.log(err);\n }\n let myArray = [];\n if (data) {\n myArray = JSON.parse(data);\n }\n myArray.push(object);\n // Add new tennis players to the tennisPartners.json file / indentation 5\n fs.writeFile(file, JSON.stringify(myArray, null, 5), (err) => {\n if (err) console.log (err);\n });\n });\n }\n}", "title": "" }, { "docid": "6975be2619c794ebc243313c847df770", "score": "0.5112839", "text": "function writeToFile(data) {\n const toWrite = \"Closed - \" + Date.now() + ' ' + data;\n fs.writeFile('error.txt', toWrite, function (err) {\n if (err) {\n return console.log('error.txt Error: ' + err);\n }\n });\n}", "title": "" }, { "docid": "e3ba687cada7243cdf1b685d422165be", "score": "0.51104116", "text": "function writeToDB (newNote) {\n const filePath = path.join(scriptPath, \"db\", \"db.json\");\n\n dbNotes.push(newNote);\n generateID(dbNotes);\n var updatedNotes = JSON.stringify(dbNotes);\n fs.writeFile(filePath, updatedNotes, function (error, file) {\n if (error) throw error;\n console.log(\"working\");\n });\n}", "title": "" }, { "docid": "9a123c646a628e89f737c6e8efed78d7", "score": "0.51102006", "text": "function writeToFile(fileName, data) {\n}", "title": "" }, { "docid": "9a123c646a628e89f737c6e8efed78d7", "score": "0.51102006", "text": "function writeToFile(fileName, data) {\n}", "title": "" }, { "docid": "9a123c646a628e89f737c6e8efed78d7", "score": "0.51102006", "text": "function writeToFile(fileName, data) {\n}", "title": "" }, { "docid": "9a123c646a628e89f737c6e8efed78d7", "score": "0.51102006", "text": "function writeToFile(fileName, data) {\n}", "title": "" }, { "docid": "9a123c646a628e89f737c6e8efed78d7", "score": "0.51102006", "text": "function writeToFile(fileName, data) {\n}", "title": "" }, { "docid": "dfac76d4738bbbf2c36e879178f7f978", "score": "0.51083195", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, function(err) {\n console.log(fileName)\n console.log(data)\n if (err) {\n return console.log(err)\n }else {\n console.log(\"read me generated\")\n }\n })\n}", "title": "" }, { "docid": "483183001a810c51ec62e754b7e79b8a", "score": "0.51027817", "text": "function writeTextFile(n) {\n fs.appendFile('log.txt', JSON.stringify(n), function(err) {\n if (err) {\n console.log(err);\n } else {\n console.log('content added to log.txt');\n }\n })\n}", "title": "" }, { "docid": "cd7fcf8a08e4b05c606c7c3adf06eb86", "score": "0.5102139", "text": "function writeToFile(file, data) {\n return fs.writeFileSync(file, data);\n}", "title": "" }, { "docid": "872ecdcd2adfde80bf45e782d191cb05", "score": "0.50814605", "text": "function infoStorage() {\n\n\t//var fileName = askWhereToSave();\n\n\tvar donorFormInfo = [{\n\t\tbusiness: document.getElementById(\"businessName\").value,\n\t\tfirst: document.getElementById(\"firstName\").value,\n\t\tlast: document.getElementById(\"lastName\").value,\n\t\temail: document.getElementById(\"emailAddress\").value,\n\t\tphone: document.getElementById(\"phoneNumber\").value,\n\t\taddressInfo: document.getElementById(\"address\").value,\n\t\tcityInfo: document.getElementById(\"city\").value,\n\t\tprovinceInfo: document.getElementById(\"province\").value,\n\t\tpostal: document.getElementById(\"postalCode\").value,\n\t\tdonationDate: document.getElementById(\"donationDate\").value,\n\t\tmonetary: document.getElementById(\"monetaryAmount\").value,\n\t\tchequeInfo: document.getElementById(\"cheque\").value,\n\t\tcashInfo: document.getElementById(\"cash\").value,\n\t\tnonMonetary: document.getElementById(\"nonMonetaryAmount\").value,\n\t\titem: document.getElementById(\"nonMonetaryItem\").value,\n\t\treceiptCheckBox: document.getElementById(\"givenReceipt\").value,\n\t\tthankYouCheckBox: document.getElementById(\"givenCard\").value,\n\t\tcomment: document.getElementById(\"commentBox\").value\n\t}];//donorFormInfo\n\n\tvar fs = require('fs');\n\tvar stream = fs.createWriteStream(\"donorFormEntries/\" + donorFormInfo[0].business + \".txt\"/*, {'flags':'a'}*/);\n\n\tstream.once('open', function(fd) {\n\n\tstream.write(\"Business Name: \" + donorFormInfo[0].business);\n\tstream.write(\"Full Name: \" + donorFormInfo[0].first + \" \" + donorFormInfo[0].last + \"\\r\\n\");\n\tstream.write(\"Email Address: \" + donorFormInfo[0].email + \"\\r\\n\");\n\tstream.write(\"Phone Number: \" + donorFormInfo[0].phone + \"\\r\\n\");\n\tstream.write(\"Address: \" + donorFormInfo[0].addressInfo + \" , \" + donorFormInfo[0].cityInfo + \" , \" + donorFormInfo[0].provinceInfo + \" , \" + donorFormInfo[0].postal + \"\\r\\n\");\n\tstream.write(\"Monetary amount donated: $\" + donorFormInfo[0].monetary + \"\\r\\n\");\n\tstream.write(\"Cash: \" + donorFormInfo[0].cashInfo);\n\tstream.write(\"Cheque: \" + donorFormInfo[0].chequeInfo);\n\tstream.write(\"Non-Monetary estimated value: $\" + donorFormInfo[0].nonMonetary + \" The item donated: \" + donorFormInfo[0].item + \"\\r\\n\");\n\tstream.write(donorFormInfo[0].receiptCheckBox + \" \" + donorFormInfo[0].thankYouCheckBox + \"\\r\\n\" + \"\\r\\n\");\n\tstream.write(\"Comments: \" + donorFormInfo[0].comment);\n\tstream.end();\n\t});\n\n\tswal(\n\t\t'Thank you for your submission',\n\t\t'Your PDF is generated and saved',\n\t\t'success'\n\t)\n\n\tmakePDF(donorFormInfo);\n\t//gotoMainMenu();\n\t\n\n}", "title": "" }, { "docid": "53d3c605ff24073c3eec74b6249fdda3", "score": "0.50790805", "text": "function writetothefile(data){\n \n fs.appendFileSync(outputPath, data, 'utf8'); \n}", "title": "" }, { "docid": "b5b2d3d8f6b788e009359e7bd71a6844", "score": "0.5078948", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, err => {\n if (err) {\n return console.error(err);\n };\n \n console.log(\"READme Created!\");\n });\n\n}", "title": "" }, { "docid": "d0ea35fadb2eadda2201c560196b9f94", "score": "0.5074375", "text": "writeFile(filepath, data, { targetDir, fingerprint = this.fingerprint, error } = {}) {\n\t\tif(!targetDir) {\n\t\t\ttargetDir = path.dirname(filepath);\n\t\t}\n\n\t\tlet originalPath = filepath;\n\t\tif(fingerprint) {\n\t\t\tfilepath = generateFingerprint(filepath, data);\n\t\t}\n\n\t\treturn createFile(filepath, data).\n\t\t\tthen(() => this.manifest &&\n\t\t\t\t\tthis._updateManifest(originalPath, filepath, targetDir)).\n\t\t\tthen(() => {\n\t\t\t\treportFileStatus(originalPath, this.referenceDir, error);\n\t\t\t\tif(error && this.exitOnError) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t}).\n\t\t\tcatch(err => { // eslint-disable-line handle-callback-err\n\t\t\t\tabort(`aborting: ${err}`);\n\t\t\t});\n\t}", "title": "" }, { "docid": "6a7f13b652977f30b71d6b45545afcd9", "score": "0.5067428", "text": "function writeFile(data) {\n\n\tif(!fs.existsSync(\"log.txt\")) {\n\t\t//console.log(\"\\n\\nFile not found. Creating log.txt.\\n\\n\");\n\n\t\tfs.writeFileSync(\"./log.txt\",data)\n\t\t// if(fs.existsSync(\"bank.txt\")) {\n\t\t// \tconsole.log(\"File created!\\n\\n\");\n\t\t// }\n\n\t} else {\n\n\t\tfs.appendFileSync(\"./log.txt\",data)\n\n\t }\n\n}", "title": "" }, { "docid": "cda64c7d3f60fbecb4d2ea2c97862f0d", "score": "0.5060755", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, createMD(data), err=> console.log(err||\"success!\"))\n}", "title": "" }, { "docid": "8fc1c433360c3e7abec58ea288942037", "score": "0.50592595", "text": "function writeToFile(fileName, data) {\n \n fs.writeFile(fileName, data, err => {\n // if there's an error, reject promise and send error to .catch method\n if(err){\n throw err;\n // return out of the function to keep from resolving\n return;\n }\n\n // If all good, resolve and send to .this method\n console.log('README created!')\n });\n}", "title": "" }, { "docid": "b01c372aae498cd9196f1037b1a8b01d", "score": "0.5058024", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) => {\n err ? console.log(err) : console.log(`Success! Your readMe was generated!`);\n });\n}", "title": "" }, { "docid": "2c565cc874e8005b0462f1b17bd2c359", "score": "0.50491315", "text": "save(filename, label)\n {\n let data = [];\n if (fs.existsSync(filename))\n {\n data = JSON.parse(fs.readFileSync(filename, { encoding: 'utf8' }));\n }\n data.push(\n {\n date: Date.now(),\n label: label,\n timers: this.items\n });\n fs.writeFileSync(filename, JSON.stringify(data, null, 4), { encoding: 'utf8' });\n }", "title": "" }, { "docid": "5d4dec0370f7a8359345f32067df3107", "score": "0.504674", "text": "function writeFile(data) {\n\tconst newObj = data.concat(newrecipes);\n\tconst newObjstr = JSON.stringify(newObj);\n\tfs.writeFile(\"./config.json\", newObjstr, function (err) {\n\t\tif (err) {\n\t\t\tconsole.log(\"There has been an error saving your config\");\n\t\t\tconsole.log(\"err.message\");\n\t\t\treturn;\n\t\t}\n\t\tconsole.log(\"configuration saved succesfully\");\n\t});\n}", "title": "" }, { "docid": "b94942355e28623561cde743edfd019c", "score": "0.50371283", "text": "function writeFile()\n{\n console.log(\"writeFile: \" + fileEntry.fullPath);\n \n filetext = $('#textarea').val();\n \n\tfileEntry.createWriter(\n\t\tfunction (writer) { \n\t\t\twriter.write(filetext);\n\t\t}, \n\t\tfail\n\t);\n}", "title": "" }, { "docid": "8482b1947aa0ad66a8d0e00537ec1c98", "score": "0.503107", "text": "function writeJSONFile(content) {\nfs.writeFileSync(\n \"formular.json\",\n JSON.stringify({ people: content }),\n \"utf8\",\n err => {\n if (err) {\n console.log(err);\n }\n }\n);\n}", "title": "" }, { "docid": "bd4b71d7b317c01da5c806fe08ef0e5e", "score": "0.5020304", "text": "function writeToFile(fileName, readMeContent) {\n //path shipped module its within node, must be required\n //join method on path\n //lets just try to get a file to create and grabbing the information\n\n return fs.writeFileSync(fileName, readMeContent);\n}", "title": "" }, { "docid": "dcd4e7a0a06c84db869bec307c2d8d00", "score": "0.5016621", "text": "function writeToFile() {\n inquirer.prompt(questions)\n .then(answers => {\n fs.writeFile(fileName, generateFile(answers), err => {\n err ? console.log(err) : console.log('The file has been saved!');\n });\n });\n}", "title": "" }, { "docid": "169e3723bb919421d7731e550e5a9440", "score": "0.5015479", "text": "function mylog(dta){\n require('fs').writeFileSync(__dirname+\"\\\\\"+\"../../log/\"+Date.now()+\"-reqtwo.txt\" , dta);\n}", "title": "" }, { "docid": "7ed85e89576f68ae7375200311757135", "score": "0.50072175", "text": "function writeToFile(fileName, data) {\n\nfs.writeFile(fileName, data, function(err) { if (err) {\n return console.log(err);}\n console.log(\"Succes completed\" + fileName);\n });\n}", "title": "" }, { "docid": "9bffc1578c243d81ade2ad7022d88add", "score": "0.49944913", "text": "writeStringToFile(filePath, string) {\n var fileString;\n fileString = NSString.stringWithString(string);\n return fileString.writeToFile_atomically_encoding_error(filePath, true, NSUTF8StringEncoding, null);\n }", "title": "" }, { "docid": "bd51b6629c0eeed36d71ef8021f18132", "score": "0.49942607", "text": "function createFile(){\n fs.writeFile(newAnswer, newContent, (err) => {\n if (err) throw err;\n console.log(\"File successfully saved!\");\n rl.close();\n });\n }", "title": "" }, { "docid": "1e27f0464680fb97660bf133b9d36607", "score": "0.49912637", "text": "write(addNote) {\n return writeFileAsync('./db/db.json', JSON.stringify(addNote)); \n }", "title": "" }, { "docid": "192fbb79819f1b060ded260a1146edbc", "score": "0.499087", "text": "function writeFile(notesDB) {\n fs.writeFile('db/db.json', JSON.stringify(notesDB), function (err) {\n if (err) throw err;\n console.log(\"success\");\n });\n }", "title": "" }, { "docid": "94a16d97587251bf675ffd81d26b7a71", "score": "0.49904507", "text": "async function _updatePatient(patient, data) {\n const ops = {\n replace: function(patient, d) {\n _.set(patient, d.path, d.value)\n }\n /* ...add and remove for phones */\n }\n\n data.forEach((d) => {\n const operation = ops[d.op]\n operation(patient, d)\n })\n\n return patient.save(patient)\n}", "title": "" }, { "docid": "a17e41692ae8902e05c701b99ff581fd", "score": "0.49853197", "text": "function writeToFile(fileName, data) {\n \n fs.writeFile(fileName, data, err =>\n err ? console.error(err) : console.log(\"Success! New README generated!\"));\n\n}", "title": "" }, { "docid": "f4331ca780d8380653bc5393af67911d", "score": "0.4982052", "text": "async writeAll(records) {\n await fs.promises.writeFile(\n this.filename,\n JSON.stringify(records, null, 2) //2 for indentation in json file\n );\n }", "title": "" }, { "docid": "34e8ef45a69ef8f9bb534a33b169e0a3", "score": "0.49754384", "text": "function writeMainArrayToFile() {\n\tvar date = new Date().toISOString();\n\tvar fileName = '';\n\tfileName = fileName.concat(date);\n\tfs.writeFile(\"/tmp/test\", meAndMyFriends, function(err) {\n\t if(err) {\n\t sys.log(err);\n\t } else {\n\t sys.log(\"The file was saved!\");\n\t meAndMyFriends = [];\n\t }\n\t}); \n}", "title": "" }, { "docid": "d6f1e6c4f77d77c85dcd5f4458a56b32", "score": "0.49692765", "text": "function writeFile(notesArray){\n fs.writeFileSync(\n path.join(__dirname, './db/db.json'),\n JSON.stringify(notesArray, null, 2)\n );\n}", "title": "" }, { "docid": "a0aea9241faffe709621d5761b2443ff", "score": "0.49663973", "text": "function writeToFile(fileName, data) {\n fs.writeFileSync(fileName, data, function(err){\n if(err)\n console.log(err);\n })\n}", "title": "" }, { "docid": "440d86bf060a6f391ba74df939e4d5ad", "score": "0.49581727", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, err => err ? console.log(err) : console.log('Success!')); \n \n}", "title": "" }, { "docid": "a00e95f236c3106b9e99249cd21b19c4", "score": "0.4957758", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) => {\n if (err) throw err;\n // console.log(err)\n // }\n console.log('The file has been generated and saved');\n })\n}", "title": "" }, { "docid": "175ac32e82fb1d58efee99786053d0ad", "score": "0.495484", "text": "function writeToFile(fileName, data) {\n console.log(data);\n fs.writeFile(fileName, data, function(err, result) {\n if(err) console.log('error', err);\n });\n}", "title": "" }, { "docid": "4b7e7dd6a801981d949be83e461b609e", "score": "0.49387035", "text": "function writeParticipation(newParticipation) {\n var text = newParticipation.stringVersion();\n message(\"saving participation \" + text);\n FileIO.writeFile(ratingsFilename, text + \"\\r\\n\", 1);\n }", "title": "" }, { "docid": "b4ec0a2a1114424c07e210e1a6f9ce1b", "score": "0.49385896", "text": "function writeToFile(json,measurement) {\n // fs.appendFile('./influx.data',\n// ws.write('tracking'+json.line+',tote='+json.tote+',line='+json.line+',element='+json.element+' value=1 '+json.timestamp +'\\n')\n // ,function(err) {\n // if (err) {\n // console.log(err)\n // }\n \n //}\n //)\n}", "title": "" }, { "docid": "f49ed538831027e9ec5212d4b1955824", "score": "0.49374706", "text": "function writeToConfig(fileObj) {\n\n fileObj.Service.ServiceName = finalRandomServiceName;\n fileObj.Service.ServiceName2 = finalRandomServiceName2;\n ////console.log('This is to WriteFile Stringified fileObj:' +'\\n\\n' + JSON.stringify(fileObj) + '\\n\\n');\n\n jsonfile.writeFileSync(filePath, fileObj);\n //console.log('Name Write Successful');\n config = jsonfile.readFileSync('./support/'+featureConfig);\n}", "title": "" }, { "docid": "1d38ee5993ac425ed8225c10e7032fdf", "score": "0.49340025", "text": "function writeToFile(fileName, data) {\n\n fs.writeFile(fileName,data, function(err){\n if (err) throw err\n console.log(\"Done\");\n \n })\n}", "title": "" }, { "docid": "f066ed4198493aa3728a88cc17230d67", "score": "0.49259165", "text": "function addPatient(){\nlet selectedDoc = document.getElementById(\"docSelect\").value;\nlet splitDoc = selectedDoc.split(\" \");\nlet doctorId = splitDoc[0];\nlet docFirstName = splitDoc[3];\nlet docLastName = splitDoc[4];\nlet addPatId = parseInt(document.getElementById(\"id\").value);\nlet addPatFirstName = document.getElementById(\"firstName\").value;\nlet addPatLastName = document.getElementById(\"lastName\").value;\nlet preAddPatHR = (document.getElementById(\"heartRate\").value);\nlet addPatHR = Number(preAddPatHR);\n\n//Some light input sanitation. In future iterations would definitely add more input sanitation to firstname and last name, don't allow for long string entries.\n//Also should add capitalization of first letter with regex\nif (addPatId > 200){\n let removeID = document.getElementsByTagName(\"p\")[1];\n removeID.removeAttribute(\"hidden\");\n removeID.innerHTML = \"You cannot enter an Id above 200.\";\n document.getElementById(\"saveThisPatient\").innerHTML = \"\";\n return;\n } else {\n let removeID = document.getElementsByTagName(\"p\")[1];\n removeID.setAttribute(\"hidden\", true);\n }\n\nif(addPatFirstName.match(/\\d/)){\n let removeFN = document.getElementsByTagName(\"p\")[2];\n removeFN.removeAttribute(\"hidden\");\n removeFN.innerHTML = \"You cannot enter any numerical values in the First Name.\";\n document.getElementById(\"saveThisPatient\").innerHTML = \"\";\n return;\n} else {\n let removeThis = document.getElementsByTagName(\"p\")[2];\n \tremoveThis.setAttribute(\"hidden\", true);\n}\n\nif(addPatLastName.match(/\\d/)){\n let removeFN = document.getElementsByTagName(\"p\")[3];\n removeFN.removeAttribute(\"hidden\");\n removeFN.innerHTML = \"You cannot enter any numerical values in the Last Name.\";\n document.getElementById(\"saveThisPatient\").innerHTML = \"\";\n return;\n} else {\n let removeThis = document.getElementsByTagName(\"p\")[3];\n \tremoveThis.setAttribute(\"hidden\", true);\n}\n\nif (addPatHR >= 480){\n let removeID = document.getElementsByTagName(\"p\")[4];\n removeID.removeAttribute(\"hidden\");\n removeID.innerHTML = \"The highest recorded HR to date is less than 480. Try lower.\";\n document.getElementById(\"saveThisPatient\").innerHTML = \"\";\n return;\n} else {\n let removeID = document.getElementsByTagName(\"p\")[4];\n removeID.setAttribute(\"hidden\", true);\n}\n\n//Object being sent to server\n let newPatient = {\n \"doctor\": {\n \"id\": doctorId,\n \"firstName\": docFirstName,\n \"lastName\": docLastName\n },\n \"id\": addPatId,\n \"firstName\": addPatFirstName,\n \"lastName\": addPatLastName,\n \"heartRate\": addPatHR\n }\n //Post request \n ajaxPost(postUrl, printResponse, newPatient);\n}", "title": "" }, { "docid": "9d183f9cb1a075e7c210f4ca14b55640", "score": "0.49206308", "text": "function writeToFile(data) {\n fs.writeFile(writePath, data, handleError)\n}", "title": "" }, { "docid": "9a1689ccf143a8054e15dbe9b87b9e43", "score": "0.49195877", "text": "function writeToFile(fileName, data) {\n\n // fs.writeFile(fileName, data, err =>)\n fs.writeFile(fileName, data, function (err) {\n\n if (err) {\n return console.log(err);\n }\n console.log(\"Success ! Your file has been generated\")\n })\n}", "title": "" }, { "docid": "f5036ebc628c2ecc1799ad6c0a6ee8a7", "score": "0.49191946", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, generate(data), err => err \n ? console.error(err) \n : console.log(\"Success! Your ReadMe.md is being generated.\"));\n}", "title": "" }, { "docid": "bdcc078ead43a87b8ce1b88e8443eb93", "score": "0.49155605", "text": "function writeJsonToFile(jsonData)\n{\n var fileStr=\"Id\\t|firstName\\t|LastName\\t|Score \\n\";\n for(var i=0;i<jsonData.students.length;i++) \n {\n fileStr=fileStr+jsonData.students[i].id+\"\\t|\"+jsonData.students[i].fName+\"\\t\\t|\"+jsonData.students[i].lName+\"\\t\\t|\"+jsonData.students[i].score+\"\\n\";\n }\n fs.writeFile(constants.DESTINATION_TEXT_FILE,fileStr,function txtFileError(error){\n if(error) {\n console.log(error);\n }\n console.log(\"JsonObject successfully written to specified txt file\");\n });\n}", "title": "" }, { "docid": "6b90848085342df147623d815797f8e3", "score": "0.49141994", "text": "function writeLocalesFile(data) {\n\tfs.appendFileSync(LOCALES_FILE, JSON.stringify(data, null, 2));\n\tconsole.log(data);\n\tconsole.log(`data written to ${path.resolve(__dirname, LOCALES_FILE)}`);\n}", "title": "" }, { "docid": "4a11e2854a0e83517d84a4d4f1428673", "score": "0.49118122", "text": "save() {\n let rawData = fs.readFileSync(p);\n let messages = JSON.parse(rawData);\n console.log(messages);\n messages.push(this);\n console.log(messages);\n\n fs.writeFileSync(p, JSON.stringify(messages));\n }", "title": "" }, { "docid": "40e653e59accbf3c642dfe94f064b495", "score": "0.49111304", "text": "function writeToFile(fileName, data) {\n//promt questions from inquirer\n inquirer\n .prompt(questions)\n .then(answers => {\n\n const markdown = generateMarkdown(answers)\n \n //writes to file\n fs.writeFile('README.md' , markdown ,(err) => {\n if (err) throw err;\n console.log('file saved')\n\n\n } )\n })\n \n }", "title": "" }, { "docid": "308354cd100030be8f968acc732b60c5", "score": "0.49093813", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, function (err) {\n console.log(fileName);\n console.log(data);\n if (err) {\n return console.log(err);\n } else {\n\n console.log(\"Success!\");\n }\n } ,\n\n )\n }", "title": "" }, { "docid": "d2fc5ab0e6f99c09f74f0d314c077f40", "score": "0.4895495", "text": "function writeFile(response){\n\n fs.appendFile(\"log.txt\",\"\\r\"+response, function(err) {\n if(err) {\n return console.log(err);\n }\n\n console.log(\"log.txt was updated!\");\n\n}); \n}", "title": "" }, { "docid": "d3427649cb173a248e9d3e10f7592a15", "score": "0.48919544", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) =>\n err ? console.log(err) : console.log('Successfully created ReadMe!')\n );\n\n}", "title": "" }, { "docid": "e4e4489a5da27a44b754a0e6431397d9", "score": "0.48914376", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName,data, function(err) {\n console.log(fileName)\n console.log(data)\n if (err) {\n return console.log(err)\n } else {\n console.log('success')\n }\n })\n}", "title": "" }, { "docid": "5c1912431d02408d1e93290fd4e73f9a", "score": "0.48914218", "text": "function updateFile(){\n jsonFile.writeFile('server/dataFile.json', dataStuff, function (err) {\n console.error(err)\n })\n}", "title": "" }, { "docid": "afd1c4f196a713df97aad98638c7c1ef", "score": "0.4890863", "text": "function writeToFile(fileName, data) {\n fs.writeFileSync(path.join(process.cwd(), fileName), data), function(err){\n if (err) {\n throw err;\n };\n \n console.log(\"New README created!\");\n }\n}", "title": "" }, { "docid": "91fe8a3e82fafcdc303f1036ac24a428", "score": "0.48894435", "text": "function writeToFile(fileName, data) {\n //Writes file\n fs.writeFile(fileName, data, (err) =>\n err ? console.log(err) : console.log(\"Generating README..\")\n );\n}", "title": "" }, { "docid": "15e041416d2470c4b840a5c013e6de6e", "score": "0.48894078", "text": "function fappend(txt) { fileContent += txt + \"\\n\";}", "title": "" }, { "docid": "b93458c6304e8265a27bcaf2f0692df1", "score": "0.48866954", "text": "async writeAll(records) {\n await fs.promises.writeFile(\n this.filename, \n JSON.stringify(records, null,2)\n ); // second and third args are make json file more readble\n }", "title": "" }, { "docid": "6df30c7d661671cf08a5ab8b462aa730", "score": "0.4884579", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, generateMarkdown(data), function(){\n console.log(\"file successfully written\");\n })\n}", "title": "" }, { "docid": "ab00864574810618ab352c9d6c7849a3", "score": "0.4883974", "text": "static writeFile(fileEntry, dataObj, isAppend) {\n var me = this;\n // Create a FileWriter object for our FileEntry (log.txt).\n return new Promise((resolve, reject) =>{\n fileEntry.createWriter(function (fileWriter) {\n\n fileWriter.onwriteend = function () {\n me.readFile(fileEntry).then(() =>{\n resolve();\n }).catch((err) =>{\n reject(err);\n });\n };\n\n fileWriter.onerror = function (e) {\n reject(e);\n };\n\n // If we are appending data to file, go to the end of the file.\n if (isAppend) {\n try {\n fileWriter.seek(fileWriter.length);\n }\n catch (e) {\n console.log(\"file doesn't exist!\");\n reject(e);\n }\n }\n fileWriter.write(dataObj);\n });\n });\n }", "title": "" }, { "docid": "129f70859befb2ed63e7be8917239f64", "score": "0.4877179", "text": "write() {\n const extension = '.json';\n const filename = this.createFileName();\n\n filesystem.writeFile('output/' + filename + extension, JSON.stringify(this.competitionResults, null, 2), (err) => {\n if (err)\n throw err;\n\n console.log('Output saved to %s.', filename + extension);\n });\n }", "title": "" }, { "docid": "6b5a6427b6eab1510f1737a9c124a045", "score": "0.48758468", "text": "function main() {\n fs.writeFileSync(outFile, encode(fs.readFileSync(inFile, 'utf-8')), 'utf-8');\n return RETURN_OK;\n}", "title": "" }, { "docid": "4afd87055fd75da19644384449523795", "score": "0.48726007", "text": "function writeFile(fileEntry, dataObj) {\n\n // Create a FileWriter object for our FileEntry (log.txt).\n fileEntry.createWriter(function (fileWriter) {\n //fileWriter.truncate(0);\n fileWriter.write(dataObj);\n\n fileWriter.onwriteend = function() {\n console.log(\"Successful file write...\");\n };\n\n fileWriter.onerror = function (e) {\n console.log(\"Failed file write: \" + e.toString());\n };\n\n });\n}", "title": "" }, { "docid": "4ae5238dd54f406cdbb861883e26c44f", "score": "0.48720387", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, (err) =>\n err ? console.error(err) : console.log('Success!'))\n}", "title": "" }, { "docid": "9c33f3715c384d6d816d8e9a578c44c0", "score": "0.48698658", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, generateMarkdown(data), (err) => {\n if(err) throw(err)\n \n \n \n console.log(\"Success\") \n})\n}", "title": "" }, { "docid": "d43d76e84a7d44b2be6dd684ea32d9d1", "score": "0.4869148", "text": "function writeToFile(fileName, data) {\n fs.writeFile(fileName, data, err => {\n if (err) throw err\n console.log(\"ReadMe successfully generated!\");\n });\n}", "title": "" }, { "docid": "11b26ee2195f45d36faac2e40f45521e", "score": "0.48685816", "text": "function file_write( filepath, contents )\n{\n // Declare file object\n var file_obj = new File();\n\n // Opens, Writes, and Closes file.\n file_obj.Open( filepath );\n file_obj.Write( contents+\"\\n\" );\n file_obj.Close();\n\n return;\n} // end function file_write.", "title": "" }, { "docid": "c5f55a1831c81885764e3deef6ef8bb9", "score": "0.48672995", "text": "function save(){\n clearTimeout(saveTO);\n saveTO = setTimeout(function(){\n fs.writeFile(fname, stringify());\n saveTO = null;\n }, 13)\n }", "title": "" }, { "docid": "43237a25280ab4f563d4e836cb93f4cb", "score": "0.48583978", "text": "function write() {\n var file = getFile();\n file.write(JSON.stringify({\n username: exports.username,\n domain: exports.domain,\n resource: exports.resource,\n url: exports.url,\n password: exports.password\n }));\n}", "title": "" }, { "docid": "22edff5dd608889d0fe0d8af743f8cfe", "score": "0.48582244", "text": "function writeToFile(fileName, data) {\n fs.writeFile( fileName, data, err=> {\n if (err) {\n return console.log(err);\n }\n console.log(\"File Successfully wrote: \" + fileName);\n })\n}", "title": "" } ]
8e6a8706c4e0b3306271ccc22efcec5f
Function Name: checkCheckBox Arguments: cb Returns: true if the checkbox is checked false otherwise
[ { "docid": "0f602c55d2ed0931cfe1832aeef5028e", "score": "0.837126", "text": "function checkCheckBox(cb){\n\treturn cb.checked;\n}", "title": "" } ]
[ { "docid": "132d16696d407eb8b81bf9f186e3c459", "score": "0.7477834", "text": "function checkCheckBox(topping) {\r\n let flag = false;\r\n if (topping.checked === false) {\r\n\r\n } else {\r\n flag = true;\r\n }\r\n\r\n return flag;\r\n\r\n\r\n}", "title": "" }, { "docid": "5b7984890da144f8b5439094418c5860", "score": "0.7443684", "text": "function isChecked( pCheckBox )\r\n{\r\n\tif( pCheckBox.checked )\r\n\t\treturn true\r\n\telse\r\n\t\treturn false\r\n}", "title": "" }, { "docid": "157aba24cdfcbca80233e8a288c46022", "score": "0.6831063", "text": "function checkCheckBox(field,name)\r\n{\r\n var i,flag=0\r\n \r\n if (field.length > 1)\r\n {\r\n for(i=0;i<field.length;i++)\r\n {\r\n if (field[i].checked)\r\n {\r\n flag=1\r\n break\r\n } \r\n }\r\n \r\n }\r\n else\r\n {\r\n if (field.checked)\r\n {\r\n flag=1\r\n } \r\n }\r\n \r\n if(flag==0)\r\n {\r\n alert(name + \" should be selected\")\r\n return false\r\n }\r\n \r\n \r\n return true\r\n}", "title": "" }, { "docid": "fa116a1a28298830bfbaa36627165f0a", "score": "0.6824221", "text": "checkBox(data) {\r\n //Selecting the checkbox\r\n let checkBox = this.shadowRoot.querySelector(\"#check\");\r\n let status = data.checked;\r\n //The code below checks if the checked property has changed\r\n if (checkBox.checked == status) {\r\n return (status);\r\n } else {\r\n return (!status);\r\n }\r\n }", "title": "" }, { "docid": "5e4ec7ad644a80c50444f976dcae1120", "score": "0.67341983", "text": "function isCheckboxSelected(szFormName, szCheckBoxName) \r\n{\r\n return getSelectedCheckbox(szFormName, szCheckBoxName).length > 0;\r\n}", "title": "" }, { "docid": "d08d77d82ea8fc2f32df1b0968cea689", "score": "0.66602445", "text": "function BocCheckBox_ToggleCheckboxValue (checkBox, label, trueDescription, falseDescription)\n{ \n checkBox.checked = !checkBox.checked;\n BocCheckBox_OnClick (checkBox, label, trueDescription, falseDescription);\n}", "title": "" }, { "docid": "05426f5a250e4912a86e4b273197ac6b", "score": "0.66337484", "text": "function check(answer){\n return answer===checkboxValue\n }", "title": "" }, { "docid": "d6175953b874174e2a91cd89fb5a1b35", "score": "0.66146696", "text": "function controlloCheckbox(nomeCheckbox)\n{\n //Controlla se la checkBox è spuntata\n if(document.getElementById(nomeCheckbox).checked)\n {\n return true;\n }\n else\n {\n return false;\n }\n}", "title": "" }, { "docid": "5851f7e636b4fb1312e24b135f59d494", "score": "0.66123456", "text": "hasCheckboxAtIndex() {\n return false;\n }", "title": "" }, { "docid": "ae60f02f47ec39035e22eacf433a1aeb", "score": "0.6569805", "text": "function checkBoxGetChecked (checkBox){\n \n return checkBox[0][0].checked;\n}", "title": "" }, { "docid": "a2eab67247302774dc8765b79a2734cc", "score": "0.65141237", "text": "function handleCheckBox(checkbox) {\n switch (checkbox) {\n case \"cbStatus\":\n console.log(`Status anterior ${checkedStatus}`);\n setCheckedStatus(!checkedStatus);\n\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "387dd5739dbfa782a29597b6c41591b9", "score": "0.64936936", "text": "check() {\n if (this.state.label === this.state.deivce) {\n this.setState({ isChecked: true });\n return true;\n } else {\n return this.state.isChecked;\n }\n }", "title": "" }, { "docid": "cafe2387b02e48d10295f3013dde1548", "score": "0.6492662", "text": "function checkCallback(event) {\n\tevent.stopPropagation();\n\tconst taskContainer = event.target.parentElement;\n\tconst taskId = taskContainer.getAttribute(\"id\");\n\n\tlet checkedValue;\n\n\tif (this.checked) {\n\t\tcheckedValue = true;\n\t} else {\n\t\tcheckedValue = false;\n\t}\n\n\ttoggleComplete(taskId, checkedValue);\n}", "title": "" }, { "docid": "1c48f9d65ee3af7b505d97bcfa72ff35", "score": "0.64614093", "text": "function wasallcheckd() {\n var res = 'true'\n $('input.chckbox').each(function(){ \n if($(this).is(':not(:checked)')){\n res = 'false'; \n } \n });\n if (res == 'false') {\n return false;\n }\n }", "title": "" }, { "docid": "985548f8101ba898bd0cfa387717a998", "score": "0.6436275", "text": "function isChecked( checkboxId )\r\n{\r\n return document.getElementById( checkboxId ).checked;\r\n}", "title": "" }, { "docid": "ab4af0618b2521755920c6865b572fff", "score": "0.64204943", "text": "function CheckCheckBoxes(cbid, hidden, display) {\n var i;\n var id;\n var disable;\n\n disable = false;\n for (i = 0; i < checkBoxCount; i++) {\n id = cbid + i;\n if (document.getElementById(id).checked) {\n id = hidden + id;\n if (document.getElementById(id) != null) {\n disable = true;\n break;\n }\n }\n }\n\n ToggleButton(display, disable);\n}", "title": "" }, { "docid": "e5c2b5d2a027de5ae1fc53d772856190", "score": "0.63838536", "text": "function BocCheckBox_OnClick (checkBox, label, trueDescription, falseDescription)\n{ \n // Update the controls\n var checkBoxToolTip;\n var labelText;\n \n if (checkBox.checked)\n {\n var description;\n if (trueDescription == null)\n description = _bocCheckBox_trueDescription;\n else\n description = trueDescription;\n checkBoxToolTip = description;\n labelText = description;\n }\n else\n {\n var description;\n if (falseDescription == null)\n description = _bocCheckBox_falseDescription;\n else\n description = falseDescription;\n labelText = description;\n }\n if (label != null)\n label.innerHTML = labelText;\n}", "title": "" }, { "docid": "27457532459f5862a274c3ee91a7a999", "score": "0.6383373", "text": "function estado_checked (id_checkbox) {\n checkbox_pizarra = document.getElementById (id_checkbox);\n if (checkbox_pizarra.checked) {\n return true;\n } else {\n return false;\n } \n \n \n}", "title": "" }, { "docid": "84e61b6e32d0a565bcd52622662e63c1", "score": "0.6353675", "text": "function handleCheck(event) {\n\n // destructuring the event.target\n const { name } = event.target\n\n if (!values.checkBox1) {\n setValues((prevValue) => {\n return { ...prevValue, [name]: true }; //return true if checkbox 1 is checked\n }) \n } else {\n setValues((prevValue => {\n return { ...prevValue, [name]: false } //return false if checkbox 1 is unchecked\n }))\n }\n }", "title": "" }, { "docid": "016dc09754b78831d1a4825accc796cf", "score": "0.62357646", "text": "function normalCheck(cb, changeVal=false, newVal=false, editSelect=true, isChecked=\"\") {\n if (isChecked == \"\") isChecked=cb.checked;\n if (!isChecked && !newVal) $(\".select-all-box\").first().prop(\"checked\",false);\n\n var row = $(cb).parent().parent()\n\n if (changeVal) {\n $(cb).prop(\"checked\", newVal);\n isChecked = newVal;\n }\n function getName() {\n mid = \" \";\n nickname = $(row).find(\".nk-col\").html().trim();\n if (typeof(nickname) == \"string\" && nickname.length > 0) mid = \" \\\"\"+nickname+\"\\\" \";\n return $(row).find(\".fn-col\").html().trim() +mid+ $(row).find(\".ln-col\").html().trim();\n }\n if (isChecked) {\n $(row).addClass(\"highlight\");\n if (editSelect) {\n tokenFocusOverride = true;\n try { tokenbox.tokenInput(\"add\", { id: $(row).prop(\"id\"), name: getName()} ); } catch {}\n }\n } else {\n $(row).removeClass(\"highlight\");\n if (editSelect) {\n tokenFocusOverride = true;\n try { tokenbox.tokenInput(\"remove\", { id: $(row).prop(\"id\"), name: getName()} ); } catch {}\n }\n }\n}", "title": "" }, { "docid": "f74214fc3341d3aa6368f4e075dade59", "score": "0.6235473", "text": "function displayCheckBox(name, value) {\n var functionName = \"displayCheckBox :\";\n var check = null;\n var onClicked = \"changeState(this);\";\n try {\n if (value == true) {\n check = \"<input type='checkbox' name='\" + name + \"' checked='true' onClick='\" + onClicked + \"'>\";\n }\n else {\n check = \"<input type='checkbox' name='\" + name + \"' onClick='\" + onClicked + \"'>\";\n }\n\n } catch (e) {\n throwError(e, functionName)\n }\n return check;\n}", "title": "" }, { "docid": "640964a862fbf381eadcecbe12ece6dc", "score": "0.6192493", "text": "function CheckBoxValidation(Controlname,Fieldname)\n {\n var objfrm=document.getElementById(Controlname); \n var objFieldname=Fieldname;\t \t\n\t var flag;\n\t flag=false;\n\t\n\t var objValidator = new InputValidator();\n\t var objError \t = new ErrorAlert();\n if\n (\n \n objValidator.isCheckBoxValidation(objfrm,objValidator.Replace(objError.strchkboxchecked,\"<Field>\",objFieldname))\n \n )\n {\n\t \t objError = null\n\t\t objValidator = null\n\t\t flag=true\n }\n\n\t objError = null\n\t objValidator = null\n\t return flag\n }", "title": "" }, { "docid": "7319060062c6c2c861ba3613a6698044", "score": "0.6188562", "text": "function checkCheckboxInput(answer) {\n\t\t\tif ($('input[id=\"' + answer + '\"]:checked').length > 0) {\n\t\t\t\t\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": "7319060062c6c2c861ba3613a6698044", "score": "0.6188562", "text": "function checkCheckboxInput(answer) {\n\t\t\tif ($('input[id=\"' + answer + '\"]:checked').length > 0) {\n\t\t\t\t\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": "6e1e7675bc929fbf35a35fdd3d6c7beb", "score": "0.6172134", "text": "function makeTestAnyIsChecked() {\n var componentIds = [];\n for (var i = 0; i < arguments.length; i++) {\n componentIds[i] = arguments[i];\n }\n\n return {\n\ttestFunction: function() {\n\t for (var i = 0; i < componentIds.length; i++) {\n\t\tvar check = Ext.getCmp(componentIds[i]);\n\t\tif (check.getValue()) {\n\t\t return true;\n\t\t}\n\t }\n\t return false;\n\t},\n\ttestComponentIds: componentIds\n };\n}", "title": "" }, { "docid": "bbbb4c11def3c693325e3af08a842e75", "score": "0.61600834", "text": "checkBoxChanged(){\n console.log(\"chenged checkbox: \");\n \n /*this.users[this.users.indexOf(user)].selected = true;*/ \n /*user.checked = true;*/\n }", "title": "" }, { "docid": "ebabb47894415e0ea474221678158514", "score": "0.61412036", "text": "function isCheckBoxSelected(chkbox)\n{\n var noneChecked = true;\n\n if (typeof chkbox.length == 'undefined')\n {\n // there's only one checkbox in the form\n // normalize it to an array\n chkbox = new Array(chkbox);\n }\n\n for (var i = 0; i < chkbox.length; i++)\n {\n if (chkbox[i].checked)\n {\n noneChecked = false;\n break;\n }\n }\n\n if (noneChecked)\n return false;\n\n return true;\n}", "title": "" }, { "docid": "e25e4be8fbe5b11ba3c7a26eeada5e2b", "score": "0.61394995", "text": "function checkAll(checkboxname) {\n\tvar checkall = $(\"chkAllConfirm\");\n\tvar rowsNum = beanGrid.getRowsNum(); // Get the total rows of the grid\n\tvar columnId = beanGrid.getColIndexById(checkboxname);\n\n\tfor ( var rowId = 1; rowId <= rowsNum; rowId++) {\n\t\tif(cellValue(rowId, \"permission\") == 'Y') {\n\t\t\tvar curCheckBox = checkboxname + rowId;\n\t\t\tif ($(curCheckBox)) { // Make sure the row has been rendered and the element exists\n\t\t\t\t$(curCheckBox).checked = checkall.checked;\n\t\t\t\tupdateHchStatusA(curCheckBox);\n\t\t\t} else { // The HTML element hasn't been drawn yet, update the JSON data directly\n\t\t\t\tsetGridCellValue(beanGrid, rowId, columnId, checkall.checked);\n\t\t\t}\n\t\t}\n\t}\n\t\t\n\treturn true;\n}", "title": "" }, { "docid": "87815f57e3681e34d2728a50c883802f", "score": "0.6121831", "text": "function cbSkybox(s) {\n skybox = !skybox;\n s.checked = skybox;\n}", "title": "" }, { "docid": "2a46ea7afdc32332d7f9fa8273dfcaa2", "score": "0.6117401", "text": "function checkbox(){\n\n\t\tif (document.input.terms_ok != null && !document.input.terms_ok.checked) {\n\t\t\talert('Por favor acepta los términos y condiciones para continuar.');\n\t\t\treturn false;\n\t\t}\t\t\t\n\t\t\n\t\treturn true;\n\t}", "title": "" }, { "docid": "b2d51a484f3e1d1a57cd3ba748493e48", "score": "0.61139965", "text": "function ItemSelected(form,warningmsg, onlyCb){\n intCount = form.elements.length;\n bolShowMessage=true;\n for(x=1;x<=intCount;x++) {\n if(form.elements[x-1].checked && (!onlyCb || form.elements[x-1].id.substring(0, 3) == 'cb_')) {\n bolShowMessage=false;\n continue;\n }\n }\n\n if (bolShowMessage){\n if(warningmsg!=\"\") alert(warningmsg);\n return false;\n }else{\n return true;\n }\n}", "title": "" }, { "docid": "d9204f5bc49744b1104da3180f566ccd", "score": "0.6043847", "text": "function updateGUICheckbox(name)\n{\n\tlet obj = g_Checkboxes[name];\n\n\tlet checked = obj.get();\n\tlet hidden = obj.hidden && obj.hidden();\n\tlet enabled = !obj.enabled || obj.enabled();\n\n\tlet [guiName, guiType, guiIdx] = getGUIObjectNameFromSetting(name);\n\tlet checkbox = Engine.GetGUIObjectByName(guiName + guiType + guiIdx);\n\tlet label = Engine.GetGUIObjectByName(guiName + \"Text\" + guiIdx);\n\tlet frame = Engine.GetGUIObjectByName(guiName + \"Frame\" + guiIdx);\n\tlet title = Engine.GetGUIObjectByName(guiName + \"Title\" + guiIdx);\n\n\tif (guiType == \"Checkbox\")\n\t\tEngine.GetGUIObjectByName(guiName + \"Dropdown\" + guiIdx).hidden = true;\n\n\tcheckbox.checked = checked;\n\tcheckbox.enabled = g_IsController && enabled;\n\tcheckbox.hidden = hidden || !g_IsController;\n\tcheckbox.tooltip = obj.tooltip ? obj.tooltip() : \"\";\n\n\tlabel.caption = checked ? translate(\"Yes\") : translate(\"No\");\n\tlabel.hidden = hidden || g_IsController;\n\n\tif (frame)\n\t\tframe.hidden = hidden;\n\n\tif (title && obj.title)\n\t\ttitle.caption = sprintf(translate(\"%(setting)s:\"), { \"setting\": obj.title() });\n}", "title": "" }, { "docid": "4f360d92e2eea8cc3b2929177c148cd1", "score": "0.6041705", "text": "function onClickCheckbox() {\n setupButtons();\n}", "title": "" }, { "docid": "57f59c4fbcf9cfeda0fb77c404cf02ad", "score": "0.60327435", "text": "function Checkbox(props, context) {\r\n var _this = _super.call(this, props, context) || this;\r\n _this._checkBox = Utilities_1.createRef();\r\n _this._onFocus = function (ev) {\r\n var inputProps = _this.props.inputProps;\r\n if (inputProps && inputProps.onFocus) {\r\n inputProps.onFocus(ev);\r\n }\r\n };\r\n _this._onBlur = function (ev) {\r\n var inputProps = _this.props.inputProps;\r\n if (inputProps && inputProps.onBlur) {\r\n inputProps.onBlur(ev);\r\n }\r\n };\r\n _this._onClick = function (ev) {\r\n var _a = _this.props, disabled = _a.disabled, onChange = _a.onChange;\r\n var isChecked = _this.state.isChecked;\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n if (!disabled) {\r\n if (onChange) {\r\n onChange(ev, !isChecked);\r\n }\r\n if (_this.props.checked === undefined) {\r\n _this.setState({ isChecked: !isChecked });\r\n }\r\n }\r\n };\r\n _this._onRenderLabel = function (props) {\r\n var label = props.label;\r\n return label ? (React.createElement(\"span\", { className: _this._classNames.text }, label)) : (null);\r\n };\r\n _this._warnMutuallyExclusive({\r\n 'checked': 'defaultChecked'\r\n });\r\n _this._id = Utilities_1.getId('checkbox-');\r\n _this.state = {\r\n isChecked: !!(props.checked !== undefined ? props.checked : props.defaultChecked)\r\n };\r\n return _this;\r\n }", "title": "" }, { "docid": "57f59c4fbcf9cfeda0fb77c404cf02ad", "score": "0.60327435", "text": "function Checkbox(props, context) {\r\n var _this = _super.call(this, props, context) || this;\r\n _this._checkBox = Utilities_1.createRef();\r\n _this._onFocus = function (ev) {\r\n var inputProps = _this.props.inputProps;\r\n if (inputProps && inputProps.onFocus) {\r\n inputProps.onFocus(ev);\r\n }\r\n };\r\n _this._onBlur = function (ev) {\r\n var inputProps = _this.props.inputProps;\r\n if (inputProps && inputProps.onBlur) {\r\n inputProps.onBlur(ev);\r\n }\r\n };\r\n _this._onClick = function (ev) {\r\n var _a = _this.props, disabled = _a.disabled, onChange = _a.onChange;\r\n var isChecked = _this.state.isChecked;\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n if (!disabled) {\r\n if (onChange) {\r\n onChange(ev, !isChecked);\r\n }\r\n if (_this.props.checked === undefined) {\r\n _this.setState({ isChecked: !isChecked });\r\n }\r\n }\r\n };\r\n _this._onRenderLabel = function (props) {\r\n var label = props.label;\r\n return label ? (React.createElement(\"span\", { className: _this._classNames.text }, label)) : (null);\r\n };\r\n _this._warnMutuallyExclusive({\r\n 'checked': 'defaultChecked'\r\n });\r\n _this._id = Utilities_1.getId('checkbox-');\r\n _this.state = {\r\n isChecked: !!(props.checked !== undefined ? props.checked : props.defaultChecked)\r\n };\r\n return _this;\r\n }", "title": "" }, { "docid": "754b23fde803a0b88b3b31a33dd4ffcb", "score": "0.6023447", "text": "function checkBoxChecked(e) {\n filters.hideCompleted = e.target.checked;\n}", "title": "" }, { "docid": "cc06f3707e1ee5617ff8c5e8ca8e661d", "score": "0.60149294", "text": "function Checkbox(props, context) {\n var _this = _super.call(this, props, context) || this;\n _this._checkBox = Utilities_1.createRef();\n _this._onFocus = function (ev) {\n var inputProps = _this.props.inputProps;\n if (inputProps && inputProps.onFocus) {\n inputProps.onFocus(ev);\n }\n };\n _this._onBlur = function (ev) {\n var inputProps = _this.props.inputProps;\n if (inputProps && inputProps.onBlur) {\n inputProps.onBlur(ev);\n }\n };\n _this._onClick = function (ev) {\n var _a = _this.props, disabled = _a.disabled, onChange = _a.onChange;\n var isChecked = _this.state.isChecked;\n ev.preventDefault();\n ev.stopPropagation();\n if (!disabled) {\n if (onChange) {\n onChange(ev, !isChecked);\n }\n if (_this.props.checked === undefined) {\n _this.setState({ isChecked: !isChecked });\n }\n }\n };\n _this._onRenderLabel = function (props) {\n var label = props.label;\n return label ? (React.createElement(\"span\", { className: _this._classNames.text }, label)) : (null);\n };\n _this._warnMutuallyExclusive({\n 'checked': 'defaultChecked'\n });\n _this._id = Utilities_1.getId('checkbox-');\n _this.state = {\n isChecked: !!(props.checked !== undefined ? props.checked : props.defaultChecked)\n };\n return _this;\n }", "title": "" }, { "docid": "50707ff4d6dd10e5450d0c0be255d534", "score": "0.60004896", "text": "function checkBoxStatus(status) {\n if (status.checked) {\n status.value = \"Yes\";\n } else {\n status.value = \"No\";\n }\n}", "title": "" }, { "docid": "a52836c93a8251bf0cbc3c95c07d97b3", "score": "0.5993653", "text": "function validateCheckBoxSelection(message)\r\n{\r\n for(i=0; i <document.forms[0].elements.length; i++) {\r\n type = document.forms[0].elements[i].type;\r\n if ((type == \"checkbox\") && (document.forms[0].elements[i].checked)) {\r\n return true;\r\n }\r\n }\r\n \r\n alert(message);\r\n return false;\r\n}", "title": "" }, { "docid": "712919ca559e6a78f57ca72cd904c6a4", "score": "0.5980238", "text": "function createCheckBox(boxId){\r\n return '<input type=\"checkbox\" id=\"' + boxId + '\" onclick=\"updateArray(' + boxId + ', window.cpArray)\">'\r\n}", "title": "" }, { "docid": "9b14f5f24731311ec54b4f55601623a6", "score": "0.5974515", "text": "function cbCheckAllRowsAndSubTask( cb, n, fldName, subtaskName, subtaskValue ) {\n if (!fldName) {\n fldName = 'cb';\n }\n f = cbParentForm( cb );\n for ( var i = 0; i < n; i++ ) {\n box = f.elements[fldName+i];\n if ( box.checked == false ) {\n box.checked = true;\n }\n }\n\tif (subtaskName && subtaskValue) {\n\t\tf.elements[subtaskName].value = subtaskValue;\n\t}\n}", "title": "" }, { "docid": "eff7228bc517cbbbad7d6d048668c158", "score": "0.5974134", "text": "function chequear()\n{\n var isValid=false;\n\n var check=document.getElementById(\"check\");\n if(check.checked)\n {\n isValid=true;\n }\n else\n {\n isValid=false;\n }\n return isValid;\n}", "title": "" }, { "docid": "d82042e4b641f068a46e8426d5557b00", "score": "0.5971909", "text": "function checkBox() {\n // If the box is filled, add a button to change\n // the open box image to a closed box image\n if (booksIn === BOX_FILLED) {\n // You can't had more books\n $box.droppable(\"disable\");\n // Display the button to close the box\n $fullBoxButton.css(\"display\", \"inline-block\");\n // Check if the button is clicked\n // If so, hide the button and change the image\n $fullBoxButton.click(function(event, ui) {\n $fullBoxButton.css(\"display\", \"none\");\n $boxImage.attr(\"src\", \"assets/images/closedBox.png\");\n // Call the function to pick up the box\n liftBox();\n });\n }\n}", "title": "" }, { "docid": "5290a7ccee8d00764145a797d1f5a142", "score": "0.59683794", "text": "function InputCheck() {\r\n\t\tvar x = document.getElementById(\"check\").checked;\r\n\t\tvar age1 = document.getElementById(\"age1\").checked;\r\n\t\tvar age2 = document.getElementById(\"age2\").checked;\r\n\r\n\t\tif (\r\n\t\t\t(x == true) &&\r\n\t\t\t(age1 == true || age2 == true)\r\n\t\t) {\r\n\t\t\treturn false\r\n\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "c4c7237a9f79879f42c0886f686c0260", "score": "0.5954924", "text": "function checkboxChecked() {\n let angka = this.id.slice(-2);\n if (document.getElementById(this.id).checked) {\n mewarnai(angka);\n } else {\n hapusWarna(angka);\n }\n kalkulasi();\n}", "title": "" }, { "docid": "d647b000a78bbf319f1cfc6190108adf", "score": "0.59470344", "text": "isCheckbox(element) {\n\t\treturn element.type === 'checkbox';\n\t}", "title": "" }, { "docid": "f17e7c35f541fa1f531b5c5273356924", "score": "0.5931505", "text": "function isEventChecked() {\n const checkboxes = document.querySelectorAll('[type=\"checkbox\"]');\n let isBoxChecked = false;\n\n //Loop over all checkboxes and see if any have the checked attribute\n checkboxes.forEach((checkbox) => {\n //If they do, change isBoxChecked to true\n if (checkbox.checked) {\n isBoxChecked = true;\n }\n });\n\n if (!isBoxChecked) {\n //Show error message\n message.style.display = \"inline\";\n return isBoxChecked;\n } else {\n message.style.display = \"none\";\n return isBoxChecked;\n }\n}", "title": "" }, { "docid": "8b02bdcfbea86b49290e4163de452fd6", "score": "0.5929273", "text": "function checkerCB() {\n let count = 0;\n $(checkoxInps).each(function (el, item) {\n if (item.checked) {\n count++;\n }\n });\n return count;\n }", "title": "" }, { "docid": "093087fa200cdf6c4138eadd1cd5df68", "score": "0.59187156", "text": "function setCheckBoxByValue(obj, valueToChk, flag){\n var success = false;\n for(var i=0; i <obj.length;i++){ \n\tif(obj[i].value == valueToChk){ \n \t\tobj[i].checked = flag;\n \t\tsuccess = true;\n \t\tbreak;\n \t}\t \n } \n return success;\n}", "title": "" }, { "docid": "d3d90c94b9ad9c1dca1695f13bd96298", "score": "0.5901623", "text": "function gestoreClick(elemento)\n{\n //in base al valore attuale viene segnata come spuntata o meno la checkBox\n if(elemento.checked === false)\n {\n elemento.checked === true;\n }\n else\n {\n elemento.checked === true;\n }\n\n //console.log(elemento.name + \" \" + elemento.checked);\n}", "title": "" }, { "docid": "209d891c38002ebd939feda1dd7aeb5e", "score": "0.5897219", "text": "function checkboxClick(){\r\n\t\tif (!this.checked == true){\r\n\t\t\tthis.checked = true;\r\n\t\t} else {\r\n\t\t\tthis.checked = false;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "53a942aed6533e3c38024ccb091d5b64", "score": "0.58922875", "text": "function CheckBoxItem (props) {\n function onChecked (event) {\n const { name, handleAddFacet, handleRemoveFacet } = props\n if (event.target.checked) {\n handleAddFacet(name)\n } else {\n handleRemoveFacet(name)\n }\n }\n\n const { isActive, count, displayName } = props\n const labelKlass = classNames({\n 'ola-checkbox ola-checkbox-label': true,\n 'ola-checkbox-active': isActive\n })\n return (\n <label className={labelKlass} title={displayName}>\n <input type='checkbox' checked={isActive} onChange={onChecked} />\n <span className='ola-search-facet-name'>{displayName}</span>\n {count && <span className='ola-search-facet-count'>{count}</span>}\n </label>\n )\n}", "title": "" }, { "docid": "2e6df79d9401671daa9adb5e469933bc", "score": "0.5886621", "text": "check() {\n this.$context.find(':checkbox')\n .filter(':not(:disabled)')\n .filter(':visible')\n .prop('checked', true)\n .trigger('change');\n }", "title": "" }, { "docid": "fb84f0914a6cd67968e6c35cdcd73e92", "score": "0.5882973", "text": "checkBoxMain(){\n for (let i = 0; i < this.users.length; i++) {\n this.users[i].checked = this.mainCheckValue;\n }\n }", "title": "" }, { "docid": "eba19b19af5febcbe7026186d4ac6b65", "score": "0.5879006", "text": "function onChange(args) {\n this.label = 'CheckBox: ' + args.checked;\n }", "title": "" }, { "docid": "c7aa438acf15d8401aeaed143df83a5d", "score": "0.5876196", "text": "function checkBox() {\n // Get the checkbox\n var checkBox = document.getElementById(\"myCheck\");\n // Get the output text\n var text = document.getElementById(\"check\");\n \n // If the checkbox is checked, display the output text\n if (checkBox.checked == true){\n text.style.display = \"block\";\n } else {\n text.style.display = \"none\";\n }\n }", "title": "" }, { "docid": "b5feded1ab4a97729350705eef6d906d", "score": "0.58727497", "text": "function celdaCheckbox(obj,parametrostrue,parametrosfalse){\n\tif(obj.checked){\n\t\t//alert(archivo+parametrostrue);\n\t\t//submitajax(archivo+parametrostrue);\n\t\tenviardatos(indice_i,indice_j,parametrostrue);\n\t\t//enviardatos(i,j,parametrostrue);\n\t}\n\telse\n\t{\n\t\t//alert(archivo+parametrosfalse);\n\t\t//submitajax(archivo+parametrosfalse);\n\t\tenviardatos(indice_i,indice_j,parametrostrue);\n\n\n\t}\n\t\n}", "title": "" }, { "docid": "b5feded1ab4a97729350705eef6d906d", "score": "0.58727497", "text": "function celdaCheckbox(obj,parametrostrue,parametrosfalse){\n\tif(obj.checked){\n\t\t//alert(archivo+parametrostrue);\n\t\t//submitajax(archivo+parametrostrue);\n\t\tenviardatos(indice_i,indice_j,parametrostrue);\n\t\t//enviardatos(i,j,parametrostrue);\n\t}\n\telse\n\t{\n\t\t//alert(archivo+parametrosfalse);\n\t\t//submitajax(archivo+parametrosfalse);\n\t\tenviardatos(indice_i,indice_j,parametrostrue);\n\n\n\t}\n\t\n}", "title": "" }, { "docid": "62774bd4df11d1cb9aad481d1c2607fb", "score": "0.5871996", "text": "checkCheckBoxAll() {\n let rows = this.state.rows;\n var count = 0;\n // Check checkbox checked all\n if (rows.length === 0) {\n return false;\n }\n rows.forEach(row => {\n if (row.checkbox === true) count++;\n });\n if (count === rows.length) {\n return true;\n } else {\n return false;\n }\n }", "title": "" }, { "docid": "4b186b20ed22a6430fb8f62bcd2430c0", "score": "0.5870968", "text": "function handleCBchange(cb, whatisit) {\n if (whatisit == \"bell\") {\n if (bell != cb.checked) {\n setBell(cb.checked)\n }\n }\n else if (whatisit == \"compressor\") {\n if (compressor != cb.checked) {\n setCompressor(cb.checked)\n Materialize.toast(\"handleCBchange() ran setCompressor\", 4000)\n }\n }\n else if (whatisit == \"light\") {\n if (headlight != cb.checked) {\n setHeadlight(cb.checked)\n }\n }\n else if (whatisit == \"trackpower\") {\n if (layoutTrackPower_state != cb.checked) {\n //trkpower function needs to be updated to use bool instead of \"on\" and \"off\" as params, that's stupid\n trkpower(cb.checked)\n }\n }\n else if (whatisit == \"primemover\") {\n if (engine != cb.checked) {\n setEngine(cb.checked)\n }\n }\n}", "title": "" }, { "docid": "add593488cbbabe712e52c01934496f5", "score": "0.58699137", "text": "function evtpropscheckedevent(args) {\n if (args.isChecked) {\n switch (args.model.text) {\n case \"create\": acrdnObj.option(args.model.text, \"onCreate\"); break;\n case \"beforeActive\": acrdnObj.option(args.model.text, \"onBeforeActive\"); break;\n case \"active\": acrdnObj.option(args.model.text, \"onActive\"); break;\n case \"ajaxBeforeLoad\": acrdnObj.option(args.model.text, \"onBeforeLoad\"); break;\n case \"ajaxLoad\": acrdnObj.option(args.model.text, \"onLoad\"); break;\n case \"ajaxSuccess\": acrdnObj.option(args.model.text, \"onAjaxSuccess\"); break;\n case \"ajaxError\": acrdnObj.option(args.model.text, \"onError\"); break;\n }\n }\n else acrdnObj.option(args.model.text, null);\n }", "title": "" }, { "docid": "bdbfaed99e93c2f9130ac1c9f58eeb1b", "score": "0.5861271", "text": "function check() {\r\n\t\tvar status;\r\n\t\tstatus = checkStatus.getValue();\r\n\t\tif (status == '1') {\r\n\t\t\tExt.get('checkBtn').dom.disabled = false\r\n\t\t\tExt.get('cancelBtn').dom.disabled = true\r\n\t\t} else if (status == '2') {\r\n\t\t\tExt.get('checkBtn').dom.disabled = true\r\n\t\t\tExt.get('cancelBtn').dom.disabled = false\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "3dffe5868badfcab9ec3defa009b90ee", "score": "0.58592945", "text": "function getCheckBoxValue(){\n\t\tif($('favoriteDeal').checked){\n\t\t\tfavoriteValue = \"Yes\";\n\t\t}else{\n\t\t\tfavoriteValue = \"No\";\n\t\t}\n\t}", "title": "" }, { "docid": "c9d950ad9b261fb1505785e9d6cdee6b", "score": "0.5858993", "text": "function pause() {\n ctxUI.fillStyle = 'rgb(255, 255, 255)';\n ctxUI.fillRect(0,0, canvasUI.width, canvasUI.height);\n var cb = [];\n\n for(var i = 0; i < genres.length; i++)\n {\n cb.push(new CheckBox(genres[i], 20 + (i%2)*400, 20 + ((i+1)%2)*20 + (i*checkBoxOff.height*.75), undefined, undefined));\n cb[i].draw();\n }\n\n canvasUI.addEventListener(\"onclick\", function()\n {\n for(var i = 0; i < genres.length; i++)\n {\n if(event.pageX > cb[i].x && event.pageX < cb[i].x + checkBoxOff.width && event.pageY > cb[i].y && event.pageY < cb[i].y + checkBoxOff.height)\n {\n alert(cb[i].text);\n }\n }\n });\n\n}", "title": "" }, { "docid": "263bb0d9569b1d92b48178c0852c00d4", "score": "0.5855024", "text": "toggleCheckboxChange() {\n this.setState(({ isChecked }) => (\n {\n isChecked: !isChecked\n }\n ));\n this.props.handleClick(this.state.label, !this.state.isChecked);\n }", "title": "" }, { "docid": "d559a7b830703067bb9ecc80619eab2d", "score": "0.5852607", "text": "function MultiStateCheckBox_getCheckedState()\r\n{\r\n // todo: to be filled in later (or merged possible) \r\n var retValue; \r\n \r\n\r\n \r\n return retValue; \r\n}", "title": "" }, { "docid": "cba537a4ae7ad14f4458a7866ad7f253", "score": "0.58494747", "text": "_checkboxListener() {\n const checkedBoxes = document.querySelectorAll(`input[name=\"${this.el.name}\"]:checked`);\n if (!checkedBoxes || !checkedBoxes.length) {\n this.vm.$validator.validate(this.fieldName, null, getScope(this.el));\n return;\n }\n\n [...checkedBoxes].forEach(box => {\n this.vm.$validator.validate(this.fieldName, box.value, getScope(this.el));\n });\n }", "title": "" }, { "docid": "4ceb267ca0e905dc0a0b7c4395e8d7ea", "score": "0.5844031", "text": "function renderCheckBox() {\n return (\n <View style={{marginHorizontal: 20}}>\n <CheckBox\n disabled={false}\n value={false} \n onAnimationType='fill'\n offAnimationType='fill'\n animationDuration={0.1}\n boxType='square'\n lineWidth={1.5} \n onValueChange={(newValue) => setToggleCheckBox(newValue)} \n />\n </View> \n )\n }", "title": "" }, { "docid": "a86ef9e9f20ed7eaa251f42d02b51cdd", "score": "0.5840479", "text": "handleChecked(tac, i) {\n var finTac = this.props.project.finishedTactics;\n\n // here it will be checked wheather the default value is true or false, true during loading page and setting defaultchecks\n if (this.state.default) {\n if (finTac.indexOf(tac.name) === -1) {\n return false;\n } else {\n return true;\n }\n } else {\n return this.createDoneArray()[i].done;\n }\n }", "title": "" }, { "docid": "9fb446b1d08323c6ae632d52c5dec94d", "score": "0.5837832", "text": "function activity_selected(){\n for(let i = 0; i < activities_field.length; i++){\n if(activities_field[i].type === \"checkbox\"){\n if(activities_field[i].checked){\n return true;\n } \n }\n }\n return false;\n}", "title": "" }, { "docid": "82f58875c9c5d98a08aa272bc6a01054", "score": "0.58325547", "text": "async check() {\n const checkStatus = await this.getAttributeValue('checked');\n if (!checkStatus) {\n await this.click();\n }\n }", "title": "" }, { "docid": "6190330e3c55b82231ee6a3167de4052", "score": "0.5818544", "text": "function checkbox() {\r\n\r\n const checkbox = document.getElementById(\"inputBookIsComplete\");\r\n\r\n checkbox.addEventListener(\"change\", function(){\r\n\r\n if(checkbox.checked == false) {\r\n document.querySelector(\"span\").innerText = \"belum selesai dibaca\";\r\n } else {\r\n document.querySelector(\"span\").innerText = \"selesai dibaca\";\r\n }\r\n \r\n })\r\n}", "title": "" }, { "docid": "5655ed2eef3c1a0938d02baa32eb0731", "score": "0.5811073", "text": "function btn_single_checkbox_onclick(p_checkbox_obj, p_hidden_obj) {\n if (p_checkbox_obj.checked)\n p_hidden_obj.value = 1;\n else\n p_hidden_obj.value = 0;\n}", "title": "" }, { "docid": "cdb79323eb8ae935c8084328b802f089", "score": "0.58084315", "text": "function checkTermBox() {\r\n if (!$(\"input[type=checkbox]\").prop(\"checked\")) {\r\n $(\".btn-error-tick\").show();\r\n return true;\r\n } else {\r\n $(\".btn-error-tick\").hide();\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "5b0662a71e93d292d47dcf1f67f0600c", "score": "0.57907367", "text": "function addCheckBoxListener(){\n\n $(\"input:checkbox\").on('click', function() {\n\n var $box = $(this);\n if ($box.is(\":checked\") ) {\n\n var group = \"input:checkbox[name='\" + $box.attr(\"name\") + \"']\";\n\n if($box.attr(\"name\") != 'topping'){\n $(group).prop(\"checked\", false);\n }\n $box.prop(\"checked\", true);\n \n } else {\n $box.prop(\"checked\", false);\n }\n updatePrice();\n });\n\n}", "title": "" }, { "docid": "d6825f2a8ee9becb7d319b810ef46d79", "score": "0.57889754", "text": "function checkBox(e){\n\t\t\t\t$(this).toggleClass(\"on\");\n\n\t\t\t\tif($(this).hasClass(\"stab\")){\n\t\t\t\t\tself.generateExploreResults(false);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "6dd70b29383edbfae0ff83c8604bb29c", "score": "0.5785956", "text": "function checkbox() {\n\n const checkbox = document.getElementById(\"inputBookIsComplete\");\n\n checkbox.addEventListener(\"change\", function(){\n\n if(checkbox.checked == false) {\n document.querySelector(\"span\").innerText = \"belum selesai dibaca\";\n } else {\n document.querySelector(\"span\").innerText = \"selesai dibaca\";\n }\n \n })\n}", "title": "" }, { "docid": "d9dbf172736566eedd7cac0b4d459304", "score": "0.57809156", "text": "function checkBoxButton () {\n const checkBox = document.createElement('input');\n checkBox.setAttribute('type', 'checkbox');\n checkBox.classList.add('check-box');\n todoContainer.append(checkBox);\n checkBox.addEventListener('change', (e) => {\n if (e.target.checked) {\n e.target.parentElement.classList.toggle('done');\n } else {\n e.target.parentElement.classList.toggle('done')\n }\n })\n}", "title": "" }, { "docid": "327193c2266092be8df087d0d9de14a8", "score": "0.5778019", "text": "function Checkbox(props) {\n return (\n <input\n name=\"\"\n type=\"checkbox\"\n checked={props.checked}\n onChange={() => props.onChange()}\n />\n );\n}", "title": "" }, { "docid": "b8df934576ac025b191fc764c669c299", "score": "0.57737243", "text": "function selectedCheckBox(id){\nvar value = $(\"#\"+id).prop('checked');\n if($(\"#\"+id).prop('checked')){\n selectedChecked=id;\n hideExcept(id);\n } else {\n showAllCheckbox();\n selectedChecked=\"\";\n }\n\n}", "title": "" }, { "docid": "c9b1dddf6c8bcb1263080689a6fd4cdd", "score": "0.5773513", "text": "function clicked(checkBox, text) {\n if (checkBox.checked == true){\n text.style.display = \"block\";\n } else {\n text.style.display = \"none\";\n }\n }", "title": "" }, { "docid": "eec1b6a0a296dfc0581ecb644ea81f9c", "score": "0.5768825", "text": "function checkGrid() {\r\n\tvar alen=document.frmViewNews.elements.length;\r\n\tvar isChecked=false;\r\n\talen=(alen>2)?document.frmViewNews.chkid.length:0;\r\n\tif (alen>0){\r\n\t\tfor(var i=0;i<alen;i++)\r\n\t\t\tif (document.frmViewNews.chkid[i].checked==true)\r\n\t\t\t\tisChecked=true;\r\n\t}\r\n\telse{\r\n\t\tif(document.frmViewNews.chkid.checked==true)\r\n\t\t\tisChecked=true;\r\n\t}\r\n\tif(!isChecked)\r\n\t\talert(\"Ban phai chon it nhat 1 ban tin.\");\r\n\telse{\r\n\t\tblnDel=confirm(\"Ban co chac chan xoa cac tin nay khong?\");\r\n\t\tif (blnDel==true)\r\n\t\t\tisChecked=true;\r\n\t\telse\r\n\t\t\tisChecked=false;\r\n\t}\r\n\treturn isChecked;\r\n}", "title": "" }, { "docid": "8bd4d935dd3c115c46ffc6358f0e493b", "score": "0.5762835", "text": "function checkIfCheckboxesChecked() {\n thisObj = this;\n var getCheckboxDataValidateType = thisObj.getAttribute(\"data-validate-type\");\n\n if (getCheckboxDataValidateType === \"checkbox\") {\n if (thisObj.checked) {\n removeErrorClasses(thisObj);\n } else {\n addErrorClasses(thisObj);\n }\n }\n\n checkIfInputsAllFilled();\n}", "title": "" }, { "docid": "d6f52c235dc876733cc7570b9e745ca6", "score": "0.57512945", "text": "function checkBox(row, col, value) {\n // Need to floor to get integer value\n row = (row / 4) * 4;\n col = (col / 4) * 4;\n for (var i = 0; i < 4; i++) {\n for (var j = 0; j < 4; j++) {\n if (model[row + i][col + j] == value)\n return 0;\n }\n }\n return 1;\n}", "title": "" }, { "docid": "e9b572e92ca563088392ed594d5728c5", "score": "0.5734123", "text": "function testCheckUp( elm ){\n //enable or disable submit button when checkbox is cheked\n if(elm.checked) { //enable\n document.getElementById(\"submit\").disabled = false;\n } else { //disable\n document.getElementById(\"submit\").disabled = true;\n }\n}", "title": "" }, { "docid": "e94a077f3760dd46d4d55297efb5d167", "score": "0.5732691", "text": "isChecked(state = this.state, props = this.props) {\n return this.isControlled() ? props.checked : state.checked;\n }", "title": "" }, { "docid": "13e0b36ed4c904ebeccdaacf9032f9c1", "score": "0.5730002", "text": "function checkboxChecked() {\n const checkboxes = $('fieldset.activities input');\n for (i = 0; i < checkboxes.length; i += 1) {\n if (checkboxes[i].checked === true) {\n $('p.alert').remove(); //if any checkbox is checked, the alert paragraph: \"At least one checkbox needs to be checked.\" will be removed\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "3c2169dc5e5c6f8bd2b6258851282a03", "score": "0.57242125", "text": "function model_checkbox($this){\n\tvar pk = $this.dataset.pk;\n\tvar checkbox;\n\tvar action = 'None';\n\n\tvar lang = document.getElementById('language_type').value;\n\n\tif (pk == 'all'){\n\t\tcheckbox = document.getElementById('all_checkbox');\n\t\tif (checkbox.checked){\n\t\t\taction = 'checked';\n\t\t}else{\n\t\t\taction = 'unchecked';\n\t\t}\n\t}else{\n\t\tid = document.getElementById('model_checkbox'+toString(pk));\n\t}\n\tconsole.log(action);\n\n\tconsole.log(pk)\n\ttotal_price(pk, action, lang)\n\t\n}", "title": "" }, { "docid": "7e415e5121493e1684d5af995a9d5c29", "score": "0.5721588", "text": "function checkCheckBoxGroup(groupName) {\n var g = document.getElementsByName(groupName);\n\n for(var i = 0;i<g.length;i++) {\n if (g[i].checked) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "d11619787f34c433d809322faeec09bd", "score": "0.5718512", "text": "function selectedCheckboxCheck() {\n var isChecked = false;\n $(\"tbody .css-checkbox\").each(function () {\n if ($(this).is(':checked')) {\n isChecked = true;\n }\n });\n\n if (isChecked) {\n $('.group-control').fadeIn(200);\n }\n else {\n $('.group-control').fadeOut(200);\n }\n }", "title": "" }, { "docid": "f038e182c77a7c6aaf8770c836ef7d9f", "score": "0.5712767", "text": "function checkValidation(id) {\n\n // checking if Submit button is first clicked\n if (isSubmitClick) {\n\n // if checkbox is not ticked\n if ($('#' + id).prop('checked') == false) {\n $('#' + id + 'Text').css('color', 'red');\n wrapAlert(id, 'Tick the check Box')\n return false;\n } else {\n $('#' + id + 'Text').css('color', '#6c757d');\n wrapSuccess(id);\n return true;\n }\n }\n}", "title": "" }, { "docid": "39b27db90c10b2261eee9ccd6f5776fe", "score": "0.5712518", "text": "function checkBox() {\n var box = document.createElement(\"input\");\n box.className = \"form-check-input\";\n box.setAttribute(\"type\", \"checkbox\");\n box.value = 0;\n box.addEventListener(\"click\", marcarBox);\n\n return box;\n}", "title": "" }, { "docid": "32ae454ee3763ec24a080439cabd966f", "score": "0.5700663", "text": "function calcoloValoriCheckbox()\n{\n treOre = controlloCheckbox(\"3ore\");\n altoRischio = controlloCheckbox(\"Rischio\");\n ecg = controlloCheckbox(\"ECG\");\n\n /*\n console.log(\"3ore: \", treOre);\n console.log(\"altoRischio: \", altoRischio);\n console.log(\"ECG: \", ecg);\n */\n}", "title": "" }, { "docid": "2055fd58ee0e41eccca70fe8bc236067", "score": "0.5696766", "text": "function makeCheckBoxForChecking(label, id, Editdtls) {\n let checked = (Editdtls) ? 'checked' : ''\n return `\n <div class=\"form-check fix-size\">\n <input class=\"form-check-input\" type=\"checkbox\" value=\"\" id=\"${id}\" ${checked}>\n <label class=\"form-check-label\" for=\"${id}\">\n ${label}\n </label>\n </div>\n `\n}", "title": "" }, { "docid": "29ff0d22395cb57628ead11291bfed24", "score": "0.56964946", "text": "function check_item_box(checkbox) {\n\tconst item = checkbox.parentNode;\n\tconst checkBtn = item.querySelector('.checkButton');\n\t\n\titem.style.background = '#fff';\n\tcheckBtn.style.background = '#c0c0c0';\n\tcheckbox.style.display = 'none';\n\n\tcheckBtn.innerHTML = \"done\";\n\n\ttodo.items.forEach(e => {\n\t\tif( e.id == item.getAttribute('id') ){\n\t\t\te.check = \"done\";\n\t\t\tallFilter(); // [4]\n\t\t} \t\n }); \t\n\n checkbox.checked = 'checked'; // CHANGE STATUS CHECKBOX IN THE END OF FUNCTION\n}", "title": "" }, { "docid": "bbba3e722e94ad748a2b3b09e9211aab", "score": "0.5696487", "text": "isWorkItemCheckboxSelected (workItemElement) {\n browser.actions().mouseMove(workItemElement).perform();\n return this.workItemCheckbox (workItemElement).isSelected();\n }", "title": "" }, { "docid": "32433963e1d11d352d85aa513becd8f6", "score": "0.5694848", "text": "function checkBox(map) {\n\n\n if (document.getElementById('checkbox1').checked == true) {\n unchecked = false\n // if (notSlided == true) {\n // showAndHideYear(map, 5)\n // } else {\n // showAndHideYear(map, sliderLevel)\n // }\n\n } else {\n unchecked = true\n }\n}", "title": "" }, { "docid": "7f4c539067f9d9515e495a58e529e69d", "score": "0.569351", "text": "function setChecked() {\n\t\tbox.prop('checked', bindItem.get() == true? true : false);\n\t}", "title": "" }, { "docid": "8038d4f6f9c63c3f417d5061e81f4952", "score": "0.5682002", "text": "function easyBotCheck() {\n\tif (easyBotO.selected == true || easyBotX.selected == true) {\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "e80461ab7dddbb52f897db3ee148702d", "score": "0.56763804", "text": "function check_checkboxes() {\n if ($(\".activities > label > input:checked\").length === 0) {\n $('#checkboxError').html('<h3>You have not selected an activity. Please select an activity.<br></h3>');\n $('#checkboxError').css('color', 'red').show();\n $('.activities').css('border', 'solid red 3px').show();\n error_checkbox = true;\n }\n else {\n $('.activities').css('border', 'none').show();\n $('#checkboxError').css('color', 'red').hide();\n console.log(\"checkbox field is valid\");\n error_checkbox = false;\n };\n\n }", "title": "" } ]
97d86d6278eede8ee1ad869e6be5e356
Hacky method to try to get the constructor name for an object.
[ { "docid": "984bdb3741d2c91c18fbbd814922db6c", "score": "0.57320315", "text": "function tryGetCustomObjectType(input) {\r\n if (input.constructor) {\r\n var funcNameRegex = /function\\s+([^\\s(]+)\\s*\\(/;\r\n var results = funcNameRegex.exec(input.constructor.toString());\r\n if (results && results.length > 1) {\r\n return results[1];\r\n }\r\n }\r\n return null;\r\n}", "title": "" } ]
[ { "docid": "3c8978882a399c565b81dc9e7fed516e", "score": "0.85033494", "text": "getConstructorName(obj) {\n\t\treturn utils.getConstructorName(obj);\n\t}", "title": "" }, { "docid": "e21de3309fb57a215d9c46434e8afdc5", "score": "0.81695056", "text": "function getConstructorName(obj) {\n\t var receiver = obj.receiver\n\t return (receiver.constructor && receiver.constructor.name) || null\n\t}", "title": "" }, { "docid": "2eb8eeeaeef9c45982c49aa943c70e98", "score": "0.8046498", "text": "function getConstructorName(obj) {\n var receiver = obj.receiver;\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "ee27223c0b1cdf92e1ed7bf6e068798e", "score": "0.8018716", "text": "function getConstructorName(obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "ee27223c0b1cdf92e1ed7bf6e068798e", "score": "0.8018716", "text": "function getConstructorName(obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "ee27223c0b1cdf92e1ed7bf6e068798e", "score": "0.8018716", "text": "function getConstructorName(obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "ee27223c0b1cdf92e1ed7bf6e068798e", "score": "0.8018716", "text": "function getConstructorName(obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "af840a4a8d5fd53122e685e544c27e09", "score": "0.8012523", "text": "function getConstructorName(obj) {\n var receiver = obj.receiver;\n return receiver.constructor && receiver.constructor.name || null;\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "18ea4ffb13ab0cd2b74852ac0250d815", "score": "0.8004587", "text": "function getConstructorName (obj) {\n var receiver = obj.receiver\n return (receiver.constructor && receiver.constructor.name) || null\n}", "title": "" }, { "docid": "a2213371e297b62e8b6a5d91885867cd", "score": "0.73730266", "text": "function getTypeName(obj)\n {\n switch (typeof obj)\n {\n case \"undefined\":\n return undefined;\n\n case \"object\":\n if (obj === null)\n return undefined;\n break;\n\n case \"boolean\":\n return undefined;\n\n case \"number\":\n return undefined;\n\n case \"string\":\n return undefined;\n\n case \"function\":\n return undefined;\n\n default:\n return undefined;\n }\n\n var prototype = Object.getPrototypeOf(obj);\n\n if (prototype === Object.prototype)\n return Object.prototype;\n\n if (prototype === Array.prototype)\n return undefined;\n\n var name = allConstructors.getNameByPrototype(prototype);\n\n if (name !== undefined)\n return name;\n\n throw new TypeError(\"JSS.stringify can not find a constructor\"\n + \" for an object: \" + obj);\n }", "title": "" }, { "docid": "cae04dd28d440f5a072834ab5fce66ed", "score": "0.7278816", "text": "function getObjectName(obj) {\r\n var name = obj.constructor.name;\r\n \r\n return name === undefined? obj.fixedName : name;\r\n}", "title": "" }, { "docid": "fab767825d44d7b810f839fe651629ce", "score": "0.7241186", "text": "function getObjectName(object)\r\n{\r\n if (isNullOrUndefined(object))\r\n {\r\n return object;\r\n }\r\n\r\n return /(\\w+)\\(/.exec(object.constructor.toString())[1];\r\n}", "title": "" }, { "docid": "8522b1c05cf1ee86f3703840812ac65c", "score": "0.71829623", "text": "function getObjectName(object)\n{\n if (isNullOrUndefined(object))\n {\n return object;\n }\n\n return /(\\w+)\\(/.exec(object.constructor.toString())[1];\n}", "title": "" }, { "docid": "74939af4e8ecb762931b42deb196677f", "score": "0.7065462", "text": "function getClassName(object) {\n\t\n\tvar _name = 'null';\n\t\n\tif (object) {\n\t\t\n\t\t//get object type\n\t\t_name = typeof(object);\n\t\t\n\t\tif (object.constructor) {\n\t\t\n\t\t\t// get classname abstracted from\n\t\t\t// constructor property\n\t\t\t_name = object.constructor.toString();\n\t\t\t\n\t\t\tif (_name) {\n\t\t\t\tvar start = _name.indexOf('function ') + 9;\n\t\t\t\tvar stop = _name.indexOf('(');\n\t\t\t\t_name = _name.substring(start, stop);\n\t\t\t}\n\t\t\t\n\t\t} //end if (object has constructor)\n\t\t\n\t} //end if (object exists)\n\t\n\treturn _name;\n\t\n} //end getClassName()", "title": "" }, { "docid": "f9f5a021c91c0495f1b2af14c24e00ce", "score": "0.6975755", "text": "function _getObjectClassName (obj) {\n if (obj && obj.constructor && obj.constructor.toString) {\n let arr = obj.constructor.toString().match(/function\\s*(\\w+)/);\n \n if (arr && 2 === arr.length) {\n return arr[1]\n }\n }\n}", "title": "" }, { "docid": "ab583e1d038d3b203ea534acaa4ae301", "score": "0.6919384", "text": "function exports(obj) {\n\t if (obj.constructor && obj.constructor.name) return obj.constructor.name;\n\n\t return upperFirst({}.toString.call(obj).replace(/(\\[object )|]/g, ''));\n\t }", "title": "" }, { "docid": "d6d89947d9c0ec27189f91afe965c310", "score": "0.6870105", "text": "function getClass(obj, forceConstructor) {\r\n if ( typeof obj == \"undefined\" ) return \"undefined\";\r\n if ( obj === null ) return \"null\";\r\n if ( forceConstructor == true && obj.hasOwnProperty(\"constructor\") ) delete obj.constructor; // reset constructor\r\n if ( forceConstructor != false && !obj.hasOwnProperty(\"constructor\") ) return getFunctionName(obj.constructor);\r\n return Object.prototype.toString.call(obj)\r\n .match(/^\\[object\\s(.*)\\]$/)[1];\r\n}", "title": "" }, { "docid": "9679544c80b710e8eb1bdb677aca66c0", "score": "0.68450314", "text": "function name3159(func) {\n if (func.name) {\n return func.name;\n }\n\n var matches = func.toString().match(/^\\s*function\\s*(\\w*)\\s*\\(/) ||\n func.toString().match(/^\\s*\\[object\\s*(\\w*)Constructor\\]/);\n\n return matches ? matches[1] : '<anonymous>';\n }", "title": "" }, { "docid": "009a7aa1ee43eb29ae95ba5b1b19a4dc", "score": "0.67479414", "text": "function name3160(func) {\n if (func.name) {\n return func.name;\n }\n\n var matches = func.toString().match(/^\\s*function\\s*(\\w*)\\s*\\(/) ||\n func.toString().match(/^\\s*\\[object\\s*(\\w*)Constructor\\]/);\n\n return matches ? matches[1] : '<anonymous>';\n }", "title": "" }, { "docid": "741b13c894db4cb026bb3a86f2592fe7", "score": "0.6661073", "text": "function objTypeName(obj) {\n if(typeof obj === 'object' && typeof obj.constructor === 'function')\n return obj.constructor.name;\n return typeof obj;\n}", "title": "" }, { "docid": "0bea61a16ab96d1b2e9882f3900a66b3", "score": "0.66322637", "text": "function _getClass(v) {\n if (v === void 0 || null === v) {\n throw new TiptopError('Undefined and null arguments are not currently supported');\n }\n\n var ctor = v.constructor;\n if (!ctor || ctor.name === void 0 || !ctor.name.length) {\n throw new UnnamedObjectError('Argument must have constructor name to infer type');\n }\n else {\n return ctor.name;\n }\n }", "title": "" }, { "docid": "71c6af088782e15a25335d3ad51614e5", "score": "0.65919447", "text": "function _describe(obj) {\n return (obj && obj.constructor && obj.constructor.name ? obj.constructor.name : '' + obj);\n}", "title": "" }, { "docid": "a4a712847a0e3f117cdbbc4df3c3b415", "score": "0.6511941", "text": "static is(argA) {\n // console.log(argA);\n return Object.getPrototypeOf(argA).constructor.name;\n }", "title": "" }, { "docid": "a4a712847a0e3f117cdbbc4df3c3b415", "score": "0.6511941", "text": "static is(argA) {\n // console.log(argA);\n return Object.getPrototypeOf(argA).constructor.name;\n }", "title": "" }, { "docid": "0f8ed16f30daf3c98bc7ecfe576b0ee6", "score": "0.6362735", "text": "function getTypeName(type) {\n if (type === Function) { return \"Function\"; }\n else if (type === Array) { return \"Array\"; }\n else if (type === String) { return \"String\"; }\n else if (type === Number) { return \"Number\"; }\n else if (type === Boolean) { return \"Boolean\"; }\n else { throw new Error(\"Not a supported constructor function\"); }\n }", "title": "" }, { "docid": "f9acf6fafdf1518ccfa27e4c745e7008", "score": "0.63098717", "text": "function tryGetCustomObjectType(input){if(input.constructor){var funcNameRegex=/function\\s+([^\\s(]+)\\s*\\(/;var results=funcNameRegex.exec(input.constructor.toString());if(results&&results.length>1){return results[1];}}return null;}", "title": "" }, { "docid": "e5acc7657374c90da30949e565ff5dc4", "score": "0.62926626", "text": "function tryGetCustomObjectType(input){if(input.constructor){var funcNameRegex=/function\\s+([^\\s(]+)\\s*\\(/;var results=funcNameRegex.exec(input.constructor.toString());if(results&&results.length>1){return results[1]}}return null}", "title": "" }, { "docid": "e5acc7657374c90da30949e565ff5dc4", "score": "0.62926626", "text": "function tryGetCustomObjectType(input){if(input.constructor){var funcNameRegex=/function\\s+([^\\s(]+)\\s*\\(/;var results=funcNameRegex.exec(input.constructor.toString());if(results&&results.length>1){return results[1]}}return null}", "title": "" }, { "docid": "6007366dff9298ec6dd7a99f7b8cd242", "score": "0.6225938", "text": "function getObjectName(obj, lower = true) {\n const value = obj && (obj.name || (obj.constructor && obj.constructor.name) || null);\n if (typeof value === 'string' && lower)\n return value.toLowerCase();\n return value;\n}", "title": "" }, { "docid": "0bb19b28caf5368bbc565f9e7d443517", "score": "0.6224463", "text": "function functionName(fn){if(Function.prototype.name===undefined){var funcNameRegex=/function\\s([^(]{1,})\\(/;var results=funcNameRegex.exec(fn.toString());return results&&results.length>1?results[1].trim():\"\";}else if(fn.prototype===undefined){return fn.constructor.name;}else{return fn.prototype.constructor.name;}}", "title": "" }, { "docid": "4410c84e70636fed146315bf0459153e", "score": "0.6194061", "text": "function getClassName(optValue) {\n\t if (!optValue.constructor || !optValue.constructor.name) {\n\t return ANONYMOUS;\n\t }\n\t return optValue.constructor.name;\n\t}", "title": "" }, { "docid": "cb7bdbffc31410ac9f3955e88bd62ec1", "score": "0.6142286", "text": "function newObect_find_next_constructor(obj, cur_constructor){\n let obj_of_cur_cons = obj.inheritsPropertyFrom(\"constructor\")\n let next_ans_above_cur_cons = Object.getPrototypeOf(obj_of_cur_cons)\n if(next_ans_above_cur_cons) { return next_ans_above_cur_cons.constructor } //might be nothing\n else { return null }\n //if(!cur_constructor) { cur_constructor = obj.constructor }\n //let obj_cons = obj.constructor\n //if (!obj_constructor) { return null } //there is no next constructor\n //else if (obj_cons != cur_constructor) { return obj_cons }\n //else { return newObject_find_next_constructor(Object.getPrototypeOf(obj), cur_constructor) }\n}", "title": "" }, { "docid": "01a21b96c1f211bc1a59a123bd35b469", "score": "0.6118812", "text": "class() {\n return this.__proto__.constructor.name;\n }", "title": "" }, { "docid": "ffe29f309d3bb458572390815479dc6b", "score": "0.60818887", "text": "function Us(t) {\n if (void 0 === t) return \"undefined\";\n if (null === t) return \"null\";\n if (\"string\" == typeof t) return t.length > 20 && (t = t.substring(0, 20) + \"...\"), \n JSON.stringify(t);\n if (\"number\" == typeof t || \"boolean\" == typeof t) return \"\" + t;\n if (\"object\" == typeof t) {\n if (t instanceof Array) return \"an array\";\n var e = \n /** Hacky method to try to get the constructor name for an object. */\n function(t) {\n if (t.constructor) {\n var e = /function\\s+([^\\s(]+)\\s*\\(/.exec(t.constructor.toString());\n if (e && e.length > 1) return e[1];\n }\n return null;\n }(t);\n return e ? \"a custom \" + e + \" object\" : \"an object\";\n }\n return \"function\" == typeof t ? \"a function\" : S();\n}", "title": "" }, { "docid": "4cd9a5e3d653a9183d834b64e78b6685", "score": "0.60672253", "text": "function functionName(fn) {\n if (Function.prototype.name === undefined) {\n var funcNameRegex = /function\\s([^(]{1,})\\(/;\n var results = funcNameRegex.exec(fn.toString());\n return results && results.length > 1 ? results[1].trim() : \"\";\n } else\n if (fn.prototype === undefined) {\n return fn.constructor.name;\n } else\n {\n return fn.prototype.constructor.name;\n }\n }", "title": "" }, { "docid": "5d586b5f5bd59ece3a0af074451e38a3", "score": "0.6063479", "text": "function getObjName(obj) {\n\t return Object.prototype.toString.call(obj).replace('[object ', '').replace(']', '');\n\t}", "title": "" }, { "docid": "f8ece4a9fbe50336e84a3a3ed590efba", "score": "0.6038189", "text": "function getConstructor(properties, className) {\n\tvar constructor = properties.hasOwnProperty('constructor') ? properties.constructor : undefined;\n\n\tif (constructor && typeof constructor != \"function\")\n\t\tthrow \"constructor must be a function for class: \" + className;\n\n\treturn constructor;\n}", "title": "" }, { "docid": "1d4d8e47762561e13212d96e1f72776d", "score": "0.6023498", "text": "function functionName(fn) {\n if (Function.prototype.name === undefined) {\n var funcNameRegex = /function\\s([^(]{1,})\\(/;\n var results = funcNameRegex.exec(fn.toString());\n return results && results.length > 1 ? results[1].trim() : \"\";\n } else if (fn.prototype === undefined) {\n return fn.constructor.name;\n } else {\n return fn.prototype.constructor.name;\n }\n }", "title": "" }, { "docid": "1d4d8e47762561e13212d96e1f72776d", "score": "0.6023498", "text": "function functionName(fn) {\n if (Function.prototype.name === undefined) {\n var funcNameRegex = /function\\s([^(]{1,})\\(/;\n var results = funcNameRegex.exec(fn.toString());\n return results && results.length > 1 ? results[1].trim() : \"\";\n } else if (fn.prototype === undefined) {\n return fn.constructor.name;\n } else {\n return fn.prototype.constructor.name;\n }\n }", "title": "" }, { "docid": "1d4d8e47762561e13212d96e1f72776d", "score": "0.6023498", "text": "function functionName(fn) {\n if (Function.prototype.name === undefined) {\n var funcNameRegex = /function\\s([^(]{1,})\\(/;\n var results = funcNameRegex.exec(fn.toString());\n return results && results.length > 1 ? results[1].trim() : \"\";\n } else if (fn.prototype === undefined) {\n return fn.constructor.name;\n } else {\n return fn.prototype.constructor.name;\n }\n }", "title": "" }, { "docid": "0316b0e0e84a26ce6145e04c822f9502", "score": "0.60100925", "text": "getConstructor(className) {\n return this.components[className] || window[className] || eval(className);\n }", "title": "" }, { "docid": "58b9b3b334fbb389384642faab213f24", "score": "0.5992125", "text": "getClassName() {\n return this.constructor\n .className;\n }", "title": "" }, { "docid": "7c187e309a854b80430c59cb2a80088b", "score": "0.5992076", "text": "function getType(ctor) {\r\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\r\n return match ? match[1] : ctor === null ? 'null' : '';\r\n}", "title": "" }, { "docid": "8f7002c5eae1acf6cabf1334d481a1e9", "score": "0.5985016", "text": "function getType(ctor) {\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : ctor === null ? 'null' : '';\n}", "title": "" }, { "docid": "8f7002c5eae1acf6cabf1334d481a1e9", "score": "0.5985016", "text": "function getType(ctor) {\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : ctor === null ? 'null' : '';\n}", "title": "" }, { "docid": "b81784d02705be9acb62cf08b1db0ac2", "score": "0.5964068", "text": "getClassName() {\n return this.constructor\n .className;\n }", "title": "" }, { "docid": "69dc87533430d052f4a26239a1cbc314", "score": "0.5957676", "text": "classof(obj) {\n return Object.prototype\n .toString\n .call(obj)\n .replace(/^\\[object\\s(.*)\\]$/, \"$1\");\n }", "title": "" }, { "docid": "4002633526dba3a3ba1c835d8543229d", "score": "0.59397036", "text": "function GetClassName(fun) {\n var className = '';\n if (fun.name) { // e.target.metadata.description.constructor.name\n className = fun.name;\n } else {\n var ret = fun.toString();\n ret = ret.substr('function '.length);\n className = ret.substr(0, ret.indexOf('('));\n }\n return className;\n}", "title": "" }, { "docid": "a1870f6f9d3154d4ddf2a93b6ac92568", "score": "0.5936084", "text": "function hn(t) {\n if (void 0 === t) return \"undefined\";\n if (null === t) return \"null\";\n if (\"string\" == typeof t) return t.length > 20 && (t = t.substring(0, 20) + \"...\"), \n JSON.stringify(t);\n if (\"number\" == typeof t || \"boolean\" == typeof t) return \"\" + t;\n if (\"object\" == typeof t) {\n if (t instanceof Array) return \"an array\";\n var e = \n /** Hacky method to try to get the constructor name for an object. */\n function(t) {\n if (t.constructor) {\n var e = /function\\s+([^\\s(]+)\\s*\\(/.exec(t.constructor.toString());\n if (e && e.length > 1) return e[1];\n }\n return null;\n }(t);\n return e ? \"a custom \" + e + \" object\" : \"an object\";\n }\n return \"function\" == typeof t ? \"a function\" : _e(\"Unknown wrong type: \" + typeof t);\n}", "title": "" }, { "docid": "a1870f6f9d3154d4ddf2a93b6ac92568", "score": "0.5936084", "text": "function hn(t) {\n if (void 0 === t) return \"undefined\";\n if (null === t) return \"null\";\n if (\"string\" == typeof t) return t.length > 20 && (t = t.substring(0, 20) + \"...\"), \n JSON.stringify(t);\n if (\"number\" == typeof t || \"boolean\" == typeof t) return \"\" + t;\n if (\"object\" == typeof t) {\n if (t instanceof Array) return \"an array\";\n var e = \n /** Hacky method to try to get the constructor name for an object. */\n function(t) {\n if (t.constructor) {\n var e = /function\\s+([^\\s(]+)\\s*\\(/.exec(t.constructor.toString());\n if (e && e.length > 1) return e[1];\n }\n return null;\n }(t);\n return e ? \"a custom \" + e + \" object\" : \"an object\";\n }\n return \"function\" == typeof t ? \"a function\" : _e(\"Unknown wrong type: \" + typeof t);\n}", "title": "" }, { "docid": "de18e7aa04f23b92ec730432dbdec1ac", "score": "0.59278375", "text": "function ms(t) {\n if (void 0 === t) return \"undefined\";\n if (null === t) return \"null\";\n if (\"string\" == typeof t) return t.length > 20 && (t = t.substring(0, 20) + \"...\"), JSON.stringify(t);\n if (\"number\" == typeof t || \"boolean\" == typeof t) return \"\" + t;\n\n if (\"object\" == typeof t) {\n if (t instanceof Array) return \"an array\";\n\n var e =\n /** Hacky method to try to get the constructor name for an object. */\n function (t) {\n if (t.constructor) {\n var e = /function\\s+([^\\s(]+)\\s*\\(/.exec(t.constructor.toString());\n if (e && e.length > 1) return e[1];\n }\n\n return null;\n }(t);\n\n return e ? \"a custom \" + e + \" object\" : \"an object\";\n }\n\n return \"function\" == typeof t ? \"a function\" : S();\n }", "title": "" }, { "docid": "5f00448b5419ba234fbecb2ad1a585e0", "score": "0.5901893", "text": "function functionName(fn) {\n if (Function.prototype.name === undefined) {\n var funcNameRegex = /function\\s([^(]{1,})\\(/;\n var results = funcNameRegex.exec(fn.toString());\n return results && results.length > 1 ? results[1].trim() : \"\";\n } else if (fn.prototype === undefined) {\n return fn.constructor.name;\n } else {\n return fn.prototype.constructor.name;\n }\n}", "title": "" }, { "docid": "f43d58521cea08d01eddc2201f8ea2ed", "score": "0.5874914", "text": "getTypeName() {\n if (this._typeName == null) {\n var funcNameRegex = /function (.{1,})\\(/;\n var results = (funcNameRegex).exec(this.constructor.toString());\n this._typeName = (results && results.length > 1) ? results[1] : \"\";\n }\n return this._typeName;\n }", "title": "" }, { "docid": "9994d2d19795229704824d16558fce6c", "score": "0.5864638", "text": "function Vs(t) {\n if (void 0 === t) return \"undefined\";\n if (null === t) return \"null\";\n if (\"string\" == typeof t) return t.length > 20 && (t = t.substring(0, 20) + \"...\"), \n JSON.stringify(t);\n if (\"number\" == typeof t || \"boolean\" == typeof t) return \"\" + t;\n if (\"object\" == typeof t) {\n if (t instanceof Array) return \"an array\";\n var e = \n /** Hacky method to try to get the constructor name for an object. */\n function(t) {\n if (t.constructor) {\n var e = /function\\s+([^\\s(]+)\\s*\\(/.exec(t.constructor.toString());\n if (e && e.length > 1) return e[1];\n }\n return null;\n }(t);\n return e ? \"a custom \" + e + \" object\" : \"an object\";\n }\n return \"function\" == typeof t ? \"a function\" : x();\n}", "title": "" }, { "docid": "4af1be7c46161580c254c26b7fff9911", "score": "0.58583474", "text": "function _i(t) {\n if (void 0 === t) return \"undefined\";\n if (null === t) return \"null\";\n if (\"string\" == typeof t) return t.length > 20 && (t = t.substring(0, 20) + \"...\"), \n JSON.stringify(t);\n if (\"number\" == typeof t || \"boolean\" == typeof t) return \"\" + t;\n if (\"object\" == typeof t) {\n if (t instanceof Array) return \"an array\";\n var e = \n /** Hacky method to try to get the constructor name for an object. */\n function(t) {\n if (t.constructor) {\n var e = /function\\s+([^\\s(]+)\\s*\\(/.exec(t.constructor.toString());\n if (e && e.length > 1) return e[1];\n }\n return null;\n }(t);\n return e ? \"a custom \" + e + \" object\" : \"an object\";\n }\n return \"function\" == typeof t ? \"a function\" : p();\n}", "title": "" }, { "docid": "c941163606f1f47e67282b2e67e28cfd", "score": "0.58507454", "text": "toString () {\n return `[object ${this.constructor.name}]`\n }", "title": "" }, { "docid": "9ef1e5dfc58d5f87f545e4d3fad45bed", "score": "0.585024", "text": "function getType(ctor) {\r\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\r\n return match ? match[1] : '';\r\n}", "title": "" }, { "docid": "7ad99b73527e0eb2cdb1cddf44c821b1", "score": "0.5844033", "text": "function functionName(fn) {\n if (Function.prototype.name === undefined) {\n var funcNameRegex = /function\\s([^(]{1,})\\(/;\n var results = (funcNameRegex).exec((fn).toString());\n return (results && results.length > 1) ? results[1].trim() : \"\";\n }\n else if (fn.prototype === undefined) {\n return fn.constructor.name;\n }\n else {\n return fn.prototype.constructor.name;\n }\n}", "title": "" }, { "docid": "5f0c77211c41538cfda2722a01cae27a", "score": "0.58335906", "text": "function getType(ctor) {\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "title": "" }, { "docid": "5f0c77211c41538cfda2722a01cae27a", "score": "0.58335906", "text": "function getType(ctor) {\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "title": "" }, { "docid": "5f0c77211c41538cfda2722a01cae27a", "score": "0.58335906", "text": "function getType(ctor) {\n const match = ctor && ctor.toString().match(/^\\s*function (\\w+)/);\n return match ? match[1] : '';\n}", "title": "" }, { "docid": "46ef759cea131ae7933d08af17294051", "score": "0.5822337", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n }", "title": "" }, { "docid": "46ef759cea131ae7933d08af17294051", "score": "0.5822337", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n }", "title": "" }, { "docid": "46ef759cea131ae7933d08af17294051", "score": "0.5822337", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n }", "title": "" }, { "docid": "46ef759cea131ae7933d08af17294051", "score": "0.5822337", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n }", "title": "" }, { "docid": "46ef759cea131ae7933d08af17294051", "score": "0.5822337", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n }", "title": "" }, { "docid": "46ef759cea131ae7933d08af17294051", "score": "0.5822337", "text": "function miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n }", "title": "" }, { "docid": "55a6a197fdaca75e5c296c142fd288cb", "score": "0.58133143", "text": "function getType(ctor) {\n const match = ctor && ctor.toString().match(/^\\s*(function|class) (\\w+)/);\n return match ? match[2] : ctor === null ? 'null' : '';\n}", "title": "" }, { "docid": "05dbd7fbafde719729f8b6622a7a9cf9", "score": "0.58018166", "text": "toString () {\n return `${this.constructor.name}.${this.name}`\n }", "title": "" }, { "docid": "28b15aea3f20fef5760292c04cda990b", "score": "0.5776018", "text": "_getConstructorStartSourceReference(trace) {\n const contract = trace.bytecode.contract;\n const constructor = contract.constructorFunction;\n const line = constructor !== undefined\n ? constructor.location.getStartingLineNumber()\n : contract.location.getStartingLineNumber();\n return {\n file: contract.location.file,\n contract: contract.name,\n function: solidity_stack_trace_1.CONSTRUCTOR_FUNCTION_NAME,\n line,\n };\n }", "title": "" }, { "docid": "e85c4edf1253a6adf357c921897d852f", "score": "0.5767144", "text": "function functionName(fn) {\n if (typeof Function.prototype.name === 'undefined') {\n var funcNameRegex = /function\\s([^(]{1,})\\(/;\n var results = funcNameRegex.exec(fn.toString());\n return results && results.length > 1 ? results[1].trim() : \"\";\n } else if (typeof fn.prototype === 'undefined') {\n return fn.constructor.name;\n } else {\n return fn.prototype.constructor.name;\n }\n}", "title": "" }, { "docid": "505341079082e45e304090968bee24ed", "score": "0.57611483", "text": "function miniKindOf(val) {\n\t if (val === void 0) return 'undefined';\n\t if (val === null) return 'null';\n\t var type = typeof val;\n\t\n\t switch (type) {\n\t case 'boolean':\n\t case 'string':\n\t case 'number':\n\t case 'symbol':\n\t case 'function':\n\t {\n\t return type;\n\t }\n\t }\n\t\n\t if (Array.isArray(val)) return 'array';\n\t if (isDate(val)) return 'date';\n\t if (isError(val)) return 'error';\n\t var constructorName = ctorName(val);\n\t\n\t switch (constructorName) {\n\t case 'Symbol':\n\t case 'Promise':\n\t case 'WeakMap':\n\t case 'WeakSet':\n\t case 'Map':\n\t case 'Set':\n\t return constructorName;\n\t } // other\n\t\n\t\n\t return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n\t}", "title": "" }, { "docid": "73287aaef688ddb7df7cee7a7ffb0a54", "score": "0.57492286", "text": "function tryGetConstructorLikeCompletionContainer(contextToken){if(contextToken){var parent=contextToken.parent;switch(contextToken.kind){case 20/* OpenParenToken */:case 27/* CommaToken */:return ts.isConstructorDeclaration(contextToken.parent)?contextToken.parent:undefined;default:if(isConstructorParameterCompletion(contextToken)){return parent.parent;}}}return undefined;}", "title": "" }, { "docid": "fdd969f011fe7fc579513feeaffa187f", "score": "0.57373834", "text": "function Jc() {\n return new Hc(\"__name__\");\n}", "title": "" }, { "docid": "6dba84f3251b9cb64bdb4f6ef7ebc8d5", "score": "0.57275504", "text": "function getClassName(){\n \n var stack = new Error(\"Dummy\").stack;\n if (stack != undefined){\n var functionName = stack.split(\"\\n\")[3];\n functionName = functionName.split(\"/\")[functionName.split(\"/\").length-1];\n functionName = functionName.split(\":\")[0];\n functionName = functionName.split(\".\")[0];\n return functionName;\n }\n return \"IE. No ClasName\";\n \n }", "title": "" }, { "docid": "8e90d3b9cf6857b33aa057638f02dc67", "score": "0.57264656", "text": "function defineConstructor(name) {\n\t\tname = typeof name === 'function' ? name.name : (typeof name === 'string' ? name : 'Object');\n\t\tif (name.match(/[^\\w\\d\\$]/)) throw 'Constructor names cannot contain special characters: ' + name + '()';\n\t\t// Using eval to define a properly named function\n\t\teval('var fn = function ' + name + '(){this.$super(arguments);}');\n\t\treturn fn;\n\t}", "title": "" } ]
0b14d05f89bec9b849ef3812a13b9a99
Initialize the date picker if the input has class .inputdate
[ { "docid": "25cedf0f6bb898d67e779d81a7cb1acf", "score": "0.74685484", "text": "initDatePicker() {\n\t\t\tlet field = this.input;\n\t\t\tlet picker;\n\n\t\t\t// make sure it is a text input\n\t\t\tfield.type = 'text';\n\n\t\t\t// if touch device use default date picker\n\t\t\tif ( 'ontouchstart' in doc.documentElement ) {\n\t\t\t\tfield.type = 'date';\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tpicker = new Pikaday( {\n\t\t\t\tfield: field,\n\t\t\t\tformat: 'MM/DD/YYYY',\n\t\t\t\tonSelect: function() {\n\t\t\t\t\tfield.value = this.getMoment().format( 'MM/DD/YYYY' );\n\t\t\t\t}\n\t\t\t} );\n\t\t}", "title": "" } ]
[ { "docid": "d670b54bcd206ce4330c2dc883f670b4", "score": "0.7534662", "text": "function setup_date_picker() {\n var datepicker_input = $('[data-behaviour~=\"datepicker\"]');\n if(datepicker_input == undefined || datepicker_input === undefined) return;\n\n datepicker_input.datepicker({\n autoclose: true,\n format: 'dd/mm/yyyy',\n language: 'pt-BR',\n startDate: 'today'\n });\n}", "title": "" }, { "docid": "d8bcf0db5cb9c4d1faf8171a7ff7891e", "score": "0.7507258", "text": "function Datepicker() {}", "title": "" }, { "docid": "d8bcf0db5cb9c4d1faf8171a7ff7891e", "score": "0.7507258", "text": "function Datepicker() {}", "title": "" }, { "docid": "8219ee64e213b7064fa805ac56d54993", "score": "0.7415762", "text": "initDatePicker() {\n // Find components\n const birthDateInput = $(this.birthDateInput);\n const deathDateInput = $(this.deathDateInput);\n\n birthDateInput.datepicker({\n language: 'vi'\n });\n deathDateInput.datepicker({\n language: 'vi'\n });\n }", "title": "" }, { "docid": "4f7f1e5b865d8cc2411e0d936578b27f", "score": "0.71964824", "text": "function initDatePicker()\n\t{\n\t\tvar dp = $('#datepicker');\n\t\tdp.datepicker();\n\t}", "title": "" }, { "docid": "0ad11bb04336f26117dc3111ff109c04", "score": "0.7184027", "text": "function initDatePicker()\r\n\t{\r\n\t\tif($('.datepicker').length)\r\n\t\t{\r\n\t\t\tvar datePickers = $('.datepicker');\r\n\t\t\tdatePickers.each(function()\r\n\t\t\t{\r\n\t\t\t\tvar dp = $(this);\r\n\t\t\t\t// Uncomment to use date as a placeholder\r\n\t\t\t\t// var date = new Date();\r\n\t\t\t\t// var dateM = date.getMonth() + 1;\r\n\t\t\t\t// var dateD = date.getDate();\r\n\t\t\t\t// var dateY = date.getFullYear();\r\n\t\t\t\t// var dateFinal = dateM + '/' + dateD + '/' + dateY;\r\n\t\t\t\tvar placeholder = dp.data('placeholder');\r\n\t\t\t\tdp.val(placeholder);\r\n\t\t\t\tdp.datepicker();\r\n\t\t\t});\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "bf54901d7fc680ade692b6855621a022", "score": "0.7157373", "text": "function initdate(){\nDate.firstDayOfWeek = 0;\nDate.format = 'dd/mm/yyyy';\n$(function()\n{$('.date-pick').datePicker({startDate:'01/01/1930'});});\n}", "title": "" }, { "docid": "c3ad87f0adc19d7d716671c8b79dc783", "score": "0.7066003", "text": "function rgdateinput() {\n if (!jQuery.fn.dateinput) {\n return false;\n }\n\n function sync_inputs(backend, frontend) {\n backend.val(frontend.getValue('yyyy-mm-dd'));\n }\n\n jQuery('.rg-dateinput').each(\n function(idx, el) {\n var frontend = jQuery(el).removeClass('rg-dateinput');\n var backend = frontend.clone().attr({type: 'hidden'});\n jQuery('label[for=\"' + backend.attr('name') + '\"] .formHelp').remove();\n frontend.after(backend);\n frontend.dateinput(\n {\n change: function() {\n sync_inputs(backend, this);\n }\n }\n );\n frontend.removeClass('date');\n frontend.attr({name: backend.attr('name') + Math.random()});\n }\n );\n }", "title": "" }, { "docid": "66e97dfd1ba9196e19503d65436eebce", "score": "0.7061997", "text": "function DateInput(el, opts) {\n if (typeof(opts) != \"object\") opts = {};\n $.extend(this, DateInput.DEFAULT_OPTS, opts);\n \n this.input = $(el);\n this.bindMethodsToObj(\"show\", \"hide\", \"hideIfClickOutside\", \"keydownHandler\", \"selectDate\");\n \n this.build();\n this.selectDate();\n this.hide();\n}", "title": "" }, { "docid": "66e97dfd1ba9196e19503d65436eebce", "score": "0.7061997", "text": "function DateInput(el, opts) {\n if (typeof(opts) != \"object\") opts = {};\n $.extend(this, DateInput.DEFAULT_OPTS, opts);\n \n this.input = $(el);\n this.bindMethodsToObj(\"show\", \"hide\", \"hideIfClickOutside\", \"keydownHandler\", \"selectDate\");\n \n this.build();\n this.selectDate();\n this.hide();\n}", "title": "" }, { "docid": "d1a02057a4fe16d4d072b6c84ae6a86f", "score": "0.704765", "text": "function setupDate(element) {\n $(element).datepicker();\n}", "title": "" }, { "docid": "4ad843066c1f5920b7cc35e8a2f4500e", "score": "0.6965573", "text": "function dtpdmanifiesto_fecha_salida__init(){\n $(\"#pgmanifiesto_dtpdmanifiesto_fecha_salida\").datepicker({\n language: \"es\",\n todayBtn: \"linked\",\n format: \"dd/mm/yyyy\",\n multidate: false,\n todayHighlight: true,\n autoclose: true\n\n }).datepicker(\"setDate\", new Date());\n}", "title": "" }, { "docid": "0a717e6873bd8c6c871bc32078d89029", "score": "0.6926382", "text": "function initDatePicker(){\n $('#date-flight').datetimepicker({\n format: \"YYYY-MM-DD\"\n });\n}", "title": "" }, { "docid": "81811679f3f8b2df8af27b7891743873", "score": "0.6915841", "text": "function dtpdguia_fecha_reenvio__init(){\n $(\"#dtpdguia_fecha_reenvio\").datepicker({\n language: \"es\",\n todayBtn: \"linked\",\n format: \"dd/mm/yyyy\",\n multidate: false,\n todayHighlight: true,\n autoclose: true,\n\n }).datepicker(\"setDate\", new Date());\n}", "title": "" }, { "docid": "105fd56333e8d99f7240f5c6fe95b11e", "score": "0.6897614", "text": "function setDatepicker()\r\n{\r\n $(\".datepicker-field\").datepicker();\r\n}", "title": "" }, { "docid": "80a64bc6539f99606c751e96cd2441f6", "score": "0.68881464", "text": "function setDatePicker() {\n\t\t$( \"#eventdate\" ).datepicker({\n\t\t\tbeforeShowDay : function(date){\n\t\t\t\tswitch (isAvailable(date)) {\n\t\t\t\t\tcase -1: \treturn [0,'','gesloten'];\n\t\t\t\t\tcase 1: \treturn [1,'date-bookable','boekbaar'];\n\t\t\t\t\tcase 0:\t\treturn [1,'date-full','boekbaar'];\n\t\t\t\t}\n\t\t\t},\n\t\t\tminDate : new Date(),\n\t\t\tdefaultDate: getMinimalBookableDate()\n\t\t});\n\t}", "title": "" }, { "docid": "eccddeb99b60bb84e627aae6d0309301", "score": "0.6850451", "text": "function init(e) {\n var $inputGroup = $(this);\n if ($inputGroup.data('DateTimePicker')) return;\n\n var yearly = $inputGroup.find('input').attr('yearly');\n var format = yearly ? 'DD-MM' : 'DD-MM-YYYY';\n\n $inputGroup.datetimepicker({\n locale: locale,\n format: format,\n extraFormats: ['YYYY-MM-DDTHH:mm:ssZ'], //Allow ISO8601 format for input\n dayViewHeaderFormat: yearly ? 'MMMM' : 'MMMM YYYY',\n\n //Allow arrow keys navigation inside date text field\n keyBinds: {\n up: null,\n down: function (widget) {\n if (!widget) this.show();\n },\n left: null,\n right: null,\n t : null,\n delete : null\n }\n });\n\n if (typeof e !== 'undefined') {\n $(e.target).closest('.input-group-addon').trigger('click');\n }\n }", "title": "" }, { "docid": "f38ed2c6b2b6f221b50842cf9042c361", "score": "0.68401283", "text": "function go_date_input_make_datepicker( elem ) {\n\tvar date_format = \"yy-mm-dd\";\n\tjQuery( elem ).datepicker( { dateFormat: date_format } );\n}", "title": "" }, { "docid": "1cfd6840277797d1382f5b815554e078", "score": "0.6815401", "text": "function datepicker(){\n\t\t // Adding calender to the Firefox and IE\n\t\t\tvar elem = document.createElement('input');\n elem.setAttribute('type', 'date');\n \n if ( elem.type === 'text' ) {\n $( \".date\" ).datepicker({ \n\t\t dateFormat: 'yy-mm-dd'\n\t\t\t});\n }\t\n\t}", "title": "" }, { "docid": "9ee6f4e5c51dc2966f351e613cb7a585", "score": "0.6768649", "text": "function visitDatepickerInitializer() {\n\n\t$('.datepicker').pickadate({\n\t\t\tselectMonths: true, \n\t\t labelMonthNext: 'Mois suivant',\n\t\t \tlabelMonthPrev: 'Mois précédent',\n\t\t \tlabelMonthSelect: 'Choisir un mois',\n\t\t labelYearSelect: 'Choisir une année',\n\t\t monthsFull: [ 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre' ],\n\t\t monthsShort: [ 'Jan', 'Fev', 'Mar', 'Avr', 'Mai', 'Juin', 'Juil', 'Aoû', 'Sep', 'Oct', 'Nov', 'Dec' ],\n\t\t weekdaysFull: [ 'Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi' ],\n\t\t weekdaysShort: [ 'Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam' ],\n\t\t weekdaysLetter: [ 'D', 'L', 'Ma', 'Me', 'J', 'V', 'S' ],\n\t\t clear: 'Effacer',\n\t\t close: 'Ok',\n\t\t format: 'dddd dd mmmm yyyy',\n\t\t formatSubmit: 'dd-mm-yyyy',\n\t\t \thiddenName: true,\n\t\t \tfirstDay: 1,\n\t\t closeOnSelect: false,\n\t\t\tselectYears : 2,\n\t\t\ttoday : \"Aujourd'hui\",\n\t\t\tmin : true,\n\t\t\tmax : 730,\n\t\t\tdisable : disabledDates\n\t\t});\n\n}", "title": "" }, { "docid": "3f96dde8f6d0b2a21056ba02af4d7e0c", "score": "0.67595553", "text": "function setupDatetime(){\n if(Modernizr.inputtypes.time){\n $('#planner-options-timeformat').hide();\n $('#planner-options-timeformat').attr('aria-hidden',true);\n }\n setTime(String(currentTime.getHours()).lpad('0',2)+':'+String(currentTime.getMinutes()).lpad('0',2));\n function pad(n) { return n < 10 ? '0' + n : n; }\n var date = currentTime.getFullYear() + '-' + pad(currentTime.getMonth() + 1) + '-' + pad(currentTime.getDate());\n setDate(date);\n $(\"#planner-options-date\").datepicker( {\n dateFormat: Locale.dateFormat,\n dayNames: Locale.days,\n dayNamesMin : Locale.daysMin,\n monthNames: Locale.months,\n defaultDate: 0,\n hideIfNoPrevNext: true,\n minDate: whitelabel_minDate,\n maxDate: whitelabel_maxDate\n });\n\n /* Read aloud the selected dates */\n $(document).on(\"mouseenter\", \".ui-state-default\", function() {\n var text = $(this).text()+\" \"+$(\".ui-datepicker-month\",$(this).parents()).text()+\" \"+$(\".ui-datepicker-year\",$(this).parents()).text();\n $(\"#planner-options-date-messages\").text(text);\n });\n\n if(Modernizr.inputtypes.date){\n $('#planner-options-dateformat').hide();\n $('#planner-options-dateformat').attr('aria-hidden',true);\n }\n}", "title": "" }, { "docid": "40c4eebe8276befb146221003d13d4cc", "score": "0.6747192", "text": "function InitDatePicker() {\n SupportCtrl.ePage.Masters.DatePicker = {};\n SupportCtrl.ePage.Masters.DatePicker.Options = APP_CONSTANT.DatePicker;\n SupportCtrl.ePage.Masters.DatePicker.isOpen = [];\n SupportCtrl.ePage.Masters.DatePicker.OpenDatePicker = OpenDatePicker;\n }", "title": "" }, { "docid": "df239b37ab3c61470bae17ffc2dcf465", "score": "0.6705263", "text": "function init_datepicker( e ) {\n var $context = $(e.target);\n $context.find(selector.date).datepicker();\n $context.find(selector.time).timepicker();\n $context.find(selector.datetime).datetimepicker();\n }", "title": "" }, { "docid": "c66e87fab8dd19f9cc4acc004798ea63", "score": "0.6698165", "text": "function initDatePicker(id, today){\n\t$(\"#\"+id+\"-date-picker\").datepicker({\n\t\tuseCurrent: true,\n\t\tforceParse: false,\n\t\tdisabled: true,\n\t\tdaysOfWeekDisabled: [0, 6],\n\t\tformat: \"yyyy-mm\",\n\t\tstartView: \"months\", \n\t\tminViewMode: \"months\",\n\t\tstartDate: today,\n//\t\tendDate: today, \n\t\tautoclose: true,\n\t});\n\t\n\t$(\"#\"+id+\"-date\").val(getToday());\n\t\n}", "title": "" }, { "docid": "85142dd5f6415a38dde9a58fd5707630", "score": "0.6613227", "text": "function initDatepickers() {\r\n $('input.highcharts-range-selector', $('#chart-container'))\r\n .datepicker({\r\n format: 'yyyy-mm-dd',\r\n todayBtn: 'linked',\r\n todayHighlight: true,\r\n orientation: 'auto right'\r\n })\r\n .on('focus', function () {\r\n var currentDate = new Date($(this).val());\r\n $(this).datepicker('setDate', currentDate);\r\n });\r\n }", "title": "" }, { "docid": "b76677de583772cb9f826e7041c7660a", "score": "0.6571244", "text": "function bootstrap_datepicker(date){\n\t\t$(date).datepicker({\n\t\t format: 'dd-mm-yyyy',\n\t\t todayHighlight: true,\n\t\t autoclose: true,\n\t\t calendarWeeks: true,\n\t\t clearBtn: true,\n\t\t disableTouchKeyboard: true,\n\t\t language: 'es'\n\t\t});\n\t}", "title": "" }, { "docid": "d39e613ed2c7974e606f1dce7338e94a", "score": "0.6518248", "text": "function d(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId=\"ui-datepicker-div\",this._inlineClass=\"ui-datepicker-inline\",this._appendClass=\"ui-datepicker-append\",this._triggerClass=\"ui-datepicker-trigger\",this._dialogClass=\"ui-datepicker-dialog\",this._disableClass=\"ui-datepicker-disabled\",this._unselectableClass=\"ui-datepicker-unselectable\",this._currentClass=\"ui-datepicker-current-day\",this._dayOverClass=\"ui-datepicker-days-cell-over\",this.regional=[],this.regional[\"\"]={closeText:\"Done\",prevText:\"Prev\",nextText:\"Next\",currentText:\"Today\",monthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],monthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],dayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],dayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],dayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],weekHeader:\"Wk\",dateFormat:\"mm/dd/yy\",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:\"\"},this._defaults={showOn:\"focus\",showAnim:\"fadeIn\",showOptions:{},defaultDate:null,appendText:\"\",buttonText:\"...\",buttonImage:\"\",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:\"c-10:c+10\",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:\"+10\",minDate:null,maxDate:null,duration:\"fast\",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:\"\",altFormat:\"\",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[\"\"]),this.regional.en=t.extend(!0,{},this.regional[\"\"]),this.regional[\"en-US\"]=t.extend(!0,{},this.regional.en),this.dpDiv=p(t(\"<div id='\"+this._mainDivId+\"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"))}", "title": "" }, { "docid": "d39e613ed2c7974e606f1dce7338e94a", "score": "0.6518248", "text": "function d(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId=\"ui-datepicker-div\",this._inlineClass=\"ui-datepicker-inline\",this._appendClass=\"ui-datepicker-append\",this._triggerClass=\"ui-datepicker-trigger\",this._dialogClass=\"ui-datepicker-dialog\",this._disableClass=\"ui-datepicker-disabled\",this._unselectableClass=\"ui-datepicker-unselectable\",this._currentClass=\"ui-datepicker-current-day\",this._dayOverClass=\"ui-datepicker-days-cell-over\",this.regional=[],this.regional[\"\"]={closeText:\"Done\",prevText:\"Prev\",nextText:\"Next\",currentText:\"Today\",monthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],monthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],dayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],dayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],dayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],weekHeader:\"Wk\",dateFormat:\"mm/dd/yy\",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:\"\"},this._defaults={showOn:\"focus\",showAnim:\"fadeIn\",showOptions:{},defaultDate:null,appendText:\"\",buttonText:\"...\",buttonImage:\"\",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:\"c-10:c+10\",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:\"+10\",minDate:null,maxDate:null,duration:\"fast\",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:\"\",altFormat:\"\",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[\"\"]),this.regional.en=t.extend(!0,{},this.regional[\"\"]),this.regional[\"en-US\"]=t.extend(!0,{},this.regional.en),this.dpDiv=p(t(\"<div id='\"+this._mainDivId+\"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"))}", "title": "" }, { "docid": "09d14d45428ae12887a3ee14792025ed", "score": "0.6497335", "text": "function BindDatePicker(elem) {\n elem.removeClass('hasDatepicker');\n elem.datepicker({\n format: DEFAULT_DATE_PICKER_FORMAT,\n changeMonth: true,\n changeYear: true,\n endDate: 0,\n maxViewMode: 2,\n defaultDate: new Date(),\n minDate: MIN_PRODUCTION_DATA_DATE,\n language: 'vi',\n autoclose: true\n });\n}", "title": "" }, { "docid": "1af76e3bd42a5d9235c98067aa8b2a47", "score": "0.6472592", "text": "function inputDate(value, nameId) {\n if ($('#ui-datepicker-div').is(\":visible\")) {\n $(value).find('.remove-text-js').css({\n 'font-size': '0',\n });\n }\n\n if($(nameId).datepicker().val() == '') {\n let dateNow = $.datepicker.formatDate('yy.mm.dd', new Date());\n $(nameId).datepicker().val(dateNow)\n }\n }", "title": "" }, { "docid": "2460f86299a883cade55de39e693f46c", "score": "0.6472449", "text": "function initDatePicker() {\n\t$('#date-picker').daterangepicker({\n\t\t//options for the plugin\n\t\t\"locale\": {\n\t\t \"format\": \"DD/MM/YYYY\"\n\t\t },\n\t\t\"maxSpan\": {\n\t\t \"days\": 15\n\t\t},\n\t\t\"autoApply\": true,\n\t\t'opens': 'center',\n\t\t\"minYear\": 2018,\n\t\t\"maxYear\": 2022,\n\t\t\"showCustomRangeLabel\": false\n\t\t//callback function to perform filtering\n\t}\n\t// ,function(start, end, label) {\n\t// \t//filter with this value\n\t// \tuserInputDate = Math.round((end-start)/(1000*60*60*24));\n\t// \tuserInputDateUpdated = userInputDate - 1;\n\t// }\n\n\t);\n}", "title": "" }, { "docid": "ae3e27710cb3984a6dfe44887496459e", "score": "0.64648557", "text": "function setfecharechazo(){\n\n classdate();\n// fechacita = $('#fecha_solicitud').val();\n// $(\"#fecharechazo\").datepicker(\"option\", \"minDate\", '2016-06-02');\n\n\n var dateFormat = $('#fecha_solicitud' ).val();\n var arr = dateFormat.split('-');\n\n if($('#fecharechazo').hasClass('hasDatepicker')) {\n $('#fecharechazo').datepicker( \"option\", \"minDate\", new Date(arr[0], arr[1] - 1, arr[2]));\n } else {\n $(\"#fecharechazo\").datepicker({'minDate': new Date(arr[0], arr[1] - 1, arr[2])});\n }\n\n\n}", "title": "" }, { "docid": "d64070fb9c23535fe29ddc90961ed7ec", "score": "0.6438389", "text": "function initDateDefault(){\n $(\".dp-ym\").datepicker({\n dateFormat: 'yy-mm',\n changeMonth: true,\n changeYear: true,\n showButtonPanel: true,\n\n onClose: function(dateText, inst) {\n var month = $(\"#ui-datepicker-div .ui-datepicker-month :selected\").val();\n var year = $(\"#ui-datepicker-div .ui-datepicker-year :selected\").val();\n $(this).val($.datepicker.formatDate('yy-mm', new Date(year, month, 1)));\n }\n });\n $(\".dp-ym\").focus(function () {\n $(\".ui-datepicker-calendar\").hide();\n $(\"#ui-datepicker-div\").position({\n my: \"center top\",\n at: \"center bottom\",\n of: $(this)\n });\n });\n}", "title": "" }, { "docid": "e976efee11655659cc351541c6ff92e5", "score": "0.6427109", "text": "function dateSelect() {\n $('.datepicker').datepicker({\n showOn: 'both',\n buttonText: 'Show Date',\n buttonImageOnly: false,\n dateFormat: 'mm/dd/yy',\n onSelect: updateModel\n });\n\n // Add buttons and style to the date inputs\n var $datepickerBtn = $('.input-datepicker button');\n $datepickerBtn.html('<i class=\"glyphicon glyphicon-calendar\"></i>');\n $datepickerBtn.addClass('btn btn-default');\n\n function updateModel (dateText, $element) {\n var showValidationMessage = false;\n dateText = new Date(dateText);\n var $elm = $element.input;\n dateText = dateText.toString().slice(0, 15);\n var strModel = $elm.attr('ng-model');\n strModel = strModel.split('.');\n strModel = strModel.pop();\n var err = dateValid(strModel, dateText);\n var $elmErr = $elm.parent().siblings().find('p');\n var ngEl = angular.element($elm.parent().parent());\n if (err){\n showValidationMessage = true;\n console.log('err ',err);\n $elmErr.text(err);\n ngEl.toggleClass('has-error', showValidationMessage);\n // Replace input value\n $elm.val(dateText);\n } else {\n //Input model update\n vm.makeathon[strModel] = dateText;\n $scope.$apply();\n }\n }\n }", "title": "" }, { "docid": "8b46697c9fd6539902023f3a6698bf88", "score": "0.641837", "text": "ready () {\n\t\tlet self = this\n\n\t\tthis.datepicker = $(this.$el).pickadate({\n\t\t\tinterval: this.interval,\n\t\t\tmin: this.min,\n\t\t\tmax: this.max,\n\t\t\teditable: this.disabled,\n\t\t\t// Escape any “rule” characters with an exclamation mark (!).\n\t\t\tformat: this.format,\n\t\t\tformatLabel: this.formatLabel,\n\t\t\tformatSubmit: this.formatSubmit,\n\t\t\thiddenPrefix: this.hiddenPrefix,\n\t\t\thiddenSuffix: this.hiddenSuffix,\n\t\t\tonSet: function (context) {\n\t\t\t\tself.$emit('set', this)\n\t\t\t}\n\t\t});\n\n\t\t// this.datepicker.set('select', this.value, {format: 'yyyymmdd'})\n }", "title": "" }, { "docid": "d014cfccf6da62bc6d8411e3a6e1758b", "score": "0.6402821", "text": "function loadDatepicker() {\n\t\t$( \".js-datepicker\" ).datepicker({ \n\t\t\tdateFormat: \"dd/mm/yy\",\n\t\t\tfirstDay: wp_start_of_week,\n\t\t});\n\t}", "title": "" }, { "docid": "cbe2f00de4df73ca2ad92d3ff2d26043", "score": "0.6369229", "text": "function DatePicker(container, name){\r\n DatePicker.superclass.constructor.apply(this, arguments);\r\n \r\n this.control = null;\r\n this.dateInput = null;\r\n this.date = '';\r\n}", "title": "" }, { "docid": "3f2e7f41b4d9474f79bc15de107aca08", "score": "0.6363609", "text": "function initReadingDateDatePicker() {\n $('#readingDateDatepicker').datepicker({\n inline: true\n });\n}", "title": "" }, { "docid": "49832909a6bf7e51db6bcc9be10a5cfb", "score": "0.6350177", "text": "function initializeDatePicker(elementId) {\n var d = moment(new Date()).add(1, 'days').hours(12).minutes(0);\n if (elementId == '#voting-due-date') {\n d.add(1, 'days');\n }\n $(elementId + '-utc').val(d.utc().format('MM/DD/YY hA'));\n return $(elementId).datetimepicker({\n defaultDate: d,\n sideBySide: true,\n format: 'MM/DD/YY hA',\n useStrict: true,\n showClose: true\n });\n}", "title": "" }, { "docid": "9af2b1fc4aa8ce30d7b97b19be1eac20", "score": "0.6312783", "text": "function init() {\n\tif (!started){\n\t\tvar formElements = document.getElementsByTagName(\"input\");\n\t\tfor(var i=0; i<formElements.length; i++){\n\t\t\tvar element = formElements[i];\n\t\t\tif (element.getAttribute(\"fieldTag\")){\n\t\t\t\tvar parent = element.parentNode;\n\t\t\t\tvar newElement = document.createElement(\"div\");\n\t\t\t\tnewElement.setAttribute('class', 'formField');\t\t\t\t\n\t\t\t\tparent.insertBefore(newElement, element);\n\t\t\t\tnewElement.appendChild(parent.removeChild(element));\n\t\t\t\telement.onblur = function(){\n\t\t\t\t\tvalidate(this, false);\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\tif (element.getAttribute(\"fieldTag\").toUpperCase()=='DATE'){\n\t\t\t\t\tvar element = document.getElementsByTagName(\"input\")[i];\n\t\t\t\t\telement.setAttribute('readonly', 'readonly');\n\t\t\t\t\tvar calendarDiv = document.createElement(\"div\");\n\t\t\t\t\tcalendarDiv.setAttribute('id', 'datePicker');\n\t\t\t\t\tcalendarDiv.setAttribute('style', 'display:none');\n\t\t\t\t\tcalendarDiv.setAttribute('class', 'calendar');\n\t\t\t\t\telement.parentNode.appendChild(calendarDiv);\n\t\t\t\t\telement.onblur = undefined;\n\t\t\t\t\telement.onfocus = function(){\n\t\t\t\t\t\tdatePicker(this);\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (element.getAttribute(\"type\").toUpperCase()=='SUBMIT'){\n\t\t\t\telement.onclick = function(){\n\t\t\t\t\tvar formElements = document.getElementsByTagName(\"input\");\n\t\t\t\t\tfor(var i=0; i<formElements.length; i++){\n\t\t\t\t\t\tvar element = formElements[i];\n\t\t\t\t\t\tif (element.getAttribute(\"fieldTag\")){\n\t\t\t\t\t\t\tvalidate(element, 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\tif (_timer) clearInterval(_timer);\n\t\tstarted=true;\n\t}\n}", "title": "" }, { "docid": "5e7e3e6c57180d07cb0cb254bef97b7f", "score": "0.631264", "text": "function BindDatepicker(datepickerId) {\n\n var date_input = $('#'+datepickerId);\n var container = $('.bootstrap-iso form').length > 0 ? $('.bootstrap-iso form').parent() : \"body\";\n var dateToday = new Date();\n date_input.datepicker({\n format: 'mm/dd/yyyy',\n container: container,\n todayHighlight: true,\n autoclose: true,\n numberOfMonths: 2,\n showButtonPanel: true\n })\n}", "title": "" }, { "docid": "e5f7acd62aeaa7ccc779be6011629098", "score": "0.63018966", "text": "getInput() {\n return this.element.shadowRoot\n ? this.element.shadowRoot.querySelector('.tag-date-picker__input')\n : this.element.querySelector('.tag-date-picker__input');\n }", "title": "" }, { "docid": "12377034dd9726a0286131d43d4acc7a", "score": "0.6290053", "text": "#show() {\n this.#options.locale = this.#curInstance.locale;\n if (!DatePickerWidget.#visible) {\n let date,\n validDate;\n validDate = this.#curInstance.selectedDate;\n date = validDate ? new Date(validDate) : new Date();\n this.selectedDay = this.currentDay = date.getDate();\n this.selectedMonth = this.currentMonth = date.getMonth();\n this.selectedYear = this.currentYear = date.getFullYear();\n this.maxValidDate = this.#options.maximum ? new Date(\n this.#curInstance.maxValidDate) : null;\n this.minValidDate = this.#options.minimum ? new Date(\n this.#curInstance.minValidDate) : null;\n this.exclMaxDate = this.#curInstance.exclMaxDate;\n this.exclMinDate = this.#curInstance.exclMinDate;\n this.#dp.getElementsByClassName(\"dp-clear\")[0].getElementsByTagName(\n \"a\")[0].innerText = this.#options.locale.clearText;\n this.#layout(this.#defaultView);\n this.#position();\n this.#dp.style.display = \"flex\";\n this.#focusedOnLi = false;\n DatePickerWidget.#visible = true;\n if (this.#options.showCalendarIcon) {\n this.#curInstance.$field.setAttribute('readonly', true); // when the datepicker is active, deactivate the field\n }\n }\n\n // Disabling the focus on ipad due to a bug where value of\n // date picker is not being set\n // Removing this code will only hamper one use case\n // where on ipad if you click on the calander then\n // the field becomes read only so\n // there is no indication where the current focus is\n // And if you remove this foucs code all together\n // then what happens is that on desktop MF in iframe the exit event\n // is not getting called hence calander getting remained open even\n // when you click somewhere on window or focus into some other field\n if (this.#options.showCalendarIcon && !this.#touchSupported) {\n this.#curInstance.$field.focus(); // field loses focus after being marked readonly, causing blur event not to be fired later\n }\n }", "title": "" }, { "docid": "6c7762a492423cfa65ab548cad3f4808", "score": "0.6283362", "text": "function setupDatePicker() {\n\t/* config startdate picker : setupStartdatePicker() & config enddate picker : setupEnddatePicker()\n\t* directionstartdate: false, means past only dates ending today\n\t* pair: $(enddate), sets the date of the enddate picker to startdate +1\n\t* direction for enddate: only allow dates in future from selected startdate\n\t* offset shifts datepickers position relative to top right of the icon\n\t*/\n\t$(document).ready(function() {\n\t\t$(\"#startdate\").val('');\n\t\t$(\"#enddate\").val('');\n\t\t$(\"#startdate\").Zebra_DatePicker({direction: false, pair: $(enddate), offset:[-190, 285]});\n\t\t$(\"#enddate\").Zebra_DatePicker({direction: false, direction: 1, offset:[-190, 285]});\n\t});\n\t/*\n*/\n}", "title": "" }, { "docid": "406d582b36d3c5471cf01960fba12536", "score": "0.6283307", "text": "function openCalender()\n{\n $( \"#txtDeliveryDate\" ).datepicker();\n}", "title": "" }, { "docid": "25e34a5d48e1f2fff29711e9371b8dfb", "score": "0.6258051", "text": "function initDatePicker(element, onChange) {\n element.glDatePicker(\n {\n cssName: \"android\",\n startDate: new Date(Date.parse(\"Today\")),\n endDate: new Date(Date.parse(\"Yesterday\").addYears(1)),\n allowOld: false,\n position: \"fixed\",\n onChange: onChange\n });\n }", "title": "" }, { "docid": "54ab9e268c7fa2c140c2346e4f26dea6", "score": "0.62541354", "text": "function inicializarFechas(){ \n $(\"#fechanac\").datepicker({ dateFormat: \"yy-mm-dd\",changeMonth: true, changeYear: true,yearRange: \"-100:+0\" });\n $(\"#fechanac_sub\").datepicker({ dateFormat: \"yy-mm-dd\",changeMonth: true, changeYear: true,yearRange: \"-100:+0\" });\n// $('#fechanac').dateEntry({dateFormat: 'ymd-',maxDate: new Date(),minDate: new Date(1910,01,01)});\n}", "title": "" }, { "docid": "de65a5eba14ccf392f914fd4f9dedebe", "score": "0.6238933", "text": "loadDatePicker(round, date){\n $(this.shadowRoot.getElementById(round)).Zebra_DatePicker({direction: 1, disabled_dates:['* * * 0,1,2,3,5,6']});\n }", "title": "" }, { "docid": "a6e4ad9b27dff52b115691a0212fcc0a", "score": "0.62379885", "text": "function fecharechazosol(){\n// if ()$('#fechanewcitasol').val()=\"\" || )\n var dateFormat = $('#fecharechazo' ).val();\n var arr = dateFormat.split('-');\n\n if($('#fechanewcitasol').hasClass('hasDatepicker')) {\n $('#fechanewcitasol').datepicker( \"option\", \"minDate\", new Date(arr[0], arr[1] - 1, arr[2]));\n } else {\n $(\"#fechanewcitasol\").datepicker({'minDate': new Date(arr[0], arr[1] -1, arr[2])});\n }\n\n\n}", "title": "" }, { "docid": "e584b8107d22ea7361691a92b9a736e6", "score": "0.62379694", "text": "function BindBootstrapDatePicker() {\n $('.bootstrap-datepicker').datepicker({\n dateFormat: 'dd-mm-yyyy',\n autoclose: true,\n todayHighlight: true\n });\n}", "title": "" }, { "docid": "d05d367908683f69428211a097fe95cd", "score": "0.6227502", "text": "function f(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId=\"ui-datepicker-div\",this._inlineClass=\"ui-datepicker-inline\",this._appendClass=\"ui-datepicker-append\",this._triggerClass=\"ui-datepicker-trigger\",this._dialogClass=\"ui-datepicker-dialog\",this._disableClass=\"ui-datepicker-disabled\",this._unselectableClass=\"ui-datepicker-unselectable\",this._currentClass=\"ui-datepicker-current-day\",this._dayOverClass=\"ui-datepicker-days-cell-over\",this.regional=[],this.regional[\"\"]={closeText:\"Done\",prevText:\"Prev\",nextText:\"Next\",currentText:\"Today\",monthNames:[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],monthNamesShort:[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],dayNames:[\"Sunday\",\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\"],dayNamesShort:[\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"],dayNamesMin:[\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"],weekHeader:\"Wk\",dateFormat:\"mm/dd/yy\",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:\"\"},this._defaults={showOn:\"focus\",showAnim:\"fadeIn\",showOptions:{},defaultDate:null,appendText:\"\",buttonText:\"...\",buttonImage:\"\",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:\"c-10:c+10\",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:\"+10\",minDate:null,maxDate:null,duration:\"fast\",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:\"\",altFormat:\"\",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[\"\"]),this.regional.en=t.extend(!0,{},this.regional[\"\"]),this.regional[\"en-US\"]=t.extend(!0,{},this.regional.en),this.dpDiv=p(t(\"<div id='\"+this._mainDivId+\"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"))}", "title": "" }, { "docid": "d726114b01a6f8b090e2c5ef24c93211", "score": "0.62088126", "text": "function load_datepicker(element_id)\n{\n\t//console.log('datepicker loaded');\n\n\t$( \"#\" + element_id ).datepicker({ dateFormat: 'yy-mm-dd' });\n\n\n}", "title": "" }, { "docid": "d8bf4a792dd35101ae37df9dbca6de1c", "score": "0.6208003", "text": "function setDateToInput(event) {\n var day = event.target.innerHTML;\n var localMonth = String(month + 1);\n\n day = ('0' + day).slice(-2);\n localMonth = ('0' + localMonth).slice(-2);\n\n var val;\n if (options.format == 'mdy') {\n val = localMonth + '/' + day + '/' + year;\n } else if (options.format == 'ymd') {\n val = year + '/' + localMonth + '/' + day;\n } else {\n val = day + '/' + localMonth + '/' + year;\n }\n\n el.value = val;\n el.innerHTML = val;\n removeCalendar();\n }", "title": "" }, { "docid": "4739049a8d0fb53dcd4ddc6e137ab971", "score": "0.61965114", "text": "function setupDatePicker() {\n\n // Set date styles\n $(\"input[name*=outwardDate]\").addClass('dateEntryWithButton');\n $(\"input[name*=btnOutwardDate]\").removeClass('hide');\n\n $(document).on(\"click\", \"input[name*=btnOutwardDate]\", function () {\n displayCalendar();\n\n // Return to prevent page postback\n return false;\n });\n\n $(document).on(\"click\", \"input[name*=outwardDate]\", function () {\n displayCalendar();\n return false;\n });\n\n // Enter key pressed on date input\n $(document).on(\"keydown\", \"input[name*=outwardDate]\", function (e) {\n if (e.target.className != \"searchtextbox\") {\n if (e.keyCode == 13) { //Enter key\n e.preventDefault();\n displayCalendar();\n return false;\n }\n else\n return true;\n }\n else\n return true;\n });\n \n\n $(document).on(\"click\", \"input[name*=dataDate]\", function () {\n // Set the selected date\n var date = $(this).attr('title');\n\n var todayDate = getJSHdnSettingFieldValue('todayDate', $(\".eventDate\"));\n\n if (date == todayDate) {\n // If date selected is today, then display \"today\" in the date box\n date = $('input[name*=outwardDate]').data('todaytext');\n }\n\n $('input[name*=outwardDate]').first().val(date);\n\n $(this).parent().addClass('daySelected');\n\n hidePage('#datepage');\n\n resetArriveByFlag();\n\n // Set focus back onto the button\n $('#datepage').parent().find('input[name*=btnOutwardDate]').focus();\n\n return false;\n });\n}", "title": "" }, { "docid": "07f2481b8abee99762c1a555efdd97d7", "score": "0.61677253", "text": "function Datepicker() {\n this._curInst = null; // The current instance in use\n\n this._keyEvent = false; // If the last event was a key event\n\n this._disabledInputs = []; // List of date picker inputs that have been disabled\n\n this._datepickerShowing = false; // True if the popup picker is showing , false if not\n\n this._inDialog = false; // True if showing within a \"dialog\", false if not\n\n this._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\n this._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\n this._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\n this._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\n this._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\n this._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\n this._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\n this._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\n this._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\n this.regional = []; // Available regional settings, indexed by language code\n\n this.regional[\"\"] = {\n // Default regional settings\n closeText: \"Done\",\n // Display text for close link\n prevText: \"Prev\",\n // Display text for previous month link\n nextText: \"Next\",\n // Display text for next month link\n currentText: \"Today\",\n // Display text for current month link\n monthNames: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n // Names of months for drop-down and formatting\n monthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"],\n // For formatting\n dayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n // For formatting\n dayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n // For formatting\n dayNamesMin: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],\n // Column headings for days starting at Sunday\n weekHeader: \"Wk\",\n // Column header for week of the year\n dateFormat: \"mm/dd/yy\",\n // See format options on parseDate\n firstDay: 0,\n // The first day of the week, Sun = 0, Mon = 1, ...\n isRTL: false,\n // True if right-to-left language, false if left-to-right\n showMonthAfterYear: false,\n // True if the year select precedes month, false for month then year\n yearSuffix: \"\" // Additional text to append to the year in the month headers\n\n };\n this._defaults = {\n // Global defaults for all the date picker instances\n showOn: \"focus\",\n // \"focus\" for popup on focus,\n // \"button\" for trigger button, or \"both\" for either\n showAnim: \"fadeIn\",\n // Name of jQuery animation for popup\n showOptions: {},\n // Options for enhanced animations\n defaultDate: null,\n // Used when field is blank: actual date,\n // +/-number for offset from today, null for today\n appendText: \"\",\n // Display text following the input box, e.g. showing the format\n buttonText: \"...\",\n // Text for trigger button\n buttonImage: \"\",\n // URL for trigger button image\n buttonImageOnly: false,\n // True if the image appears alone, false if it appears on a button\n hideIfNoPrevNext: false,\n // True to hide next/previous month links\n // if not applicable, false to just disable them\n navigationAsDateFormat: false,\n // True if date formatting applied to prev/today/next links\n gotoCurrent: false,\n // True if today link goes back to current selection instead\n changeMonth: false,\n // True if month can be selected directly, false if only prev/next\n changeYear: false,\n // True if year can be selected directly, false if only prev/next\n yearRange: \"c-10:c+10\",\n // Range of years to display in drop-down,\n // either relative to today's year (-nn:+nn), relative to currently displayed year\n // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n showOtherMonths: false,\n // True to show dates in other months, false to leave blank\n selectOtherMonths: false,\n // True to allow selection of dates in other months, false for unselectable\n showWeek: false,\n // True to show week of the year, false to not show it\n calculateWeek: this.iso8601Week,\n // How to calculate the week of the year,\n // takes a Date and returns the number of the week for it\n shortYearCutoff: \"+10\",\n // Short year values < this are in the current century,\n // > this are in the previous century,\n // string value starting with \"+\" for current year + value\n minDate: null,\n // The earliest selectable date, or null for no limit\n maxDate: null,\n // The latest selectable date, or null for no limit\n duration: \"fast\",\n // Duration of display/closure\n beforeShowDay: null,\n // Function that takes a date and returns an array with\n // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n // [2] = cell title (optional), e.g. $.datepicker.noWeekends\n beforeShow: null,\n // Function that takes an input field and\n // returns a set of custom settings for the date picker\n onSelect: null,\n // Define a callback function when a date is selected\n onChangeMonthYear: null,\n // Define a callback function when the month or year is changed\n onClose: null,\n // Define a callback function when the datepicker is closed\n numberOfMonths: 1,\n // Number of months to show at a time\n showCurrentAtPos: 0,\n // The position in multipe months at which to show the current month (starting at 0)\n stepMonths: 1,\n // Number of months to step back/forward\n stepBigMonths: 12,\n // Number of months to step back/forward for the big links\n altField: \"\",\n // Selector for an alternate field to store selected dates into\n altFormat: \"\",\n // The date format to use for the alternate field\n constrainInput: true,\n // The input is constrained by the current date format\n showButtonPanel: false,\n // True to show button panel, false to not show it\n autoSize: false,\n // True to size the input for the date format, false to leave as is\n disabled: false // The initial disabled state\n\n };\n $.extend(this._defaults, this.regional[\"\"]);\n this.regional.en = $.extend(true, {}, this.regional[\"\"]);\n this.regional[\"en-US\"] = $.extend(true, {}, this.regional.en);\n this.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n }", "title": "" }, { "docid": "0fbb075df8123361807560f839300079", "score": "0.6167576", "text": "function _datePicker(id) {\n\t$(id).datepicker();\n\t$(id).datepicker('option', 'dateFormat', 'yy-mm-ddT00:00:00Z');\n\t$(id).datepicker('option', 'showAnim', 'drop');\n}", "title": "" }, { "docid": "371d1909ac4700f4b63c810e80640657", "score": "0.61638445", "text": "function Datepicker() {\n this.debug = false; // Change this to true to start debugging\n\n this._curInst = null; // The current instance in use\n\n this._keyEvent = false; // If the last event was a key event\n\n this._disabledInputs = []; // List of date picker inputs that have been disabled\n\n this._datepickerShowing = false; // True if the popup picker is showing , false if not\n\n this._inDialog = false; // True if showing within a \"dialog\", false if not\n\n this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\n\n this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\n\n this._appendClass = 'ui-datepicker-append'; // The name of the append marker class\n\n this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\n\n this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\n\n this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\n\n this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\n\n this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\n\n this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\n\n this.regional = []; // Available regional settings, indexed by language code\n\n this.regional[''] = {\n // Default regional settings\n closeText: 'Done',\n // Display text for close link\n prevText: 'Prev',\n // Display text for previous month link\n nextText: 'Next',\n // Display text for next month link\n currentText: 'Today',\n // Display text for current month link\n monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],\n // Names of months for drop-down and formatting\n monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n // For formatting\n dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n // For formatting\n dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n // For formatting\n dayNamesMin: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n // Column headings for days starting at Sunday\n weekHeader: 'Wk',\n // Column header for week of the year\n dateFormat: 'mm/dd/yy',\n // See format options on parseDate\n firstDay: 0,\n // The first day of the week, Sun = 0, Mon = 1, ...\n isRTL: false,\n // True if right-to-left language, false if left-to-right\n showMonthAfterYear: false,\n // True if the year select precedes month, false for month then year\n yearSuffix: '' // Additional text to append to the year in the month headers\n\n };\n this._defaults = {\n // Global defaults for all the date picker instances\n showOn: 'focus',\n // 'focus' for popup on focus,\n // 'button' for trigger button, or 'both' for either\n showAnim: 'fadeIn',\n // Name of jQuery animation for popup\n showOptions: {},\n // Options for enhanced animations\n defaultDate: null,\n // Used when field is blank: actual date,\n // +/-number for offset from today, null for today\n appendText: '',\n // Display text following the input box, e.g. showing the format\n buttonText: '...',\n // Text for trigger button\n buttonImage: '',\n // URL for trigger button image\n buttonImageOnly: false,\n // True if the image appears alone, false if it appears on a button\n hideIfNoPrevNext: false,\n // True to hide next/previous month links\n // if not applicable, false to just disable them\n navigationAsDateFormat: false,\n // True if date formatting applied to prev/today/next links\n gotoCurrent: false,\n // True if today link goes back to current selection instead\n changeMonth: false,\n // True if month can be selected directly, false if only prev/next\n changeYear: false,\n // True if year can be selected directly, false if only prev/next\n yearRange: 'c-10:c+10',\n // Range of years to display in drop-down,\n // either relative to today's year (-nn:+nn), relative to currently displayed year\n // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n showOtherMonths: false,\n // True to show dates in other months, false to leave blank\n selectOtherMonths: false,\n // True to allow selection of dates in other months, false for unselectable\n showWeek: false,\n // True to show week of the year, false to not show it\n calculateWeek: this.iso8601Week,\n // How to calculate the week of the year,\n // takes a Date and returns the number of the week for it\n shortYearCutoff: '+10',\n // Short year values < this are in the current century,\n // > this are in the previous century,\n // string value starting with '+' for current year + value\n minDate: null,\n // The earliest selectable date, or null for no limit\n maxDate: null,\n // The latest selectable date, or null for no limit\n duration: 'fast',\n // Duration of display/closure\n beforeShowDay: null,\n // Function that takes a date and returns an array with\n // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\n // [2] = cell title (optional), e.g. $.datepicker.noWeekends\n beforeShow: null,\n // Function that takes an input field and\n // returns a set of custom settings for the date picker\n onSelect: null,\n // Define a callback function when a date is selected\n onChangeMonthYear: null,\n // Define a callback function when the month or year is changed\n onClose: null,\n // Define a callback function when the datepicker is closed\n numberOfMonths: 1,\n // Number of months to show at a time\n showCurrentAtPos: 0,\n // The position in multipe months at which to show the current month (starting at 0)\n stepMonths: 1,\n // Number of months to step back/forward\n stepBigMonths: 12,\n // Number of months to step back/forward for the big links\n altField: '',\n // Selector for an alternate field to store selected dates into\n altFormat: '',\n // The date format to use for the alternate field\n constrainInput: true,\n // The input is constrained by the current date format\n showButtonPanel: false,\n // True to show button panel, false to not show it\n autoSize: false,\n // True to size the input for the date format, false to leave as is\n disabled: false // The initial disabled state\n\n };\n $.extend(this._defaults, this.regional['']);\n this.dpDiv = bindHover($('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>'));\n }", "title": "" }, { "docid": "4bb19c62331cdf5a12131a6c1d6b33cf", "score": "0.61522627", "text": "function initdatepicker2(){\n Calendar.setup({\n inputField : \"followup2date\",\n ifFormat : \"%d-%b-%y\",\n weekNumbers : false,\n showsTime : false,\n firstDay : 1,\n align : \"tl\",\n showOthers : true \n });\n }", "title": "" }, { "docid": "d4d568ab99958bf4265989c45c4eaf08", "score": "0.6148906", "text": "function tm_set_datepicker( obj ) {\n\t\tvar inputIds;\n\t\tvar elem;\n\t\tvar timepickerSelector = '.tm-epo-timepicker';\n\n\t\tif ( ! $.tm_datepicker ) {\n\t\t\treturn;\n\t\t}\n\n\t\tinputIds = $( 'input' )\n\t\t\t.map( function() {\n\t\t\t\treturn this.id;\n\t\t\t} )\n\t\t\t.get()\n\t\t\t.join( ' ' );\n\n\t\telem = document.createElement( 'input' );\n\t\telem.setAttribute( 'type', 'date' );\n\n\t\tif ( elem.type === 'text' ) {\n\t\t\ttimepickerSelector = '.tm-epo-system-timepicker';\n\t\t}\n\n\t\tobj.find( timepickerSelector )\n\t\t\t.toArray()\n\t\t\t.forEach( function( el ) {\n\t\t\t\tvar field = $( el );\n\t\t\t\tvar _mintime = null;\n\t\t\t\tvar _maxtime = null;\n\t\t\t\tvar format = field.attr( 'data-time-format' ).trim();\n\t\t\t\tvar date_theme = field.attr( 'data-time-theme' ).trim();\n\t\t\t\tvar date_theme_size = field.attr( 'data-time-theme-size' ).trim();\n\t\t\t\tvar date_theme_position = field.attr( 'data-time-theme-position' ).trim();\n\t\t\t\tvar data_tranlation_hour = field.attr( 'data-tranlation-hour' ).trim();\n\t\t\t\tvar data_tranlation_minute = field.attr( 'data-tranlation-minute' ).trim();\n\t\t\t\tvar data_tranlation_second = field.attr( 'data-tranlation-second' ).trim();\n\n\t\t\t\tfield.attr( 'type', 'text' );\n\n\t\t\t\tif ( field.attr( 'data-min-time' ).trim() !== '' ) {\n\t\t\t\t\t_mintime = field.attr( 'data-min-time' ).trim();\n\t\t\t\t}\n\t\t\t\tif ( field.attr( 'data-max-time' ).trim() !== '' ) {\n\t\t\t\t\t_maxtime = field.attr( 'data-max-time' ).trim();\n\t\t\t\t}\n\n\t\t\t\tif ( field.attr( 'data-custom-time-format' ).trim() !== '' ) {\n\t\t\t\t\tformat = field.attr( 'data-custom-time-format' ).trim();\n\t\t\t\t}\n\t\t\t\tif ( ! data_tranlation_hour ) {\n\t\t\t\t\tdata_tranlation_hour = TMEPOJS.hourText;\n\t\t\t\t}\n\t\t\t\tif ( ! data_tranlation_minute ) {\n\t\t\t\t\tdata_tranlation_minute = TMEPOJS.minuteText;\n\t\t\t\t}\n\t\t\t\tif ( ! data_tranlation_second ) {\n\t\t\t\t\tdata_tranlation_second = TMEPOJS.secondText;\n\t\t\t\t}\n\n\t\t\t\tfield.tm_timepicker( {\n\t\t\t\t\tisRTL: TMEPOJS.isRTL,\n\t\t\t\t\thourText: data_tranlation_hour,\n\t\t\t\t\tminuteText: data_tranlation_minute,\n\t\t\t\t\tsecondText: data_tranlation_second,\n\t\t\t\t\ttimeFormat: format,\n\t\t\t\t\tminTime: _mintime,\n\t\t\t\t\tmaxTime: _maxtime,\n\t\t\t\t\tcloseText: TMEPOJS.closeText,\n\t\t\t\t\tshowOn: 'both',\n\t\t\t\t\tbuttonText: '',\n\n\t\t\t\t\tbeforeShow: function( input, inst ) {\n\t\t\t\t\t\t$( inst.dpDiv )\n\t\t\t\t\t\t\t.removeClass( inputIds )\n\t\t\t\t\t\t\t.removeClass( 'tm-ui-skin-epo tm-ui-skin-epo-black tm-datepicker-medium tm-datepicker-small tm-datepicker-large tm-datepicker-normal tm-datepicker-top tm-datepicker-bottom' )\n\t\t\t\t\t\t\t.addClass( this.id + ' tm-bsbb-all tm-ui-skin-' + date_theme + ' tm-timepicker tm-datepicker tm-datepicker-' + date_theme_position + ' tm-datepicker-' + date_theme_size )\n\t\t\t\t\t\t\t.appendTo( 'body' );\n\n\t\t\t\t\t\tjDocument.off( 'click', '.tm-ui-dp-overlay' ).on( 'click', '.tm-ui-dp-overlay', function() {\n\t\t\t\t\t\t\tfield.tm_timepicker( 'hide' );\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tjBody.addClass( 'tm-static' );\n\t\t\t\t\t\tfield.prop( 'readonly', true );\n\n\t\t\t\t\t\tjWindow.trigger( {\n\t\t\t\t\t\t\ttype: 'tm-timepicker-beforeShow',\n\t\t\t\t\t\t\tinput: input,\n\t\t\t\t\t\t\tinst: inst\n\t\t\t\t\t\t} );\n\t\t\t\t\t},\n\t\t\t\t\tonClose: function() {\n\t\t\t\t\t\tjBody.removeClass( 'tm-static' );\n\t\t\t\t\t\tfield.prop( 'readonly', false );\n\t\t\t\t\t\tfield.trigger( 'change' );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\t$( '#ui-tm-datepicker-div' ).hide();\n\t\t\t} );\n\n\t\tobj.find( '.tm-epo-datepicker' )\n\t\t\t.toArray()\n\t\t\t.forEach( function( el ) {\n\t\t\t\tvar field = $( el );\n\t\t\t\tvar startDate = parseInt( field.attr( 'data-start-year' ).trim(), 10 );\n\t\t\t\tvar endDate = parseInt( field.attr( 'data-end-year' ).trim(), 10 );\n\t\t\t\tvar minDate = field.attr( 'data-min-date' ).trim();\n\t\t\t\tvar maxDate = field.attr( 'data-max-date' ).trim();\n\t\t\t\tvar disabled_dates = field.attr( 'data-disabled-dates' ).trim();\n\t\t\t\tvar enabled_only_dates = field.attr( 'data-enabled-only-dates' ).trim();\n\t\t\t\tvar exlude_disabled = field.attr( 'data-exlude-disabled' ).trim();\n\t\t\t\tvar disabled_weekdays = field.attr( 'data-disabled-weekdays' ).trim().split( ',' );\n\t\t\t\tvar disabled_months = field.attr( 'data-disabled-months' ).trim().split( ',' );\n\t\t\t\tvar format = field.attr( 'data-date-format' ).trim();\n\t\t\t\tvar show = field.attr( 'data-date-showon' ).trim();\n\t\t\t\tvar default_date = field.attr( 'data-date-defaultdate' ).trim();\n\t\t\t\tvar date_theme = field.attr( 'data-date-theme' ).trim();\n\t\t\t\tvar date_theme_size = field.attr( 'data-date-theme-size' ).trim();\n\t\t\t\tvar date_theme_position = field.attr( 'data-date-theme-position' ).trim();\n\t\t\t\tvar $split;\n\t\t\t\tvar $index;\n\t\t\t\tvar $split2;\n\t\t\t\tvar $index2;\n\n\t\t\t\tif ( disabled_dates !== '' ) {\n\t\t\t\t\t$split = disabled_dates.split( ',' );\n\t\t\t\t\t$index = disabled_dates.indexOf( ',' );\n\n\t\t\t\t\tif ( $index !== -1 && $split.length > 0 ) {\n\t\t\t\t\t\tdisabled_dates = $split;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( enabled_only_dates !== '' ) {\n\t\t\t\t\t$split2 = enabled_only_dates.split( ',' );\n\t\t\t\t\t$index2 = enabled_only_dates.indexOf( ',' );\n\n\t\t\t\t\tif ( $index2 !== -1 && $split2.length > 0 ) {\n\t\t\t\t\t\tenabled_only_dates = $split2;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( minDate === '' ) {\n\t\t\t\t\tif ( startDate === '' ) {\n\t\t\t\t\t\tminDate = null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tminDate = new Date( startDate, 1 - 1, 1 );\n\t\t\t\t\t}\n\t\t\t\t} else if ( exlude_disabled ) {\n\t\t\t\t\tminDate = correctDate( minDate );\n\t\t\t\t}\n\t\t\t\tif ( maxDate === '' ) {\n\t\t\t\t\tif ( endDate === '' ) {\n\t\t\t\t\t\tmaxDate = null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmaxDate = new Date( endDate, 12 - 1, 31 );\n\t\t\t\t\t}\n\t\t\t\t} else if ( exlude_disabled ) {\n\t\t\t\t\tmaxDate = correctDate( maxDate );\n\t\t\t\t}\n\n\t\t\t\tfield.data( 'tc-enabled_only_dates', enabled_only_dates );\n\t\t\t\tfield.data( 'tc-disabled_weekdays', disabled_weekdays );\n\t\t\t\tfield.data( 'tc-disabled_months', disabled_months );\n\t\t\t\tfield.data( 'tc-disabled_dates', disabled_dates );\n\t\t\t\tfield.data( 'tc-format', format );\n\n\t\t\t\tfield.tm_datepicker( {\n\t\t\t\t\tmonthNames: TMEPOJS.monthNames,\n\t\t\t\t\tmonthNamesShort: TMEPOJS.monthNamesShort,\n\t\t\t\t\tdayNames: TMEPOJS.dayNames,\n\t\t\t\t\tdayNamesShort: TMEPOJS.dayNamesShort,\n\t\t\t\t\tdayNamesMin: TMEPOJS.dayNamesMin,\n\t\t\t\t\tisRTL: TMEPOJS.isRTL,\n\t\t\t\t\tshowOtherMonths: true,\n\t\t\t\t\tselectOtherMonths: true,\n\t\t\t\t\tshowOn: show,\n\t\t\t\t\tdefaultDate: default_date,\n\t\t\t\t\tbuttonText: '',\n\t\t\t\t\tshowButtonPanel: true,\n\t\t\t\t\tfirstDay: TMEPOJS.first_day,\n\t\t\t\t\tcloseText: TMEPOJS.closeText,\n\t\t\t\t\tcurrentText: TMEPOJS.currentText,\n\t\t\t\t\tdateFormat: format,\n\t\t\t\t\tminDate: minDate,\n\t\t\t\t\tmaxDate: maxDate,\n\t\t\t\t\tonSelect: function() {\n\t\t\t\t\t\tvar input = $( this );\n\t\t\t\t\t\tvar id = '#' + $.epoAPI.dom.id( input.attr( 'id' ) );\n\t\t\t\t\t\tvar date = input.tm_datepicker( 'getDate' );\n\t\t\t\t\t\tvar day = '';\n\t\t\t\t\t\tvar month = '';\n\t\t\t\t\t\tvar year = '';\n\t\t\t\t\t\tvar day_field = obj.find( id + '_day' );\n\t\t\t\t\t\tvar month_field = obj.find( id + '_month' );\n\t\t\t\t\t\tvar year_field = obj.find( id + '_year' );\n\t\t\t\t\t\tvar string;\n\t\t\t\t\t\tvar ld;\n\n\t\t\t\t\t\tif ( date ) {\n\t\t\t\t\t\t\tday = date.getDate();\n\t\t\t\t\t\t\tmonth = date.getMonth() + 1;\n\t\t\t\t\t\t\tyear = date.getFullYear();\n\t\t\t\t\t\t\tstring = $.tm_datepicker.formatDate( format, date );\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tdisabled_months.indexOf( month.toString() ) !== -1 ||\n\t\t\t\t\t\t\t\tdisabled_weekdays.indexOf( date.getDay().toString() ) !== -1 ||\n\t\t\t\t\t\t\t\tdisabled_dates.indexOf( string ) !== -1 ||\n\t\t\t\t\t\t\t\t( enabled_only_dates !== '' && enabled_only_dates.indexOf( string ) === -1 )\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tld = input.data( 'tm-last-date' );\n\t\t\t\t\t\t\t\tif ( input.data( 'tm-last-date' ) ) {\n\t\t\t\t\t\t\t\t\tld = input.data( 'tm-last-date' );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tld = '';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tinput.val( ld );\n\t\t\t\t\t\t\t\tinput.tm_datepicker( 'setDate', ld );\n\t\t\t\t\t\t\t\tif ( ld ) {\n\t\t\t\t\t\t\t\t\tdate = input.tm_datepicker( 'getDate' );\n\t\t\t\t\t\t\t\t\tday = date.getDate();\n\t\t\t\t\t\t\t\t\tmonth = date.getMonth() + 1;\n\t\t\t\t\t\t\t\t\tyear = date.getFullYear();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tday = '';\n\t\t\t\t\t\t\t\t\tmonth = '';\n\t\t\t\t\t\t\t\t\tyear = '';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tday_field.val( day );\n\t\t\t\t\t\tmonth_field.val( month );\n\t\t\t\t\t\tyear_field.val( year );\n\n\t\t\t\t\t\tinput.data( 'tm-last-date', input.val() );\n\t\t\t\t\t},\n\t\t\t\t\tbeforeShow: function( input, inst ) {\n\t\t\t\t\t\t$( inst.dpDiv )\n\t\t\t\t\t\t\t.removeClass( inputIds )\n\t\t\t\t\t\t\t.removeClass( 'tm-datepicker-normal tm-datepicker-top tm-datepicker-bottom' )\n\t\t\t\t\t\t\t.addClass( this.id + ' tm-bsbb-all tm-ui-skin-' + date_theme + ' tm-datepicker tm-datepicker-' + date_theme_position + ' tm-datepicker-' + date_theme_size )\n\t\t\t\t\t\t\t.appendTo( 'body' );\n\n\t\t\t\t\t\tjDocument.off( 'click', '.tm-ui-dp-overlay' ).on( 'click', '.tm-ui-dp-overlay', function() {\n\t\t\t\t\t\t\tfield.tm_datepicker( 'hide' );\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tjDocument.off( 'click', '.ui-tm-datepicker-current' ).on( 'click', '.ui-tm-datepicker-current', function() {\n\t\t\t\t\t\t\tvar tempDate = new Date(),\n\t\t\t\t\t\t\t\ttoday = $.tm_datepicker._daylightSavingAdjust( new Date( tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate() ) );\n\t\t\t\t\t\t\tvar day = today.getDay();\n\t\t\t\t\t\t\tvar month = today.getMonth() + 1;\n\t\t\t\t\t\t\tvar id = '#' + inst.id.replace( /\\\\\\\\/g, '\\\\' );\n\t\t\t\t\t\t\tvar check = false;\n\t\t\t\t\t\t\tvar string;\n\t\t\t\t\t\t\tvar date = field.tm_datepicker( 'getDate' );\n\n\t\t\t\t\t\t\tif ( enabled_only_dates !== '' ) {\n\t\t\t\t\t\t\t\tstring = $.tm_datepicker.formatDate( format, date );\n\t\t\t\t\t\t\t\tcheck = enabled_only_dates.indexOf( string ) !== -1;\n\t\t\t\t\t\t\t} else if ( disabled_months.indexOf( month.toString() ) !== -1 || disabled_weekdays.indexOf( day.toString() ) !== -1 ) {\n\t\t\t\t\t\t\t\tcheck = false;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif ( disabled_dates !== '' ) {\n\t\t\t\t\t\t\t\t\tstring = $.tm_datepicker.formatDate( format, date );\n\t\t\t\t\t\t\t\t\treturn [ disabled_dates.indexOf( string ) === -1, '' ];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcheck = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif ( check ) {\n\t\t\t\t\t\t\t\t$.tm_datepicker._setDate( inst, today );\n\t\t\t\t\t\t\t\t$.tm_datepicker._gotoToday( id );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tjBody.addClass( 'tm-static' );\n\t\t\t\t\t\tfield.prop( 'readonly', true );\n\n\t\t\t\t\t\tjWindow.trigger( {\n\t\t\t\t\t\t\ttype: 'tm-datepicker-beforeShow',\n\t\t\t\t\t\t\tinput: input,\n\t\t\t\t\t\t\tinst: inst\n\t\t\t\t\t\t} );\n\t\t\t\t\t},\n\t\t\t\t\tonClose: function() {\n\t\t\t\t\t\tjBody.removeClass( 'tm-static' );\n\t\t\t\t\t\tfield.prop( 'readonly', false );\n\t\t\t\t\t\tfield.removeAttr( 'readonly' );\n\t\t\t\t\t\tfield.trigger( 'change' );\n\t\t\t\t\t},\n\t\t\t\t\tbeforeShowDay: function( date ) {\n\t\t\t\t\t\tvar day = date.getDay();\n\t\t\t\t\t\tvar month = date.getMonth() + 1;\n\t\t\t\t\t\tvar string;\n\n\t\t\t\t\t\tif ( enabled_only_dates !== '' ) {\n\t\t\t\t\t\t\tstring = $.tm_datepicker.formatDate( format, date );\n\t\t\t\t\t\t\treturn [ enabled_only_dates.indexOf( string ) !== -1, '' ];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( disabled_months.indexOf( month.toString() ) !== -1 || disabled_weekdays.indexOf( day.toString() ) !== -1 ) {\n\t\t\t\t\t\t\treturn [ false, '' ];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( disabled_dates !== '' ) {\n\t\t\t\t\t\t\tstring = $.tm_datepicker.formatDate( format, date );\n\t\t\t\t\t\t\treturn [ disabled_dates.indexOf( string ) === -1, '' ];\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn [ true, '' ];\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\t$( '#ui-tm-datepicker-div' ).hide();\n\t\t\t} );\n\n\t\tobj.find( '.tmcp-date-select' )\n\t\t\t.on( 'change.cpf', function() {\n\t\t\t\tvar id = '#' + $.epoAPI.dom.id( $( this ).attr( 'data-tm-date' ) );\n\t\t\t\tvar input = obj.find( id );\n\t\t\t\tvar format = input.attr( 'data-date-format' );\n\t\t\t\tvar day = obj.find( id + '_day' ).val();\n\t\t\t\tvar month = obj.find( id + '_month' ).val();\n\t\t\t\tvar year = obj.find( id + '_year' ).val();\n\t\t\t\tvar dateFormat = $.tm_datepicker.formatDate( format, new Date( year, parseInt( month, 10 ) - 1, day ) );\n\n\t\t\t\tif ( day > 0 && month > 0 && year > 0 ) {\n\t\t\t\t\tinput.tm_datepicker( 'setDate', dateFormat );\n\t\t\t\t\tinput.trigger( 'change' );\n\t\t\t\t} else {\n\t\t\t\t\tinput.val( '' );\n\t\t\t\t\tinput.trigger( 'change.cpf' );\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.on( 'focus.cpf', function() {\n\t\t\t\tvar id = '#' + $.epoAPI.dom.id( $( this ).attr( 'data-tm-date' ) );\n\t\t\t\tvar input = obj.find( id );\n\t\t\t\tvar day_select = obj.find( id + '_day' );\n\t\t\t\tvar month_select = obj.find( id + '_month' );\n\t\t\t\tvar year_select = obj.find( id + '_year' );\n\t\t\t\tvar day = day_select.val();\n\t\t\t\tvar month = month_select.val();\n\t\t\t\tvar year = year_select.val();\n\t\t\t\tvar _select = $( this );\n\n\t\t\t\tif ( ( year !== '' && month !== '' && day !== '' ) || ( year !== '' && month !== '' && day === '' ) || ( day !== '' && year !== '' && month === '' ) || ( day !== '' && month !== '' && year === '' ) ) {\n\t\t\t\t\t_select\n\t\t\t\t\t\t.find( 'option' )\n\t\t\t\t\t\t.toArray()\n\t\t\t\t\t\t.forEach( function( element ) {\n\t\t\t\t\t\t\tvar option = $( element );\n\t\t\t\t\t\t\tvar val = option.val();\n\t\t\t\t\t\t\tvar date_string = year + '-' + month + '-' + day;\n\t\t\t\t\t\t\tvar d;\n\n\t\t\t\t\t\t\tif ( _select.is( '.tmcp-date-day' ) ) {\n\t\t\t\t\t\t\t\tif ( year === '' || month === '' ) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdate_string = year + '-' + month + '-' + val;\n\t\t\t\t\t\t\t} else if ( _select.is( '.tmcp-date-month' ) ) {\n\t\t\t\t\t\t\t\tif ( year === '' || day === '' ) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdate_string = year + '-' + val + '-' + day;\n\t\t\t\t\t\t\t} else if ( _select.is( '.tmcp-date-year' ) ) {\n\t\t\t\t\t\t\t\tif ( day === '' || month === '' ) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdate_string = val + '-' + month + '-' + day;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( val !== '' ) {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\td = $.tm_datepicker.parseDate( 'yy-mm-dd', date_string );\n\t\t\t\t\t\t\t\t\tif ( d ) {\n\t\t\t\t\t\t\t\t\t\tif ( validate_date_with_options( d, input ) ) {\n\t\t\t\t\t\t\t\t\t\t\toption.prop( 'disabled', false );\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\toption.prop( 'disabled', true );\n\t\t\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} catch ( err ) {\n\t\t\t\t\t\t\t\t\twindow.console.log( err );\n\n\t\t\t\t\t\t\t\t\toption.prop( 'disabled', true );\n\t\t\t\t\t\t\t\t\terrorObject = err;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\tday_select.find( 'option' ).prop( 'disabled', false );\n\t\t\t\t\tmonth_select.find( 'option' ).prop( 'disabled', false );\n\t\t\t\t\tyear_select.find( 'option' ).prop( 'disabled', false );\n\t\t\t\t}\n\t\t\t} );\n\n\t\tjWindow.on( 'resizestart', function() {\n\t\t\tvar activeElement = $( document.activeElement );\n\n\t\t\tif ( activeElement.is( '.hasDatepicker' ) ) {\n\t\t\t\tactiveElement.data( 'resizestarted', true );\n\n\t\t\t\t// we don't use jWindow here because we want the current window width\n\t\t\t\tif ( $( window ).width() < 768 ) {\n\t\t\t\t\tactiveElement.data( 'resizewidth', true );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tactiveElement.tm_datepicker( 'hide' );\n\t\t\t}\n\t\t} );\n\t\tjWindow.on( 'resizestop', function() {\n\t\t\tvar activeElement = $( document.activeElement );\n\n\t\t\tif ( activeElement.is( '.hasDatepicker' ) && activeElement.data( 'resizestarted' ) ) {\n\t\t\t\tif ( activeElement.data( 'resizewidth' ) ) {\n\t\t\t\t\tactiveElement.tm_datepicker( 'hide' );\n\t\t\t\t}\n\t\t\t\tactiveElement.tm_datepicker( 'show' );\n\t\t\t}\n\t\t\tactiveElement.data( 'resizestarted', false );\n\t\t\tactiveElement.data( 'resizewidth', false );\n\t\t} );\n\t}", "title": "" }, { "docid": "394aaf66e98081507cd613cdcb7f46f1", "score": "0.61421674", "text": "function initDatepickerInline(){\n $('#datepicker-inline').datepicker({\n language: \"es\",\n todayHighlight: true,\n todayBtn: true,\n startDate: new Date(1900,01,01),\n title: 'Fecha de Consulta',\n });\n}", "title": "" }, { "docid": "9a7f724120408d2d242c100b05d81d75", "score": "0.613914", "text": "autocomplete() {\n\n $(\"#inputStartDate\").on(\"dp.change\", function (e) {\n $('#inputEndDate').data(\"DateTimePicker\").minDate(e.date);\n });\n $(\"#inputEndDate\").on(\"dp.change\", function (e) {\n $('#inputStartDate').data(\"DateTimePicker\").maxDate(e.date);\n });\n\n }", "title": "" }, { "docid": "9a89b4cda3eeef82d86fb6404461fa86", "score": "0.6134882", "text": "function Datepicker() {\r\n this.debug = false; // Change this to true to start debugging\r\n this._curInst = null; // The current instance in use\r\n this._keyEvent = false; // If the last event was a key event\r\n this._disabledInputs = []; // List of date picker inputs that have been disabled\r\n this._datepickerShowing = false; // True if the popup picker is showing , false if not\r\n this._inDialog = false; // True if showing within a \"dialog\", false if not\r\n this._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\r\n this._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\r\n this._appendClass = 'ui-datepicker-append'; // The name of the append marker class\r\n this._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\r\n this._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\r\n this._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\r\n this._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\r\n this._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\r\n this._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\r\n this.regional = []; // Available regional settings, indexed by language code\r\n this.regional[''] = { // Default regional settings\r\n closeText: 'Done', // Display text for close link\r\n prevText: 'Prev', // Display text for previous month link\r\n nextText: 'Next', // Display text for next month link\r\n currentText: 'Today', // Display text for current month link\r\n monthNames: ['January','February','March','April','May','June',\r\n 'July','August','September','October','November','December'], // Names of months for drop-down and formatting\r\n monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\r\n dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\r\n dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\r\n dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\r\n weekHeader: 'Wk', // Column header for week of the year\r\n dateFormat: 'mm/dd/yy', // See format options on parseDate\r\n firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\r\n isRTL: false, // True if right-to-left language, false if left-to-right\r\n showMonthAfterYear: false, // True if the year select precedes month, false for month then year\r\n yearSuffix: '' // Additional text to append to the year in the month headers\r\n };\r\n this._defaults = { // Global defaults for all the date picker instances\r\n showOn: 'focus', // 'focus' for popup on focus,\r\n // 'button' for trigger button, or 'both' for either\r\n showAnim: 'fadeIn', // Name of jQuery animation for popup\r\n showOptions: {}, // Options for enhanced animations\r\n defaultDate: null, // Used when field is blank: actual date,\r\n // +/-number for offset from today, null for today\r\n appendText: '', // Display text following the input box, e.g. showing the format\r\n buttonText: '...', // Text for trigger button\r\n buttonImage: '', // URL for trigger button image\r\n buttonImageOnly: false, // True if the image appears alone, false if it appears on a button\r\n hideIfNoPrevNext: false, // True to hide next/previous month links\r\n // if not applicable, false to just disable them\r\n navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\r\n gotoCurrent: false, // True if today link goes back to current selection instead\r\n changeMonth: false, // True if month can be selected directly, false if only prev/next\r\n changeYear: false, // True if year can be selected directly, false if only prev/next\r\n yearRange: 'c-10:c+10', // Range of years to display in drop-down,\r\n // either relative to today's year (-nn:+nn), relative to currently displayed year\r\n // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\r\n showOtherMonths: false, // True to show dates in other months, false to leave blank\r\n selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\r\n showWeek: false, // True to show week of the year, false to not show it\r\n calculateWeek: this.iso8601Week, // How to calculate the week of the year,\r\n // takes a Date and returns the number of the week for it\r\n shortYearCutoff: '+10', // Short year values < this are in the current century,\r\n // > this are in the previous century,\r\n // string value starting with '+' for current year + value\r\n minDate: null, // The earliest selectable date, or null for no limit\r\n maxDate: null, // The latest selectable date, or null for no limit\r\n duration: 'fast', // Duration of display/closure\r\n beforeShowDay: null, // Function that takes a date and returns an array with\r\n // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\r\n // [2] = cell title (optional), e.g. $.datepicker.noWeekends\r\n beforeShow: null, // Function that takes an input field and\r\n // returns a set of custom settings for the date picker\r\n onSelect: null, // Define a callback function when a date is selected\r\n onChangeMonthYear: null, // Define a callback function when the month or year is changed\r\n onClose: null, // Define a callback function when the datepicker is closed\r\n numberOfMonths: 1, // Number of months to show at a time\r\n showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\r\n stepMonths: 1, // Number of months to step back/forward\r\n stepBigMonths: 12, // Number of months to step back/forward for the big links\r\n altField: '', // Selector for an alternate field to store selected dates into\r\n altFormat: '', // The date format to use for the alternate field\r\n constrainInput: true, // The input is constrained by the current date format\r\n showButtonPanel: false, // True to show button panel, false to not show it\r\n autoSize: false, // True to size the input for the date format, false to leave as is\r\n disabled: false // The initial disabled state\r\n };\r\n $.extend(this._defaults, this.regional['']);\r\n this.dpDiv = bindHover($('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>'));\r\n}", "title": "" }, { "docid": "bbc460cb0915f88e58481eb49a7184a4", "score": "0.6106624", "text": "function loadDatePipe(){\n \t$('#orderDate').mask(\"99/99/9999\");\n\t\t$('#deliveryDate').mask(\"99/99/9999\");\n\t\t$(\"#orderDate\").on(\"dp.change\", function (e) {\n $('#deliveryDate').data(\"DateTimePicker\").setMinDate(e.date);\n });\n $(\"#deliveryDate\").on(\"dp.change\", function (e) {\n $('#orderDate').data(\"DateTimePicker\").setMaxDate(e.date);\n });\n }", "title": "" }, { "docid": "c0ed0663f3f3412b70e68ecec72cf39f", "score": "0.60968894", "text": "function birthDatepickerInitializer() {\n\n\t$('.datepickerBirthday').pickadate({\n\t\t\tselectMonths: true, \n\t\t labelMonthNext: 'Mois suivant',\n\t\t \tlabelMonthPrev: 'Mois précédent',\n\t\t \tlabelMonthSelect: 'Choisir un mois',\n\t\t labelYearSelect: 'Choisir une année',\n\t\t monthsFull: [ 'Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre' ],\n\t\t monthsShort: [ 'Jan', 'Fev', 'Mar', 'Avr', 'Mai', 'Juin', 'Juil', 'Aoû', 'Sep', 'Oct', 'Nov', 'Dec' ],\n\t\t weekdaysFull: [ 'Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi' ],\n\t\t weekdaysShort: [ 'Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam' ],\n\t\t weekdaysLetter: [ 'D', 'L', 'Ma', 'Me', 'J', 'V', 'S' ],\n\t\t clear: 'Effacer',\n\t\t close: 'Ok',\n\t\t format: 'dddd dd mmmm yyyy',\n\t\t formatSubmit: 'dd-mm-yyyy',\n\t\t \thiddenName: true,\n\t\t \tfirstDay: 1,\n\t\t closeOnSelect: false,\n\t\t\tselectYears : 100,\n\t\t\ttoday : \"\",\n\t\t\tmax : true\n\t\t});\n\n}", "title": "" }, { "docid": "a0c65ef9a8d3b2440580f5045ac61a90", "score": "0.6088768", "text": "function DatePicker(options, element) {\n var _this = _super.call(this, options, element) || this;\n _this.previousElementValue = '';\n _this.isDateIconClicked = false;\n _this.isAltKeyPressed = false;\n _this.invalidValueString = null;\n _this.checkPreviousValue = null;\n _this.keyConfigs = {\n altUpArrow: 'alt+uparrow',\n altDownArrow: 'alt+downarrow',\n escape: 'escape',\n enter: 'enter',\n controlUp: 'ctrl+38',\n controlDown: 'ctrl+40',\n moveDown: 'downarrow',\n moveUp: 'uparrow',\n moveLeft: 'leftarrow',\n moveRight: 'rightarrow',\n select: 'enter',\n home: 'home',\n end: 'end',\n pageUp: 'pageup',\n pageDown: 'pagedown',\n shiftPageUp: 'shift+pageup',\n shiftPageDown: 'shift+pagedown',\n controlHome: 'ctrl+home',\n controlEnd: 'ctrl+end',\n tab: 'tab'\n };\n _this.calendarKeyConfigs = {\n escape: 'escape',\n enter: 'enter',\n tab: 'tab'\n };\n return _this;\n }", "title": "" }, { "docid": "d0230c46f518c9edf2bbb741387e2459", "score": "0.60861754", "text": "function attachFormDatepicker(){\n $( \".form-datepicker\" ).datepicker({\n showOn: \"button\",\n buttonImage: \"../rx_resources/widgets/form/images/calendar.gif\",\n dateFormat: \"d M, yy\",\n buttonImageOnly: true,\n buttonText: \"\"\n });\n }", "title": "" }, { "docid": "9824040ac4962d9e8da8cde299bbc8dc", "score": "0.60826063", "text": "function Datepicker() {\r\n\tthis.debug = false; // Change this to true to start debugging\r\n\tthis._curInst = null; // The current instance in use\r\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\r\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\r\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\r\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\r\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\r\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\r\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\r\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\r\n\tthis._promptClass = 'ui-datepicker-prompt'; // The name of the dialog prompt marker class\r\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\r\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\r\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\r\n\tthis.regional = []; // Available regional settings, indexed by language code\r\n\tthis.regional[''] = { // Default regional settings\r\n\t\tclearText: 'Clear', // Display text for clear link\r\n\t\tclearStatus: 'Erase the current date', // Status text for clear link\r\n\t\tcloseText: 'Close', // Display text for close link\r\n\t\tcloseStatus: 'Close without change', // Status text for close link\r\n\t\tprevText: '&#x3c;Prev', // Display text for previous month link\r\n\t\tprevStatus: 'Show the previous month', // Status text for previous month link\r\n\t\tprevBigText: '&#x3c;&#x3c;', // Display text for previous year link\r\n\t\tprevBigStatus: 'Show the previous year', // Status text for previous year link\r\n\t\tnextText: 'Next&#x3e;', // Display text for next month link\r\n\t\tnextStatus: 'Show the next month', // Status text for next month link\r\n\t\tnextBigText: '&#x3e;&#x3e;', // Display text for next year link\r\n\t\tnextBigStatus: 'Show the next year', // Status text for next year link\r\n\t\tcurrentText: 'Today', // Display text for current month link\r\n\t\tcurrentStatus: 'Show the current month', // Status text for current month link\r\n\t\tmonthNames: ['January','February','March','April','May','June',\r\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\r\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\r\n\t\tmonthStatus: 'Show a different month', // Status text for selecting a month\r\n\t\tyearStatus: 'Show a different year', // Status text for selecting a year\r\n\t\tweekHeader: 'Wk', // Header for the week of the year column\r\n\t\tweekStatus: 'Week of the year', // Status text for the week of the year column\r\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\r\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\r\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\r\n\t\tdayStatus: 'Set DD as first week day', // Status text for the day of the week selection\r\n\t\tdateStatus: 'Select DD, M d', // Status text for the date selection\r\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\r\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\r\n\t\tinitStatus: 'Select a date', // Initial Status text on opening\r\n\t\tisRTL: false // True if right-to-left language, false if left-to-right\r\n\t};\r\n\tthis._defaults = { // Global defaults for all the date picker instances\r\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\r\n\t\t\t// 'button' for trigger button, or 'both' for either\r\n\t\tshowAnim: 'show', // Name of jQuery animation for popup\r\n\t\tshowOptions: {}, // Options for enhanced animations\r\n\t\tdefaultDate: null, // Used when field is blank: actual date,\r\n\t\t\t// +/-number for offset from today, null for today\r\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\r\n\t\tbuttonText: '...', // Text for trigger button\r\n\t\tbuttonImage: '', // URL for trigger button image\r\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\r\n\t\tcloseAtTop: true, // True to have the clear/close at the top,\r\n\t\t\t// false to have them at the bottom\r\n\t\tmandatory: false, // True to hide the Clear link, false to include it\r\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\r\n\t\t\t// if not applicable, false to just disable them\r\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\r\n\t\tshowBigPrevNext: false, // True to show big prev/next links\r\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\r\n\t\tchangeMonth: true, // True if month can be selected directly, false if only prev/next\r\n\t\tchangeYear: true, // True if year can be selected directly, false if only prev/next\r\n\t\tmonthAfterYear: false, // True if the year select precedes month, false for month then year\r\n\t\tyearRange: '-10:+10', // Range of years to display in drop-down,\r\n\t\t\t// either relative to current year (-nn:+nn) or absolute (nnnn:nnnn)\r\n\t\tchangeFirstDay: true, // True to click on day name to change, false to remain as set\r\n\t\thighlightWeek: false, // True to highlight the selected week\r\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\r\n\t\tshowWeeks: false, // True to show week of the year, false to omit\r\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\r\n\t\t\t// takes a Date and returns the number of the week for it\r\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\r\n\t\t\t// > this are in the previous century, \r\n\t\t\t// string value starting with '+' for current year + value\r\n\t\tshowStatus: false, // True to show status bar at bottom, false to not show it\r\n\t\tstatusForDate: this.dateStatus, // Function to provide status text for a date -\r\n\t\t\t// takes date and instance as parameters, returns display text\r\n\t\tminDate: null, // The earliest selectable date, or null for no limit\r\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\r\n\t\tduration: 'normal', // Duration of display/closure\r\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\r\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '', \r\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\r\n\t\tbeforeShow: null, // Function that takes an input field and\r\n\t\t\t// returns a set of custom settings for the date picker\r\n\t\tonSelect: null, // Define a callback function when a date is selected\r\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\r\n\t\tonClose: null, // Define a callback function when the datepicker is closed\r\n\t\tnumberOfMonths: 1, // Number of months to show at a time\r\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\r\n\t\tstepMonths: 1, // Number of months to step back/forward\r\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\r\n\t\trangeSelect: false, // Allows for selecting a date range on one date picker\r\n\t\trangeSeparator: ' - ', // Text between two dates in a range\r\n\t\taltField: '', // Selector for an alternate field to store selected dates into\r\n\t\taltFormat: '' // The date format to use for the alternate field\r\n\t};\r\n\t$.extend(this._defaults, this.regional['']);\r\n\tthis.dpDiv = $('<div id=\"' + this._mainDivId + '\" style=\"display: none;\"></div>');\r\n}", "title": "" }, { "docid": "1e8ac3b2c05b1e54ba8581e859b1cfe5", "score": "0.60732", "text": "function iniciarCamposFechas() {\n if (!$(\"#txtfechaventa\").val()) {\n setFechaDatePicker('txtfechaventa');\n }\n}", "title": "" }, { "docid": "a8422cae7f3a1a0dab826d60a725c08d", "score": "0.6071134", "text": "function mUNewsInitDateField(fieldName) {\n jQuery('#' + fieldName + 'ResetVal').click(function (event) {\n event.preventDefault();\n if ('DIV' == jQuery('#' + fieldName).prop('tagName')) {\n jQuery('#' + fieldName + '_date, #' + fieldName + '_time').val('');\n } else {\n jQuery('#' + fieldName + ', #' + fieldName + '').val('');\n }\n }).removeClass('d-none');\n}", "title": "" }, { "docid": "b3254b2b90105b9c47395a97a815d30f", "score": "0.6060939", "text": "function Datepicker() {\n\t\t\tthis._curInst = null; // The current instance in use\n\t\t\tthis._keyEvent = false; // If the last event was a key event\n\t\t\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\t\t\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\t\t\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\t\t\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\t\t\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\t\t\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\t\t\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\t\t\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\t\t\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\t\t\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\t\t\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\t\t\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\t\t\tthis.regional = []; // Available regional settings, indexed by language code\n\t\t\tthis.regional[\"\"] = { // Default regional settings\n\t\t\t\tcloseText: \"Done\", // Display text for close link\n\t\t\t\tprevText: \"Prev\", // Display text for previous month link\n\t\t\t\tnextText: \"Next\", // Display text for next month link\n\t\t\t\tcurrentText: \"Today\", // Display text for current month link\n\t\t\t\tmonthNames: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"], // Names of months for drop-down and formatting\n\t\t\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\t\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\t\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\t\t\tdayNamesMin: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"], // Column headings for days starting at Sunday\n\t\t\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\t\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\t\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\t\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\t\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\t\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t\t\t};\n\t\t\tthis._defaults = { // Global defaults for all the date picker instances\n\t\t\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\t\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\t\t\tshowOptions: {}, // Options for enhanced animations\n\t\t\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t\t// +/-number for offset from today, null for today\n\t\t\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\t\t\tbuttonText: \"...\", // Text for trigger button\n\t\t\t\tbuttonImage: \"\", // URL for trigger button image\n\t\t\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\t\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t\t// if not applicable, false to just disable them\n\t\t\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\t\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\t\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\t\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\t\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\t\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\t\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\t\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\t\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t\t// takes a Date and returns the number of the week for it\n\t\t\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t\t// > this are in the previous century,\n\t\t\t\t// string value starting with \"+\" for current year + value\n\t\t\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\t\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\t\t\tduration: \"fast\", // Duration of display/closure\n\t\t\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\t\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t\t// returns a set of custom settings for the date picker\n\t\t\t\tonSelect: null, // Define a callback function when a date is selected\n\t\t\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\t\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\t\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\t\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\t\t\tstepMonths: 1, // Number of months to step back/forward\n\t\t\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\t\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\t\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\t\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\t\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\t\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\t\t\tdisabled: false // The initial disabled state\n\t\t\t};\n\t\t\t$.extend(this._defaults, this.regional[\"\"]);\n\t\t\tthis.regional.en = $.extend(true, {}, this.regional[\"\"]);\n\t\t\tthis.regional[\"en-US\"] = $.extend(true, {}, this.regional.en);\n\t\t\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n\t\t}", "title": "" }, { "docid": "3a43c4b7d2d618c43520cceaf13e46fb", "score": "0.60455143", "text": "function Datepicker() {\n this._curInst = null; // The current instance in use\n this._keyEvent = false; // If the last event was a key event\n this._disabledInputs = []; // List of date picker inputs that have been disabled\n this._datepickerShowing = false; // True if the popup picker is showing , false if not\n this._inDialog = false; // True if showing within a \"dialog\", false if not\n this._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n this._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n this._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n this._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n this._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n this._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n this._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n this._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n this._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n this.regional = []; // Available regional settings, indexed by language code\n this.regional[\"\"] = { // Default regional settings\n closeText: \"Done\", // Display text for close link\n prevText: \"Prev\", // Display text for previous month link\n nextText: \"Next\", // Display text for next month link\n currentText: \"Today\", // Display text for current month link\n monthNames: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\",\n \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"], // Names of months for drop-down and formatting\n monthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n dayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n dayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n dayNamesMin: [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"], // Column headings for days starting at Sunday\n weekHeader: \"Wk\", // Column header for week of the year\n dateFormat: \"mm/dd/yy\", // See format options on parseDate\n firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n isRTL: false, // True if right-to-left language, false if left-to-right\n showMonthAfterYear: false, // True if the year select precedes month, false for month then year\n yearSuffix: \"\" // Additional text to append to the year in the month headers\n };\n this._defaults = { // Global defaults for all the date picker instances\n showOn: \"focus\", // \"focus\" for popup on focus,\n // \"button\" for trigger button, or \"both\" for either\n showAnim: \"fadeIn\", // Name of jQuery animation for popup\n showOptions: {}, // Options for enhanced animations\n defaultDate: null, // Used when field is blank: actual date,\n // +/-number for offset from today, null for today\n appendText: \"\", // Display text following the input box, e.g. showing the format\n buttonText: \"...\", // Text for trigger button\n buttonImage: \"\", // URL for trigger button image\n buttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n hideIfNoPrevNext: false, // True to hide next/previous month links\n // if not applicable, false to just disable them\n navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n gotoCurrent: false, // True if today link goes back to current selection instead\n changeMonth: false, // True if month can be selected directly, false if only prev/next\n changeYear: false, // True if year can be selected directly, false if only prev/next\n yearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n // either relative to today's year (-nn:+nn), relative to currently displayed year\n // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n showOtherMonths: false, // True to show dates in other months, false to leave blank\n selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n showWeek: false, // True to show week of the year, false to not show it\n calculateWeek: this.iso8601Week, // How to calculate the week of the year,\n // takes a Date and returns the number of the week for it\n shortYearCutoff: \"+10\", // Short year values < this are in the current century,\n // > this are in the previous century,\n // string value starting with \"+\" for current year + value\n minDate: null, // The earliest selectable date, or null for no limit\n maxDate: null, // The latest selectable date, or null for no limit\n duration: \"fast\", // Duration of display/closure\n beforeShowDay: null, // Function that takes a date and returns an array with\n // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n // [2] = cell title (optional), e.g. $.datepicker.noWeekends\n beforeShow: null, // Function that takes an input field and\n // returns a set of custom settings for the date picker\n onSelect: null, // Define a callback function when a date is selected\n onChangeMonthYear: null, // Define a callback function when the month or year is changed\n onClose: null, // Define a callback function when the datepicker is closed\n numberOfMonths: 1, // Number of months to show at a time\n showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n stepMonths: 1, // Number of months to step back/forward\n stepBigMonths: 12, // Number of months to step back/forward for the big links\n altField: \"\", // Selector for an alternate field to store selected dates into\n altFormat: \"\", // The date format to use for the alternate field\n constrainInput: true, // The input is constrained by the current date format\n showButtonPanel: false, // True to show button panel, false to not show it\n autoSize: false, // True to size the input for the date format, false to leave as is\n disabled: false // The initial disabled state\n };\n $.extend(this._defaults, this.regional[\"\"]);\n this.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n }", "title": "" }, { "docid": "92b9e23022000a6e18bcf3507457c67b", "score": "0.60443676", "text": "function Datepicker() {\r\n this._curInst = null; // The current instance in use\r\n this._keyEvent = false; // If the last event was a key event\r\n this._disabledInputs = []; // List of date picker inputs that have been disabled\r\n this._datepickerShowing = false; // True if the popup picker is showing , false if not\r\n this._inDialog = false; // True if showing within a \"dialog\", false if not\r\n this._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\r\n this._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\r\n this._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\r\n this._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\r\n this._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\r\n this._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\r\n this._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\r\n this._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\r\n this._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\r\n this.regional = []; // Available regional settings, indexed by language code\r\n this.regional[\"\"] = { // Default regional settings\r\n closeText: \"Done\", // Display text for close link\r\n prevText: \"Prev\", // Display text for previous month link\r\n nextText: \"Next\", // Display text for next month link\r\n currentText: \"Today\", // Display text for current month link\r\n monthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\r\n \"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\r\n monthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\r\n dayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\r\n dayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\r\n dayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\r\n weekHeader: \"Wk\", // Column header for week of the year\r\n dateFormat: \"mm/dd/yy\", // See format options on parseDate\r\n firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\r\n isRTL: false, // True if right-to-left language, false if left-to-right\r\n showMonthAfterYear: false, // True if the year select precedes month, false for month then year\r\n yearSuffix: \"\" // Additional text to append to the year in the month headers\r\n };\r\n this._defaults = { // Global defaults for all the date picker instances\r\n showOn: \"focus\", // \"focus\" for popup on focus,\r\n // \"button\" for trigger button, or \"both\" for either\r\n showAnim: \"fadeIn\", // Name of jQuery animation for popup\r\n showOptions: {}, // Options for enhanced animations\r\n defaultDate: null, // Used when field is blank: actual date,\r\n // +/-number for offset from today, null for today\r\n appendText: \"\", // Display text following the input box, e.g. showing the format\r\n buttonText: \"...\", // Text for trigger button\r\n buttonImage: \"\", // URL for trigger button image\r\n buttonImageOnly: false, // True if the image appears alone, false if it appears on a button\r\n hideIfNoPrevNext: false, // True to hide next/previous month links\r\n // if not applicable, false to just disable them\r\n navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\r\n gotoCurrent: false, // True if today link goes back to current selection instead\r\n changeMonth: false, // True if month can be selected directly, false if only prev/next\r\n changeYear: false, // True if year can be selected directly, false if only prev/next\r\n yearRange: \"c-10:c+10\", // Range of years to display in drop-down,\r\n // either relative to today's year (-nn:+nn), relative to currently displayed year\r\n // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\r\n showOtherMonths: false, // True to show dates in other months, false to leave blank\r\n selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\r\n showWeek: false, // True to show week of the year, false to not show it\r\n calculateWeek: this.iso8601Week, // How to calculate the week of the year,\r\n // takes a Date and returns the number of the week for it\r\n shortYearCutoff: \"+10\", // Short year values < this are in the current century,\r\n // > this are in the previous century,\r\n // string value starting with \"+\" for current year + value\r\n minDate: null, // The earliest selectable date, or null for no limit\r\n maxDate: null, // The latest selectable date, or null for no limit\r\n duration: \"fast\", // Duration of display/closure\r\n beforeShowDay: null, // Function that takes a date and returns an array with\r\n // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\r\n // [2] = cell title (optional), e.g. $.datepicker.noWeekends\r\n beforeShow: null, // Function that takes an input field and\r\n // returns a set of custom settings for the date picker\r\n onSelect: null, // Define a callback function when a date is selected\r\n onChangeMonthYear: null, // Define a callback function when the month or year is changed\r\n onClose: null, // Define a callback function when the datepicker is closed\r\n numberOfMonths: 1, // Number of months to show at a time\r\n showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\r\n stepMonths: 1, // Number of months to step back/forward\r\n stepBigMonths: 12, // Number of months to step back/forward for the big links\r\n altField: \"\", // Selector for an alternate field to store selected dates into\r\n altFormat: \"\", // The date format to use for the alternate field\r\n constrainInput: true, // The input is constrained by the current date format\r\n showButtonPanel: false, // True to show button panel, false to not show it\r\n autoSize: false, // True to size the input for the date format, false to leave as is\r\n disabled: false // The initial disabled state\r\n };\r\n $.extend(this._defaults, this.regional[\"\"]);\r\n this.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\r\n }", "title": "" }, { "docid": "732b9db7ef4d2b990ab4e98eb522e8c7", "score": "0.603328", "text": "focus() {\n if (this.connected) {\n this.getDatepicker().focus();\n }\n }", "title": "" }, { "docid": "9f504f8d1cd0e194504d24ecde652ce4", "score": "0.6026608", "text": "__disableDatePickerInput() {\n this.set('shouldShowDatePicker', false);\n }", "title": "" }, { "docid": "ea905084d995837efe3e8680102af0e2", "score": "0.60260224", "text": "function Datepicker() {\n this._curInst = null; // The current instance in use\n this._keyEvent = false; // If the last event was a key event\n this._disabledInputs = []; // List of date picker inputs that have been disabled\n this._datepickerShowing = false; // True if the popup picker is showing , false if not\n this._inDialog = false; // True if showing within a \"dialog\", false if not\n this._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n this._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n this._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n this._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n this._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n this._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n this._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n this._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n this._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n this.regional = []; // Available regional settings, indexed by language code\n this.regional[ \"\" ] = { // Default regional settings\n closeText: \"Done\", // Display text for close link\n prevText: \"Prev\", // Display text for previous month link\n nextText: \"Next\", // Display text for next month link\n currentText: \"Today\", // Display text for current month link\n monthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n \"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n monthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n dayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n dayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n dayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n weekHeader: \"Wk\", // Column header for week of the year\n dateFormat: \"mm/dd/yy\", // See format options on parseDate\n firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n isRTL: false, // True if right-to-left language, false if left-to-right\n showMonthAfterYear: false, // True if the year select precedes month, false for month then year\n yearSuffix: \"\" // Additional text to append to the year in the month headers\n };\n this._defaults = { // Global defaults for all the date picker instances\n showOn: \"focus\", // \"focus\" for popup on focus,\n // \"button\" for trigger button, or \"both\" for either\n showAnim: \"fadeIn\", // Name of jQuery animation for popup\n showOptions: {}, // Options for enhanced animations\n defaultDate: null, // Used when field is blank: actual date,\n // +/-number for offset from today, null for today\n appendText: \"\", // Display text following the input box, e.g. showing the format\n buttonText: \"...\", // Text for trigger button\n buttonImage: \"\", // URL for trigger button image\n buttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n hideIfNoPrevNext: false, // True to hide next/previous month links\n // if not applicable, false to just disable them\n navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n gotoCurrent: false, // True if today link goes back to current selection instead\n changeMonth: false, // True if month can be selected directly, false if only prev/next\n changeYear: false, // True if year can be selected directly, false if only prev/next\n yearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n // either relative to today's year (-nn:+nn), relative to currently displayed year\n // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n showOtherMonths: false, // True to show dates in other months, false to leave blank\n selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n showWeek: false, // True to show week of the year, false to not show it\n calculateWeek: this.iso8601Week, // How to calculate the week of the year,\n // takes a Date and returns the number of the week for it\n shortYearCutoff: \"+10\", // Short year values < this are in the current century,\n // > this are in the previous century,\n // string value starting with \"+\" for current year + value\n minDate: null, // The earliest selectable date, or null for no limit\n maxDate: null, // The latest selectable date, or null for no limit\n duration: \"fast\", // Duration of display/closure\n beforeShowDay: null, // Function that takes a date and returns an array with\n // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n // [2] = cell title (optional), e.g. $.datepicker.noWeekends\n beforeShow: null, // Function that takes an input field and\n // returns a set of custom settings for the date picker\n onSelect: null, // Define a callback function when a date is selected\n onChangeMonthYear: null, // Define a callback function when the month or year is changed\n onClose: null, // Define a callback function when the datepicker is closed\n numberOfMonths: 1, // Number of months to show at a time\n showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n stepMonths: 1, // Number of months to step back/forward\n stepBigMonths: 12, // Number of months to step back/forward for the big links\n altField: \"\", // Selector for an alternate field to store selected dates into\n altFormat: \"\", // The date format to use for the alternate field\n constrainInput: true, // The input is constrained by the current date format\n showButtonPanel: false, // True to show button panel, false to not show it\n autoSize: false, // True to size the input for the date format, false to leave as is\n disabled: false // The initial disabled state\n };\n $.extend( this._defaults, this.regional[ \"\" ] );\n this.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n this.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n this.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n }", "title": "" }, { "docid": "30a8ddb755c1cf9d965dd265584bd0ec", "score": "0.6017606", "text": "function datepickerSet(id, date) {\n\n console.log('setting date: ' + date);\n\n // Set datepicker input value to selected value\n document.querySelector('#' + id + ' input').value = date;\n\n // Close datepicker\n datepickerClose();\n }", "title": "" }, { "docid": "865b25f1da4b1fcaae67db7fa4e309d7", "score": "0.60157937", "text": "handleFocusDate(e) {\n\t\tthis.setState({\n\t\t\tinputDateType: \"date\",\n\t\t})\n\t}", "title": "" }, { "docid": "0770e28e398f54babb9fa6cc061b1264", "score": "0.6013296", "text": "function addInputDateMask() {\n\t\t$('#Paid_Expenses_date').inputmask(\"mask\", {\"mask\": \"9999-99-99\"});\n\t\t$('#Paid_Expenses_dateEnd').inputmask(\"mask\", {\"mask\": \"9999-99-99\"});\n\t}", "title": "" }, { "docid": "198ca6e151ac8697ab82bc851cc0782b", "score": "0.600686", "text": "function DatePicker( element, options ) {\n this.$el = $(element);\n\n this.proxy('ahead').proxy('show').proxy('hide').proxy('keyHandler').proxy('selectDate');\n\n $.extend(this, options);\n this.$el.data('datepicker', this);\n this.init();\n }", "title": "" }, { "docid": "ad6ebf56600e8ca43c6fed59ca44bc62", "score": "0.6005586", "text": "function Datepicker() {\r\n\tthis.debug = false; // Change this to true to start debugging\r\n\tthis._curInst = null; // The current instance in use\r\n\tthis._keyEvent = false; // If the last event was a key event\r\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\r\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\r\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\r\n\tthis._mainDivId = 'ui-datepicker-div'; // The ID of the main datepicker division\r\n\tthis._inlineClass = 'ui-datepicker-inline'; // The name of the inline marker class\r\n\tthis._appendClass = 'ui-datepicker-append'; // The name of the append marker class\r\n\tthis._triggerClass = 'ui-datepicker-trigger'; // The name of the trigger marker class\r\n\tthis._dialogClass = 'ui-datepicker-dialog'; // The name of the dialog marker class\r\n\tthis._disableClass = 'ui-datepicker-disabled'; // The name of the disabled covering marker class\r\n\tthis._unselectableClass = 'ui-datepicker-unselectable'; // The name of the unselectable cell marker class\r\n\tthis._currentClass = 'ui-datepicker-current-day'; // The name of the current day marker class\r\n\tthis._dayOverClass = 'ui-datepicker-days-cell-over'; // The name of the day hover marker class\r\n\tthis.regional = []; // Available regional settings, indexed by language code\r\n\tthis.regional[''] = { // Default regional settings\r\n\t\tcloseText: 'Done', // Display text for close link\r\n\t\tprevText: 'Prev', // Display text for previous month link\r\n\t\tnextText: 'Next', // Display text for next month link\r\n\t\tcurrentText: 'Today', // Display text for current month link\r\n\t\tmonthNames: ['January','February','March','April','May','June',\r\n\t\t\t'July','August','September','October','November','December'], // Names of months for drop-down and formatting\r\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], // For formatting\r\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], // For formatting\r\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // For formatting\r\n\t\tdayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Column headings for days starting at Sunday\r\n\t\tweekHeader: 'Wk', // Column header for week of the year\r\n\t\tdateFormat: 'mm/dd/yy', // See format options on parseDate\r\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\r\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\r\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\r\n\t\tyearSuffix: '' // Additional text to append to the year in the month headers\r\n\t};\r\n\tthis._defaults = { // Global defaults for all the date picker instances\r\n\t\tshowOn: 'focus', // 'focus' for popup on focus,\r\n\t\t\t// 'button' for trigger button, or 'both' for either\r\n\t\tshowAnim: 'fadeIn', // Name of jQuery animation for popup\r\n\t\tshowOptions: {}, // Options for enhanced animations\r\n\t\tdefaultDate: null, // Used when field is blank: actual date,\r\n\t\t\t// +/-number for offset from today, null for today\r\n\t\tappendText: '', // Display text following the input box, e.g. showing the format\r\n\t\tbuttonText: '...', // Text for trigger button\r\n\t\tbuttonImage: '', // URL for trigger button image\r\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\r\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\r\n\t\t\t// if not applicable, false to just disable them\r\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\r\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\r\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\r\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\r\n\t\tyearRange: 'c-10:c+10', // Range of years to display in drop-down,\r\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\r\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\r\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\r\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\r\n\t\tshowWeek: false, // True to show week of the year, false to not show it\r\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\r\n\t\t\t// takes a Date and returns the number of the week for it\r\n\t\tshortYearCutoff: '+10', // Short year values < this are in the current century,\r\n\t\t\t// > this are in the previous century,\r\n\t\t\t// string value starting with '+' for current year + value\r\n\t\tminDate: null, // The earliest selectable date, or null for no limit\r\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\r\n\t\tduration: 'fast', // Duration of display/closure\r\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\r\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or '',\r\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\r\n\t\tbeforeShow: null, // Function that takes an input field and\r\n\t\t\t// returns a set of custom settings for the date picker\r\n\t\tonSelect: null, // Define a callback function when a date is selected\r\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\r\n\t\tonClose: null, // Define a callback function when the datepicker is closed\r\n\t\tnumberOfMonths: 1, // Number of months to show at a time\r\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\r\n\t\tstepMonths: 1, // Number of months to step back/forward\r\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\r\n\t\taltField: '', // Selector for an alternate field to store selected dates into\r\n\t\taltFormat: '', // The date format to use for the alternate field\r\n\t\tconstrainInput: true, // The input is constrained by the current date format\r\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\r\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\r\n\t\tdisabled: false // The initial disabled state\r\n\t};\r\n\t$.extend(this._defaults, this.regional['']);\r\n\tthis.dpDiv = bindHover($('<div id=\"' + this._mainDivId + '\" class=\"ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all\"></div>'));\r\n}", "title": "" }, { "docid": "fb9cd167ef2bb63d5a805d73965d3eae", "score": "0.6005043", "text": "function Datepicker() {\n\tthis._defaults = {\n\t\tpickerClass: '', // CSS class to add to this instance of the datepicker\n\t\tshowOnFocus: true, // True for popup on focus, false for not\n\t\tshowTrigger: null, // Element to be cloned for a trigger, null for none\n\t\tshowAnim: 'show', // Name of jQuery animation for popup, '' for no animation\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tshowSpeed: 'normal', // Duration of display/closure\n\t\tpopupContainer: null, // The element to which a popup calendar is added, null for body\n\t\talignment: 'bottom', // Alignment of popup - with nominated corner of input:\n\t\t\t// 'top' or 'bottom' aligns depending on language direction,\n\t\t\t// 'topLeft', 'topRight', 'bottomLeft', 'bottomRight'\n\t\tfixedWeeks: false, // True to always show 6 weeks, false to only show as many as are needed\n\t\tfirstDay: 0, // First day of the week, 0 = Sunday, 1 = Monday, ...\n\t\tcalculateWeek: this.iso8601Week, // Calculate week of the year from a date, null for ISO8601\n\t\tmonthsToShow: 1, // How many months to show, cols or [rows, cols]\n\t\tmonthsOffset: 0, // How many months to offset the primary month by;\n\t\t\t// may be a function that takes the date and returns the offset\n\t\tmonthsToStep: 1, // How many months to move when prev/next clicked\n\t\tmonthsToJump: 12, // How many months to move when large prev/next clicked\n\t\tuseMouseWheel: true, // True to use mousewheel if available, false to never use it\n\t\tchangeMonth: true, // True to change month/year via drop-down, false for navigation only\n\t\tyearRange: 'c-10:c+10', // Range of years to show in drop-down: 'any' for direct text entry\n\t\t\t// or 'start:end', where start/end are '+-nn' for relative to today\n\t\t\t// or 'c+-nn' for relative to the currently selected date\n\t\t\t// or 'nnnn' for an absolute year\n\t\tshortYearCutoff: '+10', // Cutoff for two-digit year in the current century\n\t\tshowOtherMonths: false, // True to show dates from other months, false to not show them\n\t\tselectOtherMonths: false, // True to allow selection of dates from other months too\n\t\tdefaultDate: null, // Date to show if no other selected\n\t\tselectDefaultDate: false, // True to pre-select the default date if no other is chosen\n\t\tminDate: null, // The minimum selectable date\n\t\tmaxDate: null, // The maximum selectable date\n\t\tdateFormat: 'mm/dd/yyyy', // Format for dates\n\t\tautoSize: false, // True to size the input field according to the date format\n\t\trangeSelect: false, // Allows for selecting a date range on one date picker\n\t\trangeSeparator: ' - ', // Text between two dates in a range\n\t\tmultiSelect: 0, // Maximum number of selectable dates, zero for single select\n\t\tmultiSeparator: ',', // Text between multiple dates\n\t\tonDate: null, // Callback as a date is added to the datepicker\n\t\tonShow: null, // Callback just before a datepicker is shown\n\t\tonChangeMonthYear: null, // Callback when a new month/year is selected\n\t\tonSelect: null, // Callback when a date is selected\n\t\tonClose: null, // Callback when a datepicker is closed\n\t\taltField: null, // Alternate field to update in synch with the datepicker\n\t\taltFormat: null, // Date format for alternate field, defaults to dateFormat\n\t\tconstrainInput: true, // True to constrain typed input to dateFormat allowed characters\n\t\tcommandsAsDateFormat: false, // True to apply formatDate to the command texts\n\t\tcommands: this.commands // Command actions that may be added to a layout by name\n\t};\n\tthis.regional = [];\n\tthis.regional[''] = { // US/English\n\t\tmonthNames: ['January', 'February', 'March', 'April', 'May', 'June',\n\t\t'July', 'August', 'September', 'October', 'November', 'December'],\n\t\tmonthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],\n\t\tdayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n\t\tdayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n\t\tdayNamesMin: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],\n\t\tdateFormat: 'mm/dd/yyyy', // See options on formatDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\trenderer: this.defaultRenderer, // The rendering templates\n\t\tprevText: '&lt;Prev', // Text for the previous month command\n\t\tprevStatus: 'Show the previous month', // Status text for the previous month command\n\t\tprevJumpText: '&lt;&lt;', // Text for the previous year command\n\t\tprevJumpStatus: 'Show the previous year', // Status text for the previous year command\n\t\tnextText: 'Next&gt;', // Text for the next month command\n\t\tnextStatus: 'Show the next month', // Status text for the next month command\n\t\tnextJumpText: '&gt;&gt;', // Text for the next year command\n\t\tnextJumpStatus: 'Show the next year', // Status text for the next year command\n\t\tcurrentText: 'Current', // Text for the current month command\n\t\tcurrentStatus: 'Show the current month', // Status text for the current month command\n\t\ttodayText: 'Today', // Text for the today's month command\n\t\ttodayStatus: 'Show today\\'s month', // Status text for the today's month command\n\t\tclearText: 'Clear', // Text for the clear command\n\t\tclearStatus: 'Clear all the dates', // Status text for the clear command\n\t\tcloseText: 'Close', // Text for the close command\n\t\tcloseStatus: 'Close the datepicker', // Status text for the close command\n\t\tyearStatus: 'Change the year', // Status text for year selection\n\t\tmonthStatus: 'Change the month', // Status text for month selection\n\t\tweekText: 'Wk', // Text for week of the year column header\n\t\tweekStatus: 'Week of the year', // Status text for week of the year column header\n\t\tdayStatus: 'Select DD, M d, yyyy', // Status text for selectable days\n\t\tdefaultStatus: 'Select a date', // Status text shown by default\n\t\tisRTL: false // True if language is right-to-left\n\t};\n\t$.extend(this._defaults, this.regional['']);\n\tthis._disabled = [];\n}", "title": "" }, { "docid": "2ef165f37dcbe213b79713bfcdd4cbf9", "score": "0.59984833", "text": "function Datepicker() {\n\t\tthis._curInst = null; // The current instance in use\n\t\tthis._keyEvent = false; // If the last event was a key event\n\t\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\t\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\t\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\t\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\t\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\t\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\t\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\t\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\t\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\t\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\t\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\t\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\t\tthis.regional = []; // Available regional settings, indexed by language code\n\t\tthis.regional[\"\"] = { // Default regional settings\n\t\t\tcloseText: \"Done\", // Display text for close link\n\t\t\tprevText: \"Prev\", // Display text for previous month link\n\t\t\tnextText: \"Next\", // Display text for next month link\n\t\t\tcurrentText: \"Today\", // Display text for current month link\n\t\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t\t};\n\t\tthis._defaults = { // Global defaults for all the date picker instances\n\t\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\t\tshowOptions: {}, // Options for enhanced animations\n\t\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t\t// +/-number for offset from today, null for today\n\t\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\t\tbuttonText: \"...\", // Text for trigger button\n\t\t\tbuttonImage: \"\", // URL for trigger button image\n\t\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t\t// if not applicable, false to just disable them\n\t\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t\t// takes a Date and returns the number of the week for it\n\t\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t\t// > this are in the previous century,\n\t\t\t\t// string value starting with \"+\" for current year + value\n\t\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\t\tduration: \"fast\", // Duration of display/closure\n\t\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t\t// returns a set of custom settings for the date picker\n\t\t\tonSelect: null, // Define a callback function when a date is selected\n\t\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\t\tstepMonths: 1, // Number of months to step back/forward\n\t\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\t\tdisabled: false // The initial disabled state\n\t\t};\n\t\t$.extend(this._defaults, this.regional[\"\"]);\n\t\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n\t}", "title": "" }, { "docid": "0d80c0399555112f5fe12a7c3cbc0c50", "score": "0.5983155", "text": "function calendar_open(input_element, options) {\n build_calendar(input_element); // CH: added this, see method below\n calendar.input_element = input_element;\n options = options || {};\n calendar.format = options.format;\n if (options.month_names) {\n calendar.month_names = options.month_names;\n }\n \n // CH: Start add init of new options\n if(options.onDateSelect) {\n calendar.onDateSelect = options.onDateSelect;\n }\n\n if(options.fireEvent == false) {\n calendar.fireEvent = false;\n }\n \n // FL Added to support diffrent start days. Defaults to 0 (Sunday).\n if (options.start_day) {\n \tcalendar.start_day = options.start_day;\n }\n\n if (options.showYearControls == false) {\n \tcalendar.showYearControls = false;\n }\n // CH: Done add init of new options\n \n if (options.day_names) {\n calendar.day_names = options.day_names;\n }\n // Built month numbers lookup.\n for (var i=0; i < calendar.month_names.length; i++) {\n calendar.month_numbers[calendar.month_names[i].substr(0,3).toLowerCase()] = i;\n }\n // Set day name cells.\n var day_names = calendar.element.getElementsByTagName('tr')[1].childNodes;\n for (var i=0; i < day_names.length; i++) {\n \tvar dayIndex=(i+calendar.start_day) % 7; // FL Adjust for start_day\n day_names[i].innerHTML = calendar.day_names[dayIndex].substr(0,3);\n if ( dayIndex == 0 || dayIndex == 6)\n day_names[i].className += ' weekend';\n }\n var images_dir = options.images_dir || '.';\n // Set up previous and next images.\n var images = calendar.element.getElementsByTagName('img');\n if (images.length == 0) {\n get_element('calendar_prev_year').appendChild(document.createElement('img'));\n get_element('calendar_prev_month').appendChild(document.createElement('img'));\n get_element('calendar_next_month').appendChild(document.createElement('img'));\n get_element('calendar_next_year').appendChild(document.createElement('img'));\n images = calendar.element.getElementsByTagName('img');\n }\n images[0].src = images_dir + '/' + PREV_YEAR_IMAGE;\n images[1].src = images_dir + '/' + PREV_MONTH_IMAGE;\n images[2].src = images_dir + '/' + NEXT_MONTH_IMAGE;\n images[3].src = images_dir + '/' + NEXT_YEAR_IMAGE;\n add_event('click', calendar_hide_check);\n input_element.onkeydown = input_keypress; // CH use onkeydown instead of onkeypress to trap Tab key too\n \n // If a ieShim has been written to the page, determine the dimensions before display\n if ($('ieShim'))\n {\n var calDim = $('calendar_control').getDimensions();\n $('ieShim').style.left = left(input_element) + 'px';\n $('ieShim').style.top = (top(input_element) + input_element.offsetHeight) + 'px';\n $('ieShim').style.height = (calDim.height) + 'px';\n $('ieShim').style.width = (calDim.width) + 'px';\n $('ieShim').style.display = 'block';\n }\n \n // Position calendar by input element.\n if ( isInsideModal(input_element) ) {\n \tleft = input_element.viewportOffset().left;\n \ttop = input_element.viewportOffset().top;\n \tcalendar.element.style.position = \"fixed\"; \n }\n else {\n \tleft = input_element.cumulativeOffset().left;\n \ttop = input_element.cumulativeOffset().top;\n \tcalendar.element.style.position = \"absolute\";\n }\n \n calendar.element.style.left = left + 'px';\n calendar.element.style.top = (top + input_element.offsetHeight) + 'px'; \n calendar_show();\n // Parse input date.\n var date = string_to_date(input_element.value);\n if (date) {\n calendar.input_date = date;\n calendar.month_date = new Date(date);\n }\n else {\n calendar.input_date = undefined;\n calendar.month_date = new Date;\n }\n calendar.month_date.setDate(1);\n calendar_update();\n}", "title": "" }, { "docid": "08a188e353706f129176df102616a6b1", "score": "0.5982596", "text": "function Datepicker() {\n\t\tthis._curInst = null; // The current instance in use\n\t\tthis._keyEvent = false; // If the last event was a key event\n\t\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\t\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\t\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\t\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\t\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\t\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\t\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\t\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\t\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\t\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\t\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\t\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\t\tthis.regional = []; // Available regional settings, indexed by language code\n\t\tthis.regional[ \"\" ] = { // Default regional settings\n\t\t\tcloseText: \"Done\", // Display text for close link\n\t\t\tprevText: \"Prev\", // Display text for previous month link\n\t\t\tnextText: \"Next\", // Display text for next month link\n\t\t\tcurrentText: \"Today\", // Display text for current month link\n\t\t\tmonthNames: [ \"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\" ], // Names of months for drop-down and formatting\n\t\t\tmonthNamesShort: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\" ], // For formatting\n\t\t\tdayNames: [ \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\" ], // For formatting\n\t\t\tdayNamesShort: [ \"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\" ], // For formatting\n\t\t\tdayNamesMin: [ \"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\" ], // Column headings for days starting at Sunday\n\t\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t\t};\n\t\tthis._defaults = { // Global defaults for all the date picker instances\n\t\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\t\tshowOptions: {}, // Options for enhanced animations\n\t\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t\t// +/-number for offset from today, null for today\n\t\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\t\tbuttonText: \"...\", // Text for trigger button\n\t\t\tbuttonImage: \"\", // URL for trigger button image\n\t\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t\t// if not applicable, false to just disable them\n\t\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t\t// takes a Date and returns the number of the week for it\n\t\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t\t// > this are in the previous century,\n\t\t\t\t// string value starting with \"+\" for current year + value\n\t\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\t\tduration: \"fast\", // Duration of display/closure\n\t\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t\t// returns a set of custom settings for the date picker\n\t\t\tonSelect: null, // Define a callback function when a date is selected\n\t\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\t\tstepMonths: 1, // Number of months to step back/forward\n\t\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\t\tdisabled: false // The initial disabled state\n\t\t};\n\t\t$.extend( this._defaults, this.regional[ \"\" ] );\n\t\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ] );\n\t\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\t\tthis.dpDiv = datepicker_bindHover( $( \"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\" ) );\n\t}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.5982351", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.5982351", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.5982351", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.5982351", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.5982351", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.5982351", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.5982351", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.5982351", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.5982351", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.5982351", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.5982351", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.5982351", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.5982351", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.5982351", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "4db52e4f0b06731663b82963cafdebf3", "score": "0.5982351", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.dpDiv = bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" }, { "docid": "efc85c7852469694c8901aa66a71a713", "score": "0.5982351", "text": "function Datepicker() {\n\tthis._curInst = null; // The current instance in use\n\tthis._keyEvent = false; // If the last event was a key event\n\tthis._disabledInputs = []; // List of date picker inputs that have been disabled\n\tthis._datepickerShowing = false; // True if the popup picker is showing , false if not\n\tthis._inDialog = false; // True if showing within a \"dialog\", false if not\n\tthis._mainDivId = \"ui-datepicker-div\"; // The ID of the main datepicker division\n\tthis._inlineClass = \"ui-datepicker-inline\"; // The name of the inline marker class\n\tthis._appendClass = \"ui-datepicker-append\"; // The name of the append marker class\n\tthis._triggerClass = \"ui-datepicker-trigger\"; // The name of the trigger marker class\n\tthis._dialogClass = \"ui-datepicker-dialog\"; // The name of the dialog marker class\n\tthis._disableClass = \"ui-datepicker-disabled\"; // The name of the disabled covering marker class\n\tthis._unselectableClass = \"ui-datepicker-unselectable\"; // The name of the unselectable cell marker class\n\tthis._currentClass = \"ui-datepicker-current-day\"; // The name of the current day marker class\n\tthis._dayOverClass = \"ui-datepicker-days-cell-over\"; // The name of the day hover marker class\n\tthis.regional = []; // Available regional settings, indexed by language code\n\tthis.regional[\"\"] = { // Default regional settings\n\t\tcloseText: \"Done\", // Display text for close link\n\t\tprevText: \"Prev\", // Display text for previous month link\n\t\tnextText: \"Next\", // Display text for next month link\n\t\tcurrentText: \"Today\", // Display text for current month link\n\t\tmonthNames: [\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\n\t\t\t\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"], // Names of months for drop-down and formatting\n\t\tmonthNamesShort: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"], // For formatting\n\t\tdayNames: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"], // For formatting\n\t\tdayNamesShort: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"], // For formatting\n\t\tdayNamesMin: [\"Su\",\"Mo\",\"Tu\",\"We\",\"Th\",\"Fr\",\"Sa\"], // Column headings for days starting at Sunday\n\t\tweekHeader: \"Wk\", // Column header for week of the year\n\t\tdateFormat: \"mm/dd/yy\", // See format options on parseDate\n\t\tfirstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...\n\t\tisRTL: false, // True if right-to-left language, false if left-to-right\n\t\tshowMonthAfterYear: false, // True if the year select precedes month, false for month then year\n\t\tyearSuffix: \"\" // Additional text to append to the year in the month headers\n\t};\n\tthis._defaults = { // Global defaults for all the date picker instances\n\t\tshowOn: \"focus\", // \"focus\" for popup on focus,\n\t\t\t// \"button\" for trigger button, or \"both\" for either\n\t\tshowAnim: \"fadeIn\", // Name of jQuery animation for popup\n\t\tshowOptions: {}, // Options for enhanced animations\n\t\tdefaultDate: null, // Used when field is blank: actual date,\n\t\t\t// +/-number for offset from today, null for today\n\t\tappendText: \"\", // Display text following the input box, e.g. showing the format\n\t\tbuttonText: \"...\", // Text for trigger button\n\t\tbuttonImage: \"\", // URL for trigger button image\n\t\tbuttonImageOnly: false, // True if the image appears alone, false if it appears on a button\n\t\thideIfNoPrevNext: false, // True to hide next/previous month links\n\t\t\t// if not applicable, false to just disable them\n\t\tnavigationAsDateFormat: false, // True if date formatting applied to prev/today/next links\n\t\tgotoCurrent: false, // True if today link goes back to current selection instead\n\t\tchangeMonth: false, // True if month can be selected directly, false if only prev/next\n\t\tchangeYear: false, // True if year can be selected directly, false if only prev/next\n\t\tyearRange: \"c-10:c+10\", // Range of years to display in drop-down,\n\t\t\t// either relative to today's year (-nn:+nn), relative to currently displayed year\n\t\t\t// (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)\n\t\tshowOtherMonths: false, // True to show dates in other months, false to leave blank\n\t\tselectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable\n\t\tshowWeek: false, // True to show week of the year, false to not show it\n\t\tcalculateWeek: this.iso8601Week, // How to calculate the week of the year,\n\t\t\t// takes a Date and returns the number of the week for it\n\t\tshortYearCutoff: \"+10\", // Short year values < this are in the current century,\n\t\t\t// > this are in the previous century,\n\t\t\t// string value starting with \"+\" for current year + value\n\t\tminDate: null, // The earliest selectable date, or null for no limit\n\t\tmaxDate: null, // The latest selectable date, or null for no limit\n\t\tduration: \"fast\", // Duration of display/closure\n\t\tbeforeShowDay: null, // Function that takes a date and returns an array with\n\t\t\t// [0] = true if selectable, false if not, [1] = custom CSS class name(s) or \"\",\n\t\t\t// [2] = cell title (optional), e.g. $.datepicker.noWeekends\n\t\tbeforeShow: null, // Function that takes an input field and\n\t\t\t// returns a set of custom settings for the date picker\n\t\tonSelect: null, // Define a callback function when a date is selected\n\t\tonChangeMonthYear: null, // Define a callback function when the month or year is changed\n\t\tonClose: null, // Define a callback function when the datepicker is closed\n\t\tnumberOfMonths: 1, // Number of months to show at a time\n\t\tshowCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0)\n\t\tstepMonths: 1, // Number of months to step back/forward\n\t\tstepBigMonths: 12, // Number of months to step back/forward for the big links\n\t\taltField: \"\", // Selector for an alternate field to store selected dates into\n\t\taltFormat: \"\", // The date format to use for the alternate field\n\t\tconstrainInput: true, // The input is constrained by the current date format\n\t\tshowButtonPanel: false, // True to show button panel, false to not show it\n\t\tautoSize: false, // True to size the input for the date format, false to leave as is\n\t\tdisabled: false // The initial disabled state\n\t};\n\t$.extend(this._defaults, this.regional[\"\"]);\n\tthis.regional.en = $.extend( true, {}, this.regional[ \"\" ]);\n\tthis.regional[ \"en-US\" ] = $.extend( true, {}, this.regional.en );\n\tthis.dpDiv = datepicker_bindHover($(\"<div id='\" + this._mainDivId + \"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>\"));\n}", "title": "" } ]
74da21cbd76b94c68c365ddb7e2316f3
This function will loop through the listings and hide them all.
[ { "docid": "7177d6f526eed501661d634db60b7946", "score": "0.0", "text": "function hideMarkers(markers) {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n }", "title": "" } ]
[ { "docid": "646b345ee1298e5a89b1375731266495", "score": "0.74278647", "text": "function hideListings() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n }", "title": "" }, { "docid": "59d5bc9e36cdd70a85bcad6ae1679381", "score": "0.7367919", "text": "function hideListings() {\r\n for (var i = 0; i < markers.length; i++) {\r\n markers[i].setMap(null);\r\n }\r\n }", "title": "" }, { "docid": "59d5bc9e36cdd70a85bcad6ae1679381", "score": "0.7367919", "text": "function hideListings() {\r\n for (var i = 0; i < markers.length; i++) {\r\n markers[i].setMap(null);\r\n }\r\n }", "title": "" }, { "docid": "81be89cd725ea8a58f7bc515fb372766", "score": "0.73552054", "text": "function hideListings() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n }", "title": "" }, { "docid": "cd945adf8ffeb9807111f02263067754", "score": "0.7280888", "text": "function hideListings() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n}", "title": "" }, { "docid": "b4931858282b9be54c41c9aea36cd0ee", "score": "0.7255515", "text": "function hideListings () {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setVisible(false);\n markers[i].setIcon('img/bball_s.png');\n }\n}", "title": "" }, { "docid": "779d6922f43f2c149cc971fe294c4382", "score": "0.7232948", "text": "function hideListings() {\n for (var i = 0; i < places.length; i++) {\n places[i].setMap(null);\n }\n }", "title": "" }, { "docid": "d4adfbf69f7aac261319d39c62b5b633", "score": "0.7160492", "text": "function hideListings() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n}", "title": "" }, { "docid": "13bb8c7b97cb4cd6c5e1a0ec2c6488c6", "score": "0.7152572", "text": "function hideAndAppened() {\n\thideAll();\n\t//default page is the first. so we display the first 10 students\n\n\tfor (let i=0;i<10;i++){\n\t\tif (studentListDOM.item(i) ==null){return};//if end of students then stop trying to display them\n\t\tstudentListDOM.item(i).style.display =\"list-item\";\n\t\n\t}\n}", "title": "" }, { "docid": "0132b0320098b805adb565d45fa6865b", "score": "0.7144252", "text": "function hideListings() {\n for (let marker of markers) {\n marker.setMap(null);\n }\n}", "title": "" }, { "docid": "cd5c7c3de729928b009526cc63ccb781", "score": "0.71277195", "text": "function hideAllListings() {\n var bounds = new google.maps.LatLngBounds();\n // Delete all markers from the map\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n}", "title": "" }, { "docid": "388e735786b1a9fa902abd20cce20cb7", "score": "0.7102045", "text": "function displayListings() {\n var $el = $(this);\n var typeToShow = $el.data('listingtype');\n getListings(typeToShow);\n}", "title": "" }, { "docid": "e7e63cb418e422f57f0b848f95b14d83", "score": "0.7083239", "text": "function hideListings() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n}", "title": "" }, { "docid": "e7e63cb418e422f57f0b848f95b14d83", "score": "0.7083239", "text": "function hideListings() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n}", "title": "" }, { "docid": "e7e63cb418e422f57f0b848f95b14d83", "score": "0.7083239", "text": "function hideListings() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n}", "title": "" }, { "docid": "ddbe54eca35f2c774bf2ef4853c65071", "score": "0.7066706", "text": "function hideAll() {\n document.getElementById(\"buList\").style.visibility = \"hidden\";\n hideStaffList();\n}", "title": "" }, { "docid": "ad4fae05c072ad0a2c4cebc1f02fd4f1", "score": "0.6963725", "text": "function hideListings(){\n for (var i=0; i < markers.length; i++){\n markers[i].setMap(null);\n }\n}", "title": "" }, { "docid": "59a065c64186ff8de25c15d958612e49", "score": "0.6949718", "text": "function hideFeed(e) {\r\n\te.find(\"li>div.feed-item-container\").has(\"span:contains('replied to a')\").hide();\r\n\t\t\t\r\n\te.find(\"li>div.feed-item-container\").has(\"span:contains('liked')\").hide();\r\n\r\n\te.find(\"li>div.feed-item-container\").has(\"span:contains('commented')\").hide();\r\n\r\n\te.find(\"li>div.feed-item-container\").has(\"span:contains('added ')\").hide();\r\n\r\n\te.find(\"li>div.feed-item-container\").has(\"span:contains('posted')\").hide();\r\n\t\r\n\te.find(\"li>div.feed-item-container\").has(\"span:contains('created')\").hide();\r\n\r\n\te.find(\"li>div.feed-item-container\").has(\"span:contains('subscribed to a channel')\").hide();\r\n\t\t\t\t\r\n\te.find(\"li>div.feed-item-container\").has(\"span.feed-item-rec\").hide();\r\n\r\n\t//Show combinations of \"uploaded and ...\"\r\n\te.find(\"li>div.feed-item-container\").has(\"span:contains('uploaded and ')\").show();\r\n\r\n\t//But hide watched videos\r\n\te.find(\"li>div.feed-item-container\").has(\"div:contains('WATCHED')\").hide();\r\n}", "title": "" }, { "docid": "017a7b52e00c4a245d7829058b9404d5", "score": "0.69080436", "text": "function hideAll(){\n\t\ts.loader.css({'display':'none'});\n\t\tclearList();\n\t\ts.resultsBox.hide();\n\t}", "title": "" }, { "docid": "f16621bd429e4908a8a425d9c6db2650", "score": "0.6830785", "text": "function hideListings(markers) {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n\n }", "title": "" }, { "docid": "40128e8edfac70615553c0c810a0c220", "score": "0.6763773", "text": "function hide (list,page){\r\n const startIndex = ((page*10)-10);\r\n const endIndex = ((page*10)-1);\r\n for (let i = 0; i <list.length; i +=1){\r\n if(i < startIndex || i > endIndex){\r\n list[i].style.display = 'none';}else{\r\n list[i].style.display = 'block';\r\n }\r\n };\r\n}", "title": "" }, { "docid": "fe629f4d7f228f53b3cec081f0138c83", "score": "0.67211384", "text": "function hideAllPageItems() {\n self.children(opts.data_element).css({display: 'none'});\n }", "title": "" }, { "docid": "00fbbd120f704a07ddee9a5e9170fe07", "score": "0.668472", "text": "function hideMarkers() {\r\n\r\n for (var i = 0; i < markerList.length; i++) {\r\n markerList[i].setVisible(false);\r\n }\r\n}", "title": "" }, { "docid": "984e29bdd876c5fee021983f53c865c1", "score": "0.66728747", "text": "function hideAll() {\n infoDivs.forEach(function(el) {\n el.style.display = 'none';\n });\n}", "title": "" }, { "docid": "3191b91af605d72354a5fc9e49598ba9", "score": "0.66560787", "text": "function resetAndHideAllLists(list){\n\t\n\tfor(let i = 0; i < list.length ; i++){\n\t\t\n\t\tlist[i].style.display = 'none';\n\t\t\n\t}\n\t\n}", "title": "" }, { "docid": "434d22acf421ef611dca3f1aa8dc35c8", "score": "0.6639563", "text": "function DisplayItems(pageNumber) {\n var anyShow = 0;\n for (var i = 0; i < listItemsArray.length; i++) {\n if (listItemsArray[i].Page == pageNumber && listItemsArray[i].Visible == \"Y\") {\n $(listItemsArray[i].Item).show();\n anyShow = anyShow + 1;\n }\n else\n $(listItemsArray[i].Item).hide();\n } \n\n if (anyShow > 0)\n $('#emptyList').hide();\n else\n $('#emptyList').show();\n \n }", "title": "" }, { "docid": "3ee19edf2065a3c4b8d5a80a4c093a79", "score": "0.65698063", "text": "function _hideAll()\n {\n $(\".status-on\").hide();\n $(\".status-off\").hide();\n $(\".no-devices\").hide();\n $(\".connected\").hide();\n loader.close();\n }", "title": "" }, { "docid": "2cac2594654d0006c8daae2459cb9b70", "score": "0.65124893", "text": "function hideAll(collection) {\n for (var i = 0; i < collection.length; i++) {\n hide(collection[i]);\n }\n}", "title": "" }, { "docid": "eff0057548c3b253ae1f290f4b9a32da", "score": "0.6504068", "text": "function displayAll() {\n\t//Clear search input field\n\tchannelSearchInput.value = \"\";\n\n\tsetTabActive(tabAll);\n\t//Display all streamers Li\n\tchannelList.childNodes.forEach(function(node) {\n\t\tif(node.nodeName == \"LI\") {\t\t\t\t\t\t\n\t\t\tnode.classList.remove(\"displayNone\");\n\t\t}\n\t})\n}", "title": "" }, { "docid": "e51f3b3617108bc50489319cae820dce", "score": "0.6501067", "text": "function hideAll() {\n elements = document.getElementsByClassName(\"resources-item\");\n for (var i = 0; i < elements.length; i++) {\n elements[i].style.display = 'none';\n }\n}", "title": "" }, { "docid": "2674fba5d5aa3a60c27e33048aae8e30", "score": "0.6494171", "text": "function hideAll (){\n\n\t//adding a style to hide all the students from the html\n\tfor (let i=0; i<studentListDOM.length;i++){\n\tstudentListDOM[i].style.display = 'none';//adding a style to hide all the students from the html\n\n\t}\n}", "title": "" }, { "docid": "174cffbdb27fb250c69bf40d76d81a24", "score": "0.64914775", "text": "function hideMarkers()\r\n{\r\n\tfor (j=1;j<marker.length;j++)\r\n\t{\r\n\t\tmarker[j].display(false);\r\n\t}\r\n}", "title": "" }, { "docid": "a003e1959d929e9a5638e36bef910083", "score": "0.6491268", "text": "function hideOthers() {\n details.forEach((el)=>{\n el.style = \"display:none\";\n }\n )\n}", "title": "" }, { "docid": "685780e6863b83c1830be7472b70b7f6", "score": "0.64911425", "text": "function hideList() {\n // Getting an array of input wrappers (there must be 2 of them)\n var inputWrappers = document.getElementsByClassName(\"valid-thru-input-wrapper\");\n // Modifying last child of every element in the array of input wrappers\n // Array.prototype was used in order to use the forEach method\n // inputWrappers is an array-like object, so we need to pretend,\n // that it's an array\n Array.prototype.forEach.call(inputWrappers, function(item) {\n item.lastChild.classList.remove(\"valid-thru--active\");\n });\n }", "title": "" }, { "docid": "df1918c4321481bacff76d3acd7b3ebe", "score": "0.6438242", "text": "function hideAll(){\n for (var i = 0; i < pages.length; i++){\n $(pages[i]).hide();\n }\n }", "title": "" }, { "docid": "bcf52e0086d72c65aecf082ddcaf157c", "score": "0.6413434", "text": "function hideStudentList(studentList)\n{\n //Use the parameter variable to hold the student list\n //studentList = document.getElementsByClassName('student-item');\n\n //Use a 'for' loop to loop through the students, and hide the students from\n //the site\n for (var i = 0; i < studentList.length; i++)\n {\n studentList[i].style.display = \"none\"; //Hide each student\n }\n}", "title": "" }, { "docid": "2ffc30ff92f2dd1a0eb4dda954f274da", "score": "0.64044416", "text": "function viewList() {\n var elem = document.getElementsByClassName('listDiv');\n var i;\n for (i = 0; i < elem.length; i++) {\n elem[i].style.display = 'block';\n }\n \n elem = document.getElementsByClassName('pageDiv');\n for (i = 0; i < elem.length; i++) {\n elem[i].style.display = 'none';\n }\n \n elem = document.getElementsByClassName('pages');\n for (i = 0; i < elem.length; i++) {\n elem[i].style.display = 'block';\n }\n elem = i = null;\n}", "title": "" }, { "docid": "a7d3d1d496bb9e2b93861355ed2d4e31", "score": "0.6388076", "text": "function hide_all() {\t\n\n\tfor(var cur_cat in hashCategories)\n\t{\n\t\thide_cat(hashCategories[cur_cat][1]);\n\t}\n}", "title": "" }, { "docid": "bfbe3e9120c96820e94b97f0cf485fe2", "score": "0.6369843", "text": "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $userProfile,\n $favoritedStories,\n $loginForm,\n $createAccountForm,\n $userProfile\n ];\n elementsArr\n .forEach(val => val.hide());\n }", "title": "" }, { "docid": "cd845c7cc8e35a2141c93db767425163", "score": "0.63421303", "text": "function hideAllDescriptions() {\n\n for (var i = 0; i < totalDesc; i++) {\n // Prepare single description\n var description = descriptions[i];\n // Hide each description\n description.setAttribute('data-state', 'hidden');\n }\n}", "title": "" }, { "docid": "0de7f4fa5f33712a232a65b6f6eae063", "score": "0.6328864", "text": "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $userProfile,\n $favoritedStories,\n $loginForm,\n $createAccountForm,\n $userProfile\n ];\n elementsArr.forEach(val => val.hide());\n }", "title": "" }, { "docid": "13bbd2310a1f42870e04ee640fbffe83", "score": "0.63256365", "text": "function filterlistings(selectedtags) {\r\n $(\".grid-item\").each(function() {\r\n showitem = false;\r\n if (selectedtags.length == 0) {\r\n showitem = true;\r\n }\r\n for (i = 0; i < selectedtags.length; i++) {\r\n if ($(this).hasClass(selectedtags[i])) {\r\n showitem = true;\r\n }\r\n }\r\n if (!showitem) {\r\n $(this).hide();\r\n } else {\r\n $(this).show();\r\n }\r\n\r\n // Reposition footer as needed based on element removal/addition\r\n resizeEvents();\r\n });\r\n}", "title": "" }, { "docid": "ac92bbf70d0df0c2ea5fa00f05421249", "score": "0.63233334", "text": "function hideStar() {\n\tconst starList = document.querySelectorAll('.stars li');\n\tfor (star of starList) {\n\t\tif (star.style.display !== 'none') {\n\t\t\tstar.style.display = 'none';\n\t\t\tbreak;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "3d6b4f53bc232633b352254855a6c631", "score": "0.6306022", "text": "function list_readyResults() {\n $(\"div.list-container > span.list-start\").hide()\n $(\"div.list-container > span.list-none\").hide()\n $(\"div.list-container\").removeClass(\"list-container-empty\")\n $(\"div.list-container > div.list-item\").off()\n $(\"div.list-container > div.list-item\").remove()\n}", "title": "" }, { "docid": "f3976423a5017d7fa6ff6c72de13afe3", "score": "0.62891096", "text": "function checkIfAllHidden($listDiv) {\n var $listItems = $listDiv.find('.a-z-filters__listing__letter-list__item');\n var countHidden = 0;\n $listItems.each(function(idx, $thisLi) {\n if ($($thisLi).hasClass('a-z__item--hidden__region') || $($thisLi).hasClass('a-z__item--hidden__text')) {\n countHidden++ ;\n }\n });\n if (countHidden === $listItems.length) {\n $listDiv.hide();\n } else {\n $listDiv.show()\n } \n \n }// end checkIfAllHidden()", "title": "" }, { "docid": "e9fac9d09bafd699b4faee6b68e3b63b", "score": "0.6263938", "text": "function HideItems(arr) {\n var i;\n for (i = 1; i < 21; i++) {\n if (!arr.includes(i)) {\n document.getElementById(\"f\" + i).style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "49ec511043251fb0012c6e9918c47b8b", "score": "0.62590307", "text": "function showListings(parentElementId, dlClassName) {\n var i=6;\n\tvar newDL = document.createElement(\"dl\");\n\tnewDL.className = dlClassName;\n while (i < zSr.length) {\n var descr = zSr[i++]; // listing description\n var unused1 = zSr[i++]; // (ignore)\n var clickURL = zSr[i++]; // listing link\n var title = zSr[i++]; // listing title\n var sitehost = zSr[i++]; // advertiser's domain name\n var unused2 = zSr[i++]; // (ignore)\n\t var newDT = document.createElement(\"dt\");\n\t\tvar newDD = document.createElement(\"dd\");\n\t\tvar newA = document.createElement(\"a\");\n\t\tnewDT.appendChild(newA);\n\t\tnewA.setAttribute(\"target\", \"_new\");\n\t\tnewA.setAttribute(\"href\", clickURL);\n\t\tvar newA2 = document.createElement(\"a\");\n\t\tnewDD.appendChild(newA2);\n\t\tnewA2.setAttribute(\"target\", \"_new\");\n\t\tnewA2.setAttribute(\"href\", clickURL);\n\t\tvar newStrong = document.createElement(\"strong\");\n\t\tnewA.appendChild(newStrong);\n\t\tvar newTextTitle = document.createTextNode(title);\n\t\tnewStrong.appendChild(newTextTitle);\n\t\tvar newTextDescr = document.createTextNode(descr);\n\t\tnewA2.appendChild(newTextDescr);\n\t\t\n\t\tnewDL.appendChild(newDT);\n\t\tnewDL.appendChild(newDD);\n\t}\n\tdocument.getElementById(parentElementId).appendChild(newDL);\n\t\n}", "title": "" }, { "docid": "88e3e47bfa7d8312308c25e2d5f0db9a", "score": "0.6256353", "text": "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm\n ];\n elementsArr.forEach(val => val.hide());\n }", "title": "" }, { "docid": "313b2fb58b68daa371bb9126a3a3716f", "score": "0.62557256", "text": "function restartVisibility() {\n $($slideables).each(function( index, element ) {\n $(element).find('> li:gt(0)').addClass(self.options.hideClass);\n });\n }", "title": "" }, { "docid": "fece8a42f8cad3d35e56f36d5504ca7a", "score": "0.6250421", "text": "function hideStar() {\n const starList = document.querySelectorAll('.stars li');\n for (star of starList) {\n if (star.style.display !== 'none') {\n star.style.display = 'none';\n break;\n }\n }\n}", "title": "" }, { "docid": "87e66c96b5ffc3a6be6e0b56911ac6ff", "score": "0.62434095", "text": "function hideBlacklistedSubredditEntries(){\r\n\tif(settings[\"hide_blacklisted_subreddits_entries\"][\"enabled\"] == true){\r\n\t\t$.each($(\".thing.link\"), function(a,b){\r\n\t\tif($(b).find(\".del-button\").length == 0 && $.inArray($.trim($(b).find(\".subreddit\").text().toLowerCase()), settings[\"hide_blacklisted_subreddits_entries\"][\"entries\"]) != -1)\r\n\t\t\t$(b).hide();\r\n\t\t});\r\n\t}\r\n}", "title": "" }, { "docid": "f5d41b48eb953beaa41736d151e34d31", "score": "0.62386787", "text": "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm,\n $favoritedStories,\n $userProfile\n ];\n elementsArr.forEach($elem => $elem.hide());\n }", "title": "" }, { "docid": "9b31628b13335b92de2536464c181394", "score": "0.6234548", "text": "function showPageItems() {\n //hide all items\n var pageSelected = pages[0][pageNumber],\n hidden,\n i;\n for (i = 0; i < studentCount; i += 1) {\n hidden = document.getElementById('student-list').children[i].style.display = 'none';\n }\n //show only items for the selected page\n if (pageSelected !== undefined) {\n pageSelected.forEach(function (element) {\n var show = document.getElementById('student-list').children[element].style.display = 'block';\n });\n }\n }", "title": "" }, { "docid": "60cb48d4fd4ceff660f47ce46abe6b25", "score": "0.6230342", "text": "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm,\n $favoritedArticles,\n $myArticles,\n $userProfile\n ];\n elementsArr.forEach($elem => $elem.hide());\n }", "title": "" }, { "docid": "95152de735adcfa61c4df56e9bb73d42", "score": "0.6229351", "text": "function hideVisibility(elementsList) {\n \"use strict\";\n for (var i=0;i<elementsList.length;i++) {\n document.getElementById(elementsList[i]).style.visibility = \"hidden\";\n }\n}", "title": "" }, { "docid": "506ea10117a3d38f940d2af3c52eb106", "score": "0.62192523", "text": "toggleListItemsVisibilities(id, hide) {\n $(`#entity_list`).find(`> li[data-id=${id}]`).each(function() {\n let needsShowing = !hide && $(this).hasClass('b2-hidden');\n let needsHiding = hide && !$(this).hasClass('b2-hidden');\n if (needsShowing) {\n $(this).removeClass('anim-out').removeClass('b2-hidden').addClass(\n 'anim-in');\n } else if (needsHiding) {\n $(this).one('animationend', function() {\n $(this).one('animationend', function() {\n $(this).addClass('b2-hidden');\n });\n });\n $(this).removeClass('anim-in').addClass('anim-out');\n }\n });\n }", "title": "" }, { "docid": "5056909d73bc4641333d122d25d3f310", "score": "0.6217954", "text": "function hide_warbase(jNode){\n\n if(hideOff == '1'){\n // Modified by XedX\n jNode.find(\"li:has(div.member.icons:has(li[id^='icon2'])), li:has(div:has(div[id*='offline-user']))\").each(function(item){\n $(this).remove();\n });\n // End modified\n }\n\n if(hideTravel == '1'){\n jNode.find(\"li:has(span.t-red:contains('Traveling')), li:has(span.t-red:contains('Federal')), li:has(span.t-red:contains('Fallen'))\").each(function(item){\n $(this).remove();\n });\n }\n\n if(hideHosped == '1'){\n jNode.find(\"li:has(span.t-red:contains('Hospital'))\").each(function(item){\n $(this).remove();\n });\n }\n\n}", "title": "" }, { "docid": "ff41f8727698167cd6bcce44d5573a8c", "score": "0.6203332", "text": "function hideElements() {\n const list = document.getElementById(\"dog-breeds\");\n const ListItems = list.getElementsByTagName(\"li\");\n if (event.type === \"click\") {\n let targetValue = event.target.value;\n for(let item of ListItems){\n if (item.textContent.charAt(0) !== targetValue && item.textContent !== \"---sort by:---\") { \n item.style.display = \"none\";\n }else{\n \n console.log(\"foo\");\n item.style.display = \"\";\n }\n }\n \n }\n}", "title": "" }, { "docid": "074e0239eeb584dedf4ffb38c2484fd9", "score": "0.6201021", "text": "function hideStaffList() {\n document.getElementById(\"staffListHeader\").style.visibility = \"hidden\";\n document.getElementById(\"staffList\").style.visibility = \"hidden\";\n document.getElementById(\"Staffdetail\").style.visibility = \"hidden\";\n \n}", "title": "" }, { "docid": "bb28b9afdd31619f9d48d722f260627c", "score": "0.6200078", "text": "function hideAllItems() {\n $('tbody tr').each(function () {\n $(this).css('display', 'none');\n });\n }", "title": "" }, { "docid": "2245f92e7bffb789b3c6d6a58599582c", "score": "0.61986053", "text": "function displayFilteredList(filteredList) {\n // clear the gallery\n gallery.innerHTML = \"\";\n\n // display the filtered list\n filteredList.forEach(business => {\n displayListBusiness(business);\n });\n}", "title": "" }, { "docid": "7fc784f6f55dca49aa23ab368e4a27ab", "score": "0.61965543", "text": "function showPage(list,page){\n\t\n\tlet startIndex = (page * numberOfEntriesPerPage) - numberOfEntriesPerPage;\n\tlet endIndex = page * numberOfEntriesPerPage;\n\t\n\tresetAndHideAllLists(list);// This function hides all the DOM elements of all students \n\t\n\tfor(let i = startIndex; i < endIndex ; i++){\n\t\t\n\t\tif(list[i]){\n\t\t\t\n\t\t\tlist[i].style.display = 'block';\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n}", "title": "" }, { "docid": "156f837673b1a2d7b0a4a2b588dd0cd2", "score": "0.61930066", "text": "function hideMarkers() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setVisible(false);\n }\n}", "title": "" }, { "docid": "5aa64ca699711f54f219e48f1fcab375", "score": "0.618708", "text": "function showAll() {\n let commonName = document.getElementsByTagName(\"h3\");\n let animalsList = document.getElementsByTagName(\"li\");\n\n for (var x = 0; x < commonName.length; x++) \n {\n animalsList[x + 1].style.display = \"block\";\n }\n\n animalsList[0].style.display = \"none\";\n}", "title": "" }, { "docid": "018c29e6756ea083e7a7a3825240b2eb", "score": "0.6184093", "text": "function list_noResults() {\n $(\"div.list-container > div.list-item\").remove()\n $(\"div.list-container\").addClass(\"list-container-empty\")\n $(\"div.list-container > span.list-none\").show()\n $(\"div.list-container > span.list-start\").hide()\n}", "title": "" }, { "docid": "3b49e2e557d98043d9467abbbdcbb5ee", "score": "0.61816806", "text": "function hidestudents(){ \n\tstudentItems.hide();\n\t\n}", "title": "" }, { "docid": "27df68b43633441bdc381f9b68e1857a", "score": "0.616743", "text": "hide() {\n $(HTML_ID_EMPTY_ARTICLE_LIST).hide();\n $(HTML_CLASS_TOUR).removeClass(HTML_CLASS_NAME_WIGGLE);\n $(HTML_CLASS_MDL_BURGER).removeClass(HTML_CLASS_NAME_WIGGLE);\n }", "title": "" }, { "docid": "068a945051a2dc27f0d04ac60c9e4555", "score": "0.61657006", "text": "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm,\n $favoritedArticles,\n $editForm\n ];\n elementsArr.forEach($elem => $elem.hide());\n }", "title": "" }, { "docid": "c4d8802aef975b86980d06fba5e70132", "score": "0.6164591", "text": "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $favoritedArticles,\n $loginForm,\n $createAccountForm\n ];\n elementsArr.forEach($elem => $elem.hide());\n }", "title": "" }, { "docid": "6a1571428ac43a99a5340b9182fe7c57", "score": "0.6164413", "text": "function hideElements() {\n\t\tconst elementsArr = [\n\t\t\t$submitForm,\n\t\t\t$allStoriesList,\n\t\t\t$userStories,\n\t\t\t$loginForm,\n\t\t\t$createAccountForm,\n\t\t\t$favoritedStories,\n\t\t\t$userProfileInfo\n\t\t]\n\t\telementsArr.forEach(($elem) => $elem.hide())\n\t}", "title": "" }, { "docid": "571e60589de46032b6407b98a8886eb0", "score": "0.6161774", "text": "function filterPeople(){\n hideshowperson('tutor');\n hideshowperson('student');\n}", "title": "" }, { "docid": "7f3764a7c5648a9addda1900dd74c514", "score": "0.616095", "text": "function showToggle(type) {\n $('.listings').children().addClass('hidden');\n var $el = $('.listings').find('.' + type);\n $el.removeClass('hidden');\n}", "title": "" }, { "docid": "db03792c2f8d54bea08ab6ef20d27d0e", "score": "0.6155249", "text": "function noListing() {\n\t$('.noListing').remove();\n}", "title": "" }, { "docid": "6942da773f9ef4056ee88360d94584c2", "score": "0.6153105", "text": "function hideDisplay(elementsList) {\n \"use strict\";\n for (var i=0;i<elementsList.length;i++) {\n document.getElementById(elementsList[i]).style.display = \"none\";\n }\n}", "title": "" }, { "docid": "ec2b0270b5564c718e58a634dd036431", "score": "0.61475194", "text": "function hideAll()\n{\n\tif ( dom )\n\t{\n\t\tfor (i = 0; i < count_div_ids ; i++)\n\t\t{\n\t\t\tfull_item_id = drop_id + i;\n\t\t\tif ( document.getElementById( full_item_id )\t)// test to make sure element id exists\n\t\t\t{\n\t\t\t\thideElement( full_item_id );\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9c5d1aa5094cfbab917e1611634ffeeb", "score": "0.61348814", "text": "function hideList(list, list2) {\n if (list === undefined && list2 === undefined) {\n ingredientsList.style.display = 'none';\n devicesList.style.display = 'none';\n utensilsList.style.display = 'none';\n } else {\n list.style.display = 'none';\n if (list2 != undefined) {\n list2.style.display = 'none';\n }\n }\n}", "title": "" }, { "docid": "3b506a11adb7e534ffca67f54ffc4f20", "score": "0.61257017", "text": "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm\n ];\n elementsArr.forEach($elem => $elem.hide());\n }", "title": "" }, { "docid": "3b506a11adb7e534ffca67f54ffc4f20", "score": "0.61257017", "text": "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm\n ];\n elementsArr.forEach($elem => $elem.hide());\n }", "title": "" }, { "docid": "6b2d5a305d5060baaafefeff561a70d4", "score": "0.61222464", "text": "function hideMarkers() {\n for (var i = 0; i < Markers().length; i++) {\n Markers()[i].setVisible(false);\n }\n}", "title": "" }, { "docid": "bdb794d88b35c16c43f9d8de2386a54a", "score": "0.61177266", "text": "function showPage( list, page ) {\t\n\t\tconst startIndex = ( page * maxItems ) - maxItems;\n\t\tconst endIndex = ( page * maxItems ) - 1;\n\n //This for loop will display only 10 students and hide all the rest.\n\t\tfor( let i = 0; i < list.length; i ++ ) {\n\t\t\tif( i >= startIndex && i <= endIndex ) {\n\t\t\t\tlist[i].style.display = 'block';\n } \n else {\n\t\t\t\tlist[i].style.display = 'none';\n\t\t\t}\t\n\t\t} \n}", "title": "" }, { "docid": "a46ff1ad533bf2a8fb2c81765216deb6", "score": "0.6116804", "text": "function hideAllStudents(){\n\tsetTimeout(function(){\n\n\t\tfor(var i = 0; i < students.length; i++){\n\t\t\n\t\t\tstudents[i].style.display = \"none\";\n\n\t\t}\n\n\t}, 50);\n}", "title": "" }, { "docid": "33cfd6b818a8e063517593a5166f61eb", "score": "0.6112102", "text": "function hideElements() {\n\t\tconst elementsArr = [ $allStoriesList, $ownStories, $('#favorited-articles') ];\n\t\telementsArr.forEach(($elem) => $elem.hide());\n\t}", "title": "" }, { "docid": "3b88c2e45b21827f87e3c3728de40221", "score": "0.6111537", "text": "function hideElements() {\n const elementsArr = [\n $submitForm,\n $allStoriesList,\n $filteredArticles,\n $favoritedArticles,\n $ownStories,\n $editArticleForm,\n $loginForm,\n $createAccountForm,\n $userProfile,\n $editUserForm\n\n ];\n elementsArr.forEach($elem => $elem.hide());\n }", "title": "" }, { "docid": "aa71ee6f1887f244ad036aa88c01c2fb", "score": "0.6109536", "text": "function showPage(page, list) { //takes in page number and the overall student list\r\n var start = (page * 10) - 10; //start index\r\n var end = (page * 10); //end index\r\n for (let i of names) { //initially hides all names\r\n i.style.display = \"none\";\r\n }\r\n for (let i = 0; i < list.length; i++) { \r\n if (i >= start && i < end) //if i falls within start and end index...\r\n list[i].style.display = \"block\"; //show the names\r\n }\r\n}", "title": "" }, { "docid": "c56dd1c476146ee5e390d449a0d24926", "score": "0.6108193", "text": "function hidePagesOffView() {\n var myObj = this;\n //only operate if pagination: scroll\n if( this.model.getOpt( 'pagination' ) !== 'scroll' || !this.model.getOpt( 'hide_unshown_items' ) ) {\n return;\n }\n\n var viewable = {\n min: (this.model.getCurPage() - 1) * this.model.get( 'items_per_page' ),\n max: (this.model.getCurPage() + 2) * this.model.get( 'items_per_page' )\n };\n //hide all, and then show only ones within viewable\n this.model.get( '$lis' ).each(function(k,v){\n if(k < viewable.min || k > viewable.max){\n $(this).css('display', 'none');\n } else {\n $(this).css('display', 'block');\n }\n });\n }", "title": "" }, { "docid": "61d6bfab5893c0a4584e7e7e14b41abd", "score": "0.6105474", "text": "function showPage(list) {\n // Removes student filter.\n for (let i = 0; i < students.length; i++) {\n students[i].style.display = '';\n }\n // Hides student information as needed.\n for (let i = 0; i < students.length; i++) {\n if (!list.includes(students[i])) {\n students[i].style.display = 'none';\n }\n }\n}", "title": "" }, { "docid": "b28894ce0aedf0ce22b019b1bce78d77", "score": "0.60990524", "text": "display_director_list(totalCount, directors) {\n // Check if there are any directors set\n if (directors.length === 0) {\n // There are no directors. Hide the director list section\n PLEX._director_list_section.style.display = 'none';\n return;\n }\n\n const numToShowBeforeHiding = 5; // Set how many directors to show before hiding the rest\n let count = 0; // Init how many directors there are\n let numHidden = 0; // Init how many rows are hidden\n let listHtml = `<li data-director=\"all\"><em>${totalCount}</em>All</li>`; // Init the list html\n\n // Loop through each director\n directors.forEach(director => {\n count += 1; // Increment the total director count\n // Check if needing to hide the director\n if (count <= numToShowBeforeHiding) {\n // Add director to the list html\n listHtml += `<li data-director=\"${director.director}\" class=\"director_shown\"><em>${director.count}</em>${director.director}</li>`;\n } else {\n // Hide the director\n numHidden += 1; // Increment hidden director count\n // Add director to the list html\n listHtml += `<li data-director=\"${director.director}\" class=\"director_hidden\"><em>${director.count}</em>${director.director}</li>`;\n }\n });\n\n // Check if there are any hidden genres\n if (numHidden > 0) {\n // Output show and hide elements\n listHtml += `<li id=\"director_show_all\">Show ${numHidden} more...</li>`;\n listHtml += `<li id=\"director_hide_all\">Show fewer...</li>`;\n }\n\n // Update the director list inner HTML\n PLEX._director_list.innerHTML = listHtml;\n\n // Check if wanting to show all directors\n if (PLEX.show_all_directors) {\n // Hide the show all element\n const directorShowAll = document.querySelector('#director_show_all');\n if (directorShowAll) {\n directorShowAll.style.display = 'none';\n }\n // Show all hidden directors\n document\n .querySelectorAll('.director_hidden')\n .forEach(directorHiddenElm => {\n directorHiddenElm.style.display = 'grid';\n });\n } else {\n // Hide hidden directors\n // Hide the hide all element\n const directorHideAll = document.querySelector('#director_hide_all');\n if (directorHideAll) {\n directorHideAll.style.display = 'none';\n }\n // Hide all hidden directors\n document\n .querySelectorAll('.director_hidden')\n .forEach(directorHiddenElm => {\n directorHiddenElm.style.display = 'none';\n });\n }\n\n // Remove current class from current director\n PLEX._director_list\n .querySelectorAll('li.current')\n .forEach(directorListLi => {\n directorListLi.classList.remove('current');\n });\n\n // Add current class to new current director\n document\n .querySelectorAll(`li[data-director=\"${PLEX.current_director}\"]`)\n .forEach(dataDirectorLi => {\n if (!dataDirectorLi.classList.contains('current'))\n dataDirectorLi.classList.add('current');\n });\n\n // Show the director list section\n PLEX._director_list_section.style.display = 'block';\n }", "title": "" }, { "docid": "030e3d1e6de0e0ed0e4e520276f17da9", "score": "0.60959923", "text": "function doHide (step, list, step_len, id) {\r\n\tvar start = step * step_len;\r\n\tvar end = start + step_len; \r\n\tif (end >= _glow.dom.get(list).length) {\r\n\t\tlist.slice(start).hide();\r\n\t\tgetTotalDeaths(id);\r\n\t} else {\r\n\t\tlist.slice(start, end).hide();\r\n\t\tsetTimeout(function() {doHide(++step, list, step_len, id)}, 70);\r\n\t}\r\n}", "title": "" }, { "docid": "eca9ef1e538f9aa3445ecceb1db59110", "score": "0.60885304", "text": "showAll(){\n All();\n this.state.all.forEach(function(item){\n\n document.getElementById(item.id2).style.display = 'block';\n })\n }", "title": "" }, { "docid": "cb6ff37c9dfc5392c02a307d63e1fc7c", "score": "0.6087194", "text": "function clientHide() {\n // TODO: Turn this into a multidemensional array\n // Items with a closest LI that needs to be hidden\n var li = [\n '#container nav ul li a[title=\"Guidance\"]',\n '#container nav ul li a[title=\"Toolbox\"]',\n '#container nav ul li a[title=\"University\"]',\n '#container nav ul li a[title=\"Administration\"]',\n \"#subnav_icon_container a:not(#BookmarkPage_Button)\"\n ];\n\n // Items with a closest TD that needs to be hidden\n var td = [\n 'table[id*=\"view_module\"] div[class=\"checkbox-wrapper\"]',\n '#view_patterns_container div[class=\"checkbox-wrapper\"]'\n ];\n\n // Items with a closest TH that needs to be hidden\n var th = [\n 'table[id*=\"view_module\"] div[class=\"checkbox-wrapper\"]',\n '#view_patterns_container div[class=\"checkbox-wrapper\"]'\n ];\n\n // Items without a closest element that needs to be hidden\n var none = [\n \"#secondary-header div\",\n 'table[id*=\"view_module\"] td[class*=\"actions\"]',\n 'table[id*=\"view_module\"] th[class=\"actions\"]',\n \"#MODULE_TAB_CONFIRMED-content div.bulk_actions_container\",\n '#modules_wrapper a[class=\"dt-button\"]',\n '#instances_wrapper a[class=\"dt-button left\"]',\n \"#view_use_cases_container div.linear_table_header\",\n \"#view_use_cases_container div.bulk_actions_container\",\n \"#edit-instances\",\n \"#delete-instances\",\n \".bulk_actions_container\",\n \"#toggle-report-view-wrapper\",\n 'label[for=\"toggle-report-view\"'\n ];\n var i = \"0\";\n for (i = 0; i < li.length; i++) {\n hideElement(li[i], \"li\");\n }\n for (i = 0; i < td.length; i++) {\n hideElement(td[i], \"td\");\n }\n for (i = 0; i < th.length; i++) {\n hideElement(th[i], \"th\");\n }\n for (i = 0; i < none.length; i++) {\n hideElement(none[i]);\n }\n}", "title": "" }, { "docid": "18bb022e7dbe24efd6d5309e2e5ba100", "score": "0.60773134", "text": "function displayItems(items){\n\titems.forEach((item, i, arr) => {\n\t\titem.style.display = \"none\";\n\t\tlet itemToShow = arr.slice(0, 10);\n\t\titemToShow.forEach(el => el.style.display = \"block\")\n\t})\n}", "title": "" }, { "docid": "06e4e919075129e53a1ebf1ebdfb20b3", "score": "0.6071374", "text": "function Hide() {\n\n // console.log(\"hiiiii\");\n var temp = document.getElementById(\"outer-completed-todos\");\n //if(document.getElementById(\"completed-todos\").style.display == \"block\"){\n // temp.innerHTML =\"Show Completed Items\";\n document.getElementById(\"completed-todos\").style.display = \"none\";\n // console.log(\"in loop\");\n //}\n //else if(document.getElementById(\"completed-todos\").style.display == \"none\"){\n // temp.innerText =\"Show Completed Items\";\n // document.getElementById(\"completed-todos\").style.display = \"block\";\n //}\n}", "title": "" }, { "docid": "f4b08c88306261c0b216978ba3a3489d", "score": "0.60523295", "text": "function bc_mostrarlista() {\n if (Object.keys(clientes).length > 0) {\n if ($(\"ul#bc_lista_clientes\").is(\":visible\")) {\n $(\"ul#bc_lista_clientes\").hide();\n } else {\n $(\"ul#bc_lista_clientes\").show();\n }\n }\n}", "title": "" }, { "docid": "20acc45479277615fe62081d1c9f5961", "score": "0.60521704", "text": "function showAllMarkers() {\n for (var i = 0; i < locationList.length; i++) {\n if(locationList[i].marker) {\n locationList[i].marker.setVisible(true);\n }\n };\n}", "title": "" }, { "docid": "87f9161c4ee44e524e44611f63a3882b", "score": "0.6051114", "text": "function hideItems() {\n piecesSlider.hidePieces({items: [currentImageIndex, currentTextIndex, currentNumberIndex]});\n }", "title": "" }, { "docid": "1f9ac1867afb8d4cd4e2b4a1f634b1d7", "score": "0.6050086", "text": "function hideAllComponents() {\n $('#retrievedRepositoriesDisplay').hide();\n $('#repoDetailsPart').hide();\n\t$('#repoCorrespondantGraph').hide();\n}", "title": "" }, { "docid": "50e1134c01aed2af17b6864e0c3f79b2", "score": "0.6040105", "text": "function hideElements() {\n const elementsArr = [\n $submitForm,\n $favoriteArticles,\n $userProfile,\n $allStoriesList,\n $filteredArticles,\n $ownStories,\n $loginForm,\n $createAccountForm\n ];\n elementsArr.forEach($elem => $elem.hide());\n }", "title": "" }, { "docid": "348f7f6683eaaa145e6247f0ae759a0c", "score": "0.60313195", "text": "static hideAllShowSpecific() {\n document.getElementById('around-input').style.display = 'none';\n document.getElementById('specific-input').style.display = 'inline-block';\n }", "title": "" }, { "docid": "0c4c2033a37e5eeeb482a97564a38bda", "score": "0.6030521", "text": "function showTheTherapists() {\r\n\tdocument.querySelectorAll('.tab').forEach(function (tab) {\r\n\t\ttab.style.display = \"none\";\r\n\t})\r\n\tform.style.display = \"none\";\r\n\tlistTherapists.style.display = \"block\";\r\n}", "title": "" }, { "docid": "ddcfbf0e39c21af4d8c7fcc25c4043e3", "score": "0.60302687", "text": "function hideFilters() {\n\tvar filters = $$('dd.tags');\n\tfilters.each(function(filter) {\n\t\tvar tags = filter.select('input');\n\t\tvar selected = false;\n\t\ttags.each(function(tag) {if (tag.checked) selected=true});\n\t\tif (selected != true) {toggleFilters(filter.id, 0);}\n\t});\t\n}", "title": "" }, { "docid": "18bcae6ed75ec08d6e9183a39a3b21f3", "score": "0.602633", "text": "hide() {\n this._items.forEach(item => item._foundation.deactivate());\n }", "title": "" } ]
2ffc5cf31e8a47c4284bf43e331a3501
Base class helpers for the updating state of a component.
[ { "docid": "1b0018a926fddcebfbf89447af20d661", "score": "0.0", "text": "function PureComponent(props, context, updater) {\n // Duplicated from Component.\n this.props = props;\n this.context = context;\n this.refs = emptyObject;\n // We initialize the default updater but the real one gets injected by the\n // renderer.\n this.updater = updater || ReactNoopUpdateQueue;\n}", "title": "" } ]
[ { "docid": "20258e40dfc7da21724a6bbe465e6b21", "score": "0.69607294", "text": "update(state) {\n throw new Error('update() not implemented', this);\n }", "title": "" }, { "docid": "e64c007e32b591013d812a8b6cd48dcd", "score": "0.6764188", "text": "constructor(){\n\t\tsuper() // Super is the context of the state in the component\n\t\t// Create the state\n\t\tthis.state = {\n\t\t\ttxt: ''\n\t\t}\n\t\t// Bind update function this state\n\t\tthis.update = this.update.bind(this)\n\t}", "title": "" }, { "docid": "57f9e29264f13074ee813f5299357bec", "score": "0.6724619", "text": "constructor() {\n // We call super() to invoke the constructor of our extender class\n super();\n this.state = {\n txt: \"This is the state txt\",\n red: 0,\n green: 0,\n blue: 0\n };\n // Explicitly binding this inside a components constructor is very helpful\n // when we want to pass this method to another component, but we want to\n // make sure that it will reference the correct this\n this.update = this.update.bind(this);\n }", "title": "" }, { "docid": "a9558375c573022c8e7a2d3d9693893a", "score": "0.6690574", "text": "updateState(newState){\n \t \t//change parent State\t\n \t \tlet oldState = Object.create(this.state);\t\t//create new object to prevent overwritting the old state\n \t \tObject.assign(oldState, newState);\t\t\t\t//assign only what we want to change.\n \t \tthis.setState(oldState);\n \t }", "title": "" }, { "docid": "1451d711ca35aa416dc37096d9a4dc06", "score": "0.65878636", "text": "set component(value){this._component = value;}", "title": "" }, { "docid": "3f35be256971f323d5247ad9652f16b2", "score": "0.6476289", "text": "updateStateFromProps(props){\n this.setState(this.State(props));\n this.status('valid',this.isValid());\n }", "title": "" }, { "docid": "9a6efea4b57fb83fc6ca478c7e8a67eb", "score": "0.6385576", "text": "updated() {\n this.emit('core.state.updated', this)\n }", "title": "" }, { "docid": "fe3b7d6553d49669af06c587ab3de7a6", "score": "0.63831973", "text": "updateState() {\n this.state = this.state;\n }", "title": "" }, { "docid": "372a2cbddb743266e55ca0d953fcf0eb", "score": "0.63156223", "text": "update() { console.log('update() abstract method not implemented in ' + this.constructor.name); }", "title": "" }, { "docid": "c61619019f1d2616d7d593fff9ee3024", "score": "0.6284419", "text": "updateState() {\n\t\tdebug('updateState', this.state);\n\t\tthis.trigger(this.state);\n\t}", "title": "" }, { "docid": "b7878b607b4c4b163f7e726928623167", "score": "0.6282283", "text": "#updater() {\n this.componentWillUpdate();\n this.update(this.render())\n this.componentDidUpdate()\n }", "title": "" }, { "docid": "981493f9f7e6fa4cdc314f0944ebc6ac", "score": "0.62732583", "text": "methodUpdate(input, elem){\n this.setState({\n fetchType: input,\n element: elem\n })\n }", "title": "" }, { "docid": "8321d02315eee2fc12ae81be186cab25", "score": "0.62700856", "text": "constructor() {\n super();\n this.state = {\n txt: \"this is the state txt\",\n cat: 0, \n currentEvent: \"---\",\n a: '', \n b: '',\n }\n // if used with currentEvent will update to the type of event\n this.update = this.update.bind(this)\n }", "title": "" }, { "docid": "9fa9b8a30963521b24816fc93b14de22", "score": "0.6266675", "text": "_updateStateValue(prop, v) {\n return new Promise((resolve, reject) => {\n var c = this._component\n if(c.state && c.state[prop] !== undefined){\n var state = {}\n state[prop] = v\n c.setState(state, resolve)\n }else{\n c[prop] = v\n c.forceUpdate()\n resolve()\n }\n })\n }", "title": "" }, { "docid": "1f892fb40a2dc8c375a8a76138eadec7", "score": "0.62185365", "text": "function updated(updated) {\n this.setState({value: updated})\n // console.log(\"UVC I: \" + JSON.stringify(this.props.input));\n // console.log(\"UVC V: \" + JSON.stringify(updated));\n this.props.input.onChange(updated);\n // console.log(\"UVC II: \" + JSON.stringify(this.props.input));\n}", "title": "" }, { "docid": "6c5a53bf946ffe731fdd062534b8391f", "score": "0.6212556", "text": "selfUpdated() { }", "title": "" }, { "docid": "c750aa9b24b5d43faf55eb93b4a1166c", "score": "0.6181365", "text": "_stateChanged(state) {\n throw new Error('_stateChanged() not implemented', this);\n }", "title": "" }, { "docid": "6da72e088de652a07a9d3b06d27ede8d", "score": "0.6180027", "text": "updateState(data) {\n this.setState(data);\n }", "title": "" }, { "docid": "93b9f92bd3df6eda24e647d2bf73156d", "score": "0.61760336", "text": "sliderChange(sliderVal) {\n this.setState(state => ({\n value: sliderVal\n }));\n this.props.sliderChanged(sliderVal, this.props.sliderName); //this is a callback to wherever the component is initialised\n }", "title": "" }, { "docid": "12bf1c40914a3ccf248ecda7a6f76731", "score": "0.6163899", "text": "updateInput(key,value){\n\t\t//update react state by calling setState again\n\t\tthis.setState({\n\t\t\t[key]: value\n\t\t})\n\n\t}", "title": "" }, { "docid": "954d0e181406c5057d082338244181c7", "score": "0.61581206", "text": "updateItem() {\n this.setState(this.state);\n }", "title": "" }, { "docid": "40aad9e0b885c5f2a76102423615a102", "score": "0.6157695", "text": "componentUpdated(el, binding, vnode, oldVnode) {}", "title": "" }, { "docid": "8f9ff367795b6eabcfa6f602f4102648", "score": "0.61525756", "text": "render() {\n // const txt = this.props.txt;\n // When working with custom methods that we defined inside our components\n // like this.update from onChange - only for ES6 classes - we have to explicitly\n // bind this to the component, else it will be undefined, because the method is called\n // from the onChange event. If explicitly binding the method like so:\n // onChange={this.update.bind(this)} is too much, then we can explicitly bind it and assign\n // it to this inside the component's constructor method\n // return (\n // <div>\n // <h1>{txt}</h1>\n // <h2>{this.state.txt}</h2>\n // <input type=\"text\" onChange={this.update.bind(this)} \n // placeholder=\"fill in some state txt\" />\n // </div>\n // );\n // The above JSX code is equivalent to:\n // return React.createElement('h1', null, 'Hello from JS');\n // The second parameter is for props - here we can define the props obj\n // The last param is the value that will go inside the created element\n \n // On update={this.update} we use the bound update that we've declare in our\n // constructor\n return (\n <div>\n <Widget txt={this.state.txt} propsTxt={this.props.txt} update={this.update} />\n <Widget txt={this.state.txt} propsTxt={this.props.txt} update={this.update} />\n <Widget txt={this.state.txt} propsTxt={this.props.txt} update={this.update} />\n <hr />\n {this.state.txt}\n {\n /* we want each Slider component to update the value of either red, green\n or blue - for this we will need to edit the update() method and add the\n ref=\"state prop name\" attribute on the widget */\n }\n <Slider ref=\"red\" update={this.update} /> \n {this.state.red}\n <br />\n <Slider ref=\"green\" update={this.update} />\n {this.state.green}\n <br />\n <Slider ref=\"blue\" update={this.update} />\n {this.state.blue}\n <br />\n <hr />\n <Parent />\n </div> \n );\n }", "title": "" }, { "docid": "b41276785640594f9b57fc7641db2848", "score": "0.61284614", "text": "function setComponentState(componentId, key, value) {\r\n var componentState = getViewState(componentId);\r\n if (!componentState) {\r\n componentState = new Object();\r\n setViewState(componentId, componentState);\r\n }\r\n componentState[key] = value;\r\n}", "title": "" }, { "docid": "08ad388c3231ba8ad3e783a65512a8ea", "score": "0.60945463", "text": "componentDidUpdate(){\n tellTheWorld(\"Component was just updated!\")\n }", "title": "" }, { "docid": "9c09175f3685297cb40841c9af2510d2", "score": "0.60907596", "text": "updateStatus (value) {\n this.setState({value});\n }", "title": "" }, { "docid": "9c09175f3685297cb40841c9af2510d2", "score": "0.60907596", "text": "updateStatus (value) {\n this.setState({value});\n }", "title": "" }, { "docid": "9c09175f3685297cb40841c9af2510d2", "score": "0.60907596", "text": "updateStatus (value) {\n this.setState({value});\n }", "title": "" }, { "docid": "9c09175f3685297cb40841c9af2510d2", "score": "0.60907596", "text": "updateStatus (value) {\n this.setState({value});\n }", "title": "" }, { "docid": "9c09175f3685297cb40841c9af2510d2", "score": "0.60907596", "text": "updateStatus (value) {\n this.setState({value});\n }", "title": "" }, { "docid": "589f21e4e041f1d5ff941d1782752f35", "score": "0.60895276", "text": "function setComponentState(componentId, key, value) {\n var componentState = getViewState(componentId);\n if (!componentState) {\n componentState = new Object();\n setViewState(componentId, componentState);\n }\n componentState[key] = value;\n}", "title": "" }, { "docid": "ed0e94fe2e359f0202b40382e753fdf6", "score": "0.608374", "text": "onUpdateFromWidget() {\n }", "title": "" }, { "docid": "9abf2f51fbff09220b8b5546b6b6d46a", "score": "0.6073981", "text": "stateChanged(_state) {}", "title": "" }, { "docid": "1dc22ccaee3f5a67cb40768e7e5090cd", "score": "0.6064935", "text": "componentDidUpdate(prevProps, prevState) {\n if (this.state.values !== prevState.values && typeof this.props.onUpdate === 'function') {\n this.props.onUpdate(this.state.values);\n }\n }", "title": "" }, { "docid": "95ed37d7c0a885c64c64b2222b9f4c5d", "score": "0.60587925", "text": "stateChanged(state) {\n\n }", "title": "" }, { "docid": "7df6ecc07af2c9a469783a56823832b5", "score": "0.60378265", "text": "set(key, newValue){\n if(this.components[key]===undefined) throw `key \"${key}\" not found`;\n if(typeof newValue != 'number') throw `key \"${key}\" newValue (\"${newValue}\") is not a number`;\n if(newValue < 0) throw `key \"${key}\" newValue (\"${newValue}\") is negative`;\n //update state variable value\n this.components[key]=newValue;\n }", "title": "" }, { "docid": "3123f738361f0166bd44db0e1aee6351", "score": "0.60230917", "text": "componentDidUpdate(){\n console.log(\"state changed - component did update\");\n }", "title": "" }, { "docid": "7904a18b9d435566c6048944b84a275f", "score": "0.60185975", "text": "stateChanged(_state){}", "title": "" }, { "docid": "85bebb8666d3b92696e70ec78258c109", "score": "0.6000226", "text": "update(): void {\n for(let i = 0, l = this.mounts.length; i < l; i++) {\n const Component: Component = this.mounts[i];\n if(Component.stateless || Component.isolated) continue;\n Component.update();\n }\n\n const hasIgnoredStatefull: boolean = typeof this.ignoredStatefull !== 'undefined';\n if(hasIgnoredStatefull) {\n this.statefulls.splice(this.statefulls.indexOf(this.ignoredStatefull), 1);\n }\n\n for(let i = 0, l = this.statefulls.length; i < l; i++) {\n this.statefulls[i](this.selectedState || this.state, this);\n }\n\n if(hasIgnoredStatefull) {\n this.statefulls.push(this.ignoredStatefull);\n this.ignoredStatefull = undefined;\n }\n }", "title": "" }, { "docid": "a6020aa564484306b7ddacefb714ac5e", "score": "0.5985766", "text": "setState(partialState) {\n this.setChangeFlags({\n stateChanged: true\n });\n Object.assign(this.state, partialState);\n this.setNeedsRedraw();\n }", "title": "" }, { "docid": "4c72c2f2053c44da4a34657145fc6926", "score": "0.5983333", "text": "updateState(newState){\n\t\t\t//change parent State\t\n\t\t\tlet oldState = Object.create(this.state);\t\t//create new object to prevent overwritting the old state\n\t\t\tObject.assign(oldState, newState);\t\t\t\t//assign only what we want to change.\n\t\t\tthis.setState(oldState);\n\t\t\t//change child State indirectly, by passing down\n\t\t\t\t//if(this.state.selected)this.state.selected.undoSelection();\t\t\t\n\t\t\t\t//if(this.selected)\tthis.selected = null;\n\t\t}", "title": "" }, { "docid": "a11fe669669b859654d2e8b5ac1a6a88", "score": "0.5980702", "text": "update(a, b) {\n let typeArg = _Util_main_js__WEBPACK_IMPORTED_MODULE_0__.default.getType(a);\n switch (typeArg) {\n case \"Function\":\n this._state = a(this._state);\n break;\n case \"String\":\n this._state[a] = b(this._state, this.state(a));\n break;\n default:\n throw new yngwie__WEBPACK_IMPORTED_MODULE_1__.Error(\"Argument passed to yngwieModel.update is of an unsupported type\", typeArg);\n }\n return this;\n }", "title": "" }, { "docid": "1f8c46fc80073e5f65aaf829817a07a6", "score": "0.5975352", "text": "_StateChanged(state, newValue) { }", "title": "" }, { "docid": "5eab3316f008fc2bb26592c459e5dc8a", "score": "0.5973498", "text": "handleState(state) {\n Object.assign(this, state);\n }", "title": "" }, { "docid": "6e6fbd26f41c5dab5a8b1d959cb29200", "score": "0.59602666", "text": "constructor(props) {\n super(props);\n this.state = {value: props.shelf}\n // this.updateCallback = this.updateCallback.bind(this)\n }", "title": "" }, { "docid": "abd14deb5075c385e72dbc432d35d277", "score": "0.59498054", "text": "componentDidUpdate(prevState) {\n\n\n\n }", "title": "" }, { "docid": "02768bb20df2c433b28b9d506ebd2032", "score": "0.59476584", "text": "componentDidUpdate(prevProps) {\n //needed so that labels aren't on top of data when the edit form opens\n M.updateTextFields();\n //needed so that dropdown shows its value\n $('select#phase').formSelect();\n if(this.props.forceReset) {\n this.resetState();\n //setting mainInterface's forceReset to false will avoid infinite loop\n this.props.onForceReset();\n }\n if(this.props.divisionToLoad != null) {\n this.loadDivision();\n //setting mainInterface's editWhichDivision to null will avoid infinite loop\n this.props.onLoadDivInModal();\n }\n }", "title": "" }, { "docid": "b666e5feadde13089dd41945e9d022b3", "score": "0.5945642", "text": "update()\n\t{\n\t\t//TODO:\n\t}", "title": "" }, { "docid": "55e3c3da08317772dad775bc876c9047", "score": "0.59440976", "text": "refreshComponent(){\n\n\t}", "title": "" }, { "docid": "0a387603201d4c6693a55661d08589ae", "score": "0.59438294", "text": "handleThinkingChange(value) {\n this.setState(value);\n }", "title": "" }, { "docid": "23202c5af419a685dd7cf89d8702d682", "score": "0.5943035", "text": "update(e) {\n // setState() is part of ReactComponent API\n this.setState({txt: e.target.value})\n }", "title": "" }, { "docid": "bbb0c3256b5952320bb95c3ba6519852", "score": "0.59409463", "text": "updateStatusComponents(){\n const uniqueDeviceId = 'default'; //TODO: gets the device id \n\n // Powet state management\n if( this._status.power === 1 ){\n if(this.markDeviceOn){ \n this.markDeviceOn(uniqueDeviceId);\n }\n }\n else {\n if(this.markDeviceOff) {\n this.markDeviceOff(uniqueDeviceId);\n }\n }\n\n // Stops the interval increment by one second for the slider update.\n // It will be restarted below if needed.\n if( this.durationInterval ){\n clearInterval( this.durationInterval );\n this.durationInterval = null;\n } \n\n if( this._status.mode == 'play' ){\n if( this.sendComponentUpdate ) {\n // Slider duration management\n let value = this._cache['duration'] = Math.round( this._status.time / this._status.duration * 100 );\n\n if( this._settings.pollingDelay >= 2 ) {\n const durationIncrement = (1 / this._status.duration) * 100\n this.durationInterval = setInterval( () => {\n this.sendComponentUpdate({ uniqueDeviceId, component: 'duration', value });\n value += durationIncrement;\n }, 1 * 1000 );\n } else {\n // If the polling is every seconds, updates the slider directly...\n if( this._shouldSendUpdate('duration'))\n this.sendComponentUpdate({ uniqueDeviceId, component: 'duration', value });\n }\n }\n } \n }", "title": "" }, { "docid": "ec210b67b9de5e44c78d552f1eeaeea4", "score": "0.5931076", "text": "componentWillUpdate(){\n tellTheWorld(\"Component is about to update\")\n }", "title": "" }, { "docid": "e7247a1f196412304624192a2ff5e6d8", "score": "0.5930299", "text": "componentDidUpdate(prevProps, prevState) {\n if (prevState.value !== this.state.value) {\n this.props.handleButton(this.state.value);\n }\n }", "title": "" }, { "docid": "fb155caa019a17ed86e50818ad177022", "score": "0.59252995", "text": "setState(inputState) {\n this.currentState = inputState;\n }", "title": "" }, { "docid": "769960e29230d72bdeafb0928ed20bdb", "score": "0.5919995", "text": "setState(state) {\n // TODO\n }", "title": "" }, { "docid": "ae8a22a9136b041fb0f77c09319f73dd", "score": "0.59188473", "text": "constructor() {\n // super help start up the components\n // super will only be used if we extends Components\n super();\n\n // if state changes it trigger another re-render\n this.state = { name: 'Tom', role: 'Supervisor' }; // Luke isn't being used...\n }", "title": "" }, { "docid": "1ecaccbe1f18e3f385f1b3ea4c999929", "score": "0.59062123", "text": "shouldComponentUpdate(newProps, newState) {\r\n return true;\r\n }", "title": "" }, { "docid": "bd7c99d5f259213516c8f85e0c188c91", "score": "0.5901579", "text": "constructor(props) {\n super(props);\n\n this.state = {\n name: '',\n email: '',\n subject: '',\n message: '',\n count: 0\n }\n // i understand bnd statements arent required anymore\n\n this.updateName = this.updateName.bind(this);\n this.updateEmail = this.updateEmail.bind(this);\n this.updateSubject = this.updateSubject.bind(this);\n this.updateMessage = this.updateMessage.bind(this);\n this.handleSubmit = this.handleSubmit.bind(this);\n }", "title": "" }, { "docid": "b93efbc76e3079eb2008fa779cba7375", "score": "0.58958375", "text": "update(e){\n this.setState({\n a: this.a.value,\n b: this.refs.b.value,\n c: ReactDOM.findDOMNode(this.c).value\n })\n }", "title": "" }, { "docid": "775bd0b5a6e430ebf0b0da60a9954992", "score": "0.58942413", "text": "_update(){}", "title": "" }, { "docid": "5bd5531cbbc129f67b965b068a8e6ade", "score": "0.5888679", "text": "function o(){var t=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=t&&this.setState(t)}", "title": "" }, { "docid": "764b13a822e3d8458bc9aac7a441229a", "score": "0.5882287", "text": "update(props, oldProps) {\n //init state\n this.residual(props,oldProps)\n \n // if (props.state==0){\n // console.log(\"state=0\")\n // this.step0(props,oldProps)\n // }\n // else if (props.state==1){\n \n // console.log(\"state=1\")\n // }\n // else{\n // this.svg\n // .selectAll('line')\n // .attr(\"stroke\",\"black\")\n // console.log(\"state=else\")\n // }\n }", "title": "" }, { "docid": "84902e0608780b1f517b076cee75502e", "score": "0.58780694", "text": "constructor(){\n super();\n console.log(`this value after super call`, this);\n this.state = {\n txt: \"this is the state text\"\n };\n console.log(`this value after state`, this);\n\n // shortcut to force this.update to always have this \"this\" in its execution context\n this.update = this.update.bind(this);\n }", "title": "" }, { "docid": "2a5504b9d9cae4ffbd94ee825b5bfa74", "score": "0.5868988", "text": "onChange(newState) {\r\n this.setState(newState);\r\n }", "title": "" }, { "docid": "6c32ab6e09c1e5c9cb1ad61a56a5ba0e", "score": "0.5866358", "text": "stateUpdated(state){\n\t\tconst {\n\t\t\tactiveIndex\n\t\t} = state;\n\n\t\tconst activeThumbId = `thumb-${activeIndex}`;\n\t\tconst activeThumb = this.inputs.find(input => input.id === activeThumbId);\n\n\t\tconst { \n\t\t\tvalue: imageSrc, \n\t\t\tdataset: { description }\n\t\t} = activeThumb;\n\n\t\tactiveThumb.checked = true;\n\t\tthis.mainImg.alt = description\n\t\tthis.mainImg.src = imageSrc;\n\t\tthis.voidImg.style.backgroundImage = `url(${imageSrc})`;\n\t}", "title": "" }, { "docid": "b8b258b52fa73347b4c6dd71db7ac0f9", "score": "0.586505", "text": "__update__(){\n VIRTUAL_BUTTONS_OLD_STATE = {...VIRTUAL_BUTTONS_STATE};\n\n for(let i=0; i<INTERFACES_ENABLED.length; i++){\n let _interface = INTERFACES[ INTERFACES_ENABLED[i] ];\n if( _interface.hasOwnProperty( 'update' ) ) _interface.update();\n }\n }", "title": "" }, { "docid": "4819fb4314070f71f79e9d89ccfa9869", "score": "0.5861968", "text": "update(){\n this.updateStatus().then( this.updateStatusComponents.bind( this ) );\n this.updateSong().then( this.updateSongComponents.bind( this ) );\n }", "title": "" }, { "docid": "c6865091b2b2af1ad2d90eb6033d7bae", "score": "0.5861627", "text": "handleValuesChange(component, value) {\n\t\tthis.setState({\n\t\t\tvalue: value,\n\t\t});\n\t}", "title": "" }, { "docid": "d073856fa32f34409dbfe34f8d47b0dd", "score": "0.5858354", "text": "update(property) {\n return e => this.setState({[property]: e.target.value});\n }", "title": "" }, { "docid": "6155fe3b33c77ef91484542082826c38", "score": "0.5854311", "text": "componentWillUpdate(nextProps) {\n if (this.props.value !== nextProps.value) {\n this.setState({ value: this.props.value });\n }\n }", "title": "" }, { "docid": "4dc2ec504e8376a5984826d9b986a9b3", "score": "0.58470494", "text": "changeState() { \n \n \n}", "title": "" }, { "docid": "cda47de3869bb5f4339afcc2decd7d4b", "score": "0.58465946", "text": "setState(updater, callback = null) {\n // register the callback\n if (callback && typeof callback === 'function') {\n this._rrls_cb = callback\n }\n\n // merge old state with state from updater\n let newState = {}\n if (typeof updater === 'function') {\n newState = {...this.state, ...updater(this.state, this.props)}\n } else if (typeof updater === 'object') {\n newState = {...this.state, ...updater}\n } else {\n throw 'setState must be passed a function or an object'\n }\n\n // fire redux action with new state\n this.props.setComponentState(componentName, newState)\n }", "title": "" }, { "docid": "ac3203f8010334df4ae803389383c3b9", "score": "0.58457947", "text": "increment () { //Update state\n this.props.incrementMethod(this.props.by); \n\n// this.setState( // THIS IS A MERGE\n// { counter : this.state.counter + this.props.by }\n// );\n }", "title": "" }, { "docid": "66ef9bfe7c7ceb8194028587a79294c3", "score": "0.58348113", "text": "onChangeStatus(e) {\n this.setState({\n status: e.target.value,\n changed:true,\n });\n}", "title": "" }, { "docid": "196dd088275dbef200ba7c377d7225d5", "score": "0.5833969", "text": "componentDidUpdate(prevProps) {\n const value = this.props.value\n if (value !== prevProps.value) {\n this.setState({ value })\n }\n }", "title": "" }, { "docid": "d956af1cf324992bdbde954cd6adb2d5", "score": "0.5830436", "text": "_setState () {\n // console.log('change');\n }", "title": "" }, { "docid": "45806e7be1e94bfb23db884ff3835760", "score": "0.582866", "text": "_onChange() {\n let object = this._tool.selected;\n if (object === undefined || object === null)\n return;\n for (let key in this._component) {\n if (key[0] === '_')\n continue;\n let value = this._component[key];\n let type = typeof (value);\n switch (type) {\n case 'boolean':\n break;\n case 'number':\n let drawer = this._drawers[key];\n let newValue = drawer.getValue();\n if (newValue !== value) {\n // TODO : 컴멘더로 실행해야 한다.\n //this._tool.execute( new SetComponentPropertyCommand( object, newValue ) );\n this._component[key] = newValue;\n }\n break;\n case 'string':\n break;\n case 'object':\n break;\n }\n }\n }", "title": "" }, { "docid": "e68b9bce48623d04f69b0c1538c98015", "score": "0.5828656", "text": "onChange(state){\n this.props.onUpdateTask(state);\n }", "title": "" }, { "docid": "4ae6c1a39b41ff58a5ae209f0b3a7a33", "score": "0.5824373", "text": "shouldComponentUpdate() {}", "title": "" }, { "docid": "87821d4a6c9fcc50b1d5ebdcca999cd2", "score": "0.5821443", "text": "onInstanceChange (eventData) {\n // only use SET\n if (eventData.method === 'set') {\n Axial.log({\n method: 'component.binding.changed',\n component: this,\n property: eventData.property,\n oldValue: eventData.oldValue,\n newValue: eventData.newValue,\n event: eventData\n });\n if (eventData.value === eventData.oldValue) {\n Axial.log({\n method: 'component.binding.equal',\n property: eventData.property,\n event: eventData\n });\n return;\n }\n Axial.log({\n method: 'component.binding.difference',\n property: eventData.property,\n event: eventData\n });\n const state = {};\n state[eventData.instance.toString() + ':' + eventData.property.key] = eventData.value;\n this.setState(state);\n }\n }", "title": "" }, { "docid": "2d6decd94812fdeb8a6d03378541f7ba", "score": "0.5818987", "text": "function setState(newValue) {\n var NEWSTATE = $.extend({}, CALCULATOR, newValue)\n console.log('State updated:', NEWSTATE)\n CALCULATOR = NEWSTATE\n // render(CALCULATOR)\n }", "title": "" }, { "docid": "5cfd1fa745d815bb3216f5d61cb2ba61", "score": "0.58180845", "text": "componentDidUpdate() {\n\t\t/* preserve context */\n\t\tconst _this = this;\n\t}", "title": "" }, { "docid": "d8d885b86f0b6d249bf3dca128dfee04", "score": "0.58164585", "text": "updateStateValue(prop, v) {\n return new Promise((resolve) => {\n const c = this.component;\n if (c.state && c.state[prop] !== undefined) {\n const state = {};\n state[prop] = v;\n c.setState(state, resolve);\n } else {\n c[prop] = v;\n c.forceUpdate();\n resolve();\n }\n });\n }", "title": "" }, { "docid": "7a09612e0640b885303ad9bc2190a332", "score": "0.5816425", "text": "constructor() {\r\n super(); //this will call the all important super functions\r\n this.state = {\r\n name: \"Flekenstine\"\r\n }; // Super object for this component changing this will change everything\r\n }", "title": "" }, { "docid": "2c3c2ae6359343ce32ff6479198eb9f6", "score": "0.5813637", "text": "_onChange() {\n this.setState(getListState());\n this.setState(getCartState());\n }", "title": "" }, { "docid": "a93a7af76ec71b679178c08ce4faedcb", "score": "0.58085114", "text": "contstructor (props){\n //will call constructor\n super()\n //invent property to attach new input newItem\n // this.state = props\n // this.state.newItem = \"\"\n this.state = props\n }", "title": "" }, { "docid": "7228baa476524a28373a0bfaeb815219", "score": "0.580713", "text": "updateState(key,value) {\r\n\t\tthis.setState({[key]:value});\r\n\t}", "title": "" }, { "docid": "f0b645cc9f53b364a4f2ba0c1ba2a38e", "score": "0.58059293", "text": "genericSync(event) {\n const { name, value } = event.target;\n this.setState({ [name]: value });\n }", "title": "" }, { "docid": "2f1767b45c00e407b62de27232fce28d", "score": "0.58001685", "text": "_requestUpdate(name,oldValue){let shouldRequestUpdate=!0;// If we have a property key, perform property update steps.\nif(name!==void 0){const ctor=this.constructor,options=ctor._classProperties.get(name)||defaultPropertyDeclaration;if(ctor._valueHasChanged(this[name],oldValue,options.hasChanged)){if(!this._changedProperties.has(name)){this._changedProperties.set(name,oldValue)}// Add to reflecting properties set.\n// Note, it's important that every change has a chance to add the\n// property to `_reflectingProperties`. This ensures setting\n// attribute + property reflects correctly.\nif(!0===options.reflect&&!(this._updateState&STATE_IS_REFLECTING_TO_PROPERTY)){if(this._reflectingProperties===void 0){this._reflectingProperties=new Map}this._reflectingProperties.set(name,options)}}else{// Abort the request if the property should not be considered changed.\nshouldRequestUpdate=!1}}if(!this._hasRequestedUpdate&&shouldRequestUpdate){this._enqueueUpdate()}}", "title": "" }, { "docid": "2278ec676020c32aed60a2b90cd41fd6", "score": "0.57872534", "text": "componentWillUpdate(nextProps, nextState) {}", "title": "" }, { "docid": "7ff3040a90b284f55e74acfd51dabc54", "score": "0.5784286", "text": "updateImmediate(newState) {\n }", "title": "" }, { "docid": "1927e8671ff38cd263bdf1be7b9f2426", "score": "0.5782544", "text": "function setState(param,cb) {\n if(_.isFunction(param)) {\n this.state = param(this.state,this.props);\n } else {\n this.state = Object.assign({},this.state,param)\n if(!_.isNil(cb)) {\n cb(this.state)\n }\n }\n \n if(this.state.mouseOver && this.state.mouseClicked) {\n this.props.onClickHandler(this.props._id, this.state.mouseBtn) \n }\n \n \n \n if(shouldUpdate) {\n this.render()\n }\n \n \n return this.state\n }", "title": "" }, { "docid": "ec510b816f5d35892253de80f0a32c73", "score": "0.5780933", "text": "onPropertyChanged(newProp, oldProp) {\n let wrapper = this.getWrapper();\n for (let prop of Object.keys(newProp)) {\n switch (prop) {\n case 'checked':\n this.changeState(newProp.checked);\n break;\n case 'disabled':\n if (newProp.disabled) {\n this.setDisabled();\n this.unWireEvents();\n }\n else {\n this.element.disabled = false;\n wrapper.classList.remove(DISABLED$1);\n wrapper.setAttribute('aria-disabled', 'false');\n this.wireEvents();\n }\n break;\n case 'value':\n this.element.setAttribute('value', newProp.value);\n break;\n case 'name':\n this.element.setAttribute('name', newProp.name);\n break;\n case 'onLabel':\n case 'offLabel':\n this.setLabel(newProp.onLabel, newProp.offLabel);\n break;\n case 'enableRtl':\n if (newProp.enableRtl) {\n wrapper.classList.add(RTL$2);\n }\n else {\n wrapper.classList.remove(RTL$2);\n }\n break;\n case 'cssClass':\n if (oldProp.cssClass) {\n Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"removeClass\"])([wrapper], oldProp.cssClass.split(' '));\n }\n if (newProp.cssClass) {\n Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"addClass\"])([wrapper], newProp.cssClass.split(' '));\n }\n break;\n }\n }\n }", "title": "" }, { "docid": "bd16401417ec46f6a8d8362683ceb9b5", "score": "0.57809085", "text": "componentDidUpdate(prevProps, prevState) {\n const { state, node } = this;\n\n if (state !== prevState) {\n Object.values(state).forEach(control => node.append(control));\n }\n }", "title": "" }, { "docid": "bbbdd99605d9aab5970bf56cc6a5ccbb", "score": "0.57801664", "text": "_updateStateButtonPress() {\n this.props.onSetState(this.state.text);\n }", "title": "" }, { "docid": "38bfdf02af01e5ee971bf43f3d5a207c", "score": "0.5779276", "text": "_requestUpdate(name,oldValue){let shouldRequestUpdate=!0;// If we have a property key, perform property update steps.\nif(void 0!==name){const ctor=this.constructor,options=ctor._classProperties.get(name)||defaultPropertyDeclaration$1;if(ctor._valueHasChanged(this[name],oldValue,options.hasChanged)){if(!this._changedProperties.has(name)){this._changedProperties.set(name,oldValue)}// Add to reflecting properties set.\n// Note, it's important that every change has a chance to add the\n// property to `_reflectingProperties`. This ensures setting\n// attribute + property reflects correctly.\nif(!0===options.reflect&&!(this._updateState&STATE_IS_REFLECTING_TO_PROPERTY$1)){if(void 0===this._reflectingProperties){this._reflectingProperties=new Map}this._reflectingProperties.set(name,options)}}else{// Abort the request if the property should not be considered changed.\nshouldRequestUpdate=!1}}if(!this._hasRequestedUpdate&&shouldRequestUpdate){this._enqueueUpdate()}}", "title": "" }, { "docid": "ed7a6bb2b13ce0c55a682203be6eaf6e", "score": "0.5778513", "text": "update(e) {\n // it will change state of txt but not state of cat\n this.setState({\n txt: e.target.value,\n currentEvent: e.type,\n a: this.refs.a.value, // only change based on reference a\n b: this.refs.b.value // only change based on reference b\n })\n }", "title": "" }, { "docid": "13bad438f32c247a6e6426c43cfec42f", "score": "0.5777235", "text": "needsUpdate() {\n this.state.needsUpdate = true;\n }", "title": "" }, { "docid": "021aa7d0b4d5189c5894f010404fb49b", "score": "0.57747626", "text": "_update() {\n // Call subclass lifecycle method\n const stateNeedsUpdate = this.needsUpdate(); // End lifecycle method\n\n Object(_debug__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(TRACE_UPDATE, this, stateNeedsUpdate);\n\n if (!stateNeedsUpdate) {\n return;\n }\n\n const currentProps = this.props;\n const context = this.context;\n const internalState = this.internalState;\n const currentViewport = context.viewport;\n\n const propsInTransition = this._updateUniformTransition();\n\n internalState.propsInTransition = propsInTransition; // Overwrite this.context.viewport during update to use the last activated viewport on this layer\n // In multi-view applications, a layer may only be drawn in one of the views\n // Which would make the \"active\" viewport different from the shared context\n\n context.viewport = internalState.viewport || currentViewport; // Overwrite this.props during update to use in-transition prop values\n\n this.props = propsInTransition;\n\n try {\n const updateParams = this._getUpdateParams();\n\n const oldModels = this.getModels(); // Safely call subclass lifecycle methods\n\n if (context.gl) {\n this.updateState(updateParams);\n } else {\n try {\n this.updateState(updateParams);\n } catch (error) {// ignore error if gl context is missing\n }\n } // Execute extension updates\n\n\n for (const extension of this.props.extensions) {\n extension.updateState.call(this, updateParams, extension);\n }\n\n const modelChanged = this.getModels()[0] !== oldModels[0];\n\n this._postUpdate(updateParams, modelChanged); // End subclass lifecycle methods\n\n } finally {\n // Restore shared context\n context.viewport = currentViewport;\n this.props = currentProps;\n\n this._clearChangeFlags();\n\n internalState.needsUpdate = false;\n internalState.resetOldProps();\n }\n }", "title": "" }, { "docid": "4368a983442fc670f3d9d300ceb73c80", "score": "0.5773469", "text": "componentDidUpdate(){}", "title": "" } ]
0a962e05810186d7fa0685c0a4390ac5
(public) return value as short (assumes DB>=16)
[ { "docid": "966cf13aa01e4bce744a287efbf98fb8", "score": "0.72289246", "text": "function bnShortValue() {\n return (this.t == 0) ? this.s : (this[0] << 16) >> 16\n}", "title": "" } ]
[ { "docid": "33852570086da78651efa4fbb69df526", "score": "0.7414052", "text": "function getShort(dataView, offset) {\n return dataView.getInt16(offset, false);\n }", "title": "" }, { "docid": "ce8cd3e6bafd1dbeb0d6372eb764832f", "score": "0.74137247", "text": "function getShort(dataView, offset) {\n return dataView.getInt16(offset, false);\n }", "title": "" }, { "docid": "aeb54752be5a1088a0cf806b7df7ece7", "score": "0.7405533", "text": "function getShort(dataView, offset) {\n return dataView.getInt16(offset, false);\n } // Retrieve an unsigned 32-bit long from the DataView.", "title": "" }, { "docid": "8323503d2fc4d19ed9b1b4836e8d7b85", "score": "0.73954695", "text": "function getShort(dataView, offset) {\n\t return dataView.getInt16(offset, false);\n\t}", "title": "" }, { "docid": "9b600b440867e45d3948509f7e1523eb", "score": "0.7279291", "text": "function bnShortValue(){return 0==this.t?this.s:this[0]<<16>>16}", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.7254606", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.7254606", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.7254606", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.7254606", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.7254606", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.7254606", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.7254606", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.7254606", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.7254606", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.7254606", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.7254606", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.7254606", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "9dcd559cd69600dadcd1f8dd43037d21", "score": "0.7254606", "text": "function bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }", "title": "" }, { "docid": "03ddbc2ae3da96871a9abc7d4a6da651", "score": "0.7247695", "text": "function getShort(dataView, offset) {\n return dataView.getInt16(offset, false);\n}", "title": "" }, { "docid": "755c35d6f9fb8a169a1dca7fe538b5b0", "score": "0.72467035", "text": "function bnShortValue()\n {\n return (this.t == 0) ? this.s : (this[0] << 16) >> 16;\n }", "title": "" }, { "docid": "755c35d6f9fb8a169a1dca7fe538b5b0", "score": "0.72467035", "text": "function bnShortValue()\n {\n return (this.t == 0) ? this.s : (this[0] << 16) >> 16;\n }", "title": "" }, { "docid": "755c35d6f9fb8a169a1dca7fe538b5b0", "score": "0.72467035", "text": "function bnShortValue()\n {\n return (this.t == 0) ? this.s : (this[0] << 16) >> 16;\n }", "title": "" }, { "docid": "b8a3e80adb06b7de1f6f40bf144e15f1", "score": "0.7243326", "text": "function getShort(dataView, offset) {\n return dataView.getInt16(offset, false);\n} // Retrieve an unsigned 32-bit long from the DataView.", "title": "" }, { "docid": "bf82615e1771e256bf2064d35480b54d", "score": "0.72304994", "text": "function bnShortValue() {\n return (this.t == 0) ? this.s : (this[0] << 16) >> 16;\n}", "title": "" }, { "docid": "bf82615e1771e256bf2064d35480b54d", "score": "0.72304994", "text": "function bnShortValue() {\n return (this.t == 0) ? this.s : (this[0] << 16) >> 16;\n}", "title": "" }, { "docid": "bf82615e1771e256bf2064d35480b54d", "score": "0.72304994", "text": "function bnShortValue() {\n return (this.t == 0) ? this.s : (this[0] << 16) >> 16;\n}", "title": "" }, { "docid": "bf82615e1771e256bf2064d35480b54d", "score": "0.72304994", "text": "function bnShortValue() {\n return (this.t == 0) ? this.s : (this[0] << 16) >> 16;\n}", "title": "" }, { "docid": "1dcca95e77052c0cb76cd09ba8c4f4d9", "score": "0.7215892", "text": "function bnShortValue() {\n return this.t == 0 ? this.s : this.data[0] << 16 >> 16;\n }", "title": "" }, { "docid": "d7be7ea71ffaf9c830f3462fd1aff2f8", "score": "0.7212516", "text": "function readShort() {\n const result = viewer.getInt16(currentByte, true);\n currentByte += 2;\n return result;\n }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "ee3352c7af37a15b8b196b0a57e7e30c", "score": "0.7198107", "text": "function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }", "title": "" }, { "docid": "8e3a7f0e31e3859f448a13ecd58893d4", "score": "0.71961987", "text": "function bnShortValue() {\n\t return (this.t == 0) ? this.s : (this[0] << 16) >> 16\n\t}", "title": "" }, { "docid": "9aaba6d14080b94e214bf333da76a44f", "score": "0.71933365", "text": "function bnShortValue() {\n return this.t == 0 ? this.s : this[0] << 16 >> 16;\n}", "title": "" }, { "docid": "9aaba6d14080b94e214bf333da76a44f", "score": "0.71933365", "text": "function bnShortValue() {\n return this.t == 0 ? this.s : this[0] << 16 >> 16;\n}", "title": "" }, { "docid": "be5d1ed71e51bb0e0aefac5ace9cf47c", "score": "0.7186635", "text": "function bnShortValue() { return (this.t == 0) ? this.s : (this[0] << 16) >> 16; }", "title": "" }, { "docid": "be5d1ed71e51bb0e0aefac5ace9cf47c", "score": "0.7186635", "text": "function bnShortValue() { return (this.t == 0) ? this.s : (this[0] << 16) >> 16; }", "title": "" }, { "docid": "4760fcd4fff6142c1cc907ecc0c6d454", "score": "0.7173057", "text": "function bnShortValue() {\n\t return this.t == 0 ? this.s : this[0] << 16 >> 16;\n\t}", "title": "" }, { "docid": "4d06372e1d89df2be7ed20207c25a08f", "score": "0.70816976", "text": "function bnShortValue() {\n return this.t == 0 ? this.s : this[0] << 16 >> 16;\n }", "title": "" }, { "docid": "4d06372e1d89df2be7ed20207c25a08f", "score": "0.70816976", "text": "function bnShortValue() {\n return this.t == 0 ? this.s : this[0] << 16 >> 16;\n }", "title": "" }, { "docid": "ede54d3ff89581854b7e1b89a1391980", "score": "0.6381223", "text": "function ReadShort(v, p) { return (v.charCodeAt(p) << 8) + v.charCodeAt(p + 1); }", "title": "" }, { "docid": "0f603db7ab2e4bc0d50f78920ab64705", "score": "0.63604003", "text": "function getByte(dataView, offset) {\n return dataView.getUint8(offset);\n } // Retrieve an unsigned 16-bit short from the DataView.", "title": "" }, { "docid": "254d1489691ff4886eeb259d97d56471", "score": "0.6317465", "text": "function getUShort(dataView, offset) {\n return dataView.getUint16(offset, false);\n } // Retrieve a signed 16-bit short from the DataView.", "title": "" }, { "docid": "f979a2c8245288484d4e3dd320b69d88", "score": "0.6176639", "text": "function getUShort(dataView, offset) {\n return dataView.getUint16(offset, false);\n} // Retrieve a signed 16-bit short from the DataView.", "title": "" }, { "docid": "4428863a74081876840456d00d36caff", "score": "0.6138374", "text": "function getByte(dataView, offset) {\n return dataView.getUint8(offset);\n} // Retrieve an unsigned 16-bit short from the DataView.", "title": "" }, { "docid": "d728bf0929474e760b581d0999052b0a", "score": "0.60841286", "text": "get width() {\n var value = this.dv.getUint16(6, true);\n return value === 0 ? 'default' : value;\n }", "title": "" }, { "docid": "074a35fdffd0fc6ad13438b6396bfbfb", "score": "0.60345906", "text": "function returnInt(){\n\treturn 16;\n}", "title": "" }, { "docid": "acf496b1fa56da5b14aca64709d95974", "score": "0.59681016", "text": "get1() { return this.getUint32() / 4294967295.0; }", "title": "" }, { "docid": "52d58d5df6cb6fa9c25fce6f28117da6", "score": "0.5892936", "text": "byte() {\n return this.int8();\n }", "title": "" }, { "docid": "e6dd34d2ff16d39cf091a92900ac7efa", "score": "0.5798279", "text": "function bnIntValue(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}\n// assumes 16 < DB < 32\nreturn(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}", "title": "" }, { "docid": "56835f8a1494d2cb3250da4921c3b4b4", "score": "0.57519555", "text": "function ToInt16(v) { return (v << 16) >> 16; }", "title": "" }, { "docid": "ff31fec89d6eb88ab7ce42656ab89b9d", "score": "0.5724277", "text": "get() { return this.getUint32() / 4294967296.0; }", "title": "" }, { "docid": "8654b7ddad585442cb6ab4077d445ccc", "score": "0.57152927", "text": "get fieldLength() {\n const { extended, short } = this.constructor;\n return (this?.data?.length > 0xff || this.le > 0x100) ? extended : short;\n }", "title": "" }, { "docid": "734913eb396e40655744dd5b163effd2", "score": "0.56575173", "text": "async function readShort(buf) {\n const high = await buf.readByte();\n if (high === null)\n return null;\n const low = await buf.readByte();\n if (low === null)\n throw new Deno.errors.UnexpectedEof();\n return (high << 8) | low;\n }", "title": "" }, { "docid": "7845b286bd5e2492ef1d7fbeb4c324d5", "score": "0.56549096", "text": "readUint16() {\n const value = this.dataView.getUint16(this.index, this.littleEndian);\n this.index += 2;\n return value;\n }", "title": "" }, { "docid": "efebd70b52544005d47fff4fe9f3b00c", "score": "0.5623962", "text": "function bnIntValue() {\n if (this.s < 0) {\n if (this.t == 1) return this[0] - this.DV;else if (this.t == 0) return -1;\n } else if (this.t == 1) return this[0];else if (this.t == 0) return 0;\n // assumes 16 < DB < 32\n return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0];\n }", "title": "" }, { "docid": "08e3a8a93c5d6f24251993db55ae90e3", "score": "0.56040037", "text": "function wgint16(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset+1] = val & 0x00ff;\n\t} else {\n\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset] = val & 0x00ff;\n\t}\n}", "title": "" }, { "docid": "08e3a8a93c5d6f24251993db55ae90e3", "score": "0.56040037", "text": "function wgint16(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset+1] = val & 0x00ff;\n\t} else {\n\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset] = val & 0x00ff;\n\t}\n}", "title": "" }, { "docid": "08e3a8a93c5d6f24251993db55ae90e3", "score": "0.56040037", "text": "function wgint16(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset+1] = val & 0x00ff;\n\t} else {\n\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset] = val & 0x00ff;\n\t}\n}", "title": "" }, { "docid": "08e3a8a93c5d6f24251993db55ae90e3", "score": "0.56040037", "text": "function wgint16(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset+1] = val & 0x00ff;\n\t} else {\n\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset] = val & 0x00ff;\n\t}\n}", "title": "" }, { "docid": "08e3a8a93c5d6f24251993db55ae90e3", "score": "0.56040037", "text": "function wgint16(val, endian, buffer, offset)\n{\n\tif (endian == 'big') {\n\t\tbuffer[offset] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset+1] = val & 0x00ff;\n\t} else {\n\t\tbuffer[offset+1] = (val & 0xff00) >>> 8;\n\t\tbuffer[offset] = val & 0x00ff;\n\t}\n}", "title": "" } ]
3601a6e920a3642303eccd218ee7eb62
Load recipe object 'x' into DOM
[ { "docid": "31b0cf949af882f1534333c0b6c9fba5", "score": "0.54816175", "text": "LoadObject(x) {\n\t\t\tvar storage = window.localStorage;\n\t\t\tconsole.log(\"Loading object '\" + x + \"'\");\n\t\t\tvar jso = {};\n\t\t\tvar object = {};\n\n\t\t\tif (jso = storage.getItem(x)) {\n\t\t\t\tobject = JSON.parse(jso);\n\n\t\t\t\tthis.ingredients = object.ingredients.length;\n\t\t\t\tthis.steps = object.steps.length;\n\t\t\t\tthis.lastStorageItem = x;\n\t\t\t\t\n\t\t\t\tthis.recipe.numberOfIngreds = object.ingredients.length;\n\t\t\t\tthis.recipe.numberOfSteps = object.steps.length;\n\t\t\t\tthis.recipe.title = object.title;\n\t\t\t\tthis.recipe.image = object.image;\n\t\t\t\tthis.recipe.filename = object.filename;\n\t\t\t\tthis.recipe.serves = object.serves;\n\t\t\t\tthis.recipe.difficulty = object.difficulty;\n\t\t\t\tthis.recipe.cooking.quantity = parseInt(object.cooking.quantity);\n\t\t\t\tthis.recipe.cooking.measurement = object.cooking.measurement;\n\t\t\t\tthis.recipe.preparation.quantity = parseInt(object.preparation.quantity);\n\t\t\t\tthis.recipe.preparation.measurement = object.preparation.measurement;\n\t\t\t\tthis.recipe.ingredients = [];\n\n\t\t\t\tobject.ingredients.forEach((ing, index) => {\n\t\t\t\t\tthis.recipe.ingredients.push({\n\t\t\t\t\t\tname: ing.name,\n\t\t\t\t\t\tquantity: ing.quantity,\n\t\t\t\t\t\tmeasurement: ing.measurement,\n\t\t\t\t\t\topt: ing.opt\n\t\t\t\t\t});\n\t\t\t\t\tconsole.log(\"Pushing ingredient \" + (index + 1) + \": \\\"\" + ing.quantity + \" \" + ing.measurement + \" \" + ing.name + \"\\\"\");\n\t\t\t\t});\n\n\t\t\t\tthis.recipe.steps = [];\n\t\t\t\tobject.steps.forEach((st) => {\n\t\t\t\t\tthis.recipe.steps.push(st);\n\t\t\t\t});\n\n\t\t\t\tthis.uploaded = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.error(\"Could not load specified item '\" + x + \"' from local storage\");\n\t\t\t\tthis.topStatus = \"<p class=\\\"success\\\">Starting a new recipe.</p>\";\n\n\t\t\t\tthis.recipe.title = \"New Recipe!\";\n\t\t\t}\n\t\t\tthis.saved = false;\n\t\t}", "title": "" } ]
[ { "docid": "bad7f48d34aaa30b255e3e8d1d13a32b", "score": "0.6507616", "text": "function loadRecipes() {\n\t\tvar content = $(\"#content\");\n\n\t\tcontent.load(\"view/recipes.html\", function () {\n\t\t\tcontent.attr('class', 'content recipes');\n\t\t\trecipe.recipe();\n\t\t});\n\t}", "title": "" }, { "docid": "40eb8a0bdbe30a1a9044c5ca67b98914", "score": "0.62441427", "text": "function loadRecipes() {\n if (this.readyState == 4 && this.status == 200) {\n let recipes = JSON.parse(this.responseText);\n //reload\n $(\"#searchResult\").load(\"recipes/search_result.html\", () => {\n //enable tab widget\n $(\"#recipe_tabs\").tabs();\n // update message\n $(\"#notification\").html(`${recipes.length} recipes have been found.`);\n // create recipe shortcut\n recipes.forEach(recipe => {\n let img = $(\"<img>\").attr(\"src\", recipe.image.source);\n // store recipe._id as div id, and name as data-name\n let div = $(\"<div>\").attr(\"id\", recipe._id)\n .attr(\"data-name\", recipe.recipe_name)\n .addClass(\"recipe-button\")\n .click(display_recipe)\n .append(img);\n findOrCreateDivWithClass(\"All\", \"recipeContainer\").append(div);\n })\n })\n .effect(\"slide\");\n }\n}", "title": "" }, { "docid": "bd12f7204ef6a81280855d34d1fc5a53", "score": "0.5929003", "text": "function eatingWellLoad (url){\n var req = new XMLHttpRequest();\n\n req.open('GET', url, false);\n req.send(null);\n if (req.status == 200){\n var page = cheerio.load(req.responseText);\n }\n var recipe = {};\n recipe.recipeIngredients = [];\n recipe.recipeInstructions = [];\n recipe.recipeNutrition = [];\n recipe.recipeTags = [];\n recipe.recipeBrowse = {}; //stores recipeTitle, rating, cooktime, numberingredients, numberdirections, tags ie vegetarian, dinner,\n var recipeIngredient = {}; //stores recipeTitle, ingredient quantity, ingredient measurement, ingredient measurement abbrv?,ingredient, and fullrecipeLine\n var recipeInstructionObj = {}; //stores recipeTitle, instruction Number, instruction\n var recipeNutritionObj = {};\n var recipeTitle = ''\n\n var recipeTagObj = {}; //.title.tag\n recipeTitle = page('.recipeDetailHeader').text();\n recipe.recipeBrowse.title = recipeTitle;\n recipe.recipeBrowse.source = url;\n var imgPath = page('.recipeDetailSummaryImageMain').attr('src');\n\n recipe.recipeBrowse.img = imgPath;\n recipe.recipeBrowse.cookTime = page('span', 'time').text();\n recipe.recipeBrowse.servings = parseInt(page('span', '.servingsCount').text());\n // recipe.recipeBrowse.mealType = page('.toggle-similar__title').text();\n\n // page('.toggle-similar__title').each(function(i,elem){\n // console.log(page(this).text());\n // if (i == 3){\n // recipe.recipeBrowse.mealType = page(this).text();\n // }\n // })\n\n // console.log(recipe);\n page('a', '.nutritionTag').each(function(i,elem){\n recipeTagObj.title = recipeTitle;\n recipeTagObj.tag = page(this).text();\n recipe.recipeTags.push(recipeTagObj);\n recipeTagObj = {};\n });\n\n // console.log(recipeTags);\n page('span', '.checkListListItem').each(function(i,elem){\n recipeIngredient.title = recipeTitle;\n recipeIngredient.fullIngredient = page(this).text();\n if (recipeIngredient.fullIngredient != '')\n recipe.recipeIngredients[i] = recipeIngredient;\n // recipe.nutritionFound = false;\n // console.log(typeof(recipeIngredient.fullIngredient))\n recipeIngredient = {};\n });\n recipe.recipeBrowse.numberIngredients = recipe.recipeIngredients.length;\n // console.log(recipe.recipeIngredients);\n page('.recipeDirectionsListItem').each(function(i,elem){\n recipeInstructionObj.title = recipeTitle;\n recipeInstructionObj.instruction = page(this).text();\n recipeInstructionObj.instructionNumber = i+1;\n if (recipeInstructionObj.instruction != '')\n recipe.recipeInstructions[i] = recipeInstructionObj;\n\n recipeInstructionObj = {};\n })\n\n page('li', '.nutritionInfoList').each(function(i,elem){ //set up parentheses removal\n // console.log(page(this).attr('itemprop'));\n var nutrition = {};\n // console.log(page(this).find('span').text());\n // console.log(page(this).text().indexOf('Per serving'));\n if (page(this).text().indexOf('Per serving')!=-1){\n var text = page(this).find('span').text();\n // console.log(text);\n // console.log(text);\n var delimited = text.split(' ');\n // console.log(delimited);\n // var delimited = text.split('> ');\n recipe.recipeNutrition.title = recipeTitle;\n for (var x = 0; x < delimited.length; x++){\n // console.log(x+': '+ delimited[x]);\n var delimited2 = delimited[x].split(' ');\n // console.log(delimi)\n // console.log(delimited[x]);\n for (var y = 0; y < delimited2.length; y++){\n // console.log('value: '+ delimited[y]);\n if (!/^[a-zA-Z]+$/.test(delimited2[y]) && gramConvertions[delimited2[y+1]]){\n // nutrition.quantity = 5;\n nutrition.title = recipeTitle;\n nutrition.quantity = parseInt(delimited2[y]) * gramConvertions[delimited2[y+1]];\n nutrition.value = delimited2[y+2];\n if (delimited[y+3]!=undefined && !/^[a-zA-Z]+$/.test(delimited2[y+3])){\n // console.log('y+3: '+ delimited2[y+3]);\n nutrition.value+=delimited2[y+3];\n }\n break;\n }\n else if (!/^[a-zA-Z]+$/.test(delimited2[y]) && /^[a-zA-Z]+$/.test(delimited2[y+1])){\n // console.log('here');\n nutrition.title = recipeTitle;\n nutrition.quantity = delimited2[y-1];\n // nutrition.quantity = delimited2[y];\n nutrition.value = delimited2[y];\n break;\n }\n\n }\n // console.log(nutrition);\n if (nutrition.value.indexOf(';')){\n // console.log('found');\n nutrition.value = nutrition.value.split(';')[0];\n }\n if (nutrition.value.indexOf('(')){\n // console.log('found');\n nutrition.value = nutrition.value.split('(')[0];\n }\n if (nutrition.value.indexOf('vitaminA')!=-1){\n nutrition.value+=\"IU\";\n }\n if (recipe.recipeBrowse.servings >1){\n nutrition.perServing = true;\n }\n else{\n nutrition.perServing = false;\n }\n recipe.recipeNutrition[nutrition.value]= nutrition.quantity;\n nutrition = {};\n }\n }\n // if (page(this).attr('itemprop') == \"calories\"){\n // console.log('calories: ' + page(this).text());\n // }\n })\n if (recipe.recipeNutrition){\n recipe.recipeBrowse.nutritionFound = true;\n }\n // console.log(recipe);\n // page('.') //get nutrition\n return recipe;\n}", "title": "" }, { "docid": "d4307bf93297ed1c6da1577c1073d324", "score": "0.5701601", "text": "function loadDisplay(recipeTitle){\n //load the recipe object with the matching title property\n const recipe = load(recipeTitle);\n\n document.getElementById(\"displayTitle\").value = recipe.title;\n document.getElementById(\"displayServings\").value = recipe.servings;\n document.getElementById(\"displayTime\").value = recipe.time;\n document.getElementById(\"displayIngredients\").value = recipe.ingredients;\n document.getElementById(\"displayInstructions\").value = recipe.instructions;\n}", "title": "" }, { "docid": "825938ac995e2a0ef0d07e9b499e6a38", "score": "0.55972403", "text": "function populateRecipe() {\n\n // Empty content string\n var content = '';\n\n // jQuery AJAX call for JSON\n $.getJSON( '/recettesJSON', function( data ) {\n\n // Stick our user data array into a userlist variable in the global object\n recipeListData = data;\n\n\n // For each item in our JSON, add a table row and cells to the content string\n $.each(data, function(){\n\n content += '<article>';\n content += '<header>';\n content += '<time datetime=\"' + getTimestampFromObjectId(this._id) + '\" pubdate>publié le ' + getTimestampFromObjectId(this._id) +'</time>';\n content += '<h1><a href=\"recette/' + this._id + '\" rel=\"bookmark\" title=\"link to this post\">' + this.nom + '</a><h1>';\n content += '</header>';\n content += 'commentaire: ' + this.commentaire;\n content += '<br/>';\n content += 'temps de préparation: ' + this.tempsPreparation;\n content += '<br/>';\n content += 'temps de cuisson: ' + this.tempsCuisson;\n content += '<br/>';\n content += 'nombre de portion: ' + this.nombrePortion;\n content += '<br/>';\n content += 'appréciation: ' + this.note + '/100';\n content += '<br/>';\n content += 'fait la dernière fois: ' + this.dateDerniereExecution;\n content += '<br/>';\n content += 'Mots clés: ';\n $.each(this.listeCategorie, function(){\n content += this.nom + \"; \";\n });\n\n content += '<br/>';\n content += 'Ingrédients';\n content += '<ul class=\"recette-detail\">';\n\n $.each(this.listeIngredient, function(){\n content += \"<li>\" + this.quantite + \"&nbsp;\" + this.nom + \"</li>\";\n });\n\n \n content += '</ul>';\n\n content += 'Étapes';\n content += '<ul class=\"recette-detail\">';\n\n $.each(this.listeEtape, function(){\n content += \"<li>\" + this.etape + \"</li>\";\n });\n\n \n content += '</ul>';\n content += '<div class=\"spacer\">';\n content += '</article>';\n\n \n $('.contenu').append(content);\n\n });\n\n });\n}", "title": "" }, { "docid": "daa9be9e90040cf15b0e0433ee24e35e", "score": "0.553421", "text": "function renderRecipe(recipe) {\n console.log('rendering recipes', recipe);\n var templateHtml = $('#recipeTemplate').html();\n var templateFun = Handlebars.compile(templateHtml);\n var newHtml= templateFun(recipe);\n $('#recipes').append(newHtml);\n}", "title": "" }, { "docid": "e72a38926145d88194216e40d3c6a2c6", "score": "0.5517864", "text": "renderRecipeview(recipe) {\n const recipeInfo = document.getElementById('recipe-view');\n if (!recipe) {\n recipeInfo.innerHTML = '';\n return;\n }\n\n let recipeHtml = this.createRecipeViewHtml(recipe);\n recipeInfo.innerHTML = recipeHtml;\n }", "title": "" }, { "docid": "c4d2623963e1e6b4a6f9b0d3340c245c", "score": "0.5491147", "text": "function addRecipeToDOM(recipe) {\n const ingredients = [];\n for (let i = 0; i < recipe.ingredientNames.length; i++) {\n if (recipe.ingredientQtys[i] === undefined) {\n ingredients.push(`\n ${recipe.ingredientNames[i]}\n `);\n } else {\n ingredients.push(`\n ${recipe.ingredientNames[i]} - ${recipe.ingredientQtys[i]}\n `);\n }\n }\n single_mealEl.innerHTML = `\n <div class=\"meal-header\">\n <span id=\"recipeId\" style=\"display:none\">${recipe.id}</span>\n <div class=\"meal-btn\">\n <button id='edit-recipe' onclick='editRecipe()'>Edit</button>\n <button id='delete-recipe' onclick='deleteRecipe()'>Delete</button>\n <button class=\"close-meal-btn\" id=\"close-meal-btn\" onclick=\"closeMeal()\">&times;</button>\n </div>\n </div>\n <div class=\"meal-title\" id=\"meal-title\">\n ${recipe.title}\n </div>\n <div class=\"meal-body\" id=\"sgl-meal\">\n <div class=\"single-meal-category\">\n ${checkCategory(recipe.category)}\n </div>\n <div class=\"recipe-time-serves\">\n <h5>Prep time: ${recipe.prepTime} Serves: ${recipe.serves}</h5>\n </div>\n <div class=\"single-meal-types\">\n ${recipe.vegan ? '<span class=\"vegan-card\">Vegan</span>' : ''}\n ${\n recipe.glutenFree ? '<span class=\"gluten-card\">Gluten Free</span>' : ''\n }\n </div>\n <div class=\"main\">\n <h2 class=\"ingregients\">Ingregients</h2>\n <ul>\n ${ingredients.map((ing) => `<li>${ing}</li>`).join('')}\n </ul>\n <h2 class=\"directions\">Directions</h2>\n <p>${recipe.directions}</p>\n <h2 class=\"notes\" id=\"note-heading\">${\n recipe.notes ? 'Notes' : ''\n }</h2>\n <p>${recipe.notes}</p> \n </div>\n </div>\n`;\n if (recipe.notes) {\n document.getElementById('note-heading').style.borderBottom =\n '1px solid #727070';\n } else {\n document.getElementById('note-heading').style.borderBottom = '';\n }\n single_mealEl.classList.add('active');\n}", "title": "" }, { "docid": "b4946860d2581672aaa0da7e26ff357a", "score": "0.54736406", "text": "function populateRecipeContainer(mealObj){\n displayRecipe()\n recipeContainerEl.innerHTML = `\n <div class=\"recipe-title\">\n <h1>${mealObj.strMeal}\n <a href=\"${mealObj.strSource}\"\n target=\"_blank\"\n title=\"Recipe Blog Post\"\n class=\"fa fa-book\"\n >Read More</a>\n </h1>\n <a href=\"${mealObj.strYoutube}\" title=\"Youtube Tutorial\" class=\"fa fa-youtube-play\"></a>\n </div>\n \n <div class=\"recipe-information\">\n <div class=\"information\">\n <img src=\"${mealObj.strMealThumb}\" />\n <p>Category: ${mealObj.strCategory}</p>\n <p>Area: ${mealObj.strArea}</p>\n <p>Tags: ${mealObj.strTags}</p>\n <u class=\"ingredients\" aria-label=\"Ingredients\">\n <li>${mealObj.strIngredient1} - ${mealObj.strMeasure1}</li>\n <li>${mealObj.strIngredient2} - ${mealObj.strMeasure2}</li>\n <li>${mealObj.strIngredient3} - ${mealObj.strMeasure3}</li>\n <li>${mealObj.strIngredient4} - ${mealObj.strMeasure4}</li>\n <li>${mealObj.strIngredient5} - ${mealObj.strMeasure5}</li>\n <li>${mealObj.strIngredient6} - ${mealObj.strMeasure6}</li>\n <li>${mealObj.strIngredient7} - ${mealObj.strMeasure7}</li>\n <li>${mealObj.strIngredient8} - ${mealObj.strMeasure8}</li>\n <li>${mealObj.strIngredient9} - ${mealObj.strMeasure9}</li>\n <li>${mealObj.strIngredient10} - ${mealObj.strMeasure10}</li>\n <li>${mealObj.strIngredient11} - ${mealObj.strMeasure11}</li>\n <li>${mealObj.strIngredient12} - ${mealObj.strMeasure12}</li>\n <li>${mealObj.strIngredient13} - ${mealObj.strMeasure13}</li>\n <li>${mealObj.strIngredient14} - ${mealObj.strMeasure14}</li>\n <li>${mealObj.strIngredient15} - ${mealObj.strMeasure15}</li>\n <li>${mealObj.strIngredient16} - ${mealObj.strMeasure16}</li>\n <li>${mealObj.strIngredient17} - ${mealObj.strMeasure17}</li>\n <li>${mealObj.strIngredient18} - ${mealObj.strMeasure18}</li>\n <li>${mealObj.strIngredient19} - ${mealObj.strMeasure19}</li>\n <li>${mealObj.strIngredient20} - ${mealObj.strMeasure20}</li>\n </u>\n </div>\n </div>\n <div class=\"recipe-instructions\" aria-label=\"Instructions\">\n ${mealObj.strInstructions}\n </div>`\n}", "title": "" }, { "docid": "d784e2ebac79361381a9bc008fe11a12", "score": "0.5444686", "text": "function populateEditor() {\r\n\t\r\n\t// Editor area is invisible at the beginning, make it visible.\r\n\tvar setVisible = document.getElementById(\"editor\");\r\n \r\n\tsetVisible.style.visibility = \"visible\";\r\n\r\n\tvar xhr = new XMLHttpRequest();\r\n\r\n\tvar select = document.getElementById(\"recipeSelect\");\r\n\t\r\n\t// Get the selected recipe and add the _ and .json back.\r\n\tvar toParse = select.options[select.selectedIndex].value;\r\n\tcurrentFile = toParse;\r\n\ttoParse = toParse.split(\" \").join(\"_\");\r\n\ttoParse += \".json\";\r\n\r\n\txhr.open(\"GET\", \"/recipes/\" + toParse);\r\n\r\n\txhr.addEventListener('load', function(){\r\n\t\tvar recipeObj = JSON.parse(xhr.responseText);\r\n\r\n\t\t// get all text areas on the webpage\r\n\t\tvar duration = document.getElementById(\"recDuration\");\r\n\t\tvar ingredients = document.getElementById(\"recIngredients\");\r\n\t\tvar steps = document.getElementById(\"recSteps\");\r\n\t\tvar notes = document.getElementById(\"recNotes\");\r\n\r\n\t\t// show content in the respective areas\r\n\t\tduration.value = recipeObj.duration;\r\n\t\tingredients.value = recipeObj.ingredients.join(\"\\n\");\r\n\t\tsteps.value = recipeObj.directions.join(\"\\n\");\r\n\t\tnotes.value = recipeObj.notes;\r\n\t});\r\n\r\n\txhr.send();\r\n}", "title": "" }, { "docid": "aae5c51d1b65f656bfdb3192beb9bc70", "score": "0.53571254", "text": "function jsonLoaded2(obj) {\n\n // if there's an error, print a message and return\n if (obj.error) {\n var status = obj.status;\n var description = obj.description;\n document.querySelector(\"#dynamicContent\").innerHTML = \"<h3><b>Error!</b></h3>\" + \"<p><i>\" + status + \"</i><p>\" + \"<p><i>\" + description + \"</i><p>\";\n return; // Bail out\n }\n\n // place holder variable for recipe\n // getting more recipe at a time\n var recipe = obj;\n\n var name = recipe.name;\n if (!name) name = \"No name found\";\n\n var prep = recipe.prepTime;\n var cookTime = recipe.cookTime;\n var ingredients = recipe.ingredientLines;\n var url = recipe.attribution.url;\n var servings = recipe.numberOfServings;\n\n // get image of the food\n if (recipe.images) {\n if (recipe.images[0].hostedLargeUrl) {\n var img = recipe.images[0].hostedLargeUrl;\n } else if (recipe.images[0].hostedMediumUrl) {\n var img = recipe.images[0].hostedMediumUrl;\n }\n }\n\n var flavor = recipe.flavors;\n if (flavor) {\n var p = recipe.flavors.Piquant;\n var m = recipe.flavors.Meaty;\n var b = recipe.flavors.Bitter;\n var sw = recipe.flavors.Sweet;\n var so = recipe.flavors.Sour;\n var sa = recipe.flavors.Salty;\n }\n\n // if any of flavor is undefined, most likely all flavors are\n if (p == undefined) {\n flavor = null;\n }\n\n var line = \"<div class='image'>\";\n if (img) line += \"<img src=\" + img + \">\";\n if (ingredients != null) {\n line += \"<b>Ingredients: </b></br>\";\n for (var i = 0; i < ingredients.length; i++) {\n line += \"<br>\" + ingredients[i];\n }\n }\n line += \"</div>\";\n line += \"<div class='content'>\";\n line += \"<h3>\" + name + \"</h3>\";\n if (prep) line += \"<b>Prep time:</b> \" + prep + \"<br>\";\n if (cookTime) line += \"<b>Cook Time:</b> \" + cookTime + \"<br></br>\";\n if (servings) line += \"<b>Servings:</b> \" + servings + \"<br><br>\";\n if (flavor) line += \"<b>Flavor Scale, 0-1:</b>\";\n\n if (p != undefined) line += \"<p><b>Piquant:</b> \" + p + \"&nbsp;\";\n if (m != undefined) line += \"&nbsp; <b>Meaty:</b> \" + m + \"&nbsp;\";\n if (b != undefined) line += \"&nbsp; <b>Bitter:</b> \" + b + \"</p>\";\n if (sw != undefined) line += \"<p><b>Sweet:</b> \" + sw + \"&nbsp;\";\n if (so != undefined) line += \"&nbsp; <b>Sour:</b> \" + so + \"&nbsp;\";\n if (sa != undefined) line += \"&nbsp; <b>Salty:</b> \" + sa + \"</p>\";\n\n if (url) line += \"<p><a href=\" + url + \">\" + \"Link to Recipe!\" + \"</a></p>\";\n line += \"</div>\";\n line += \"<div style='clear: both;'></div>\";\n allStuff += line;\n\n\n // printOut(bigString);\n storeAllJson.push(allStuff);\n\n if (storeAllJson.length == numRecipesPage) {\n printOut();\n allStuff = \"\";\n storeAllJson.length = 0;\n }\n }", "title": "" }, { "docid": "a9bac599cd2cb92051636bec3229609a", "score": "0.53165656", "text": "function recipeToDOM(response){\n $(\"#recipe-name\").text(response.strMeal);\n $(\"#recipe-name\").attr(\"data-id\", response.idMeal);\n $(\"#instructions\").text(response.strInstructions);\n $(\"#recipe-img\").attr(\"src\", response.strMealThumb);\n\n let youtubeLink = createYouTubeEmbedLink(response.strYoutube);\n\n console.log(youtubeLink);\n\n $(\"#recipe-video\").attr(\"src\", youtubeLink);\n\n let ingredients = \n [{\n ingredient: response.strIngredient1,\n measure: response.strMeasure1\n },{\n ingredient: response.strIngredient2,\n measure: response.strMeasure2\n },{\n ingredient: response.strIngredient3,\n measure: response.strMeasure3\n },{\n ingredient: response.strIngredient4,\n measure: response.strMeasure4\n },{\n ingredient: response.strIngredient5,\n measure: response.strMeasure5\n },{\n ingredient: response.strIngredient6,\n measure: response.strMeasure6\n },{\n ingredient: response.strIngredient7,\n measure: response.strMeasure7\n },{\n ingredient: response.strIngredient8,\n measure: response.strMeasure8\n },{\n ingredient: response.strIngredient9,\n measure: response.strMeasure9\n },{\n ingredient: response.strIngredient10,\n measure: response.strMeasure10\n },{\n ingredient: response.strIngredient11,\n measure: response.strMeasure11\n },{\n ingredient: response.strIngredient12,\n measure: response.strMeasure12\n },{\n ingredient: response.strIngredient13,\n measure: response.strMeasure13\n },{\n ingredient: response.strIngredient14,\n measure: response.strMeasure14\n },{\n ingredient: response.strIngredient15,\n measure: response.strMeasure15\n },{\n ingredient: response.strIngredient16,\n measure: response.strMeasure16\n },{\n ingredient: response.strIngredient17,\n measure: response.strMeasure17\n },{\n ingredient: response.strIngredient18,\n measure: response.strMeasure18\n },{\n ingredient: response.strIngredient19,\n measure: response.strMeasure19\n },{\n ingredient: response.strIngredient20,\n measure: response.strMeasure20\n }]\n\n $(\"#ingredients\").empty();\n\n for(let i=0; i<ingredients.length; i++){\n if(ingredients[i].ingredient)\n {\n let liEL = $(\"<li>\").text(ingredients[i].measure + \" : \" + ingredients[i].ingredient);\n $(\"#ingredients\").append(liEL);\n }\n }\n\n // call nutrition functions\n createIngredientJSON(ingredients);\n}", "title": "" }, { "docid": "c2ab56153000c3b0ced51b56666672d3", "score": "0.526454", "text": "recipeDisplay(arrayOfObjects) {\n\n // Access HTML element housing the list of recipes in DOM\n const recipeListElement = document.getElementById('recipeList')\n // Clear current content in HTML element\n recipeListElement.textContent = \"\"\n\n for (const recipe of arrayOfObjects) {\n const recipeHTML = factory.recipeHtmlRepresentation(recipe)\n recipeListElement.innerHTML += recipeHTML\n }\n\n }", "title": "" }, { "docid": "d57c66638abc72d424eab29c22b3a9a8", "score": "0.5260136", "text": "function loadShowRecipe(tag){\n event.preventDefault()\n let recipeLink = tag.currentTarget.href \n $.get(recipeLink,'',null,'json').done(displayShowRecipe)\n}", "title": "" }, { "docid": "10f0049b52d7e3be5820c6d24432290b", "score": "0.52105093", "text": "function addToPage(recipe, id) {\n document.getElementById(\n \"recipe_synopsis\" + (id)\n ).innnerHTML = recipeHeader(recipe, id);\n document.getElementById(\"recipe_full\" + id).innerHTML =\n \"Ingredients: \" +\n recipe.Ingredients +\n \"<br>\" +\n \"Recipe: <br>\" +\n recipe.Recipe;\n document.getElementById(\"recipe_img\" + id).src =\n recipe.RecipePicture;\n console.log(recipe);\n}", "title": "" }, { "docid": "90a022500c6a2098014e1c40cebb0352", "score": "0.51787394", "text": "function printRecipe(x) {\n console.log(x.title);\n console.log(\"Serves: \" + x.servings);\n console.log(\"Required ingredients: \" + x.ingredients);\n}", "title": "" }, { "docid": "b156e3fa3d38e6a6f82b2b36447a8618", "score": "0.5166056", "text": "function populateRecipes(){\r\n\tvar xhr = new XMLHttpRequest();\r\n\r\n\txhr.open(\"GET\", \"/recipes/\");\r\n\r\n\txhr.addEventListener('load', function(){\r\n\t\t\r\n\t\t// parse the object\r\n\t\tvar recipeList = JSON.parse(xhr.responseText).list;\r\n\t\t\r\n\t\tvar select = document.getElementById(\"recipeSelect\");\r\n\r\n\t\tvar toParse;\r\n\t\t\r\n\t\t// for each filename in the array, parse it and display it as an option.\r\n\t\tfor (var i in recipeList){\r\n\t\t\t// remove underscores and extension.\r\n\t\t\ttoParse = recipeList[i];\r\n\t\t\ttoParse = toParse.slice(0, toParse.indexOf('.'));\r\n\t\t\ttoParse = toParse.split('_').join(\" \");\r\n\r\n\t\t\tselect.add( new Option(toParse));\r\n\t\t}\r\n\t});\r\n\r\n\txhr.send();\r\n}", "title": "" }, { "docid": "be44bbd06537393393d7f44cf73ad0e4", "score": "0.5146553", "text": "load() {\n this.el_.load();\n }", "title": "" }, { "docid": "0616c102988e33e1b669e317165b4c16", "score": "0.51230377", "text": "function loadRecipe() {\n axios.get(\"/api/recipe/all\")\n .then(res => {\n console.log(res)\n setRecipes(res.data)\n }\n\n )\n .catch(err => console.log(err));\n }", "title": "" }, { "docid": "0c017f916eb7541cd59ec68a2d456402", "score": "0.50897115", "text": "function generateRecipe(data, instructions, ingredients) {\n let HTML = '';\n\n HTML += `\n <h2>${data.title}</h2>\n\n <div id=\"full-recipe\">\n\n <div class=\"recipe-cards\">\n <h3>Ingredients</h3>\n <ol id=\"ingredientsList\">`\n ingredients.map( ingredientsAll => {\n HTML += `\n <li>${ingredientsAll.original}</li>\n `\n })\n HTML += `\n </ol>\n </div>`\n\n\n//start recipe instructions\n HTML += `\n <div class=\"recipe-cards\">\n\n <h3>Instructions</h3>\n <ol id=\"instructionsList\">`\n\n instructions.map( instruction => {\n HTML += `\n <li>${instruction.step}</li>\n `\n })\n HTML += `\n </ol>\n </div>`\n \n//start images\n HTML += `\n <div class=\"recipe-cards\">\n <h3>Images</h3>\n <img src=\"${data.image}\" alt=\"image of ${data.title}\"> \n </div>\n `\n\n//start recipe details\n HTML += `\n <div class=\"recipe-cards\">\n <h3>Nutrition and Summary</h3>\n <p id=\"summary\">${data.summary}</p>\n </div>\n\n </div>\n\n <a href=\"/recipe-project/index.html\" class=\"btn\" id=\"recipe-back-btn\">Back to Search</a>\n <a href=\"/recipe-project/my-recipes.html?${data.id}\" class=\"btn\" id=\"recipe-back-btn\">Save Recipe</a>\n `\n recipeOutput.innerHTML = HTML;\n}", "title": "" }, { "docid": "cb1bb2b9b02074422d4b8434c24456c0", "score": "0.50777787", "text": "function appendRecipeData(response){\nconsole.log(response)\nvar recipeDiv = $(\"#recipeResult\").html(\"<div class='recipe'>\");\nvar title = response.recipes[0].title;\nvar HeadOne = $(\"<h1>\").text(\"Your Recipe Tonight Is: \" + title);\nrecipeDiv.append(HeadOne);\n\nvar instructions = response.recipes[0].instructions;\n var newinstructions = (removeTags(instructions));;\n\n \nvar pOne = $(\"<p>\").text(\"Instructions: \" + newinstructions);\n recipeDiv.append(pOne);\n \nvar imgrecipe = response.recipes[0].image;\n console.log(imgrecipe)\n// var img = $('<img />')\n// .attr('src', imgrecipe); \n// img.appendTo(\"<div class='recipe'>\")\n \n var recipeimg =$(\"<img>\");\n \n recipeimg.attr(\"src\", imgrecipe);\n \n $(\"#images\").html(recipeimg);\n\n// --------------------------------------------\n// Ingredients Appended to HTML PopOver- CP\nvar ingredLength = response.recipes[0].extendedIngredients.length\n// console.log(ingredLength)\nvar i;\n\n var ingredientArray = [];\n for(i=0; i< ingredLength; i++){\n var ingredients = response.recipes[0].extendedIngredients[i].original;\n console.log(ingredients)\n ingredientArray.push(ingredients)\n }\n console.log(ingredientArray)\n\n $(\".ingredients\").attr(\"data-content\", ingredientArray)\n\n}", "title": "" }, { "docid": "ab4143b83f4b1ef3a308396f893b7c74", "score": "0.5075538", "text": "function displayRecipes(response) {\n\n var display = $('<div class=\"row\">');\n\n for (var i = 0; i < response.length; i++) {\n var singleRecipe = buildRecipeCard(response[i]);\n // console.log(singleRecipe);\n display.append(singleRecipe);\n }\n\n // console.log(display);\n $(\"#ingredient-search-results\").append(display);\n\n}", "title": "" }, { "docid": "8b8eed9a889603a87482e998d37a5d19", "score": "0.5066629", "text": "function assignRecipeInstructions(recipeObject){\n reqCount = 0;\n var reqQuery = \"https://spoonacular-recipe-food-nutrition-v1.p.mashape.com/recipes/extract?\"\n + \"forceExtraction=false&\"\n + \"url=\" + recipeObject.sourceUrl;\n \n var req = new XMLHttpRequest();\n \n req.open(\"GET\", reqQuery, true);\n req.setRequestHeader(\"X-Mashape-Key\", key);\n \n req.addEventListener('load', function(){\n assignRecipeInstRequestCallback(req, reqQuery, recipeObject);\n });\n \n req.send();\n}", "title": "" }, { "docid": "bc335b19754ad5fa744dbc06c3b04536", "score": "0.5064103", "text": "function display_yeast() {\n $.get({{ STATIC_URL }} + 'yeast_entry.htm', function(template) {\n var $tpl = $('<div />').html(template); // make detached DOM node\n fill_yeast_template(recipe.yeast, $tpl);\n $('#yeast_container').append($tpl.html());\n });\n}", "title": "" }, { "docid": "88e1abe520842d754f3913f39d351954", "score": "0.5050476", "text": "function renderSearchResults(recipes) {\n document.id(\"searchResults\").empty();\n console.log(recipes);\n\n if (mode === \"recipe\") {\n for (var i = 0; i < recipes.results.length; i++) {\n\n var recipeDiv = new Element(\"div\");\n recipeDiv.set(\"recipeId\")\n recipeDiv.addClass(\"row recipe\")\n\n var recipeImg = new Element(\"img\");\n recipeImg.addClass(\"col s12 m4 l3\");\n recipeImg.set(\"src\", (recipes.baseUri + recipes.results[i].image));\n recipeImg.set(\"alt\", recipes.results[i].title);\n recipeDiv.grab(recipeImg);\n console.log(recipeDiv);\n\n var recipeTitleDiv = new Element(\"div\");\n recipeTitleDiv.addClass(\"col s12 m6\")\n var recipeTitleA = new Element(\"a\");\n recipeTitleA.set(\"href\", recipes.results[i].sourceUrl);\n var recipeTitleH = new Element(\"h5\");\n recipeTitleH.textContent = recipes.results[i].title;\n recipeTitleA.grab(recipeTitleH);\n recipeTitleDiv.grab(recipeTitleA);\n\n var saveButton = new Element(\"button.saveButton\");\n saveButton.addClass(\"btn\");\n saveButton.set(\"type\", \"button\");\n saveButton.set(\"index\", i);\n saveButton.textContent = \"save\";\n recipeTitleDiv.grab(saveButton);\n\n var readyIn = new Element(\"p\");\n readyIn.textContent = (\"Ready In: \" + recipes.results[i].readyInMinutes + \" minutes\");\n recipeTitleDiv.grab(readyIn);\n\n var serves = new Element(\"p\");\n serves.textContent = (\"Serves \" + recipes.results[i].servings);\n recipeTitleDiv.grab(serves);\n\n recipeDiv.grab(recipeTitleDiv);\n\n document.id(\"searchResults\").grab(recipeDiv);\n }\n }\n\n if (mode === \"ingredient\") {\n for (var i = 0; i < recipes.length; i++) {\n var queryURL = \"https://api.spoonacular.com/recipes/\" + recipes[i].id + \"/information?apiKey=fe159fe9965f4cb28a5a0f45fd2ac4cb\";\n var recipe;\n jQuery.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function (response) {\n console.log(response);\n var recipeDiv = new Element(\"div\");\n recipeDiv.set(\"recipeId\")\n recipeDiv.addClass(\"row recipe\")\n\n var recipeImg = new Element(\"img\");\n recipeImg.addClass(\"col s12 m4 l3\");\n recipeImg.set(\"src\", (response.image));\n recipeImg.set(\"alt\", response.title);\n recipeDiv.grab(recipeImg);\n console.log(recipeDiv);\n\n var recipeTitleDiv = new Element(\"div\");\n recipeTitleDiv.addClass(\"col s12 m6\")\n var recipeTitleA = new Element(\"a\");\n recipeTitleA.set(\"href\", response.sourceUrl);\n var recipeTitleH = new Element(\"h5\");\n recipeTitleH.textContent = response.title;\n recipeTitleA.grab(recipeTitleH);\n recipeTitleDiv.grab(recipeTitleA);\n\n var saveButton = new Element(\"button.saveButton\");\n saveButton.set(\"type\", \"button\");\n saveButton.set(\"index\", i);\n saveButton.textContent = \"save\";\n recipeTitleDiv.grab(saveButton);\n\n var readyIn = new Element(\"p\");\n readyIn.textContent = (\"Ready In: \" + response.readyInMinutes + \" minutes\");\n recipeTitleDiv.grab(readyIn);\n\n var serves = new Element(\"p\");\n serves.textContent = (\"Serves \" + response.servings);\n recipeTitleDiv.grab(serves);\n\n recipeDiv.grab(recipeTitleDiv);\n\n document.id(\"searchResults\").grab(recipeDiv);\n });\n }\n }\n}", "title": "" }, { "docid": "f6563eb20ce4da53c39161fffa5101eb", "score": "0.5005865", "text": "function loadDocumentIntoElement(url, element) {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() { // callback function\n if (xhttp.readyState == 4 && xhttp.status == 200) {\n element.innerHTML = xhttp.responseText;\n }\n };\n xhttp.open(\"GET\", url, true);\n xhttp.send();\n}", "title": "" }, { "docid": "c4cf394ed0b60b6ae36ea5c55c32aaf1", "score": "0.5003171", "text": "function addRecipe() {\n\n var recipeName = document.getElementsByClassName(\"recipeName\")[0].value\n var recipeNumber = numberRecipe\n var recipeSteps = Array.from(document.getElementsByClassName('step'))\n\n for (var i = 0; i < recipeSteps.length; i++) {\n\n recipeSteps[i] = (i + 1) + \". \" + recipeSteps[i].value + \"<br>\"\n }\n\n newRecipe = new recipe(recipeName, recipeNumber, recipeSteps)\n\n \n // an if statement to check that there are properties to the object\n book[recipeNumber] = newRecipe\n\n if (newRecipe.name == \"\") {\n book.pop()\n numberRecipe--\n }\n\n if (book.length - 1 == 0) {\n document.getElementById(\"recipes\").innerHTML = \"<p>Page \" + book[0].number + \"</p><p id='recipeTitle'>\" + book[0].name + \"</p><p>\" + book[0].steps.join(\"\") + \"</p>\"\n }\n\n numberRecipe++\n}", "title": "" }, { "docid": "45054e0494b5c797abc6c1aabbc311a5", "score": "0.5002737", "text": "function load() {\r\n\r\n fetch('https://dog.ceo/api/breed/hound/images/random')\r\n .then(function(result){\r\n return result.json();\r\n })\r\n .then(function(data){\r\n \tcreateHTML(data);\r\n });\r\n \r\n}", "title": "" }, { "docid": "76dd05ab2d8fc278596246bc2d4e4285", "score": "0.49938864", "text": "function initContent(){ \n // OO: Istället för att låta \"candiesShow\" vara global, låt \"loadContent\" returnera html-koden\n candiesShow = '<div class=\"grid-container\" id=\"content\">'; \n loadContent(); \n candiesShow = candiesShow + '</div>'; console.log(candiesShow); \n document.getElementById(\"content\").innerHTML = candiesShow; \n}", "title": "" }, { "docid": "cc7b5c61aa012db969b309cac0658662", "score": "0.49917975", "text": "function fillRecipeDetail() {\n if (currentRecipe == null) {\n currentRecipe = allRecipes[Object.keys(allRecipes)[0]];\n }\n\n var activeRecipe = document.querySelector(\".card--active\");\n if (activeRecipe) {\n activeRecipe.classList.remove(\"card--active\");\n }\n\n //Highlight the user selected recipe.\n newActiveRecipe = document.querySelector(\"#card-\" + currentRecipe.id);\n newActiveRecipe.classList.add(\"card--active\");\n\n //Renders the right side section of the page with recipe content.\n document.querySelector(\"#recipeTitle\").innerHTML = `${currentRecipe.title}`;\n document.querySelector(\"#recipeFullImage\").setAttribute(\"src\", getRecipeFullImage(currentRecipe));\n document.querySelector(\"#recipeDescriptionText\").innerHTML =currentRecipe.description;\n document.querySelector(\"#recipeForPeople\").innerHTML = getRecipePeople();\n document.querySelector(\"#recipeIngredientLists\").innerHTML = listRecipeIngredients(currentRecipe);\n document.querySelector(\"#listRecipeIngredients\").innerHTML = listRecipeInstruction(currentRecipe.instructions);\n}", "title": "" }, { "docid": "d80d625a4b406246b189094d61d07786", "score": "0.49907932", "text": "function populateContent() {\n $.get(\"resources/data/content.xml\", function(content) {\n $(content)\n .find(\"includes item\")\n .each(function() {\n var id = $(\"id\", this).text();\n var html = $(\"html\", this).text();\n $('[data-include-html=\"' + id + '\"]')\n .html(html)\n .trigger(\"contentLoaded\");\n });\n $(document).trigger(\"allContentLoaded\");\n $(\"body\").addClass(\"contentLoaded\");\n }).fail(function() {\n console.error(\"content.xml is not loaded\");\n });\n }", "title": "" }, { "docid": "27947311c6e675b20ccd1b88f7015769", "score": "0.49895534", "text": "function generateRecipes()\n{\n $(\"#recipesGrid\").html(\"\");\n $.ajax({\n type:\"get\",\n async: false,\n url:\"getRecipes\",\n success: function(raw){\n var recipes = raw.split(\";\");\n for(var i = 0; i < recipes.length -1; i++)\n {\n //recipeData goes [id, title, src, desc, ETA, servings, ingredients, steps, username]\n var recipeData = recipes[i].split(\"|\");\n var element = \"<li id='\" + recipeData[0] + \"' class='pop' > <h3 >\" + recipeData[1] + \"</h3><hr><img src='\" + recipeData[2] + \"' /> </li>\";\n $(\"#recipesGrid\").append(element);\n }\n\n \n },\n error: function(var1, error){\n alert(error);\n }\n });\n}", "title": "" }, { "docid": "7ed5f805f18fe57f1599afc6b69cbe56", "score": "0.49754763", "text": "function renderRecipe(id, name, url, date, imgsrc) {\n\t\tconsole.log(name);\n\t\treturn $('<div>').attr('id', id).append(\n\t\t\t\t$('<img>').attr('src', imgsrc).addClass('recipeCardPic')\n\t\t\t).append(\n\t\t\t\t$('<p>').html(name).addClass('recipeCardTitle')\n\t\t\t)\n\t\t\t.addClass('recipeCard');\n\t}", "title": "" }, { "docid": "b133bb3f3802e4fe2d3b341031423b23", "score": "0.49709916", "text": "static load() {\r\n API.get('/recipes')\r\n .then(function(recipes){\r\n recipes.forEach(data => new Recipe(data))\r\n Recipe.all.sort(Recipe.alphaByName)\r\n Recipe.renderRecipes();\r\n })\r\n .finally(Day.load.bind(Day))\r\n .catch(errors => console.log(errors))\r\n }", "title": "" }, { "docid": "25569fd51c7eacc9296dd5bb4ac6e7e6", "score": "0.49700373", "text": "function useRecipeData(recipeData) {\n // return the 4th item in the array for the search query\n document.querySelector(\"#recipe-append\").innerHTML = `\n <div class=\"card center-align\" style=\"width: 18rem;\">\n <img src=\"${recipeData.hits[4].recipe.image}\" class=\"card-img-top\" alt=\"recipe image\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${recipeData.hits[4].recipe.label}</h5>\n <p class=\"card-text\">Ingredients:</p>\n <p class=\"card-text ingredients\">${recipeData.hits[4].recipe.ingredientLines}</p>\n <br>\n <p class=\"card-text\">Click the button below and check out the recipe!</p>\n <a href=\"${recipeData.hits[4].recipe.url}\" class=\"recipe-btn btn-primary\">Get Cooking!</a>\n </div>\n </div>\n `\n}", "title": "" }, { "docid": "bdbeee6df6c4c3dbc019a99bccf63339", "score": "0.49590817", "text": "async getRecipe(){\n try {\n const result = await axios(`https://forkify-api.herokuapp.com/api/get?rId=${this.id}`);\n const recipe = result.data.recipe;\n // Set all the neeeded attributes for this recipe\n this.title = recipe.title;\n this.author = recipe.publisher;\n this.img = recipe.image_url;\n this.url = recipe.source_url;\n this.ingredients = recipe.ingredients.map(this.parseIngredient);\n\n } catch (error){\n console.log(error);\n }\n }", "title": "" }, { "docid": "916fec4a7bf21b99978eccbeec0fdb9a", "score": "0.4943974", "text": "function renderSingleRecipe(id, name, url, date, imgsrc, text) {\n\t\treturn $('<div>').attr('id', 'fullrecipe'+id).append(\n\t\t\t$('<h2>').html(name)\n\t\t).append(\n\t\t\t$('<h3>').html(\"Saved on \" + date)\n\t\t).append(\n\t\t\t$('<img>').attr('src', imgsrc)\n\t\t);\n\t}", "title": "" }, { "docid": "2c2fcd2ad38b1cae7c3144d914ef5738", "score": "0.49413696", "text": "function retrieveSingleRecipe() {\n event.preventDefault();\n recipeID = $(this).attr(\"id\");\n recipeTitle = $(this).attr(\"recipe-name\");\n $(\"#ingredient-modal-title\").empty();\n $(\"#ingredient-modal-title\").text(recipeTitle);\n queryURL = \"https://www.food2fork.com/api/get?key=\" + key + \"&rId=\" + recipeID;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function(response) {\n displaySingleRecipe(response)\n\n });\n}", "title": "" }, { "docid": "5eaaf47aae0eb2f5a0285448a5e97479", "score": "0.491876", "text": "function getRecipe() {\n axios\n .get(\"http://127.0.0.1:5000/recipes/fetch_recipe?hash=\" + hash)\n .then((response) => {\n console.log(response);\n setRecipe(response[\"data\"][0]);\n getImage(response[\"data\"][0].title);\n getTags(response[\"data\"][0].id);\n })\n .catch(function (error) {\n console.log(error);\n });\n }", "title": "" }, { "docid": "35624838f27f1d1a0b7a0829183c3703", "score": "0.49051756", "text": "function getAll() {\n let request = new XMLHttpRequest();\n request.open(\"GET\", \"http://127.0.0.1:3000/recipe/getAll\", true);\n request.onload = function() {\n data = JSON.parse(this.response);\n if (request.status == 200)\n {\n console.log(data);\n for(let i=0;i<data.length;i++)\n {\n var recipe = \"Username: \" + data[i].username + \" Title: \" + data[i].recipeTitle + \" Ingredients: \" + data[i].recipeIngredients + \" Category: \" + data[i].recipeCategories + \" Directions: \" + data[i].recipeDirections;\n var newP = document.createElement(\"p\");\n newP.setAttribute('id', 'recipePrintOut');\n var recipeNode = document.createTextNode(recipe);\n newP.appendChild(recipeNode);\n document.querySelector(\"#allRecipeDiv\").appendChild(newP);\n }\n }\n else {console.log(\"ERROR\");}\n }\n request.send();\n}", "title": "" }, { "docid": "9a5d614f089015481ae1a5a3af9c54f6", "score": "0.4891969", "text": "set data(data) {\n this.json = data;\n\n // reset article to be empty so we can populate it \n // fill in with same html as in constructor\n this.shadowRoot.querySelector('article').innerHTML = `\n <div class=\"photo\" style=\"\"> \n <div class=\"recipe-notes\">\n <button class=\"notes-button\">Recipe Notes</button>\n </div>\n </div>\n <div class=\"notes hide\">\n <textarea name=\"comments\" id=\"additional_comments\" cols=\"30\" rows=\"10\"></textarea>\n <div class=\"recipe-notes\">\n <button class=\"image-button\">Close</button>\n </div>\n </div>\n <div class=\"recipe-info-container\">\n <div class=\"back-to-search\">\n <button>Back to Search</button>\n </div>\n <div class=\"recipe-info\">\n <h3 class=\"name\"></h3>\n <div class=\"time-info\"> \n <span>Total Time: </span> \n <span><b id=\"time\"></b></span> \n </div> \n <div class=\"calories\">\n <span>Calories Per Serving:</span> \n <span><b id=\"cals\"></b></span>\n </div>\n <div class=\"recipe-tags\"> \n </div>\n <div class=\"description\">\n <p id=\"summary\"></p>\n </div>\n </div>\n <div class=\"add-to-myrecipes\">\n <button>Add to MyRecipes</button>\n </div>\n </div>\n <div class=\"ingredients\">\n <h3>Ingredients</h3>\n <div class=\"serving-size\">\n <span>Servings:</span>\n <button class=\"minus-button\">-</button>\n <span class=\"num-servings\"><b id=\"servings\"></b></span>\n <button class=\"plus-button\">+</button>\n </div>\n <ul class=\"ingredients\"> \n </ul>\n </div>\n <div class=\"directions\">\n <h3>Directions</h3>\n <div class=\"equipment\">\n <span>Equipment:</span>\n <span><b id=\"equipment-list\"></b></span>\n </div>\n <ol> \n </ol>\n </div>\n `;\n\n // TODO: set all data\n\n // set image \n const recipeImage = data['image'];\n this.shadowRoot.querySelector('.photo').style = `background-image: url(${recipeImage})`;\n\n // set recipe title\n const recipeTitle = data['title'];\n this.shadowRoot.querySelector('.name').innerHTML = recipeTitle;\n\n // set total time\n const totalTime = data['readyInMinutes'];\n this.shadowRoot.getElementById('time').innerHTML = totalTime + ' min';\n\n // set calories\n const calories = data[''] // need to find this\n this.shadowRoot.getElementById('cals').innerHTML = calories;\n\n // set racipe tags\n \n\n // set description\n const description = data['summary'] // need to find this\n this.shadowRoot.getElementById('summary').innerHTML = description;\n\n //set serving size\n const servings = data['servings'];\n this.shadowRoot.getElementById('servings').innerHTML = servings;\n\n // set ingredient list\n const ingredients = data[''];\n\n\n // set necessary equipment\n const equipmentSet = new Set();\n const recipeSteps = data['analyzedInstructions'][0].steps;\n for (let i = 0; i < recipeSteps.length; i++) {\n const equipmentArr = recipeSteps[i].equipment;\n for (let j = 0; j < equipmentArr.length; j++) {\n equipmentSet.add(equipmentArr[j].name);\n }\n }\n let count = 1;\n let equipmentList = this.shadowRoot.getElementById('equipment-list');\n for (const item of equipmentSet) {\n if (count == equipmentSet.size) {\n equipmentList.innerHTML += item;\n } else {\n equipmentList.innerHTML = equipmentList.innerHTML + item + ', ';\n }\n count++;\n }\n\n // set directions list\n const directions = data['analyzedInstructions'][0].steps;\n let directionsList = this.shadowRoot.querySelector('ol');\n for (let i = 0; i < directions.length; i++) {\n const dir = document.createElement('li');\n dir.innerHTML = directions[i].step;\n directionsList.appendChild(dir);\n }\n }", "title": "" }, { "docid": "e9f8e5a073f255577b1faf4dd9d0394b", "score": "0.48883277", "text": "function getRecipe(tag) {\n var queryURL = \"https://api.spoonacular.com/recipes/search?query=\" + tag + \"&number1&apiKey=c30cd056ba1c4e459950da3b71b83d82\"\n\n //ajax call for recipe\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n\n //see what information you can get from this api, make divs to display them to, append them to the target element one by one\n console.log(response);\n \n //create a url link to the address in the returned object\n var recipeLink = $(\"<a>\").attr(\"href\", response.results[0].sourceUrl);\n recipeLink.text(response.results[0].title);\n \n //empty the #recipe div and append the new link to it\n $(\"#recipe\").empty()\n $(\"#recipe\").append(recipeLink);\n \n var currentRecipe = response.results[0].id\n console.log(currentRecipe)\n \n \n //create a function to get the ingredients, with a second ajax call (probably don't have to use localstorage since it will be able to look outward)\n function getIngredients() {\n\n \n //create a variable for our ingredientQuery url\n var ingredientQuery = `https://api.spoonacular.com/recipes/${currentRecipe}/ingredientWidget.json?apiKey=c30cd056ba1c4e459950da3b71b83d82`;\n console.log(ingredientQuery);\n \n //second ajax function for ingredients:\n $.ajax({\n url: ingredientQuery,\n method: \"GET\"\n }).then(function (response) {\n console.log(response)\n });\n \n //create a variable to represent the ingredient list that corresponds with the returned object?\n \n };//closing bracket for getIngredients function\n\n //invoke getIngredients function as a step\n getIngredients();\n \n });//closing bracket for getRecipe function's ajax call\n \n}", "title": "" }, { "docid": "bff4941355ab01c0e982533ef7170345", "score": "0.4883459", "text": "function loadDom() {\n insertAnnotations(aliceTextRaw);\n displayText(annotatedText);\n displayInstructions();\n }", "title": "" }, { "docid": "b8e4df5a5e9eeaae88129da521199513", "score": "0.4882997", "text": "function recipeUnpacker(recipeID) {\n //calls function to pull recipe from db\n var webMethod = \"../RecipeServices.asmx/ViewRecipe\";\n $.ajax({\n type: \"POST\",\n url: webMethod,\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (msg) {\n //creates and sets recipe object equal to returned datat object\n var recipe = msg.d;\n }\n });\n //set variables equal to recipe properties\n var userID = recipe.userID;\n var ingredients = recipe.ingredients.split(\",\");\n var utensils = recipe.utensils.split(\",\");\n var directions = recipe.directions.split(\",\");\n //fill in page elements\n}", "title": "" }, { "docid": "087b5c8443981c36ddef4742611a4280", "score": "0.487623", "text": "function displayItems(recipes) {\n const container = document.querySelector(\".recipes\");\n container.innerHTML = recipes\n .map((recipe) => createHTMLString(recipe))\n .join(\"\");\n}", "title": "" }, { "docid": "7b7b328e934b97cd760c70bf73c688bb", "score": "0.48648843", "text": "populateLoadRecipesList() {\n if (!this.app.isLocalStorageAvailable()) return false;\n\n const loadNameEl = document.getElementById(\"load-name\");\n\n // Remove current recipes from select\n let i = loadNameEl.options.length;\n while (i--) {\n loadNameEl.remove(i);\n }\n\n // Add recipes to select\n const savedRecipes = localStorage.savedRecipes ?\n JSON.parse(localStorage.savedRecipes) : [];\n\n for (i = 0; i < savedRecipes.length; i++) {\n const opt = document.createElement(\"option\");\n opt.value = savedRecipes[i].id;\n // Unescape then re-escape in case localStorage has been corrupted\n opt.innerHTML = Utils.escapeHtml(Utils.unescapeHtml(savedRecipes[i].name));\n\n loadNameEl.appendChild(opt);\n }\n\n // Populate textarea with first recipe\n const loadText = document.getElementById(\"load-text\");\n const evt = new Event(\"change\");\n loadText.value = savedRecipes.length ? savedRecipes[0].recipe : \"\";\n loadText.dispatchEvent(evt);\n }", "title": "" }, { "docid": "5a7525005920ded7dcea6dde0d4b34e5", "score": "0.48647267", "text": "function display_grain_bill() {\n $.get({{ STATIC_URL }} + 'grain_entry.htm', function(template) {\n $.each(recipe.grain_bill, function(i, grain) {\n var $tpl = $('<div />').html(template); // make detached DOM node\n fill_grain_template(grain, $tpl);\n $('#fermentable_container').append($tpl.html());\n });\n });\n}", "title": "" }, { "docid": "e7f2fefe80e39919e9a539da7ac1e3ba", "score": "0.4857876", "text": "function displayRecipes(data) {\n var results = data.matches;\n for (var index = 0; index < 5; index++) {\n // console.log (myrecipe);\n var divId = \"#recipe-div-\"+index;\n var divTitle = \"#recipe-title-\"+index;\n $(divId).addClass(\"text-center\");\n $(divTitle).append(\"<p>\"+results[index].recipeName +\"</p>\");\n $(divId).append(\"<img class='recipeImages w-100' style='height:150px;' id='img_\"+(results[index].id)+\"' src='\"+results[index].imageUrlsBySize[90].slice(0, -6) +\"'/>\");\n $(divId).append(\"<p hidden id='recipeName_\"+ (results[index].id)+\"'>\" + (results[index].recipeName) + \" </p>\");\n $(divId).append(\"<p hidden id='ingredientsList_\"+ (results[index].id)+\"'>\" + (results[index].ingredients) + \" </p>\"); \n $(divId).attr(\"id\",results[index].id); \n }\n $(\".side-recipe-div\")[0].click();\n}", "title": "" }, { "docid": "ce226c19fa6a1533e4f169a590959c7c", "score": "0.484445", "text": "function load_()\n\t {\n\t\tvar content = this.getAttribute('value');\n\t\t$('.content').load(content + '.html', function() {\n\t\t\tif (console) {\n\t\t\t\tconsole.log(content + ' loaded successfully');\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "1348025bdc353ba271a50e218aa5e296", "score": "0.48395318", "text": "function getRecipeById(recipeID) {\n fetch(`https://www.mealprepapi.com/api/v1/recipes/${recipeID}`)\n .then((response) => response.json())\n .then((results) => {\n const recipe = results.data;\n addRecipeToDOM(recipe);\n });\n}", "title": "" }, { "docid": "ac5da1d02bccefd8cb2c36a76243d5e6", "score": "0.4829168", "text": "function onload() {\n xhr.onload = function () {\n if (this.status === 200) {\n let json = JSON.parse(this.responseText);\n let articles = json.articles;\n let container = document.getElementById('container');\n let newsHtml = \"\";\n articles.forEach(function (element, index) {\n let news = `<div class=\"headline\">\n <p id=\"title\">Breaking News ${index + 1} : ${element['title']}</p>\n </div>\n <div class=\"explanation\">\n <p id=\"content\">\n ${element['content']}<a href=\"${element['url']}\" target=\"_blank\" >Read more here</a>\n </p>\n </div>`\n\n newsHtml += news;\n });\n container.innerHTML = newsHtml;\n effects();\n }\n else {\n console.log(\"some error occured\");\n }\n }\n}", "title": "" }, { "docid": "fe907c9be9469af4a774a8d14af6e8b7", "score": "0.48239708", "text": "function createExerciseFromXrLibrary(type){\n\t$.ajax({\n\t\turl : siteUrl+\"search/getmodelTemplate/\",\n\t\tdata : {\n\t\t\taction : 'exerciseLibrary',\n\t\t\trequestFrom:'dashboard'\n\t\t},\n\t\tsuccess : function(content){\n\t\t\t$('#exerciselib-template').remove();\n\t\t\t$('body div.container').append(content);\n\t\t\tif($('#exerciselib-model').length){\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t$('#exerciselib-model').modal();\n\t\t\t\t\t$('#exerciselib-model').on('shown.bs.modal', function() {\n\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\tsetDynamicHeight();\n\t\t\t\t\t\t}, 200);\n\t\t\t\t\t});\n\t\t\t\t}, 200);\n\t\t\t};\n\t\t}\n\t});\n}", "title": "" }, { "docid": "1990d217635ac154d2b2212aec2ad75c", "score": "0.4822398", "text": "async function getXmen() {\n //getting id from inputfield\n let heroId = document.getElementById('hero-id').value;\n //selecting the right element from json object, and fetching it\n let data = await fetch(`http://localhost:3000/heroes?id=${heroId}`);\n let heroObj = await data.json();\n //selecting the first element (of one element but yes)\n heroObj = heroObj[0];\n // using the provided template with the wanted data\n createTemplate(heroObj)\n \n }", "title": "" }, { "docid": "d7ab5698d18d7ea064dee94fd1a8728d", "score": "0.4815411", "text": "function fullRecipe(){\n\n var txt = \"\";\n\n fetch(jsFile[p])\n .then(function(resp){\n return resp.json();\n })\n .then(function(data){\n var x;\n var i = 0;\n \n for(x in data){\n\n if(data[x] == data[\"recipe_instructions\"]){\n txt += \"Recipe Instructions\" + \"<br>\";\n for(x in data[\"recipe_instructions\"]){\n txt += data.recipe_instructions[x] + \"<br>\";\n }\n }\n else if(data[x] == data[\"recipe_ingredients\"]){\n txt += \"Recipe Instructions\" + \"<br>\";\n for(x in data[\"recipe_instructions\"]){\n txt += data.recipe_instructions[x] + \"<br>\";\n }\n }\n else{\n txt += recipeInfo[i] + \" \" + data[x] + \"<br>\";\n i++;\n }\n }\n\n document.getElementById(\"recipeViewFull\").innerHTML = txt;\n })\n \n }", "title": "" }, { "docid": "0debbb53d59e188fb358ee1f3f090400", "score": "0.47828785", "text": "function load()\r\n{\r\n // load the xml doms\r\n //var newsXML = loadXML(\"xml/news.xml\");\r\n var newsXML = loadXML(\"https://moneytech.github.io/webd/xml/news.xml\");\r\n\r\n // obtain the root element in order to insert elements\r\n // in the appropriate places\r\n var newsRoot = newsXML.documentElement;\r\n\r\n var news = document.getElementById(\"news\");\r\n var articles = newsRoot.getElementsByTagName('article');\r\n\r\n var i = -1;\r\n\r\n while(articles[++i] !== undefined)\r\n {\r\n var title = articles[i].getElementsByTagName(\"title\")[0].firstChild.nodeValue;\r\n var link = articles[i].getElementsByTagName(\"link\")[0].firstChild.nodeValue;\r\n\r\n var li = document.createElement(\"li\");\r\n var a = document.createElement(\"a\");\r\n\r\n a.setAttribute(\"href\", link);\r\n a.innerHTML = title;\r\n\r\n li.append(a);\r\n news.append(li);\r\n }\r\n}", "title": "" }, { "docid": "4c4f04bd576ee63550cc9091ec0b11ae", "score": "0.47815084", "text": "function showRecipes() {\n var selectedRecipes = [];\n data.forEach(function (recipe) { //could name it anything besides recipe.\n selectedTags.forEach(function (tag) {\n if (recipe.tags.includes(tag)) {\n selectedRecipes.push(recipe);\n return;\n }\n });\n });\n recipes.innerHTML = \"\";\n selectedRecipes.forEach(function (recipe) {\n var DOMrecipeListContainer = document.createElement('div');\n DOMrecipeListContainer.className = \"recipe-link\";\n var img = document.createElement('img');\n img.setAttribute('src', recipe.images);\n var h = document.createElement('H1'); //this is recipe.recipeTitle\n var t = document.createTextNode(recipe.recipeTitle);\n h.appendChild(t);\n var p = document.createElement('P');\n p.innerText = recipe.tags;\n p.appendChild(h);\n h.appendChild(img);\n DOMrecipeListContainer.append(img, h, p);\n DOMrecipeListContainer.style.width = \"100VW\";\n DOMrecipeListContainer.style.height = \"100VW\";\n DOMrecipeListContainer.style.background = \"green\";\n document.getElementById('recipes').appendChild(DOMrecipeListContainer);\n // lines 48 to 54 must be recoded using create element and append child. Then you can do\n // on click handler for each thing in loop.\n // alternatively use createelement and append child to build DIV above.\n // because h1.onclick = function() this can be the function to click when I call my title\n // this function needs to clear recipe.inner.html\"\" (line 46) then does the same thing again\n // rebuilds page with this full one screen page of recipe instructions.\n });\n // showrecipeInstructioncontainer();\n}", "title": "" }, { "docid": "1a43dd485805f8d8d0f96bb1906b05a0", "score": "0.47791827", "text": "function load_(o) {\n return o.x;\n}", "title": "" }, { "docid": "4a23a81af58a0bef12d3eec3d271c8ca", "score": "0.47713083", "text": "function load() {\n // reset id\n newInstanceId = 1;\n prepareContent(content.content());\n }", "title": "" }, { "docid": "2de6097faf53ef16d99c3092faa97c18", "score": "0.4767275", "text": "function eachRecipe(name,image){\n var recipes =\"\";\n recipes += `\n <strong class = \"text-danger\">${name}</strong>\n <img src = \"${image}\" width = \"100\" class = \"rounded-circle\">\n `;\n $('#recipe').html(recipes);\n}", "title": "" }, { "docid": "aefff955d59155de1efeba2527c42bef", "score": "0.47637808", "text": "function loadArticle(search, content, autogen) {\n //Täytettävä html pohja.\n const template =\n `\n <h2>${search}</h2>\n <div class=\"figcaption-content\">\n ${content}\n </div>\n `;\n\n //Jos wikipedia artikkelin sisältö ei ole tyhjä, se luodaan elementin sisälle, muuten annetaan virhe.\n if(content){\n //Jos autogen on päällä, oikea elementti estitään suoraan id perusteella ja sen sisälle luodaan artikkeli.\n if(autogen){\n const figcaptionElement = document.querySelector(\"#\"+search+\"-figcaption\");\n\n if(!figcaptionElement){\n sendErrorCode(\"ei löydetty napin parent -elementtiä.\");\n }\n\n figcaptionElement.innerHTML = template;\n\n /*\n Jos autogen ei ole päällä, eli pyyntö tuli napilta. Etsitään napin ancestor elementti ja etsitään sieltä oikea elementti.\n Liäsksi elementille annetaan id merkiksi siitä, että mikä artikkeli elementtiin on ladattu.\n */\n } else {\n const figcaptionElement = document.querySelector(\"#\"+search).parentElement.parentElement.querySelector(\"figcaption\");\n\n if(!figcaptionElement){\n sendErrorCode(\"ei löydetty napin parent -elementtiä.\");\n }\n\n figcaptionElement.id = search + \"-figcaption\";\n figcaptionElement.innerHTML = template;\n }\n } else {\n console.error(\"Wikipedia artikkelin lataus ongelma\");\n }\n}", "title": "" }, { "docid": "578556870cad3f80e478edd57552b2aa", "score": "0.47621495", "text": "function readXML(xml) {\n // Pass in 'text/xml' content to be able to parse individual XML nodes\n const dom = new JSDOM(xml, { contentType: 'text/xml' });\n let div1 = dom.window.document.querySelector('div1');\n let output = createJSONChapter(div1);\n console.log(output);\n}", "title": "" }, { "docid": "c3ba478fa245bc31cf9a55b8cc37fe46", "score": "0.4757609", "text": "function getRecipeList() {\n fetch(`http://localhost:3001/recipes`)\n .then((response) => response.json())\n .then((data) => {\n let html = '';\n\n if (data) {\n // Display all the resulting recipes.\n for (let i = 0; i < data.length; i++) {\n html += `\n <div class=\"recipe-item\" data-id=\"${data[i].uuid}\">\n <div class=\"recipe\">\n `;\n\n // Recipes uploaded by a user won't have any images.\n html += `\n <div class=\"recipe-img\">\n <img src=\".${\n data[i].images\n ? data[i].images.small\n : '/img/blanktable.png'\n }\">\n </div>\n <div class=\"recipe-name\">\n <h3>${data[i].title}</h3>\n <a href=\"#\" class=\"recipe-btn\">Get Recipe</a>\n </div>\n </div>\n </div>\n `;\n }\n\n // Add one more set of divs for a blank placeholder entry.\n html += `\n <div class=\"recipe-item\" data-id=\"New Recipe\">\n <div class=\"recipe\">\n <div class=\"recipe-img\">\n <img src=\"./img/blanktable.png\">\n </div>\n <div class=\"recipe-name\">\n <h3>New recipe?</h3>\n <a href=\"#\" class=\"recipe-btn\">Click Here</a>\n </div>\n </div>\n </div>\n `;\n\n recipeList.classList.remove('notFound');\n } else {\n html = \"Sorry, we didn't find anything\";\n recipeList.classList.add('notFound');\n }\n\n recipeList.innerHTML = html;\n });\n}", "title": "" }, { "docid": "29dc76d32be186dd6c313a804be6da31", "score": "0.47485113", "text": "function AJAXLoad(contentURL, targetID)\n{\n var getRequest = new xmlRequest();\n getRequest.onreadystatechange=function() {\n var targetElement = document.getElementById(targetID);\n targetElement.innerHTML = \"<img src='/static/throbber.gif' alt='loading...'>\";\n if (getRequest.readyState==4) { //request has finished\n if (getRequest.status==200) { //request was OK\n targetElement.innerHTML=getRequest.responseText;\n } else {\n targetElement.innerHTML=\"<p>The requested resource failed to load.</p>\";\n }\n }\n }\n getRequest.open(\"GET\", contentURL, true); //load the target\n getRequest.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n getRequest.send(null);\n}", "title": "" }, { "docid": "c3130ef265173544f130b2f70a739d4e", "score": "0.4745455", "text": "function load(domEle, prop, data)\n\t{\n\t\tvar html = _getHtml(prop, data);\n\t\tdomEle.appendChild(html);\n\t}", "title": "" }, { "docid": "aeb6f9ed3ea790855d9c9dbbfca65913", "score": "0.4742191", "text": "loadButtonClick() {\n try {\n const recipeConfig = Utils.parseRecipeConfig(document.getElementById(\"load-text\").value);\n this.app.setRecipeConfig(recipeConfig);\n this.app.autoBake();\n\n $(\"#rec-list [data-toggle=popover]\").popover();\n } catch (e) {\n this.app.alert(\"Invalid recipe\", 2000);\n }\n }", "title": "" }, { "docid": "3bc1d6011ebc39c713c30559ecca34dc", "score": "0.47396255", "text": "function loadFileInto(fromIdentifier, fromList) {\n\n\t// creating a new XMLHttpRequest object\n\tajax = new XMLHttpRequest();\n \n // define the fromFile value based on PHP URL\n fromFile = \"recipes.php?id=\" + fromIdentifier + \"&list=\" + fromList;\n\n\t// defines the GET/POST method, source, and async value of the AJAX object\n\tajax.open(\"GET\", fromFile, true);\n\n\t// prepares code to do something in response to the AJAX request\n\tajax.onreadystatechange = function() {\n\t\t\n\t\t\tif ((this.readyState == 4) && (this.status == 200)) {\n\t\t\t\t\n console.log(\"AJAX JSON response: \" + this.responseText);\n \n //convert JSON from PHP into JS array\n responseArray = JSON.parse(this.responseText);\n responseHTML = \"\";\n for (x=0; x<responseArray.length; x++) {\n responseHTML += \"<li>\" + responseArray[x] + \"</li>\";\n }\n \n whereTo = \"#\" + fromList + \" ul\";\n if (fromList == \"directions\") whereTo = \"#\" + fromList + \" ol\";\n document.querySelector(whereTo).innerHTML = responseHTML;\n\t\t\t\t\n\t\t\t} else if ((this.readyState == 4) && (this.status != 200)) {\n\t\t\t\tconsole.log(\"Error: \" + this.responseText);\n\t\t\t\t\n\t\t\t}\n\t\t\n\t} // end ajax.onreadystatechange\n\n\t// now that everything is set, initiate request\n\tajax.send();\n\n}", "title": "" }, { "docid": "1d6588cefc05cd9d77732c0d76313f40", "score": "0.47362167", "text": "function loadDom(data){\r\n\t\t//Lead story contents\r\n\t\t$(\"#lead-story-section\").html(data[0].sections[0].name);\r\n\t\t// .wrap('<a href=\"/'+data[0].sections[0].slug+'/\"></a>');\r\n\t\tconsole.log(data);\r\n\t\t$(\"#lead-story-headline\").text(data[0].headline).wrapInner('<a href=\"/'+data[0].slug+'/\"></a>');\r\n\t\t$(\"#lead-story .img-box\").html('<img src=\"'+imgConfig.cdn+data[0][\"hero-image-s3-key\"] + '\" alt =\"\"/>');\r\n\t\t$(\".lead-story-author .right span.author-name\").html(data[0][\"author-name\"]);\r\n\t\t$(\".lead-story-author .right span.time\").html(getPDate(data[0][\"last-published-at\"]));\r\n\r\n\t\t//Module2 contents\r\n\t\t$(\"#module2-left-section\").html(data[1].sections[0].name);\r\n\t\t// .wrap('<a href=\"/'+data[1].sections[0].slug+'/\"></a>');\r\n\t\tconsole.log(new Date(data[1][\"last-published-at\"]));\r\n\t\t$(\"#module2-left-headline\").text(data[1].headline).wrapInner('<a href=\"/'+data[1].slug+'/\"></a>');\r\n\t\t$(\".module2-left .img-box\").html('<img src=\"'+imgConfig.cdn+data[1][\"hero-image-s3-key\"] + '\" alt =\"\"/>');\r\n\t\t$(\".module2-left span.author\").html(data[1][\"author-name\"]);\r\n\t\tvar module2Html = \"<ul>\";\r\n\t\tfor (var i = 2; i < 5; i++) {\r\n\t\t\tmodule2Html += '<li><h4 class=\"section\">'+data[i].sections[0].name+'</h4><h2><a href=\"/'+data[i].slug+'/\">'+data[i].headline +'</a></h2><span class=\"author\">'+data[i][\"author-name\"]+'</span></li>';\r\n\t\t}\r\n\t\tmodule2Html += \"</ul>\";\r\n\t\t$(\".module2-middle\").html(module2Html);\r\n\r\n\t\t//Must Read contents\r\n\r\n\t\tvar mustReadHtml = \"\";\r\n\t\tfor (var i = 5; i < 8; i++) {\r\n\t\t\tmustReadHtml += '<li><p>'+data[i].headline+'</p><a href=\"/'+data[i].slug+'/\">Read Story</a></li>';\r\n\t\t}\r\n\t\t$(\".must-read ul\").html(mustReadHtml);\r\n\t\t$(\".must-read ul\").cycle({\r\n\t\t\t\tfx: 'scrollHorz',\r\n\t\t\t\ttimeout: 10000,\r\n\t\t\t\tslides: '> li',\r\n\t\t\t\tspeed: 2000\r\n\t\t\t});\r\n\r\n\t\t//Politics contents\r\n\t\t\t//left\r\n\t\tvar module3LeftHtml = '<img src=\"'+imgConfig.cdn+data[8][\"hero-image-s3-key\"]+'\" alt=\"\"/>';\r\n\t\t\tmodule3LeftHtml += '<div><h2>' + data[8].headline + '</h2><span class=\"author\">'+data[8][\"author-name\"]+'</span></div>';\r\n\t\t$(\".module3-left\").html(module3LeftHtml);\r\n\t\t\t//Middle\r\n\t\t$(\".module3-middle-top\").html('<img src=\"'+imgConfig.cdn+data[9][\"hero-image-s3-key\"]+'\" alt=\"\"/><div><h2>'+ data[9].headline + '</h2><span class=\"author\">'+data[9][\"author-name\"]+'</span></div>');\r\n\t\t$(\".module3-middle-bottom\").html('<div><h2>'+ data[10].headline + '</h2><span class=\"author\">'+data[10][\"author-name\"]+'</span></div>');\r\n\t\t\t//Right\r\n\t\tvar moduleRightHtml = \"<ul>\";\r\n\t\tfor (var i = 11; i < 15; i++) {\r\n\t\t\tmoduleRightHtml += '<li><h2><a href=\"/'+data[i].slug+'/\">'+data[i].headline +'</a></h2><span class=\"author\">'+data[i][\"author-name\"]+'</span></li>';\r\n\t\t}\r\n\t\tmoduleRightHtml += \"</ul>\";\r\n\t\t$(\".module3-right\").html(moduleRightHtml);\r\n\t\t//Module4 contents\r\n\t\t\t//left\r\n\t\tvar module4LeftHtml = \"\";\r\n\t\tfor (var i = 15; i < 18; i++) {\r\n\t\t\tmodule4LeftHtml += '<div class=\"module4-left-content clearfix box\"><div class=\"img-box\"><img src=\"'+imgConfig.cdn+data[i][\"hero-image-s3-key\"] + '\" alt =\"\"/></div><div class=\"content-box\"><h2><a href=\"/'+data[i].slug+'/\">'+data[i].headline +'</a></h2><span class=\"author\">'+data[i][\"author-name\"]+'</span></div></div>';\r\n\t\t}\r\n\r\n\t\t$(\".module4-left\").html(module4LeftHtml);\r\n\t\t\t//Right\r\n\t\t$(\".module4-right\").html('<img src=\"'+imgConfig.cdn+data[15][\"hero-image-s3-key\"]+'\" alt=\"\"/><div><h2>'+ data[15].headline + '</h2><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Distinctio ipsa nesciunt temporibus dignissimos ducimus obcaecati.</p><span class=\"author\">'+data[15][\"author-name\"]+'</span></div>');\r\n\r\n\t\t//Recent stories\r\n\r\n\t\tvar recentHtml = \"\";\r\n\t\tfor (var i = 17; i < 20; i++) {\r\n\t\t\trecentHtml += '<div class=\"recent-post clearfix\"><div class=\"img-box\"><img src=\"'+imgConfig.cdn+data[i][\"hero-image-s3-key\"] + '\" alt =\"\"/></div><div class=\"right-content\"><h4 class=\"section\">'+data[i].sections[0].name+'</h4><h2><a href=\"/'+data[i].slug+'/\">'+data[i].headline +'</a></h2><span class=\"author\">'+data[i][\"author-name\"]+'</span><span class=\"time\">'+getPDate(data[0][\"last-published-at\"])+'</span></div></div>';\r\n\t\t}\r\n\t\trecentHtml += \"</ul>\";\r\n\t\t$(\".content-recent-stories\").html(recentHtml);\r\n\t}", "title": "" }, { "docid": "91fe2c3d6b4cbf3fd1aa2299dcb70398", "score": "0.47350276", "text": "async function populate_row(o) {\n const {html:row_html,lang,timeStamp} = o;\n const s3fn = `s3://blueink/${lang}/new-products.html`\n //console.log(`@463:`,{s3fn})\n const retv1 = await s3.getObject(s3fn); // template\n //console.log(`@463:`,retv1)\n\n let html = retv1.Body.toString('utf8');\n const $ = cheerio.load(html);\n const row = $('div#main-content');\n row.html(row_html)\n\n $('div#e3object-time-stamp').html(o.timeStamp)\n\n /*\n const e3objects = $('.e3object');\n const vo = [];\n e3objects.each((j,it)=>{\n const s3fn = it.attribs.e3object;\n // console.log(`--${j} inject <${s3fn}> `)\n vo.push(it);\n })\n\n for (it of vo) {\n const s3fn = it.attribs.e3object;\n console.log(`-- inject <${s3fn}> `)\n const retv1 = await s3.getObject(s3fn);\n if (!retv1 || retv1.error) {\n console.log(`ALERT@445 `,retv1)\n continue;\n }\n $(it).html(retv1.Body.toString('utf8'))\n }\n */\n\n html = $.html()\n return html\n}", "title": "" }, { "docid": "4938cb310d7b7da6b122304c00e86f50", "score": "0.472687", "text": "function parse(thedom){\n\n\t//Find ingredients\n\tvar ingredientsListParent = thedom.getElementsByClassName('recipe-ingred_txt');\n\tvar thisIngredient;\t\n\tfor (var i=0; i<ingredientsListParent.length; i++){\n\t\tvar iname = ingredientsListParent[i].innerText;\n\t\tif (iname != undefined && iname != \"Add all ingredients to list\"){\n\t\t\tINGREDIENTS.push(iname);\n\t\t}\n\t}\n\t\n\t//Find steps\n\tvar stepparents = thedom.getElementsByClassName('recipe-directions__list--item');\n\tfor (var i=0; i<stepparents.length; i++){\n\t\t\tthisstep = stepparents[i].innerText;\n\t\t\tSTEPS.push(thisstep);\n\t}\n\t\n\tvar ilist = document.getElementById(\"ilist\");\n\tvar slist = document.getElementById(\"slist\");\n\twhile(ilist.hasChildNodes()){\n\t\tilist.removeChild(ilist.firstChild);\n\t}\n\twhile(slist.hasChildNodes()){\n\t\tslist.removeChild(slist.firstChild);\n\t}\t\n\t\n\tvar title,img,li;\n\ttitle=thedom.getElementsByClassName('recipe-summary__h1')[0].innerText;\n\tvar toprow = document.getElementById('toprow');\n\tvar header = document.createElement('h1');\n\t\theader.appendChild(document.createTextNode(title));\n\t\theader.className = 'text-center';\n\ttoprow.insertBefore(header, toprow.firstChild);\n\t\n\timg = thedom.getElementsByClassName('rec-photo')[0].src;\n\t\n\tourimg = document.createElement('img');\n\t\tourimg.src = img;\n\t\tourimg.style.width = '500px';\n\tdocument.getElementById('picture').appendChild(ourimg);\n\t\n\tvar listParent = document.createElement('ul');\n\t\tlistParent.appendChild(document.createTextNode('List of ingredients:'));\n\tfor (var i = 0; i<INGREDIENTS.length;i++){\n\t\tif(INGREDIENTS[i].trim()==\"\") continue;\n\t\tli = document.createElement('li');\n\t\t\tli.style.color='grey';\n\t\t\tli.appendChild(document.createTextNode(INGREDIENTS[i]));\n\t\tlistParent.appendChild(li);\n\t}\n\tilist.appendChild(listParent);\n\t\n\tlistParent = document.createElement('ol');\n\t\tlistParent.appendChild(document.createTextNode('Instructions:'));\n\tfor (var i = 0; i<STEPS.length;i++){\n\t\tif(STEPS[i].trim()==\"\") continue;\n\t\tli = document.createElement('li');\n\t\t\tli.style.color='grey';\n\t\t\tli.appendChild(document.createTextNode(STEPS[i]));\n\t\tlistParent.appendChild(li);\n\t}\n\tslist.appendChild(listParent);\n\t\t\n\tconsole.log(INGREDIENTS);\n\tconsole.log(STEPS);\n}", "title": "" }, { "docid": "cdbaa70f63a5a33d8d26fd99c18b9a4e", "score": "0.47163433", "text": "function getRecipe(recipeID){\n\n recipeURL = \"https://api.spoonacular.com/recipes/\"+recipeID+\"/information?includeNutrition=true&apiKey=\"+spoonacularAPIKey;\n\n $.ajax({\n method:'GET',\n url:recipeURL\n }).then(function(data){\n console.log(data) //DEBUG\n \n parseRecipe(data);\n parseNutrition(data.nutrition);\n })\n}", "title": "" }, { "docid": "e72cf1cd8b91df1bd6ee7105ba577128", "score": "0.4711616", "text": "function useApiData(data){\n var max = 10;\n var new_recipe = \"\";\n for (var i=0; i<max; i++) {\n new_recipe += ` \n <div class=\"card recipe-card\" style=\"width: 18rem;\">\n <img src=\"${data.hits[i].recipe.image}\" class=\"card-img-top\" alt=\"...\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${data.hits[i].recipe.label}</h5>\n <p class=\"card-text\">Source: ${data.hits[i].recipe.source}</p>\n <a href=\"${data.hits[i].recipe.url}\" class=\"btn btn-primary recipe-info\">Click for the recipe</a>\n </div>\n </div>\n `\n\n console.log(new_recipe);\n document.querySelector(\"#content\").innerHTML = new_recipe;\n }\n\n }", "title": "" }, { "docid": "de8a45c4ea6377b2545e26458e8061de", "score": "0.47063532", "text": "function banner()\n{\n var url=\"\";\n var datos={\n id:2\n }\n var xml=ajax(url,datos);\n $(xml,\"item\").each(function()\n {\n var urlImagen=\"\";\n var html='<div class=\"item\"><img src=\"'+urlImagen+'\"></div>';\n $(\"#owl-demo\").append(html);\n });\n}", "title": "" }, { "docid": "aa183573910517580618643200d709a6", "score": "0.47036433", "text": "function displayRecipes(response) {\n\n var results = JSON.parse(response);\n$(\"#recipe-search-wrapper\").empty();\n $(\".recipe-search-container\").removeClass(\"hidden\");\n recipeCount = results.count;\n newRecipes = results.recipes;\n for (i = 0; i < recipeCount; i ++) {\n newDiv = $(\"<div>\")\n .attr(\"id\", newRecipes[i].recipe_id)\n .addClass(\"card\")\n newP = newRecipes[i].title;\n newSourceURL = newRecipes[i].source_url;\n newImage = $(\"<img>\")\n .attr(\"src\", newRecipes[i].image_url)\n .addClass(\"card-img-top\")\n .attr(\"alt\", \"an image of the cooked recipe\")\n divBody = $(\"<div>\")\n .addClass(\"card-body\");\n cardTitle = $(\"<h5>\")\n .addClass(\"card-title\")\n .text(newRecipes[i].title);\n sourceLink = $(\"<a>\")\n .attr(\"href\", newSourceURL)\n .attr(\"target\", \"_blank\")\n .text(newSourceURL);\n cardText = $(\"<p>\")\n .addClass(\"card-text\")\n .prepend(\"Source URL: \")\n .append(sourceLink)\n .append(\"<p> Popularity Rank: \" + (newRecipes[i].social_rank).toFixed(3) + \"</p>\");\n newButton = $(\"<button>\")\n .attr(\"id\", newRecipes[i].recipe_id)\n .attr(\"recipe-name\", newRecipes[i].title)\n .addClass(\"recipe-btn btn btn-primary\")\n .attr(\"data-toggle\", \"modal\")\n .attr(\"data-target\", \"#recipeModal\")\n .text(\"Click here to see the recipe\");\n newDiv.append(newImage, divBody);\n divBody.append(cardTitle, cardText, newButton)\n $(\"#recipe-search-wrapper\").append(newDiv);\n }\n}", "title": "" }, { "docid": "b215c8549a3be885effc38dc6f52c077", "score": "0.46949854", "text": "function Recipe(recipeName, imageURL, contributorName, recipeIdentifier) {\n this.name = recipeName;\n this.imgsrc = imageURL;\n this.contributor = contributorName;\n this.identifier = recipeIdentifier;\n \n // update screen with objects information\n this.displayRecipe = function() {\n document.querySelector(\"#titleBanner h1\").innerHTML = this.name;\n document.querySelector(\"#titleBanner h2\").innerHTML = \"Contributed by: \" + this.contributor;\n document.querySelector(\"#picture\").style.backgroundImage = \"url(\" + this.imgsrc + \")\";\n loadFileInto(this.identifier, \"ingredients\");\n loadFileInto(this.identifier, \"equipment\");\n loadFileInto(this.identifier, \"directions\");\n }\n}", "title": "" }, { "docid": "8be5de2784fd2ffb8abd79bb70ba13fb", "score": "0.4692387", "text": "function recipeHtml(recipe) {\n var index, ingredient, title = \"\", html = \"<div class='center' title='$(title)'>\";\n\n for (index = 0; index < recipe.length; ++index) {\n ingredient = recipe[index];\n fixIngredientName(ingredient);\n title += (title ? \", \" : \"\") + ingredientTitle(ingredient);\n html += ingredientHtml(ingredient);\n }\n \n html = html.replace(\"$(title)\", title);\n html += \"</div>\";\n \n return html\n}", "title": "" }, { "docid": "07ec2c93578572abab3953fed90a0f90", "score": "0.4690418", "text": "function getContent() {\n $.ajax({\n url: \"http://www.json-generator.com/api/json/get/bPUkvYyLzC?indent=2\",\n success: function (respuesta) {\n //console.log(Object.keys(respuesta.peliculas[0]));\n $(\".section-central-ind\").append(\n '<section id=\"s1\"><h2>' + respuesta.peliculas[0].genero + '</h2>' +\n '<div class=\"articulos-individual\">'\n );\n var articulos = $(\".articulos-individual\");\n $.each(respuesta.peliculas, function (index, elemento) {\n articulos.append(\n '<article>' +\n '<img src=\"' + elemento.poster + '\" title=\"' + elemento.titulo + '\">' +\n '<p>' + elemento.sinopsis + '</p></article></div>'\n );\n });\n //$(\".section-central-ind img\").css({'width':'200px','height':'200px'});\n console.log(respuesta);\n },\n error: function () {\n alert(\"No se ha podido obtener la información\");\n console.log(\"No se ha podido obtener la información\");\n }\n });\n}", "title": "" }, { "docid": "fabfbf1d390598e538a1e160e3db1b42", "score": "0.46886164", "text": "function getRecipes() {\n\n var search = document.getElementById('recipeSearch').value\n document.getElementById('recipeHere').innerHTML = \"\"\n console.log(search)\n \n $.ajax({\n url: cors + queryURL + search + keyId,\n dataType: \"JSON\",\n \n success: function (data) {\n for (i = 0; i < data.hits.length; i++) {\n var div = $('<div>', {\n class: \"recipeDiv\"\n });\n \n var heading = $('<h5>', {\n class: \"header\"\n })\n .text(data.hits[i].recipe.label);\n \n var image = $('<img>', { \n src: data.hits[i].recipe.image, \n alt: 'Recipe image',\n class: \"recipeImage\"\n });\n \n var link = $('<a>', { \n href: data.hits[i].recipe.url,\n class: \"link\"\n })\n .text('Link to Recipe').attr('target' ,'_blank');\n \n \n div.append(heading, link, \"<br>\", image, \"<br\", \"<hr>\")\n .appendTo(recipeHere);\n\n }\n },\n type: 'GET' \n });\n\n }", "title": "" }, { "docid": "704eaaf1383fe699ef6c32c3d18767b1", "score": "0.46784633", "text": "function load(node) {\n return request({\n path: `item/${node.id}`\n }).then(mutate);\n}", "title": "" }, { "docid": "54749791d22a106f40b49be25a979f35", "score": "0.46779862", "text": "load() {\n const storage = localStorage.getItem('recipes');\n const currentId = localStorage.getItem('currentId');\n // Check if any recipes are saved or exists in localStorage\n if (storage !== null) {\n const recipesJson = localStorage.getItem('recipes');\n this.recipes = JSON.parse(recipesJson);\n }\n // Check if the currentId is saved in localStorage\n if (currentId !== null) {\n const currentId = localStorage.getItem('currentId');\n this.currentId = parseInt(currentId);\n }\n }", "title": "" }, { "docid": "12c79ed14948525090aac7dd89aab70f", "score": "0.4676348", "text": "function morein(recipeId){\n \n \n base1 = ('https://forkify-api.herokuapp.com/api/get')\n base1 += `?rId=${recipeId}`\n fetch(base1)\n .then (function (response){\n return response.json();\n })\n .then(function(showDta){\n\n console.log(showDta);\n var LIStIngri =showDta.recipe.ingredients;\n \n \n var INGRID = document.createElement('div');\n INGRID.setAttribute('class','col-sm-3')\n INGRID.style.marginTop='100px'\n INGRID.style.border ='1px solid black'\n INGRID.style.textAlign='center'\n INGRID.style.backgroundColor= 'white';\n \n INGRID.style.bor ='2px'\n \n INGRID.style.borderRadius= '8px'\n INGRID.style.display ='inline-block'\n INGRID.style.marginLeft= '80px';\n \n \n // it will show the Ingredient at LAst\n \n \n INGRID.innerHTML =`\n <p><ul><li> Ingredients Of Dish are<hr><br>${LIStIngri}</li></ul></p>\n `\n\n document.body.appendChild(INGRID);\n \n \n })\n .catch(function(err){\n console.log(err);\n })\n\n}", "title": "" }, { "docid": "728e12b2648859b855902da6e09c6bb9", "score": "0.4667861", "text": "function loadContentItem()\n{\n var type = currentContentObject.contentType;\n var id = currentContentObject.contentId;\n var slideData;\n $.get(\"/\" + type + \"/\" + id + \".json\", function( data ) {\n var slideContent = data.content.replace(/\\[(.*?)\\]/g,\n \"</div><label class='slide_label'>$1</label> \\\n <div class='slide_content'><p>\");\n\n slideContent = \"<div>\" + slideContent;\n slideContent = slideContent.replace(/(?:\\r\\n|\\r|\\n)/g, '</p><p class=\"lyric-line\">');\n slideContent += \"</p></div>\";\n slideContent = slideContent.replace(\"<p></p>\",'');\ndefaultFontSize,defaultFont,fontColor,vidBGColor,100\n\n currentContentObject.fontSize = data.font_size ? data.font_size : defaultFontSize;\n currentContentObject.fontFamily = data.font_family ? data.font_family : defaultFont;\n currentContentObject.textColor = data.text_color ? data.text_color : fontColor;\n currentContentObject.bgResourceId = data.resource_id ? data.resource_id : null;\n currentContentObject.bgOpacity = data.bg_opacity ? data.bg_opacity : 100;\n currentContentObject.bgColor = data.bg_color ? data.bg_color : vidBGColor;\n\n $( \"#slides\" ).html( slideContent );\n $('.slide_content').click(function() { change_content(this); });\n\n });\n\n $(\"#slides div:nth-child(1)\").css(\"backgroundColor\",\"#A2D3A2\");\n}", "title": "" }, { "docid": "eb0de599457e5007ac8c6b61eaccb89f", "score": "0.46652827", "text": "function load_inner_html(uri, target) {\n load_data(uri, function (e) {\n target.innerHTML = e;\n exec_js(target);\n cTagLoader.forEach(function (l) {\n return l.load(target);\n });\n cCodeView.forEach(function (l) {\n return l.update(target);\n });\n cCalcValues.forEach(function (l) {\n return l.update(target);\n });\n if (typeof MathJax != \"undefined\") MathJax.typeset();\n });\n}", "title": "" }, { "docid": "43099c398709fdda3420c305af9c7419", "score": "0.46620855", "text": "function requestApi() {\n $.ajax ({\n dataType: \"json\",\n url: getUrl(),\n success: (data) => choseRecipe(data.recipes),\n error: () => console.log(\"Cannot get data\"),\n });\n}", "title": "" }, { "docid": "cd5c6e697a61eb834ec1f32133a8fd72", "score": "0.46617925", "text": "function populatePage (inventory) {\n\tvar carInventory = inventory[0];\n\tvar carDom = \"\";\n\tvar\tcarList = document.getElementById (\"car-list\");\n // Loop over the inventory and populate the page\n for (var i = 0; i<carInventory.cars.length; i++){\n\n \t\tcarDom += `<div class=\"col-md-6 col-md-4\">`;\n \t\tcarDom += `<div class=\"thumbnail\" id=car-${i}>`;\n \t\tcarDom += `<img src=\"${carInventory.cars[i].picture}\" style=\"width:100%\">`;\n \t\tcarDom += `<div class=\"caption\">`;\n \t\tcarDom += `<h4>${carInventory.cars[i].year} ${carInventory.cars[i].make} ${carInventory.cars[i].model}</h4>`;\n \t\tcarDom += `<h5>Price ${carInventory.cars[i].price}</h5>`;\n \t\tcarDom += `<p>${carInventory.cars[i].description}</p>`;\n \t\tcarDom += `</div> </div> </div>`;\n }\n \n carList.innerHTML = carDom;\n }", "title": "" }, { "docid": "a8d393a598ad21d6ad98e184fb377262", "score": "0.46616685", "text": "function setupDom() {\n creative.dom = {};\n creative.dom.mainContainer = document.getElementById('main-container');\n creative.dom.exit = document.getElementById('exit');\n creative.dom.feature = document.getElementById('feature');\n creative.dom.headline = document.getElementById('headline');\n creative.dom.logo = document.getElementById('logo');\n}", "title": "" }, { "docid": "dc1932830a02f843916f37549e22dd4d", "score": "0.46611714", "text": "async renderRecipes() {\n const recipes = await recipeService.getRecipe();\n const recipesCardContainer = document.getElementById('recipes-cards'); // Contenedor donde se va a renderizar.\n recipesCardContainer.innerHTML = ''; // Verifico que este limpio.\n recipes.forEach(recipe => {\n const div = document.createElement('div');\n div.className = '';\n div.innerHTML = `\n <div class=\"card m-2\">\n <div class=\"row\">\n <div class=\"col-md-4\">\n <img src=\"http://localhost:3000${recipe.imagePath}\" alt=\"\" class=\"img-fluid\" />\n </div>\n <div class=\"col-md-8\">\n <div class=\"card-block px-2\">\n <h3 class=\"card-title mt-1\">${recipe.title}</h3> \n <h5>Ingredients:</h5>\n <p class=\"card-text\">${recipe.ingredients}</p>\n <h5>Instructions:</h5>\n <p class=\"card-text\">${recipe.instructions}</p>\n <a href=\"#\" class=\"btn btn-primary delete\" _id=\"${recipe._id}\" style=\"max-width:3.9rem; width:3.9rem;\">\n <h3 class=\"delete\" _id=\"${recipe._id}\">🗑</h3>\n </a>\n <a href=\"#\" class=\"btn btn-success edit\" data-toggle=\"modal\" data-target=\"#myModal\" _id=\"${recipe._id}\" style=\"max-width:3.9rem; width:3.9rem;\" > \n <h3 class=\"edit\" _id=\"${recipe._id}\">🖊</h3>\n </a>\n\n <br>\n <br>\n </div>\n </div>\n </div>\n <div class=\"card-footer\">\n ${format(recipe.created_at)}\n </div>\n </div>\n `; // Que va a tener adentro.\n recipesCardContainer.appendChild(div);\n });\n }", "title": "" }, { "docid": "4ea978d9af5cbf0f8fa46c4f9609eb3d", "score": "0.46611091", "text": "function loadRecipe(user_directory, slug, rank, callback) {\n $(\"#recipe_container\").load(\n '/' + user_directory + '/cocktails/'+ slug + '/get_recipe/' + String(rank) + '/', function() {\n console.log(\"Loaded recipe \" + rank);\n if(callback) {\n callback();\n }\n }).hide().fadeIn('slow');\n}", "title": "" }, { "docid": "f99495259292b2ca44516d43946428ca", "score": "0.46565616", "text": "function loadnext(){\n //request opzetten\n var request = new XMLHttpRequest();\n request.onload = function() {\n //alleen het article selecteren van de request.response\n //en niet de hele html met head en body\n var article = request.response.querySelector(\"article\");\n //elke article een data-nr\n article.setAttribute(\"data-nr\",current);\n // article aan de dom toevoegen\n document.querySelector(\"main\").appendChild(article);\n //als het artikel is geplaatst, pagina tonen\n shownext();\n }\n //De counter wordt gebruikt om de juiste pagina te laden\n request.open('GET', pages[current]);\n //set 'type' als 'document' om html documenten te laden\n request.responseType = 'document';\n request.send();\n}", "title": "" }, { "docid": "23be646583a22ca8768ba8b51d3ba4ef", "score": "0.46558854", "text": "function LoadFileToElement(url, elementID) {\r\n\tajax.Request(url, \"\", function () {\r\n\t\td.getElementById(elementID).innerHTML = ajax.response;\r\n\t});\r\n}", "title": "" }, { "docid": "0f8b5483b7cc349d02d9723486482449", "score": "0.4652492", "text": "function displaySingleRecipe(response) {\n\n var results = JSON.parse(response); \n recipeIngredients = results.recipe.ingredients;\n newSource = $(\"<p>\")\n .html(\"See Full Recipe at: \" + \"<span><a href='\" + results.recipe.source_url +\"' target='_blank'>\" + results.recipe.source_url + \"</span>\");\n $(\"#ingredient-modal-body\").empty();\n $(\"#ingredient-modal-body\").prepend(newSource);\n for( i = 0 ; i < recipeIngredients.length; i++) {\n newP = $(\"<p>\").text(recipeIngredients[i]);\n $(\"#ingredient-modal-body\").append(newP);\n }\n $(\"#saveRecipe\").on(\"click\", function(){\n currentUserRecipes.push({\n recipe_name: results.recipe.title, recipe_id: results.recipe.recipe_id, recipe_url: results.recipe.source_url, recipe_image: results.recipe.image_url, usage_count: 0\n });\n results = null;\n });\n\n//Added call to display Edamam data \ndisplayCaloriesJSON (recipeIngredients,results.recipe.title);\n\n}", "title": "" }, { "docid": "6376ba950428b20178c5ae67b1d6cb82", "score": "0.46506432", "text": "async getRecipe() {\n try {\n const res = await axios(`https://forkify-api.herokuapp.com/api/get?rId=${this.id}`);\n //all properties we need for the object\n this.title = res.data.recipe.title;\n this.author = res.data.recipe.publisher;\n this.img = res.data.recipe.image_url;\n this.url = res.data.recipe.source_url;\n this.ingredients = res.data.recipe.ingredients;\n } catch (error) {\n console.log(error);\n alert('Something went wrong');\n }\n }", "title": "" }, { "docid": "dbfb15a19a5b99ba24cdb549810f601a", "score": "0.46499047", "text": "function Recipe(recipeName, imageURL, contributorName, ingredientsFilename, equipmentFilename, directionsFilename) {\n this.name = recipeName;\n this.imgsrc = imageURL;\n this.contributor = contributorName;\n this.ingFile = ingredientsFilename;\n this.equipFile = equipmentFilename;\n this.dirFile = directionsFilename;\n \n // update screen with objects information\n this.displayRecipe = function() {\n document.querySelector(\"#titleBanner h1\").innerHTML = this.name;\n document.querySelector(\"#titleBanner h2\").innerHTML = \"Contributed by: \" + this.contributor;\n document.querySelector(\"#picture\").style.backgroundImage = \"url(\" + this.imgsrc + \")\";\n loadFileInto(this.ingFile, \"ingredients\");\n loadFileInto(this.equipFile, \"equipment\");\n loadFileInto(this.dirFile, \"directions\");\n }\n}", "title": "" }, { "docid": "2918106526d6df4e495478c0c0182907", "score": "0.46433195", "text": "loadClick() {\n this.populateLoadRecipesList();\n $(\"#load-modal\").modal();\n }", "title": "" }, { "docid": "10bdacb201f79608892f8743680f0908", "score": "0.4643253", "text": "loadContent(container, mode = this.mode || \"default\") { //TODO other name for function\n if(mode == \"default\")\n this.createBoxAsDefault(container);\n else if (mode == \"popup\")\n this.createBoxAsPopup(container);\n else if (mode == \"prop\")\n this.createBoxAsProp(container);\n else if (mode == \"point\")\n this.createBoxAsPoint(container);\n else if (mode == \"section\")\n this.createBoxAsSection(container);\n\n this.mode = mode;\n\n this.checkForChildren();\n if(this.mode == \"default\" || this.mode == \"popup\") {\n // load childrens content\n let filterprops = false;\n this.data.props.forEach(propid => {\n let propbox;\n if(propid[0] == \"_\") { // support for old versions (\"props\":[\"_tmpid123\"])\n propbox = new Box({tmpid: propid}, this.boxmgr)\n filterprops = true;\n } else\n propbox = this.boxmgr.getBox(propid);\n propbox.data.in = this.id;\n propbox.loadContent(this.elements.propContainer, propbox.data.issection ? \"section\" : \"prop\");\n });\n if(filterprops) // remove for old propids (\"props\":[\"_tmpid123\"])\n this.data.props = this.data.props.filter(propid => propid[0] != \"_\");\n }\n // load own content\n this.title = this.data.title;\n MathJax && MathJax.typeset && MathJax.typeset();\n }", "title": "" }, { "docid": "42d9876421ce6008ebd9cc08c9762934", "score": "0.46382675", "text": "async function onLoad(id){\n async function getData(url){\n const response = await fetch(url);\n const data = await response.json();\n return data;\n }\n try{\n const datos = await getData(`https://rickandmortyapi.com/api/character/${id}`);\n const bloqueEnHTML =\n `<div class=\"item\">\n <img src=\"${datos.image}\" alt=\"Character img\">\n <p>\n <span>${datos.name}</span><br>\n </p>\n </div>`\n const html = document.implementation.createHTMLDocument() //creamos un document virtual\n html.body.innerHTML = bloqueEnHTML //Aqui convertimos el texto en una etiqueta real\n elemento.append(html.body.children[0]) // Se agrega la etiqueta real a .elemento\n }\n catch{\n console.log('Algo salio mal');\n }\n}", "title": "" }, { "docid": "917d5ce297aa7cbbb6cac45fae482c62", "score": "0.46257916", "text": "function getRecipeListItem(recipe)\n{\n // create a variable to store the HTML code\n // we put the static (non variable) bits in speech marks\n // and the variable bits outside of speech marks\n var li = \"<li>\"\n + \"<img src=\" + recipe.image + \">\"\n + \"<h3>\" + recipe.label + \"</h3>\"\n + \"<p>This recipe is <b>\" + recipe.level + \"</b> and will take you \" + recipe.totalTime + \" minutes to prepare.</p>\"\n + \"<a href=\" + recipe.url + \" target=_blank>Let's make this recipe</a>\"\n + \"</li>\"\n\n return li \n}", "title": "" }, { "docid": "5bfcf875baac723cc86d80a5f1a0352d", "score": "0.46222347", "text": "function loadCarrinho(){\n var compras = JSON.parse(carrinho);\n var i;\n var page = '<div id=\"cartPage\" class=\"w3-center w3-light-gray\">'+\n '<br><br><br><br><br>'+\n '<div class=\"w3-ontainer w3-padding-32 w3-hide-small\"></div>'+\n '<div class=\"w3-center w3-container \">'+\n '<h2 class=\"KartHead\">Carrinho</h2>'+\n '</div>'+\n '<div class=\"w3-container cartContent w3-center w3-white\">'+\n '<div class=\"cartContentHeader w3-black w3-row\">'+\n '<div class = \"descKart w3-col\t\">Item</div>'+\n '<div class = \"descKart w3-col\t\">Descricao</div>'+\n '<div class = \"descKart w3-col\t\">Quantidade</div>'+\n '<div class = \"descKart w3-col\t\">Preco</div>'+\n '</div>';\n for(i = 0 ; i < compras.produtos.length ; i++){\n page += '<div class=\"cartItem w3-container w3-row\">'+\n '<div class=\"cartProdImg w3-container w3-col\">'+\n '<img class = \"cartImg w3-image\" src = \"img/'+ compras.produtos[i].foto +'\" alt = \"Ração\"/>'+\n '</div>'+\n\n '<div class=\"cartDescr w3-col w3-container\">'+ compras.produtos[i].desc +'</div>'+\n '<div class=\"cartQtd w3-container w3-col\"><input onkeydown=\"return false;\" onclick=\"updatePreco()\" type=\\'number\\' min=\"0\" max=\\''+compras.produtos[i].qtdE+ '\\' id=\\'qtd'+ compras.produtos[i].produtoID + '\\' name=\\'mynumber\\' value=\\'1\\' /> </div>'+\n '<div class=\"cartPreco w3-container w3-col\">R$'+ compras.produtos[i].preco +'</div>'+\n /*'<div class=\"cartX w3-container w3-col \"><span class=\"w3-hover-black Xis\"><a href=\"#\" onclick=\"removerDoCarrinho('+ compras.produtos[i].produtoID +')\">X</a></span></div>'+*/\n '</div>';\n precototal += parseFloat(compras.produtos[i].preco);\n }\n\n\n page += '<div class=\"cartSumPrice w3-black\"><span class=\"w3-right totalPrice\" id=\"precoTotal\">Total: R$ '+ precototal +'</span></div>'+\n '</div>'+\n '<div class=\"w3-container w3-row\">'+\n '<div class=\"w3-container w3-half w3-center w3-white contPay w3-border\">'+\n '<h2 class=\"KartHead2 w3-teal\">Pagamento</h2>'+\n 'Numero do Cartão:<br>'+\n '<input type=text class=\"payIn\" pattern=\"[0-9]{13,16}\"><br>'+\n 'Senha:<br>'+\n '<input type=\"password\" class=\"payIn\"><br>'+\n\n '<img class = \"cartImg\" src = \"img/Logos-Cart%C3%B5es-de-Cr%C3%A9dito-com-Logo-Pagseguro.jpg\" alt = \"Ração\"/>'+\n '</div>'+\n\n '<div class=\"w3-container w3-half w3-center w3-white contPay w3-border\">'+\n '<h2 class=\"KartHead2 w3-teal\">Endereco</h2>'+\n 'Endereco:<br>'+\n '<input type=text class=\"payIn\"><br>'+\n 'CEP:<br>'+\n '<input type=text class=\"payIn\" pattern=\"[0-9]{13,16}\"><br>'+\n 'Telefone:<br>'+\n '<input type=text class=\"payIn\" pattern=\"[0-9]{13,16}\"><br>'+\n '<div class=\"w3-container fimKart\">'+\n '<a href=\"#\" onclick=\"realizarVenda()\"><div id=\"FinPay\" type=\"button\" class=\"w3-black w3-hover-teal\">Finalizar</div></a>'+\n '</div>'+\n '</div>'+\n '</div>'+\n '</div>';\n document.getElementById(\"success\").innerHTML = page;\n updatePreco();\n}", "title": "" }, { "docid": "c9f1a21a69cf9f9e10128f727ef13c3c", "score": "0.46189436", "text": "function loadLectureContent(httpDoc, index) {\n var divName = \"electure-\" + index[0]; // get the 1st part of the 2d array - value of the ddlArray\n var slideDiv = httpDoc.getElementById(divName);\n\n var containerDiv = document.getElementById(\"lecture-container\");\n var titleNode = document.createElement(\"p\");\n var lectureNode = document.createElement(\"div\");\n\n titleNode.style.cssText = \"font-weight: bold\";\n titleNode.append(index[1]); // append because its not a node, but a normal string (text of ddlArray)\n lectureNode.appendChild(titleNode);\n lectureNode.appendChild(slideDiv);\n containerDiv.appendChild(lectureNode);\n\n validation(slideDiv); // validation to remove uneccessary styles\n}", "title": "" }, { "docid": "4da5f0ed9f1766540e2780ec740eac2a", "score": "0.46167663", "text": "async function createRecipeModal(recipeData) {\n // Build the recipe header.\n let header = `\n <div class=\"recipe-details-img\">\n <img src=\".${\n recipeData.images\n ? recipeData.images.small\n : '/img/blanktable.png'\n }\" alt=\"\" />\n </div>\n <div class=\"recipe-header\">\n <h2 class=\"recipe-title\">${recipeData.title}</h2>\n <cite class=\"recipe-description\">${recipeData.description}</cite>\n <i id=\"recipe-header-edit\" class=\"edit-header-icon fas fa-pencil-alt\"></i>\n </div>\n `;\n\n // Build list of directions.\n let directions = '';\n\n if (recipeData.directions.length > 0) {\n recipeData.directions.forEach((d) => {\n directions += `<li class='item recipe-direction-item'>`;\n directions += `<span class='direction-optional'>${\n d.optional ? '(OPTIONAL):' : ''\n }</span> `;\n directions += `<span class='direction-instructions'>${d.instructions}</span>`;\n directions += `<i id=\"recipe-direction-${d.uuid}\" class=\"edit-icon edit-direction-icon fas fa-pencil-alt\"></i>`;\n directions += `</li>`;\n });\n }\n\n // Build each content page.\n let html = `\n <div>\n ${header}\n </div>\n <div class=\"tab recipe-content\">\n <button\n id=\"tab-ingredients\"\n class=\"btn tablinks\"\n onclick=\"openTab(event,'Ingredients')\"\n >\n Ingredients\n </button>\n <button\n id=\"tab-directions\"\n class=\"btn tablinks\"\n onclick=\"openTab(event,'Directions')\"\n >\n Directions\n </button>\n <div id=\"Ingredients\" class=\"recipe-ingredients tabcontent\">\n <h3>Ingredients:\n <i id='add-ingredient-icon' class='add-icon fas fa-plus'></i>\n </h3>\n <ul>\n </ul>\n </div>\n <div id=\"Directions\" class=\"recipe-directions tabcontent\">\n <h3>Directions:\n <i id='add-direction-icon' class='add-icon fas fa-plus'></i>\n </h3>\n <ul>\n ${directions}\n </ul>\n </div>\n </div>\n `;\n\n recipeDetailsContent.innerHTML = html;\n recipeDetailsContent.parentElement.classList.add('showRecipe');\n\n // Build list of ingredients.\n // Has to be async because each one needs to fetch its own specials.\n let ingredients = '';\n let specials = '';\n let specialFetches = [];\n\n recipeData.ingredients.forEach((i) => {\n // Check for specials.\n specialFetches.push(\n fetch(`http://localhost:3001/specials?ingredientId=${i.uuid}`)\n .then((response) => response.json())\n .then((specialData) => {\n specials = '';\n\n specialData.forEach(async (s) => {\n specials += `<li class='item recipe-special-item' data-id=\"${s.uuid}\">`;\n specials += `<span class='special-type'>${\n s.type.charAt(0).toUpperCase() + s.type.slice(1)\n }</span>: `;\n specials += `<span class='special-title'>${s.title}</span>! `;\n specials += `<span class='special-text'>${s.text}</span>`;\n specials += `<i id=\"recipe-special-${s.uuid}\" class=\"edit-icon edit-special-icon fas fa-pencil-alt\"></i>`;\n specials += `</li>`;\n });\n\n ingredients += `<li class='item recipe-ingredient-item' data-id=\"${i.uuid}\">`;\n ingredients += `<span class='ingredient-amount'>${i.amount} </span>`;\n ingredients += `<span class='ingredient-measurement'>${i.measurement} </span>`;\n ingredients += `<span class='ingredient-name'>${i.name}</span>`;\n ingredients += `<i id=\"recipe-ingredient-${i.uuid}\" class=\"edit-icon edit-ingredient-icon fas fa-pencil-alt\"></i>`;\n ingredients += `</li>`;\n\n if (specials) {\n ingredients += '<ul>' + specials + '</ul>';\n }\n })\n .catch((err) => {\n console.log(err);\n })\n );\n });\n\n // Once all of the specials have been fetched, add the ingredients to the list.\n Promise.all(specialFetches).then(() => {\n // Add the ingredients and any specials to the modal.\n $('.recipe-ingredients ul').append(ingredients);\n });\n\n // Open the Ingredients tab by default.\n document.getElementById('tab-ingredients').click();\n\n $('.recipe-details').attr('data-id', recipeData.uuid);\n\n // Add some JQuery onclick events to each of the various icons.\n $('#add-ingredient-icon').on('click', addIngredient);\n $('#add-direction-icon').on('click', addDirection);\n $('.edit-header-icon').on('click', editRecipeHeader);\n $('.edit-ingredient-icon').on('click', editRecipeIngredient);\n $('.edit-special-icon').on('click', editIngredientSpecial);\n $('.edit-direction-icon').on('click', editRecipeDirection);\n}", "title": "" }, { "docid": "6c525ecb4235249e19aa098eb8bcb0db", "score": "0.46146366", "text": "function puxHandleLoad(e) {\n\t\tvar usableContent;\n\n\t\t// Get the link element by the id\n\t\tvar link = e.target;\n\n\t\t// Get the class of the element\n\t\tif (link.hasAttribute(\"data-layout\") == true) {\n\t\t\tvar layoutData = link.getAttribute(\"data-layout\");\n\t\t}\n\n\t\t// If we have a layout attribute declared...\n\t\tif (layoutData) {\n\t\t\t// Create a new wrapper for the layout css\n\t\t\tvar layoutWrapper = document.createElement('div');\n\n\t\t\t// Add the element's layout class to the new element\n\t\t\tlayoutWrapper.setAttribute('class', layoutData);\n\n\t\t\t// Import the actual content\n\t\t\tusableContent = puxImportHtml(link);\n\n\t\t\t// Repace the link element with the layout wrapper\n\t\t\tlink.parentNode.replaceChild(layoutWrapper, link);\n\n\t\t\t// Add content of the link to the layoutwrapper\n\t\t\tlayoutWrapper.appendChild(usableContent);\n\t\t}\n\t\telse {\n\t\t\t// Import the actual content\n\t\t\tusableContent = puxImportHtml(link);\n\n\t\t\t//Repace the link element with the layout wrapper\n\t\t\tlink.parentNode.replaceChild(usableContent, link);\n\t\t}\n\t}", "title": "" } ]
c29e50924c4c249b32260afe42254bc1
2 call is a method to call a func inside a func another example
[ { "docid": "5405ab9f4242f20b8ceac2792034d739", "score": "0.0", "text": "function foo2() {\n console.log(this.a);\n}", "title": "" } ]
[ { "docid": "dc0c85eb85d6f3f2edf9a4296cbe4d62", "score": "0.64138436", "text": "function callTwice(func) {\n func();\n func();\n}", "title": "" }, { "docid": "918087b28149ce0feac302c1a3bde842", "score": "0.6399348", "text": "function second() {\r\n return third();\r\n }", "title": "" }, { "docid": "629b8130c0d70e661b0f166eae763734", "score": "0.6387928", "text": "function callFunction(func){\n func();\n}", "title": "" }, { "docid": "fa90ccc82101f78bafdd0afe6e5769f5", "score": "0.63779354", "text": "function calling(fun){\n fun();\n}", "title": "" }, { "docid": "24d407329b580fbe66f3c1ee07c40da0", "score": "0.6366312", "text": "function run(func1){\n func1()\n}", "title": "" }, { "docid": "2421e765af1cc82947a2776b6dd23f5c", "score": "0.6339236", "text": "function myFunc(b){\r\n console.log('this is confusing')\r\n b()\r\n}", "title": "" }, { "docid": "69ebe7ce7b61b2e8b74e3ed5a6fa6b1d", "score": "0.6325195", "text": "function call() { //Modified this from function expression to function declaration.\r\n console.log(\"I am calling\");\r\n}", "title": "" }, { "docid": "999019811d5dfabb83c3c110771eb42a", "score": "0.631757", "text": "function callIt(func) {\n func();\n}", "title": "" }, { "docid": "3e9beb6a5922de22fcdcc6c49d651d3d", "score": "0.63157785", "text": "function callWith2Arguments(arg1,arg2,func){\n return console.log(func(arg1,arg2))\n}", "title": "" }, { "docid": "400d394d45fccd7aea6b79fecef3fc89", "score": "0.62973803", "text": "function callWith2Arg(arg1, arg2, func) {\n return func(arg1,arg2)\n}", "title": "" }, { "docid": "9990bd563328e790efc7dafc0e08922f", "score": "0.6258106", "text": "function justInvoke(fn){\n return fn()\n}//justInvoke", "title": "" }, { "docid": "910a95346cae11c623a265764625e3ad", "score": "0.622909", "text": "function call(func, self) { func.call(self); }", "title": "" }, { "docid": "ec18402f7c3295c3923aabc302f02321", "score": "0.6217227", "text": "function callFoo(fn){\n fn();\n}", "title": "" }, { "docid": "c6a470459d65f76a4989a10e9de1671f", "score": "0.62016773", "text": "function firstFunc(funcParam){\n funcParam();\n}", "title": "" }, { "docid": "5ecbde7156816064ddc47b1bb9eaf738", "score": "0.61985487", "text": "function c(func) {\n\tfunc();\n}", "title": "" }, { "docid": "1b71597013f2bee697c423e84414ec65", "score": "0.6185134", "text": "function abc (a, b, bla ){\n return bla(a,b)\n }", "title": "" }, { "docid": "f6de51e5b7831e517f5a22f687e3f71d", "score": "0.61720556", "text": "function run (fun1) {\n fun1()\n}", "title": "" }, { "docid": "c205ba5863e0c116f5937747fb894d19", "score": "0.6147205", "text": "function a(fn) { fn()}", "title": "" }, { "docid": "c58e76e297fba01bf2dd273e23cfe778", "score": "0.613242", "text": "function callFunction(fun) {\r\n fun()\r\n}", "title": "" }, { "docid": "6c54033b8c8ef4d2956fecee408b4905", "score": "0.61285895", "text": "function z(){// can be called as an API method\nD(),F()}", "title": "" }, { "docid": "e517353c8371405fb02190aa3d896c38", "score": "0.6100023", "text": "function callFunction(fun){\n fun();\n}", "title": "" }, { "docid": "bf8cd1d05e6670554f51c590a92968b8", "score": "0.6095552", "text": "function show(str1,str2){\r\n console.log(str1);\r\n function innerFn(){\r\n console.log(str2);\r\n }\r\n innerFn();\r\n}", "title": "" }, { "docid": "845cf0aee96fabc004e0e6277e2c6961", "score": "0.6087592", "text": "function callFunction (fun){\n fun();\n}", "title": "" }, { "docid": "0470159d7341a9a54a1bdbfb68bbbf0e", "score": "0.60593563", "text": "function outerCall(callingFunction){\n callingFunction();\n //callingFunction.call(this); // if we bind an context using bind function so rebinding not able to possible\n}", "title": "" }, { "docid": "bfdfdb42fd2c6c583d6e7f9c267987e2", "score": "0.60475", "text": "function a(fn) {\n fn()\n}", "title": "" }, { "docid": "b80be9af32e2445ca6de2b58e41f7c95", "score": "0.601484", "text": "function iniFungsi(func) {\n func();\n func();\n\n return function () {\n console.log(\"Done!\");\n };\n}", "title": "" }, { "docid": "dbe0513c4a7790e3ef989ff7973ff6ef", "score": "0.6011001", "text": "function GiveSalaryToEmployeeIn2Calls(employeeName){\n return function(salaryAmount){\n // IMPORTANT - notice that the employeeName from the outer function is used here .. \n // the outer function is almost like an object where it stores the data passed to it \n // at some point of time.. \n Console.log(\"paying \" + salaryAmount + \" to \" + employeeName)\n }\n }", "title": "" }, { "docid": "4535db48e746024f461530c9f192cf40", "score": "0.60017234", "text": "handelSub() {\n console.log(\"im a normal function\");\n }", "title": "" }, { "docid": "86fd6b16a3d554716d232d3dbba12fbd", "score": "0.599549", "text": "function someRunner(anyFunction){ \n \tconsole.log(2+2); \n \tanyFunction(); \n }", "title": "" }, { "docid": "86e4a0194169cd1ada7e47fd9bc05360", "score": "0.5992119", "text": "function run(fun){\n fun()\n}", "title": "" }, { "docid": "86e4a0194169cd1ada7e47fd9bc05360", "score": "0.5992119", "text": "function run(fun){\n fun()\n}", "title": "" }, { "docid": "86e4a0194169cd1ada7e47fd9bc05360", "score": "0.5992119", "text": "function run(fun){\n fun()\n}", "title": "" }, { "docid": "1ad719eee5053d09e82897342d05d308", "score": "0.5968414", "text": "function names(name){\n\n var firstName = \"Syed\"\n \n function inner(program,insitute){\n console.log(\"my name is\"+firstName+name+\"i'm studing in\"+ program+\" from \"+insitute)\n function coding(){\n console.log(\"code is art after few year later i'm father of programming :) \")\n }\n coding()\n }\n \n inner(\"BSCS\",\"NCBA&Ecc\")\n}", "title": "" }, { "docid": "78d735928de9f95fe6eb3de051dd614c", "score": "0.59634787", "text": "function first(func){\n var run = true; \n return function second(){ \n if (run === true) {\n func();\n run = false;\n }\n }\n}", "title": "" }, { "docid": "99120c12e531a9aab20240a7a9ee4a8e", "score": "0.5946285", "text": "function callFunction(fun){\n\tfun();\n}", "title": "" }, { "docid": "10b323043821e233d9dd844482d18a8e", "score": "0.59459853", "text": "function callFunctions(first, second) {\r\n closeOther(first);\r\n toggleCurrent(second);\r\n updateParentHeight(second);\r\n }", "title": "" }, { "docid": "23206452bcbb211ca59f6bd6fc217806", "score": "0.594572", "text": "function fn() {\n\t\t }", "title": "" }, { "docid": "a2af42eca2db1d46fb75a0766b4f2c11", "score": "0.5927447", "text": "function another(cb) {\n cb();\n}", "title": "" }, { "docid": "0655a24c5894e62e8ef80f411a63dfb9", "score": "0.5927026", "text": "function otherFunct(){\n console.log(\"we are in another funct\");\n console.log(\"do stuff\");\n}", "title": "" }, { "docid": "37991d1dc45d53b7b5f42ef62e71e9fb", "score": "0.59268254", "text": "function doSth(fn) {\n fn(1);\n}", "title": "" }, { "docid": "087ebe9efd6e8110d552c18f9500d817", "score": "0.59266645", "text": "function run (fun) {\n fun() \n}", "title": "" }, { "docid": "127b774c7d5f6e75b387faf013b96d77", "score": "0.5921705", "text": "function Callable(wat) {\nreturn wat;\n}", "title": "" }, { "docid": "df4a9717221c3a075eb9204dd6d02158", "score": "0.59200716", "text": "function callFunction(fun) {\n fun();\n}", "title": "" }, { "docid": "f3279c1149d8d9e09f952d8f4a9c34ca", "score": "0.5902929", "text": "function outermethod(arg){\n console.log(\"123\",arg);\n}", "title": "" }, { "docid": "5f8a3c661e99340e4ac577822e3eb55e", "score": "0.5901596", "text": "function first(two, N) {\n return function() {\n if (N > 1) {\n console.log('STAHHP');\n }\n else {\n N++;\n return two();\n }\n }\n}", "title": "" }, { "docid": "3ed9cbe8177c00db758fd8dfda6ce460", "score": "0.5899638", "text": "function call3Times(fun) {\n fun();\n fun();\n fun();\n }", "title": "" }, { "docid": "3c3dc3fe9c6f94abbaef70d346af1c23", "score": "0.58918273", "text": "function innerFunction() {\n console.log('Regular function inside method:', this);\n }", "title": "" }, { "docid": "cd3629ffe65512b5c7d63dcdb853031a", "score": "0.58817184", "text": "function x(y){ // function x has the hole control of function \"y\"\n console.log(\"Functon x\");\n y();\n}", "title": "" }, { "docid": "24f2453e25866b8c6160f7317764d2e8", "score": "0.58580047", "text": "function fun() { }", "title": "" }, { "docid": "11653e977237fa56e9179691978b4b9c", "score": "0.58553934", "text": "function question4() {\n question2('functions in functions');\n}", "title": "" }, { "docid": "a65cf2b64ae68af03e923895d94e6bf6", "score": "0.5847645", "text": "function a() \n{\n b(function fun(x){\n console.log(x)\n }); /** passing a parameter as function */\n}", "title": "" }, { "docid": "da701c2d4a6c6ea0fdbe32e04e1a381a", "score": "0.5841051", "text": "function run(fun) {\n fun()\n}", "title": "" }, { "docid": "da701c2d4a6c6ea0fdbe32e04e1a381a", "score": "0.5841051", "text": "function run(fun) {\n fun()\n}", "title": "" }, { "docid": "da701c2d4a6c6ea0fdbe32e04e1a381a", "score": "0.5841051", "text": "function run(fun) {\n fun()\n}", "title": "" }, { "docid": "ab4bd7a4f8550e0cf9cb7b52b4e63350", "score": "0.5839562", "text": "function b(){f.call(this)}", "title": "" }, { "docid": "f6c145a5a255e7dcf329ffbd8188b03b", "score": "0.58253783", "text": "function first(){\n console.log(\"I'm the first to be called\")\n second();\n}", "title": "" }, { "docid": "62110ce538f7e49ba20427ed5ab97ed2", "score": "0.58251196", "text": "function repeatThreeTimes(func) {\n func(); // cannot do func.call(john) b/c its out of scope\n func();\n func();\n}", "title": "" }, { "docid": "86358b0b1d74ffa592664b6428621b0d", "score": "0.5809433", "text": "function greet(otherFunc){\n console.log(otherFunc())\n}", "title": "" }, { "docid": "9f044513a97d7bd748e6a23adde5af0d", "score": "0.5809212", "text": "function add() { //add is returning function . that fuction is invoke\n return function() { \n console.log('returned function called')\n \n }\n\n}", "title": "" }, { "docid": "ea06df36eeeee7c542f86533f35bb7e2", "score": "0.5805929", "text": "function foo(func) {\r\n // What to do here? \r\n bar(func);\r\n }", "title": "" }, { "docid": "f94c78acaa98bc18cae54ebcf9b37a6e", "score": "0.579232", "text": "function called () {\r\n alert(\"First Ive been called\");\r\n \r\n return function() {\r\n alert(\"Im next on line\");\r\n };\r\n }", "title": "" }, { "docid": "5edec19d74d57d077648587d9489e874", "score": "0.57870024", "text": "function Dispatch3(a, b) { a(); b(); }", "title": "" }, { "docid": "f30cd8605a51dab34d38429552bccafd", "score": "0.57768077", "text": "function logGreeting(fn){\n console.log(\"This one is from a function passed into another function:\");\n fn();\n}", "title": "" }, { "docid": "db290b94912e1f4e6ae846f5d949e1d5", "score": "0.57604057", "text": "function helloWorld(fn) {\n fn();\n}", "title": "" }, { "docid": "50b23d2280b7e1f397f663ec3015a5fd", "score": "0.57566726", "text": "function funcName() {\n\tconsole.log(\"funcName 1 called\")\n}", "title": "" }, { "docid": "c7d2160db4c610aec8da93baf9dfd960", "score": "0.5751055", "text": "function fn(param) {\n // param();\n // console.log(\"current param is \", param());\n fn.invokCount++;\n}", "title": "" }, { "docid": "7454d24e3c76e1c42c500d8cf618010d", "score": "0.5749107", "text": "function foo(){\n foo();\n}", "title": "" }, { "docid": "d6880f2a1a2b2e06915b364416c04aa9", "score": "0.57428336", "text": "function withinAfunct(func, a) {\n\tconsole.log(a * 10);\n}", "title": "" }, { "docid": "2915cb16f55d21e8f2f3d5c166152192", "score": "0.5737232", "text": "function sayHi(param) {\n console.log(\"hi \", param);\n param();\n}", "title": "" }, { "docid": "3fe5ddf2f8acda4ec0d96021594f0652", "score": "0.5734011", "text": "function two() {\n return function () {\n console.log('two');\n }\n}", "title": "" }, { "docid": "89f29c6bf0095d1957497458813791f7", "score": "0.57319814", "text": "function foo3(f) { f(1, 2); }", "title": "" }, { "docid": "b3c8af4312c7365fc88e2faf8d6c4666", "score": "0.572805", "text": "function arrowFn() {\n alert(\"hello from the return of the second sayHi\");\n\n }", "title": "" }, { "docid": "a7012e8f6bc2cbfb027338d05b80e647", "score": "0.57220745", "text": "function y(){f.call(this)}", "title": "" }, { "docid": "a7012e8f6bc2cbfb027338d05b80e647", "score": "0.57220745", "text": "function y(){f.call(this)}", "title": "" }, { "docid": "a7012e8f6bc2cbfb027338d05b80e647", "score": "0.57220745", "text": "function y(){f.call(this)}", "title": "" }, { "docid": "7f64cc4c3767f8bd131d868412f08a2e", "score": "0.57055545", "text": "function callOnMe() { return 'called' }", "title": "" }, { "docid": "3b4c39ae749f663ea7b9e867985b3f06", "score": "0.56981283", "text": "function innerFunc(){\n console.log(\"Number 1:\" + number1);\n console.log(\"Number 2:\" + number2);\n console.log(\"Param is: \" + param);\n }", "title": "" }, { "docid": "9bd1f19add24a50389313dd6cf81081b", "score": "0.5695612", "text": "function outer() {\n // Step 1.3: Log arguments\n\n function inner() {\n // Step 1.4: Log arguments\n };\n\n // Step 1.2: Call inner with some other arguments\n}", "title": "" }, { "docid": "886e498bc3419ee74f21cfcc6f4d478e", "score": "0.5688426", "text": "function b() { return function c(){ console.log('c') }}", "title": "" }, { "docid": "4d35338dbe6534da79d51808a30815b9", "score": "0.56817555", "text": "step_func(func) { func(); }", "title": "" }, { "docid": "30d6ea6e94d50efbe4ad3e43677369c4", "score": "0.5678787", "text": "function three () {}", "title": "" }, { "docid": "0e70789cb3456f896e28f233cb1b42fe", "score": "0.5673804", "text": "function fun1(){}", "title": "" }, { "docid": "0e70789cb3456f896e28f233cb1b42fe", "score": "0.5673804", "text": "function fun1(){}", "title": "" }, { "docid": "73bbe87315ea8821865f9f6ed2fd9d75", "score": "0.5671414", "text": "function func(){\r\n\r\n}", "title": "" }, { "docid": "52a129db838491d2a3a7d239c826f4e2", "score": "0.56697917", "text": "function third() {}", "title": "" }, { "docid": "36452c4f2cf16681fa4284d05fe90a66", "score": "0.56676096", "text": "function fun1 ( ) {}", "title": "" }, { "docid": "45214c4df25a6a4e50afbcfeeeb765c3", "score": "0.56670225", "text": "function greetFn1(name) {\n console.log(name+ \" iam from greetfn 1 function \");\n}", "title": "" }, { "docid": "5412cbec186d84761f7c0bb74ddbad34", "score": "0.56668067", "text": "function __func(){}", "title": "" }, { "docid": "53cb5b11086809c484e61c5692161780", "score": "0.5661527", "text": "function Func_s() {\n}", "title": "" }, { "docid": "790f0b7b106f9634a53b4bf3b32b2d7d", "score": "0.56535226", "text": "function outerFunction( param){\n \tfunction innerFunction(input){\n \t\treturn input * 2;\n \t};\n\n \treturn ' The result is '+ innerFunction(param);\n}", "title": "" }, { "docid": "0c385a65def3642eb5b0219a71f81271", "score": "0.5650139", "text": "function foo (){\n foo()\n}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.5649396", "text": "function miFuncion(){}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.5649396", "text": "function miFuncion(){}", "title": "" }, { "docid": "07baaa7b10a2faddf5ad2c1b651b13e9", "score": "0.5649396", "text": "function miFuncion(){}", "title": "" }, { "docid": "9d5fddbdbaa7c603da8903a14a439b32", "score": "0.56481266", "text": "function test2 (a) {\n test1 (0, 1);\n}", "title": "" }, { "docid": "303af55221558595a7f975755c32d5f7", "score": "0.56412506", "text": "function main() {\n\t// call problem # 1\n\tconst moustache = \"Moustache\";\n\tconsole.log(\"Calling hello(\" + moustache + \")\");\n\thello(moustache);\n\n\t// call problem # 2\n\t// (a) - with a name passed in\n\tconsole.log(\"\\nCalling hello2(\" + moustache + \")\");\n\thello2(moustache);\n\t// (b) - without a name passed in\n\tconsole.log(\"\\nCalling hello2()\");\n\thello2();\n\n\t// call problem # 3\n\tconst name2 = \"Anushka\";\n\tconst subject = \"art\";\n\tconsole.log(\"\\nCalling madlib(\" + name2 + \", \" + subject + \")\");\n\tconsole.log(madlib(name2, subject));\n\n\t// call problem # 4\n\t// (a) - service level is good\n\tconst service1 = \"good\";\n\tconst amount1 = 100;\n\tconsole.log(\"\\nCalling tipAmount(\" + amount1 + \", \" + service1 + \")\");\n\tconsole.log(tipAmount(amount1, service1));\n\t// (b) - service level is fair\n\tconst service2 = \"fair\";\n\tconst amount2 = 40;\n\tconsole.log(\"\\nCalling tipAmount(\" + amount2 + \", \" + service2 + \")\");\n\tconsole.log(tipAmount(amount2, service2));\n\t// (c) - service level is bad\n\tconst service3 = \"bad\";\n\tconst amount3 = 20;\n\tconsole.log(\"\\nCalling tipAmount(\" + amount3 + \", \" + service3 + \")\");\n\tconsole.log(tipAmount(amount3, service3));\n\n\t// call problem # 5\n\t// (a) - service level is good\n\tconst service11 = \"good\";\n\tconst amount11 = 200;\n\tconsole.log(\"\\nCalling totalAmount(\" + amount11 + \", \" + service11 + \")\");\n\tconsole.log(totalAmount(amount11, service11));\n\t// (b) - service level is fair\n\tconst service22 = \"fair\";\n\tconst amount22 = 80;\n\tconsole.log(\"\\nCalling totalAmount(\" + amount22 + \", \" + service22 + \")\");\n\tconsole.log(totalAmount(amount22, service22));\n\t// (c) - service level is bad\n\tconst service33 = \"bad\";\n\tconst amount33 = 40;\n\tconsole.log(\"\\nCalling totalAmount(\" + amount33 + \", \" + service33 + \")\");\n\tconsole.log(totalAmount(amount33, service33));\n\n\t// call problem # 6\n\t// (a) - service level is good\n\tconst service111 = \"good\";\n\tconst amount111 = 400;\n\tconst numberOfPersons1 = 5;\n\tconsole.log(\"\\nCalling splitAmount(\" + amount111 + \", \" + service111 + \", \" + numberOfPersons1 + \")\");\n\tconsole.log(splitAmount(amount111, service111, numberOfPersons1));\n\t// (b) - service level is fair\n\tconst service222 = \"fair\";\n\tconst amount222 = 160;\n\tconst numberOfPersons2 = 10;\n\tconsole.log(\"\\nCalling splitAmount(\" + amount222 + \", \" + service222 + \", \" + numberOfPersons2 + \")\");\n\tconsole.log(splitAmount(amount222, service222, numberOfPersons2));\n\t// (c) - service level is bad\n\tconst service333 = \"bad\";\n\tconst amount333 = 80;\n\tconst numberOfPersons3 = 20;\n\tconsole.log(\"\\nCalling splitAmount(\" + amount333 + \", \" + service333 + \", \" + numberOfPersons3 + \")\");\n\tconsole.log(splitAmount(amount333, service333, numberOfPersons3));\n}", "title": "" }, { "docid": "cde1d9dc09e1010ddbd3e67bcd4505a7", "score": "0.56409067", "text": "function firstFunction() //abhi argument zero hai \n{//function body open\n\n //here we write a task\n console.log(\"Hello , \");\n console.log(\"How are you?\");\n console.log(\"What are you doing\");\n\n}", "title": "" }, { "docid": "316eb1d69ef9065ecd6756092ab0af17", "score": "0.56399226", "text": "function myOtherrunFunctions(b,c){\r\n console.log(\"I'm another function that will run two other functions.\");\r\n b();\r\n c(); \r\n}", "title": "" }, { "docid": "d7adb96610e058ed177baebe9c1696ae", "score": "0.5638879", "text": "function log(a) {\n a();\n}", "title": "" }, { "docid": "557e154dad1e113ae862325b8394f757", "score": "0.5632642", "text": "function log(a) {\n a();\n}", "title": "" }, { "docid": "53ca98d006439e95e4881926c36ea359", "score": "0.5631591", "text": "function main(param1,param2,callBack){ \n console.log(param1, param2) \n callBack() \n }", "title": "" } ]
f8b53fdeb341941385bf0d2be946b75b
rd_Precompose_buildUI() Description: This function builds the user interface. Parameters: thisObj Panel object (if script is launched from Window menu); null otherwise. Returns: Window or Panel object representing the built user interface.
[ { "docid": "08ae7f75e3f4a796099e4cb52b5fa97b", "score": "0.7511603", "text": "function rd_Precompose_buildUI(thisObj)\r\n {\r\n var pal = new Window(\"dialog\", rd_PrecomposeData.scriptName, undefined);\r\n if (pal !== null)\r\n {\r\n var res = \r\n \"group { \\\r\n orientation:'column', alignment:['fill','fill'], alignChildren:['fill','top'], \\\r\n compName: Group { \\\r\n alignment:['center','top'], \\\r\n lbl: StaticText { text:'\" + rd_Precompose_localize(rd_PrecomposeData.strNewCompName) + \"' }, \\\r\n fld: EditText { text:'', characters:31, preferredSize:[-1,20] }, \\\r\n }, \\\r\n leaveOpt: RadioButton { text:'\" + rd_Precompose_localize(rd_PrecomposeData.strLeaveOpt) + \"', alignment:['fill','top'], value:true, helpTip:'\" + rd_Precompose_localize(rd_PrecomposeData.strLeaveOptDesc) + \"' }, \\\r\n moveOpt: RadioButton { text:'\" + rd_Precompose_localize(rd_PrecomposeData.strMoveOpt) + \"', alignment:['fill','top'], helpTip:'\" + rd_Precompose_localize(rd_PrecomposeData.strMoveOptDesc) + \"' }, \\\r\n opts: Group { \\\r\n orientation:'column', alignment:['fill','top'], \\\r\n batchMode: Checkbox { text:'\" + rd_Precompose_localize(rd_PrecomposeData.strBatchMode) + \"', alignment:['fill','top'] }, \\\r\n batchModeLayerNames: Checkbox { text:'\" + rd_Precompose_localize(rd_PrecomposeData.strBatchModeLayerName) + \"', alignment:['fill','top'] }, \\\r\n trimLayers: Checkbox { text:'\" + rd_Precompose_localize(rd_PrecomposeData.strTrimLayers) + \"', alignment:['fill','top'] }, \\\r\n handles: Group { \\\r\n orientation:'row', alignment:['left','fill'], alignChildren:['left','center'], \\\r\n headLbl: StaticText { text:'\" + rd_Precompose_localize(rd_PrecomposeData.strHeadHandle) + \"', enabled:false }, \\\r\n headVal: EditText { text:'0', characters:4, enabled:false, preferredSize:[-1,20] }, \\\r\n headUOM: StaticText { text:'\" + rd_Precompose_localize(rd_PrecomposeData.strHandleUOM) + \"', enabled:false }, \\\r\n spacer: StaticText { text:' ', alignment:['fill','center'], enabled:false }, \\\r\n tailLbl: StaticText { text:'\" + rd_Precompose_localize(rd_PrecomposeData.strTailHandle) + \"', enabled:false }, \\\r\n tailVal: EditText { text:'0', characters:4, enabled:false, preferredSize:[-1,20] }, \\\r\n tailUOM: StaticText { text:'\" + rd_Precompose_localize(rd_PrecomposeData.strHandleUOM) + \"', enabled:false }, \\\r\n }, \\\r\n }, \\\r\n cmds: Group { \\\r\n alignment:['fill','top'], \\\r\n helpBtn: Button { text:'\" + rd_Precompose_localize(rd_PrecomposeData.strHelp) + \"', alignment:['left','top'], preferredSize:[-1,20] }, \\\r\n okBtn: Button { text:'\" + rd_Precompose_localize(rd_PrecomposeData.strOK) + \"', alignment:['right','top'], preferredSize:[-1,20] }, \\\r\n cancelBtn: Button { text:'\" + rd_Precompose_localize(rd_PrecomposeData.strCancel) + \"', alignment:['right','top'], preferredSize:[-1,20] }, \\\r\n }, \\\r\n }\";\r\n \r\n pal.grp = pal.add(res);\r\n \r\n pal.grp.opts.margins.top = pal.grp.cmds.margins.top = 10;\r\n pal.grp.opts.handles.indent = 20;\r\n \r\n pal.grp.compName.fld.onChanging = function ()\r\n {\r\n if (this.text.length > 31)\r\n this.text = this.text.substr(0, 31);\r\n }\r\n pal.grp.opts.batchMode.onClick = function ()\r\n {\r\n var enableState = this.value;\r\n \r\n this.parent.batchModeLayerNames.enabled = enableState;\r\n }\r\n pal.grp.opts.batchModeLayerNames.onClick = function ()\r\n {\r\n var enableState = this.value;\r\n \r\n this.parent.parent.compName.lbl.enabled = this.parent.parent.compName.fld.enabled = !enableState;\r\n }\r\n pal.grp.opts.trimLayers.onClick = function ()\r\n {\r\n var enableState = this.value;\r\n \r\n //this.parent.handles.enabled = enableState;\t// doesn't work in AE CS6\r\n this.parent.handles.headLbl.enabled = enableState;\r\n this.parent.handles.headVal.enabled = enableState;\r\n this.parent.handles.headUOM.enabled = enableState;\r\n this.parent.handles.spacer.enabled = enableState;\r\n this.parent.handles.tailLbl.enabled = enableState;\r\n this.parent.handles.tailVal.enabled = enableState;\r\n this.parent.handles.tailUOM.enabled = enableState;\r\n }\r\n pal.grp.opts.handles.headVal.onChange = pal.grp.opts.handles.tailVal.onChange = function ()\r\n {\r\n var value = parseFloat(this.text);\r\n if (isNaN(value) || (value < 0.0))\r\n value = 0;\r\n else if (value > 9999)\r\n value = 9999;\r\n this.text = value.toString();\r\n }\r\n pal.grp.cmds.helpBtn.preferredSize.width = 25;\r\n pal.grp.cmds.helpBtn.onClick = function () {alert(rd_PrecomposeData.scriptTitle + \"\\n\" + rd_Precompose_localize(rd_PrecomposeData.strHelpText), rd_PrecomposeData.scriptName);}\r\n pal.grp.cmds.okBtn.onClick = rd_Precompose_precomp;\r\n \r\n var comp = app.project.activeItem;\r\n pal.grp.leaveOpt.text = rd_Precompose_localize(rd_PrecomposeData.strLeaveOpt).replace(\"\\\\'%s\\\\'\", \"'\"+comp.name+\"'\");\r\n pal.grp.leaveOpt.helpTip = rd_Precompose_localize(rd_PrecomposeData.strLeaveOptDesc).replace(\"\\\\'%s\\\\'\", \"'\"+comp.selectedLayers[0].name+\"'\");\r\n if (comp.selectedLayers.length === 1)\r\n {\r\n // The \"Leave all attributes\" option is available only if the selected layer has source\r\n if (comp.selectedLayers[0].source === null)\r\n {\r\n pal.grp.moveOpt.value = true;\r\n pal.grp.moveOpt.helpTip = rd_Precompose_localize(rd_PrecomposeData.strMoveOptDescNoSrc);\r\n pal.grp.leaveOpt.enabled = false;\r\n }\r\n pal.grp.compName.fld.text = comp.selectedLayers[0].name.substr(0, 31-(\" Comp 1\".length)) + \" Comp 1\";\r\n \r\n // No batch mode for a single selected layer\r\n pal.grp.opts.batchMode.enabled = pal.grp.opts.batchMode.value = pal.grp.opts.batchModeLayerNames.enabled = pal.grp.opts.batchModeLayerNames.value = false;\r\n }\r\n else\r\n {\r\n pal.grp.compName.fld.text = \"Pre-comp 1\";\r\n pal.grp.moveOpt.value = true;\r\n pal.grp.moveOpt.helpTip = rd_Precompose_localize(rd_PrecomposeData.strMoveOptDescMulti);\r\n pal.grp.leaveOpt.text = rd_Precompose_localize(rd_PrecomposeData.strLeaveOpt2);\r\n pal.grp.leaveOpt.enabled = false;\r\n \r\n // Batch mode is available for multiple selected layer, but off by default\r\n pal.grp.opts.batchMode.enabled = true;\r\n pal.grp.opts.batchMode.value = pal.grp.opts.batchModeLayerNames.value = false;\r\n pal.grp.opts.batchModeLayerNames.enabled = false;\r\n }\r\n \r\n pal.layout.layout(true);\r\n }\r\n \r\n return pal;\r\n }", "title": "" } ]
[ { "docid": "ff9dad66de28e71e81e963258e4ab199", "score": "0.7412733", "text": "function buildUI(thisObj) {\n var win =\n thisObj instanceof Panel\n ? thisObj\n : new Window(\"palette\", \"example\", [0, 0, 150, 260], {\n resizeable: true\n });\n\n if (win != null) {\n var H = 25; // the height\n var W1 = 30; // the width\n var W2 = 50; // the width\n var G = 5; // the gutter\n var x = G;\n var y = G;\n // ------------ THE OM SETTINGS ------------\n win.refresh_templates_button = win.add(\n \"button\",\n [x, y, x + W2 * 3 - G / 2, y + H],\n \"Refresh OM Templates ⟲\"\n );\n win.help_button = win.add(\n \"button\",\n [x + W2 * 3 + G / 2, y, x + W2 * 5, y + H],\n \"⚙/?\"\n );\n\n y += H + G;\n win.om_templates_ddl = win.add(\n \"dropdownlist\",\n [x, y, x + W1 * 5, y + H],\n SOM_meta.outputTemplates\n );\n win.om_templates_ddl.selection = 0;\n y += H + G;\n win.set_templates_button = win.add(\n \"button\",\n [x, y, x + W1 * 5, y + H],\n \"Set Output Template\"\n );\n y += H + G;\n // win.help_button.graphics.font = \"dialog:17\";\n y += H + G * 2;\n\n // ------------ NOW THE PATH SETTING ------------\n win.setpath_button = win.add(\n \"button\",\n [x, y, x + W2 * 5, y + H],\n \"Set Output Path\"\n );\n y += H + G;\n win.add_to_name_dropdl = win.add(\n \"dropdownlist\",\n [x, y, x + W2 * 5, y + H],\n SOP_meta.ddlStrings\n );\n win.add_to_name_dropdl.selection = 1;\n y += H + G;\n win.outname_etxt = win.add(\n \"edittext\",\n [x, y, x + W2 * 5, y + H * 4],\n SOP_meta.outname,\n { multiline: true }\n );\n /**\n * This reads in all outputtemplates from the renderqueue\n *\n * @return {nothing}\n */\n win.refresh_templates_button.onClick = function() {\n get_templates();\n // now we set the dropdownlist\n win.om_templates_ddl.removeAll(); // remove the content of the ddl\n for (var i = 0; i < SOM_meta.outputTemplates.length; i++) {\n win.om_templates_ddl.add(\"item\", SOM_meta.outputTemplates[i]);\n }\n win.om_templates_ddl.selection = 0;\n }; // close refresh_templates_button\n\n win.om_templates_ddl.onChange = function() {\n SOM_meta.selectedTemplate =\n SOM_meta.outputTemplates[this.selection.index];\n };\n win.set_templates_button.onClick = function() {\n set_templates();\n };\n\n win.add_to_name_dropdl.onChange = function() {\n win.outname_etxt.textselection = this.selection.text;\n SOP_meta.outname = win.outname_etxt.text;\n };\n win.outname_etxt.onChange = function() {\n SOP_meta.outname = this.text;\n };\n win.setpath_button.onClick = function() {\n changeRenderLocations();\n }; // end of setpath_button on click\n }\n return win;\n } // close buildUI", "title": "" }, { "docid": "b2a3083336c62e36dcd21ecc2d5feedf", "score": "0.73742896", "text": "function sirokTools_buildUI(thisObj)\r\t\t{\r\t\t\tvar pal = (thisObj instanceof Panel) ? thisObj : new Window(\"palette\", sirokToolsData.scriptName, [200, 200, 600, 500], {resizeable: true});\r\t\t\t\r\t\t\tif (pal != null)\r\t\t\t{\r\t\t\t\tpal.bounds.width = (sirokToolsData.btnSize+5)*10 + 5;\r\t\t\t\tpal.bounds.height = (sirokToolsData.btnSize+5)*1 + 5;\r\t\t\t\tpal.scriptBtns = null;\r\t\t\t\tsirokTools_rebuildButtons(pal);\r\t\t\t\t\r\t\t\t\tpal.onResize = sirokTools_doResizePanel;\r\t\t\t\tpal.onResizing = sirokTools_doResizePanel;\r\t\t\t}\r\r\t\t\treturn pal;\r\t\t}", "title": "" }, { "docid": "f70b3877b33346e6b909f66adad6903a", "score": "0.72197247", "text": "function rd_CompRenamer_buildUI(thisObj)\r\n\t{\r\n\t\tvar pal = (thisObj instanceof Panel) ? thisObj : new Window(\"palette\", rd_CompRenamerData.scriptName, undefined, {resizeable:true});\r\n\t\t\r\n\t\tif (pal !== null)\r\n\t\t{\r\n\t\t\tvar res =\r\n\t\t\t\"group { \\\r\n\t\t\t\torientation:'column', alignment:['fill','top'], \\\r\n\t\t\t\theader: Group { \\\r\n\t\t\t\t\talignment:['fill','top'], \\\r\n\t\t\t\t\ttitle: StaticText { text:'\" + rd_CompRenamerData.scriptName + \"', alignment:['fill','center'] }, \\\r\n\t\t\t\t\thelp: Button { text:'\" + rd_CompRenamer_localize(rd_CompRenamerData.strHelp) +\"', maximumSize:[30,20], alignment:['right','center'] }, \\\r\n\t\t\t\t}, \\\r\n\t\t\t\tselPnl: Panel { \\\r\n\t\t\t\t\ttext: '\" + rd_CompRenamer_localize(rd_CompRenamerData.strSelectPnl) + \"', alignment:['fill','top'], spacing:5, \\\r\n\t\t\t\t\tonlyWC1: Checkbox { text:'\" + rd_CompRenamer_localize(rd_CompRenamerData.strOnlyWithComp1) + \"', alignment:['fill','top'] }, \\\r\n\t\t\t\t\tselectComps: Button { text:'\" + rd_CompRenamer_localize(rd_CompRenamerData.strSelectComps) + \"', alignment:['fill','top'], preferredSize:[-1,20] }, \\\r\n\t\t\t\t}, \\\r\n\t\t\t\tnamePnl: Panel { \\\r\n\t\t\t\t\ttext: '\" + rd_CompRenamer_localize(rd_CompRenamerData.strNamingPnl) + \"', alignment:['fill','top'], spacing:5, \\\r\n\t\t\t\t\tdelSuffix: Checkbox { text:'\" + rd_CompRenamer_localize(rd_CompRenamerData.strRemoveComp1) + \"', alignment:['fill','top'] }, \\\r\n\t\t\t\t\taddSuffix: Group { \\\r\n\t\t\t\t\t\talignment:['fill','top'], margins:[0,0,0,0], \\\r\n\t\t\t\t\t\tlbl: StaticText { text:'\" + rd_CompRenamer_localize(rd_CompRenamerData.strAddSuffix) + \"', alignment:['left','center'] }, \\\r\n\t\t\t\t\t\tfld: EditText { text:'', characters:10, alignment:['fill','center'], preferredSize:[-1,20] }, \\\r\n\t\t\t\t\t}, \\\r\n\t\t\t\t}, \\\r\n\t\t\t\tcmds: Group { \\\r\n\t\t\t\t\talignment:['right','top'] \\\r\n\t\t\t\t\trename: Button { text:'\" + rd_CompRenamer_localize(rd_CompRenamerData.strRename) + \"', preferredSize:[-1,20] }, \\\r\n\t\t\t\t}, \\\r\n\t\t\t} \\\r\n\t\t\t\";\r\n\t\t\tpal.grp = pal.add(res);\r\n\t\t\t\r\n\t\t\tpal.layout.layout(true);\r\n\t\t\tpal.grp.minimumSize = pal.grp.size;\r\n\t\t\tpal.layout.resize();\r\n\t\t\tpal.onResizing = pal.onResize = function () {this.layout.resize();}\r\n\t\t\t\r\n\t\t\tpal.grp.header.help.onClick = function () {alert(rd_CompRenamerData.scriptTitle + \"\\n\" + rd_CompRenamer_localize(rd_CompRenamerData.strHelpText), rd_CompRenamerData.scriptName);}\r\n\t\t\tpal.grp.selPnl.onlyWC1.value = true;\r\n\t\t\tpal.grp.selPnl.selectComps.onClick = rd_CompRenamer_doSelectComps;\r\n\t\t\tpal.grp.namePnl.delSuffix.value = true;\r\n\t\t\tpal.grp.cmds.rename.onClick = rd_CompRenamer_doRenameComps;\r\n\t\t}\r\n\t\t\r\n\t\treturn pal;\r\n\t}", "title": "" }, { "docid": "2be6e28e62bd08b4dede59d2d917082b", "score": "0.70449764", "text": "function BuildAndShowUI(thisObj) {\n\t\t\t// Create and show a floating palette.\n\t\t\tvar my_palette =\n\t\t\t\tthisObj instanceof Panel\n\t\t\t\t\t? thisObj\n\t\t\t\t\t: new Window(\"palette\", scriptName, undefined, { resizeable: true });\n\t\t\tif (my_palette != null) {\n\t\t\t\tvar res =\n\t\t\t\t\t\"group { \\\n\t\t\t\t\t\torientation:'column', alignment:['fill','top'], alignChildren:['left','top'], spacing:5, margins:[0,0,0,0], \\\n\t\t\t\t\t\toptsRow: Group { \\\n\t\t\t\t\t\t\torientation:'column', alignment:['fill','top'], \\\n name_text: StaticText { text:'Control Layer Name:', alignment:['left','top'] },\\\n\t\t\t\t\t\t\tname_input: EditText { text:'_CONTROL', alignment:['left','top'], preferredSize:[80,20] }, \\\n\t\t\t\t\t\t}, \\\n\t\t\t\t\t\tcmds: Group { \\\n\t\t\t\t\t\t\talignment:['fill','top'], \\\n\t\t\t\t\t\t\tokButton: Button { text:'Take Control!', alignment:['fill','center'] }, \\\n\t\t\t\t\t\t}, \\\n\t\t\t\t\t}\";\n\n\t\t\t\tmy_palette.margins = [10, 10, 10, 10];\n\t\t\t\tmy_palette.grp = my_palette.add(res);\n\n\t\t\t\t// Workaround to ensure the edittext text color is black, even at darker UI brightness levels.\n\t\t\t\tvar winGfx = my_palette.graphics;\n\t\t\t\tvar darkColorBrush = winGfx.newPen(\n\t\t\t\t\twinGfx.BrushType.SOLID_COLOR,\n\t\t\t\t\t[0, 0, 0],\n\t\t\t\t\t1\n\t\t\t\t);\n\t\t\t\tmy_palette.grp.optsRow.name_input.graphics.foregroundColor = darkColorBrush;\n\n\t\t\t\t// Set the callback. When the user enters text, this will be called.\n\t\t\t\tmy_palette.grp.optsRow.name_input.onChange = onNameInputChange;\n\n\t\t\t\tmy_palette.grp.cmds.okButton.onClick = createControls;\n\n\t\t\t\tmy_palette.onResizing = my_palette.onResize = function() {\n\t\t\t\t\tthis.layout.resize();\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn my_palette;\n\t\t}", "title": "" }, { "docid": "b812beef8e8556bb302a4c04f31d00da", "score": "0.6903634", "text": "function createUI(thisObj)\n {\n var mydlg = (thisObj instanceof Panel) ? thisObj : new Window(\"palette\", \"Make Toolbar\", undefined, {resizeable:true});\n mydlg.orientation = \"column\";\n \n btnSize = 32;\n leftMargin = 5;\n \n for (var i=0; i<scriptList.length; i++)\n {\n scriptBtn = mydlg.add(\"iconbutton\", \"x:\"+leftMargin+\",y:\"+\",width:\"+btnSize+\" ,height:\"+btnSize, iconLocation+scriptList[i][1], {style: 'toolbutton'});\n scriptBtn.ID = i;\n scriptBtn.helpTip = scriptList[i][2]; \n scriptBtn.onClick = function(){launchScript(this.ID);}\n }\n \n mydlg.onResizing = mydlg.onResize = function () {\n this.layout.resize();\n if (this.size[0] < this.size[1]){mydlg.orientation = \"column\";}else{mydlg.orientation = \"row\";}\n } \n \n return mydlg;\n \n }", "title": "" }, { "docid": "03f69e7034a11a4b9077b9892b921f74", "score": "0.6847311", "text": "function rd_SnapDecisions_buildUI(thisObj)\r\n\t{\r\n\t\tvar pal = (thisObj instanceof Panel) ? thisObj : new Window(\"palette\", rd_SnapDecisionsData.scriptName, undefined, {resizeable:true});\r\n\t\t\r\n\t\tif (pal !== null)\r\n\t\t{\r\n\t\t\tvar res = \r\n\t\t\t\"\"\"group { \r\n\t\t\t\torientation:'column', alignment:['fill','top'], alignChildren:['fill','top'], \r\n\t\t\t\theader: Group { \r\n\t\t\t\t\talignment:['fill','top'], \r\n\t\t\t\t\ttitle: StaticText { text:'\"\"\" + rd_SnapDecisionsData.scriptName + \"\"\"', alignment:['fill','center'] }, \r\n\t\t\t\t\thelp: Button { text:'\"\"\" + rd_SnapDecisions_localize(rd_SnapDecisionsData.strHelp) + \"\"\"', maximumSize:[30,20], alignment:['right','center'] }, \r\n\t\t\t\t}, \r\n\t\t\t\tlayerIO: Group {\r\n\t\t\t\t\torientation:'row', alignChildren:['fill','center'], \r\n\t\t\t\t\tsnapLbl: StaticText { text:'\"\"\" + rd_SnapDecisions_localize(rd_SnapDecisionsData.strSnapLbl) + \"\"\"', alignment:['left','top'] },\r\n\t\t\t\t\tlbl: Checkbox { text:'\"\"\" + rd_SnapDecisions_localize(rd_SnapDecisionsData.strLayerIOLbl) + \"\"\"', alignment:['left','top'], value:true },\r\n\t\t\t\t}, \r\n\t\t\t\tkfs: Group {\r\n\t\t\t\t\torientation:'row', alignChildren:['fill','center'],\r\n\t\t\t\t\tspacer: Group { alignment:['left','center'] },\r\n\t\t\t\t\tlbl: Checkbox { text:'\"\"\" + rd_SnapDecisions_localize(rd_SnapDecisionsData.strKfsLbl) + \"\"\"', alignment:['left','center'], value:true },\r\n\t\t\t\t}, \r\n\t\t\t\tlayerMarkers: Group {\r\n\t\t\t\t\torientation:'row', alignChildren:['fill','center'],\r\n\t\t\t\t\tspacer: Group { alignment:['left','center'] },\r\n\t\t\t\t\tlbl: Checkbox { text:'\"\"\" + rd_SnapDecisions_localize(rd_SnapDecisionsData.strLayerMarkersLbl) + \"\"\"', alignment:['left','center'], value:true },\r\n\t\t\t\t}, \r\n\t\t\t\tsnapTo: Group {\r\n\t\t\t\t\tlbl: StaticText { text:'\"\"\" + rd_SnapDecisions_localize(rd_SnapDecisionsData.strToLbl) + \"\"\"', alignment:['left','center'] },\r\n\t\t\t\t\tlst: DropDownList { properties:{ }, alignment:['fill','center'], preferredSize:[-1,20] }, \r\n\t\t\t\t}, \r\n\t\t\t\taffectLayers: Group {\r\n\t\t\t\t\tlbl: StaticText { text:'\"\"\" + rd_SnapDecisions_localize(rd_SnapDecisionsData.strAffectLbl) + \"\"\"', alignment:['left','center'] },\r\n\t\t\t\t\tlst: DropDownList { properties:{ }, alignment:['fill','center'], preferredSize:[-1,20] }, \r\n\t\t\t\t}, \r\n\t\t\t\tbtns: Group { \r\n\t\t\t\t\talignment:['right','bottom'], \r\n\t\t\t\t\tsnap: Button { text:'\"\"\" + rd_SnapDecisions_localize(rd_SnapDecisionsData.strSnap) + \"\"\"', preferredSize:[-1,20] }, \r\n\t\t\t\t}, \r\n\t\t\t}\"\"\";\r\n\t\t\tpal.grp = pal.add(res);\r\n\t\t\t\r\n\t\t\t//var listItems = rd_SnapDecisions_localize(rd_SnapDecisionsData.strKfsOpts);\r\n\t\t\t//for (var i=0; i<listItems.length; i++)\r\n\t\t\t//\tpal.grp.kfs.lst.add(\"item\", listItems[i]);\r\n\t\t\t//pal.grp.kfs.lst.selection = 1;\r\n\t\t\tvar listItems = rd_SnapDecisions_localize(rd_SnapDecisionsData.strToOpts);\r\n\t\t\tfor (var i=0; i<listItems.length; i++)\r\n\t\t\t\tpal.grp.snapTo.lst.add(\"item\", listItems[i]);\r\n\t\t\tpal.grp.snapTo.lst.selection = 0;\r\n\t\t\tvar listItems = rd_SnapDecisions_localize(rd_SnapDecisionsData.strAffectOpts);\r\n\t\t\tfor (var i=0; i<listItems.length; i++)\r\n\t\t\t\tpal.grp.affectLayers.lst.add(\"item\", listItems[i]);\r\n\t\t\tpal.grp.affectLayers.lst.selection = 0;\r\n\t\t\t\r\n\t\t\tpal.grp.affectLayers.lbl.preferredSize.width = pal.grp.snapTo.lbl.preferredSize.width = pal.grp.kfs.spacer.preferredSize.width = pal.grp.layerMarkers.spacer.preferredSize.width = pal.grp.layerIO.snapLbl.preferredSize.width;\r\n\t\t\t\r\n\t\t\tpal.layout.layout(true);\r\n\t\t\tpal.grp.minimumSize = pal.grp.size;\r\n\t\t\tpal.layout.resize();\r\n\t\t\tpal.onResizing = pal.onResize = function () {this.layout.resize();}\r\n\t\t\t\r\n\t\t\t//pal.grp.kfs.lbl.onClick = function ()\r\n\t\t\t//{\r\n\t\t\t//\tthis.parent.lst.enabled = this.value;\r\n\t\t\t//}\r\n\t\t\tpal.grp.btns.snap.onClick = function () {rd_SnapDecisions_doSnap(pal);}\r\n\t\t\tpal.grp.header.help.onClick = function () {alert(rd_SnapDecisionsData.scriptTitle + \"\\n\" + rd_SnapDecisions_localize(rd_SnapDecisionsData.strHelpText), rd_SnapDecisionsData.scriptName);}\r\n\t\t}\r\n\t\t\r\n\t\treturn pal;\r\n\t}\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t// rd_SnapDecisions_captureKeys()\r\n\t// \r\n\t// Description:\r\n\t// This function retrieves a property's keys as an array.\r\n\t// \r\n\t// Parameters:\r\n\t// prop - The property that has keys.\r\n\t// \r\n\t// Returns:\r\n\t// Array of property info (object)\r\n\t//\r\n\tfunction rd_SnapDecisions_captureKeys(prop)\r\n\t{\r\n\t\tvar keys = new Array(), key;\r\n\t\t\r\n\t\tfor (var i=1; i<=prop.numKeys; i++)\r\n\t\t{\r\n\t\t\tkeys[i-1] = {\r\n\t\t\t\ttime: prop.keyTime(i),\r\n\t\t\t\tvalue: prop.keyValue(i),\r\n\t\t\t\tinInterp: prop.keyInInterpolationType(i),\r\n\t\t\t\toutInterp: prop.keyOutInterpolationType(i),\r\n\t\t\t\ttempAutoBezier: prop.keyTemporalAutoBezier(i),\r\n\t\t\t\ttempContBezier: prop.keyTemporalContinuous(i),\r\n\t\t\t\tinTempEase: prop.keyInTemporalEase(i),\r\n\t\t\t\toutTempEase: prop.keyOutTemporalEase(i),\r\n\t\t\t}\r\n\t\t\tif ((prop.propertyValueType === PropertyValueType.TwoD_SPATIAL) || (prop.propertyValueType === PropertyValueType.ThreeD_SPATIAL))\r\n\t\t\t{\r\n\t\t\t\tkeys[i-1][\"spatAutoBezier\"] = prop.keySpatialAutoBezier(i);\r\n\t\t\t\tkeys[i-1][\"spatContBezier\"] = prop.keySpatialContinuous(i);\r\n\t\t\t\tkeys[i-1][\"inSpatTangent\"] = prop.keyInSpatialTangent(i);\r\n\t\t\t\tkeys[i-1][\"outSpatTangent\"] = prop.keyOutSpatialTangent(i);\r\n\t\t\t\tkeys[i-1][\"roving\"] = prop.keyRoving(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn keys;\r\n\t}\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t// rd_SnapDecisions_snapProp()\r\n\t// \r\n\t// Description:\r\n\t// This function performs the actual snapping operation on a layer's properties.\r\n\t// \r\n\t// Parameters:\r\n\t// comp - CompItem object representing the composition.\r\n\t// prop - Property object containing keyframes.\r\n\t// snapTo - In what direction to snap.\r\n\t// \r\n\t// Returns:\r\n\t// Nothing.\r\n\t//\r\n\tfunction rd_SnapDecisions_snapProp(comp, prop, snapTo)\r\n\t{\r\n\t\tvar oldKeys, oldK, frameOffset;\r\n\t\tvar frameDuration = comp.frameDuration, halfFrameDuration = frameDuration/2.0;\r\n\t\t\r\n\t\t// Capture the current keyframes\r\n\t\toldKeys = rd_SnapDecisions_captureKeys(prop);\r\n\t\t\r\n\t\t// Remove the current keyframes\r\n\t\twhile (prop.numKeys > 0)\r\n\t\t\tprop.removeKey(1);\r\n\t\t\r\n\t\t// Snap keyframe times\r\n\t\tfor (var k=0; k<oldKeys.length; k++)\r\n\t\t{\r\n\t\t\toldK = oldKeys[k];\r\n\t\t\t\r\n\t\t\t// Find the nearest frame time (i.e., round to nearest time)\r\n\t\t\tframeOffset = oldK.time % frameDuration;\r\n\t\t\t//$.writeln(\"old=\"+oldK.time+\", offset=\"+frameOffset);\r\n\t\t\tif (frameOffset > 0.0001)\t// Hopefully enough slop needed for \"exact\" frame values\r\n\t\t\t{\r\n\t\t\t\tif (snapTo === 1)\t\t// Previous Frame\r\n\t\t\t\t\toldK.time -= frameOffset;\r\n\t\t\t\telse if (snapTo === 2)\t// Next Frame\r\n\t\t\t\t\toldK.time += (frameDuration - frameOffset);\r\n\t\t\t\telse if (snapTo === 0)\t// Nearest Frame\r\n\t\t\t\t{\r\n\t\t\t\t\tif (frameOffset < halfFrameDuration)\r\n\t\t\t\t\t\toldK.time -= frameOffset;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\toldK.time += (frameDuration - frameOffset);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tprop.setValueAtTime(oldK.time, oldK.value);\r\n\t\t\t\r\n\t\t\t// Restore old key's characteristics\r\n\t\t\tif (oldK.outInterp !== KeyframeInterpolationType.HOLD)\r\n\t\t\t\tprop.setTemporalEaseAtKey(k+1, oldK.inTempEase, oldK.outTempEase);\r\n\t\t\t\r\n\t\t\tprop.setInterpolationTypeAtKey(k+1, oldK.inInterp, oldK.outInterp);\r\n\t\t\t\r\n\t\t\tif ((oldK.inInterp === KeyframeInterpolationType.BEZIER) && (oldK.outInterp === KeyframeInterpolationType.BEZIER) && oldK.tempContBezier)\r\n\t\t\t{\r\n\t\t\t\tprop.setTemporalContinuousAtKey(k+1, oldK.tempContBezier);\r\n\t\t\t\tprop.setTemporalAutoBezierAtKey(k+1, oldK.tempAutoBezier);\t\t// Implies Continuous, so do after it\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ((prop.propertyValueType === PropertyValueType.TwoD_SPATIAL) || (prop.propertyValueType === PropertyValueType.ThreeD_SPATIAL))\r\n\t\t\t{\r\n\t\t\t\tprop.setSpatialContinuousAtKey(k+1, oldK.spatContBezier);\r\n\t\t\t\tprop.setSpatialAutoBezierAtKey(k+1, oldK.spatAutoBezier);\t\t// Implies Continuous, so do after it\r\n\r\n\t\t\t\tprop.setSpatialTangentsAtKey(k+1, oldK.inSpatTangent, oldK.outSpatTangent);\r\n\r\n\t\t\t\tprop.setRovingAtKey(k+1, oldK.roving);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t// rd_SnapDecisions_snapLayerProps()\r\n\t// \r\n\t// Description:\r\n\t// This function performs the actual snapping operation on a layer's properties.\r\n\t// \r\n\t// Parameters:\r\n\t// comp - CompItem object representing the composition.\r\n\t// propGroup - PropertyGroup object (initially, the Layer object) containing keyframes.\r\n\t// doKeys - Whether to snap keyframes.\r\n\t// doMarkers - Whether to snap layer markers.\r\n\t// snapTo - In what direction to snap.\r\n\t// \r\n\t// Returns:\r\n\t// Nothing.\r\n\t//\r\n\tfunction rd_SnapDecisions_snapLayerProps(comp, propGroup, doKeys, doMarkers, snapTo)\r\n\t{\r\n\t\tvar prop, newTime, newValue, keyIndex;\r\n\t\t\r\n\t\t// Iterate over the specified property group's properties\r\n\t\tfor (var i=1; i<=propGroup.numProperties; i++)\r\n\t\t{\r\n\t\t\tprop = propGroup.property(i);\r\n\t\t\tif (prop.propertyType === PropertyType.PROPERTY)\t\t\t// Found a property\r\n\t\t\t{\r\n\t\t\t\tif (!doKeys && (prop.matchName !== \"ADBE Marker\"))\t// Skip keyframes if not needed\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tif (!doMarkers && (prop.matchName === \"ADBE Marker\"))\t// Skip markers if not needed\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tif (prop.numKeys === 0)\t\t\t\t\t\t\t// Skip properties that aren't keyframed\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t\r\n\t\t\t\tif (prop.isSeparationLeader && prop.dimensionsSeparated)\t// Skip Position property when dimensions are separated\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t\r\n\t\t\t\trd_SnapDecisions_snapProp(comp, prop, snapTo);\r\n\t\t\t}\r\n\t\t\telse if (prop.propertyType === PropertyType.INDEXED_GROUP)\t// Found an indexed group, so check its nested properties\r\n\t\t\t\trd_SnapDecisions_snapLayerProps(comp, prop, doKeys, doMarkers, snapTo);\r\n\t\t\telse if (prop.propertyType === PropertyType.NAMED_GROUP)\t// Found a named group, so check its nested properties\r\n\t\t\t\trd_SnapDecisions_snapLayerProps(comp, prop, doKeys, doMarkers, snapTo);\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t// rd_SnapDecisions_doSnap()\r\n\t// \r\n\t// Description:\r\n\t// This function performs the actual snapping operation.\r\n\t// \r\n\t// Parameters:\r\n\t// pal - The palette (Window object) itself.\r\n\t// \r\n\t// Returns:\r\n\t// Nothing.\r\n\t//\r\n\tfunction rd_SnapDecisions_doSnap(pal)\r\n\t{\r\n\t\tvar layerIO = pal.grp.layerIO.lbl.value, kfs = pal.grp.kfs.lbl.value, layerMarkers = pal.grp.layerMarkers.lbl.value, snapTo = pal.grp.snapTo.lst.selection.index, affectLayers = pal.grp.affectLayers.lst.selection.index;\r\n\t\t//var kfsOpt = pal.grp.kfs.lst.selection.index;\r\n\t\t\r\n\t\t// Check that a project exists\r\n\t\tif (app.project === null)\r\n\t\t\treturn;\r\n\t\t\r\n\t\t// Get the current (active/frontmost) comp\r\n\t\tvar comp = app.project.activeItem;\r\n\t\t\r\n\t\tif ((comp === null) || !(comp instanceof CompItem))\r\n\t\t{\r\n\t\t\talert(rd_SnapDecisions_localize(rd_SnapDecisionsData.strErrNoCompSel), rd_SnapDecisionsData.scriptName);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// Get the layers to update\r\n\t\tif (affectLayers === 1)\r\n\t\t{\r\n\t\t\t// Get all layers into an array (blah)\r\n\t\t\tvar layers = new Array();\r\n\t\t\tfor (var i=1; i<=comp.numLayers; i++)\r\n\t\t\t\tlayers[layers.length] = comp.layer(i);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tvar layers = comp.selectedLayers;\r\n\t\t\tif (layers.length === 0)\r\n\t\t\t{\r\n\t\t\t\talert(rd_SnapDecisions_localize(rd_SnapDecisionsData.strErrNoLayerSel), rd_SnapDecisionsData.scriptName);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Process each intended layer\r\n\t\tapp.beginUndoGroup(rd_SnapDecisionsData.scriptName);\r\n\t\t\r\n\t\tvar frameOffset, frameDuration = comp.frameDuration, halfFrameDuration = frameDuration / 2.0, doubleFrameDuration = frameDuration * 2.0;\r\n\t\tvar layer, inTime, outTime;\r\n\t\t\r\n\t\tfor (var i=0; i<layers.length; i++)\r\n\t\t{\r\n\t\t\tlayer = layers[i];\r\n\t\t\t\r\n\t\t\t// Process layer in/out\r\n\t\t\tif (layerIO)\r\n\t\t\t{\r\n\t\t\t\tinTime = layer.inPoint;\r\n\t\t\t\toutTime = layer.outPoint;\r\n\t\t\t\t//$.writeln(\"frameDur=\"+frameDuration);\r\n\t\t\t\t\r\n\t\t\t\tframeOffset = inTime % frameDuration;\r\n\t\t\t\t//$.writeln(\"oldIn=\"+inTime+\", offset=\"+frameOffset);\r\n\t\t\t\tif (frameOffset > 0.0001) //doubleFrameDuration)// 0.0001)\t// Hopefully enough slop needed for \"exact\" frame values\r\n\t\t\t\t{\r\n\t\t\t\t\tif (snapTo === 1)\t\t// Previous Frame\r\n\t\t\t\t\t\tinTime -= frameOffset;\r\n\t\t\t\t\telse if (snapTo === 2)\t// Next Frame\r\n\t\t\t\t\t\tinTime += (frameDuration - frameOffset);\r\n\t\t\t\t\telse if (snapTo === 0)\t// Nearest Frame\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (frameOffset < halfFrameDuration)\r\n\t\t\t\t\t\t\tinTime -= frameOffset;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tinTime += (frameDuration - frameOffset);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tframeOffset = outTime % frameDuration;\r\n\t\t\t\t//$.writeln(\"oldOut=\"+outTime+\", offset=\"+frameOffset);\r\n\t\t\t\tif (frameOffset > 0.0001) //doubleFrameDuration)// 0.0001)\t// Hopefully enough slop needed for \"exact\" frame values\r\n\t\t\t\t{\r\n\t\t\t\t\tif (snapTo === 1)\t\t// Previous Frame\r\n\t\t\t\t\t\toutTime -= frameOffset;\r\n\t\t\t\t\telse if (snapTo === 2)\t// Next Frame\r\n\t\t\t\t\t\toutTime += (frameDuration - frameOffset);\r\n\t\t\t\t\telse if (snapTo === 0)\t// Nearest Frame\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (frameOffset < halfFrameDuration)\r\n\t\t\t\t\t\t\toutTime -= frameOffset;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\toutTime += (frameDuration - frameOffset);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tlayer.inPoint = inTime;\r\n\t\t\t\tlayer.outPoint = outTime;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Process keys\r\n\t\t\trd_SnapDecisions_snapLayerProps(comp, layer, kfs, layerMarkers, snapTo);\r\n\t\t}\r\n\t\t\r\n\t\tapp.endUndoGroup();\r\n\t}\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t// main code:\r\n\t//\r\n\t\r\n\t// Prerequisites check\r\n\tif (parseFloat(app.version) < 10.0)\r\n\t\talert(rd_SnapDecisions_localize(rd_SnapDecisionsData.strMinAE100), rd_SnapDecisionsData.scriptName);\r\n\telse\r\n\t{\r\n\t\t// Build and show the console's floating palette\r\n\t\tvar rdsdPal = rd_SnapDecisions_buildUI(thisObj);\r\n\t\tif (rdsdPal !== null)\r\n\t\t{\r\n\t\t\t// Update UI values, if saved in the settings\r\n\t\t\tif (app.settings.haveSetting(\"redefinery\", \"rd_SnapDecisions_layerIO\"))\r\n\t\t\t\trdsdPal.grp.layerIO.lbl.value = (app.settings.getSetting(\"redefinery\", \"rd_SnapDecisions_layerIO\") === \"false\") ? false : true;\r\n\t\t\tif (app.settings.haveSetting(\"redefinery\", \"rd_SnapDecisions_kfs\"))\r\n\t\t\t\trdsdPal.grp.kfs.lbl.value = (app.settings.getSetting(\"redefinery\", \"rd_SnapDecisions_kfs\") === \"false\") ? false : true;\r\n\t\t\tif (app.settings.haveSetting(\"redefinery\", \"rd_SnapDecisions_layerMarkers\"))\r\n\t\t\t\trdsdPal.grp.layerMarkers.lbl.value = (app.settings.getSetting(\"redefinery\", \"rd_SnapDecisions_layerMarkers\") === \"false\") ? false : true;\r\n\t\t\tif (app.settings.haveSetting(\"redefinery\", \"rd_SnapDecisions_snapTo\"))\r\n\t\t\t\trdsdPal.grp.snapTo.lst.selection = parseInt(app.settings.getSetting(\"redefinery\", \"rd_SnapDecisions_snapTo\"), 10);\r\n\t\t\tif (app.settings.haveSetting(\"redefinery\", \"rd_SnapDecisions_affectLayers\"))\r\n\t\t\t\trdsdPal.grp.affectLayers.lst.selection = parseInt(app.settings.getSetting(\"redefinery\", \"rd_SnapDecisions_affectLayers\"), 10);\r\n\t\t\t\r\n\t\t\t// Save current UI settings upon closing the palette\r\n\t\t\trdsdPal.onClose = function()\r\n\t\t\t{\r\n\t\t\t\tapp.settings.saveSetting(\"redefinery\", \"rd_SnapDecisions_layerIO\", rdsdPal.grp.layerIO.lbl.value);\r\n\t\t\t\tapp.settings.saveSetting(\"redefinery\", \"rd_SnapDecisions_kfs\", rdsdPal.grp.kfs.lbl.value);\r\n\t\t\t\tapp.settings.saveSetting(\"redefinery\", \"rd_SnapDecisions_layerMarkers\", rdsdPal.grp.layerMarkers.lbl.value);\r\n\t\t\t\tapp.settings.saveSetting(\"redefinery\", \"rd_SnapDecisions_snapTo\", rdsdPal.grp.snapTo.lst.selection.index);\r\n\t\t\t\tapp.settings.saveSetting(\"redefinery\", \"rd_SnapDecisions_affectLayers\", rdsdPal.grp.affectLayers.lst.selection.index);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (rdsdPal instanceof Window)\r\n\t\t\t{\r\n\t\t\t\t// Show the palette\r\n\t\t\t\trdsdPal.center();\r\n\t\t\t\trdsdPal.show();\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\trdsdPal.layout.layout(true);\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "ab9d1a43d2b3b5c8fe09d16e247f46a6", "score": "0.6734429", "text": "function createUI(thisObj) {\r\nvar myPanel = ( thisObj instanceof Panel) ? thisObj : new Window(\"palette\", \"Arabic Text\", [100, 100, 350, 270]);\r\ninput_text = myPanel.add(\"edittext\", [10, 10, 240, 130],\"\",{multiline:true});\r\nok_button = myPanel.add(\"button\", [10, 140, 100, 160], \"Ok\");\r\nok_button.onClick = checkText;\r\ninput_text.onChanging = input_text.onChange = getText;\r\n\r\n//ADDED THIS CODE TO LET THE WINDOW RESIZE//\r\ninput_text.alignment = [\"fill\",\"fill\"];\r\nok_button.alignment = [\"center\",\"bottom\"];\r\nmyPanel.layout.resize();\r\nmyPanel.layout.layout(true);\r\nmyPanel.onResizing = myPanel.onResize = function () {this.layout.resize();}\r\n//////////////////////////////////////////////////\r\n\r\nreturn myPanel;\r\n}", "title": "" }, { "docid": "3e08c54197c94d00a6d1b5011bcd839e", "score": "0.6665145", "text": "buildUI() {\n this.node.setAttribute('tabindex', '0');\n this.node.cellSpacing = 0;\n this.node.cellPadding = 0;\n this.node.innerHTML = '\\\n <div class=\"fw-windowmodal-top\">\\\n <div class=\"fw-windowmodal-title\"></div>\\\n <div class=\"fw-windowmodal-close\"></div>\\\n </div>\\\n <div class=\"fw-windowmodal-main\">\\\n <div class=\"fw-windowmodal-scroll\"></div>\\\n </div>';\n\n this.topNode = this.node.getElementsByClassName('fw-windowmodal-top')[0];\n this.titleNode = this.node.getElementsByClassName('fw-windowmodal-title')[0];\n this.closeNode = this.node.getElementsByClassName('fw-windowmodal-close')[0];\n this.mainNode = this.node.getElementsByClassName('fw-windowmodal-main')[0];\n this.scrollNode = this.node.getElementsByClassName('fw-windowmodal-scroll')[0];\n\n this.setTitle(this.config.title);\n this.setContentNode(this.configContentNode);\n }", "title": "" }, { "docid": "8c5ab8284d67b57f6b6a70ce70b70ce7", "score": "0.6577076", "text": "function rd_KindaSorta_buildUI(thisObj)\r\n\t{\r\n\t\tvar pal = (thisObj instanceof Panel) ? thisObj : new Window(\"palette\", rd_KindaSortaData.scriptName, undefined, {resizeable:true});\r\n\t\t\r\n\t\tif (pal !== null)\r\n\t\t{\r\n\t\t\tvar res = \r\n\t\t\t\"group { \\\r\n\t\t\t\torientation:'column', alignment:['fill','top'], \\\r\n\t\t\t\theader: Group { \\\r\n\t\t\t\t\talignment:['fill','top'], \\\r\n\t\t\t\t\ttitle: StaticText { text:'\" + rd_KindaSortaData.scriptName + \"', alignment:['fill','center'] }, \\\r\n\t\t\t\t\thelp: Button { text:'\" + rd_KindaSorta_localize(rd_KindaSortaData.strHelp) +\"', maximumSize:[30,20], alignment:['right','center'] }, \\\r\n\t\t\t\t}, \\\r\n\t\t\t\tr1: Group { \\\r\n\t\t\t\t\talignment:['fill','top'], \\\r\n\t\t\t\t\taffect: StaticText { text:'\" + rd_KindaSorta_localize(rd_KindaSortaData.strAffect) + \"' }, \\\r\n\t\t\t\t\taffectOpts: DropDownList { properties:{items:\" + rd_KindaSorta_localize(rd_KindaSortaData.strAffectOpts) + \"}, alignment:['fill','top'], preferredSize:[-1,20] }, \\\r\n\t\t\t\t}, \\\r\n\t\t\t\tr2: Group { \\\r\n\t\t\t\t\talignment:['fill','top'], \\\r\n\t\t\t\t\torderBy: StaticText { text:'\" + rd_KindaSorta_localize(rd_KindaSortaData.strOrderBy) + \"' }, \\\r\n\t\t\t\t\torderByOpts: DropDownList { properties:{items:\" + rd_KindaSorta_localize(rd_KindaSortaData.strOrderByOpts) + \"}, alignment:['fill','top'], preferredSize:[-1,20] }, \\\r\n\t\t\t\t}, \\\r\n\t\t\t\tr3: Group { \\\r\n\t\t\t\t\talignment:['left','top'], \\\r\n\t\t\t\t\treverse: Checkbox { text:'\" + rd_KindaSorta_localize(rd_KindaSortaData.strReversed) + \"' }, \\\r\n\t\t\t\t}, \\\r\n\t\t\t\tcmds: Group { \\\r\n\t\t\t\t\talignment:['right','top'], \\\r\n\t\t\t\t\tsortBtn: Button { text:'\" + rd_KindaSorta_localize(rd_KindaSortaData.strSort) + \"', preferredSize:[-1,20] }, \\\r\n\t\t\t\t}, \\\r\n\t\t\t}\";\r\n\t\t\tpal.grp = pal.add(res);\r\n\t\t\t\r\n\t\t\tpal.grp.r1.affect.preferredSize.width = pal.grp.r2.orderBy.preferredSize.width;\r\n\t\t\tpal.grp.r3.indent = pal.grp.r2.orderBy.preferredSize.width + pal.grp.r2.spacing;\r\n\t\t\tpal.grp.r3.margins.top -= 5;\r\n\t\t\t\r\n\t\t\tpal.layout.layout(true);\r\n\t\t\tpal.grp.minimumSize = pal.grp.size;\r\n\t\t\tpal.layout.resize();\r\n\t\t\tpal.onResizing = pal.onResize = function () {this.layout.resize();}\r\n\t\t\t\r\n\t\t\tpal.grp.r1.affectOpts.selection = 0;\r\n\t\t\tpal.grp.r2.orderByOpts.selection = 1;\r\n\t\t\t\r\n\t\t\tpal.grp.r2.orderByOpts.onChange = function ()\r\n\t\t\t{\r\n\t\t\t\tif (this.selection.index === 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t// If using Random Order, disable Reversed order option\r\n\t\t\t\t\tthis.parent.parent.r3.reverse.value = false;\r\n\t\t\t\t\tthis.parent.parent.r3.reverse.enabled = false;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.parent.parent.r3.reverse.enabled = true;\r\n\t\t\t\t\tif (this.selection.index === 1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// If using Selected Order, switch Affect to Selected Layers in Comp\r\n\t\t\t\t\t\tthis.parent.parent.r1.affectOpts.selection = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tpal.grp.header.help.onClick = function () {alert(rd_KindaSortaData.scriptTitle + \"\\n\" + rd_KindaSorta_localize(rd_KindaSortaData.strHelpText), rd_KindaSortaData.scriptName);}\r\n\t\t\tpal.grp.cmds.sortBtn.onClick = rd_KindaSorta_doKindaSorta;\r\n\t\t}\r\n\t\t\r\n\t\treturn pal;\r\n\t}", "title": "" }, { "docid": "bd20764329f6b0748df3039e03685237", "score": "0.65755737", "text": "function rd_Statesman_buildUI(thisObj)\r\n {\r\n var pal = (thisObj instanceof Panel) ? thisObj : new Window(\"palette\", rd_StatesmanData.scriptName, undefined, {resizeable:true});\r\n \r\n if (pal !== null)\r\n {\r\n var res =\r\n \"group { \\\r\n orientation:'column', alignment:['fill','fill'], \\\r\n header: Group { \\\r\n alignment:['fill','top'], \\\r\n title: StaticText { text:'\" + rd_StatesmanData.scriptName + \"', alignment:['fill','center'] }, \\\r\n help: Button { text:'\" + rd_Statesman_localize(rd_StatesmanData.strHelp) +\"', maximumSize:[30,20], alignment:['right','center'] }, \\\r\n }, \\\r\n r1: Group { \\\r\n alignment:['left','top'], \\\r\n statesLbl: StaticText { text:'\" + rd_Statesman_localize(rd_StatesmanData.strStates) + \"' }, \";\r\n \r\n for (var i=0; i<rd_StatesmanData.numStates; i++)\r\n {\r\n res += \"states\" + i.toString() + \": Button { text:'\" + (i+1).toString() + \"', stateId:\" + (i+1).toString() + \", preferredSize:[30,20] }, \\ \";\r\n }\r\n \r\n res += \" \\\r\n }, \\\r\n r2: Group { \\\r\n alignment:['left','top'], \";\r\n \r\n for (var i=0; i<rd_StatesmanData.numStates; i++)\r\n {\r\n res += \"setStates\" + i.toString() + \": Button { text:'\" + rd_Statesman_localize(rd_StatesmanData.strStateSet) + \"', stateId:\" + (i+1).toString() + \", preferredSize:[30,15] }, \\ \";\r\n }\r\n \r\n res += \" \\\r\n }, \\\r\n setPnl: Group { \\\r\n orientation:'column', alignment:['fill','fill'], spacing:5, \\\r\n lbl: StaticText { text:'\" + rd_Statesman_localize(rd_StatesmanData.strLayerFeatures) + \"', alignment:['left','top'] }, \\\r\n listBox: ListBox { alignment:['fill','fill'], properties:{ items:\" + rd_Statesman_localize(rd_StatesmanData.strLayerStatesOpts) + \", multiselect:true } }, \\\r\n }, \\\r\n } \\\r\n \";\r\n pal.grp = pal.add(res);\r\n \r\n pal.grp.r2.margins.top -= 5;\r\n pal.grp.r2.margins.left = pal.grp.r1.statesLbl.preferredSize.width + pal.grp.r1.spacing;\r\n \r\n pal.layout.layout(true);\r\n //pal.grp.minimumSize = [pal.grp.header.size.x + pal.grp.r1.size.x, pal.grp.header.size.y + pal.grp.r1.size.y];\r\n pal.layout.resize();\r\n pal.onResizing = pal.onResize = function () {this.layout.resize();}\r\n \r\n for (var i=0; i<rd_StatesmanData.numStates; i++)\r\n {\r\n eval(\"pal.grp.r1.states\"+i.toString()+\".onClick = function() {rd_Statesman_doApplyState(parseInt(this.stateId), this.parent.parent);}\");\r\n eval(\"pal.grp.r2.setStates\"+i.toString()+\".onClick = function() {rd_Statesman_doCaptureState(parseInt(this.stateId), this.parent.parent);}\");\r\n }\r\n \r\n pal.grp.setPnl.listBox.selection = [1,2,3];\r\n \r\n pal.grp.header.help.onClick = function () {alert(rd_StatesmanData.scriptTitle + \"\\n\" + rd_Statesman_localize(rd_StatesmanData.strHelpText), rd_StatesmanData.scriptName);}\r\n }\r\n \r\n return pal;\r\n }", "title": "" }, { "docid": "e5f62d873fb6fe751b3212ec25d8a743", "score": "0.64220285", "text": "function _buildDOM(options) {\n var UI = app.UI = {};\n\n options = options || {};\n\n UI.wrapper = document.createElement('div');\n UI.wrapper.id = config.name;\n\n UI.panel = document.createElement('div');\n UI.panel.className = 'panel';\n UI.panel.id = 'PPPanel';\n\n UI.mask = document.createElement('div');\n UI.mask.className = 'mask';\n UI.mask.id = 'mask';\n\n addEvent(UI.mask, 'click', paypal.checkout.startFlow, this);\n\n UI.loading = document.createElement('div');\n UI.loading.className = 'ppmodal';\n\n var logo = document.createElement('div');\n logo.className = 'pplogo';\n UI.loading.appendChild(logo);\n\n var message = document.createElement('div');\n message.className = 'message';\n message.id = 'ppmsg';\n message.innerHTML = config.secureWindowmsg;\n UI.loading.appendChild(message);\n\n var closeButton = document.createElement('a');\n closeButton.className = 'closeButton';\n closeButton.role = 'button';\n closeButton.innerText = 'Close Window';\n\n addEvent(closeButton, 'click', _destroy, this);\n\n UI.loading.appendChild(closeButton);\n\n if (options.error) {\n var text = document.createElement('div');\n text.className = 'text';\n text.innerText = options.error;\n UI.loading.appendChild(text);\n\n } else {\n UI.loading.className = UI.loading.className + ' loading';\n }\n\n\n UI.wrapper.appendChild(UI.mask);\n UI.wrapper.appendChild(UI.loading);\n\n document.body.className = document.body.className + ' ' + config.name;\n\n document.body.appendChild(UI.wrapper);\n }", "title": "" }, { "docid": "853e376406e1d3b27879997315d5371c", "score": "0.6282694", "text": "function buildUI() {\n // set the field groups\n var fieldGroups = this._uiObj.FieldGroups;\n fieldGroups.push('none');\n\n this._uiBuilderInterface.GetFieldsForFieldGroup = getFieldsForFieldGroup_Notification;\n \n // set the sublist class\n this._uiBuilderInterface.SublistClass = psg_ep.Sublist_Notification;\n \n // add the buttons\n this._uiObj.ButtonIds.push('custpage_submitter');\n this._uiObj.ButtonIds.push('custpage_cancel');\n \n // build the form\n this._uiObj._buildUI('Payment Notification', 'customscript_ep_selection_cs');\n \n }", "title": "" }, { "docid": "186a48a079a05216f85c1d9b39b7bfc4", "score": "0.625744", "text": "function buildUI() {\n setPageTitle();\n showProfileFormIfLoggedIn();\n fetchAboutMe();\n fetchEvents();\n}", "title": "" }, { "docid": "1be1dcb7bf202badc26ac44665efe64f", "score": "0.6176098", "text": "function initUI() {\n//if(DEBUG) console.log('InitUI()');\n\n\t// WorkOrders & Activities ComboBoxes\n\tewWorkOrders = new ElementUIWrapper(appName + '-' + 'cboWorkOrders');\n\tewActivities = new ElementUIWrapper(appName + '-' + 'cboActivities');\n\t\n\t// Menu UI Elements\n\tinitMenu();\n\tbwMenu = new ButtonUIWrapper(appName + '-' + 'imgMenu', 'images/btn_menu_inactive.png', 1);\n\tbwMenu.disable();\n\t\n\tbwLogin = new ButtonUIWrapper(appName + '-' + 'imgLogin', 'images/btn_validation_inactive.png', 1);\n\tbwLogin.disable();\n\t\n\t// Misc UI Elements \n\tbwGoogleMap = new ButtonUIWrapper(appName + '-' + 'imgGoogleMap', 'images/btn_googlemaps_inactive.png', 1);\n\tbwGoogleMap.disable();\n\t\n\t// WorkOrder Activity UI Elements \n\tbwEndWorkOrder = new ButtonUIWrapper(appName + '-' + 'imgEndWorkOrder', 'images/btn_arret_inactive.png', 1);\n\t\n\tbwStartPause = new ButtonUIWrapper(appName + '-' + 'imgStartPause', 'images/PlayerButton_Pause_Inactive_128x40.png', 1);\n\tbwStartActivity = new ButtonUIWrapper(appName + '-' + 'imgStartActivity', 'images/btn_marche_inactive.png', 1);\n\tbwContinueActivity = new ButtonUIWrapper(appName + '-' + 'imgContinueActivity', 'images/btn_marche_inactive.png', 1);\n\tbwPauseActivity = new ButtonUIWrapper(appName + '-' + 'imgPauseActivity', 'images/btn_pause_inactive.png', 1);\n\tbwStopActivity = new ButtonUIWrapper(appName + '-' + 'imgStopActivity', 'images/btn_arret_inactive.png', 1);\n\tbwWorkflow = new ButtonUIWrapper(appName + '-' + 'imgWorkflow', 'images/btn_task_inactive.png', 1);\n\tbwWorkOrderActivitySound = new ButtonUIWrapper(appName + '-' + 'imgWorkOrderActivitySound', 'images/btn_sound_inactive.png', 1);\n\t\n\tif(WORKFLOW_ENABLED) {\n\t\tinitIntumUI();\n\t}\n\t\n\t// Set current (StartUp) Page \n\tcurrentPage = 'pageLogin';\n\tif(localStorage.getItem('Username')!=null) {\n\t\t$('#' + appName + '-' + 'txtLoginUsername').val(localStorage.getItem('Username'));\t// Commented 2016-03-04 - Uncommented 2016-03-10\n\t}\n\n\t// Language UI Elements\n\tinitLanguageBar();\n\n\t// Toolbars UI Elements\n\tinitToolbars();\n\n\tenableExitButton(true);\n}", "title": "" }, { "docid": "a17da1c07b25cb9e04947ae19bfe7b0f", "score": "0.6146791", "text": "_buildUI(){\n\t\t\tthis._window = new Gtk.ApplicationWindow ({\n\t\t\t\tapplication: this.application,\n\t\t\t\ttitle: \"Welcome to GNOME\",\n\t\t\t\tdefault_height: 900,\n\t\t\t\tdefault_width: 800,\n\t\t\t\twindow_position: Gtk.WindowPosition.CENTER });\n\t\t\t\t\n\t\t\t// Create a webview to show the web app\n\t\t\tthis._webWiew = new Webkit.WebView();\n\t\t\t\n\t\t\t// Put the web app into the webview\n\t\t\tthis._webView.load_uri(GLib.filename_to_uri(GLib.get_current_dir()+\n\t\t\t\t\t\"/hellognome.html\", null));\n\t\t\t\t\t\n\t\t\t// Put the webview into the window\n\t\t\tthis._window.add(this._webView);\n\t\t\t\n\t\t\t// Show the window and all child widgets\n\t\t\tthis._window.show_all();\t\n\t}", "title": "" }, { "docid": "399499b8660ec2a4654780bfd62b6630", "score": "0.6139592", "text": "function createUI() {\n // create gui (dat.gui)\n let gui = new dat.GUI({\n width: 295\n });\n gui.close();\n gui.add(controls, 'txt').name(\"Press A\");\n gui.add(controls, 'boidsSlider', 10, 130).name(\"Num Flowers\").step(1);\n gui.add(controls, 'buttSlider', 0, 150).name(\"Num Butterflies\").step(1);\n gui.add(controls, 'setView').name(\"Fixed view\");\n gui.add(controls, 'perceptionSlider', 0, 1000).name(\"Perception\").step(1);\n gui.add(controls, 'alignmentSlider', 0, 2).name(\"Alignment\").step(0.1);\n gui.add(controls, 'cohesionSlider', 0, 2).name(\"Cohesion\").step(0.1);\n gui.add(controls, 'separationSlider', 0, 2).name(\"Separation\").step(0.1);\n gui.add(this, 'infoBoids').name(\"Boids Info\");\n gui.add(this, 'backHome').name(\"Visit my site\");\n}", "title": "" }, { "docid": "0885acec58d411c458ba821fc210ac8f", "score": "0.60927933", "text": "function rd_AverageTrackers_buildUI(thisObj)\r\n\t{\r\n\t\tvar pal = new Window(\"dialog\", rd_AverageTrackersData.scriptName, undefined, {resizeable:true});\r\n\t\t\r\n\t\tif (pal !== null)\r\n\t\t{\r\n\t\t\tvar res =\r\n\t\t\t\"\"\"group { \r\n\t\t\t\torientation:'column', alignment:['fill','fill'], \r\n\t\t\t\theading: StaticText { text:'\"\"\" + rd_AverageTrackers_localize(rd_AverageTrackersData.strHeading) + \"\"\"', alignment:['fill','top'] }, \r\n\t\t\t\tlst: ListBox { alignment:['fill','fill'], properties:{ multiselect:true } }, \r\n\t\t\t\tcap: StaticText { text:'\"\"\" + rd_AverageTrackers_localize(rd_AverageTrackersData.strCaption) + \"\"\"', alignment:['fill','bottom'] }, \r\n\t\t\t\tcmds: Group { \r\n\t\t\t\t\talignment:['fill','bottom'], \r\n\t\t\t\t\thelp: Button { text:'\"\"\" + rd_AverageTrackers_localize(rd_AverageTrackersData.strHelp) + \"\"\"', maximumSize:[30,20], alignment:['left','bottom'] }, \r\n\t\t\t\"\"\";\r\n\t\t\tif (onWindows)\r\n\t\t\t\tres += \"\"\" \r\n\t\t\t\t\tokBtn: Button { text:'\"\"\" + rd_AverageTrackers_localize(rd_AverageTrackersData.strOK) + \"\"\"', alignment:['right','bottom'], preferredSize:[-1,20] }, \r\n\t\t\t\t\tcancelBtn: Button { text:'\"\"\" + rd_AverageTrackers_localize(rd_AverageTrackersData.strCancel) + \"\"\"', alignment:['right','bottom'], preferredSize:[-1,20] }, \r\n\t\t\t\t\"\"\";\r\n\t\t\telse\r\n\t\t\t\tres += \"\"\" \r\n\t\t\t\t\tcancelBtn: Button { text:'\"\"\" + rd_AverageTrackers_localize(rd_AverageTrackersData.strCancel) + \"\"\"', alignment:['right','bottom'], preferredSize:[-1,20] }, \r\n\t\t\t\t\tokBtn: Button { text:'\"\"\" + rd_AverageTrackers_localize(rd_AverageTrackersData.strOK) + \"\"\"', alignment:['right','bottom'], preferredSize:[-1,20] }, \r\n\t\t\t\t\"\"\";\r\n\t\t\tres += \"\"\" \r\n\t\t\t\t}, \r\n\t\t\t}\"\"\";\r\n\t\t\tpal.grp = pal.add(res);\r\n\t\t\t\r\n\t\t\tpal.grp.cmds.margins.top = 5;\r\n\t\t\tpal.grp.lst.preferredSize.height = 100;\r\n\t\t\t\r\n\t\t\tpal.layout.layout(true);\r\n\t\t\tpal.grp.minimumSize = pal.grp.size;\r\n\t\t\tpal.layout.resize();\r\n\t\t\tpal.onResizing = pal.onResize = function () {this.layout.resize();}\r\n\t\t\t\r\n\t\t\tpal.grp.cmds.help.onClick = function () {alert(rd_AverageTrackersData.scriptTitle + \"\\n\" + rd_AverageTrackers_localize(rd_AverageTrackersData.strHelpText), rd_AverageTrackersData.scriptName);}\r\n\t\t\tpal.grp.cmds.okBtn.onClick = rd_AverageTrackers_doIt;\r\n\t\t}\r\n\t\t\r\n\t\treturn pal;\r\n\t}\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t// rd_AverageTrackers_getMTTrackPoints()\r\n\t// \r\n\t// Description:\r\n\t// This function retrieves the motion tracker track points on the specified layer.\r\n\t// \r\n\t// Parameters:\r\n\t// layer - The layer to check.\r\n\t// \r\n\t// Returns:\r\n\t// Array of motion tracker track points\r\n\t//\r\n\tfunction rd_AverageTrackers_getMTTrackPoints(layer)\r\n\t{\r\n\t\tvar mtPts = new Array();\r\n\t\t\r\n\t\tif (layer !== null)\r\n\t\t{\r\n\t\t\tvar mtGroup = layer(\"ADBE MTrackers\");\r\n\t\t\tif (mtGroup !== null)\r\n\t\t\t{\r\n\t\t\t\tvar mtracker;\r\n\t\t\t\t\r\n\t\t\t\tfor (var i=1; i<=mtGroup.numProperties; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\tmtracker = mtGroup.property(i);\r\n\t\t\t\t\tfor (var j=1; j<=mtracker.numProperties; j++)\r\n\t\t\t\t\t\tmtPts[mtPts.length] = mtracker.property(j); \r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn mtPts;\r\n\t}\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t// rd_AverageTrackers_doIt()\r\n\t// \r\n\t// Description:\r\n\t// This callback function performs the main operation.\r\n\t// \r\n\t// Parameters:\r\n\t// None.\r\n\t// \r\n\t// Returns:\r\n\t// Nothing\r\n\t//\r\n\tfunction rd_AverageTrackers_doIt()\r\n\t{\r\n\t\tvar selection = this.parent.parent.lst.selection;\r\n\t\t\r\n\t\tapp.beginUndoGroup(rd_AverageTrackersData.scriptName);\r\n\t\t\r\n\t\tvar comp = app.project.activeItem;\r\n\t\tvar layer = comp.selectedLayers[0];\r\n\t\tvar nullLayer = comp.layers.addNull();\r\n\t\t\r\n\t\tnullLayer.name = \"Average\";\r\n\t\t\r\n\t\tvar mt;\r\n\t\tvar expr = \"l = thisComp.layer(\\\"\" + layer.name + \"\\\");\\n(\";\r\n\t\tfor (var i=0; i<selection.length; i++)\r\n\t\t{\r\n\t\t\tmt = rd_AverageTrackersData.mtPts[selection[i].index];\r\n\t\t\tif (i > 0)\r\n\t\t\t\texpr += \" + \";\r\n\t\t\texpr += \"l.motionTracker(\\\"\" + mt.parentProperty.name + \"\\\")(\\\"\" + mt.name + \"\\\").attachPoint+l.motionTracker(\\\"\" + mt.parentProperty.name + \"\\\")(\\\"\" + mt.name + \"\\\").attachPointOffset\";\r\n\t\t}\r\n\t\texpr += \") / \" + selection.length + \";\";\r\n\t\t\r\n\t\tnullLayer.position.expression = expr;\r\n\t\tnullLayer.position.expressionEnabled = true;\r\n\t\t\r\n\t\tapp.endUndoGroup();\r\n\t\t\r\n\t\tthis.parent.parent.parent.close();\r\n\t}\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t// main code:\r\n\t//\r\n\t\r\n\t// Prerequisites check\r\n\tif (parseFloat(app.version) < 9.0)\r\n\t\talert(rd_AverageTrackers_localize(rd_AverageTrackersData.strMinAE90), rd_AverageTrackersData.scriptName);\r\n\telse\r\n\t{\r\n\t\t// Make sure only a single comp is selected\r\n\t\tif (app.project === null)\r\n\t\t\treturn;\r\n\t\t\r\n\t\t// Get the current (active/frontmost) comp\r\n\t\tvar comp = app.project.activeItem;\r\n\t\t\r\n\t\tif ((comp === null) || !(comp instanceof CompItem))\r\n\t\t{\r\n\t\t\talert(rd_AverageTrackers_localize(rd_AverageTrackersData.strErrNoCompSel), rd_AverageTrackersData.scriptName);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t// Make sure there is a selected layer with at least two motion tracker track points\r\n\t\tif (comp.selectedLayers.length !== 1)\r\n\t\t{\r\n\t\t\talert(rd_AverageTrackers_localize(rd_AverageTrackersData.strNoSelLayer), rd_AverageTrackersData.scriptName);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tvar layer = comp.selectedLayers[0];\r\n\t\trd_AverageTrackersData.mtPts = rd_AverageTrackers_getMTTrackPoints(layer);\r\n\t\t\r\n\t\tif (rd_AverageTrackersData.mtPts.length < 2)\r\n\t\t{\r\n\t\t\talert(rd_AverageTrackers_localize(rd_AverageTrackersData.strNoSelLayer), rd_AverageTrackersData.scriptName);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tvar dlg = rd_AverageTrackers_buildUI(thisObj);\r\n\t\tif (dlg !== null)\r\n\t\t{\r\n\t\t\t// Add the list of motion tracker track points to the UI\r\n\t\t\tfor (var i=0; i<rd_AverageTrackersData.mtPts.length; i++)\r\n\t\t\t{\r\n\t\t\t\tdlg.grp.lst.add(\"item\", rd_AverageTrackersData.mtPts[i].parentProperty.name + \" > \" + rd_AverageTrackersData.mtPts[i].name);\r\n\t\t\t\tif (rd_AverageTrackersData.mtPts[i].enabled)\r\n\t\t\t\t\tdlg.grp.lst.items[i].selected = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Show the dialog\r\n\t\t\tdlg.center();\r\n\t\t\tdlg.show();\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "48929eda480edb27354f7eb206bdb142", "score": "0.6055744", "text": "function buildUI() {\n setPageTitle();\n showMessageFormIfViewingSelf();\n fetchMessages();\n}", "title": "" }, { "docid": "5db9a721097c2e3a228a2cbfda22340b", "score": "0.6036222", "text": "createUI(data){}", "title": "" }, { "docid": "81138edf4f110117fb67bec7a6be939e", "score": "0.60178035", "text": "makeUI() {\n this.searchPanel = new ScrollablePanel(this.scene, \"SearchUI\");\n }", "title": "" }, { "docid": "545999f97e7227fb44b4781c062905eb", "score": "0.5987245", "text": "function buildUI() {\n fetchBlobstoreUrlAndShowMessageForm();\n showMessageFormIfViewingSelf();\n loadNavigation();\n fetchMessages(\"\");\n addListnerForInfiniteScroll();\n addModalViewforlikes();\n addButtonEventForDelete();\n\n}", "title": "" }, { "docid": "d3117be67c1c38c48674e0753eaeb717", "score": "0.59847444", "text": "function mkUI() {\n document.body.style.margin =\n document.body.style.padding = \"0\";\n document.body.innerHTML = ui.code;\n\n // If there was a pre-loaded display, such as a privacy policy, remove it\n var preecStyle = dce(\"style\");\n preecStyle.innerHTML = \"#pre-ec { display: none; }\";\n document.head.appendChild(preecStyle);\n\n // When we resize, we need to flex the UI\n var wrapper = ui.wrapper = gebi(\"ecouter\");\n wrapper.style.minHeight = window.innerHeight + \"px\";\n window.addEventListener(\"resize\", function() {\n wrapper.style.minHeight = window.innerHeight + \"px\";\n checkMaximized();\n if (!ui.resizing) {\n ui.manualSize = true;\n reflexUI();\n }\n });\n\n // A generic function to handle fullscreen buttons\n function fullscreen(el, btn) {\n btn.innerHTML = '<i class=\"fas fa-expand\"></i>';\n\n // Toggle based on what's fullscreen\n function toggleFullscreen() {\n if (document.fullscreenElement === el)\n document.exitFullscreen();\n else\n el.requestFullscreen();\n }\n btn.onclick = toggleFullscreen;\n\n document.addEventListener(\"fullscreenchange\", function() {\n if (document.fullscreenElement === el)\n btn.innerHTML = '<i class=\"fas fa-compress\"></i>';\n else\n btn.innerHTML = '<i class=\"fas fa-expand\"></i>';\n });\n\n // But hide it when the mouse isn't in the right place\n var timeout = null;\n el.style.cursor = \"none\";\n btn.style.display = \"none\";\n function mouseenter() {\n if (timeout)\n clearTimeout(timeout);\n btn.style.display = \"\";\n el.style.cursor = \"\";\n timeout = setTimeout(function() {\n btn.style.display = \"none\";\n el.style.cursor = \"none\";\n timeout = null;\n }, 5000);\n }\n el.addEventListener(\"mouseenter\", mouseenter);\n el.addEventListener(\"mousemove\", mouseenter);\n }\n\n // The video has several elements\n ui.video = {\n els: [],\n boxes: [],\n hasVideo: [],\n wanted: false,\n speech: {},\n major: -1,\n selected: -1,\n self: null,\n main: null,\n side: null\n };\n\n // A wrapper for *all* video\n ui.video.wrapper = gebi(\"ecvideo-wrapper\");\n ui.video.wrapper.style.display = \"none\";\n\n // A wrapper for the main video (if visible)\n ui.video.main = gebi(\"ecvideo-main\");\n ui.video.mainFullscreen = gebi(\"ecvideo-main-fs\");\n fullscreen(ui.video.main, ui.video.mainFullscreen);\n\n // A wrapper for side video\n ui.video.side = gebi(\"ecvideo-side\");\n ui.video.wrapperFullscreen = gebi(\"ecvideo-wrapper-fs\");\n fullscreen(ui.video.wrapper, ui.video.wrapperFullscreen);\n\n // And for our own video\n var selfVideo = ui.video.self = dce(\"video\");\n ui.video.els.push(selfVideo);\n ui.video.hasVideo.push(false);\n\n // The watcher image\n var img = ui.waveWatcher = gebi(\"ecwave-watcher\");\n\n // And choose its type based on support\n function usePng() {\n img.src = \"images/watcher.png\";\n }\n if (!window.createImageBitmap || !window.fetch) {\n usePng();\n } else {\n var sample = \"data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=\";\n fetch(sample).then(function(res) {\n return res.blob();\n }).then(function(blob) {\n return createImageBitmap(blob)\n }).then(function() {\n img.src = \"images/watcher.webp\";\n }).catch(usePng);\n }\n\n // The canvas for the waveform\n ui.waveWrapper = gebi(\"ecwaveform-wrapper\");\n ui.waveCanvas = gebi(\"ecwaveform\");\n\n // The menu\n ui.menu = {\n wrapper: gebi(\"ecmenu\")\n };\n\n // Move the status box\n var eclog = ui.log = gebi(\"eclog\");\n eclog.innerHTML = \"\";\n eclog.appendChild(log);\n\n // Load all the panels\n function panel(nm, auto) {\n var p = ui.panels[nm] = gebi(\"ec\" + nm + \"-wrapper\");\n p.style.display = \"none\";\n\n if (auto)\n ui.panelAutos[nm] = gebi(\"ec\" + auto);\n }\n panel(\"master\", \"master-invite-link-copy\");\n panel(\"user-list\");\n panel(\"sounds\");\n panel(\"audio-device\", \"input-device-list\");\n panel(\"video-device\", \"video-device-list\");\n panel(\"chat\", \"chat-outgoing\");\n\n // Set up the menu\n createMenu();\n\n // Set up the video UI\n updateVideoUI(0, true);\n\n // The chat box\n createChatBox();\n\n // The user list sub\"menu\"\n createUserList();\n\n // The device list submenu\n createDeviceList();\n\n // The output and video device list submenu\n if (useRTC) {\n createOutputControlPanel();\n createVideoDeviceList();\n }\n\n // Set up the master interface\n if (\"master\" in config) {\n createMasterInterface();\n ui.panels.master.style.display = \"\";\n }\n\n checkMaximized();\n reflexUI();\n}", "title": "" }, { "docid": "ab8ba7469de956bca6f7f4a83b901b8a", "score": "0.5880928", "text": "function buildUI(){\n addLoginOrLogoutLinkToNavigation();\n fetchMessages();\n initMap();\n }", "title": "" }, { "docid": "e8a7b17f46b2c583ce10577baad7c706", "score": "0.58417326", "text": "function buildUI() {\n fetchUsername();\n fetchDisplayedName();\n}", "title": "" }, { "docid": "db1abde94b75e1855bd121d484a11099", "score": "0.5812247", "text": "function buildUI() {\n this._sublistInterface.GetColumns = getColumns_Notification;\n this._sublist._buildUI();\n }", "title": "" }, { "docid": "fd37a58ab9d78945b92594d1e0dab7eb", "score": "0.5809701", "text": "function initializeUI() {\n\tif (typeof NAME != 'undefined') {\n\t\treturn;\n\t}\n\n\tNAME = dwscripts.findDOMObject(\"theName\");\n\t\n\tTYPE_MENU = dwscripts.findDOMObject('theMenu');\n\tTYPE_LIST = dwscripts.findDOMObject('theList');\n\t\n\tSIZE = dwscripts.findDOMObject(\"theSize\");\n\tLIST_VALUES = dwscripts.findDOMObject('theListValues');\n\tALLOW_MULTIPLE = dwscripts.findDOMObject('theAllowMultiple');\n\t\n\tQUERY = new EditableRecordsetMenu(\"\", \"theQuery\", true);\n\tDISPLAY = dwscripts.findDOMObject('theDisplay');\n\tVALUE = dwscripts.findDOMObject('theValue');\n\tLABEL = dwscripts.findDOMObject('theLabel');\n\tHEIGHT = dwscripts.findDOMObject('theHeight');\n\tWIDTH = dwscripts.findDOMObject('theWidth');\n\tMESSAGE = dwscripts.findDOMObject('theMessage');\n\tREQUIRED = dwscripts.findDOMObject(\"theRequired\");\n\n\tSELECTED = dwscripts.findDOMObject('theSelected');\n \n\t// reposition form elements for Windows\n\t//if (navigator.platform.charAt(0)==\"W\") {\n\t\t// Move icon into position\n\t//\tdocument.layers[\"piImage\"].top = 2;\n\t//\tdocument.layers[\"piImage\"].left = 4;\n\t//\tdocument.layers[\"idBoxLayer\"].top = 2;\n\t\t//document.layers[\"idBoxLayer\"].left = 43;\n\t//}\n}", "title": "" }, { "docid": "9f8e48a87d66da0303dc91f5f52bc185", "score": "0.58079064", "text": "_onStartup(){\n\t\t\tthis._buildUI();\t\n\t}", "title": "" }, { "docid": "e23b4275b9e57788412f61c6c452a859", "score": "0.57929796", "text": "function buildPanel(windowObj){//Define Window to be built\n var fontSize = \"med\";\n var myEffectsPanel = (windowObj instanceof Panel) ? windowObj : new Window (\"palette\", \"Effects Buttons\", undefined, {resizeable:true});\n var myEffectsTabs = myEffectsPanel.add(\"tabbedpanel\",undefined);\n var basicEffectsTab = myEffectsTabs.add(\"tab\", undefined, \"Basic Effects\", {orientation:'row',alignment:['left','top']});\n basicEffectsTab.orientation = 'row';\n var transitionEffectsTab = myEffectsTabs.add(\"tab\", undefined, \"Transition Effects\", {orientation:'row',alignment:['left','top']});\n transitionEffectsTab.orientation = 'row';\n var layersTab = myEffectsTabs.add(\"tab\", undefined, \"Layers and Time\", {orientation:'row'});\n layersTab.orientation = 'row';\n var fontsTab = myEffectsTabs.add(\"tab\", undefined, \"Fonts\", {orientation:'row'});\n fontsTab.orientation = 'row';\n\n var effectsColumn01 = basicEffectsTab.add(\"Group\",undefined,{orientation: 'column', alignment:['left','top']});\n effectsColumn01.alignment = ['left','top']; \n effectsColumn01.orientation = 'column';\n effectsColumn01.add(\"Button\",undefined ,\"Add Gaus\").onClick = function(){addEffect (\"ADBE Gaussian Blur 2\")};\n effectsColumn01.add(\"Button\",undefined ,\"Add HueSat\").onClick = function(){addEffect (\"ADBE HUE SATURATION\")};\n effectsColumn01.add(\"Button\",undefined ,\"Add Fill\").onClick = function(){addEffect (\"ADBE Fill\")};\n effectsColumn01.add(\"Button\",undefined ,\"Add DropShdw\").onClick = function(){addEffect (\"ADBE Drop Shadow\")};\n effectsColumn01.add(\"Button\",undefined ,\"Add Linear Wipe\").onClick = function(){addEffect (\"ADBE Linear Wipe\")};\n effectsColumn01.add(\"Button\",undefined ,\"Add Transform\").onClick = function(){addEffect (\"ADBE Geometry2\")};\n \n var effectsColumn02 = basicEffectsTab.add(\"Group\",undefined,{orientation: 'column', alignment:['left','top']});\n effectsColumn02.alignment = ['left','top']; \n effectsColumn02.orientation = 'column';\n effectsColumn02.add(\"Button\",undefined ,\"Add Gradient\").onClick = function(){addEffect (\"ADBE Ramp\")};\n effectsColumn02.add(\"Button\",undefined ,\"Add LightSweep\").onClick = function(){addEffect (\"CC Light Sweep\")};\n effectsColumn02.add(\"Button\",undefined ,\"Add Glow\").onClick = function(){addEffect (\"ADBE Glo2\")};\n effectsColumn02.add(\"Button\",undefined ,\"Add Simple Choker\").onClick = function(){addEffect (\"ADBE Simple Choker\")};\n effectsColumn02.add(\"Button\",undefined ,\"Add Luma Dissolve\").onClick = function(){addEffect (\"S_DissolveLuma\")};\n effectsColumn02.add(\"Button\",undefined ,\"Add S_DropShdw\").onClick = function(){addEffect (\"S_DropShadow\")};\n \n var transitionColumn01 = transitionEffectsTab.add(\"Group\",undefined);\n transitionColumn01.alignment = ['left','top'];\n transitionColumn01.orientation = 'column';\n transitionColumn01.add(\"Button\",undefined ,\"Add PageTurn\").onClick = function(){addEffect (\"CC Page Turn\")};\n transitionColumn01.add(\"Button\",undefined ,\"Add CardWipe\").onClick = function(){addEffect (\"APC CardWipeCam\")};\n transitionColumn01.add(\"Button\",undefined ,\"Add RadialWipe\").onClick = function(){addEffect (\"ADBE Radial Wipe\")};\n transitionColumn01.add(\"Button\",undefined ,\"Add Luma Dissolve\").onClick = function(){addEffect (\"S_DissolveLuma\")};\n transitionColumn01.add(\"Button\",undefined ,\"Add Force Motion Blur\").onClick = function(){addEffect (\"CC Force Motion Blur\")};\n \n var transitionColumn02 = transitionEffectsTab.add(\"Group\",undefined);\n transitionColumn02.alignment = ['left','top'];\n transitionColumn02.orientation = 'column';\n transitionColumn02.add(\"Button\",undefined ,\"Text Ramp In\").onClick = function(){addTextAnim (\"Ramp Down\")};\n transitionColumn02.add(\"Button\",undefined ,\"Text Ramp Out\").onClick = function(){addTextAnim (\"Ramp Up\")};\n transitionColumn02.add(\"Button\",undefined ,\"Text Ramp Thru\").onClick = function(){addTextAnim (\"Smooth\")};\n \n var layerColumn01 = layersTab.add(\"Group\",undefined);\n layerColumn01.alignment = ['left','top'];\n layerColumn01.orientation = 'column';\n layerColumn01.add(\"Button\",undefined ,\"Add Solid\").onClick = function(){addSolid(0)};\n layerColumn01.add(\"Button\",undefined ,\"Add Null\").onClick = function(){addNull()};\n layerColumn01.add(\"Button\",undefined ,\"Add Adjustments\").onClick = function(){addSolid(1)};\n layerColumn01.add(\"Button\",undefined ,\"Add Time Remap\").onClick = function(){toggleTimeRemap()};\n layerColumn01.add(\"Button\",undefined ,\"Match Height\").onClick = function(){matchCompSize(0)};\n layerColumn01.add(\"Button\",undefined ,\"Match Width\").onClick = function(){matchCompSize(1)};\n \n var layerColumn02 = layersTab.add(\"Group\",undefined);\n layerColumn02.alignment = ['left','top'];\n layerColumn02.orientation = 'column';\n layerColumn02.add(\"Button\",undefined ,\"Ease In\").onClick = function(){\n addEase(0, easeSpeedForEffectWindowScript, 0, 0.1);\n lastEaseUsed = \"EI\";\n }\n layerColumn02.add(\"Button\",undefined ,\"Ease Out\").onClick = function(){\n addEase(0, 0.1, 0, easeSpeedForEffectWindowScript);\n lastEaseUsed = \"EO\"\n }\n layerColumn02.add(\"Button\",undefined ,\"Fast In Out\").onClick = function(){\n addEase(0, 0.1, 0, 0.1);\n lastEaseUsed = \"FIO\"\n }\n layerColumn02.add(\"Button\",undefined ,\"Ease In Out\").onClick = function(){\n addEase(0, easeSpeedForEffectWindowScript, 0, easeSpeedForEffectWindowScript);\n lastEaseUsed = \"EIO\";\n }\n var seperatedEaseControls = layerColumn02.add(\"checkbox\",undefined ,\"Seperate Ease Controls\")\n seperatedEaseControls.onClick = function(){\n layersTab.children[2].children[0].children[2].enabled = seperatedEaseControls.value;\n layersTab.children[2].children[0].children[3].enabled = seperatedEaseControls.value;\n seperatedEaseControlsForWindowScript= seperatedEaseControls.value;\n }\n \n var layerColumn03 = layersTab.add(\"Group\",undefined);\n layerColumn03.alignment = ['left','top'];\n layerColumn03.orientation = 'column';\n var easeSliderArea = layerColumn03.add('group')\n easeSliderArea.orientation = 'column';\n var easeSlider = easeSliderArea.add('slider{minvalue:.1, maxvalue:100, value:100}')\n var easeSliderValue = easeSliderArea.add('edittext{text:100, characters:4, justify:\"center\", active:true, enterKeySignalsOnChange:flase}');\n \n //secondEaseSliderArea.hide();\n var easeSlider02 = easeSliderArea.add('slider{minvalue:.1, maxvalue:100, value:100}');\n var easeSliderValue02 = easeSliderArea.add('edittext{text:100, characters:4, justify:\"center\", active:true, enterKeySignalsOnChange:flase}');\n easeSlider02.enabled = false;\n easeSliderValue02.enabled = false;\n easeSlider.onChanging= function(){\n easeSpeedForEffectWindowScript = easeSlider.value;\n easeSliderValue.text = easeSlider.value;\n if (easeAffectPreviousSelection==true){\n continueAffectingEase(lastEaseUsed, easeSpeedForEffectWindowScript, easeSpeedForEffectWindowScript02);\n }\n }\n easeSliderValue.onChanging = function(){\n easeSlider.value =Number(easeSliderValue.text);\n \n }\n easeSliderValue.onChange= function(){\n //alert(\"On Change\")\n \n if (Number(easeSliderValue.text)!=NaN){\n changeSliderValue(Number(easeSliderValue.text),easeSliderValue, easeSlider, easeSpeedForEffectWindowScript);\n easeSpeedForEffectWindowScript = Number(easeSliderValue.text);\n }\n //alert(\"Contunue 01\")\n if (easeAffectPreviousSelection==true){\n //alert(\"Command Recieved 01\")\n \n continueAffectingEase(lastEaseUsed, easeSpeedForEffectWindowScript, easeSpeedForEffectWindowScript02);\n //alert(\"Command 01 Proccessed\");\n }\n }\n easeSlider02.onChanging= function(){\n easeSpeedForEffectWindowScript02 = easeSlider02.value;\n easeSliderValue02.text = easeSlider02.value;\n if (easeAffectPreviousSelection==true){\n continueAffectingEase(lastEaseUsed, easeSpeedForEffectWindowScript, easeSpeedForEffectWindowScript02);\n }\n }\n easeSliderValue02.onChanging = function(){\n easeSlider02.value =Number(easeSliderValue02.text);\n \n }\n easeSliderValue02.onChange= function(){\n //alert(\"On Change\")\n if (Number(easeSliderValue02.text)!=NaN){\n changeSliderValue(Number(easeSliderValue02.text),easeSliderValue02, easeSlider02, easeSpeedForEffectWindowScript02);\n easeSpeedForEffectWindowScript02 = Number(easeSliderValue02.text);\n }\n //alert(\"Continue 02\");\n if (easeAffectPreviousSelection==true){\n //alert(\"Command Recieved 02\")\n continueAffectingEase(lastEaseUsed, easeSpeedForEffectWindowScript, easeSpeedForEffectWindowScript02);\n //alert(\"Command 02 Proccessed\");\n }\n }\n var Ease100Button = layerColumn03.add(\"button\",undefined ,\"100 Ease\");\n Ease100Button.onClick = function(){\n easeSpeedForEffectWindowScript = 100;\n easeSlider.value=100;\n easeSliderValue.text = 100;\n easeSlider02.value=100;\n easeSliderValue02.text = 100;\n if (easeAffectPreviousSelection==true){\n continueAffectingEase(lastEaseUsed, easeSpeedForEffectWindowScript, easeSpeedForEffectWindowScript02);\n }\n } \n \n var Ease80Button = layerColumn03.add(\"button\",undefined ,\"80 Ease\");\n Ease80Button.onClick = function(){\n easeSpeedForEffectWindowScript = 80;\n easeSlider.value=80;\n easeSliderValue.text = 80;\n easeSlider02.value=80;\n easeSliderValue02.text = 80;\n if (easeAffectPreviousSelection==true){\n continueAffectingEase(lastEaseUsed, easeSpeedForEffectWindowScript, easeSpeedForEffectWindowScript02);\n }\n }\n \n var Ease60Button = layerColumn03.add(\"button\",undefined ,\"60 Ease\");\n Ease60Button.onClick = function(){\n easeSpeedForEffectWindowScript = 60;\n easeSlider.value=60;\n easeSliderValue.text = 60;\n easeSlider02.value=60;\n easeSliderValue02.text = 60;\n if (easeAffectPreviousSelection==true){\n continueAffectingEase(lastEaseUsed, easeSpeedForEffectWindowScript, easeSpeedForEffectWindowScript02);\n }\n }\n var easeCheckbox = layerColumn02.add(\"checkbox\",undefined ,\"Continue Affect Keys\");\n easeCheckbox.onClick = function(){easeAffectPreviousSelection=easeCheckbox.value};\n /*\n var TestCheck = layerColumn03.add(\"button\",undefined ,\"testCheck\");\n TestCheck.onClick = function(){\n easeSliderArea.maximumSize=[20,20];\n //alert(easeSliderArea.children[2].type);\n //easeSliderArea.remove(3);\n //easeSliderArea.remove(2);\n easeSliderArea.layout.layout(true);\n easeSliderArea.layout.resize(true);\n \n //layerColumn03.easeSliderArea.remove(3);\n \n }\n */\n \n var layerColumn04 = layersTab.add(\"Group\",undefined);\n layerColumn04.alignment = ['left','top'];\n layerColumn04.orientation = 'column';\n layerColumn04.add(\"Button\",undefined ,\"Transform Drift\").onClick = function(){addDrift(addEffectReturn(\"ADBE Geometry2\"))};\n layerColumn04.add(\"Button\",undefined ,\"Stagger Layers\").onClick = function(){staggerLayers(0)};\n layerColumn04.add(\"Button\",undefined ,\"Stagger Working\").onClick = function(){staggerLayers(1)};\n layerColumn04.add(\"Button\",undefined ,\"Fill Working\").onClick = function(){staggerLayers(2)};\n \n var fontColumn01 = fontsTab.add(\"Group\",undefined);\n fontColumn01.alignment = ['left','top'];\n fontColumn01.orientation = 'column';\n fontColumn01.add(\"Button\",undefined ,\"Helvetica\").onClick = function(){changeFontType(\"fontHelvetica\")};\n fontColumn01.add(\"Button\",undefined ,\"Frutiger\").onClick = function(){changeFontType(\"fontFrutiger\")};\n fontColumn01.add(\"Button\",undefined ,\"Futura\").onClick = function(){changeFontType(\"fontFutura\")};\n fontColumn01.add(\"Button\",undefined ,\"Gill\").onClick = function(){changeFontType(\"fontGill\")};\n fontColumn01.add(\"Button\",undefined ,\"Univers\").onClick = function(){changeFontType(\"fontUnivers\")};\n \n var fontColumn02 = fontsTab.add(\"Group\",undefined);\n fontColumn02.alignment = ['left','top'];\n fontColumn02.orientation = 'column';\n fontColumn02.add(\"Button\",undefined ,\"Myriad\").onClick = function(){changeFontType(\"fontMyriad\")};\n fontColumn02.add(\"Button\",undefined ,\"Avenir\").onClick = function(){changeFontType(\"fontAvenir\")};\n fontColumn02.add(\"Button\",undefined ,\"TradeG\").onClick = function(){changeFontType(\"fontTradeG\")};\n fontColumn02.add(\"Button\",undefined ,\"Roboto\").onClick = function(){changeFontType(\"fontRoboto\")};\n \n var fontColumn03 = fontsTab.add(\"Group\",undefined);\n fontColumn03.alignment = ['left','top'];\n fontColumn03.orientation = 'column';\n fontColumn03.add(\"Button\",undefined ,\"Light\").onClick = function(){fontSizeIndexForWindowScript = 1};\n fontColumn03.add(\"Button\",undefined ,\"Med\").onClick = function(){fontSizeIndexForWindowScript = 2};\n fontColumn03.add(\"Button\",undefined ,\"Obli\").onClick = function(){fontSizeIndexForWindowScript = 3};\n fontColumn03.add(\"Button\",undefined ,\"Black\").onClick = function(){fontSizeIndexForWindowScript = 4}; \n \n \n myEffectsPanel.layout.layout(true);\n \n return myEffectsPanel;\n }", "title": "" }, { "docid": "bdd9f33ff54d4c488879c5108d71979e", "score": "0.5784711", "text": "buildUI() {\n this.node.style.width = this.width;\n this.node.innerHTML = '\\\n <div class=\"fw-editabledatagrid-content\">\\\n <div class=\"fw-editabledatagrid-frame\">\\\n <table>\\\n <thead></thead>\\\n <tbody></tbody>\\\n </table>\\\n </div>\\\n <div class=\"fw-editabledatagrid-scroll\"></div>\\\n </div>\\\n <div class=\"fw-editabledatagrid-footer\"></div>';\n this.contentNode = this.node.getElementsByClassName('fw-editabledatagrid-content')[0];\n this.frameNode = this.contentNode.getElementsByClassName('fw-editabledatagrid-frame')[0];\n this.tableNode = this.contentNode.getElementsByTagName('table')[0];\n this.headerNode = this.contentNode.getElementsByTagName('thead')[0];\n this.bodyNode = this.contentNode.getElementsByTagName('tbody')[0];\n this.footerNode = this.node.getElementsByClassName('fw-editabledatagrid-footer')[0];\n this.scrollSpacer = this.node.getElementsByClassName('fw-editabledatagrid-scroll')[0];\n\n this.selectList = document.createElement('div');\n this.selectList.classList.add('fw-editabledatagrid-list');\n this.selectListUl = document.createElement('ul');\n this.selectListUl.classList.add('fw-editabledatagrid-list-ul');\n this.selectList.appendChild(this.selectListUl);\n this.searchList = document.createElement('div');\n this.searchList.classList.add('fw-editabledatagrid-list');\n this.searchListUl = document.createElement('ul');\n this.searchListUl.classList.add('fw-editabledatagrid-list-ul');\n this.searchList.appendChild(this.searchListUl);\n\n this.calculateColumnWidths();\n this.buildHeader();\n this.buildBody();\n this.buildFooter();\n }", "title": "" }, { "docid": "4d2dbab3642870010711a18e0ef64e22", "score": "0.5757946", "text": "renderUI() {\n return null;\n }", "title": "" }, { "docid": "f85207cdd82f6a0500a1526608952f8d", "score": "0.5756564", "text": "function BuildGui() {\n\t\t// Append a new page onto the end of the body. Add for the page a header \n\t\t// and footer.\n\t\t$('#page_body').append(\n\t\t\t'<div data-role=\"page\" id=\"page_main\" data-theme=\"'+Theme+'\" data-content-theme=\"'+Theme+'\">' +\n\t\t\t\t'<div data-role=\"header\" data-position=\"fixed\">' +\n\t\t\t\t\t'<h1>Tight Home Control</h1>' +\n\t\t\t\t\t'<a href=\"#CfgPopupMenu\" data-rel=\"popup\" data-transition=\"slideup\">Cfg</a>' +\n\t\t\t\t\t'<div data-role=\"popup\" id=\"CfgPopupMenu\">' +\n\t\t\t\t\t\t'<ul data-role=\"listview\" data-inset=\"true\">' +\n\t\t\t\t\t\t\t'<li data-role=\"list-divider\">Configurations</li>' +\n\t\t\t\t\t\t\t'<li><a data-role=\"button\" onclick=\"ThemeSwitch()\">Color</a></li>' +\n\t\t\t\t\t\t\t'<li><a data-role=\"button\" onclick=\"GridSwitch()\">Grid</a></li>' +\n\t\t\t\t\t\t'</ul>' +\n\t\t\t\t\t'</div>' +\n\t\t\t\t'</div>' +\n\t\t\t\t'<div data-role=\"content\" id=\"page_main_content\">' +\n\t\t\t\t'</div>' +\n\t\t\t\t'<div data-role=\"footer\" data-position=\"fixed\">' +\n\t\t\t\t\t'<h1>Tight Home Control</h1>' +\n\t\t\t\t'</div>' +\n\t\t\t'</div>');\n\t\n\t\t// Extract the different device groups and initiate the device update\n\t\t// stalling table.\n\t\tvar Groups=[];\n\t\t$.each(DevicesInfo, function(DeviceId, DeviceInfo) {\n\t\t\tif (Groups.indexOf(DeviceInfo[\"group\"])==-1) {\n\t\t\t\tGroups[Groups.length]=DeviceInfo[\"group\"]; }\n\t\t\tStallDeviceUpdates[DeviceId]=false;\n\t\t});\n\t\n\t\t// Generate the groups and within each group the devices. Depending the \n\t\t// grid configuration the generated HTML code is slightly different.\n\t\t$.each(Groups, function(GroupNbr, Group) {\n\t\t\tif (Grid)\n\t\t\t\tvar GroupContent='<div class=\"ui-grid-d my-breakpoint\" id=\"group-content-'+GroupNbr+'\"></div>';\n\t\t\telse\n\t\t\t\tvar GroupContent='<ul data-role=\"listview\" data-inset=\"true\" id=\"group-content-'+GroupNbr+'\"></ul>';\n\t\t\t$('#page_main_content').append(\n\t\t\t\t'<div data-role=\"collapsible\" id=\"group-'+GroupNbr+'\">' +\n\t\t\t\t\t'<h4>'+Group+'</h4>' +\n\t\t\t\t\tGroupContent +\n\t\t\t\t'</div>');\n\t\n\t\t\t$.each(DevicesInfo, function(DeviceId, DeviceInfo) {\n\t\t\t\tif (DeviceInfo[\"group\"]!=Group) {\n\t\t\t\t\treturn 0; // breaks the inner loop\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar ChildId = DeviceId.replace(/[.,]/g,\"_\");\n\t\t\t\tChildId2DeviceId[ChildId] = DeviceId;\n\t\t\t\tvar DeviceType = DeviceInfo[\"type\"];\n\t\t\t\tif (Grid)\n\t\t\t\t\t$(\"#group-content-\"+GroupNbr).append( '<div class=\"ui-block-'+'abcde'[4]+' device_outcontainer\"><div class=\"ui-bar ui-bar-'+Theme+' device_container\" id=\"cont-'+ChildId+'\"></div></div>' );\n\t\t\t\telse\n\t\t\t\t\t$(\"#group-content-\"+GroupNbr).append( '<li class=\"ui-field-contain\" id=\"cont-'+ChildId+'\"></li>' );\n\t\t\t\tDeviceWidget[DeviceType].Create( \"#cont-\"+ChildId, ChildId, DeviceId, DeviceInfo);\n\t\t\t});\n\t\t});\n\t\n\t\t// Initialize the new page \n\t\t$.mobile.initializePage();\n\t\n\t\t// Navigate to the new page\n\t\t$.mobile.changePage(\"#page_main\", \"pop\", false, true);\n\t\t\n\t\t// Apply the right device widget sizes\n\t\tResizeGui();\n\t}", "title": "" }, { "docid": "106b1b18f25a909dfc155a51d0dcfe81", "score": "0.5722808", "text": "function UI() { }", "title": "" }, { "docid": "8dfa3ee03d382857d9d929d1bceebc92", "score": "0.5717072", "text": "function createMainUI(){\r\n windowPalette = new Window(\"palette\",\"Proofing Assistant\");\r\n textMessage = windowPalette.add(\"staticText\");\r\n textMessage.text = \"Select a textbox!\"; \r\n btnAllTextPropties = windowPalette.add(\"button {text:'Show Text Properties'}\");\r\n btnAllTextPropties.onClick = function(){bridgeTalkThis(textListProperties.toString()+\"textListProperties();\");}\r\n \r\n manipulationPanel = windowPalette.add(\"panel {text:'Manipulate Text'}\");\r\n manipulationPanel.preferredSize.width = 200;\r\n manipulationPanel.alignChildren = \"fill\";\r\n btnSelectSameFont = manipulationPanel.add(\"button {text:'Select Same Font'}\");\r\n btnSelectSameFont.onClick = function(){bridgeTalkThis(selectAllSameFont.toString()+\"selectAllSameFont();\");}\r\n btnCombineText = manipulationPanel.add(\"button {text:'Combine Text'}\");\r\n btnCombineText.onClick = function(){bridgeTalkThis(combineText.toString()+\"combineText();\");}\r\n \r\n cosistencyPanel = windowPalette.add(\"panel {text:'Consistent Text'}\");\r\n cosistencyPanel.preferredSize.width = 200;\r\n cosistencyPanel.alignChildren = \"fill\";\r\n btnMakeSizeConsistent = cosistencyPanel.add(\"button {text:'Consistent Size'}\");\r\n btnMakeSizeConsistent.onClick = function(){bridgeTalkThis(makeSizeConsistent.toString()+\"makeSizeConsistent();\");}\r\n btnMakeTrackingConsistent = cosistencyPanel.add(\"button {text:'Consistent Tracking'}\");\r\n btnMakeTrackingConsistent.onClick = function(){bridgeTalkThis(makeTrackingConsistent.toString()+\"makeTrackingConsistent();\");}\r\n btnMakeStrokeConsistent = cosistencyPanel.add(\"button {text:'Consistent Stroke'}\");\r\n btnMakeStrokeConsistent.onClick = function(){bridgeTalkThis(makeStrokeConsistent.toString()+\"makeStrokeConsistent();\");}\r\n btnMakeFillConsistent = cosistencyPanel.add(\"button {text:'Consistent Fill'}\");\r\n btnMakeFillConsistent.onClick = function(){bridgeTalkThis(makeFillConsistent.toString()+\"makeFillConsistent();\");}\r\n \r\n cftPanel = windowPalette.add(\"panel {text:'Custom Foil Export'}\");\r\n cftPanel.preferredSize.width = 200;\r\n cftPanel.alignChildren = \"fill\";\r\n btnExportRGBTIFF = cftPanel.add(\"button {text:'Export RGB'}\");\r\n btnExportRGBTIFF.onClick = function(){bridgeTalkThis(exportTIFFRGB.toString()+\"exportTIFFRGB();\");}\r\n btnExportCMYKTIFF = cftPanel.add(\"button {text:'Export CMYK'}\");\r\n btnExportCMYKTIFF.onClick = function(){bridgeTalkThis(exportTIFFCMYK.toString()+\"exportTIFFCMYK();\");}\r\n\r\n windowPalette.show();\r\n}", "title": "" }, { "docid": "aec3079e96adfdf589f4dbaf25b004ae", "score": "0.57043266", "text": "function createUserControls() {\n colorPicker = createColorPicker(color(COLOR_PICKER_DEFAULT));\n sizePicker = createSlider(\n SIZE_PICKER_MIN, SIZE_PICKER_MAX,\n SIZE_PICKER_DEFAULT, SIZE_PICKER_STEP\n );\n sizePicker.addClass('slider');\n repeatPicker = createSlider(\n REPEAT_PICKER_MIN, REPEAT_PICKER_MAX,\n REPEAT_PICKER_DEFAULT, REPEAT_PICKER_STEP\n );\n repeatPicker.addClass('slider');\n\n repeatPicker.input(onRepeatSliderChange);\n sizePicker.input(onBrushSizeSliderChange);\n colorPicker.input(onColorChange);\n\n colorPicker.parent(USER_CONTROLS);\n (createSpan(translations.en.brushSize)).parent(USER_CONTROLS);\n sizePicker.parent(USER_CONTROLS);\n (createSpan(translations.en.repeatNum)).parent(USER_CONTROLS);\n repeatPicker.parent(USER_CONTROLS);\n\n // undoButton = createButton(translations.en.undo);\n // undoButton.parent(USER_CONTROLS);\n // undoButton.mouseReleased(onUndo);\n\n saveButton = createButton(translations.en.save);\n saveButton.parent(USER_CONTROLS);\n saveButton.mouseReleased(onSave);\n}", "title": "" }, { "docid": "fa58e6a1e1fc4d383894de4509fe4a6c", "score": "0.567695", "text": "function initializeUI()\n{\n\tvar niceNameSrcArray = new Array();\n\tvar nameArray;\n\tvar i;\n\tvar selTag = \"\";\n\tvar imgSrcArray = new Array();\n\tvar endsWithZero = /\\[0\\]$/; //ref ends with [0]\n\t\n\t// Determine if RESTORE is an option. If not, remove UI for it\n\t// the dw.getBehaviorTag() check ensures the checkbox\n\t// is not available if a behavior is attached to a timeline\n\n\tvar removeCheckbox = false;\n\t\n\tif (!dw.getBehaviorTag()) //if behavior is in a timeline\n\t{\n\t\tremoveCheckbox = true;\n\t}\n\telse\n\t{\n\t\tif (dw.getBehaviorElement())\n\t\t\tselTag = dw.getBehaviorElement().tagName;\n\t\n\t\tif (!selTag)\n\t\t\tselTag = getSelectionTag();\n\t\n\t\tif (selTag != \"A\" && selTag != \"IMG\" && selTag != \"AREA\") //if sel not A or IMG\n\t\t\tremoveCheckbox = true;\n\t}\n\t\n\tif (removeCheckbox)\n\t{\n\t\tvar theObj = dwscripts.findDOMObject(\"restoreOption\");\n\t\tif (theObj)\n\t\t\ttheObj.outerHTML = \"\"; //remove restoreOption checkbox\n\t}\n\n\t// Default preload flag is 1 (preload);\n\t\n\tOLD_PRELOAD_ID = 1;\n\tOLD_PRELOAD_ARRAY = new Array();\n\t\n\tdocument.theForm.preload.checked = (OLD_PRELOAD_ID != 0);\n\n\tcreateObjRefs();\n\t\n\t// Search for unreferenceable objects. <DIV id=\"foo\"> is IE only, <LAYER> is NS only.\n\t// if REF_CANNOT found, return empty string, and use IE refs for nice namelist.\n\t\n\tfor (i = 0; i < document.MM_NS_REFS.length; i++)\n\t{\n\t\tif (document.MM_NS_REFS[i].indexOf(REF_CANNOT) == 0)\n\t\t\tdocument.MM_NS_REFS[i] = \"\"; //blank it out\n\t\n\t\tniceNameSrcArray[i] = document.MM_NS_REFS[i].replace(endsWithZero, \"\"); //if foo[0], display as foo\n\t}\n\t\n\tnameArray = niceNames(niceNameSrcArray, MM.TYPE_Image);\n\t\n\tfor (i = 0; i < nameArray.length; i++)\n\t{\n\t\tdocument.theForm.menu.options[i] = new Option(nameArray[i]); //load menu\n\t\timgSrcArray[i] = \"\";\n\t}\n\t\n\tpickSelectedImage(); //if an image is selected, selects it in the picklist\n\tdocument.MM_myImgSrcs = imgSrcArray; //set global\n\n\tdocument.theForm.imgSrc.focus(); //set focus on textbox\n\tdocument.theForm.imgSrc.select(); //set insertion point into textbox\n}", "title": "" }, { "docid": "478a66caad7377a2ac53237514e2584f", "score": "0.5663543", "text": "function UI() {}", "title": "" }, { "docid": "478a66caad7377a2ac53237514e2584f", "score": "0.5663543", "text": "function UI() {}", "title": "" }, { "docid": "478a66caad7377a2ac53237514e2584f", "score": "0.5663543", "text": "function UI() {}", "title": "" }, { "docid": "478a66caad7377a2ac53237514e2584f", "score": "0.5663543", "text": "function UI() {}", "title": "" }, { "docid": "478a66caad7377a2ac53237514e2584f", "score": "0.5663543", "text": "function UI() {}", "title": "" }, { "docid": "478a66caad7377a2ac53237514e2584f", "score": "0.5663543", "text": "function UI() {}", "title": "" }, { "docid": "2eace12eadd421d2b0e5f9662b9e1134", "score": "0.5655747", "text": "function buildInterface() {\n\n var header = $(\"<div id='merge_ui_header' />\");\n\n config_select = $(\"<select id='config_select' style='margin: 10px;' />\").change(function() {\n if ( $(this).val() !== '' ) {\n loadRuleset($(this).val());\n }\n });\n\n masterSelectionRulesPanel = $(\"<table id='master_selection_rules' style='margin: 10px 0;' />\");\n\t\tvar saveBtn = $(\"<span>Save Rule Set</span>\").button().click(saveFieldRules);\n var exportBtn = $(\"<span>Export Rule Set</span>\").button().click(exportRuleset);\n var importBtn = $(\"<span>Import Rule Set</span>\").button().click(importRuleset);\n\n var masterHeader = $(\"<thead><tr><th>Sort Field</th><th>Sort Type</th><th id='actions'></th></tr></thead>\");\n var addLink = $(\"<span>Add Master Sort Field</span>\").button().click(function() {\n addMasterFieldSelector(\"createdDate\", \"descending\");\n });\n\n $(masterSelectionRulesPanel).append(masterHeader);\n\n var recalculateMaster = $(\"<span align='center'>Select Master</span>\")\n .button().click(function() {\n selectMaster();\n applyFieldSelectionRules();\n });\n\n var ruleName = $(\"<label style='margin: 10px;'>Ruleset Name: <input type='text' id='client_name' value='Default' />\");\n var toggleStaticFieldsBtn = $(\"<span align='center'>Show/Hide Static Fields</span>\").button().click(toggleNonInputRows);\n\n $(\"#mergeDescription\").append(\"<label style='margin: 10px;'>Select Merge Rule Set</label>\")\n .append(config_select)\n .append(ruleName)\n .append(saveBtn)\n .append(exportBtn)\n .append(importBtn);\n\n var recalculateFieldRules = $(\"<span align='center'>Re-Apply Field Rules</span>\").button().click(applyFieldSelectionRules);\n\n var headerTitle = $(\"<h4>Master Record Sort Order</h4>\").css(\"padding-left\", \"28px\").css(\"outline\", \"none\");\n var accordionBody = $(\"<div />\").append(masterSelectionRulesPanel).append(addLink).append(recalculateMaster);\n $(header).append(headerTitle).append(accordionBody);\n $(\"#mergeDescription\").append(header);\n $(header).accordion({\n collapsible: true,\n active: false,\n heightStyle: \"content\"\n }).css(\"width\", \"auto\");\n\n var fieldActions = $(\"<div style='clear: both;' />\").append(toggleStaticFieldsBtn).append(recalculateFieldRules);\n $(\".mergeactions\").append(fieldActions);\n\n // render rule dropdowns\n $(\".detailList tr:has(input)\").each(function(i) {\n var labelCell = $(this).find(\"td.labelCol\");\n var label = $(labelCell).text().trim();\n $(this).find(\"td.labelCol\").html(\"<div class='fieldName'>\" + label + \"</div>\");\n\n var section = $(this).parent().prev().find(\"h4\").text().trim();\n label = section + \" - \" + label;\n var cell = $(\"<td nowrap='nowrap' class='field_rule' name='\" + label + \"' />\");\n\n var input = $(\"<select class='fieldRule' field_name='\" + label + \"' />\");\n var populateBlanks = $(\"<label><input field_name='\" + label + \"' type='checkbox' checked class='populate_blanks' /> Fill Blanks</label>\")\n .change(function() {\n saveFieldRules();\n applyRuleTo(label);\n });\n\n $(input).append(\"<option value='master'>Master</option>\")\n .append(\"<option value='newest-record'>Newest Record</option>\")\n .append(\"<option value='oldest-record'>Oldest Record</option>\")\n .append(\"<option value='newest-value'>Value Descending</option>\")\n .append(\"<option value='oldest-value'>Value Ascending</option>\")\n .append(\"<option value='len-asc'>Char Length Ascending</option>\")\n .append(\"<option value='len-dec'>Char Length Descending</option>\")\n .append(\"<option value='field'>Field Link</option>\");\n\n\n $(input).change(function() {\n fieldRules[label].rule = $(this).val();\n console.log($(this).val());\n if ( $(this).val() === \"field\" ) {\n $(cell).find(\"select.linkedField\").show();\n }\n else {\n $(cell).find(\"select.linkedField\").hide();\n }\n applyRuleTo(label);\n saveFieldRules();\n });\n\n var linkedFieldInput = $(\"<select class='linkedField' />\").hide();\n // append options for all fields\n\n\n\n $(cell).append(input).append(linkedFieldInput).append(populateBlanks);\n $(this).append(cell);\n });\n\n $(\"#masterselect .contacthead\").addClass('data_column');//.css(\"height\", \"120px\");\n $(\"#masterselect > div\").css(\"height\", \"auto\");\n $(\".mergeactions\").css(\"border\", \"none\");\n //$(\".mergeactions\");//.css(\"height\", \"128px\");\n $(\".scrollcontainer\").css('height', 'auto').css('width', 'auto');\n $(\"#mergefields .mergecell\").css('width', '230px');\n $(\"#masterselect\").css(\"width\", \"auto\");//.find(\".clearingBox\").remove();\n $(\".information\").remove();\n //$(\".mergeactions\").css(\"width\", $(\".labelCol:first\").width() + \"px\");\n toggleNonInputRows();\n }", "title": "" }, { "docid": "8a5b7faa6bcb97511961f49bf39d931d", "score": "0.5649697", "text": "function buildUI() {\n setPageTitle();\n fetchProfile();\n initMap();\n getLocation();\n}", "title": "" }, { "docid": "ba489b8bb134cec5cd905b12ac54ec55", "score": "0.5647434", "text": "function UI(){}", "title": "" }, { "docid": "ba489b8bb134cec5cd905b12ac54ec55", "score": "0.5647434", "text": "function UI(){}", "title": "" }, { "docid": "ba489b8bb134cec5cd905b12ac54ec55", "score": "0.5647434", "text": "function UI(){}", "title": "" }, { "docid": "6f55704caa201c3ad7a3b04cdbc02fc0", "score": "0.5609899", "text": "function JoubelUI() {}", "title": "" }, { "docid": "6f55704caa201c3ad7a3b04cdbc02fc0", "score": "0.5609899", "text": "function JoubelUI() {}", "title": "" }, { "docid": "4f4c1ca4deae160a60642e5a50c14f50", "score": "0.55896896", "text": "function buildGui(){\n\t\tclearGui();\n\t\tgui.add(settings, \"AddNew\").name(\"Aggiungi Nuova Annotazione\");\n\t\tUpdateAnnotazioniGUI();\n\t}", "title": "" }, { "docid": "87afedde175d7e6297b030ae438cddce", "score": "0.55803806", "text": "function initGUIWindow()\n{\n\tlet summaryWindow = Engine.GetGUIObjectByName(\"summaryWindow\");\n\tsummaryWindow.sprite = g_GameData.gui.dialog ? \"ModernDialog\" : \"ModernWindow\";\n\tsummaryWindow.size = g_GameData.gui.dialog ? \"16 24 100%-16 100%-24\" : \"0 0 100% 100%\";\n\tEngine.GetGUIObjectByName(\"summaryWindowTitle\").size = g_GameData.gui.dialog ? \"50%-128 -16 50%+128 16\" : \"50%-128 4 50%+128 36\";\n\tEngine.GetGUIObjectByName(\"fadeImage\").hidden = !g_GameData.gui.dialog;\n}", "title": "" }, { "docid": "44bb5ac19a2db0a6288522862aa3504b", "score": "0.5573805", "text": "function UI() {\n }", "title": "" }, { "docid": "715d63e8c5e238df5cb48150832b794c", "score": "0.5556241", "text": "function newAceUIw(callObj) {\n\t\tvar aceUI = callObj.aceUI,\n\t\t\taceID = callObj.aceID,\n\t\t\tuiType = callObj.uiType,\n\t\t\tdomElement = callObj.domElement,\n\t\t\tuiWidgetObj = ACE.ace(uiType);\n\t\t\t\n\t\tvar widgetName = uiWidgetObj.get(\"objName\"),\n\t\t\twidgetLib = \"jquery\"; // uiWidgetObj.get(\"library\"); // Fix. Include alternative widget libraries.\n\t\t\n\t\tif (widgetLib == \"jquery\") { // Fix. Full widget code should be associated with the relevant uiType and instantiated automatically.\n\t\t\t// Fix! This should check/import the code and register it to jQueryUI, calling it afterwards.\n\t\t\tif (widgetName == \"AceObjUI\") {\n\t\t\t\tdomElement.AceObjUI({\"aceUI\":aceUI});\n\t\t\t} else if (widgetName == \"AceBtnUI\") {\n\t\t\t\tdomElement.AceBtnUI({\"aceUI\":aceUI});\n\t\t\t} else if (widgetName == \"AceHovUI\") {\n\t\t\t\tdomElement.AceHovUI({\"aceUI\":aceUI});\n\t\t\t} else if (widgetName == \"AceEditUI\") {\n\t\t\t\tdomElement.AceEditUI({\"aceUI\":aceUI});\n\t\t\t} else if (widgetName == \"AceExportBtnUI\") {\n\t\t\t\tdomElement.AceExportBtnUI({\"aceUI\":aceUI});\n\t\t\t} else {\n\t\t\t\t\n\t\t\t}\n\t\t} else if (widgetLib == \"dojo\") {\n\t\t\t// Fix. Complete this.\n\t\t} else {\n\t\t\t// Fix. Default functionality, error handling, notification.\n\t\t}\n\t\t\n\t\treturn domElement.data(widgetName); // Fix. Error checking, ensure returns correctly.\n\t}", "title": "" }, { "docid": "8d8a3d86602ea4b88bf2a0dbdea1df52", "score": "0.55185145", "text": "function CreateWindow() {\n h = createDomElement({name: \"div\"});\n h.innerHTML = projectObject;\n new Compressed_layout(\"window_body_left_bottom\", \"container\", h).init();\n}", "title": "" }, { "docid": "3ca70f63800496918b5b9192e24966a0", "score": "0.551265", "text": "createUI(layout) {\n const GrpcMng = require('../../grpc/grpc_mng');\n const blessed = require('blessed');\n // main dialog\n let attr = Object.assign(layout, {\n width: 42, height: 17,\n });\n let dlg = this.createFormWindow(this.title, attr);\n let form = dlg.insideForm;\n // layout variables\n this._ = new Object();\n this._.row_w = form.width-2;\n this._.row_w_half = parseInt(this._.row_w/2);\n this._.row_w_quater = parseInt(this._.row_w/4);\n this._.row_top = 1;\n this._.row_step = 2;\n this._.text_max_w = 7;\n this._.input_w = this._.row_w_half - this._.text_max_w - 2;\n this._.c = []; // position data of component in each column\n this._.c.push(new Object()); // 1st column\n this._.c[0].input_l = this._.row_w_half - 1 - this._.input_w; // input component's left position\n this._.c[0].txt_r = this._.row_w_half + 1 + this._.input_w + 1; // text component's right position\n this._.c.push(new Object()); // 2nd column\n this._.c[1].input_l = this._.row_w - 1 - this._.input_w; // input component's left position\n this._.c[1].txt_r = 1 + this._.input_w + 1; // text component's right position\n this._.nm = new Object(); // name => form-element mapping\n //process.exit(0);\n // input element\n this.createTextInputRow(dlg, form, 0, 'Acc.', 'acc');\n this.createTextSelRow(dlg, form, 1, 'Market', new Map([\n [GrpcMng.tradeSvcNs.EnumMarket.ANY,'ANY'], \n [GrpcMng.tradeSvcNs.EnumMarket.HK,'HK'],\n [GrpcMng.tradeSvcNs.EnumMarket.US,'US']\n ]), null);\n this._.row_top += this._.row_step;\n this.createTextInputRow(dlg, form, 0, 'Symbol');\n this.createTextInputRow(dlg, form, 1, 'Qty.', 'quantity');\n this._.row_top += this._.row_step;\n this.createTextInputRow(dlg, form, 0, 'Px.', 'price');\n this.createTextInputRow(dlg, form, 1, 'Stp.Px.', 'stopPrice');\n this._.row_top += this._.row_step;\n this.createTextSelRow(dlg, form, 0, 'Type', new Map([\n [GrpcMng.tradeSvcNs.Order.EnumType.LIMIT,'Limit'],\n [GrpcMng.tradeSvcNs.Order.EnumType.MARKET,'Market'],\n [GrpcMng.tradeSvcNs.Order.EnumType.STOP_LIMIT,'Stop Limit(Stp.L)'], \n [GrpcMng.tradeSvcNs.Order.EnumType.STOP_MARKET,'Stop Market(Stp.M)'],\n [GrpcMng.tradeSvcNs.Order.EnumType.TRAIL_STOP_LIMIT,'Trail Stop Limit(Tra.L)'],\n [GrpcMng.tradeSvcNs.Order.EnumType.TRAIL_STOP_MARKET,'Trail Stop Market(Tra.M)']\n ]));\n this.createTextSelRow(dlg, form, 1, 'TIF', new Map([\n [GrpcMng.tradeSvcNs.Order.EnumTif.DAY,'DAY'],\n [GrpcMng.tradeSvcNs.Order.EnumTif.IOC,'IOC/FAK'], \n [GrpcMng.tradeSvcNs.Order.EnumTif.FOK,'FOK'],\n [GrpcMng.tradeSvcNs.Order.EnumTif.AT_CROSS,'At Crossing(Cross)']\n ]));\n this._.row_top += this._.row_step;\n this.createTextSelRow(dlg, form, 0, 'L/S', new Map([\n [GrpcMng.tradeSvcNs.EnumLongShort.LONG,'Long'],\n [GrpcMng.tradeSvcNs.EnumLongShort.SHORT,'Short']\n ]), null, 'longShort');\n this.createTextInputRow(dlg, form, 1, 'Text');\n this._.row_top += this._.row_step;\n this.createTextInputRow(dlg, form, 0, 'ID');\n this.createTextInputRow(dlg, form, 1, 'Clt.ID', 'clientOrderId');\n this._.row_top += this._.row_step;\n // submit button\n this._.btn_open = this.createBtn('Open', {\n parent: form, name: 'open', align:'center',\n top:this._.row_top, right: 11\n });\n this._.btn_open.on('press', ()=>{ form.submit(); });\n this._.btn_close = this.createBtn('Close', {\n parent: form, name: 'close', align:'center',\n top:this._.row_top, right: 1\n });\n this._.btn_close.on('press', ()=>{ form.submit(); });\n // on submit\n form.on('submit', (data)=>{\n if (this._.mode == 'input') {\n const req = {};\n req.order = {};\n this.data2Order(req.order, data);\n req.order.open_close = data.open? GrpcMng.tradeSvcNs.EnumOpenClose.OPEN : GrpcMng.tradeSvcNs.EnumOpenClose.CLOSE;\n bilog(`orderNewSingle sending,\\n\\trequest=${JSON.stringify(req)}`);\n GrpcMng.tradeClient.orderNewSingle(req, (err, rsp)=>{\n if (err) {\n bwlog(`orderNewSingle failed,\\n\\terr=${err.toString()}`);\n this.showError(err.toString());\n } else {\n const GrpcEnumFix = require('../../grpc/grpc_enum_fix');\n GrpcEnumFix.fixOrder(rsp);\n bilog(`orderNewSingle ok, \\n\\treply=${JSON.stringify(rsp)}`);\n this.showMsg('Success!');\n }\n });\n } else if (this._.mode == 'amend') {\n const req = {};\n req.order = {};\n this.data2Order(req.order, data);\n req.old_order = this._.order;\n req.order.open_close = req.old_order.open_close;\n let isAmend = data.open;\n if (isAmend) {\n bilog(`orderAmendSingle sending,\\n\\trequest=${JSON.stringify(req)}`);\n GrpcMng.tradeClient.orderAmendSingle(req, (err, rsp)=>{\n if (err) {\n bwlog(`orderAmendSingle failed,\\n\\terr=${err.toString()}`);\n this.showError(err.toString());\n } else {\n const GrpcEnumFix = require('../../grpc/grpc_enum_fix');\n GrpcEnumFix.fixOrder(rsp);\n bilog(`orderAmendSingle ok, \\n\\treply=${JSON.stringify(rsp)}`);\n this.showMsg('Success!');\n }\n });\n } else {\n bilog(`orderCancelSingle sending,\\n\\trequest=${JSON.stringify(req)}`);\n GrpcMng.tradeClient.orderCancelSingle(req, (err, rsp)=>{\n if (err) {\n bwlog(`orderCancelSingle failed,\\n\\terr=${err.toString()}`);\n this.showError(err.toString());\n } else {\n const GrpcEnumFix = require('../../grpc/grpc_enum_fix');\n GrpcEnumFix.fixOrder(rsp);\n bilog(`orderCancelSingle ok, \\n\\treply=${JSON.stringify(rsp)}`);\n this.showMsg('Success!');\n }\n });\n }\n }\n });\n return dlg;\n }", "title": "" }, { "docid": "6501cc2988bec259d526e8051807f3ac", "score": "0.55115193", "text": "function UI(ops) {\n\tif(!ops) ops = {maxNameLength: 30, maxUrlLength: 30, visible: false, minZ: -1e6, maxZ: 1e6};\n\n\t// Configurable variables\n\tthis.maxNameLength = ops.maxNameLength;\n\tthis.maxUrlLength = ops.maxUrlLength;\n\tthis.visible = ops.visible;\n\tthis.minZ = ops.minZ;\n\tthis.maxZ = ops.maxZ;\n\n\tthis.frame = undefined;\n\tthis.browser = undefined;\n\tthis.bound = false;\n\tthis.hoverState = false;\n\tthis.content = {}; // will contains links and html.\n\n\t/*\n\t\tUI.load:\n\t\t\tLoads content required to assemble the Shrub UI. (links & interface)\n\t\t\tIf XML has already been loaded, it will not reload. This means that\n\t\t\tload can also be called multiple times to reload the links.\n\t*/\n\tthis.load = function(ops) {\n\t\tif(!ops || !ops.callback) return -1; // If ops is undefined later on, it'll throw an error.\n\n\t\tlet context = this; // required to get access 'this' from the correct scope later\n\n\t\tif(!this.content.html) {// This will load the file 'html/ui.html' into 'content', where it can later be used.\n\t\t\tloadXML({\n\t\t\t\tcallback: function(response) {\n\t\t\t\t\tcontext.content.html = response;\n\t\t\t\t\t// If the links are also loaded, we can progress to the next assembly step.\n\t\t\t\t\tif(context.content.links) {\n\t\t\t\t\t\tops.callback.call(context);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tpath: \"/html/ui.html\"\n\t\t\t});\n\t\t}\n\n\t\t// This asks background.js for the links we want to display, and stores them in 'content'.\n\t\tfetchLinks({\n\t\t\tcallback: function(response) {\n\t\t\t\tcontext.content.links = response;\n\t\t\t\t// If the html has been loaded, we can progress to the next assembly step.\n\t\t\t\tif(context.content.html) {\n\t\t\t\t\tops.callback.call(context);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t};\n\t/*\n\t\tUI.build:\n\t\t\tAssembles the previously loaded content into an injectable DOM structure.\n\t\t\tIf build has been called before (this.frame !== undefined), we only want to\n\t\t\treassemble the link structure.\n\t*/\n\tthis.build = function() {\n\t\tthis.frame = document.createElement('div');\n\t\tthis.frame.id = 'shrub-injection-frame';\n\t\tthis.frame.innerHTML = this.content.html;\n\n\t\t// We will later on need a reference to the browser.\n\t\tfor(var n = 0; n < this.frame.children.length; n++)\n\t\t\tif(this.frame.children[n].id === 'shrub-browser') this.browser = this.frame.children[n];\n\n\t\tlet ctx = this;\n\n\t\tthis.browser.onmouseover = function() { // Due to bind running asynchronously, this cannot be called from it.\n\t\t\tctx.hoverState = true;\n\t\t\tif(document.body) document.body.style.overflow = 'hidden';\n\t\t}\n\n\t\tthis.browser.onmouseout = function() {\n\t\t\tctx.hoverState = false;\n\t\t\tif(document.body) document.body.style.overflow = 'scroll';\n\t\t}\n\n\t\tthis.toggle(this.visible); // We want the UI to be in the right state when this starts.\n\t\tthis.buildLinks();\n\t};\n\t/*\n\t\tUI.buildLinks:\n\t\t\tRemoves old links from the browser, and populates it with whatever links are present in\n\t\t\tcontent.links.\n\t*/\n\tthis.buildLinks = function() {\n\t\t// First, we have to purge our existing links:\n\t\twhile(this.browser.lastChild) { // While children exist, remove them.\n\t\t\tthis.browser.removeChild(this.browser.lastChild);\n\t\t}\n\n\t\tthis.content.links.forEach((elem) => {\n\t\t\tthis.addLink(elem.name, elem.url);\n\t\t});\n\t};\n\t/*\n\t\tUI.addLink\n\t\t\t\tAdds a link to the browser. Takes a name and url.\n\t*/\n\tthis.addLink = function(name, url) {\n\t\tlet link = document.createElement('div');\n\t\tlet text = document.createElement('div');\n\t\tlet header = document.createElement('p');\n\t\tlet cutUrl = document.createElement('p');\n\t\tlet length = url.length;\n\n\t\tlink.setAttribute('class', 'shrub-browser-link');\n\t\tlink.setAttribute('shrub-data-path', url);\n\t\ttext.setAttribute('class', 'shrub-browser-link-text');\n\t\theader.setAttribute('class', 'shrub-link-header');\n\t\theader.innerHTML = name.length < this.maxNameLength ? name : (name.substring(0, this.maxNameLength - 3) + \"...\");\n\t\tcutUrl.innerHTML = length < this.maxUrlLength ? url : (\"...\" + url.substring(length - this.maxUrlLength + 3, length));\n\n\t\ttext.appendChild(header);\n\t\ttext.appendChild(cutUrl);\n\n\t\tlink.appendChild(text);\n\n\t\t// Now that the link has been fully put together, we need to attach it to the click handler.\n\t\tlink.addEventListener('click', this.clickHandler);\n\n\t\tthis.browser.appendChild(link);\n\t};\n\t/*\n\t\tUI.bind:\n\t\t\tAttaches event handlers for UI interaction.\n\t*/\n\tthis.bind = function(ops) {\n\t\tif(!ops || !ops.callback) return; // We need to have a callback so that we can try to inject the ui after binding.\n\n\t\tlet ctx = this; // We need a context later to call toggle on.\n\n\t\tbindShortcut({\n\t\t\tkeys: ['AltLeft', 'AltRight'],\n\t\t\tcallback: () => this.toggle.call(ctx)\n\t\t});\n\n\t\tdocument.addEventListener('click', function() {\n\t\t\tif(!ctx.hoverState) {\n\t\t\t\tctx.toggle(false);\n\t\t\t}\n\t\t});\n\n\t\tthis.bound = true;\n\t\tops.callback();\n\t};\n\t/*\n\t\tUI.inject:\n\t\t\tInjects the assembled content into the parent element (probably 'document.body').\n\t*/\n\tthis.inject = function(parent) {\n\t\tif(parent && this.frame) { // If the page isn't loaded when inject is called, it won't do anything (parent will be undefined)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t // The same is true if the frame isn't loaded yet.\n\t\t\tparent.appendChild(this.frame); // Inject the injection frame into the parent.\n\t\t}\n\t};\n\t/*\n\t\tUI.clickHandler:\n\t\t\tStandard link followthrough implementation.\n\t*/\n\tthis.clickHandler = function() {\n\t\tlocation.href = this.getAttribute('shrub-data-path');\n\t};\n\t/*\n\t\tUI.toggle:\n\t\t\tOptionally takes the toggle state. Changes the UI visibility.\n\t*/\n\tthis.toggle = function(state) {\n\t\tif(state === undefined) state = !this.visible;\n\t\tthis.visible = state;\n\t\tif(state) {\n\t\t\tthis.frame.style.zIndex = this.maxZ;\n\t\t\tthis.frame.style.visibility = 'visible';\n\t\t} else {\n\t\t\tthis.frame.style.zIndex = this.minZ;\n\t\t\tthis.frame.style.visibility = 'hidden';\n\t\t}\n\t};\n}", "title": "" }, { "docid": "b47f67c24433fd25719c317d822a71d6", "score": "0.5506414", "text": "function gui()\n{\n\tui_clear();\t\t// clean up the User interface before drawing a new one.\n\tui_add_ch_selector(\"chLin\", \"LIN\", \"LIN\");\n\n\tui_add_txt_combo(\"linSpec\", \"LIN Specification\");\n\t\tui_add_item_to_txt_combo(\"LIN 1.x\");\n\t\tui_add_item_to_txt_combo(\"LIN 2.x\", true);\n\n\tui_add_separator();\n\tui_add_info_label(\"Hex view options:\", 1);\n\n\tui_add_txt_combo(\"hexView\", \"Include in HEX view:\");\n\tui_add_item_to_txt_combo(\"DATA fields only\", true);\n\tui_add_item_to_txt_combo(\"DATA and ID fields only\", false);\n\tui_add_item_to_txt_combo(\"Everything\", false);\n}", "title": "" }, { "docid": "3a01368cf319958027b2d4fe1d2d8c38", "score": "0.5479666", "text": "loadStartUI() {\n // container for start menu UI\n const startBox = this.add\n .rectangle(0, 0, 420, 400)\n .setStrokeStyle(4, 0xffffff)\n .setOrigin(0.5, 0.5)\n .setFillStyle(0x0, 0.8);\n\n const startText = new CustomText(\n this,\n 0,\n 130,\n `start lvl ${this.level}!`,\n \"l\",\n \"c\",\n () => {\n this.currentMenu.destroy();\n this.loadOptInDataCollection();\n }\n );\n\n const gameTitle = new CustomText(\n this,\n 0,\n -160,\n \"bouncy balls!\",\n \"l\",\n \"c\"\n ).setShadow(0, 0, \"#fff\", 4);\n\n const t1 = new CustomText(\n this,\n 0,\n -80,\n \"collect all bouncy balls\\nmouse/touch to control\\nselect a theme:\"\n );\n\n const theme1 = new CustomText(this, -90, 5, \"RGB\", \"l\", \"c\", () =>\n this.chooseTheme(\"rgb\")\n );\n const theme2 = new CustomText(this, 90, 5, \"sea\", \"l\", \"c\", () =>\n this.chooseTheme(\"sea\")\n );\n const theme3 = new CustomText(this, -90, 65, \"forest\", \"l\", \"c\", () =>\n this.chooseTheme(\"forest\")\n );\n const theme4 = new CustomText(this, 90, 65, \"space\", \"l\", \"c\", () =>\n this.chooseTheme(\"space\")\n );\n\n const t2 = new CustomText(\n this,\n 0,\n 180,\n \"a game by ryshaw, made w/ phaser 3\",\n \"s\",\n \"c\"\n );\n\n this.currentMenu = this.add\n .container(this.width * 0.5, this.height * 0.5, [\n startBox,\n startText,\n gameTitle,\n t1,\n theme1,\n theme2,\n theme3,\n theme4,\n t2,\n ])\n .setDepth(1);\n\n // upscale all objects currently created, if on mobile\n this.children.getChildren().forEach((object) => {\n object.scale = this.scaleRatio;\n });\n }", "title": "" }, { "docid": "d6cbe290752adf85a42a5b41a424bfd2", "score": "0.54719603", "text": "function HTMLUI() {\n}", "title": "" }, { "docid": "e55698681bb114412b0f71c24efaf828", "score": "0.5466716", "text": "getGui() {\n return this.parent.createElement('div');\n }", "title": "" }, { "docid": "04808ae0853fc520675074995069a0c5", "score": "0.5463571", "text": "function initializeUI()\r\n{\r\n\r\n}", "title": "" }, { "docid": "c77989424b2cbe7330bead1c78ea9ca3", "score": "0.5460216", "text": "initializeUI() {\n\n // Initialize all applications\n for ( let [k, cls] of Object.entries(CONFIG.ui) ) {\n ui[k] = new cls();\n }\n\n // Render some applications\n ui.nav.render(true);\n ui.notifications.render(true);\n ui.sidebar.render(true);\n ui.players.render(true);\n ui.hotbar.render(true);\n ui.webrtc.render(true);\n ui.pause.render(true);\n }", "title": "" }, { "docid": "260b2fb739e103fcb50532ba49926c2b", "score": "0.54516006", "text": "function BuildSupportWindow(oTree){\n \n $('#body').empty();\n \n var oElementHeader = document.createElement('header');\n var oElementNavigate = document.createElement('nav');\n var oElementContet = document.createElement('section');\n \n document.body.appendChild(oElementHeader);\n document.body.appendChild(oElementNavigate);\n document.body.appendChild(oElementContet);\n \n var iWindowWidth = window.innerWidth;\n \n $('header').css({\n width: iWindowWidth - parseInt($('nav').css('width')) - 18 + 'px'\n });\n \n $('section').css({\n width: iWindowWidth - parseInt($('nav').css('width')) - 18 + 'px',\n });\n \n $('header').text(\"Hier werden später immer die aktuellen Tickets angezeigt\");\n \n $('section').text(\"Hier kommt die Tätigkeiten hin. Und auch Listen zum Beispiel User\");\n \n SetWorkList(oTree);\n }", "title": "" }, { "docid": "cc25c82053f27493b4b91b5026cf0019", "score": "0.5449781", "text": "function makeUI(local=false){\n\tdocument.getElementById('UIcontainer').style.visibility = 'hidden';\n\tif (!local){\n\t\tinitGUIScene();\n\t\tif (!GUIParams.animating) animateGUI();\n\t}\n\t\n\tconsole.log(\"waiting for GUI init...\")\n\tclearInterval(GUIParams.waitForInit);\n\n\tGUIParams.waitForInit = setInterval(function(){ \n\t\tvar ready = confirmGUIInit();\n\t\tif (ready){\n\t\t\tconsole.log(\"GUI ready.\")\n\t\t\tclearInterval(GUIParams.waitForInit);\n\t\n\t\t\tif (GUIParams.cameraNeedsUpdate) updateGUICamera();\n\t\t\tcreateUI();\n\t\t}\n\t}, 1000);\n\n\n\t// check that all the expected DOM elements exist in the GUI\n\tGUIParams.waitForBuild = setInterval(function(){\n\t\tvar ready = confirmGUIBuild(GUIParams.GUIState);\n\t\t// check also that the width has stabilized\n\t\tvar width = document.getElementById('UIcontainer').getBoundingClientRect().width;\n\t\tif (width != GUIParams.GUIWidth || width < 10) ready = false;\n\t\tGUIParams.GUIWidth = width;\n\t\tif (ready){\n\t\t\tclearInterval(GUIParams.waitForBuild);\n\t\t\tfinalizeGUIInitialization();\n\t\t\t// reveal the result!\n\t\t\tdocument.getElementById('UIcontainer').style.visibility = 'visible'\n\t\t\t// handle detached socket case, draw a cube\n\t\t\tif (!local) {\n\t\t\t\tcreateCube();\n\t\t\t\tsendToViewer([{'clearloading':true}]);\n\t\t\t\tshowSplash(false);\n\t\t\t}\n\t\t\telse clearloading(true);\n\t\t}\n\t},1500);\n}", "title": "" }, { "docid": "c1fc2ae2786547d2202457a15da4d0e2", "score": "0.54442453", "text": "function UIcanvas(){\n // new elements need to added here\n // TODO set variables to private\n this.UIELEM_TYPES = {Button : 1, Slider : 2, Toggle: 3, Dropdown : 4}; // public\n this.UIxmlpath = null; // stretch goal\n this.UIxml = null; // stretch goal\n this.editMode = false; // private\n this.editModeOverlay = null; // private\n \n this.clickHold = false; // private\n this.lastElement = null; // private\n \n this.UIwidth = null; // private\n this.UIHeight = null; // private\n this.UIcamera = null; // private\n \n // TODO add accessor\n this.UIElements = []; \n \n this._initCanvas(); // initialize canvas\n}", "title": "" }, { "docid": "fd3735552c45c30ad3c109aea99a5842", "score": "0.54419726", "text": "function initializeUI()\r\n{\r\n}", "title": "" }, { "docid": "1465453de9409a8780ce40e5bcf4b1ea", "score": "0.54327685", "text": "function CreateSubBoardMenu(pGrpIdx, pListTopRow, pDrawColRetObj, pMsgGrps)\n{\n\tvar topItemIndex = 0;\n\tvar selectedItemIndex = 0;\n\t// Populate the sub-board menu for the group with its list of sub-boards\n\tvar areaNameLen = pDrawColRetObj.textLen - 3;\n\tsubBoardMenu = new DDLightbarMenu(pDrawColRetObj.columnX1+pDrawColRetObj.colWidth-1, pListTopRow, pDrawColRetObj.textLen, pDrawColRetObj.colHeight);\n\tsubBoardMenu.areaNameLen = areaNameLen;\n\tsubBoardMenu.ampersandHotkeysInItems = false;\n\tsubBoardMenu.scrollbarEnabled = true;\n\tsubBoardMenu.AddAdditionalQuitKeys(\"qQ\");\n\tsubBoardMenu.msgGrp = pMsgGrps[pGrpIdx];\n\tsubBoardMenu.numSubBoardsInChosenMsgGrp = pMsgGrps[pGrpIdx].length;\n\tsubBoardMenu.subBoardCode = pMsgGrps[pGrpIdx][i];\n\tsubBoardMenu.subBoardHasPolls = subBoardHasPolls;\n\tsubBoardMenu.subBoardPollCounts = {};\n\tsubBoardMenu.NumItems = function() {\n\t\treturn this.numSubBoardsInChosenMsgGrp;\n\t};\n\tsubBoardMenu.GetItem = function(pItemIndex) {\n\t\tvar subCode = this.msgGrp[pItemIndex];\n\t\tvar pollCount = 0;\n\t\tif (this.subBoardPollCounts.hasOwnProperty(subCode))\n\t\t\tpollCount = this.subBoardPollCounts[subCode];\n\t\telse\n\t\t{\n\t\t\tpollCount = this.subBoardHasPolls(subCode);\n\t\t\tthis.subBoardPollCounts[subCode] = pollCount;\n\t\t}\n\t\tvar menuItemObj = this.MakeItemWithRetval(-1);\n\t\tvar hasPollsChar = (pollCount ? \"\\1y\\1h\" + CHECK_CHAR + \"\\1n\" : \" \");\n\t\tmenuItemObj.text = format(\"%-\" + this.areaNameLen + \"s %s\", msg_area.sub[subCode].name.substr(0, this.areaNameLen), hasPollsChar);\n\t\tmenuItemObj.retval = subCode;\n\t\treturn menuItemObj;\n\t};\n\tfor (var i = 0; i < pMsgGrps[pGrpIdx].length; ++i)\n\t{\n\t\tvar subCode = pMsgGrps[pGrpIdx][i];\n\t\tif (subCode == gSubBoardCode)\n\t\t{\n\t\t\ttopItemIndex = i;\n\t\t\tselectedItemIndex = i;\n\t\t}\n\t}\n\t// If the top item index is on the last page of the menu, then\n\t// set the top item index to the first item on the last page.\n\tif ((topItemIndex <= subBoardMenu.items.length - 1) && (topItemIndex >= subBoardMenu.GetTopItemIdxOfLastPage()))\n\t\tsubBoardMenu.SetTopItemIdxToTopOfLastPage();\n\telse\n\t\tsubBoardMenu.topItemIdx = topItemIndex;\n\tsubBoardMenu.selectedItemIdx = selectedItemIndex;\n\n\treturn subBoardMenu;\n}", "title": "" }, { "docid": "7b3af0e96cc59ac30382f1e1792bdf3d", "score": "0.54286194", "text": "function addUI()\n\t{\n\n\t\t//For the border separating the game and the user interface\n\t\tfor(var x=0; x < GRIDX; x++)\n\t\t{\n\t\t\tlet width = {\n\t\t\t\ttop : 5,\n\t\t\t\tleft : 0,\n\t\t\t\tbottom : 0,\n\t\t\t\tright : 0\n\t\t\t};\n\t\t\tPS.border(x, GRIDY, width);\n\t\t\tPS.borderColor(x, GRIDY, UI_BORDER)\n\t\t}\n\n\t\tfor(var x=0; x < GRIDX; x++)\n\t\t{\n\t\t\tfor(var y=0; y < GRIDY; y++)\n\t\t\t{\n\t\t\t\tboard.data.push(0)\n\t\t\t}\n\t\t}\n\n\t\tPS.color(PS.ALL, GRIDY, UI_COLOR)\n\t\tPS.color(PS.ALL, GRIDY + 1, UI_COLOR)\n\n\t\tlet upX = GRIDX/2;\n\t\tlet upY = GRIDY;\n\t\tlet downX = GRIDX/2;\n\t\tlet downY = GRIDY + 1;\n\t\tlet leftX = (GRIDX/2) - 1;\n\t\tlet leftY = GRIDY + 1;\n\t\tlet rightX = (GRIDX/2) + 1;\n\t\tlet rightY = GRIDY + 1;\n\t\tlet resetX = (GRIDX/2) + 1;\n\t\tlet resetY = GRIDY;\n\n\n\t\tlet widthUp = {\n\t\t\ttop : 5,\n\t\t\tleft : 5,\n\t\t\tbottom : 0,\n\t\t\tright : 5\n\t\t}\n\n\t\tlet widthLeft = {\n\t\t\ttop : 5,\n\t\t\tleft : 5,\n\t\t\tbottom : 5,\n\t\t\tright : 0\n\t\t}\n\n\t\tlet widthRight = {\n\t\t\ttop : 5,\n\t\t\tleft : 0,\n\t\t\tbottom : 5,\n\t\t\tright : 5\n\t\t}\n\n\t\tlet widthReset = {\n\t\t\ttop : 5,\n\t\t\tleft : 0,\n\t\t\tbottom : 0,\n\t\t\tright : 5\n\t\t}\n\t\tPS.glyph(upX, upY, \"^\");\n\t\tPS.glyph(downX, downY, \"v\");\n\t\tPS.glyph(leftX, leftY, \"<\");\n\t\tPS.glyph(rightX, rightY, \">\");\n\t\tPS.glyph(resetX, resetY, \"R\");\n\n\t\tPS.border(upX, upY, widthUp);\n\t\tPS.border(downX, downY, 5);\n\t\tPS.border(leftX, leftY, widthLeft);\n\t\tPS.border(rightX, rightY, widthRight);\n\t\tPS.border(resetX, resetY, widthReset);\n\n\t\tPS.borderColor(upX, upY, UI_BORDER);\n\t\tPS.borderColor(downX, downY, UI_BORDER);\n\t\tPS.borderColor(leftX, leftY, UI_BORDER);\n\t\tPS.borderColor(rightX, rightY, UI_BORDER);\n\t\tPS.borderColor(resetX, resetY, UI_BORDER);\n\n\t\tPS.exec(upX, upY, clickedUp)\n\t\tPS.exec(downX, downY, clickedDown)\n\t\tPS.exec(leftX, leftY, clickedLeft)\n\t\tPS.exec(rightX, rightY, clickedRight)\n\t\tPS.exec(resetX, resetY, resetGame);\n\t}", "title": "" }, { "docid": "f9b9c7f5bfd938b289ba6eefab6d14ed", "score": "0.542082", "text": "_createUserPanel() {\n this.userPanel = this.toolbox.add(new Layer(Layer.HBox), {\n fill: [1, 0.2],\n });\n this.userPanel\n .add(new Button(new Rect(), \"<\"), { fill: [0.5, 1] })\n .addForwarder(Message.Type.MOUSE_CLICK, this._changeTeam.bind(this, -1));\n\n this.userPanel\n .add(new Button(new Rect(), \">\"), { fill: [0.5, 1] })\n .addForwarder(Message.Type.MOUSE_CLICK, this._changeTeam.bind(this, 1));\n\n return this;\n }", "title": "" }, { "docid": "c3f49ccb151a6008c1a50e83403b28cc", "score": "0.54132867", "text": "function buildUI() {\n addLoginOrLogout();\n fetchBlobstoreUrlAndShowForm();\n}", "title": "" }, { "docid": "0f6ec4fa18356a0141d26e095e3a53d8", "score": "0.5409684", "text": "function build_user_panels(data) {\n\n\t//reset\n\tconsole.log('[ui] clearing all user panels');\n\t$('.ownerWrap').html('');\n\tfor (var x in known_companies) {\n\t\tknown_companies[x].count = 0;\n\t\tknown_companies[x].visible = 0;\t\t\t\t\t\t\t//reset visible counts\n\t}\n\n\tfor (var i in data) {\n\t\tvar html = '';\n\t\tvar colorClass = '';\n\t\tdata[i].id = escapeHtml(data[i].id);\n\t\tdata[i].username = escapeHtml(data[i].username);\n\t\tdata[i].company = escapeHtml(data[i].company);\n\t\trecord_company(data[i].company);\n\t\tknown_companies[data[i].company].count++;\n\t\tknown_companies[data[i].company].visible++;\n\n\t\tconsole.log('[ui] building owner panel ' + data[i].id);\n\n\t\tlet disableHtml = '';\n\t\tif (data[i].company === escapeHtml(bag.part_company)) {\n\t\t\tdisableHtml = '<span class=\"fa fa-trash disableOwner\" title=\"Disable Owner\"></span>';\n\t\t}\n\n\t\thtml += `<div id=\"user` + i + `wrap\" username=\"` + data[i].username + `\" company=\"` + data[i].company +\n\t\t\t`\" owner_id=\"` + data[i].id + `\" class=\"partsWrap ` + colorClass + `\">\n\t\t\t\t\t<div class=\"legend\" style=\"` + size_user_name(data[i].username) + `\">\n\t\t\t\t\t\t` + toTitleCase(data[i].username) + `\n\t\t\t\t\t\t<span class=\"fa fa-thumb-tack partsFix\" title=\"Never Hide Owner\"></span>\n\t\t\t\t\t\t` + disableHtml + `\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"innerPartWrap\"><i class=\"fa fa-plus addPart\"></i></div>\n\t\t\t\t\t<div class=\"noPartsMsg hint\">No parts</div>\n\t\t\t\t</div>`;\n\n\t\t$('.companyPanel[company=\"' + data[i].company + '\"]').find('.ownerWrap').append(html);\n\t\t$('.companyPanel[company=\"' + data[i].company + '\"]').find('.companyVisible').html(known_companies[data[i].company].visible);\n\t\t$('.companyPanel[company=\"' + data[i].company + '\"]').find('.companyCount').html(known_companies[data[i].company].count);\n\t}\n\n\t//drag and drop part\n\t$('.innerPartWrap').sortable({ connectWith: '.innerPartWrap', items: 'span' }).disableSelection();\n\t$('.innerPartWrap').droppable({\n\t\tdrop:\n\t\tfunction (event, ui) {\n\t\t\tvar part_id = $(ui.draggable).attr('id');\n\n\t\t\t// ------------ Delete Part ------------ //\n\t\t\tif ($(event.target).attr('id') === 'trashbin') {\n\t\t\t\tconsole.log('removing part', part_id);\n\t\t\t\tshow_tx_step({ state: 'building_proposal' }, function () {\n\t\t\t\t\tvar obj = {\n\t\t\t\t\t\ttype: 'delete_part',\n\t\t\t\t\t\tid: part_id,\n\t\t\t\t\t\tv: 1\n\t\t\t\t\t};\n\t\t\t\t\tws.send(JSON.stringify(obj));\n\t\t\t\t\t$(ui.draggable).addClass('invalid bounce');\n\t\t\t\t\trefreshHomePanel();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// ------------ Transfer Part ------------ //\n\t\t\telse {\n\t\t\t\tvar dragged_owner_id = $(ui.draggable).attr('owner_id');\n\t\t\t\tvar dropped_owner_id = $(event.target).parents('.partsWrap').attr('owner_id');\n\n\t\t\t\tconsole.log('dropped a part', dragged_owner_id, dropped_owner_id);\n\t\t\t\tif (dragged_owner_id != dropped_owner_id) {\t\t\t\t\t\t\t\t\t\t//only transfer parts that changed owners\n\t\t\t\t\t$(ui.draggable).addClass('invalid bounce');\n\t\t\t\t\ttransfer_part(part_id, dropped_owner_id);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\t//user count\n\t$('#foundUsers').html(data.length);\n\t$('#totalUsers').html(data.length);\n}", "title": "" }, { "docid": "cedbe1a82f4cfac5083aeb52fe85f436", "score": "0.5405442", "text": "function initUI() {\n\t\t\t\t// Set title etc\n\t\t\t\tdom.byId(\"title\").innerHTML = config.title;\n\t\t\t\t\n\t\t\t\t// Populate toolbar\n\t\t\t\tvar toolbar = registry.byId(\"toolbar\");\n\t\t\t\t// TODO: add items to toolbar i.e. toolbar.addChild()\n\t\t\t}", "title": "" }, { "docid": "21649e4d57f18ae098043ccad1c76af7", "score": "0.5401089", "text": "buildMenu() {\n const processedTemplate = preprocess(this.template, this.type);\n\n return electron.Menu.buildFromTemplate(processedTemplate);\n }", "title": "" }, { "docid": "ebe2cf1557dec01026a4c8eba5ec3941", "score": "0.5399465", "text": "function sirokTools_rebuildButtons(palObj)\r\t\t{\r\t\t\tvar topEdge = 4;\r\t\t\tvar leftEdge = 4;\r\t\t\tvar btnSize = sirokToolsData.btnSize;\r\t\t\tvar btnIconFile, defBtnIconFile;\r\t\t\t\r\t\t\t// Remove the existing buttons (all of them)\r\t\t\tif (palObj.btnGroup != undefined)\r\t\t\t{\r\t\t\t\twhile (palObj.btnGroup.children.length > 0)\r\t\t\t\t\tpalObj.btnGroup.remove(0);\r\t\t\t\tpalObj.remove(0);\r\t\t\t}\r\t\t\t\r\t\t\t// Add buttons for scripts\r\t\t\t//alert(\"Folder.current = \"+sirokToolsData.thisScriptsFolder.toString());\r\t\t\tdefBtnIconFile = new File(sirokToolsData.thisScriptsFolder.fsName + \"/scripts/Launch Pad_jsx-icon.png\");\r\t\t\tif (!defBtnIconFile.exists)\r\t\t\t\tdefBtnIconFile = null;\r\t\t\t\r\t\t\tpalObj.scriptBtns = undefined;\r\t\t\tpalObj.scriptBtns = new Array();\r\t\t\t\r\t\t\t// Place controls in a group container to get the panel background love\r\t\t\tpalObj.btnGroup = palObj.add(\"group\", [0, 0, palObj.bounds.width, palObj.bounds.height]);\r\t\t\t\r\t\t\tfor (var i=0; i<sirokToolsData.scripts.length; i++)\r\t\t\t{\r\t\t\t\t// If there's a corresponding .png file, use it as an iconbutton instead of a regular text button\r\t\t\t\tbtnIconFile = new File(File(sirokToolsData.scripts[i]).fsName.replace(/.jsx(bin)?$/, \".png\"));\r\t\t\t\tif (btnIconFile.exists)\r\t\t\t\t\tpalObj.scriptBtns[i] = palObj.btnGroup.add(\"iconbutton\", [leftEdge, topEdge, leftEdge+btnSize, topEdge+btnSize], btnIconFile, {style:\"toolbutton\"});\r\t\t\t\telse if (defBtnIconFile != null)\r\t\t\t\t\tpalObj.scriptBtns[i] = palObj.btnGroup.add(\"iconbutton\", [leftEdge, topEdge, leftEdge+btnSize, topEdge+btnSize], defBtnIconFile, {style:\"toolbutton\"});\r\t\t\t\telse\r\t\t\t\t\tpalObj.scriptBtns[i] = palObj.btnGroup.add(\"button\", [leftEdge, topEdge, leftEdge+btnSize, topEdge+btnSize], sirokToolsData.scripts[i].name.replace(/.jsx$/, \"\").replace(/%20/g, \" \"));\r\t\t\t\tpalObj.scriptBtns[i].scriptFile = sirokToolsData.scripts[i].fsName;\t\t// Store file name with button (sneaky that JavaScript is)\r\t\t\t\tpalObj.scriptBtns[i].helpTip = File(sirokToolsData.scripts[i]).name.replace(/.jsx(bin)?$/, \"\").replace(/%20/g, \" \") + \"\\n\\n(\" + sirokToolsData.scripts[i].fsName + \")\";\r\t\t\t\tpalObj.scriptBtns[i].onClick = function()\r\t\t\t\t{\r\t\t\t\t\tvar scriptFile = new File(this.scriptFile);\r\t\t\t\t\tif (scriptFile.exists)\r\t\t\t\t\t{\r\t\t\t\t\t\tscriptFile.open(\"r\");\r\t\t\t\t\t\tvar scriptContent = scriptFile.read();\r\t\t\t\t\t\tscriptFile.close();\r\t\t\t\t\t\teval(scriptContent);\r\t\t\t\t\t\t//aftereffects.executeScript(scriptContent);\r\t\t\t\t\t\t//$.evalFile(scriptFile);\r\t\t\t\t\t}\r\t\t\t\t\telse\r\t\t\t\t\t\talert(sirokToolsData.strErrCantLaunchScript.replace(/%s/, this.scriptFile.fsName), sirokToolsData.scriptName);\r\t\t\t\t}\r\t\t\t\t\r\t\t\t\tleftEdge += (btnSize + 5);\r\t\t\t}\r\t\t\t\r\t\t\t// Add the settings and help buttons\r\t\t\tvar settingsBtnIconFile = new File(sirokToolsData.thisScriptsFolder.fsName + \"/Launch Pad_settings.png\");\r\t\t\tif (settingsBtnIconFile.exists)\r\t\t\t\tpalObj.settingsBtn = palObj.btnGroup.add(\"iconbutton\", [leftEdge, topEdge, leftEdge+btnSize, topEdge+btnSize/2], settingsBtnIconFile, {style:\"toolbutton\"});\r\t\t\telse\r\t\t\t\tpalObj.settingsBtn = palObj.btnGroup.add(\"button\", [leftEdge, topEdge, leftEdge+btnSize, topEdge+btnSize/2], sirokToolsData.strSettings);\r\t\t\tpalObj.settingsBtn.helpTip = sirokToolsData.strSettingsTip;\r\t\t\tpalObj.settingsBtn.onClick = function ()\r\t\t\t{\r\t\t\t\t// Get the scripts in the selected scripts folder\r\t\t\t\tvar scriptsFolder = Folder.selectDialog(sirokToolsData.strSelScriptsFolder, Folder(sirokToolsData.scriptsFolder));\r\t\t\t\tif ((scriptsFolder != null) && scriptsFolder.exists)\r\t\t\t\t{\r\t\t\t\t\tsirokToolsData.scriptsFolder = scriptsFolder;\r\t\t\t\t\t// Get all scripts in the selected folder, but not this one, cuz that would be weird :-)\r\t\t\t\t\tsirokToolsData.scripts = scriptsFolder.getFiles(sirokTools_filterJSXFiles);\r\t\t\t\t\t\r\t\t\t\t\t// Remember the scripts folder for the next session\r\t\t\t\t\tapp.settings.saveSetting(\"Adobe\", \"sirokTools_scriptsFolder\", sirokToolsData.scriptsFolder.fsName);\r\t\t\t\t\t\r\t\t\t\t\t// Refresh the palette\r\t\t\t\t\tsirokTools_rebuildButtons(sirokToolsPal);\r\t\t\t\t\tsirokTools_doResizePanel();\r\t\t\t\t\t\r\t\t\t\t\t// Refreshing the panel's buttons while it's open is not working as expected right now, so it's safer to reopen the panel/palette.\r\t\t\t\t\t//alert(sirokToolsData.strRefreshPanel, sirokToolsData.strAboutTitle);\r\t\t\t\t}\r\t\t\t}\r\t\t\t\r\t\t\tvar helpBtnIconFile = new File(sirokToolsData.thisScriptsFolder.fsName + \"/Launch Pad_help.png\");\r\t\t\tif (helpBtnIconFile.exists)\r\t\t\t\tpalObj.helpBtn = palObj.btnGroup.add(\"iconbutton\", [leftEdge, topEdge+btnSize/2, leftEdge+btnSize, topEdge+btnSize], helpBtnIconFile, {style:\"toolbutton\"});\r\t\t\telse\r\t\t\t\tpalObj.helpBtn = palObj.btnGroup.add(\"button\", [leftEdge, topEdge+btnSize/2, leftEdge+btnSize, topEdge+btnSize], sirokToolsData.strHelp);\r\t\t\tpalObj.helpBtn.helpTip = sirokToolsData.strHelpTip;\r\t\t\tpalObj.helpBtn.onClick = function () {alert(sirokToolsData.strAbout, sirokToolsData.strAboutTitle);}\r\t\t}\r\t\t\r\t\t\r\t\t// sirokTools_doResizePanel()\r\t\t// Callback function for laying out the buttons in the panel\r\t\tfunction sirokTools_doResizePanel()\r\t\t{\r\t\t\tvar btnSize = sirokToolsData.btnSize;\r\t\t\tvar btnOffset = btnSize + 5;\r\t\t\tvar maxRightEdge = sirokToolsPal.size.width - btnSize;\r\t\t\tvar leftEdge = 5;\r\t\t\tvar topEdge = 5;\r\t\t\t\r\t\t\t// Reset the background group container's bounds\r\t\t\tsirokToolsPal.btnGroup.bounds = [0, 0, sirokToolsPal.size.width, sirokToolsPal.size.height];\r\t\t\t\r\t\t\t// Reset each button's layer bounds\r\t\t\tfor (var i=0; i<sirokToolsData.scripts.length; i++)\r\t\t\t{\r\t\t\t\tsirokToolsPal.scriptBtns[i].bounds = [leftEdge, topEdge, leftEdge+btnSize, topEdge+btnSize];\r\t\t\t\t\r\t\t\t\tleftEdge += btnOffset;\r\t\t\t\t\r\t\t\t\t// Create a new row if no more columns available in the current row of buttons\r\t\t\t\tif (leftEdge > maxRightEdge)\r\t\t\t\t{\r\t\t\t\t\tleftEdge = 5;\r\t\t\t\t\ttopEdge += btnOffset;\r\t\t\t\t}\r\t\t\t}\r\t\t\t\r\t\t\t// The settings and help buttons go into the next \"slot\"\r\t\t\tsirokToolsPal.settingsBtn.bounds = [leftEdge, topEdge, leftEdge+btnSize, topEdge+btnSize/2];\r\t\t\tsirokToolsPal.helpBtn.bounds = [leftEdge, topEdge+btnSize/2, leftEdge+btnSize, topEdge+btnSize];\r\t\t}\r\t\t\r\t\t\r\t\t// main:\r\t\t// \r\t\t\r\t\tif (parseFloat(app.version) < 9)\r\t\t{\r\t\t\talert(sirokToolsData.strErrMinAE90, sirokToolsData.scriptName);\r\t\t\treturn;\r\t\t}\r\t\telse\r\t\t{\r\t\t\t// Keep track of this script's folder so we know where to find the icons used by the script\r\t\t\tsirokToolsData.thisScriptsFolder = new Folder((new File($.fileName)).path);\r\t\t\t\r\t\t\t// Use the last defined script folder, or ask the user for one (if not previously defined)\r\t\t\tsirokToolsData.scripts = new Array();\r\t\t\tif (app.settings.haveSetting(\"Adobe\", \"sirokTools_scriptsFolder\"))\r\t\t\t{\r\t\t\t\tsirokToolsData.scriptsFolder = new Folder(app.settings.getSetting(\"Adobe\", \"sirokTools_scriptsFolder\").toString());\r\t\t\t\tif ((sirokToolsData.scriptsFolder != null) && sirokToolsData.scriptsFolder.exists)\r\t\t\t\t\tsirokToolsData.scripts = sirokToolsData.scriptsFolder.getFiles(sirokTools_filterJSXFiles);\r\t\t\t}\r\t\t\telse\r\t\t\t{\r\t\t\t\tsirokToolsData.scriptsFolder = Folder.selectDialog(sirokToolsData.strSelScriptsFolder, new Folder(Folder.startup.fsName + \"/Scripts/\"));\r\t\t\t\tif ((sirokToolsData.scriptsFolder != null) && sirokToolsData.scriptsFolder.exists)\r\t\t\t\t{\r\t\t\t\t\tsirokToolsData.scripts = sirokToolsData.scriptsFolder.getFiles(sirokTools_filterJSXFiles);\r\t\t\t\t\t\r\t\t\t\t\t// Remember the scripts folder for the next session\r\t\t\t\t\tapp.settings.saveSetting(\"Adobe\", \"sirokTools_scriptsFolder\", sirokToolsData.scriptsFolder.fsName);\r\t\t\t\t}\r\t\t\t}\r\t\t\t\r\t\t\t// Build and show the UI\r\t\t\tvar sirokToolsPal = sirokTools_buildUI(thisObj);\r\t\t\tif (sirokToolsPal != null)\r\t\t\t{\r\t\t\t\tif (sirokToolsPal instanceof Window)\r\t\t\t\t{\r\t\t\t\t\t// Center the palette\r\t\t\t\t\tsirokToolsPal.center();\r\t\t\t\t\t\r\t\t\t\t\t// Show the UI\r\t\t\t\t\tsirokToolsPal.show();\r\t\t\t\t}\r\t\t\t\telse\r\t\t\t\t\tsirokTools_doResizePanel();\r\t\t\t}\r\t\t}\r\t}\r\t\r\t\r\tmain(this);\r}", "title": "" }, { "docid": "ab42d0bb2f32194a154b62e8dc7b64ad", "score": "0.53910995", "text": "function updateUI()\r\n\t\t\t{\r\n\t\t\t\t$(\"#builderPanel3\").toggle(app.data.hasIntroRecord());\r\n\t\t\t}", "title": "" }, { "docid": "3ef472285ad52dec7c26459c63420381", "score": "0.5386777", "text": "function show_ui() {\n if (win) {\n // Show the window we have\n win.show()\n }\n}", "title": "" }, { "docid": "02c6f73d5c640542de35599ebed52015", "score": "0.53752327", "text": "function CreateMenu()\n{\n var viewMenu = findChild(ui.MainWindow().menuBar(), \"ViewMenu\");\n if (viewMenu == null)\n {\n print(\"Menu not created yet. Retrying\");\n frame.DelayedExecute(1.0).Triggered.connect(CreateMenu);\n return;\n }\n\n if (framework.ModuleByName(\"CAVEStereo\"))\n {\n viewMenu.addAction(\"Cave\").triggered.connect(OpenCaveWindow);\n viewMenu.addAction(\"Stereoscopy\").triggered.connect(OpenStereoscopyWindow);\n }\n\n if (framework.ModuleByName(\"PythonScript\"))\n viewMenu.addAction(\"Python Console\").triggered.connect(OpenPythonConsole);\n}", "title": "" }, { "docid": "328599a803209794dcfa6e49c760845d", "score": "0.5374032", "text": "function ui_needed()\n {\n return (iframe || init_ui_needed());\n }", "title": "" }, { "docid": "e26ea9a8073c5d3ee56c08fc2d68f7b8", "score": "0.5366318", "text": "function RebuildGui() {\n\t\t$('div[data-role=\"page\"]').remove();\n\t\tBuildGui();\n\t}", "title": "" }, { "docid": "0f1450eb4a28b02177aab94daad37ffd", "score": "0.5365091", "text": "initUIAndController() {\n const container = document.querySelector(\"#container\"),\n toolbox = document.querySelector(\".dashboard-toolbox-container\"),\n channelList = document.querySelector(\".sidebar-menu\"),\n memberList = document.querySelector(\".member-list\"),\n channelInfoDialog = document.querySelector(\".info-container\"),\n createChannelDialog = document.querySelector(\".create-channel-container\"),\n saveLoad = document.querySelector(\".container-load-and-publish\"),\n createSketchDialog = document.querySelector(\".create-sketch-container\"),\n adminSettingsDialog = document.querySelector(\".admin-settings-container\"),\n topBar = document.querySelector(\".container-top-bar-history-inner\"),\n templateDialog = document.querySelector(\".choose-template-container\"),\n userProfileDialog = document.querySelector(\".modal-user-profile\");\n\n drawAreaView = new DrawAreaView(container);\n toolboxView = new ToolboxView(toolbox);\n memberListView = new MemberListView(memberList);\n channelListView = new ChannelListView(channelList);\n channelInfoDialogView = new ChannelInfoDialogView(channelInfoDialog);\n createChannelDialogView = new CreateChannelDialogView(createChannelDialog);\n saveLoadView = new SaveLoadView(saveLoad);\n createSketchDialogView = new CreateSketchDialogView(createSketchDialog);\n adminSettingsDialogView = new AdminSettingsDialogView(adminSettingsDialog);\n topBarView = new TopBarView(topBar);\n chooseTemplateDialogView = new ChooseTemplateDialogView(templateDialog);\n userProfileDialogView = new UserProfileDialogView(userProfileDialog);\n\n drawAreaController = new DrawAreaController(this.socket);\n }", "title": "" }, { "docid": "45c1762e06f4ce9ba65874f408796363", "score": "0.53631574", "text": "function createViewer(createUi, fitWindow, onLoad)\n{\n doInit(function(theUi)\n {\n // Translates built-in menu commands\n for (var i = 0; i < menuCommands.length; i++)\n {\n if (menuCommands[i].label != null && menuCommands[i].label.charAt(0) == '=')\n {\n var key = menuCommands[i].label.substring(1);\n var postfix = '';\n \n if (key.substring(key.length - 3, key.length) == '...')\n {\n key = key.substring(0, key.length - 3);\n postfix = '...';\n }\n \n if (key == 'aboutDrawio')\n {\n \tmenuCommands[i].label = mxResources.get('about') + ' ' + EditorUi.VERSION + postfix;\n }\n\t\t\t\telse if (key == 'findReplace')\n\t\t\t\t{\n\t\t\t\t\tmenuCommands[i].label = mxResources.get('find') + '/' + mxResources.get('replace') + postfix;\n\t\t\t\t}\n else\n {\n \tmenuCommands[i].label = mxResources.get(key) + postfix;\n }\n }\n }\n \n if (theUi == null)\n {\n updateActions();\n\n if (onLoad != null)\n {\n onLoad();\n }\n \n return;\n }\n \n ui = theUi;\n ui.initialConfig = rootRecord.get(\"config\");\n graph = ui.editor.graph;\n graph.model.prefix = guid() + '-';\n graph.cellRenderer.minSvgStrokeWidth = 0.01;\n \n // Ignores hover mouse point for inserts\n graph.isMouseInsertPoint = function()\n {\n \treturn false;\n };\n \n // Adds CSS to print output, SVG and image export\n ui.editor.fontCss += exportCss;\n\n // Workaround for sticky mouse down after\n // focus change from other diagram\n if (mxClient.IS_GC && mxClient.IS_MAC)\n {\n graph.addMouseListener(\n {\n mouseDown: function(sender, me) {},\n mouseMove: function(sender, me)\n {\n if (graph.isMouseDown != (mxEvent.isLeftMouseButton(me.getEvent()) ||\n mxEvent.isRightMouseButton(me.getEvent())))\n {\n graph.getRubberband().reset();\n graph.graphHandler.reset();\n graph.isMouseDown = false;\n }\n },\n mouseUp: function(sender, me) {}\n });\n }\n\n // Overrides destroy to clean up resources\n var uiDestroy = ui.destroy;\n \n ui.destroy = function()\n {\n if (this.sidebarWindow != null)\n {\n this.sidebarWindow.window.setVisible(false);\n this.sidebarWindow.window.destroy();\n this.sidebarWindow = null;\n }\n \n if (this.formatWindow != null)\n {\n this.formatWindow.window.setVisible(false);\n this.formatWindow.window.destroy();\n this.formatWindow = null;\n }\n\n if (this.actions.outlineWindow != null)\n {\n this.actions.outlineWindow.destroy();\n this.actions.outlineWindow = null;\n }\n\n if (this.actions.layersWindow != null)\n {\n this.actions.layersWindow.destroy();\n this.actions.layersWindow = null;\n }\n\n if (this.actions.tagsWindow != null)\n {\n this.actions.tagsWindow.window.setVisible(false);\n this.actions.tagsWindow.window.destroy();\n this.actions.tagsWindow = null;\n }\n\n if (this.menus.findWindow != null)\n {\n this.menus.findWindow.window.setVisible(false);\n this.menus.findWindow.window.destroy();\n this.menus.findWindow = null;\n }\n\n if (this.menus.findReplaceWindow != null)\n {\n this.menus.findReplaceWindow.window.setVisible(false);\n this.menus.findReplaceWindow.window.destroy();\n this.menus.findReplaceWindow = null;\n }\n\n if (this.session != null)\n {\n this.session.destroy();\n this.session = null;\n }\n\n if (this.vHandle != null && this.vHandle.parentNode != null)\n {\n this.vHandle.parentNode.removeChild(this.vHandle);\n this.vHandle = null;\n }\n \n uiDestroy.apply(this, arguments);\n };\n\n // Redirects isOffline\n ui.isOffline = function()\n {\n return !quip.apps.isOnline();\n };\n \n // Disables built-in scrolling if not focused\n graph.isScrollWheelEvent = function()\n {\n \treturn quip.apps.isAppFocused();\n };\n \n // Mouse wheel handler to block page scrolling in fullscreen (ignored in MS Edge)\n mxEvent.addMouseWheelListener(mxUtils.bind(this, function(evt, up)\n {\n \tif ((quip.apps.isAppFocused() && !isReadOnlyMode()) || fullscreen)\n\t {\n \t\tvar source = mxEvent.getSource(evt);\n\t\n\t\t\t if ((source == graph.container || graph.container.contains(source)) &&\n\t\t\t \tgraph.container.style.overflow != 'auto' &&\n\t \t(fullscreen || (mxEvent.isControlDown(evt) &&\n\t !mxClient.IS_MAC) || mxEvent.isMetaDown(evt)))\n\t {\n\t \t// Handles scrolling of container in fullscreen\n\t if (!graph.isZoomWheelEvent(evt))\n\t {\n\t var t = graph.view.getTranslate();\n\t var step = 40 / graph.view.scale;\n\t \n\t if (!mxEvent.isShiftDown(evt))\n\t {\n\t graph.view.setTranslate(t.x, t.y + ((up) ? step : -step));\n\t }\n\t else\n\t {\n\t graph.view.setTranslate(t.x + ((up) ? -step : step), t.y);\n\t }\n\t }\n\t \n\t mxEvent.consume(evt);\n\t }\n\t else if (source != null)\n\t \t{\n\t \t\t// Safari and Firefox propagate the event to the outer page if\n\t \t\t// the top or bottom is reached in a scrollable container so we\n\t \t\t// need to block that but allow if scroll is possible\n\t \t\tvar temp = source;\n\t \t\tvar css = mxUtils.getCurrentStyle(temp);\n\t\n\t \t\twhile (temp != document.body && css != null && css.overflowY != 'auto')\n\t \t\t{\n\t \t\t\ttemp = temp.parentNode;\n\t \t\t\tcss = (temp != null) ? mxUtils.getCurrentStyle(temp) : null;\n\t \t\t}\n\t \t\t\n\t \t\tif (temp != null && ((temp == document.body && fullscreen) ||\n\t \t\t\t(temp != document.body && ((up && temp.scrollTop == 0) ||\n\t \t\t\t(!up && temp.scrollTop >= temp.scrollHeight - temp.clientHeight)))))\n\t \t\t\t{\n\t \t\t\t\tmxEvent.consume(evt);\n\t \t\t\t}\n\t \t}\n\t\t\t}\n }), graph.container);\n \n // Closes fullscreen on escape (must be called before handlers are reset)\n // and escape must be ignored in some special cases where its invoked\n // programmatically\n var uiOnKeyPress = ui.onKeyPress;\n \n ui.onKeyPress = function()\n {\n ignoreEscape = true;\n uiOnKeyPress.apply(this, arguments);\n ignoreEscape = false;\n };\n \n var graphReset = graph.reset;\n \n graph.reset = function()\n {\n ignoreEscape = true;\n graphReset.apply(this, arguments);\n ignoreEscape = false;\n };\n\n var delFunct = ui.actions.get('delete').funct;\n \n ui.actions.get('delete').funct = function()\n {\n ignoreEscape = true;\n delFunct.apply(this, arguments);\n ignoreEscape = false;\n };\n \n var graphEscape = graph.escape;\n \n graph.escape = function()\n {\n if (!graph.isEditing() && !ignoreEscape)\n {\n // Ignores escape if handlers are active\n var inactive = graph.graphHandler.first == null && graph.connectionHandler.first == null;\n \n graph.selectionCellsHandler.handlers.visit(function(key, handler)\n {\n inactive = inactive && !graph.selectionCellsHandler.isHandlerActive(handler);\n });\n\n if (inactive)\n {\n if (fullscreen)\n {\n setFullscreen(false);\n }\n else\n {\n if (ui.menus.findWindow != null)\n {\n ui.menus.findWindow.window.setVisible(false);\n }\n\n if (ui.menus.findReplaceWindow != null)\n {\n ui.menus.findReplaceWindow.window.setVisible(false);\n }\n\n if (ui.menus.tagsWindow != null)\n {\n ui.menus.tagsWindow.window.setVisible(false);\n }\n \n if (ui.actions.layersWindow != null)\n {\n ui.actions.layersWindow.window.setVisible(false);\n }\n \n if (ui.actions.outlineWindow != null)\n {\n ui.actions.outlineWindow.window.setVisible(false);\n }\n \n if (ui.formatWindow != null)\n {\n ui.formatWindow.window.setVisible(false);\n }\n \n if (ui.sidebarWindow != null)\n {\n ui.sidebarWindow.window.setVisible(false);\n }\n \n graph.popupMenuHandler.hideMenu();\n graph.clearSelection();\n fitDiagram(true);\n }\n }\n }\n \n graphEscape.apply(this, arguments);\n };\n\n // Locks unselected cells on mobile\n if (quip.apps.isMobile())\n {\n var graphIsCellLocked = graph.isCellLocked;\n \n graph.isCellLocked = function(cell)\n {\n return !this.isCellSelected(cell) || graphIsCellLocked.apply(this, arguments);\n };\n \n // Overrides cell selection to allow for unselected cells on mobile\n var click = graph.click;\n \n graph.click = function(me)\n {\n if (this.isEnabled() && me.sourceState != null)\n {\n var cell = me.sourceState.cell;\n \n if (cell != null && !graphIsCellLocked.apply(this, [cell]) &&\n (Math.abs(this.lastMouseX - me.getX()) < this.tolerance &&\n Math.abs(this.lastMouseY - me.getY()) < this.tolerance))\n {\n graph.selectCellForEvent(cell, me.getEvent());\n }\n }\n else\n {\n return click.apply(this, arguments);\n }\n };\n }\n \n // Disables centering of graph after iframe resize\n ui.chromelessWindowResize = function() {};\n \n // Overridden to add padding\n ui.chromelessResize = function(autoscale, maxScale, cx, cy, alignTop)\n {\n if (graph.container != null)\n {\n cx = (cx != null) ? cx : 0;\n cy = (cy != null) ? cy : 0;\n \n var bds = (graph.pageVisible) ? graph.view.getBackgroundPageBounds() : graph.getGraphBounds();\n var scroll = mxUtils.hasScrollbars(graph.container);\n var tr = graph.view.translate;\n var s = graph.view.scale;\n \n // Normalizes the bounds\n var b = mxRectangle.fromRectangle(bds);\n b.x = b.x / s - tr.x;\n b.y = b.y / s - tr.y;\n b.width /= s;\n b.height /= s;\n \n var st = graph.container.scrollTop;\n var sl = graph.container.scrollLeft;\n var sb = 0; //(mxClient.IS_QUIRKS || document.documentMode >= 8) ? 20 : 14;\n var cw = graph.container.offsetWidth - sb;\n var ch = graph.container.offsetHeight - sb;\n \n var ns = (autoscale) ? Math.max(0.3, Math.min(maxScale || 1, cw / b.width)) : s;\n var dx = ((cw - ns * b.width) / 2) / ns;\n var dy = (fullscreen) ? (((ch - ns * b.height) / this.lightboxVerticalDivider) / ns) : padding / ns;\n \n if (alignTop)\n {\n dy = Math.max(dy, padding / ns);\n }\n \n if (scroll)\n {\n dx = Math.max(dx, 0);\n dy = Math.max(dy, 0);\n }\n\n if (scroll || (bds.width < cw && bds.height < ch))\n {\n graph.view.scaleAndTranslate(ns, Math.floor(dx - b.x), Math.floor(dy - b.y));\n graph.container.scrollTop = st * ns / s;\n graph.container.scrollLeft = sl * ns / s;\n }\n else if (cx != 0 || cy != 0)\n {\n var t = graph.view.translate;\n var ty = \n graph.view.setTranslate((bds.width < cw) ? Math.floor(dx - b.x) : Math.floor(t.x + cx / s),\n (bds.height < ch) ? Math.floor(dy - b.y) :\n ((alignTop) ? Math.floor(dy - b.y) : Math.floor(t.y + cy / s)));\n }\n }\n };\n\n // Creates vertical handle\n ui.vHandle = document.createElement('div');\n ui.vHandle.className = 'geVerticalHandle';\n\n // Event catching on outer document\n var catcher = null;\n var bounds = null;\n var lastY = null;\n \n function addCatcher()\n {\n catcher = ui.createDiv('background');\n catcher.style.cssText = 'position:absolute;background:transparent;top:0px;left:0px;right:0px;bottom:0px;z-index:99999;';\n document.body.appendChild(catcher);\n quip.apps.addDetachedNode(ReactDOM.findDOMNode(catcher));\n\n mxEvent.addGestureListeners(catcher, function(evt)\n {\n // see below\n }, function(evt)\n {\n if (lastY != null)\n {\n var dy = mxEvent.getClientY(evt) - lastY;\n var h = Math.max(50, bounds.height + dy);\n quip.apps.setWidthAndAspectRatio(bounds.width, h / bounds.width);\n container.style.height = h + 'px';\n }\n }, function()\n {\n lastY = null;\n removeCatcher();\n });\n };\n \n function removeCatcher()\n {\n quip.apps.removeDetachedNode(ReactDOM.findDOMNode(catcher));\n catcher.parentNode.removeChild(catcher);\n };\n \n mxEvent.addGestureListeners(ui.vHandle, function(evt)\n {\n bounds = quip.apps.getCurrentDimensions();\n lastY = mxEvent.getClientY(evt);\n addCatcher();\n });\n\n // Workaround for spinner and status position\n var oldSpin = ui.spinner.spin;\n \n ui.spinner.spin = function(c, message)\n {\n var result = oldSpin.apply(ui.spinner, [container, message]);\n \n if (ui.spinner.status != null)\n {\n ui.spinner.status.style.marginTop = '70px';\n ui.spinner.status.style.left = '50%';\n ui.spinner.status.style.top = '50%';\n }\n \n return result;\n };\n \n // Handles open file via drop to splash screen\n ui.openLocalFile = function(data, name, temp)\n {\n if (dlg != null)\n {\n setInitialData(data);\n }\n };\n \n // Handles Quip exported files (currently only current XML for import)\n var uiValidateFileData = ui.validateFileData;\n \n ui.validateFileData = function(data)\n {\n if (data != null && data.substring(0, 9) == '{\"user\":\"')\n {\n try\n {\n var obj = JSON.parse(data);\n data = obj.current;\n }\n catch (e)\n {\n // ignore\n }\n }\n \n return uiValidateFileData.apply(this, [data]);\n };\n \n // Make available for resolving DOM nodes\n window.graph = graph;\n \n // Adds/modifies actions and menus\n ui.actions.get('save').setEnabled(false);\n ui.actions.get('insertText').label = mxResources.get('text');\n ui.actions.get('editDiagram').label = mxResources.get('formatXml') + '...';\n ui.actions.get('insertRectangle').label = mxResources.get('rectangle');\n ui.actions.get('insertEllipse').label = mxResources.get('ellipse');\n ui.actions.get('insertRhombus').label = mxResources.get('rhombus');\n ui.actions.get('insertImage').label = mxResources.get('image') + '...';\n ui.actions.get('insertLink').label = mxResources.get('link') + '...';\n ui.actions.get('createShape').label = mxResources.get('shape') + '...';\n ui.actions.get('outline').label = mxResources.get('outline') + '...';\n ui.actions.get('layers').label = mxResources.get('layers') + '...';\n ui.actions.get('keyboardShortcuts').funct = function()\n {\n quip.apps.openLink('https://www.draw.io/shortcuts.svg');\n };\n ui.actions.get('support').funct = function()\n {\n quip.apps.openLink('https://desk.draw.io/support/solutions/articles/16000075852');\n };\n\n ui.actions.put('fit', new Action(mxResources.get('fit'), function()\n {\n graph.popupMenuHandler.hideMenu();\n fitDiagram(true);\n }));\n ui.actions.put('comment', new Action(mxResources.get('comment') + '...', function()\n {\n setFullscreen(false);\n quip.apps.showComments(rootRecord.getId());\n }));\n ui.actions.put('preferences', new Action(mxResources.get('preferences') + '...', function()\n {\n graph.popupMenuHandler.hideMenu();\n showConfigureDialog();\n }));\n ui.actions.put('insertPage', new Action(mxResources.get('page'), function()\n {\n ui.insertPage();\n fitDiagram();\n updateActions();\n }));\n ui.actions.put('fullscreen', new Action(mxResources.get('fullscreen'), function()\n {\n setFullscreen(true);\n }));\n ui.actions.put('exitFullscreen', new Action(mxResources.get('done'), function()\n {\n if (graph.pageVisible)\n {\n ui.actions.get('pageView').funct();\n }\n \n setFullscreen(false);\n }));\n ui.actions.put('debug', new Action('Debug', function()\n {\n function getDataArray(record)\n {\n var result = [];\n \n for (var i = 0; i < record.count(); i++)\n {\n result.push(record.get(i).get(\"data\"));\n }\n \n return result;\n };\n \n console.log('ui', ui);\n console.log('root', rootRecord);\n console.log('edits', rootRecord.get(\"edits\").getId(), getDataArray(rootRecord.get(\"edits\")));\n console.log('revisions', getDataArray(rootRecord.get(\"revisions\")))\n console.log('storage', rootRecord.get(\"storage\"));\n console.log('config', rootRecord.get(\"config\"));\n console.log('snapshot', rootRecord.get(\"snapshot\"));\n console.log('user', quip.apps.getUserPreferences().getForKey('settings'));\n }));\n ui.actions.put('refresh', new Action('Refresh', function()\n {\n graph.refresh();\n }));\n ui.actions.put('importFile', new Action('File...', function()\n {\n graph.popupMenuHandler.hideMenu();\n var input = document.createElement('input');\n input.setAttribute('type', 'file');\n \n mxEvent.addListener(input, 'change', function()\n {\n if (input.files != null)\n {\n // Using null for position will disable crop of input file\n ui.importFiles(input.files, null, null, ui.maxImageSize);\n }\n });\n\n input.click();\n }));\n ui.actions.put('importCsv', new Action(mxResources.get('csv') + '...', function()\n {\n graph.popupMenuHandler.hideMenu();\n ui.showImportCsvDialog();\n }));\n ui.actions.put('importText', new Action(mxResources.get('text') + '...', function()\n {\n var dlg = new ParseDialog(ui, 'Insert from Text');\n ui.showDialog(dlg.container, 620, 420, true, false);\n dlg.init();\n }));\n ui.actions.put('formatSql', new Action(mxResources.get('formatSql') + '...', function()\n {\n var dlg = new ParseDialog(ui, 'Insert from Text', 'formatSql');\n ui.showDialog(dlg.container, 620, 420, true, false);\n dlg.init();\n }));\n \n if (EditorUi.enablePlantUml)\n {\n ui.actions.put('plantUml', new Action(mxResources.get('plantUml') + '...', function()\n {\n var dlg = new ParseDialog(ui, 'Insert from Text', 'plantUml');\n ui.showDialog(dlg.container, 620, 420, true, false);\n dlg.init();\n }));\n }\n \n ui.actions.put('mermaid', new Action(mxResources.get('mermaid') + '...', function()\n {\n var dlg = new ParseDialog(ui, 'Insert from Text', 'mermaid');\n ui.showDialog(dlg.container, 620, 420, true, false);\n dlg.init();\n }));\n \n ui.actions.put('lockApp', new Action(mxResources.get('lockUnlock'), function()\n {\n setFullscreen(false, true);\n \n toggleLocked(null, function()\n {\n if (!locked)\n {\n setFullscreen(true, true);\n }\n });\n }));\n ui.actions.put('deleteApp', new Action(mxResources.get('delete') + '...', function()\n {\n ui.confirm(mxResources.get('areYouSure'), function()\n {\n quip.apps.deleteApp();\n });\n }));\n ui.actions.put('toggleShapes', new Action(mxResources.get('shapes') + '...', toggleShapes));\n ui.actions.put('toggleFormat', new Action(mxResources.get('format') + '...', toggleFormat));\n var addInsertItem = function(menu, parent, title, method)\n {\n menu.addItem(title, null, mxUtils.bind(this, function()\n {\n var dlg = new CreateGraphDialog(ui, title, method);\n ui.showDialog(dlg.container, 620, 420, true, false);\n // Executed after dialog is added to dom\n dlg.init();\n }), parent);\n };\n\n ui.menus.put('diagram', new Menu(mxUtils.bind(this, function(menu, parent)\n {\n ui.menus.addMenuItems(menu, ['comment', '-', 'outline', 'layers', '-', 'findReplace', 'tags', '-'], parent);\n ui.menus.addSubmenu('layout', menu, parent);\n ui.menus.addSubmenu('options', menu, parent);\n ui.menus.addMenuItems(menu, ['-'], parent);\n ui.menus.addSubmenu('export', menu, parent);\n ui.menus.addMenuItems(menu, ['preferences', '-'], parent);\n ui.menus.addSubmenu('help', menu, parent);\n ui.menus.addMenuItems(menu, ['-', 'deleteApp'], parent);\n })));\n\n ui.menus.put('export', new Menu(mxUtils.bind(this, function(menu, parent)\n {\n ui.menus.addMenuItems(menu, ['exportPng', 'exportJpg', 'exportSvg', '-', 'exportPdf', 'exportVsdx', '-',\n 'exportHtml', 'exportXml', 'exportUrl', '-'], parent);\n ui.menus.addSubmenu('embed', menu, parent);\n })));\n\n ui.menus.put('insertAdvanced', new Menu(mxUtils.bind(this, function(menu, parent)\n {\n ui.menus.addMenuItems(menu, ['importText', 'plantUml', 'mermaid', '-', 'importCsv',\n 'formatSql', '-', 'editDiagram'], parent);\n })));\n \n mxResources.parse('insertLayout=' + mxResources.get('layout'));\n mxResources.parse('insertAdvanced=' + mxResources.get('advanced'));\n \n ui.menus.put('insert', new Menu(mxUtils.bind(this, function(menu, parent)\n {\n ui.menus.addMenuItems(menu, ['insertRectangle', 'insertEllipse', 'insertRhombus', '-', 'insertText',\n \t\t\t\t\t\t\t'insertPage', 'insertLink', '-', 'importFile', 'insertImage', 'insertTemplate', '-',\n \t\t\t\t\t\t\t'createShape', 'insertFreehand', '-'], parent);\n ui.menus.addSubmenu('insertLayout', menu, parent);\n ui.menus.addSubmenu('insertAdvanced', menu, parent);\n })));\n\n var methods = ['horizontalFlow', 'verticalFlow', '-', 'horizontalTree', 'verticalTree',\n 'radialTree', '-', 'organic', 'circle'];\n \n ui.menus.put('insertLayout', new Menu(mxUtils.bind(this, function(menu, parent)\n {\n for (var i = 0; i < methods.length; i++)\n {\n if (methods[i] == '-')\n {\n menu.addSeparator(parent);\n }\n else\n {\n addInsertItem(menu, parent, mxResources.get(methods[i]) + '...', methods[i]);\n }\n }\n })));\n \n ui.menus.put('options', new Menu(mxUtils.bind(this, function(menu, parent)\n {\n ui.menus.addMenuItems(menu, ['grid', 'guides', '-', 'connectionArrows',\n 'connectionPoints', '-', 'copyConnect', 'collapseExpand'], parent);\n })));\n\n ui.menus.put('embed', new Menu(mxUtils.bind(this, function(menu, parent)\n {\n ui.menus.addMenuItems(menu, ['embedImage', 'embedSvg', '-', 'embedHtml', 'embedIframe'], parent);\n })));\n\n ui.menus.put('help', new Menu(mxUtils.bind(this, function(menu, parent)\n {\n // No translation for menu item since help is english only\n var item = menu.addItem('Search:', null, null, parent, null, null, false);\n item.style.backgroundColor = (uiTheme == 'dark') ? '#505759' : 'whiteSmoke';\n item.style.cursor = 'default';\n \n var input = document.createElement('input');\n input.setAttribute('type', 'text');\n input.setAttribute('size', '25');\n input.style.marginLeft = '8px';\n\n mxEvent.addListener(input, 'keydown', mxUtils.bind(this, function(e)\n {\n var term = mxUtils.trim(input.value);\n \n if (e.keyCode == 13 && term.length > 0)\n {\n ui.openLink('https://desk.draw.io/support/search/solutions?term=' +\n encodeURIComponent(term));\n input.value = '';\n \n if (ui.menubar != null)\n {\n window.setTimeout(mxUtils.bind(this, function()\n {\n ui.menubar.hideMenu();\n }), 0);\n }\n }\n else if (e.keyCode == 27)\n {\n input.value = '';\n }\n }));\n \n item.firstChild.nextSibling.appendChild(input);\n \n mxEvent.addGestureListeners(input, function(evt)\n {\n if (document.activeElement != input)\n {\n input.focus();\n }\n \n mxEvent.consume(evt);\n }, function(evt)\n {\n mxEvent.consume(evt);\n }, function(evt)\n {\n mxEvent.consume(evt);\n });\n \n window.setTimeout(function()\n {\n input.focus();\n }, 0);\n \n ui.menus.addMenuItems(menu, ['-', 'quickStart', 'keyboardShortcuts', 'support', '-', 'about'], parent);\n })));\n \n // Needed for creating elements in Format panel\n ui.toolbar = ui.createToolbar(ui.createDiv('geToolbar'));\n ui.defaultLibraryName = mxResources.get('untitledLibrary');\n\n // Fixes event handling for popup menu in Quip\n var popupMenuHandlerPopup = graph.popupMenuHandler.popup;\n \n graph.popupMenuHandler.popup = function()\n {\n popupMenuHandlerPopup.apply(this, arguments);\n quip.apps.addDetachedNode(ReactDOM.findDOMNode(this.div));\n };\n \n if (preview == null)\n {\n quip.apps.enableResizing({maintainAspectRatio: true, minWidth: 100, minHeight: 100});\n }\n\n var undoMgr = ui.editor.undoManager;\n graph.getSelectionModel().addListener(mxEvent.CHANGE, updateActions);\n undoMgr.addListener(mxEvent.ADD, updateActions);\n undoMgr.addListener(mxEvent.UNDO, updateActions);\n undoMgr.addListener(mxEvent.REDO, updateActions);\n undoMgr.addListener(mxEvent.CLEAR, updateActions);\n updateActions();\n \n // Resets view after page change\n ui.editor.addListener('pageSelected', function()\n {\n if (!fullscreen)\n {\n fitDiagram(true, true);\n }\n });\n \n ui.addListener('pageViewChanged', function()\n {\n fitDiagram(true);\n });\n\n ui.reloadFromRecord = function(forceUpdate)\n {\n var tempConfig = rootRecord.get(\"config\");\n\n if (!quip.apps.isAppFocused())\n {\n if (ui.initialConfig != tempConfig)\n {\n ui.initialConfig = tempConfig;\n forceUpdate = true;\n \n viewerConfig = (tempConfig != null && tempConfig.length > 0) ? JSON.parse(tempConfig) : {};\n border = (viewerConfig.border != null) ? viewerConfig.border : 0;\n padding = (viewerConfig.padding != null) ? viewerConfig.padding : padding;\n locked = (viewerConfig.locked != null) ? viewerConfig.locked : false;\n }\n \n if (forceUpdate)\n {\n updateActions();\n updateBorder();\n fitDiagram(forceUpdate);\n }\n }\n else\n {\n viewerConfig = (tempConfig != null && tempConfig.length > 0) ? JSON.parse(tempConfig) : {};\n locked = viewerConfig.locked;\n }\n \n if (ui != null && ui.editor.editable == locked)\n {\n toggleLocked(true);\n }\n };\n\n initSession(fitWindow)\n \n if (ui.session == null)\n {\n if (!isDocumentEditable())\n {\n var w = quip.apps.getContainerWidth();\n quip.apps.setWidthAndAspectRatio(w, 40 / w);\n container.style.backgroundImage = '';\n container.style.height = '40px';\n var test = document.createElement('div');\n var error = document.createElement('div');\n error.style.cssText = 'text-align:center;position:absolute;left:0px;right:0px;top:0px;bottom:0px;';\n error.setAttribute('id', 'error');\n error.innerHTML = '<div style=\"background:#fafafa;border:#c0c0c0 solid 1px;' +\n 'padding:6px 12px 6px 12px;display:inline-block;border-radius:8px;color:#808080;\">' +\n 'Unsupported browser</div>';\n container.appendChild(error);\n \n // Block resizing until diagram was created\n quip.apps.disableResizing();\n updateActions();\n }\n else if (dlg == null && !isDocumentTemplate())\n {\n logEvent({category: 'QUIP', action: 'create', label: (rootRecord != null) ? rootRecord.getId() : null});\n createNewDialog();\n }\n }\n else if (rootRecord.get('snapshot') == null && !viewerConfig.noPreview)\n {\n var edits = rootRecord.get('edits');\n \n if (edits != null && edits.count() > 0)\n {\n try\n {\n // Updates snapshot if last change is older than 30 seconds\n // to avoid too many snapshots to be created when the page\n // is loaded while the diagram is being edited\n if (new Date().getTime() - JSON.parse(edits.get(\n edits.count() - 1).get('data')).timestamp > 30000)\n {\n updateSnapshot();\n }\n }\n catch (e)\n {\n // ignore\n }\n }\n }\n \n ui.vHandle.style.display = (document.getElementById('error') == null && dlg == null &&\n quip.apps.isAppFocused() && !fullscreen) ? '' : 'none';\n container.appendChild(ui.vHandle);\n quip.apps.addDetachedNode(ReactDOM.findDOMNode(ui.vHandle));\n clearSelection();\n\n if (onLoad != null)\n {\n onLoad();\n }\n }, function()\n {\n return (createUi) ? new EditorUi(new Editor(true, null, null,\n \tnull, isDocumentEditable()), container, true) : null;\n });\n} // end createViewer", "title": "" }, { "docid": "e0c07ea507e0cdaac9dd2987ded4b451", "score": "0.5349075", "text": "_buildUI() {\n\t\tthis.test=\"initial\";\n // Create the application window\n this._window = new Gtk.ApplicationWindow ({\n application: this.application,\n window_position: Gtk.WindowPosition.CENTER,\n title: \"Enter code HERE\",\n default_height: 400,\n default_width: 440,\n border_width: 20 });\n // Text view plugin\n this.buffer = new Gtk.TextBuffer();\n this._textView = new Gtk.TextView ({\n buffer: this.buffer,\n editable: true,\n wrap_mode: Gtk.WrapMode.WORD });\n\t\t//menu option vlue\n\t\tthis._test = new Gtk.Label ({\n label: this.test,\n wrap: true });\n // SCroll winfow for text box\n this._scrolled = new Gtk.ScrolledWindow ({\n hscrollbar_policy: Gtk.PolicyType.AUTOMATIC,\n vscrollbar_policy: Gtk.PolicyType.AUTOMATIC,\n shadow_type: Gtk.ShadowType.ETCHED_IN,\n height_request: 180,\n width_request: 400, });\n this._scrolled.add_with_viewport (this._textView);\n\t\t\n\t\t//Buton\n\t\tthis._send = new Gtk.Button ({\n halign: Gtk.Align.END,\n margin_top: 20,\n label: \"compile and run\" ,});\n \n \n //subGrid \n this._grid = new Gtk.Grid ({\n halign: Gtk.Align.CENTER,\n valign: Gtk.Align.CENTER });\n this._grid.attach (this._test, 0, 0, 1, 1);\n this._grid.attach (this._scrolled, 0, 1, 1, 1);\n\n\t\t//main grid\n\t\tthis._mainGrid = new Gtk.Grid ({\n halign: Gtk.Align.CENTER,\n valign: Gtk.Align.CENTER });\n\t\tthis._mainGrid.attach (this._grid, 0, 0, 1, 1);\n this._mainGrid.attach (this._send, 0, 1, 1, 1);\n // Attach the main grid to the window\n this._window.add (this._mainGrid);\n\n // Show the window and all child widgets\n this._window.show_all();\n }", "title": "" }, { "docid": "d12288ed2dd5497b2e3e3e0582b1712f", "score": "0.5348753", "text": "function gui() { //graphical user interface\n\tui_clear(); // clean up the User interface before drawing a new one.\n\tui_add_info_label( \"Single Edge Nibble Transmission\" );\n\tui_add_ch_selector( \"ch\", \"Channel to decode:\", \"\" );\n\tui_add_num_combo( \"dataSize\", \"Number of data nibbles\", 1, 6, 6);\n\tui_add_num_combo( \"tickPer\", \"Tick period (Ás)\", 2, 100, 3);\n\tui_add_num_combo( \"tickTol\", \"Tick tolerance (%)\", 0, 20, 5);\n\tui_add_txt_combo( \"crcMode\", \"CRC Mode\" );\n\t\tui_add_item_to_txt_combo( \"Legacy\", true );\n\t\tui_add_item_to_txt_combo( \"Recommended\" );\n\tui_add_txt_combo( \"pausePulse\", \"Pause Pulse\" );\n\t\tui_add_item_to_txt_combo( \"Off\", true );\n\t\tui_add_item_to_txt_combo( \"On\" );\n\tui_add_txt_combo( \"serialMode\", \"Serial Decoding\" );\n\t\tui_add_item_to_txt_combo( \"Off\", true );\n\t\tui_add_item_to_txt_combo( \"Short Message\" );\n\t\tui_add_item_to_txt_combo( \"Enhanced Message\" );\n}", "title": "" }, { "docid": "f962ad4d836e0a4f2f6df7fba82306d9", "score": "0.5342068", "text": "function gui()\n{\n ui_clear(); // clean up the User interface before drawing a new one.\n\n ui_add_ch_selector(\"ch\", \"Channel to decode\", \"DHTxx\");\n\n ui_add_txt_combo(\"sensor\", \"Sensor\");\n ui_add_item_to_txt_combo(\"DHT11\", true);\n ui_add_item_to_txt_combo(\"DHT22\");\n\n ui_add_txt_combo(\"tempUnit\", \"Temperature Units\");\n ui_add_item_to_txt_combo(\"Celsius\", true);\n ui_add_item_to_txt_combo(\"Fahrenheit\");\n ui_add_item_to_txt_combo(\"Kelvin\");\n}", "title": "" }, { "docid": "88446259fbebb65209db5d2a71d504d8", "score": "0.5336326", "text": "buildUI() {\n this.filterButtonNode = null;\n this.filterPanelNode = null;\n this.switchFilterButtonNode = null;\n this.closeFilterPanelNode = null;\n this.contentFilterPanelNode = null;\n\n if (this.filters.length > 0) {\n this.addClassName('full');\n this.node.innerHTML = '\\\n <div class=\"fw-searchlist-parent\">\\\n <div class=\"fw-searchlist-filter\"><div><div></div></div></div>\\\n <div class=\"fw-searchlist-input\"><input type=\"text\" spellcheck=\"false\"></input></div>\\\n <div class=\"fw-searchlist-search\"><div><div></div></div></div>\\\n </div>';\n this.filterButtonNode = this.node.getElementsByClassName('fw-searchlist-full-filter')[0];\n this.filterPanelNode = document.createElement('div');\n this.filterPanelNode.classList.add('fw-searchlist-panel');\n this.filterPanelNode.innerHTML = '\\\n <div class=\"fw-searchlist-header\">\\\n <div class=\"fw-searchlist-switch\">\\\n <div class=\"fw-searchlist-button\">\\\n <div class=\"fw-searchlist-on\"></div>\\\n <div class=\"fw-searchlist-off\"></div>\\\n <div class=\"fw-searchlist-cursor\"></div>\\\n </div>\\\n </div>\\\n <div class=\"fw-searchlist-close\"></div>\\\n </div>\\\n <div class=\"fw-searchlist-content\"></div>\\\n <div class=\"fw-searchlist-footer\"></div>';\n this.switchFilterButtonNode = this.filterPanelNode.getElementsByClassName('fw-searchlist-button')[0];\n this.closeFilterPanelNode = this.filterPanelNode.getElementsByClassName('fw-searchlist-close')[0];\n this.contentFilterPanelNode = this.filterPanelNode.getElementsByClassName('fw-searchlist-content')[0];\n this.buildFilterPanel();\n } else {\n this.node.innerHTML = '\\\n <div class=\"fw-searchlist-parent\">\\\n <div class=\"fw-searchlist-input\"><input type=\"text\"></input></div>\\\n <div class=\"fw-searchlist-search\"><div><div></div></div></div>\\\n </div>';\n }\n\n this.searchListParentNode = this.node.getElementsByClassName('fw-searchlist-parent')[0];\n this.inputFieldNode = this.searchListParentNode.getElementsByTagName('input')[0];\n this.searchButtonNode = this.node.getElementsByClassName('fw-searchlist-search')[0];\n this.setFocusableNode(this.inputFieldNode);\n }", "title": "" }, { "docid": "97a6d41986da0f2e6697066a293b101c", "score": "0.5330171", "text": "function build_user_panels(data) {\n\n\t//reset\n\tconsole.log('[ui] clearing all user panels');\n\t$('.ownerWrap').html('');\n\tfor (var x in known_companies) {\n\t\tknown_companies[x].count = 0;\n\t\tknown_companies[x].visible = 0;\t\t\t\t\t\t\t//reset visible counts\n\t}\n\tfor (var i=0;i<data.length;i++){\n\t\tvar u = Cookies.get('username');\n\t\tif (data[i].company===u){\n\t\t\tvar t = data[0];\n\t\t\tdata[0]=data[i];\n\t\t\tdata[i]=t;\n\t\t\tbreak;\n\t\t}\n\t}\n\ti=0;\n\tfor (var i in data) {\n\t\tvar html = '';\n\t\tvar colorClass = '';\n\t\tdata[i].id = escapeHtml(data[i].id);\n\t\tdata[i].username = escapeHtml(data[i].username);\n\t\tdata[i].company = escapeHtml(data[i].company);\n\t\trecord_company(data[i].company);\n\t\tknown_companies[data[i].company].count++;\n\t\tknown_companies[data[i].company].visible++;\n\n\t\tconsole.log('[ui] building owner panel ' + data[i].id);\n\n\t\tlet disableHtml = '';\n\t\tif (data[i].company === escapeHtml(bag.marble_company)) {\n\t\t\tdisableHtml = '<span class=\"fa fa-trash disableOwner\" title=\"Disable Owner\"></span>';\n\t\t}\n\t\tlet addhtml = '';\n\t\tif (Cookies.get('username')==='supplier' &&data[i].company==='supplier' ){\n\t\t\taddhtml = `<i class=\"fa fa-plus addMarbleButtion marblesFix\"></i>`;\n\t\t}\n\t\thtml += `<div id=\"user` + i + `wrap\" username=\"` + data[i].username + `\" company=\"` + data[i].company +\n\t\t\t`\" owner_id=\"` + data[i].id + `\" class=\"marblesWrap ` + colorClass + `\">\n\t\t\t\t\t<div class=\"legend\" style=\"` + size_user_name(data[i].username) + `\">Loan Workflow\n\t\t\t\t\t\t` + //toTitleCase(data[i].username) + \n\t\t\t\t\t\t// `\n\t\t\t\t\t\t// <span class=\"fa fa-thumb-tack marblesFix\" title=\"Never Hide Owner\"></span>\n\t\t\t\t\t\t// ` + disableHtml + \n\t\t\t\t\t\taddhtml+\n\t\t\t\t\t\t`\n\t\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"innerMarbleWrap\">\n\t\t\t\t\t\t<table class=\"innerMarbleContainer\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th>title</th>\n\t\t\t\t\t\t\t\t<th>balance</th>\n\t\t\t\t\t\t\t\t<th>company</th>\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<th>contact</th>\n\t\t\t\t\t\t\t\t<th>create date</th>\n\t\t\t\t\t\t\t\t<th>action</th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"noMarblesMsg hint\">you have no workflow in progress</div>\n\t\t\t\t</div>`;\n\n\t\t$('.companyPanel[company=\"' + data[i].company + '\"]').find('.ownerWrap').append(html);\n\t\t$('.companyPanel[company=\"' + data[i].company + '\"]').find('.companyVisible').html(known_companies[data[i].company].visible);\n\t\t$('.companyPanel[company=\"' + data[i].company + '\"]').find('.companyCount').html(known_companies[data[i].company].count);\n\t}\n\n\t//drag and drop marble\n\t$('.innerMarbleWrap').sortable({ connectWith: '.innerMarbleWrap', items: 'span' }).disableSelection();\n\t// $('.innerMarbleWrap').droppable({\n\t// \tdrop:\n\t// \tfunction (event, ui) {\n\t// \t\tvar marble_id = $(ui.draggable).attr('id');\n\n\t// \t\t// ------------ Delete Marble ------------ //\n\t// \t\tif ($(event.target).attr('id') === 'trashbin') {\n\t// \t\t\tconsole.log('removing marble', marble_id);\n\t// \t\t\tshow_tx_step({ state: 'building_proposal' }, function () {\n\t// \t\t\t\tvar obj = {\n\t// \t\t\t\t\ttype: 'delete_marble',\n\t// \t\t\t\t\tid: marble_id,\n\t// \t\t\t\t\tv: 1\n\t// \t\t\t\t};\n\t// \t\t\t\tws.send(JSON.stringify(obj));\n\t// \t\t\t\t$(ui.draggable).addClass('invalid bounce');\n\t// \t\t\t\trefreshHomePanel();\n\t// \t\t\t});\n\t// \t\t}\n\n\t// \t\t// ------------ Transfer Marble ------------ //\n\t// \t\telse {\n\t// \t\t\tvar dragged_owner_id = $(ui.draggable).attr('owner_id');\n\t// \t\t\tvar dropped_owner_id = $(event.target).parents('.marblesWrap').attr('owner_id');\n\n\t// \t\t\tconsole.log('dropped a marble', dragged_owner_id, dropped_owner_id);\n\t// \t\t\tif (dragged_owner_id != dropped_owner_id) {\t\t\t\t\t\t\t\t\t\t//only transfer marbles that changed owners\n\t// \t\t\t\t$(ui.draggable).addClass('invalid bounce');\n\t// \t\t\t\ttransfer_marble(marble_id, dropped_owner_id);\n\t// \t\t\t\treturn true;\n\t// \t\t\t}\n\t// \t\t}\n\t// \t}\n\t// });\n\n\t//user count\n\t$('#foundUsers').html(data.length);\n\t$('#totalUsers').html(data.length);\n}", "title": "" }, { "docid": "6faf00f8d976133835a0a7705cfa8306", "score": "0.5329994", "text": "setupUI() {\n\n\thdxAV.algStat.style.display = \"\";\n\thdxAV.algStat.innerHTML = \"Setting up\";\n hdxAV.algOptions.innerHTML = 'Order: <select id=\"traversalDiscipline\"><option value=\"BFS\">Breadth First</option><option value=\"DFS\">Depth First</option><option value=\"RFS\">Random</option></select>' +\n\t '<br /><input id=\"findConnected\" type=\"checkbox\" name=\"Find all connected components\">&nbsp;Find all connected components' +\n\t '<br />' + buildWaypointSelector(\"startPoint\", \"Start Vertex\", 0);\n// '<br /><input id=\"showDataStructure\" type=\"checkbox\" onchange=\"toggleDS()\" name=\"Show Data Structure\">Show Data Structure';\n\taddEntryToAVControlPanel(\"visiting\", visualSettings.visiting);\n\taddEntryToAVControlPanel(\"currentSpanningTree\", visualSettings.spanningTree);\n\taddEntryToAVControlPanel(\"undiscovered\", visualSettings.undiscovered);\n\taddEntryToAVControlPanel(\"discovered\", visualSettings.discovered);\n\taddEntryToAVControlPanel(\"discardedOnDiscovery\", visualSettings.discardedOnDiscovery);\n\taddEntryToAVControlPanel(\"discardedOnRemoval\", visualSettings.discarded);\n\n }", "title": "" }, { "docid": "67d4eea9e70dfb213f5591f60303d50c", "score": "0.5326398", "text": "UIInit() {}", "title": "" }, { "docid": "97e43ea2139089205161d6b7de1c78d2", "score": "0.5325079", "text": "function loadUIControls() {\n jQuery(function () {\n jQuery(\"#locationCheck\").button();\n jQuery(\"#downloadLinkContainer\").draggable();\n jQuery(\"#rerunlast\").button().click(function () {\n scaleImage('Document');\n return false;\n })\n .next()\n .button({\n text: false,\n icons: {\n primary: \"ui-icon-triangle-1-s\"\n }\n })\n .click(function () {\n var menu = jQuery(this).parent().next().show().position({\n my: \"left top\",\n at: \"left bottom\",\n of: this\n });\n\n jQuery(document).one(\"click\", function () {\n menu.hide();\n });\n\n return false;\n })\n .parent()\n .buttonset()\n .next()\n .hide()\n .menu();\n\n jQuery(\"#ctl00_onetidHeadbnnr2\").attr('src', '../Images/AppIcon.png');\n jQuery(\"#ctl00_onetidHeadbnnr2\").removeClass('ms-siteicon-img');\n jQuery(\"#ctl00_onetidHeadbnnr2\").width(80);\n });\n}", "title": "" }, { "docid": "dd8fb6fb0468af6628824dfcf27abc66", "score": "0.5324608", "text": "function SnpCreateDynamicScriptUI() \r\n{ \r\n this.windowRef = null;\r\n}", "title": "" }, { "docid": "216ff53886268838fc1cae081c15d2a2", "score": "0.53203017", "text": "function buildInterface() {\n $('#input').click(userCurves);\n $('#clear').click(userClear);\n $('#add_row').click(addRow);\n $('#remove_row').click(removeRow);\n $('#axes').click(setDimensions);\n $('#default_axes').click(defaultAxes);\n }", "title": "" }, { "docid": "a5bd1f9e9ca25d5d3dd55c813e597d62", "score": "0.53149503", "text": "function rebuildGUI() {\n\n\tif ( gui ) {\n\n\t\tgui.destroy();\n\n\t}\n\n\tparams.layer = Math.min( params.resolution, params.layer );\n\n\tgui = new GUI();\n\n\tconst generationFolder = gui.addFolder( 'generation' );\n\tgenerationFolder.add( params, 'gpuGeneration' );\n\tgenerationFolder.add( params, 'resolution', 10, 200, 1 );\n\tgenerationFolder.add( params, 'margin', 0, 1 );\n\tgenerationFolder.add( params, 'regenerate' );\n\n\tconst displayFolder = gui.addFolder( 'display' );\n\tdisplayFolder.add( params, 'mode', [ 'geometry', 'raymarching', 'layer', 'grid layers' ] ).onChange( () => {\n\n\t\trebuildGUI();\n\n\t} );\n\n\tif ( params.mode === 'layer' ) {\n\n\t\tdisplayFolder.add( params, 'layer', 0, params.resolution, 1 );\n\n\t}\n\n\tif ( params.mode === 'raymarching' ) {\n\n\t\tdisplayFolder.add( params, 'surface', - 0.2, 0.5 );\n\n\t}\n\n}", "title": "" }, { "docid": "56bc68542417d2aa5e73070a2dbcedd2", "score": "0.5311481", "text": "function UI() {} // Empty function, everything else will go inside the prototype", "title": "" }, { "docid": "73c932172249a69a85dcee85a6398a73", "score": "0.5303506", "text": "buildUIElements() {\r\n this.paper = Snap(this.parentNode);\r\n this.boundRect = new Rect_1.Rect(this.parentNode.width.baseVal.value, this.parentNode.height.baseVal.value);\r\n this.areaSelectorLayer = this.paper.g();\r\n this.areaSelectorLayer.addClass(\"areaSelector\");\r\n this.rectSelector = new RectSelector_1.RectSelector(this.parentNode, this.paper, this.boundRect, this.callbacks);\r\n this.rectCopySelector = new RectCopySelector_1.RectCopySelector(this.parentNode, this.paper, this.boundRect, new Rect_1.Rect(0, 0), this.callbacks);\r\n this.pointSelector = new PointSelector_1.PointSelector(this.parentNode, this.paper, this.boundRect, this.callbacks);\r\n this.polylineSelector = new PolylineSelector_1.PolylineSelector(this.parentNode, this.paper, this.boundRect, this.callbacks);\r\n this.polygonSelector = new PolygonSelector_1.PolygonSelector(this.parentNode, this.paper, this.boundRect, this.callbacks);\r\n this.selector = this.rectSelector;\r\n this.rectSelector.enable();\r\n this.rectCopySelector.disable();\r\n this.pointSelector.disable();\r\n this.polylineSelector.disable();\r\n this.polygonSelector.disable();\r\n this.selector.hide();\r\n this.areaSelectorLayer.add(this.rectSelector.node);\r\n this.areaSelectorLayer.add(this.rectCopySelector.node);\r\n this.areaSelectorLayer.add(this.pointSelector.node);\r\n this.areaSelectorLayer.add(this.polylineSelector.node);\r\n this.areaSelectorLayer.add(this.polygonSelector.node);\r\n }", "title": "" }, { "docid": "acee7b8c19ef66c548480971d80cbf01", "score": "0.5301711", "text": "function layout_ui(options){\r\n\t//main controls and container\r\n\tvar containers;\r\n\tvar parent;\r\n\tvar fragment = document.createDocumentFragment(); //inner parent\r\n\t//options and paranters\r\n\tvar self_options;\r\n\tvar link = this;\r\n\r\n\tlink.create = function(options){\r\n\t\tif(containers != undefined) link.remove;\r\n\t\tif(options.orientation == undefined)\toptions.orientation = false; //default orientation - vertical\r\n\t\tif(options.size == undefined)\t\t\toptions.size = [];\r\n\t\tif(options.minSize == undefined)\t\toptions.minSize = [];\r\n\r\n\t\tif(options.containers[0])\tparent = options.containers[0].parentNode;//check and set parent\r\n\t\telse\t\t\t\t\t\t{ console.warn('Please set correct parent and try create window again!'); return; };\r\n\r\n\t\tcontainers = [];\t\t\tself_options = {};\r\n\t\tself_create.containers(options);//create object for storage links\r\n\r\n\t\tlink.change(options);\r\n\t}\r\n\tlink.remove = function(){//clear containers and destroy separators\r\n\t\tfor(var i = 0; i < containers.length; i++){\r\n\t\t\tif(containers[i].rSeparator){\r\n\t\t\t\ttools.destroyHTML(containers[i].rSeparator);\r\n\t\t\t\tcontainers[i].rSeparator = undefined;\r\n\t\t\t}\r\n\t\t\tcontainers[i].html.cssText = '';\t\t\t\t\t\t\t\tcontainers[i].html.layout = undefined;\r\n\t\t\tcontainers[i].html.index = undefined;\t\t\t\t\t\t\tcontainers[i].lSeparator = undefined;\r\n\t\t}\r\n\t}\r\n\tlink.change = function(options){ \r\n\t\tif(options.orientation != undefined)\t\t\t\t\t\t\t\tself_change.set_orientation(options);\r\n\t\tif(options.size != undefined )\t\t\t\t\t\t\t\t\t\tself_change.set_size(options);\r\n\t\tif(options.minSize != undefined)\t\t\t\t\t\t\t\t\tself_change.set_minSize(options);\r\n\r\n\t\tself_change.apply_positions();\r\n\t}\r\n\r\n\tlink.show = function(html){ //show hidden container\r\n\t\thtml.layout.visible = true;\r\n\t\tself_change.apply_positions();\r\n\t}\r\n\tlink.hide = function(html){//hide visible container\r\n\t\thtml.layout.visible = false;\r\n\t\tself_change.apply_positions();\r\n\t}\r\n\r\n\tvar self_change = {\r\n\t\tapply_positions: function(){\r\n\r\n\t\t\tvar position = 0;\t\tself_options.pieces = 0;\t\t\tvar value;\r\n\t\t\tfor(var i = 0; i < containers.length; i++){ //count of size\r\n\t\t\t\tif(containers[i].visible) self_options.pieces += containers[i].size; }\r\n\r\n\t\t\tfor(var i = 0; i < containers.length; i++){\r\n\t\t\t\tif(containers[i].visible){\r\n\t\t\t\t\tif(containers[i].html.parentNode != parent){//show hidden object with change status\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tparent.appendChild(containers[i].html);\r\n\t\t\t\t\t\tif(containers[i].lSeparator)\t\t\t\tparent.appendChild(containers[i].lSeparator);\r\n\t\t\t\t\t\telse if(containers[i].rSeparator)\t\t\tparent.appendChild(containers[i].rSeparator);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif(position == 0)\t\t\t\t\t\t\t\tvalue = 0;\r\n\t\t\t\t\telse\t\t\t\t\t\t\t\t\t\t\tvalue = 'Calc(' + tools.roundPlus(position*100/self_options.pieces, 1) + '% + 3px)';\r\n\r\n\t\t\t\t\tif(self_options.orientation)\t\t\t\t\tcontainers[i].html.style.left = value;\r\n\t\t\t\t\telse\t\t\t\t\t\t\t\t\t\t\tcontainers[i].html.style.top = value;\r\n\r\n\t\t\t\t\tif(containers[i].lSeparator != undefined){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalue = 'Calc(' + tools.roundPlus(position*100/self_options.pieces, 1) + '% - 3px)';\r\n\t\t\t\t\t\t\tif(self_options.orientation)\t\t\tcontainers[i].lSeparator.style.left = value;\r\n\t\t\t\t\t\t\telse\t\t\t\t\t\t\t\t\tcontainers[i].lSeparator.style.top = value;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tposition += containers[i].size;\r\n\r\n\t\t\t\t\tif(position == self_options.pieces)\t\t\t\tvalue = 0;\r\n\t\t\t\t\telse \t\t\t\t\t\t\t\t\t\t\tvalue = 'Calc(' + tools.roundPlus(100 - position*100/self_options.pieces, 1) + '% + 3px)';\r\n\r\n\t\t\t\t\tif(self_options.orientation)\t\t\t\t\tcontainers[i].html.style.right = value;\r\n\t\t\t\t\telse\t\t\t\t\t\t\t\t\t\t\tcontainers[i].html.style.bottom = value;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif(containers[i].html.parentNode == parent){//hide object with change status\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfragment.appendChild(containers[i].html);\r\n\t\t\t\t\t\tif(containers[i].lSeparator)\t\t\t\tfragment.appendChild(containers[i].lSeparator);\r\n\t\t\t\t\t\telse if(containers[i].rSeparator)\t\t\tfragment.appendChild(containers[i].rSeparator);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar event = new CustomEvent(\"resize\", {bubbles: true, cancelable: true});\t\t\r\n\t\t\twindow.dispatchEvent(event);\r\n\t\t},\r\n\t\tset_size: function(options){\r\n\r\n\t\t\tvar size = (!self_options.orientation) ? parent.clientHeight : parent.clientWidth;\r\n\t\t\tvar spendSize = 100;\r\n\t\t\tvar itemsDefault = [];\r\n\r\n\t\t\tfor(var i = 0; i < containers.length; i++){\r\n\t\t\t\tif(options.size[i] == undefined)\t\t\t\t\titemsDefault.push(containers[i]);\r\n\t\t\t\telse {\r\n\t\t\t\t\tif(typeof options.size[i] == 'number')\t\t\tcontainers[i].size = options.size[i]; \r\n\t\t\t\t\telse if(options.size[i].indexOf('%') != -1)\t\tcontainers[i].size = parseFloat(options.size[i].substring(0, options.size[i].indexOf('%')));\r\n\t\t\t\t\telse if(options.size[i].indexOf('px') != -1)\tcontainers[i].size = tools.roundPlus( parseFloat(options.size[i].substring(0, options.size[i].indexOf('px')))*100/size, 2 );\r\n\t\t\t\t\tspendSize += - containers[i].size;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(itemsDefault.length != 0){\r\n\t\t\t\tspendSize = tools.roundPlus(spendSize/itemsDefault.length, 2);\r\n\t\t\t\tif(spendSize < 5) spendSize = 5;\r\n\t\t\t\tfor(var i = 0; i < itemsDefault.length; i++)\t\titemsDefault[i].size = spendSize;\r\n\t\t\t}\r\n\r\n\t\t},\r\n\t\tset_minSize: function(options){\r\n\t\t\tfor(var i = 0; i < containers.length; i++){\r\n\t\t\t\tif(options.minSize[i] == undefined)\t\t\t\t\tcontainers[i].minSize = {value: 5, units: true};\r\n\t\t\t\telse if(typeof options.minSize[i] == 'number')\t\tcontainers[i].minSize = {value: options.minSize[i], units: true};\r\n\t\t\t\telse if(options.minSize[i].indexOf('%') != -1)\t\tcontainers[i].minSize = {value: parseFloat(options.minSize[i].substring(0, options.minSize[i].indexOf('%'))), units:true};\r\n\t\t\t\telse if(options.minSize[i].indexOf('px') != -1)\t\tcontainers[i].minSize = {value: parseFloat(options.minSize[i].substring(0, options.minSize[i].indexOf('px'))), units:false};\r\n\r\n\t\t\t}\r\n\t\t},\r\n\t\tset_orientation: function(options){\r\n\t\t\tif(self_options.orientation !== options.orientation){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tself_options.orientation = options.orientation;\r\n\t\t\t\tfor(var i = 0; i < containers.length; i++){\r\n\t\t\t\t\tif(self_options.orientation)\t\t\t\t\tcontainers[i].html.style.cssText = 'position: absolute; height: 100%; width: auto; top: 0';\r\n\t\t\t\t\telse \t\t\t\t\t\t\t\t\t\t\tcontainers[i].html.style.cssText = 'position: absolute; width: 100%; height: auto; left: 0';\r\n\r\n\t\t\t\t\tif( i < options.containers.length - 1){\r\n\t\t\t\t\t\tif(self_options.orientation)\t\t\t\tcontainers[i].rSeparator.style.cssText = 'height: 100%; top: 0; width: 6px; cursor: e-resize;';\r\n\t\t\t\t\t\telse\t\t\t\t\t\t\t\t\t\tcontainers[i].rSeparator.style.cssText = 'width: 100%; left: 0; height: 6px; cursor: s-resize;';\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\tvar self_create = {\r\n\t\tcontainers: function(options){\r\n\t\t\tfor(var i = 0; i < options.containers.length; i++){\r\n\t\t\t\tcontainers[i] = { html: options.containers[i], index: i, visible: true};\r\n\t\t\t\tcontainers[i].html.layout = containers[i];\r\n\t\t\t\t\r\n\t\t\t\tif( i != 0)\tcontainers[i].lSeparator = containers[i - 1].rSeparator;\r\n\t\t\t\tif( i < options.containers.length - 1){\r\n\t\t\t\t\tcontainers[i].rSeparator = tools.createHTML({tag:'div', parent: parent, className: 'layout-separator', onmousedown: resize.mdown});\r\n\t\t\t\t\tcontainers[i].rSeparator.index = i;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tvar resize = new function(){\r\n\t\tvar self;\r\n\t\tthis.mdown = function(event){\r\n\t\t\tvar separator = tools.closest(event.target, 'layout-separator');\r\n\t\t\tself = {separator: separator, event: event};\r\n\t\t\tif(self_options.orientation)\tself.size = parent.clientWidth;\r\n\t\t\telse\t\t\t\t\t\t\tself.size = parent.clientHeight;\r\n\r\n\t\t \tfor(var i = separator.index + 1; i < containers.length; i++){\r\n\t\t \t\tif(containers[i].visible){\r\n\t\t \t\t\tself.right_containers = containers[i];\r\n\t\t \t\t\tbreak;\r\n\t\t \t\t}\r\n\t \t\t}\r\n\t \t\tfor(var i = separator.index; i >= 0; i--){\r\n\t\t \t\tif(containers[i].visible){\r\n\t\t \t\t\tself.left_containers = containers[i];\r\n\t\t \t\t\tbreak;\r\n\t\t \t\t}\r\n\t \t\t}\r\n\t \t\tself.left = 0;\r\n\t \t\tfor(var i = 0; i < self.left_containers.index; i++){\r\n\t \t\t\tif(containers[i].visible) self.left = containers[i].size;\r\n\t \t\t}\r\n\t \t\tself.min_left \t= (self.left_containers.minSize.units) ? (self.left_containers.minSize.value) : (tools.roundPlus((self.left_containers.minSize.value*100)/self.size, 1));\r\n\t \t\tself.min_right \t= (self.right_containers.minSize.units) ? (self.right_containers.minSize.value) : (tools.roundPlus((self.right_containers.minSize.value*100)/self.size, 1));\r\n\r\n\t \t\tself.position\t= tools.roundPlus((self.left + self.left_containers.size)*100/self_options.pieces - 3*100/self.size, 1);\r\n\t \t\tself.right\t\t= tools.roundPlus((self.left + self.left_containers.size + self.right_containers.size)*100/self_options.pieces, 1) - self.min_right;\r\n\t \t\tself.left\t\t= tools.roundPlus((self.left * 100 / self_options.pieces), 1) + self.min_left;\r\n\r\n\t\t\twindow.addEventListener(\"mousemove\", mmove);\r\n\t\t\twindow.addEventListener(\"mouseup\", mup);\r\n\t\t}\r\n\r\n\t\tfunction mmove(event){\r\n\t\t\tif(!self.line){\r\n\t\t\t\tif(Math.abs(self.event.pageX - event.pageX) > 3 || Math.abs(self.event.pageY - event.pageY) > 3 ){\r\n\t\t\t\t\tif(self_options.orientation){\t\tself.line\t\t\t\t\t= tools.createHTML({tag: 'div', parent: parent, className: 'layout-splitter', style: ('cursor: e-resize; height: 100%; top: 0; width: 6px; left: 0;')});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttools.startBackdrop({cursor: 'e-resize'});\r\n\t\t\t\t\t} else {\t\t\t\t\t\t\tself.line\t\t\t\t\t= tools.createHTML({tag: 'div', parent: parent, className: 'layout-splitter', style: ('cursor: s-resize; width: 100%; left: 0; height: 6px; top: 0;')});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttools.startBackdrop({cursor: 's-resize'});\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(self.line){\r\n\t\t\t\tif(self_options.orientation)\t\t\tself.new_position\t\t\t= self.position - tools.roundPlus((self.event.pageX - event.pageX)*100/self.size, 1);\r\n\t\t\t\telse\t\t\t\t\t\t\t\t\tself.new_position\t\t\t= self.position - tools.roundPlus((self.event.pageY - event.pageY)*100/self.size, 1);\r\n\t\t\t\tif(self.new_position < self.left)\t\tself.new_position\t\t\t= self.left;\r\n\t\t\t\telse if(self.new_position > self.right)\tself.new_position\t\t\t= self.right;\r\n\t\t\t\tif(self_options.orientation)\t\t\tself.line.style.transform\t= 'translate(' + Math.round((self.new_position*self.size)/100) + 'px, 0)';\r\n\t\t\t\telse\t\t\t\t\t\t\t\t\tself.line.style.transform\t= 'translate(0, ' + Math.round((self.new_position*self.size)/100) + 'px)';\r\n\t\t\t}\r\n\t\t}\r\n\t\tfunction mup(event){\r\n\t\t\tif(self.line){\r\n\t\t\t\ttools.endBackdrop();\r\n\r\n\t\t\t\tfor(var i = 0; i < containers.length; i++)\r\n\t\t\t\t\tcontainers[i].size = Math.round(containers[i].size*1000/self_options.pieces);\r\n\r\n\t\t\t\tself.left_containers.size = Math.round((self.new_position - self.left + self.min_left)*10);\r\n\t\t\t\tself.right_containers.size = Math.round((self.right + self.min_right - self.new_position)*10); \r\n\r\n\t\t\t\ttools.destroyHTML(self.line);\r\n\t\t\t\tself_change.apply_positions();\r\n\t\t\t}\r\n\t\t\twindow.removeEventListener(\"mousemove\", mmove);\r\n\t\t\twindow.removeEventListener(\"mouseup\", mup);\r\n\t\t\tself = undefined;\r\n\t\t}\r\n\t}\r\n\tlink.create( (!options) ? {} : options );\r\n}", "title": "" }, { "docid": "20bbff103c740d1aa5b4412eb341bef5", "score": "0.5275728", "text": "function IntiateUI() {\n gui = createGui();\n\n sliderRange(0, 7, 0.05);\n gui.addGlobals('canvasAngle');\n\n sliderRange(20, 120, 1);\n gui.addGlobals('cubeAmount');\n\n sliderRange(50, 300, 1);\n gui.addGlobals('maxDistance');\n\n sliderRange(1, 10, .2);\n gui.addGlobals('amplitude');\n\n sliderRange(0, 255, 1);\n gui.addGlobals('backgroundColor');\n}", "title": "" }, { "docid": "53487df5a19063ba34a7a9b608c0031c", "score": "0.52682114", "text": "get control() {\n new zebra.ui.Panel(this.settings);\n }", "title": "" }, { "docid": "5ccc7091ef18759f11366d7a6276aedc", "score": "0.5247913", "text": "build() {\n \n // create a container for the button and label\n this.moduleContainer = document.createElement(\"div\");\n this.moduleContainer.id = this.moduleID;\n\n // create a row for flex styling\n this.deselectButtonRow = document.createElement(\"div\");\n this.deselectButtonRow.id = \"deselectButtonRow\";\n this.moduleContainer.appendChild(this.deselectButtonRow);\n\n // create the deselect button\n this.deselectButton = document.createElement(\"img\");\n this.deselectButton.src = \"https://formit3d.github.io/FormItExamplePlugins/SharedPluginFiles/img/remove_blue.png\";\n this.deselectButton.id = \"deselectButton\";\n this.deselectButton.title = \"Click to remove this object type from the current selection.\"\n this.deselectButtonRow.appendChild(this.deselectButton);\n\n // create the button label\n this.deselectButtonLabel = document.createElement(\"div\");\n this.deselectButtonLabel.innerHTML = this.buttonLabelText;\n this.deselectButtonLabel.id = this.buttonLabelID;\n this.deselectButtonRow.appendChild(this.deselectButtonLabel);\n\n return this.moduleContainer;\n }", "title": "" }, { "docid": "1f3440513544393ba0e921aba477352f", "score": "0.52391183", "text": "setupUI() {\n\n let newAO;\n // Build HTML for AV options, which may consist of checkboxes,\n // scrolling number boxes, or a comboboxes, see existing AVs for\n\t// many examples\n\n hdxAV.algOptions.innerHTML = newAO;\n\n // Insert entries into the AV control panel to display data\n // structures and variables as the AV is executing\n hdxAVCP.add(\"undiscovered\", visualSettings.undiscovered); \n hdxAVCP.add(\"visiting\", visualSettings.visiting)\n \n }", "title": "" }, { "docid": "df73625981f71261acdb78715a51f560", "score": "0.52384174", "text": "function UI() {\n\n}", "title": "" }, { "docid": "e7d38ceff44045c58f7a9226e060c0ea", "score": "0.52370024", "text": "function createUIPanel($container) {\n\t$container.empty();\n\t// heading\n\t$container.append($('<h2>').html('Sort Options Panel'));\n\n\t// short list size\n\t$container.append('Short List Size:');\n\t$shortListInput = $('<input>').attr({\n\t\t\ttype: 'text',\n\t\t\tvalue: defaultShortListSize\n\t\t});\n\t$container.append($shortListInput);\n\n\t// sort options stuff\n\t$optionsList = $('<ul>').\n\t\t\tappend(createSortOptionSet(1)).\n\t\t\tappend(createSortOptionSet(2)).\n\t\t\tappend(createSortOptionSet(3));\n\t$container.append($optionsList);\n\n}", "title": "" } ]
00ceadb233e141702ccac9a2197077e8
For UTF16LE we do not explicitly append special replacement characters if we end on a partial character, we simply let v8 handle that.
[ { "docid": "844e6101ec179c7ffa52a9038d8e53b9", "score": "0.521007", "text": "function utf16End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) {\n var end = this.lastTotal - this.lastNeed;\n return r + this.lastChar.toString('utf16le', 0, end);\n }\n return r;\n}", "title": "" } ]
[ { "docid": "00a3a96c1399e9232ede43b5b08be94d", "score": "0.61751723", "text": "function $lrG1$var$utf16Text(buf, i) {\n if ((buf.length - i) % 2 === 0) {\n var r = buf.toString('utf16le', i);\n\n if (r) {\n var c = r.charCodeAt(r.length - 1);\n\n if (c >= 0xD800 && c <= 0xDBFF) {\n this.lastNeed = 2;\n this.lastTotal = 4;\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n return r.slice(0, -1);\n }\n }\n\n return r;\n }\n\n this.lastNeed = 1;\n this.lastTotal = 2;\n this.lastChar[0] = buf[buf.length - 1];\n return buf.toString('utf16le', i, buf.length - 1);\n} // For UTF-16LE we do not explicitly append special replacement characters if we", "title": "" }, { "docid": "4e28a67b8952042686dcb06abe5ae50c", "score": "0.6171606", "text": "function exchange_chars_utf8(str){\n var newstr = str;\n var bad_chars = [\n chr(0x00C9).concat(\"o\"), chr(0x00C9).concat(\"O\"), chr(0x00C9).concat(\"a\"),\n chr(0x00C9).concat(\"A\"), chr(0x00C9).concat(\"u\"), chr(0x00C9).concat(\"U\"),\n chr(137), chr(136), chr(251) , chr(194).concat(\"a\") ,\n chr(194).concat(\"i\"), chr(194).concat(\"e\"), chr(208).concat(\"c\"), chr(194).concat(\"E\"),\n chr(207).concat(\"c\"), chr(207).concat(\"s\"), chr(207).concat(\"S\"), chr(201).concat(\"i\"),\n chr(200).concat(\"e\"), chr(193).concat(\"e\"), chr(193).concat(\"a\"), chr(193).concat(\"i\"),\n chr(193).concat(\"o\"), chr(193).concat(\"u\"), chr(195).concat(\"u\"), chr(201).concat(\"e\"),\n chr(195).concat(chr(194)), \"&amp;#263;\", \"ä\"\n ];\n // console.log(bad_chars);\n var rep_chars = [\n \"ö\", \"Ö\", \"ä\",\n \"Ä\", \"ü\", \"Ü\",\n \"\" , \"\" , \"ß\", \"á\",\n \"í\", \"é\", \"ç\", \"É\",\n \"č\", \"š\", \"Š\", \"ï\",\n \"ë\", \"è\", \"à\", \"ì\",\n \"ò\", \"ú\", \"û\", \"ë\",\n \"ä\", \"ć\", \"ä\"\n ];\n if(bad_chars.length != rep_chars.length){\n //error\n }\n else{\n var regex;\n for(var i = 0; i < rep_chars.length;i++){\n regex = new RegExp(bad_chars[i], \"g\");\n newstr = newstr.replace(regex, rep_chars[i]);\n }\n }\n return newstr;\n\n}", "title": "" }, { "docid": "0d197f771bcdd1c2c6e9d953f1145c8d", "score": "0.61674815", "text": "function Utf16BeEncoding()\r\n{\r\n // note: false means big-endian.\r\n var myUtf16EncodingBase = new Utf16EncodingBase(false);\r\n \r\n this.stringFromBytes = function(dynamicDataView, beginIdx, size)\r\n {\r\n return myUtf16EncodingBase.stringFromBytes(dynamicDataView, beginIdx, size);\r\n }\r\n \r\n this.stringToBytes = function(dynamicDataView, beginIdx, str)\r\n {\r\n return myUtf16EncodingBase.stringToBytes(dynamicDataView, beginIdx, str);\r\n }\r\n}", "title": "" }, { "docid": "27fc9ca10cd05fc9d3468431399966a7", "score": "0.61585945", "text": "function utf16Text(buf,i){if((buf.length-i)%2===0){var r=buf.toString('utf16le',i);if(r){var c=r.charCodeAt(r.length-1);if(c>=0xD800&&c<=0xDBFF){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1];return r.slice(0,-1);}}return r;}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=buf[buf.length-1];return buf.toString('utf16le',i,buf.length-1);}// For UTF-16LE we do not explicitly append special replacement characters if we", "title": "" }, { "docid": "27fc9ca10cd05fc9d3468431399966a7", "score": "0.61585945", "text": "function utf16Text(buf,i){if((buf.length-i)%2===0){var r=buf.toString('utf16le',i);if(r){var c=r.charCodeAt(r.length-1);if(c>=0xD800&&c<=0xDBFF){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1];return r.slice(0,-1);}}return r;}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=buf[buf.length-1];return buf.toString('utf16le',i,buf.length-1);}// For UTF-16LE we do not explicitly append special replacement characters if we", "title": "" }, { "docid": "6a1bd3dde2a8b3a40712f3b7ce29c667", "score": "0.60820246", "text": "function Utf16LeEncoding()\r\n{\r\n // note: true means little-endian.\r\n var myUtf16EncodingBase = new Utf16EncodingBase(true);\r\n \r\n this.stringFromBytes = function(dynamicDataView, beginIdx, size)\r\n {\r\n return myUtf16EncodingBase.stringFromBytes(dynamicDataView, beginIdx, size);\r\n }\r\n \r\n this.stringToBytes = function(dynamicDataView, beginIdx, str)\r\n {\r\n return myUtf16EncodingBase.stringToBytes(dynamicDataView, beginIdx, str);\r\n }\r\n}", "title": "" }, { "docid": "7d3b3badeaf8604338f5d1b010f690f5", "score": "0.60431814", "text": "function Utf8Encoding()\r\n{\r\n this.stringFromBytes = function(dynamicDataView, beginIdx, size)\r\n {\r\n var aResult = \"\";\r\n var aCode;\r\n var i;\r\n var aValue;\r\n for (i = 0; i < size; i++)\r\n {\r\n aValue = dynamicDataView.getUint8(beginIdx + i);\r\n\r\n // If one byte character.\r\n if (aValue <= 0x7f)\r\n {\r\n aResult += String.fromCharCode(aValue);\r\n }\r\n // If mutlibyte character.\r\n else if (aValue >= 0xc0)\r\n {\r\n // 2 bytes.\r\n if (aValue < 0xe0)\r\n {\r\n aCode = ((dynamicDataView.getUint8(beginIdx + i++) & 0x1f) << 6) |\r\n (dynamicDataView.getUint8(beginIdx + i) & 0x3f);\r\n }\r\n // 3 bytes.\r\n else if (aValue < 0xf0)\r\n {\r\n aCode = ((dynamicDataView.getUint8(beginIdx + i++) & 0x0f) << 12) |\r\n ((dynamicDataView.getUint8(beginIdx + i++) & 0x3f) << 6) |\r\n (dynamicDataView.getUint8(beginIdx + i) & 0x3f);\r\n }\r\n // 4 bytes.\r\n else\r\n {\r\n // turned into two characters in JS as surrogate pair\r\n aCode = (((dynamicDataView.getUint8(beginIdx + i++) & 0x07) << 18) |\r\n ((dynamicDataView.getUint8(beginIdx + i++) & 0x3f) << 12) |\r\n ((dynamicDataView.getUint8(beginIdx + i++) & 0x3f) << 6) |\r\n (dynamicDataView.getUint8(beginIdx + i) & 0x3f)) - 0x10000;\r\n // High surrogate\r\n aResult += String.fromCharCode(((aCode & 0xffc00) >>> 10) + 0xd800);\r\n // Low surrogate\r\n aCode = (aCode & 0x3ff) + 0xdc00;\r\n }\r\n aResult += String.fromCharCode(aCode);\r\n } // Otherwise it's an invalid UTF-8, skipped.\r\n }\r\n \r\n return aResult;\r\n }\r\n \r\n this.stringToBytes = function(dynamicDataView, beginIdx, str)\r\n {\r\n var aLength = str.length;\r\n var aResultSize = 0;\r\n var aCode;\r\n var i;\r\n for (i = 0; i < aLength; i++)\r\n {\r\n aCode = str.charCodeAt(i);\r\n if (aCode <= 0x7f)\r\n {\r\n dynamicDataView.setUint8(beginIdx + aResultSize++, aCode);\r\n }\r\n // 2 bytes \r\n else if (aCode <= 0x7ff)\r\n {\r\n dynamicDataView.setUint8(beginIdx + aResultSize++, 0xc0 | (aCode >>> 6 & 0x1f));\r\n dynamicDataView.setUint8(beginIdx + aResultSize++, 0x80 | (aCode & 0x3f));\r\n }\r\n // 3 bytes\r\n else if (aCode <= 0xd700 || aCode >= 0xe000)\r\n {\r\n dynamicDataView.setUint8(beginIdx + aResultSize++, 0xe0 | (aCode >>> 12 & 0x0f));\r\n dynamicDataView.setUint8(beginIdx + aResultSize++, 0x80 | (aCode >>> 6 & 0x3f));\r\n dynamicDataView.setUint8(beginIdx + aResultSize++, 0x80 | (aCode & 0x3f));\r\n }\r\n else\r\n // 4 bytes, surrogate pair\r\n {\r\n aCode = (((aCode - 0xd800) << 10) | (str.charCodeAt(++i) - 0xdc00)) + 0x10000;\r\n dynamicDataView.setUint8(beginIdx + aResultSize++, 0xf0 | (aCode >>> 18 & 0x07));\r\n dynamicDataView.setUint8(beginIdx + aResultSize++, 0x80 | (aCode >>> 12 & 0x3f));\r\n dynamicDataView.setUint8(beginIdx + aResultSize++, 0x80 | (aCode >>> 6 & 0x3f));\r\n dynamicDataView.setUint8(beginIdx + aResultSize++, 0x80 | (aCode & 0x3f));\r\n }\r\n }\r\n \r\n return aResultSize;\r\n }\r\n}", "title": "" }, { "docid": "16101f6afcbf48fbe0b28ce3133011c2", "score": "0.5880185", "text": "function utf16Text(buf, i) {\n if ((buf.length - i) % 2 === 0) {\n var r = buf.toString('utf16le', i);\n\n if (r) {\n var c = r.charCodeAt(r.length - 1);\n\n if (c >= 0xD800 && c <= 0xDBFF) {\n this.lastNeed = 2;\n this.lastTotal = 4;\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n return r.slice(0, -1);\n }\n }\n\n return r;\n }\n\n this.lastNeed = 1;\n this.lastTotal = 2;\n this.lastChar[0] = buf[buf.length - 1];\n return buf.toString('utf16le', i, buf.length - 1);\n} // For UTF-16LE we do not explicitly append special replacement characters if we", "title": "" }, { "docid": "16101f6afcbf48fbe0b28ce3133011c2", "score": "0.5880185", "text": "function utf16Text(buf, i) {\n if ((buf.length - i) % 2 === 0) {\n var r = buf.toString('utf16le', i);\n\n if (r) {\n var c = r.charCodeAt(r.length - 1);\n\n if (c >= 0xD800 && c <= 0xDBFF) {\n this.lastNeed = 2;\n this.lastTotal = 4;\n this.lastChar[0] = buf[buf.length - 2];\n this.lastChar[1] = buf[buf.length - 1];\n return r.slice(0, -1);\n }\n }\n\n return r;\n }\n\n this.lastNeed = 1;\n this.lastTotal = 2;\n this.lastChar[0] = buf[buf.length - 1];\n return buf.toString('utf16le', i, buf.length - 1);\n} // For UTF-16LE we do not explicitly append special replacement characters if we", "title": "" }, { "docid": "037ce98dd84f7c53d19c79a5c9b4fceb", "score": "0.5810663", "text": "function escapeUTF8(data) {\n return data.replace(xmlReplacer, singleCharReplacer);\n}", "title": "" }, { "docid": "037ce98dd84f7c53d19c79a5c9b4fceb", "score": "0.5810663", "text": "function escapeUTF8(data) {\n return data.replace(xmlReplacer, singleCharReplacer);\n}", "title": "" }, { "docid": "037ce98dd84f7c53d19c79a5c9b4fceb", "score": "0.5810663", "text": "function escapeUTF8(data) {\n return data.replace(xmlReplacer, singleCharReplacer);\n}", "title": "" }, { "docid": "037ce98dd84f7c53d19c79a5c9b4fceb", "score": "0.5810663", "text": "function escapeUTF8(data) {\n return data.replace(xmlReplacer, singleCharReplacer);\n}", "title": "" }, { "docid": "037ce98dd84f7c53d19c79a5c9b4fceb", "score": "0.5810663", "text": "function escapeUTF8(data) {\n return data.replace(xmlReplacer, singleCharReplacer);\n}", "title": "" }, { "docid": "037ce98dd84f7c53d19c79a5c9b4fceb", "score": "0.5810663", "text": "function escapeUTF8(data) {\n return data.replace(xmlReplacer, singleCharReplacer);\n}", "title": "" }, { "docid": "037ce98dd84f7c53d19c79a5c9b4fceb", "score": "0.5810663", "text": "function escapeUTF8(data) {\n return data.replace(xmlReplacer, singleCharReplacer);\n}", "title": "" }, { "docid": "7fe26d016d9287e430b5835e2b789bca", "score": "0.57894856", "text": "function escapeUTF8(data) {\n return data.replace(xmlReplacer, singleCharReplacer);\n}", "title": "" }, { "docid": "7fe26d016d9287e430b5835e2b789bca", "score": "0.57894856", "text": "function escapeUTF8(data) {\n return data.replace(xmlReplacer, singleCharReplacer);\n}", "title": "" }, { "docid": "a4e318a12df60b37ba2bc996375ec1b8", "score": "0.57424927", "text": "function utf16EncodeAsString(codePoint) {\n ts.Debug.assert(0x0 <= codePoint && codePoint <= 0x10FFFF);\n if (codePoint <= 65535) {\n return String.fromCharCode(codePoint);\n }\n var codeUnit1 = Math.floor((codePoint - 65536) / 1024) + 0xD800;\n var codeUnit2 = ((codePoint - 65536) % 1024) + 0xDC00;\n return String.fromCharCode(codeUnit1, codeUnit2);\n }", "title": "" }, { "docid": "89df06ba1764c92c2ed75d6ae6f87828", "score": "0.5709051", "text": "function encodeUTF16BE(input) {\n\t var output = '';\n\t\n\t for (var i = 0; i < input.length; i++) {\n\t var c = input.charCodeAt(i);\n\t\n\t if (c < 0xFFFF) {\n\t output += encodeUnit(c);\n\t } else {\n\t var lead = ((c - 0x10000) >> 10) + 0xD800;\n\t var trail = ((c - 0x10000) & 0x3FF) + 0xDC00;\n\t output += encodeUnit(lead);\n\t output += encodeUnit(trail);\n\t }\n\t }\n\t\n\t return output;\n\t}", "title": "" }, { "docid": "fdea900d778626676acb4aa0cc60fca3", "score": "0.5700201", "text": "function fixChar(str) {\r\n var newStr = \"\";\r\n for (var i = 0; i < str.length; i++) {\r\n var firstChar = str.charCodeAt(i);\r\n if (firstChar === 0x9 || firstChar === 0xA || firstChar === 0xD\r\n || (firstChar >= 0x20 && firstChar <= 0xD7FF)\r\n || (firstChar >= 0xE000 && firstChar <= 0xFFFD)) {\r\n newStr += str[i];\r\n continue;\r\n }\r\n if (i + 1 === str.length) {\r\n newStr += \"\\uFFFD\";\r\n return newStr;\r\n }\r\n // UTF-16 surrogate characters\r\n var secondChar = str.charCodeAt(i + 1);\r\n if ((firstChar >= 0xD800 && firstChar <= 0xDBFF)\r\n && (secondChar >= 0xDC00 && secondChar <= 0xDFFF)) {\r\n newStr += str[i] + str[i + 1];\r\n i++;\r\n continue;\r\n }\r\n newStr += \"\\uFFFD\";\r\n }\r\n return newStr;\r\n}", "title": "" }, { "docid": "ceb877464bdf69cea8ab249512f26f13", "score": "0.5644965", "text": "function replaceMisEncodedCharacters(data) {\n const replacements = {\n o_: 'ō',\n u_: 'ū',\n '&amp;': '&',\n }\n\n Object.keys(data).map(key => {\n const newData =\n data[key] &&\n data[key].replace &&\n data[key].replace(\n new RegExp(Object.keys(replacements).join('|'), 'g'),\n match => replacements[match]\n )\n\n if (newData) data[key] = newData\n })\n\n return data\n}", "title": "" }, { "docid": "11241b6ed083c11aa86ee440bf2dd050", "score": "0.56018776", "text": "function UTF16Encoding(cp) { // eslint-disable-line no-unused-vars\n\t\t// 1. Assert: 0 ≤ cp ≤ 0x10FFFF.\n\t\t// 2. If cp ≤ 0xFFFF, return cp.\n\t\tif (cp <= 0xFFFF) {\n\t\t\treturn cp;\n\t\t} else {\n\t\t\t// 3. Let cu1 be floor((cp - 0x10000) / 0x400) + 0xD800.\n\t\t\tvar cu1 = Math.floor((cp - 0x10000) / 0x400) + 0xD800;\n\t\t\t// 4. Let cu2 be ((cp - 0x10000) modulo 0x400) + 0xDC00.\n\t\t\tvar cu2 = ((cp - 0x10000) % 0x400) + 0xDC00;\n\t\t\t// 5. Return the code unit sequence consisting of cu1 followed by cu2.\n\t\t\treturn [cu1, cu2];\n\t\t}\n\t}", "title": "" }, { "docid": "f98fd1b7b90666a5f7b2f8a6eb696e00", "score": "0.55992836", "text": "function replaceCodePoint(codePoint) {\n var _a;\n if ((codePoint >= 0xd800 && codePoint <= 0xdfff) || codePoint > 0x10ffff) {\n return 0xfffd;\n }\n return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint;\n}", "title": "" }, { "docid": "8aec2f95b6c8d09a153a508b49d3d6b5", "score": "0.5561619", "text": "function utf8Text(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString('utf8',i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);buf.copy(this.lastChar,0,end);return buf.toString('utf8',i,end);}// For UTF-8, a replacement character is added when ending on a partial", "title": "" }, { "docid": "8aec2f95b6c8d09a153a508b49d3d6b5", "score": "0.5561619", "text": "function utf8Text(buf,i){var total=utf8CheckIncomplete(this,buf,i);if(!this.lastNeed)return buf.toString('utf8',i);this.lastTotal=total;var end=buf.length-(total-this.lastNeed);buf.copy(this.lastChar,0,end);return buf.toString('utf8',i,end);}// For UTF-8, a replacement character is added when ending on a partial", "title": "" }, { "docid": "7ecb0d527687cbe82a6ee82d6f4b0629", "score": "0.5555576", "text": "function utf16Text(buf,i){if((buf.length-i)%2===0){var r=buf.toString(\"utf16le\",i);if(r){var c=r.charCodeAt(r.length-1);if(c>=55296&&c<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=buf[buf.length-2];this.lastChar[1]=buf[buf.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=buf[buf.length-1];return buf.toString(\"utf16le\",i,buf.length-1)}", "title": "" }, { "docid": "cddcc53236a153fd48397cd99ee6f083", "score": "0.5552614", "text": "function nullCharacterInForeignContent(p, token) {\r\n token.chars = UNICODE.REPLACEMENT_CHARACTER;\r\n p._insertCharacters(token);\r\n}", "title": "" }, { "docid": "4b1d326abc13696f0243e061d159e2ac", "score": "0.55353796", "text": "function autoEdUnicodeControlChars(str) { //MAIN FUNCTION describes list of fixes\n \n //Removes unneeded Unicode control characters\n str = str.replace(new RegExp('\\u200E|\\uFEFF|\\u200B', 'gi'), '');\n \n return str;\n}", "title": "" }, { "docid": "628f05f432411240ec7ae4b00a593650", "score": "0.55244404", "text": "function specialreplace(ent, base){\n var chr = \"\";\n var num = parseInt(ent.replace(/[\\&\\#\\;x]/g, ''), base);\n // see [[UTF-16]] for chars outside the BMP\n // try this with Gothic letters at full volume ^_^\n if (num > 0xFFFF) {\n num -= 0x10000;\n chr = String.fromCharCode(0xD800 + (num >> 10), 0xDC00 + (num & 0x3FF)); \n } else {\n chr = String.fromCharCode(num);\n }\n if (dont_replace.indexOf(chr) == -1) {\n str = str.replace(ent, chr, \"gi\");\n }\n }", "title": "" }, { "docid": "0b64fb36963f93803f9d706290782de0", "score": "0.551858", "text": "function nullCharacterInForeignContent(p, token) {\n token.chars = UNICODE.REPLACEMENT_CHARACTER;\n p._insertCharacters(token);\n}", "title": "" }, { "docid": "0b64fb36963f93803f9d706290782de0", "score": "0.551858", "text": "function nullCharacterInForeignContent(p, token) {\n token.chars = UNICODE.REPLACEMENT_CHARACTER;\n p._insertCharacters(token);\n}", "title": "" }, { "docid": "0b64fb36963f93803f9d706290782de0", "score": "0.551858", "text": "function nullCharacterInForeignContent(p, token) {\n token.chars = UNICODE.REPLACEMENT_CHARACTER;\n p._insertCharacters(token);\n}", "title": "" }, { "docid": "0b64fb36963f93803f9d706290782de0", "score": "0.551858", "text": "function nullCharacterInForeignContent(p, token) {\n token.chars = UNICODE.REPLACEMENT_CHARACTER;\n p._insertCharacters(token);\n}", "title": "" }, { "docid": "0b64fb36963f93803f9d706290782de0", "score": "0.551858", "text": "function nullCharacterInForeignContent(p, token) {\n token.chars = UNICODE.REPLACEMENT_CHARACTER;\n p._insertCharacters(token);\n}", "title": "" }, { "docid": "0b64fb36963f93803f9d706290782de0", "score": "0.551858", "text": "function nullCharacterInForeignContent(p, token) {\n token.chars = UNICODE.REPLACEMENT_CHARACTER;\n p._insertCharacters(token);\n}", "title": "" }, { "docid": "0b64fb36963f93803f9d706290782de0", "score": "0.551858", "text": "function nullCharacterInForeignContent(p, token) {\n token.chars = UNICODE.REPLACEMENT_CHARACTER;\n p._insertCharacters(token);\n}", "title": "" }, { "docid": "0b64fb36963f93803f9d706290782de0", "score": "0.551858", "text": "function nullCharacterInForeignContent(p, token) {\n token.chars = UNICODE.REPLACEMENT_CHARACTER;\n p._insertCharacters(token);\n}", "title": "" }, { "docid": "0b64fb36963f93803f9d706290782de0", "score": "0.551858", "text": "function nullCharacterInForeignContent(p, token) {\n token.chars = UNICODE.REPLACEMENT_CHARACTER;\n p._insertCharacters(token);\n}", "title": "" }, { "docid": "0b64fb36963f93803f9d706290782de0", "score": "0.551858", "text": "function nullCharacterInForeignContent(p, token) {\n token.chars = UNICODE.REPLACEMENT_CHARACTER;\n p._insertCharacters(token);\n}", "title": "" }, { "docid": "0b64fb36963f93803f9d706290782de0", "score": "0.551858", "text": "function nullCharacterInForeignContent(p, token) {\n token.chars = UNICODE.REPLACEMENT_CHARACTER;\n p._insertCharacters(token);\n}", "title": "" }, { "docid": "0b64fb36963f93803f9d706290782de0", "score": "0.551858", "text": "function nullCharacterInForeignContent(p, token) {\n token.chars = UNICODE.REPLACEMENT_CHARACTER;\n p._insertCharacters(token);\n}", "title": "" }, { "docid": "0b64fb36963f93803f9d706290782de0", "score": "0.551858", "text": "function nullCharacterInForeignContent(p, token) {\n token.chars = UNICODE.REPLACEMENT_CHARACTER;\n p._insertCharacters(token);\n}", "title": "" }, { "docid": "0b64fb36963f93803f9d706290782de0", "score": "0.551858", "text": "function nullCharacterInForeignContent(p, token) {\n token.chars = UNICODE.REPLACEMENT_CHARACTER;\n p._insertCharacters(token);\n}", "title": "" }, { "docid": "930d246d479575da14cc6d74843a72e3", "score": "0.55127704", "text": "codeMapReplace(str, ignoreRanges = [], opt) {\n let index = 0;\n let result = '';\n const strContainsChinese = opt.fixChineseSpacing && utils_1.hasChinese(str);\n let lastCharHasChinese = false;\n for (let i = 0; i < str.length; i++) {\n // Get current character, taking surrogates in consideration\n const char = /[\\uD800-\\uDBFF]/.test(str[i]) && /[\\uDC00-\\uDFFF]/.test(str[i + 1])\n ? str[i] + str[i + 1]\n : str[i];\n let s;\n let ignoreFixingChinese = false;\n switch (true) {\n // current character is in ignored list\n case utils_1.inRange(index, ignoreRanges):\n // could be UTF-32 with high and low surrogates\n case char.length === 2 && utils_1.inRange(index + 1, ignoreRanges):\n s = char;\n // if it's the first character of an ignored string, then leave ignoreFixingChinese to true\n if (!ignoreRanges.find((range) => range[1] >= index && range[0] === index)) {\n ignoreFixingChinese = true;\n }\n break;\n default:\n s = this.map[char] || opt.unknown || '';\n }\n // fix Chinese spacing issue\n if (strContainsChinese) {\n if (lastCharHasChinese &&\n !ignoreFixingChinese &&\n !utils_1.hasPunctuationOrSpace(s)) {\n s = ' ' + s;\n }\n lastCharHasChinese = !!s && utils_1.hasChinese(char);\n }\n result += s;\n index += char.length;\n // If it's UTF-32 then skip next character\n i += char.length - 1;\n }\n return result;\n }", "title": "" }, { "docid": "81ca1d1ec254d67fbe7012ed1bfd8b70", "score": "0.5467928", "text": "function utf16End(buf){var r=buf&&buf.length?this.write(buf):'';if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r+this.lastChar.toString('utf16le',0,end);}return r;}", "title": "" }, { "docid": "81ca1d1ec254d67fbe7012ed1bfd8b70", "score": "0.5467928", "text": "function utf16End(buf){var r=buf&&buf.length?this.write(buf):'';if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r+this.lastChar.toString('utf16le',0,end);}return r;}", "title": "" }, { "docid": "421a983065c2478855cbe044712e1f68", "score": "0.5445173", "text": "function replaceChars(buffer, enc, next) {\n //Regex expression to replace it into the string\n let text = buffer.toString();\n text = text.replace(/:\\)/gi, 'joy');\n text = text.replace(/:\\(/gi, 'sorrow');\n this.push(text);\n next();\n}", "title": "" }, { "docid": "3acef2df2c1db4571bd2d6a1d2050a3a", "score": "0.54310423", "text": "function utf16End(buf){var r=buf&&buf.length?this.write(buf):\"\";if(this.lastNeed){var end=this.lastTotal-this.lastNeed;return r+this.lastChar.toString(\"utf16le\",0,end)}return r}", "title": "" }, { "docid": "600a711d4df16f9a237baa3db6aec5aa", "score": "0.5412411", "text": "function nullCharacterInForeignContent(p, token) {\n token.chars = UNICODE.REPLACEMENT_CHARACTER;\n p._insertCharacters(token);\n }", "title": "" }, { "docid": "3e631aff52aec551ab7393fda62a8b28", "score": "0.54121375", "text": "function utf8Write(view, offset, string) {\n var byteLength = view.byteLength;\n for(var i = 0, l = string.length; i < l; i++) {\n var codePoint = string.charCodeAt(i);\n\n // One byte of UTF-8\n if (codePoint < 0x80) {\n view.setUint8(offset++, codePoint >>> 0 & 0x7f | 0x00);\n continue;\n }\n\n // Two bytes of UTF-8\n if (codePoint < 0x800) {\n view.setUint8(offset++, codePoint >>> 6 & 0x1f | 0xc0);\n view.setUint8(offset++, codePoint >>> 0 & 0x3f | 0x80);\n continue;\n }\n\n // Three bytes of UTF-8.\n if (codePoint < 0x10000) {\n view.setUint8(offset++, codePoint >>> 12 & 0x0f | 0xe0);\n view.setUint8(offset++, codePoint >>> 6 & 0x3f | 0x80);\n view.setUint8(offset++, codePoint >>> 0 & 0x3f | 0x80);\n continue;\n }\n\n // Four bytes of UTF-8\n if (codePoint < 0x110000) {\n view.setUint8(offset++, codePoint >>> 18 & 0x07 | 0xf0);\n view.setUint8(offset++, codePoint >>> 12 & 0x3f | 0x80);\n view.setUint8(offset++, codePoint >>> 6 & 0x3f | 0x80);\n view.setUint8(offset++, codePoint >>> 0 & 0x3f | 0x80);\n continue;\n }\n throw new Error(\"bad codepoint \" + codePoint);\n }\n}", "title": "" }, { "docid": "a3311fcaa624251478924ed31047fdba", "score": "0.5401301", "text": "function characterReplacer(character) {\n // Replace a single character by its escaped version\n var result = escapeReplacements[character];\n if (result === undefined) {\n // Replace a single character with its 4-bit unicode escape sequence\n if (character.length === 1) {\n result = character.charCodeAt(0).toString(16);\n result = '\\\\u0000'.substr(0, 6 - result.length) + result;\n }\n // Replace a surrogate pair with its 8-bit unicode escape sequence\n else {\n result = ((character.charCodeAt(0) - 0xD800) * 0x400 +\n character.charCodeAt(1) + 0x2400).toString(16);\n result = '\\\\U00000000'.substr(0, 10 - result.length) + result;\n }\n }\n return result;\n}", "title": "" }, { "docid": "a3311fcaa624251478924ed31047fdba", "score": "0.5401301", "text": "function characterReplacer(character) {\n // Replace a single character by its escaped version\n var result = escapeReplacements[character];\n if (result === undefined) {\n // Replace a single character with its 4-bit unicode escape sequence\n if (character.length === 1) {\n result = character.charCodeAt(0).toString(16);\n result = '\\\\u0000'.substr(0, 6 - result.length) + result;\n }\n // Replace a surrogate pair with its 8-bit unicode escape sequence\n else {\n result = ((character.charCodeAt(0) - 0xD800) * 0x400 +\n character.charCodeAt(1) + 0x2400).toString(16);\n result = '\\\\U00000000'.substr(0, 10 - result.length) + result;\n }\n }\n return result;\n}", "title": "" }, { "docid": "a3311fcaa624251478924ed31047fdba", "score": "0.5401301", "text": "function characterReplacer(character) {\n // Replace a single character by its escaped version\n var result = escapeReplacements[character];\n if (result === undefined) {\n // Replace a single character with its 4-bit unicode escape sequence\n if (character.length === 1) {\n result = character.charCodeAt(0).toString(16);\n result = '\\\\u0000'.substr(0, 6 - result.length) + result;\n }\n // Replace a surrogate pair with its 8-bit unicode escape sequence\n else {\n result = ((character.charCodeAt(0) - 0xD800) * 0x400 +\n character.charCodeAt(1) + 0x2400).toString(16);\n result = '\\\\U00000000'.substr(0, 10 - result.length) + result;\n }\n }\n return result;\n}", "title": "" }, { "docid": "a3311fcaa624251478924ed31047fdba", "score": "0.5401301", "text": "function characterReplacer(character) {\n // Replace a single character by its escaped version\n var result = escapeReplacements[character];\n if (result === undefined) {\n // Replace a single character with its 4-bit unicode escape sequence\n if (character.length === 1) {\n result = character.charCodeAt(0).toString(16);\n result = '\\\\u0000'.substr(0, 6 - result.length) + result;\n }\n // Replace a surrogate pair with its 8-bit unicode escape sequence\n else {\n result = ((character.charCodeAt(0) - 0xD800) * 0x400 +\n character.charCodeAt(1) + 0x2400).toString(16);\n result = '\\\\U00000000'.substr(0, 10 - result.length) + result;\n }\n }\n return result;\n}", "title": "" }, { "docid": "da4ea795fae924d79221eeeb5ffe542b", "score": "0.5399406", "text": "function nullCharacterInForeignContent(p, token) {\n token.chars = unicode.REPLACEMENT_CHARACTER;\n p._insertCharacters(token);\n}", "title": "" }, { "docid": "da4ea795fae924d79221eeeb5ffe542b", "score": "0.5399406", "text": "function nullCharacterInForeignContent(p, token) {\n token.chars = unicode.REPLACEMENT_CHARACTER;\n p._insertCharacters(token);\n}", "title": "" }, { "docid": "da4ea795fae924d79221eeeb5ffe542b", "score": "0.5399406", "text": "function nullCharacterInForeignContent(p, token) {\n token.chars = unicode.REPLACEMENT_CHARACTER;\n p._insertCharacters(token);\n}", "title": "" }, { "docid": "da4ea795fae924d79221eeeb5ffe542b", "score": "0.5399406", "text": "function nullCharacterInForeignContent(p, token) {\n token.chars = unicode.REPLACEMENT_CHARACTER;\n p._insertCharacters(token);\n}", "title": "" }, { "docid": "8786a2a148e73c3eadbb26dd09a43d4e", "score": "0.5373433", "text": "function vchar() {\n return wrap('vchar', compareToken(function vcharFunc(tok) {\n var code = tok.charCodeAt(0);\n var accept = (0x21 <= code && code <= 0x7E);\n if (opts.rfc6532) {\n accept = accept || isUTF8NonAscii(tok);\n }\n return accept;\n }));\n }", "title": "" }, { "docid": "8786a2a148e73c3eadbb26dd09a43d4e", "score": "0.5373433", "text": "function vchar() {\n return wrap('vchar', compareToken(function vcharFunc(tok) {\n var code = tok.charCodeAt(0);\n var accept = (0x21 <= code && code <= 0x7E);\n if (opts.rfc6532) {\n accept = accept || isUTF8NonAscii(tok);\n }\n return accept;\n }));\n }", "title": "" }, { "docid": "8786a2a148e73c3eadbb26dd09a43d4e", "score": "0.5373433", "text": "function vchar() {\n return wrap('vchar', compareToken(function vcharFunc(tok) {\n var code = tok.charCodeAt(0);\n var accept = (0x21 <= code && code <= 0x7E);\n if (opts.rfc6532) {\n accept = accept || isUTF8NonAscii(tok);\n }\n return accept;\n }));\n }", "title": "" }, { "docid": "8786a2a148e73c3eadbb26dd09a43d4e", "score": "0.5373433", "text": "function vchar() {\n return wrap('vchar', compareToken(function vcharFunc(tok) {\n var code = tok.charCodeAt(0);\n var accept = (0x21 <= code && code <= 0x7E);\n if (opts.rfc6532) {\n accept = accept || isUTF8NonAscii(tok);\n }\n return accept;\n }));\n }", "title": "" }, { "docid": "d5a4a85870eef90f87d33dd77ed3fe14", "score": "0.5371801", "text": "function escapeString(s) {\n s = escapedCharsRegExp.test(s) ? s.replace(escapedCharsRegExp, getReplacement) : s;\n return s;\n function getReplacement(c) {\n return escapedCharsMap[c] || get16BitUnicodeEscapeSequence(c.charCodeAt(0));\n }\n }", "title": "" }, { "docid": "8403696de45c70415b516480b574a0e3", "score": "0.53471714", "text": "function r(e){\n // if variant is present as \\uFE0F\n return m(e.indexOf(y)<0?e.replace(b,\"\"):e)}", "title": "" }, { "docid": "048ccf2d7da88d741735a43368ee3435", "score": "0.53301877", "text": "function nullCharacterInForeignContent(p, token) {\n token.chars = REPLACEMENT_CHARACTER;\n p._insertCharacters(token);\n}", "title": "" }, { "docid": "e2d81c2cb872e0e3294f40533cd28d37", "score": "0.5324513", "text": "function utf16End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) {\n var end = this.lastTotal - this.lastNeed;\n return r + this.lastChar.toString('utf16le', 0, end);\n }\n return r;\n }", "title": "" }, { "docid": "97f541cc93519b8fbd669630989019c5", "score": "0.53172266", "text": "function UnescapeSpecialChars(text) {\n\ntext = text.replace(/7f8137798425a7fed2b8c5703b70d078/gm, \"\\\\\")\ntext = text.replace(/833344d5e1432da82ef02e1301477ce8/gm, \"`\")\ntext = text.replace(/3389dae361af79b04c9c8e7057f60cc6/gm, \"*\")\ntext = text.replace(/b14a7b8059d9c055954c92674ce60032/gm, \"_\")\ntext = text.replace(/f95b70fdc3088560732a5ac135644506/gm, \"{\")\ntext = text.replace(/cbb184dd8e05c9709e5dcaedaa0495cf/gm, \"}\")\ntext = text.replace(/815417267f76f6f460a4a61f9db75fdb/gm, \"[\")\ntext = text.replace(/0fbd1776e1ad22c59a7080d35c7fd4db/gm, \"]\")\ntext = text.replace(/84c40473414caf2ed4a7b1283e48bbf4/gm, \"(\")\ntext = text.replace(/9371d7a2e3ae86a00aab4771e39d255d/gm, \")\")\ntext = text.replace(/01abfc750a0c942167651c40d088531d/gm, \"#\")\ntext = text.replace(/5058f1af8388633f609cadb75a75dc9d/gm, \".\")\ntext = text.replace(/9033e0e305f247c0c3c80d0c7848c8b3/gm, \"!\")\ntext = text.replace(/853ae90f0351324bd73ea615e6487517/gm, \":\")\nreturn text;\n}", "title": "" }, { "docid": "a2a9374c2153ff82399d44f0bbf98755", "score": "0.53066885", "text": "parseEscapeUnicodeJSON (idx) {\n const start = idx;\n const len = this.size;\n const uson = this.input;\n\n /* At least four hexadecimal digits must be present */\n if (len - start < 4) {\n return this.parseError (USON.error.unexpectedEnd, len);\n }\n\n /* Get the code point */\n let codep = parseInt (uson.substr (start, 4), 16);\n\n if (Number.isNaN (codep)) {\n return this.parseError (USON.error.escapeUnicode, start);\n }\n\n idx += 4;\n\n /* Check if it's a surrogate */\n if ((codep & 0xF800) === 0xD800) {\n /* Must be a low surrogate */\n if ((codep & 0xFC00) !== 0xDC00) {\n return this.parseError (USON.error.escapeUnicode, start);\n }\n\n /* Get the high surrogate */\n if (len - start < 10) {\n return this.parseError (USON.error.unexpectedEnd, len);\n }\n\n if (uson[4] !== '\\\\' || uson[5] !== 'u') {\n return this.parseError (USON.error.unexpectedToken, start);\n }\n\n idx += 6;\n const high = parseInt (uson.substr (start + 6, 4), 16);\n\n if (Number.isNaN (high)) {\n return this.parseError (USON.error.escapeUnicode, idx);\n }\n\n if ((codep & 0xFC00) !== 0xD800) {\n return this.parseError (USON.error.escapeUnicode, idx);\n }\n\n codep = (((high & 0x3FF) << 10) + 0x10000) | (codep & 0x3FF);\n }\n\n if (codep > 0x10FFFF) {\n return this.parseError (USON.error.escapeUnicode, start);\n }\n\n this.pos = idx;\n\n return String.fromCodePoint (codep);\n}", "title": "" }, { "docid": "db61ba4e87a2a20bccda1bb6b5eff2ef", "score": "0.5283902", "text": "function utf16End(buf) {\n\t var r = buf && buf.length ? this.write(buf) : '';\n\t if (this.lastNeed) {\n\t var end = this.lastTotal - this.lastNeed;\n\t return r + this.lastChar.toString('utf16le', 0, end);\n\t }\n\t return r;\n\t}", "title": "" }, { "docid": "db61ba4e87a2a20bccda1bb6b5eff2ef", "score": "0.5283902", "text": "function utf16End(buf) {\n\t var r = buf && buf.length ? this.write(buf) : '';\n\t if (this.lastNeed) {\n\t var end = this.lastTotal - this.lastNeed;\n\t return r + this.lastChar.toString('utf16le', 0, end);\n\t }\n\t return r;\n\t}", "title": "" }, { "docid": "db61ba4e87a2a20bccda1bb6b5eff2ef", "score": "0.5283902", "text": "function utf16End(buf) {\n\t var r = buf && buf.length ? this.write(buf) : '';\n\t if (this.lastNeed) {\n\t var end = this.lastTotal - this.lastNeed;\n\t return r + this.lastChar.toString('utf16le', 0, end);\n\t }\n\t return r;\n\t}", "title": "" }, { "docid": "db61ba4e87a2a20bccda1bb6b5eff2ef", "score": "0.5283902", "text": "function utf16End(buf) {\n\t var r = buf && buf.length ? this.write(buf) : '';\n\t if (this.lastNeed) {\n\t var end = this.lastTotal - this.lastNeed;\n\t return r + this.lastChar.toString('utf16le', 0, end);\n\t }\n\t return r;\n\t}", "title": "" }, { "docid": "db61ba4e87a2a20bccda1bb6b5eff2ef", "score": "0.5283902", "text": "function utf16End(buf) {\n\t var r = buf && buf.length ? this.write(buf) : '';\n\t if (this.lastNeed) {\n\t var end = this.lastTotal - this.lastNeed;\n\t return r + this.lastChar.toString('utf16le', 0, end);\n\t }\n\t return r;\n\t}", "title": "" }, { "docid": "db61ba4e87a2a20bccda1bb6b5eff2ef", "score": "0.5283902", "text": "function utf16End(buf) {\n\t var r = buf && buf.length ? this.write(buf) : '';\n\t if (this.lastNeed) {\n\t var end = this.lastTotal - this.lastNeed;\n\t return r + this.lastChar.toString('utf16le', 0, end);\n\t }\n\t return r;\n\t}", "title": "" }, { "docid": "db61ba4e87a2a20bccda1bb6b5eff2ef", "score": "0.5283902", "text": "function utf16End(buf) {\n\t var r = buf && buf.length ? this.write(buf) : '';\n\t if (this.lastNeed) {\n\t var end = this.lastTotal - this.lastNeed;\n\t return r + this.lastChar.toString('utf16le', 0, end);\n\t }\n\t return r;\n\t}", "title": "" }, { "docid": "db61ba4e87a2a20bccda1bb6b5eff2ef", "score": "0.5283902", "text": "function utf16End(buf) {\n\t var r = buf && buf.length ? this.write(buf) : '';\n\t if (this.lastNeed) {\n\t var end = this.lastTotal - this.lastNeed;\n\t return r + this.lastChar.toString('utf16le', 0, end);\n\t }\n\t return r;\n\t}", "title": "" }, { "docid": "db61ba4e87a2a20bccda1bb6b5eff2ef", "score": "0.5283902", "text": "function utf16End(buf) {\n\t var r = buf && buf.length ? this.write(buf) : '';\n\t if (this.lastNeed) {\n\t var end = this.lastTotal - this.lastNeed;\n\t return r + this.lastChar.toString('utf16le', 0, end);\n\t }\n\t return r;\n\t}", "title": "" }, { "docid": "db61ba4e87a2a20bccda1bb6b5eff2ef", "score": "0.5283902", "text": "function utf16End(buf) {\n\t var r = buf && buf.length ? this.write(buf) : '';\n\t if (this.lastNeed) {\n\t var end = this.lastTotal - this.lastNeed;\n\t return r + this.lastChar.toString('utf16le', 0, end);\n\t }\n\t return r;\n\t}", "title": "" }, { "docid": "db61ba4e87a2a20bccda1bb6b5eff2ef", "score": "0.5283902", "text": "function utf16End(buf) {\n\t var r = buf && buf.length ? this.write(buf) : '';\n\t if (this.lastNeed) {\n\t var end = this.lastTotal - this.lastNeed;\n\t return r + this.lastChar.toString('utf16le', 0, end);\n\t }\n\t return r;\n\t}", "title": "" }, { "docid": "db61ba4e87a2a20bccda1bb6b5eff2ef", "score": "0.5283902", "text": "function utf16End(buf) {\n\t var r = buf && buf.length ? this.write(buf) : '';\n\t if (this.lastNeed) {\n\t var end = this.lastTotal - this.lastNeed;\n\t return r + this.lastChar.toString('utf16le', 0, end);\n\t }\n\t return r;\n\t}", "title": "" }, { "docid": "db61ba4e87a2a20bccda1bb6b5eff2ef", "score": "0.5283902", "text": "function utf16End(buf) {\n\t var r = buf && buf.length ? this.write(buf) : '';\n\t if (this.lastNeed) {\n\t var end = this.lastTotal - this.lastNeed;\n\t return r + this.lastChar.toString('utf16le', 0, end);\n\t }\n\t return r;\n\t}", "title": "" }, { "docid": "65d22dc3355dd6adf9458cc7f4993fa5", "score": "0.52773774", "text": "function f(e,t){// not handling '\\' and handling \\u2028 or \\u2029 to unicode escape sequence\n// not handling '\\' and handling \\u2028 or \\u2029 to unicode escape sequence\nreturn 8232===(-2&e)?(t?\"u\":\"\\\\u\")+(8232===e?\"2028\":\"2029\"):10===e||13===e?(t?\"\":\"\\\\\")+(10===e?\"n\":\"r\"):String.fromCharCode(e)}", "title": "" }, { "docid": "9523aeb92a30d17387bb4ba3d4315fca", "score": "0.52773327", "text": "function surprised(){\n vm.input = vm.input.concat(\"😮\");\n }", "title": "" }, { "docid": "ad064c7686a705dedeafdecd1e12f794", "score": "0.5256248", "text": "function utf16End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) {\n var end = this.lastTotal - this.lastNeed;\n return r + this.lastChar.toString('utf16le', 0, end);\n }\n return r;\n }", "title": "" }, { "docid": "283346db7f25ad534c8781e9d29b8928", "score": "0.52559596", "text": "function utf16End(buf) {\n var r = buf && buf.length ? this.write(buf) : '';\n if (this.lastNeed) {\n var end = this.lastTotal - this.lastNeed;\n return r + this.lastChar.toString('utf16le', 0, end);\n }\n return r;\n }", "title": "" }, { "docid": "7973da7c445fb5bd3a00ff2812743a3e", "score": "0.5224254", "text": "_transform(chunk, encoding, callback) {\n const transformChunk = chunk.toString()\n .replace(/[a-z]|[A-Z]|[0-9]/g, this.replaceChar);\n this.push(transformChunk)\n callback();\n }", "title": "" }, { "docid": "dab7c817b1f68a5e6403ef185b649c00", "score": "0.5223337", "text": "function replaceSpecialChars(value) {\n return value.replace(/[\\&\\:\\(\\)\\[\\\\\\/]/g, ' ').replace(/\\s{2,}/g, ' ').replace(/^\\s/, '').replace(/\\s$/, '').split(' ').join('*');\n }", "title": "" }, { "docid": "2b98b19e2918ccf2682f13da183ea21d", "score": "0.5220096", "text": "function h$encodeUtf16(str) {\n var n = 0;\n var i;\n for(i=0;i<str.length;i++) {\n var c = str.charCodeAt(i);\n if(c <= 0xFFFF) {\n n += 2;\n } else {\n n += 4;\n }\n }\n var v = h$newByteArray(n+1);\n var dv = v.dv;\n n = 0;\n for(i=0;i<str.length;i++) {\n var c = str.charCodeAt(i);\n if(c <= 0xFFFF) {\n dv.setUint16(n, c, true);\n n+=2;\n } else {\n var c0 = c - 0x10000;\n dv.setUint16(n, c0 >> 10, true);\n dv.setUint16(n+2, c0 & 0x3FF, true);\n n+=4;\n }\n }\n dv.setUint8(v.len-1,0); // terminator\n return v;\n}", "title": "" }, { "docid": "2b98b19e2918ccf2682f13da183ea21d", "score": "0.5220096", "text": "function h$encodeUtf16(str) {\n var n = 0;\n var i;\n for(i=0;i<str.length;i++) {\n var c = str.charCodeAt(i);\n if(c <= 0xFFFF) {\n n += 2;\n } else {\n n += 4;\n }\n }\n var v = h$newByteArray(n+1);\n var dv = v.dv;\n n = 0;\n for(i=0;i<str.length;i++) {\n var c = str.charCodeAt(i);\n if(c <= 0xFFFF) {\n dv.setUint16(n, c, true);\n n+=2;\n } else {\n var c0 = c - 0x10000;\n dv.setUint16(n, c0 >> 10, true);\n dv.setUint16(n+2, c0 & 0x3FF, true);\n n+=4;\n }\n }\n dv.setUint8(v.len-1,0); // terminator\n return v;\n}", "title": "" }, { "docid": "2b98b19e2918ccf2682f13da183ea21d", "score": "0.5220096", "text": "function h$encodeUtf16(str) {\n var n = 0;\n var i;\n for(i=0;i<str.length;i++) {\n var c = str.charCodeAt(i);\n if(c <= 0xFFFF) {\n n += 2;\n } else {\n n += 4;\n }\n }\n var v = h$newByteArray(n+1);\n var dv = v.dv;\n n = 0;\n for(i=0;i<str.length;i++) {\n var c = str.charCodeAt(i);\n if(c <= 0xFFFF) {\n dv.setUint16(n, c, true);\n n+=2;\n } else {\n var c0 = c - 0x10000;\n dv.setUint16(n, c0 >> 10, true);\n dv.setUint16(n+2, c0 & 0x3FF, true);\n n+=4;\n }\n }\n dv.setUint8(v.len-1,0); // terminator\n return v;\n}", "title": "" }, { "docid": "2b98b19e2918ccf2682f13da183ea21d", "score": "0.5220096", "text": "function h$encodeUtf16(str) {\n var n = 0;\n var i;\n for(i=0;i<str.length;i++) {\n var c = str.charCodeAt(i);\n if(c <= 0xFFFF) {\n n += 2;\n } else {\n n += 4;\n }\n }\n var v = h$newByteArray(n+1);\n var dv = v.dv;\n n = 0;\n for(i=0;i<str.length;i++) {\n var c = str.charCodeAt(i);\n if(c <= 0xFFFF) {\n dv.setUint16(n, c, true);\n n+=2;\n } else {\n var c0 = c - 0x10000;\n dv.setUint16(n, c0 >> 10, true);\n dv.setUint16(n+2, c0 & 0x3FF, true);\n n+=4;\n }\n }\n dv.setUint8(v.len-1,0); // terminator\n return v;\n}", "title": "" } ]
3049dd5d668f2544801c2ae26f66fa68
date from iso format
[ { "docid": "c7bd4b19b4d2ac70f83b866f00bba17f", "score": "0.0", "text": "function configFromISO(config) {\n var i, l,\n string = config._i,\n match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),\n allowTime, dateFormat, timeFormat, tzFormat;\n\n if (match) {\n getParsingFlags(config).iso = true;\n\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(match[1])) {\n dateFormat = isoDates[i][0];\n allowTime = isoDates[i][2] !== false;\n break;\n }\n }\n if (dateFormat == null) {\n config._isValid = false;\n return;\n }\n if (match[3]) {\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(match[3])) {\n // match[2] should be 'T' or space\n timeFormat = (match[2] || ' ') + isoTimes[i][0];\n break;\n }\n }\n if (timeFormat == null) {\n config._isValid = false;\n return;\n }\n }\n if (!allowTime && timeFormat != null) {\n config._isValid = false;\n return;\n }\n if (match[4]) {\n if (tzRegex.exec(match[4])) {\n tzFormat = 'Z';\n } else {\n config._isValid = false;\n return;\n }\n }\n config._f = dateFormat + (timeFormat || '') + (tzFormat || '');\n configFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n}", "title": "" } ]
[ { "docid": "3bd71ef91bce91fb08f4c1c719f03bc6", "score": "0.7526114", "text": "function formatToIsoDate(data)\n{\n return data_convertida = data.substr(6, 4) + '-' + data.substr(3, 2) + '-' + data.substr(0, 2);\n}", "title": "" }, { "docid": "e7ad224c7879a9761886f53c0b1b22f7", "score": "0.74192107", "text": "function iso2date(str)\n{\nvar t = str.split(/[- :.T]/);\n\treturn new Date(t[0], t[1]-1, t[2], t[3]||0, t[4]||0, t[5]||0);\n}", "title": "" }, { "docid": "53d53193690f0be87484c48f4c2a71f1", "score": "0.7219387", "text": "function iso_date_analyze(date) {\n var year = parseInt(date.substring(0,4));\n var month = parseInt(date.substring(5,7),10);\n var day = parseInt(date.substring(8,10),10);\n var hour = parseInt(date.substring(11,13),10);\n var minute = parseInt(date.substring(14,16),10);\n var second = parseInt(date.substring(17,19),10);\n return { \"year\": year, \"month\": month, \"day\": day, \"hour\": hour, \"minute\": minute, \"second\": second }\n}", "title": "" }, { "docid": "048ac34f1ced46f96a1d9158e439f73e", "score": "0.708989", "text": "function dateFromISO(str) {\r\n var parts = str.match(/\\d+/g);\r\n\r\n var year = parseInt(parts[0]);\r\n var month = parseInt(parts[1]) - 1;\r\n var day = parseInt(parts[2]);\r\n\r\n var date = new Date();\r\n date.setFullYear(year, month, day);\r\n return date;\r\n }", "title": "" }, { "docid": "742326e6b405a11f3e07df2c37611ff7", "score": "0.6998499", "text": "function ISODate(s) { return new Date(s); }", "title": "" }, { "docid": "5705155ca787d109488e195c1fa2b5eb", "score": "0.69687665", "text": "function dateFromISO8601(isostr) { \n var parts = isostr.match(/\\d+/g);\n return new Date(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]);\n}", "title": "" }, { "docid": "5ae5006c0492de7d6c08f5901ae0e882", "score": "0.6943686", "text": "function dateFromISO8601(isostr) {\n\t\tvar parts = isostr.match(/\\d+/g);\n\t\treturn new Date(parts[0], parts[1] - 1, parts[2], parts[3], parts[4], parts[5]);\n\t}", "title": "" }, { "docid": "cacd2d991cfc37cd507dd2707cd381ce", "score": "0.6932271", "text": "function getDateFromIsoString(s) {\n\tvar d = false;\n\tif (s.match(dateReg)) {\n\t\tvar ds = s.split(\"-\");\n\t\td = new Date(Date.UTC(ds[0],ds[1]-1,ds[2]));\n\t}\n\treturn d;\n}", "title": "" }, { "docid": "bc5f5d4c749d6b11a54f86373e534338", "score": "0.6755271", "text": "function isoDate(d) {\n return '' + d.getFullYear() + ('0'+(d.getMonth()+1)).slice(-2) + ('0'+d.getDate()).slice(-2);\n }", "title": "" }, { "docid": "e6b6651e5c2fdfe6ca27d3e6a17b731e", "score": "0.67288595", "text": "function isoDateToDateObject(isoDate){\r\n var dateObject = null;\r\n\r\n if (isoDate != null){\r\n var isoDateString = isoDate.toString();\r\n \r\n var year = isoDateString.substr(0,4);\r\n var month = isoDateString.substr(4,2);\r\n var day = isoDateString.substr(6,2);\r\n \r\n dateObject = new Date(year,month-1, day); \r\n }\r\n\r\n return dateObject;\r\n }", "title": "" }, { "docid": "d2a5235c8bc7a974fd852d07aeed702f", "score": "0.662014", "text": "function fromNaiveIso(str) {\n const b = str.split(/\\D/);\n return new Date(b[0], b[1]-1, b[2], b[3], b[4], b[5]);\n}", "title": "" }, { "docid": "34076e9a91fba97365ee7b5f5e6a1584", "score": "0.65975815", "text": "function convertISO8601Date(isoDate) {\n var dateRegex = /(\\d{4})\\-(\\d{2})\\-(\\d{2})T[\\d\\:\\+\\-]+/g;\n var dateMatcher = dateRegex.exec(isoDate);\n if (dateMatcher) {\n return [dateMatcher[1], dateMatcher[2], dateMatcher[3]].join('-');\n }\n\treturn isoDate;\n}", "title": "" }, { "docid": "2668491e198312bd6059726bd5f583df", "score": "0.65355116", "text": "function findDate() {\n var date = new Date();\n res = date.toISOString();\n isoDate = res.substring(0, 10);\n return isoDate;\n}", "title": "" }, { "docid": "e501d4b518513ebbe5107a8d5677cc0a", "score": "0.65255076", "text": "function ISOToDate(string) \n{\n\tvar dd = new Date();\n\tdd.setISO(string);\n\treturn dd;\n}", "title": "" }, { "docid": "5f93951f5025f41a641719eac752de96", "score": "0.64650655", "text": "function extractISODate(strDate) {\n\t\tvar match = /((\\d{4})-(\\d{2})-(\\d{2}))/.exec(strDate),\n\t\t\tdte = null, strRest = strDate;\n\n\t\tif (match !== null) {\n\t\t\tvar lngYear, lngMonth, lngDay, iMatch;\n\t\t\tlngYear = parseInt(match[2],10);\n\t\t\tlngMonth = parseInt(match[3],10) -1; //zero based\n\t\t\tlngDay = parseInt(match[4],10);\n\t\t\tdte = new Date(lngYear, lngMonth, lngDay);\n\t\t\tiMatch = match.index;\n\t\t\tstrRest = strDate.substring(0, iMatch) + \" \" +\n\t\t\t\tstrDate.substring(iMatch+10);\n\t\t}\n\t\treturn {\"date\":dte, \"rest\":strRest.trim()};\n\t}", "title": "" }, { "docid": "5f93951f5025f41a641719eac752de96", "score": "0.64650655", "text": "function extractISODate(strDate) {\n\t\tvar match = /((\\d{4})-(\\d{2})-(\\d{2}))/.exec(strDate),\n\t\t\tdte = null, strRest = strDate;\n\n\t\tif (match !== null) {\n\t\t\tvar lngYear, lngMonth, lngDay, iMatch;\n\t\t\tlngYear = parseInt(match[2],10);\n\t\t\tlngMonth = parseInt(match[3],10) -1; //zero based\n\t\t\tlngDay = parseInt(match[4],10);\n\t\t\tdte = new Date(lngYear, lngMonth, lngDay);\n\t\t\tiMatch = match.index;\n\t\t\tstrRest = strDate.substring(0, iMatch) + \" \" +\n\t\t\t\tstrDate.substring(iMatch+10);\n\t\t}\n\t\treturn {\"date\":dte, \"rest\":strRest.trim()};\n\t}", "title": "" }, { "docid": "797132e7fcc80ebc88c51cf3ba429699", "score": "0.6459637", "text": "static toIsoDateString(date) {\n return date.toISOString().slice(0, 10);\n }", "title": "" }, { "docid": "7af914e572c62d436e9b2807358551b7", "score": "0.6406543", "text": "function formatIso(date) {\n\t return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n\t}", "title": "" }, { "docid": "5b6388ea2d7642b40644111bca406f0d", "score": "0.6381226", "text": "function decomposeIsoDate(isoDate)\n {\n var date = new Date(isoDate);\n var dateObj = {};\n if (date) {\n dateObj.year = date.getUTCFullYear();\n dateObj.month = date.getUTCMonth(); // 0-base\n dateObj.day = date.getUTCDate();\n dateObj.hours = date.getUTCHours();\n dateObj.minutes = date.getUTCMinutes();\n dateObj.seconds = date.getUTCSeconds();\n }\n return dateObj;\n }", "title": "" }, { "docid": "3398802fecc3e7856bdac564b0d9d9cf", "score": "0.6312717", "text": "function getDateFromString(date) {\n var dateString = date.substring(0, 4) + \"-\" + date.substring(4, 6) + \"-\" + date.substring(6, 11) + \":\" + date.substring(11, 13) + \":\" + date.substring(13, 15) + \"Z\";\n console.log(dateString);\n return new Date(dateString);\n }", "title": "" }, { "docid": "2f81af7699b65c6ccc40165644d2e955", "score": "0.62925196", "text": "function parseDate(iso8601) {\n var regexp = new RegExp('^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2})' + 'T' + '([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})' + '(.([0-9]+))?' + 'Z$');\n var match = regexp.exec(iso8601);\n if (!match) {\n return null;\n }\n\n var year = match[1] || 0;\n var month = (match[2] || 1) - 1;\n var day = match[3] || 0;\n var hour = match[4] || 0;\n var minute = match[5] || 0;\n var second = match[6] || 0;\n var milli = match[8] || 0;\n\n return new Date(Date.UTC(year, month, day, hour, minute, second, milli));\n }", "title": "" }, { "docid": "e4b2786b23ea18039e6327d89c14c369", "score": "0.62635076", "text": "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "e4b2786b23ea18039e6327d89c14c369", "score": "0.62635076", "text": "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "e4b2786b23ea18039e6327d89c14c369", "score": "0.62635076", "text": "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "e4b2786b23ea18039e6327d89c14c369", "score": "0.62635076", "text": "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "e4b2786b23ea18039e6327d89c14c369", "score": "0.62635076", "text": "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "e4b2786b23ea18039e6327d89c14c369", "score": "0.62635076", "text": "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "e4b2786b23ea18039e6327d89c14c369", "score": "0.62635076", "text": "function isoStringToDate(match) {\n var date = new Date(0);\n var tzHour = 0;\n var tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n var dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n var timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n var h = Number(match[4] || 0) - tzHour;\n var m = Number(match[5] || 0) - tzMin;\n var s = Number(match[6] || 0);\n var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "7a674867203510e609ff4d325de4583c", "score": "0.62383527", "text": "function transformeDate(laDate)\n{\n return laDate.toISOString().substring(0, 19).replace('T', ' ');\n}", "title": "" }, { "docid": "87a7f9d1abdaa463c922d407391f0885", "score": "0.6213936", "text": "function toISODate(date){\n return date.getFullYear()+'-'+\n addZero(date.getMonth()+1)+'-'+\n addZero(date.getDate())+'T'+\n addZero(date.getHours())+':'+\n addZero(date.getMinutes())+':'+\n addZero(date.getSeconds())+'Z';\n}", "title": "" }, { "docid": "72dba6f278469698e465d290df47274f", "score": "0.62081796", "text": "function parseISODate(isodt) {\n var d;\n var s = (isodt || \"\").replace(/-/g,\"/\").replace(/[TZ]/g,\" \");\n var m = s.match(/(.*)([+-])(\\d\\d)(:?(\\d\\d))?$/);\n if (m) {\n d = new Date(m[1]);\n var tzH = parseInt(m[3].replace(/^0*/,\"\"));\n var tzM = parseInt(m[5].replace(/^0*/,\"\").replace(/^$/,\"0\"));\n var tzOffset = tzH * 60 + tzM;\n if (m[2] == '-')\n tzOffset *= -1;\n var offset = d.getTimezoneOffset() + tzOffset;\n if (offset != 0)\n d.setTime(d.getTime() + offset*60*1000);\n } else {\n d = new Date(s);\n }\n return d;\n}", "title": "" }, { "docid": "07ce54dd81eee9b1a407ec14bd492a73", "score": "0.6201553", "text": "function formatIso(date) {\n return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n}", "title": "" }, { "docid": "07ce54dd81eee9b1a407ec14bd492a73", "score": "0.6201553", "text": "function formatIso(date) {\n return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n}", "title": "" }, { "docid": "07ce54dd81eee9b1a407ec14bd492a73", "score": "0.6201553", "text": "function formatIso(date) {\n return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n}", "title": "" }, { "docid": "07ce54dd81eee9b1a407ec14bd492a73", "score": "0.6201553", "text": "function formatIso(date) {\n return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n}", "title": "" }, { "docid": "07ce54dd81eee9b1a407ec14bd492a73", "score": "0.6201553", "text": "function formatIso(date) {\n return new Date(date.toDateString() + ' 12:00:00 +0000').toISOString().substring(0, 10);\n}", "title": "" }, { "docid": "477b01d827e8092434ff5f7bea57ac4d", "score": "0.6187633", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "477b01d827e8092434ff5f7bea57ac4d", "score": "0.6187633", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "81fa4f6971aa8aabeb853b08a9ab2500", "score": "0.618634", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "81fa4f6971aa8aabeb853b08a9ab2500", "score": "0.618634", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 4; i > 0; i--) {\n if (match[i]) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i - 1] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "13c84fc5ada599ea3535440cac695697", "score": "0.61794", "text": "function formatDateIso(date) {\n\tif (!date || date == null) {\n\t\treturn \"\";\n\t}\n\t\n\tvar jsDate = new Date(date);\n\t\n\t// get the calendar-date components of the iso date. \n\tvar YYYY = jsDate.getFullYear();\n\tvar MM = (jsDate.getMonth() + 1) < 10 ? '0' + (jsDate.getMonth() + 1) : (jsDate.getMonth() + 1); // month should be in the form 'MM'.\n\tvar DD = jsDate.getDate() < 10 ? '0' + jsDate.getDate() : jsDate.getDate(); // day should be in the form 'DD'.\n\t\n\t// get the clock-time components of the iso date.\n\tvar hh = jsDate.getHours() < 10 ? '0' + jsDate.getHours() : jsDate.getHours(); // hours should be in the form 'hh'.\n\tvar mm = jsDate.getMinutes() < 10 ? '0' + jsDate.getMinutes() : jsDate.getMinutes(); // minutes should be in the form 'mm'.\n\tvar ss = jsDate.getSeconds() < 10 ? '0' + jsDate.getSeconds() : jsDate.getSeconds(); // seconds should be in the form 'ss'.\n\tvar sss = '000'; //just hardcoded 000 for milliseconds...\n\t\n\t// assemble the iso date from the date and time components.\n\tvar isoDate = YYYY + '-' + MM + '-' + DD + 'T' + // add the date components.\n\t\thh + ':' + mm + ':' + ss + '.' + sss + 'Z'; // add the time components.\n\t\t\n\t// return the iso-formatted version of the date.\n\treturn isoDate;\n}", "title": "" }, { "docid": "271bc3e1961fa5ca72de19de529a1be4", "score": "0.6142079", "text": "function configFromISO(config){var i,l,string=config._i,match=from_string__isoRegex.exec(string);if(match){getParsingFlags(config).iso = true;for(i = 0,l = isoDates.length;i < l;i++) {if(isoDates[i][1].exec(string)){ // match[5] should be 'T' or undefined\nconfig._f = isoDates[i][0] + (match[6] || ' ');break;}}for(i = 0,l = isoTimes.length;i < l;i++) {if(isoTimes[i][1].exec(string)){config._f += isoTimes[i][0];break;}}if(string.match(matchOffset)){config._f += 'Z';}configFromStringAndFormat(config);}else {config._isValid = false;}} // date from iso format or fallback", "title": "" }, { "docid": "f245e61f0037bd571707d4d4c27b916a", "score": "0.6111776", "text": "function decode_date(date_str) {\r\n\tvar [month, day, year] = date_str.split(\"/\");\r\n\tyear = parseInt(year) > parseInt(new Date().getFullYear().toString().substring(2)) ? year : \"20\" + year;\r\n\treturn new Date(year, month - 1, day);\r\n}", "title": "" }, { "docid": "456472630797d3d3a093075ba041f4e7", "score": "0.60922885", "text": "function dateFromISO8601(date) {\n if (typeof date !== 'string') {\n throw new CustomError('ISO 8601 wrong format » {0}', date);\n }\n var r = date.match(ISO_8601);\n if (!r) throw new CustomError('ISO 8601 wrong format » {0}', date);\n var gmt = new Date(),\n th = +r[7] || (gmt.getTimezoneOffset() / -60), //normalize the hours offset\n tm = +r[8] || (gmt.getTimezoneOffset() % -60), //normalize the minutes offset\n M = r[2] - 1,\n h = r[4] || 0,\n m = r[5] || 0,\n s = r[6] || 0,\n ms;\n if (th < 0 && tm > 0) tm = -tm; //fixes minutes offset\n ms = -60000 * (th * 60 + tm); //corrects the time offset\n gmt = new Date(Date.UTC(r[1], M, r[3], h, m, s) + ms);\n return new Date(gmt);\n }", "title": "" }, { "docid": "1119d6afb150e6db1e91effb193f7469", "score": "0.6088689", "text": "function parseIso8601(iso8601) {\n var s = $.trim(iso8601);\n s = s.replace(/-/,\"/\").replace(/-/,\"/\");\n s = s.replace(/T/,\" \").replace(/Z/,\" UTC\");\n s = s.replace(/([\\+-]\\d\\d)\\:?(\\d\\d)/,\" $1$2\"); // -04:00 -> -0400\n return new Date(s);\n}", "title": "" }, { "docid": "98d88619a188ad881a99c8e6fb38c44a", "score": "0.6084536", "text": "function aux_dateFromISO(iso_time)\n{\n MM = [\"Jan\", \"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\n \"Aug\",\"Sep\",\"Oct\",\"Nov\", \"Dec\"];\n\n iso_time += ' UTC';\n var expires = iso_time.replace(\n /(\\d{4})-(\\d{2})-(\\d{2}) (\\d{2}):(\\d{2}):(\\d{2})/,\n function($0,$1,$2,$3,$4,$5,$6){\n return $3 + \" \" + MM[$2-1] + \" \" + $1 + \" \" + $4 + \":\" +$5 + \":\" + $6;\n }\n )\n\n var d = new Date();\n d.setTime(Date.parse(expires))\n return d;\n}", "title": "" }, { "docid": "e3a200e9b3d5d01a3696a437b5c1bf10", "score": "0.60761553", "text": "function getMyDateIsoString (ts) {\n var dateIso = new Date(ts * 1000).toISOString();\n return dateIso.slice(0, 10) + ' ' + dateIso.slice(11, 19) + ' z';\n }", "title": "" }, { "docid": "9cea93fdd5a6b7d51a0102d8c78a7d77", "score": "0.6074163", "text": "static dateToISOString(date) {\n return moment(date).format('YYYY-MM-DD');\n }", "title": "" }, { "docid": "3e067a7863fdcb41e8deffbc262d3d7b", "score": "0.6073136", "text": "function parseISO(config) {\nvar i, l,\nstring = config._i,\nmatch = isoRegex.exec(string);\nif (match) {\nconfig._pf.iso = true;\nfor (i = 0, l = isoDates.length; i < l; i++) {\nif (isoDates[i][1].exec(string)) {\n// match[5] should be 'T' or undefined\nconfig._f = isoDates[i][0] + (match[6] || ' ');\nbreak;\n}\n}\nfor (i = 0, l = isoTimes.length; i < l; i++) {\nif (isoTimes[i][1].exec(string)) {\nconfig._f += isoTimes[i][0];\nbreak;\n}\n}\nif (string.match(parseTokenTimezone)) {\nconfig._f += 'Z';\n}\nmakeDateFromStringAndFormat(config);\n} else {\nconfig._isValid = false;\n}\n}", "title": "" }, { "docid": "e8eb77686cf0078f28f5da5d733510ef", "score": "0.60705477", "text": "function makeDateFromString(config) {\n\t var i, l,\n\t string = config._i,\n\t match = isoRegex.exec(string);\n\n\t if (match) {\n\t config._pf.iso = true;\n\t for (i = 0, l = isoDates.length; i < l; i++) {\n\t if (isoDates[i][1].exec(string)) {\n\t // match[5] should be \"T\" or undefined\n\t config._f = isoDates[i][0] + (match[6] || \" \");\n\t break;\n\t }\n\t }\n\t for (i = 0, l = isoTimes.length; i < l; i++) {\n\t if (isoTimes[i][1].exec(string)) {\n\t config._f += isoTimes[i][0];\n\t break;\n\t }\n\t }\n\t if (string.match(parseTokenTimezone)) {\n\t config._f += \"Z\";\n\t }\n\t makeDateFromStringAndFormat(config);\n\t }\n\t else {\n\t config._d = new Date(string);\n\t }\n\t }", "title": "" }, { "docid": "f29dc47349e86f2f95307fa09cd3d943", "score": "0.60613644", "text": "function ISO_2022() {}", "title": "" }, { "docid": "f29dc47349e86f2f95307fa09cd3d943", "score": "0.60613644", "text": "function ISO_2022() {}", "title": "" }, { "docid": "f29dc47349e86f2f95307fa09cd3d943", "score": "0.60613644", "text": "function ISO_2022() {}", "title": "" }, { "docid": "f29dc47349e86f2f95307fa09cd3d943", "score": "0.60613644", "text": "function ISO_2022() {}", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.606091", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.606091", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.606091", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.606091", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.606091", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.606091", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.606091", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "6251ccccd8ce22e285709d658da2e27f", "score": "0.606091", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "168b5390c8310937292e9056f44256d1", "score": "0.60492265", "text": "function toNaiveIso(date) {\n if (!date) {\n return null;\n }\n\n const pad = function(num) {\n return (num < 10 ? '0' : '') + num;\n };\n\n return date.getFullYear() +\n '-' + pad(date.getMonth() + 1) +\n '-' + pad(date.getDate()) +\n 'T' + pad(date.getHours()) +\n ':' + pad(date.getMinutes()) +\n ':' + pad(date.getSeconds())\n}", "title": "" }, { "docid": "333c708c4c0adbeff0fa29e47bd2bc3d", "score": "0.6042832", "text": "function getISOLocalDate(date) {\n var year = padStart(getYear(date), 4);\n var month = padStart(getMonthHuman(date));\n var day = padStart(getDate(date));\n return \"\".concat(year, \"-\").concat(month, \"-\").concat(day);\n}", "title": "" }, { "docid": "2107f19cce09aa199913776475ff319d", "score": "0.60378784", "text": "function parseDate(date){\n var day = date.slice(0,3);\n var month = date.slice(3,6);\n var year = date.slice(6);\n\n return month + day + year;\n }", "title": "" }, { "docid": "86737ad0f7a49eda4b518f87284ac7bd", "score": "0.6034979", "text": "function convertDateStringToDateObj(date) {\r\n var year = parseInt(date.substring(0,4), 10);\r\n var month = parseInt(date.substring(5,7), 10) - 1;\r\n var day = parseInt(date.substring(8,10), 10);\r\n\r\n return new Date(year, month, day, 0, 0, 0, 0);\r\n}", "title": "" }, { "docid": "7e1f0c65d6d90983fe64a32a1f608580", "score": "0.5995632", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "7e1f0c65d6d90983fe64a32a1f608580", "score": "0.5995632", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "7e1f0c65d6d90983fe64a32a1f608580", "score": "0.5995632", "text": "function makeDateFromString(config) {\n var i,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n // match[2] should be \"T\" or undefined\n config._f = 'YYYY-MM-DD' + (match[2] || \" \");\n for (i = 0; i < 4; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (parseTokenTimezone.exec(string)) {\n config._f += \" Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._d = new Date(string);\n }\n }", "title": "" }, { "docid": "0d52c25baf6042bdbf90fe04d9a1461b", "score": "0.5967464", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "0d52c25baf6042bdbf90fe04d9a1461b", "score": "0.5967464", "text": "function makeDateFromString(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n }\n else {\n moment.createFromInputFallback(config);\n }\n }", "title": "" }, { "docid": "fd9ff5d2996a2d69b190bdbd5bffd76e", "score": "0.5967229", "text": "function convert(date) {\n if (!date || date.length != 19) return null;\n\n const day = date.substring(0,2);\n const month = date.substring(3,5);\n\n return month + \"/\" + day + date.substring(5);\n}", "title": "" }, { "docid": "f310ea410a6c5fc7af3b21dbcad8db4f", "score": "0.596102", "text": "function dateConverter(date){\n const splitDate = date.date.split(\"-\");\n const year = splitDate[0].substring(2);\n const month = splitDate[1];\n const splitDay = splitDate[2].split(\"T\");\n const day = splitDay[0];\n return day + \"/\" + month + \"/\" + year;\n}", "title": "" }, { "docid": "54ee9d5311569d172e9d671b34daccff", "score": "0.59484166", "text": "function fixDate(d){\n if(d.date && d.date.toISOString().substr)\n return d.date.toISOString().substr(0,10);\n else {\n //var x= new Date();\n //return x.toISOString().substr(0,10);\n }\n }", "title": "" }, { "docid": "13ac3611470bef07c3872014eb14043e", "score": "0.59377056", "text": "function toISODate(date) { // yyyy-mm-dd\n \"use strict\";\n var yyyy, mm, dd;\n // JavaScript provides no simple way to format a date-only\n yyyy = \"\" + date.getFullYear();\n mm = date.getMonth() + 1; // Months go from 0 .. 11\n dd = date.getDate();\n // Need leading zeroes to form the yyyy-mm-dd pattern.\n if (mm < 10) {\n mm = \"0\" + mm; // This converts it to a string\n }\n if (dd < 10) {\n dd = \"0\" + dd; // This converts it to a string\n }\n return \"\" + yyyy + \"-\" + mm + \"-\" + dd;\n}", "title": "" }, { "docid": "b8d0df3393536343f93ead1605cfa4cd", "score": "0.593691", "text": "function utcToISODate(str) {\n d = new Date(str);\n return d.toISOString().slice(0,10);\n}", "title": "" }, { "docid": "1028d86cd9b7244f0b91773ffe205bce", "score": "0.59346765", "text": "function datestring(obs) {\n // datestring provides a locale independent format\n var datestr = \"\";\n datestr += obs.year;\n datestr += ((obs.month < 10) ? \":0\" : \":\") + obs.month;\n datestr += ((obs.day < 10) ? \":0\" : \":\") + obs.day;\n return datestr;\n }", "title": "" }, { "docid": "13b38a00f1dbd76e3bc9d64468054f0c", "score": "0.5930827", "text": "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "13b38a00f1dbd76e3bc9d64468054f0c", "score": "0.5930827", "text": "function isoStringToDate(match) {\n const date = new Date(0);\n let tzHour = 0;\n let tzMin = 0;\n // match[8] means that the string contains \"Z\" (UTC) or a timezone like \"+01:00\" or \"+0100\"\n const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;\n const timeSetter = match[8] ? date.setUTCHours : date.setHours;\n // if there is a timezone defined like \"+01:00\" or \"+0100\"\n if (match[9]) {\n tzHour = Number(match[9] + match[10]);\n tzMin = Number(match[9] + match[11]);\n }\n dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));\n const h = Number(match[4] || 0) - tzHour;\n const m = Number(match[5] || 0) - tzMin;\n const s = Number(match[6] || 0);\n // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)\n // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`\n // becomes `999ms`.\n const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);\n timeSetter.call(date, h, m, s, ms);\n return date;\n}", "title": "" }, { "docid": "f6e4f3380afd297faa2a287c8862f9dd", "score": "0.59306073", "text": "function convertToDate(date){\n var first = date.indexOf(\"/\")\n var second = date.indexOf(\"/\", first+1)\n var month = date.substring(0,first)\n var day = date.substring(first+1, second)\n var year = date.substring(second+1)\n return new Date(year, month, day)\n}", "title": "" }, { "docid": "4f5a6dd4b90b5416c407af30c76e1db1", "score": "0.5927594", "text": "function makeDateFromString(config) {\nparseISO(config);\nif (config._isValid === false) {\ndelete config._isValid;\nmoment.createFromInputFallback(config);\n}\n}", "title": "" }, { "docid": "970b2e500f07a0ccc83dc2ad1558d1ce", "score": "0.59231097", "text": "formatDateIso(date) {\n return moment(date).add(new Date().getTimezoneOffset() / 60);\n }", "title": "" }, { "docid": "31fd51d7459403b6dd235f45ba2d0ffb", "score": "0.59128714", "text": "function getIsoStringFromDate(d) {\n\tvar s = '';\n\tif (d) {\n\t\tvar dd = d.getUTCDate();\n\t\tvar mm = d.getUTCMonth() + 1;\n\t\ts = '' + d.getUTCFullYear() + '-' +\n\t\t\t(mm <= 9 ? '0' + mm : mm) + '-' +\n\t\t\t(dd <= 9 ? '0' + dd : dd);\n\t}\n\treturn s;\n}", "title": "" }, { "docid": "4cdaa8d332593ec5bf12a5e69a0f8b87", "score": "0.588776", "text": "function dateObjectToIsoDate(dateObject){\r\n var stringDate = $filter('date')(dateObject, 'yyyyMMdd');\r\n var isoDate = null;\r\n // verifico que no sea un NaN (illegal number)\r\n if (!isNaN(parseInt(stringDate))){\r\n isoDate = parseInt(stringDate);\r\n }\r\n return isoDate;\r\n }", "title": "" }, { "docid": "3d9aea3264c2250753d10b50cfa4175e", "score": "0.5886303", "text": "function dateConvert(date) {\n var parsed = date.match(/(\\d\\d)?\\/?(\\d\\d)?\\/?(\\d\\d\\d\\d)$/);\n if (parsed) {\n date = parsed[3] + (parsed[1] ? '-' + parsed[1] + (parsed[2] ? '-' + parsed[2] : '') : '');\n }\n return date;\n}", "title": "" }, { "docid": "da373bfd1dc4b0281c8e84e8dba398eb", "score": "0.58862925", "text": "function makeDateFromString( config ){\n\t\tvar i, string = config._i;\n\t\tif( isoRegex.exec(string) ){\n\t\t\tconfig._f = 'YYYY-MM-DDT';\n\t\t\tfor( i = 0; i < 4; i++ ){\n\t\t\t\tif( isoTimes[i][1].exec(string) ){\n\t\t\t\t\tconfig._f += isoTimes[i][0];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif( parseTokenTimezone.exec(string) ){\n\t\t\t\tconfig._f += \" Z\";\n\t\t\t}\n\t\t\tmakeDateFromStringAndFormat(config);\n\t\t} else{\n\t\t\tconfig._d = new Date(string);\n\t\t}\n\t}", "title": "" }, { "docid": "79c8a084b51fd60f2ac905a2f8327b54", "score": "0.5882923", "text": "function parseIsoDate(dateStr) {\r\n\r\n // parenthese matches:\r\n // year month day hours minutes seconds \r\n // dotmilliseconds \r\n // tzstring plusminus hours minutes\r\n var d = dateStr.match(matchDateIso);\r\n\r\n // 0 1 2 3 4 5 6 7 8 9 10 11 \r\n // \"2010-12-07T01:02:03.123-01:12\" => [\"2010-12-07T01:02:03.123-01:12\", \"2010\", \"12\", \"07\", \"T\", \"01\", \"02\", \"03.123\", undefined, \"-\", \"01\", \"12\"]\r\n // \"2010-12-07T01:02:03-01:12\" => [\"2010-12-07T01:02:03-01:12\", \"2010\", \"12\", \"07\", \"T\", \"01\", \"02\", \"03\", undefined, \"-\", \"01\", \"12\"]\r\n // \"2010-12-07T01:02:03Z\" => [\"2010-12-07T01:02:03Z\", \"2010\", \"12\", \"07\", \"T\", \"01\", \"02\", \"03\", \"Z\", undefined, undefined, undefined]\r\n // \"2010-12-07T01:02:03\" => [\"2010-12-07T01:02:03\", \"2010\", \"12\", \"07\", \"T\", \"01\", \"02\", \"03\", undefined, undefined, undefined, undefined]\r\n // \"2010-12-07\" => [\"2010-12-07\", \"2010\", \"12\", \"07\", undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined]\r\n\r\n if (!d) {\r\n throw \"Couldn't parse ISO 8601 date string '\" + dateStr + \"'\";\r\n }\r\n\r\n // parse strings, leading zeros into proper types\r\n var i;\r\n for (i = 1; i < 11; i++) {\r\n if (matchInteger.test(d[i])) {\r\n d[i] = parseInt(d[i], 10);\r\n }\r\n if (matchFloat.test(d[i])) {\r\n d[i] = parseFloat(d[i]);\r\n }\r\n }\r\n\r\n // fix undefined numeric values\r\n var fixUndef = [1, 2, 3, 5, 6, 7, 10, 11];\r\n for (i in fixUndef) {\r\n if (fixUndef.hasOwnProperty(i)) {\r\n if (!d[fixUndef[i]]) {\r\n d[fixUndef[i]] = 0;\r\n }\r\n }\r\n }\r\n\r\n var hasTimezone = d[8] === \"Z\" || d[9] === \"-\" || d[9] === \"+\";\r\n\r\n var res;\r\n if (hasTimezone) {\r\n // assume date is UTC\r\n res = new Date(Date.UTC(d[1], d[2] - 1, d[3], d[5], d[6], d[7]));\r\n } else {\r\n // assume date is localtime\r\n res = new Date(d[1], d[2] - 1, d[3], d[5], d[6], d[7]);\r\n }\r\n\r\n // if there's a timezone, calculate it\r\n if (hasTimezone && d[10]) {\r\n var offset = d[10] * 60 * 60 * 1000;\r\n if (d[11]) {\r\n offset += d[11] * 60 * 1000;\r\n }\r\n if (d[9] === \"-\") {\r\n offset *= -1;\r\n }\r\n\r\n res = new Date(res.getTime() - offset);\r\n }\r\n\r\n return res;\r\n}", "title": "" }, { "docid": "0a380c16b8e39bbbe301524ef569dbf3", "score": "0.58821905", "text": "function parseISO(config) {\n var i, l, string = config._i, match = isoRegex.exec(string);\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be \"T\" or undefined\n config._f = isoDates[i][0] + (match[6] || \" \");\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += \"Z\";\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "title": "" }, { "docid": "b21d6c4ca70a66a9bd2f5cb81c4d5021", "score": "0.58801687", "text": "function convertDate(date) {\n\t// var date = \"2015-02-26T15:00:00.000Z\";\n\tvar d = new Date(Date.parse(date));\n\tvar dAr = [d.getFullYear(), addZero(d.getMonth() + 1), addZero(d.getDate())];\n\treturn dAr.join(\"-\");\n}", "title": "" }, { "docid": "50c7b95eaf13c7f74ca54f02b14aaedf", "score": "0.58786935", "text": "function makeDateFromString(config) {\n\t parseISO(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t moment.createFromInputFallback(config);\n\t }\n\t }", "title": "" }, { "docid": "50c7b95eaf13c7f74ca54f02b14aaedf", "score": "0.58786935", "text": "function makeDateFromString(config) {\n\t parseISO(config);\n\t if (config._isValid === false) {\n\t delete config._isValid;\n\t moment.createFromInputFallback(config);\n\t }\n\t }", "title": "" }, { "docid": "33272030c7605ec4d610584209c9fb14", "score": "0.58669186", "text": "function toDate(line) {\n return moment(line);\n // return new Date(Date.UTC(line.substring(0,4), +line.substring(4,6)-1, line.substring(6,8), line.substring(9,11), line.substring(11,13), line.substring(13,15)));\n }", "title": "" }, { "docid": "a3e3b7b92a5f60defb59dcf3bbaafeb3", "score": "0.5863038", "text": "function date_to_string(date) {\n return date.toISOString().split('.')[0].replace('T', ' ');\n}", "title": "" }, { "docid": "2320d57bd4eecaab78cef56caf7fbd61", "score": "0.58623075", "text": "function ISODateString(d){\n function pad(n){\n return n<10 ? '0'+n : n\n }\n return d.getUTCFullYear()+'-'\n + pad(d.getUTCMonth()+1)+'-'\n + pad(d.getUTCDate())+'T'\n + pad(d.getUTCHours())+':'\n + pad(d.getUTCMinutes())+':'\n + pad(d.getUTCSeconds())+'Z'\n }", "title": "" }, { "docid": "0a423f3248b25b2b457e93b07fb06f7e", "score": "0.5859843", "text": "function doFormatDateISO(pDate)\n\t\t{\n\t\t\treturn doFormatDate(pDate, 'YYYY-MM-DD');\n\t\t}", "title": "" }, { "docid": "8db72000a9d3c14cc637ee10f4729aa9", "score": "0.5858746", "text": "function localDateFromISOString(dateStr) {\n var dateInts = dateStr.split('-').map(function (x) {\n return parseInt(x);\n });\n return new Date(dateInts[0], dateInts[1] - 1, dateInts[2]);\n} // Date() -> \"Oct 2, 2018\" (localized)", "title": "" }, { "docid": "e3da7c388be5401eedd70977c6183c56", "score": "0.585618", "text": "function getValidFormat(date) {\r\n\r\n var date = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));\r\n var result = date.toISOString().split('T')[0];\r\n return result;\r\n \r\n}", "title": "" }, { "docid": "7c79f9c5c7f1cc926f6d6c8d82f5e1f9", "score": "0.5841354", "text": "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "title": "" }, { "docid": "7c79f9c5c7f1cc926f6d6c8d82f5e1f9", "score": "0.5841354", "text": "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "title": "" }, { "docid": "7c79f9c5c7f1cc926f6d6c8d82f5e1f9", "score": "0.5841354", "text": "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "title": "" }, { "docid": "7c79f9c5c7f1cc926f6d6c8d82f5e1f9", "score": "0.5841354", "text": "function parseISO(config) {\n var i, l,\n string = config._i,\n match = isoRegex.exec(string);\n\n if (match) {\n config._pf.iso = true;\n for (i = 0, l = isoDates.length; i < l; i++) {\n if (isoDates[i][1].exec(string)) {\n // match[5] should be 'T' or undefined\n config._f = isoDates[i][0] + (match[6] || ' ');\n break;\n }\n }\n for (i = 0, l = isoTimes.length; i < l; i++) {\n if (isoTimes[i][1].exec(string)) {\n config._f += isoTimes[i][0];\n break;\n }\n }\n if (string.match(parseTokenTimezone)) {\n config._f += 'Z';\n }\n makeDateFromStringAndFormat(config);\n } else {\n config._isValid = false;\n }\n }", "title": "" } ]
97c224ec8ac12363290a3b7d9661c347
if the string is a palindrome. A palindrome is a string that is spelled the same way backwards and forwards. isPalindrome("") // returns true; isPalindrome("a") // returns true; isPalindrome("ada") // returns true; isPalindrome("tacocat") // returns true; isPalindrome("racecar") // returns true; isPalindrome("lions oil") // returns true; isPalindrome("not the same backwards and forwards") // returns false; 2. Write a method called removeLetter that accepts a string, and a string representing a character to be removed from the string. The function should return a new string with all the occurences of the letter removed from the original string. removeLetter("tomorrow", "o") // returns "tmrrw"
[ { "docid": "0da3cd5daf2d2328f389c37323d47687", "score": "0.0", "text": "function palindrome(str) {\n var len = str.length;\n for ( var i = 0; i < Math.floor(len/2); i++ ) {\n if (str[i] !== str[len - 1 - i]) {\n return false;\n }\n }\n return true;\n}", "title": "" } ]
[ { "docid": "747f7efeed4db587bfa83a1eea9b1818", "score": "0.74056107", "text": "function palindrome(str) {\n return str;\n}", "title": "" }, { "docid": "04b21aa00b3c13ba6dfb3f31ce0d040a", "score": "0.73686695", "text": "function palindrome(str) {\n\n// convert string to lower case then use regex var to remove non whitespace chars \n var regex = /[^A-Za-z0-9]/g; \n str = str.toLowerCase().replace(regex, ''); \n\n // to determine length of string (includes spaces)\n var len = str.length; \n \n for (var i = 0; i < len/2; i++) { //for loop to check part of string for matches\n if (str[i] !== str[len - 1 - i]) { //if compared characters do not match, return false\n return false; \n }\n\n }\n return true; // If both characters are strictly equal, return true, the string is a palindrome\n \n}", "title": "" }, { "docid": "1c6625b79939ea7a503c8f3e001da643", "score": "0.7330008", "text": "function palindrome1(myString){\n\n /* remove special characters, spaces and make lowercase*/\n var removeChar = myString.replace(/[^A-Z0-9]/ig, \"\").toLowerCase();\n\n /* reverse removeChar for comparison*/\n var checkPalindrome = removeChar.split('').reverse().join('');\n\n /* Check to see if myString is a Palindrome*/\n if(removeChar === checkPalindrome){\n\n console.log(\"it is a palindrome\");\n }else{\n console.log(\"it is NOT a palindrome\");\n }\n}", "title": "" }, { "docid": "522c6a40e20071e4a4e45e9907025540", "score": "0.7313657", "text": "function palindrome(str) {\n \n}", "title": "" }, { "docid": "6975de5e6cf2e521e2756f070124129e", "score": "0.73089665", "text": "function Palindrome(string) {\n // Convert toLowerCase and keep only alphabetical & numerical characters\n var cleanedString = string.toLowerCase().match(/[a-z0-9]/g).join(\"\");\n // Create the reversed string\n var reversedString = cleanedString.split(\"\").reverse().join(\"\");\n\n if (cleanedString === reversedString) {\n // Check if the reversed string is equal to the initial string\n return string + \" is a palyndrome.\";\n } else {\n return string + \" is not a palyndrome.\";\n }\n}", "title": "" }, { "docid": "59e2bcdf6f2b6658084248ec54f8c9ce", "score": "0.7275979", "text": "function isPalindrome(string) {\n if (string.length <= 1) {\n return true;\n }\n\n let [firstLetter] = string;\n let lastLetter = string[string.length - 1];\n\n if (firstLetter === lastLetter) {\n let stringWithoutFirstAndLastLetters = string.substring(1, string.length - 1);\n return isPalindrome(stringWithoutFirstAndLastLetters);\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "3f25364a5cb84495455e0c5458a6acd6", "score": "0.72483283", "text": "function removeLetter(word, letterToRemove)\n{\n var i = 0;\n\n while(i < word.length)\n {\n if((word[i] == letterToRemove))\n {\n var start = \"\";\n\n if(i > 0)\n {\n start = word.slice(0, i);\n }\n\n var end = \"\";\n\n if((word.length > 0) && (i != word.length))\n {\n end = word.slice(i + 1, word.length);\n }\n\n word = start + end;\n }\n\n else\n {\n i += 1;\n }\n }\n\n return word;\n}", "title": "" }, { "docid": "a3b1e885455ae7b8b1488582d4515f2a", "score": "0.7143549", "text": "function palindrome(string){\n if(string.length < 2){\n return true;\n }\n var firstChar = string.charAt(0);\n var lastChar = string.charAt(string.length-1);\n if(firstChar === lastChar){\n newStr = string.slice(1, -1);\n return palindrome(newStr);\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "21eed4ba92e6e76fb3289b6118851bf4", "score": "0.7133746", "text": "function Palindrome(str) { \n var filtered = str.replace(/[^a-z]/gi, \"\").toLowerCase();\n return filtered === filtered.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "080b53cadcfe43cc208e1ff1c8cfa6f4", "score": "0.71288955", "text": "function palindrome() {\n\n var originalString = document.getElementById('string').value;\n\n /* remove special characters, spaces and make lowercase*/\n var removeChar = originalString.replace(/[^A-Z0-9]/ig, \"\").toLowerCase();\n\n /* reverse removeChar for comparison*/\n var checkPalindrome = removeChar.split('').reverse().join('');\n\n /* Check to see if myString is a Palindrome*/\n if (removeChar === checkPalindrome) {\n\n var output = originalString + \" is a Palindrome.\";\n\n document.getElementById(\"isPalindrome\").innerHTML = output;\n\n } else {\n\n var output = originalString + \" is not a Palindrome.\";\n\n document.getElementById(\"isPalindrome\").innerHTML = output;\n\n }\n\n}", "title": "" }, { "docid": "ca19d87c36d92cb6cf29117e04694aa2", "score": "0.71130323", "text": "function palindrome(str) {\n // IMPLEMENT ME\n}", "title": "" }, { "docid": "c2eee7fbd9ca11e427c43d8baa553256", "score": "0.71016437", "text": "function cekPalindrome(string){\n // code here\n \n}", "title": "" }, { "docid": "a6122398860898001b5556adac244cb6", "score": "0.70904374", "text": "function palindromeTest(str){\n\n\n}", "title": "" }, { "docid": "11bce9cbd9e3a8b33fce66d9a02f8cd0", "score": "0.7081666", "text": "function isPalindrome(string) {\n string = string.toLowerCase();\n var charactersArr = string.split('');\n var validCharacters = 'abcdefghijklmnopqrstuvwxyz'.split('');\n\n var lettersArr = [];\n charactersArr.forEach(char => {\n if (validCharacters.indexOf(char) > -1) lettersArr.push(char);\n });\n\n return lettersArr.join('') === lettersArr.reverse().join('');\n}", "title": "" }, { "docid": "11bce9cbd9e3a8b33fce66d9a02f8cd0", "score": "0.7081666", "text": "function isPalindrome(string) {\n string = string.toLowerCase();\n var charactersArr = string.split('');\n var validCharacters = 'abcdefghijklmnopqrstuvwxyz'.split('');\n\n var lettersArr = [];\n charactersArr.forEach(char => {\n if (validCharacters.indexOf(char) > -1) lettersArr.push(char);\n });\n\n return lettersArr.join('') === lettersArr.reverse().join('');\n}", "title": "" }, { "docid": "9bfca769140a96f78d82ef0ef96c1c03", "score": "0.70763934", "text": "function palindrome(str) {\n //assign a front and a back pointer\n let front = 0\n let back = str.length - 1\n\n //back and front pointers won't always meet in the middle, so use (back > front)\n while (back > front) {\n //increments front pointer if current character doesn't meet criteria\n if ( str[front].match(/[\\W_]/) ) {\n front++\n continue\n }\n //decrements back pointer if current character doesn't meet criteria\n if ( str[back].match(/[\\W_]/) ) {\n back--\n continue\n }\n //finally does the comparison on the current character\n if ( str[front].toLowerCase() !== str[back].toLowerCase() ) return false\n front++\n back--\n }\n\n //if the whole string has been compared without returning false, it's a palindrome!\n return true\n\n}", "title": "" }, { "docid": "1e9abec114d6994837441aa09e6069c5", "score": "0.7041359", "text": "function palindromeChecker (string) {\n\n //Assigning string a new string that is all uppercase\n string = string.toUpperCase();\n //Replaces whitespace from string with an empty string\n string = string.replace(/\\s+/g, '');//Removes whitespace\n //Declaring a new string that is empty\n var newString = \"\";\n //Declaring a for loop, in loop a vairable called i is declared\n //i is assigned to the (length of string - 1) for indexing purposes\n //At every iteration i is subtracted by one\n for (var i = string.length - 1; i >= 0; i--) {\n //The character at index i of string is added to newString\n newString = newString + string[i];\n }\n\n //Returns true if the two string are equal\n return newString === string;//Returns true if palindrome\n\n}", "title": "" }, { "docid": "ee33c6691cb629da2584919af47f5fb0", "score": "0.6997255", "text": "function palindrome(str) {\n \n //Regex code explanation\n // \\W_ matches any non-word characters including underscore\n // g matches all characters\n \n //Here we use the toLowercase to make every character lowercase. We then use method chaining to add the replace method which searches a string for a specified value, or a regular expression, and returns a new string where the specified values are replaced.\n \n\n\tstr = str.toLowerCase().replace(/[\\W_]/g, \"\");\n\n//Here we use the split method to return an array of substrings. We then use method chaining to add the reverse method which revereses the order of elements in array. Finally we add the join method to which joins the elements of an array into a string, and returns the string\n \n return str === str.split(\"\").reverse().join(\"\")\n\n \n\n}", "title": "" }, { "docid": "b348dee96cfe224beb00201c347bf0cb", "score": "0.6992783", "text": "function palindrome(str) {\n //assign a front and a back pointer\n let front = 0;\n let back = str.length - 1;\n\n //back and front pointers won't always meet in the middle, so use (back > front)\n while (back > front) {\n //increments front pointer if current character doesn't meet criteria\n while (str[front].match(/[\\W_]/)) {\n front++;\n continue;\n }\n //decrements back pointer if current character doesn't meet criteria\n while (str[back].match(/[\\W_]/)) {\n back--;\n continue;\n }\n //finally does the comparison on the current character\n if (str[front].toLowerCase() !== str[back].toLowerCase()) return false\n front++;\n back--;\n }\n\n //if the whole string has been compared without returning false, it's a palindrome!\n return true;\n\n}", "title": "" }, { "docid": "317e7d266e4fe54d426e629a66f03c3d", "score": "0.699078", "text": "function palindrome(str) {\n str = str.toLowerCase().replace(/[^a-z0-9]/g, '');\n //reverse the string\n var tmpRevStr = str.split('').reverse().join('');\n //compare, and return\n if (tmpRevStr === str) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "ac0acb29eaefc3450bb676d417fe533e", "score": "0.698704", "text": "function palindrome(str) {\n str = str.toLowerCase().replace(/[^a-z0-9]/g, \"\");\n return str === str.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "2b1767f04ab691b105f2041f7815d15a", "score": "0.6977835", "text": "function palindrome(str) {\n // ? remove all symbols, punctuation, and spaces also make it to lower case\n str = str.replace(/[^a-zA-Z0-9]/g, \"\").toLowerCase();\n return str === str.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "02b2a9e3b0fb6aed7e6129ad45c201f1", "score": "0.6975636", "text": "function palindrome(word) {\n\n\t\tvar removeChar = word.replace(/[^A-Z0-9]/ig, \"\").toLowerCase();\n\t\tvar checkPalindrome = removeChar.split('').reverse().join('');\n\t\tif(removeChar === checkPalindrome){\n\t\t return(\"yes\");\n\t\t}\n\t\telse{\n\t\t\n\t\t return(\"no\");\n\t\t}\n\n}", "title": "" }, { "docid": "5ad4dee3a4d6351260baa63ba0318ca8", "score": "0.6967088", "text": "function isPalindrome(string){\n string = string.toLowerCase();\n //this array includes spaces, punchtuation and everyother stuff that the string may have\n var charactersArr = string.split('');\n //this is strickly alphamets arrays \n var validCharactersArr = 'abcdefghijklmnopqrstuvwxyz'.split(''); \n\n var lettersArr = [];\n charactersArr.forEach(char => {\n //if that character is valid in the validCharactersArr\n if(validCharactersArr.indexOf(char) > -1) lettersArr.push(char);\n });\n if(lettersArr.join('') === lettersArr.reverse().join('')){\n return true;\n }\n else{\n return false;\n } \n}", "title": "" }, { "docid": "a437b491df747b21e35f8f4f6068c8e9", "score": "0.6938626", "text": "function palindrome(str) {\n // Step 1. The first part is the same as earlier\n var re = /[^A-Za-z0-9]/g; // or var re = /[\\W_]/g;\n str = str.toLowerCase().replace(re, '');\n \n // Step 2. Create the FOR loop\n var len = str.length; // var len = \"A man, a plan, a canal. Panama\".length = 30\n \n for (var i = 0; i < len/2; i++) {\n if (str[i] !== str[len - 1 - i]) { // As long as the characters from each part match, the FOR loop will go on\n return false; // When the characters don't match anymore, false is returned and we exit the FOR loop\n }\n }\n return true; // Both parts are strictly equal, it returns true => The string is a palindrome\n }", "title": "" }, { "docid": "571c1ad6d122797119f44da157242cfc", "score": "0.69364643", "text": "function palindrome(str) {\n \n //remove all punctuation, spaces, and symbols w/ replace()\n \n /***ORIGINAL CODE 1.0 \n var strCheck = str.replace(/([^\\w]*)/gi,\"\");\nvar noUnderscores = strCheck.replace(/_/gi,\"\");\n //turn everything lower case to check for palindromes\n var strCheckLower= noUnderscores.toLowerCase();\n //compare our unreversed,(w/ spexcial chars and pesky underscore removed) to reversed string\n if(strCheckLower===strCheckLower.split(\"\").reverse().join(\"\"))\n return true;\n else\n return false;\n ORIGINAL CODE 1.0 ENDED ***/\n \n \n // Good luck!\n\n var alphaNumericOnly = str.replace(/[\\W_]/g,\"\");\n return alphaNumericOnly.toLowerCase() === alphaNumericOnly.split(\"\").reverse().join(\"\").toLowerCase(); \n}", "title": "" }, { "docid": "c4f8a9188e1793277a503791a9ad9561", "score": "0.6935947", "text": "function checkPalindrome(inputString) {\n // convert the string into an array of letters, reverse the order and the convert it back to a string\n var str = inputString.split('').reverse().join('');\n // return true if those 2 strings are equal, else return false\n return str === inputString;\n}", "title": "" }, { "docid": "87de1f98056ea5b75982d636ee234f4c", "score": "0.6916584", "text": "function palindromeFunction(str) {\n var re = /[^A-Za-z0-9]/g;\n var regexStr = str.toLowerCase().replace(re, '');\n var reverseStr = regexStr.split('').reverse().join('');\n return reverseStr === regexStr;\n}", "title": "" }, { "docid": "eed59f71d04fcca65809a0b5d0ecf2f9", "score": "0.69029385", "text": "function palindrome(str) {\n // Good luck!\n return true;\n}", "title": "" }, { "docid": "61338068681c910fa1eb53800cf03494", "score": "0.6859818", "text": "function palindrome(str) {\n let cleanStr = str.replace(/[^a-z]/gi, \"\").toLowerCase();\n let reverseStr = cleanStr.split('').reverse().join('');\n return cleanStr === reverseStr;\n}", "title": "" }, { "docid": "20d7877f3813513ad66400ee0438d367", "score": "0.6842119", "text": "function isPalindrome(str) {\r\n str = str.replace(/\\W/g, '').toLowerCase()\r\n return (str == str.split('').reverse().join(''))\r\n}", "title": "" }, { "docid": "e728c540fb744444419a9f03d98231b3", "score": "0.6816674", "text": "function isPalindrome(str) {\n str = str.replace(/\\W/g, '').toLowerCase();\n return (str == str.split('').reverse().join(''));\n}", "title": "" }, { "docid": "03668399daf94565715e7552768cc2c6", "score": "0.6813135", "text": "function palindrome(str) {\n return true;\n}", "title": "" }, { "docid": "44430e6956948147ed9361d831f9b108", "score": "0.67853487", "text": "function isPalindrome(string) {\n\tstring = string.toLowerCase();//Registry not important\n\tstring = string.replace(/\\W/g, '');//Drop all except letters\n\tstring1 = string.slice(0, Math.floor(string.length/2));\n\tstring2 = reverseString(string.slice(Math.ceil(string.length/2)));\n\treturn (string1 == string2);\n}", "title": "" }, { "docid": "9ed1f5814213c3a4a80c5451ec5ce4e0", "score": "0.6765373", "text": "function palindrome(str) {\n\tstr = str.toLowerCase().replace(/[\\W_]/g, '');\n\tlet rev = str.split('').reverse().join('');\n\treturn str === rev;\n}", "title": "" }, { "docid": "3c9c64ef86be3c71a77738dea2809c5e", "score": "0.67605454", "text": "function palindrome(str) {\n str = str.toLowerCase().match(/[a-z0-9]/gi); \n //cleaner but _ is included as part of a valid string: str = str.toLowerCase().match(/\\w/gi);\n while( str.length > 1 ){\n if( str.shift() != str.pop() ){return false;}\n }\n return true;\n}", "title": "" }, { "docid": "8599d3f04687783bffc2bbcdaa885e42", "score": "0.67604995", "text": "function checkIsPalindrome(inputString) {\n\n // removes all non-alphanumeric characters and apply a global search\n let regExp = /[^A-Za-z0-9]/g;\n\n // set all string to lowercase and remove non-alphanumeric characters\n let regStr = inputString.toLowerCase().replace(regExp, '');\n console.log('before ' + regStr);\n\n let revStr = regStr.split('').reverse().join('');\n console.log('after ' + revStr);\n\n if (revStr === regStr) {\n return 'Yes';\n }\n return 'No';\n}", "title": "" }, { "docid": "dda897e1d8a16b625a9b5ac1d7b3f333", "score": "0.6748835", "text": "function isRealPalindrome(string) {\n string = string.toLowerCase().replace(/[^a-z0-9]/g, '');\n return isPalindrome(string);\n}", "title": "" }, { "docid": "6b3b928a262553302e42264afdda5cad", "score": "0.6733812", "text": "function isPalindrome(s) {\n // create new string, make lowercase, then use.match, then .join (\"\")\n let newString = s.replace(/[^a-zA-Z0-9]/g, \"\").toLowerCase();\n if (!newString || newString.length === 1) return true;\n let left = 0;\n let right = newString.length - 1;\n while (left < right) {\n if (newString[left] !== newString[right]) {\n return false;\n }\n left++;\n right--;\n }\n return true;\n}", "title": "" }, { "docid": "43eca25d2b5a91d15878d65f553886d4", "score": "0.6728413", "text": "function palindrome(str) {\n var out = true;\n let reg1 = /[A-Za-z0-9]/g;\n str = str.toLowerCase().match(reg1); \n\n for (let i = 0 ; i < str.length ; i++) {\n if (str[i] != str[(str.length - (i+1))]) {\n out = false;\n }\n }\n\n return (out) ? true : false ; \n}", "title": "" }, { "docid": "32405855abb0bca6e91fcba08a4c64f7", "score": "0.67271715", "text": "function palindrome(str) {\n var re = /[\\W_]/g; // Remove any unwanted character\n var lowCaseStr = str.toLowerCase().replace(re, ''); // Trasnform the string\n var reverseStr = lowCaseStr.split('').reverse().join(''); // Split it and reverse it\n return reverseStr === lowCaseStr; // Check if it is the same\n}", "title": "" }, { "docid": "0d1727f6b21aceeaa73852af9e3ad4ea", "score": "0.6717601", "text": "function palindromeF(str) {\n\t//* Solution 1\n\t// return (\n\t// \tstr.replace(/[\\W_]/g, \"\").toLowerCase() ===\n\t// \tstr\n\t// \t\t.replace(/[\\W_]/g, \"\")\n\t// \t\t.toLowerCase()\n\t// \t\t.split(\"\")\n\t// \t\t.reverse()\n\t// \t\t.join('')\n\t// );\n\n\t//* Solution 2\n\t// str = str.toLowerCase().replace(/[\\W_]/g,'');\n\t// for (let i = 0, len = str.length-1; i < len/2;i++){\n\t// \tif(str[i] !== str[len - i]){\n\t// \t\treturn false;\n\t// \t}\n\t// }\n\t// return true;\n\n\t//* Solution 3 (best performance)\n\t// front and back pointers\n\tlet front = 0, back = str.length - 1;\n\t// they won't always meet in the middle so use back > front\n\twhile (back > front) {\n\t\t// Inc/decre. pointers if curr char doesn't meet criteria\n\t\tif (str[front].match(/[\\W_]/)) {\n\t\t\tfront++;\n\t\t\tcontinue;\n\t\t}\n\t\tif (str[back].match(/[\\W_]/)) {\n\t\t\tback--;\n\t\t\tcontinue;\n\t\t}\n\t\t// do the comparison between chars\n\t\tif (str[front].toLowerCase() !== str[back].toLowerCase()) return false;\n\t\tfront++;\n\t\tback--;\n\t}\n\treturn true;\n\n}", "title": "" }, { "docid": "563d3d4f9e0058a4041c29c0fc941f01", "score": "0.67085314", "text": "function palindrome(str){\n var i = 0, j = str.length-1\n\n while (i < j){\n let front = str.charAt(i).toLowerCase().charCodeAt()\n while (((front < 97) || (front > 122)) && (i < j)){\n i++\n front = str.charAt(i).toLowerCase().charCodeAt()\n }\n\n let back = str.charAt(j).toLowerCase().charCodeAt()\n while (((back < 97) || (back > 122)) && ( i < j)){\n j--\n back = str.charAt(j).toLowerCase().charCodeAt()\n }\n\n if (front != back){\n return false\n } else {\n i++\n j--\n }\n }\n\n return true\n}", "title": "" }, { "docid": "fcd45609f3195259356ae46d3ea3dc69", "score": "0.6707898", "text": "function palindrome(str) {\n let newStr = str.toLowerCase().replace(/[^a-z\\d]/g, '');\n return newStr.split('').reverse().join('') === newStr;\n }", "title": "" }, { "docid": "57cdb740fd9da2681531a41fcb81d3ca", "score": "0.67063946", "text": "function isPalindrome(str)\n{\n return (str.replace(/[\\W_]/g, \"\").toLowerCase() === str.replace(/[\\W_]/g, \"\").toLowerCase().split(\"\").reverse().join(\"\"));\n}", "title": "" }, { "docid": "2c6c29b25572a2fb4873d3fd91287dc7", "score": "0.6695098", "text": "function isPalindrome(word){\n word = word.toLowerCase();\n word = word.replace(/ /g, '');\n var reversedWord = '';\n for (let i = word.length - 1; i >= 0; i--){\n reversedWord = reversedWord + word[i];\n }\n return word == reversedWord;\n}", "title": "" }, { "docid": "39449968919395580b329b98e0140d0c", "score": "0.66949576", "text": "function palindrome(str) {\n let regEx = /[^A-Za-z0-9]/g;\n let newStr = str.replace(regEx,\"\").toLowerCase();\n\n let reverseStr = newStr;\n let arr = reverseStr.split('');\n\n let newArr = arr.reverse();\n reverseStr = newArr.join('');\n\n if (newStr === reverseStr) {\n return document.getElementById('outputText').innerHTML = \"True\";\n } else {\n return document.getElementById('outputText').innerHTML = \"False\";\n }\n}", "title": "" }, { "docid": "14ba431dad64e71502fe148368f7f488", "score": "0.6687194", "text": "function isRealPalindrome(string) {\n return isPalindrome(string.replace(/[^a-z0-9]/gi,'').toLowerCase());\n}", "title": "" }, { "docid": "06137018f4dcd8574cc8aa739534fa3a", "score": "0.66871077", "text": "function palindromeVerifier(string) {\n let newString = string.replace(/ /g, \"\")\n return newString\n}", "title": "" }, { "docid": "63140599846eff122457a95efbb10e45", "score": "0.66800094", "text": "function isPalindrome(str) {\n str = str.replace(/\\W/g, '').toLowerCase();\n return (str == str.split('').reverse().join(''));\n }", "title": "" }, { "docid": "63140599846eff122457a95efbb10e45", "score": "0.66800094", "text": "function isPalindrome(str) {\n str = str.replace(/\\W/g, '').toLowerCase();\n return (str == str.split('').reverse().join(''));\n }", "title": "" }, { "docid": "51a54f54b6a28c53683da3f06d7f4f68", "score": "0.6660856", "text": "function palindrome (str) {\n var str1 = \"\";\n for (var i = str.length - 1; i >= 0; i--) {\n str1 += str[i];\n } \n if (str === str1) {\n return \"The string is palindrome.\";\n }\n return \"The string isn't palindrome.\";\n}", "title": "" }, { "docid": "8aa86f76b9c3698c23730160bc226082", "score": "0.66564995", "text": "function palindrome(str) {\n var cleanStr = str.replace(/\\W|_/g, \"\").toLowerCase();\n var checkStr = cleanStr.split(\"\").reverse(\"\").join(\"\");\n \n if(checkStr === cleanStr) {\n return true; \n } else {\n return false;\n };\n\t\n}", "title": "" }, { "docid": "f302042d0b60ef91fe765a44abdb7476", "score": "0.6652077", "text": "function palindrome(str) {\n var re = /[\\W_]/g;\n var lowRegStr = str.toLowerCase().replace(re, '');\n var reverseStr = lowRegStr.split('').reverse().join(''); \n return reverseStr === lowRegStr;\n}", "title": "" }, { "docid": "911e6785d71d5bb4e7a059d08d7e5ce0", "score": "0.6650741", "text": "function palindrome(str) {\n \n var string = str.replace(/\\W/g,\"\").replace(/\\s/g, \"\").replace(/[_]/, \"\").toLowerCase();\n \n var reverseString = string.split(\"\").reverse().join('');\n \n return reverseString === string;\n \n}", "title": "" }, { "docid": "0b386e5ca873d2a7dac5755485d52281", "score": "0.6643143", "text": "function is_palindrome(str){\n if(str.length <=1){\n return true;\n } else if (str[0] == str[str.length - 1]) { \n is_palindrome(str.substring(1,(str.length -1)));\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "bdfee8fe388ab4a6525c7011912591f2", "score": "0.6636655", "text": "function palindrome(str) {\r\n\r\n var forwards = [];\r\n var backwards = [];\r\n var strfor;\r\n var strback;\r\n var newstr = str.replace(/\\s/g, '');\r\n var nonalph = newstr.replace(/[\\W_]+/g, '');\r\n var lower = nonalph.toLowerCase();\r\n\r\n for (i = 0; i < lower.length; i++) {\r\n forwards.push(lower[i]);\r\n }\r\n\r\n for (j = (lower.length - 1); j >= 0; j--) {\r\n backwards.push(lower[j]);\r\n }\r\n\r\n strfor = forwards.join('');\r\n strback = backwards.join('');\r\n\r\n if (strfor === strback) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "8eb189c67764e37b76534961d22f8f7e", "score": "0.66297346", "text": "function palindrome(str) {\n let rev = str.split(\"\").reduce((rev, char) => {\n return char + rev\n }, \"\");\n if (rev === str) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "c9a1aa75349de337b4249ba2acf69d78", "score": "0.661097", "text": "function removeChar(str){\n //You got this!\n return str.slice(1,-1);\n }", "title": "" }, { "docid": "e0c41f97c5daf6bc1ad5d0e9ab113476", "score": "0.6608135", "text": "function palindrome(palin) {\n\n var re = /[^A-Za-z0-9]/g; \n palin = palin.toLowerCase().replace(re, '');\n\n\n var len = palin.length; \n \n for (var v = 0; v < len/2; v++) {\n if (palin[v] !== palin[len - 1 - v]) { \n return false; \n }\n }\n return true; \n}", "title": "" }, { "docid": "cd90045c90d976ea5bccbfc7b627bfd2", "score": "0.66073567", "text": "function isPalindrome(str) {\n if (str.length === 1) return true;\n if (str.length === 2) return str[0] === str[1];\n\n // recursion to check if the first letter and last letter is the same\n // if it is then keep checking\n if (str[0] === str[str.length - 1]) return isPalindrome(str.slice(1, -1));\n return false;\n}", "title": "" }, { "docid": "74c391a6a42a90e99b8edf277610a996", "score": "0.6596976", "text": "function isPalindrome(word){\n // add whatever parameters you deem necessary - good luck!\n if(word.length === 0 || word.length === 1) return true; \n \n if(word[0] !== word[word.length - 1]) return false; \n \n return isPalindrome(word.substr(1, word.length - 2))\n }", "title": "" }, { "docid": "3edde77525e21c8757458510a3d99e90", "score": "0.6590584", "text": "function isPalindrome(str) {\n // convert to lowercase\n str = str.toLowerCase();\n // ignore special characters\n str = str.match(/[a-zA-Z]/g).join(\"\");\n // reverse string, compare to original\n console.log(str);\n let rev = str.split(\"\").reverse().join(\"\");\n // return value\n return str == rev;\n}", "title": "" }, { "docid": "261b5f5fd11e75884f6f41a0fe27b187", "score": "0.6589409", "text": "function isPalindrome(string) {\n // Write your code here.\n let bool = true;\n for (let i = 0; i < Math.floor(string.length); i++) {\n if (string[i] !== string[string.length - 1 - i]) bool = false;\n }\n return bool;\n}", "title": "" }, { "docid": "7889a70844099f3ddf3865f34aad6598", "score": "0.65882957", "text": "function isPalindrome(input) {\n // type check the input to avoid errors from calling string methods\n if (typeof input !== \"string\") return \"please input a string\";\n\n /* this line is optional if you want to represent the english value of Palindrome\n i.e. non letters and capitals aren't counted. toLowerCase() makes any capitals\n small and replace(/\\W/g, '') matches any 'non word character' (not a letter or number)\n and removes it*/\n input = input.toLowerCase().replace(/\\W/g, '');\n // can use input.length/2 since if you make it half way you have a palindrome\n for(var i = 0; i < input.length / 2; i++){\n // compare input current index to it's corresponding distance from the end of string\n // the +1 is to account for count from 0 indexing as length is 1 higher than the final index\n if(input[i] !== input[input.length - (i + 1)]){\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "e6e3a59e8100206e69445530552ec999", "score": "0.6584817", "text": "function palindromFunc(s) {\n let tmpStr = strFunc(s)\n if (s === tmpStr) {\n console.log(\"Palindrome!\")\n } else {\n console.log(\"No Palindrome!\")\n }\n}", "title": "" }, { "docid": "d4705943f13eb35c911eca2ab028826e", "score": "0.6578445", "text": "function is_palindrome(s) {\n s = s.toLowerCase().replace(/[^a-zA-Z0-9]/g, \"\");\n // Your code goes here\n for(let i = 0; i < s.length/2; i++) {\n if(s[i] !== s[s.length - 1 - i]) {\n return false\n } \n }\n return true\n}", "title": "" }, { "docid": "32b4fef2e95a22d020c0f622d821e105", "score": "0.6578112", "text": "function isPalindrome (string) {\n// my own way \n var isString = '';\n for (var i=string.length-1; i>=0; i--){\n isString += string[i];\n }\n if (isString === string) {\n return true;\n }\n else {\n return false;\n }\n// cara trainer \n /*return string.toLowerCase().split('').reverse().join('') === string. toLowerCase();*/\n}", "title": "" }, { "docid": "9f558152d5417c4277ac02a7367ae31f", "score": "0.65758854", "text": "function palindrome(str) {\n let reversedStr = '';\n for(let char of str) {\n reversedStr = char + reversedStr;\n }\n return reversedStr === str;\n}", "title": "" }, { "docid": "fcd94d161250ef94f3075ac7e20c7798", "score": "0.65563196", "text": "function isPalindrome(word) {\n if (!(typeof word === 'string' || word instanceof String)) {\n return false\n }\n word = stringCleanup(word)\n\n for (let i = 1; i <= (word.length / 2); i++) {\n if (word[i - 1] !== word[word.length - i]) {\n return false\n }\n }\n return true\n}", "title": "" }, { "docid": "62a691e674cae67edb345975aec30b32", "score": "0.6555375", "text": "function palindrome(str) {\n let nilai = [];\n let aa = str.toLowerCase().replace(/[^a-zA-Z0-9]/g, '')\n\n for (let a = aa.length - 1; a >= 0; a--) {\n nilai.push(aa[a])\n }\n let newNilai = nilai.join('')\n // console.log(aa, newNilai)\n return aa === newNilai ? true : false;\n}", "title": "" }, { "docid": "504a3c423d0a9d393a96eccf9ec3406e", "score": "0.65506625", "text": "function isPalindrome(string) {\nlet newString = '';\n\nfor (let i = string.length - 1; i >= 0; i--) {\n newString += string[i];\n } if (string === newString) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "85b62cc9d787eb3dd84ce663621790ca", "score": "0.65440947", "text": "function removeChar(str){\n return str.slice(1, str.length-1)\n //You got this!\n\n}", "title": "" }, { "docid": "123c9c2e2f7296a354607ecd5dc05ec6", "score": "0.65401256", "text": "function f(str) {\n let nLength = str.length;\n let lLetter = str.charAt(nLength - 1);\n if (lLetter.toUpperCase() !== lLetter.toLowerCase())\n return lLetter;\n return undefined; \n\n}", "title": "" }, { "docid": "502d3857129e4269e3b582fd1d4c2ab8", "score": "0.65392035", "text": "function isPalindrome(str) {\n if (str.length <= 1) return true;\n if (str[0] !== str[str.length - 1]) return false;\n return isPalindrome(str.slice(1, str.length - 1));\n}", "title": "" }, { "docid": "1c05c8a7c38b52d1f2167de3b71b29f1", "score": "0.653615", "text": "function isPalindrome(str){\n if(str.length <= 1) return true;\n if(str[0] === str[str.length-1]) return isPalindrome(str.slice(1,-1));\n return false;\n}", "title": "" }, { "docid": "1140382d65138ad9c72971812c26b3fe", "score": "0.6534367", "text": "function palindrome(str) {\n const toCheck = str.replace(/\\W|_/g, \"\").toLowerCase();\n const result = toCheck.split(\"\").reverse().join(\"\")\n return (toCheck === result) ? true : false;\n}", "title": "" }, { "docid": "225814c326b6033064a607ef2e5a07d9", "score": "0.65343535", "text": "function palindromeCheck(string) {\n const word = string.split('')\n const reversedWord = (word.filter((letter) => letter !== ' ')).reverse().join('')\n // console.log(string, reversedWord)\n const newWord = (word.filter((letter) => letter !== ' ')).join('')\n // console.log(newWord)\n if (newWord === reversedWord) {\n return true\n } else {\n return false\n }\n}", "title": "" }, { "docid": "c00b5400996aaf4003669be7f9569cf9", "score": "0.6531739", "text": "function palindrome(string){\n\tlet processedContent = string.toLowerCase();\n\treturn processedContent == reverse(processedContent);\n}", "title": "" }, { "docid": "bfaca7af6e74c5b55e84b21cec863472", "score": "0.6529324", "text": "function isPalindrome(str){\n\n function helper(str2){\n if(str2.length <= 1) return str2;\n return helper(str2.substr(1)) + str2[0]\n }\n var reverse = helper(str);\n if (str === reverse) return true;\n return false;\n}", "title": "" }, { "docid": "46418ef6a78ba12c3015d62ca09d75a3", "score": "0.65281934", "text": "function isPalindrome(s) {\n \n const strArr = s.replace(/([^a-zA-Z0-9])/g,\"\")\n \n if(strArr.length < 2){\n return true\n }\n \n if( strArr[0].localeCompare(strArr[strArr.length - 1], undefined, {\n sensitivity: 'base',\n }) !== 0){\n \n return false \n }\n \n return isPalindrome(strArr.slice(1, -1))\n}", "title": "" }, { "docid": "7d820f4b3bfd3315aa2939586f0d174c", "score": "0.65263706", "text": "function isPalindrome(str){\n var re = /[\\W_]/g\n var lowRegStr = str.toLowerCase().replace(re, '')\n var reverseStr = lowRegStr.split('').reverse().join('');\n return reverseStr === lowRegStr\n}", "title": "" }, { "docid": "9ab6f944e7acff4342fe9bcec1361ffa", "score": "0.6525683", "text": "function palindromeChecker2(text) {\n const chars = [...text.toLowerCase()]\n //The every() method tests whether all elements in the array pass the test implemented by the provided function. It returns a Boolean value. \n const result = chars.every( (letter, index) => {\n return letter === chars[chars.length - index - 1]\n } )\n return result\n}", "title": "" }, { "docid": "ee6b11548bd4842e13253b7eede3f25e", "score": "0.65193397", "text": "function isPalindrome(str){\n if(str.length === 1) return true;\n if(str.length === 2) return str[0] === str[1];\n if(str[0] === str.slice(-1)) return isPalindrome(str.slice(1,-1))\n return false;\n}", "title": "" }, { "docid": "4c6ffbbcef1583a664960258aedb5541", "score": "0.65063876", "text": "function palindrome(str) {\n let regex = /[a-z0-9]+/ig;\n let matches = str.match(regex).map(i => i.toLowerCase());\n return matches.join(\"\") == matches.map(word => word.split(\"\").reverse().join(\"\")).reverse().join(\"\");\n}", "title": "" }, { "docid": "c989379afa3d814fcc5e04d30347f10d", "score": "0.6506247", "text": "function isPalindrome(myString){\n str = myString.toLowerCase();\n if(str.length === 1){\n return true;//returns 'true' when a string is a palindrome\n }else if(str[0] !== str[str.length-1]){\n return false;//returns 'false' when a string is not a palindrome\n }\n return isPalindrome(str.slice(1,-1));//makes the proper recursive calls\n }", "title": "" }, { "docid": "c5ea2f2edec078398446e50d884d1f21", "score": "0.6498242", "text": "function palindrome(str) {\n return str === str.split('').reverse().join('');\n}", "title": "" }, { "docid": "9ea4a8ae5d304dd2c84efe51b04679ba", "score": "0.6496253", "text": "function isPalindrome_2(string) {\n string = string.toLowerCase().replace(/[\\W_]/g, '');\n let lastIdx = string.length - 1,\n i = 0;\n for (; i < lastIdx / 2; i++) {\n if (string[i] !== string[lastIdx - i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "c6eb961985a03f011a8671258d18014e", "score": "0.64939433", "text": "function isPalindrome(myString) {\n if (myString.length > 1) {\n const endIndex = myString.length - 1\n const palSub = isPalindrome(myString.substring(1, endIndex));\n\n // If first and last letters are equal invoke recursive call with substring; else return false \n return myString[0] === myString[endIndex] ? palSub : false\n }\n // Base case; single letters are palindromes\n else {\n return true;\n }\n}", "title": "" }, { "docid": "f332d578139507f2cfd513d02351cca7", "score": "0.64905804", "text": "function removeLetters(word, letters){\n\treturn word.split('').filter(x =>!(letters.includes(x))).join(\"\");\n}", "title": "" }, { "docid": "c0b1832faf2c54d2f20ff59c5bf2e052", "score": "0.6484364", "text": "function isPalindrome(s) {\n s = s.replace(/[^A-Za-z0-9]/g, \"\").toLowerCase();\n let rev = \"\";\n for (let i = s.length - 1; i >= 0; i -= 1) {\n rev += s[i];\n }\n return rev === s;\n }", "title": "" }, { "docid": "9f257924a95d05840015af903fd596b1", "score": "0.64790183", "text": "function isPalindrome(str) {\r\n return str == str.split(\"\").reverse().join(\"\");\r\n}", "title": "" }, { "docid": "fb75d831b3af11dfdd4db5beb4e74049", "score": "0.6474603", "text": "function palindrome(str) {\n return str === str.split(\"\").reverse().join(\"\");\n}", "title": "" }, { "docid": "7b1dc67e5be703cb4d36ec332ac0a5f1", "score": "0.6472974", "text": "function Palindrome(str) {\n str.toLowerCase();\n var str2 = str.split('').reverse().join('');\n\n return str === str2;\n}", "title": "" }, { "docid": "adc8d7cc2be3dd7ab0b5075735aac51b", "score": "0.64728916", "text": "function palindrome(str) {\n var str = str.replace(/[\\W\\s]/g, \"\").toLowerCase();\n var str = str.split(\"\");\n var sArray = str.slice(0);\n var revArray = sArray.reverse();\n var swtch = false;\n\n for (var i = 0; i < sArray.length; i++) {\n \tif (str[i] !== revArray[i]) {\n \t\tswtch = false;\n \t\tbreak;\n \t}\n \telse {\n \t\tswtch = true;\n \t}\n }\n\n if (swtch === true) {\n return true;\n }\n \n else {\n return false;\n }\n}", "title": "" }, { "docid": "aaf35b1ccef61c2264a6f04033dde0f6", "score": "0.6471624", "text": "function palindrome2(x) {\n let xReduced = x.toLowerCase().replace(/[^a-z0-9]+/g, \"\");\n let xReducedRev = xReduced\n .split(\"\")\n .reverse()\n .join(\"\");\n if (xReduced === xReducedRev) {\n console.log(`${x} is a palindrome`);\n } else {\n console.log(`${x} ain't no palindrome`);\n }\n}", "title": "" }, { "docid": "43ce68c3c1e5edfb6534ef4d56f7247d", "score": "0.64707845", "text": "function Palindrome(string)\n{\n var newString=\"\";\n for(i=string.length-1;i>=0;i--)\n {\n newString+=string[i];\n }\n if(string===newString)\n {\n document.write(\"<br>Its a Palindrome\");\n }\n else\n {\n document.write(\"<br>Its not a Palindrome\");\n }\n}", "title": "" }, { "docid": "7f78f14daf8804f3150a62cba259188a", "score": "0.6461446", "text": "function isPalindrome (str) {\n\tlet revStr = str.split('').reduce((revString, char) => char + revString, '');\n\treturn revStr === str;\n}", "title": "" }, { "docid": "f2ed9dad4f06b304afdf545c7dfadb24", "score": "0.6461411", "text": "function LetterChanges(str) { \n // code goes here \n var newLetter;\n var arr;\n str = str.toLowerCase();\n arr = str.split('');\n \n for (var i = 0, len = str.length; i < len; i++) {\n if (str.charCodeAt(i) <= 122 && str.charCodeAt(i) >= 97) {\n if (str[i] === \"z\") {\n newLetter = str.charCodeAt(i);\n newLetter = String.fromCharCode(newLetter - 25);\n arr.splice(i, 1, newLetter);\n } else {\n newLetter = str.charCodeAt(i);\n newLetter = String.fromCharCode(newLetter + 1);\n arr.splice(i, 1, newLetter);\n };\n };\n };\n for (var j = 0; j < arr.length; j++) {\n if (arr[j] == \"a\" || arr[j] == \"e\" || arr[j] == \"i\" || arr[j] == \"o\" || arr[j] == \"u\") {\n arr.splice(j, 1, arr[j].toUpperCase());\n };\n };\n\n str = arr.join('');\n return str; \n}", "title": "" }, { "docid": "3a1ed0834078803167f00d21a0696de7", "score": "0.6461267", "text": "function canBePalindrome(str) {\n // set the string to lower case first\n var str = str.toLowerCase();\n\n var letterCounts = {};\n var letter;\n var palindromeSum = 0;\n var newArr = [];\n var oddLetter = '';\n\n // Loop over the string an make a count of each char occurance\n for (var i = 0; i < str.length; i++) {\n letter = str[i];\n letterCounts[letter] = letterCounts[letter] || 0;\n letterCounts[letter]++;\n }\n\n // Create a method to check if the string can be a palindrome\n for (var letterCount in letterCounts) {\n palindromeSum += letterCounts[letterCount] % 2;\n }\n\n // If the string CAN be a palindrome...\n if (palindromeSum < 2) {\n\n // Loop through the letterCounts object\n for (var letter in letterCounts) {\n // If the char occures an EVEN number of times...\n if( letterCounts[letter] % 2 === 0) {\n // Loop over that char count so you can insert them into the array\n for(var i=0; i< letterCounts[letter]; i++) {\n // Insert the EVEN chars to the middle of the array\n newArr.splice(newArr.length/2, 0, letter);\n }\n }\n // If the char has an ODD number of occurances..\n if (letterCounts[letter] % 2 !== 0) {\n // Loop over that char to get the full count\n for(var i=0; i< letterCounts[letter]; i++) {\n // Save the One odd set of char(s) to insert last\n // Save it in a temporary string\n oddLetter += letter;\n }\n }\n // When all the even count chars have gone in, push the Odd char(s) in\n if(str.length == (newArr.length + oddLetter.length)) {\n newArr.splice(newArr.length/2, 0, oddLetter);\n }\n }\n return newArr.join('');\n\n } else {\n return -1;\n }\n\n}", "title": "" }, { "docid": "f1df20c02f6c582d2f4e78c95ac8a8f3", "score": "0.6458224", "text": "function isPalindrome (str) {\n if (str.length === 1) return true;\n if (str.length === 2) return str[0] === str[1];\n if (str[0] === str.slice(-1)) return isPalindrome(str.slice(1, -1))\n return false;\n}", "title": "" } ]
05bdf8012de791d63dd4d2152d5ac10a
Connect the redux store to react and map State and Dispatch as props
[ { "docid": "75ca7ec1a689143ad6824b7ab4ee9aaa", "score": "0.0", "text": "function mapStateToProps(state) {\n return {\n show : state.calendar.display,\n date : state.calendar.selectedDate\n };\n}", "title": "" } ]
[ { "docid": "c25bb46a1ae03d6f52f70914ebf5fb87", "score": "0.710776", "text": "function connect(mapStateToProps, mapDispatchToProps) {\n // It lets us inject component as the last step so people can use it as a decorator.\n // Generally you don't need to worry about it.\n return function (WrappedComponent) {\n // It returns a component\n return class extends React.Component {\n render() {\n return (\n // that renders your component\n <WrappedComponent\n {/* with its props */}\n {...this.props}\n {/* and additional props calculated from Redux store */}\n {...mapStateToProps(store.getState(), this.props)}\n {...mapDispatchToProps(store.dispatch, this.props)}\n />\n )\n }\n \n componentDidMount() {\n // it remembers to subscribe to the store so it doesn't miss updates\n this.unsubscribe = store.subscribe(this.handleChange.bind(this))\n }\n \n componentWillUnmount() {\n // and unsubscribe later\n this.unsubscribe()\n }\n \n handleChange() {\n // and whenever the store state changes, it re-renders.\n this.forceUpdate()\n }\n }\n }\n}", "title": "" }, { "docid": "12751b2727fd49b997b24bdc75d31a58", "score": "0.7074255", "text": "function mapStateToProps(state) {\n return {\n storeData: state,\n };\n}", "title": "" }, { "docid": "b4774b9d30570e70dea53558eafb954b", "score": "0.70727676", "text": "function mapStateToProps(state) {// whatever gets returned will show up as props inside of dispatch fun\n return {\n theme: state.theme, \n layout: state.layout,\n weapons: state.weapons,\n targets: state.targets,\n options: state.options\n };\n}", "title": "" }, { "docid": "f8f0e89170b452ebfaff7084ebfaf084", "score": "0.70593125", "text": "function mapDispatchToProps(dispatch) {\n // Whenever dispatch is called the result should be passed\n // to all of the reducers\n return bindActionCreators({}, dispatch)\n}", "title": "" }, { "docid": "28c82e9cbbf92c334b3a5700e8ecd28e", "score": "0.70418364", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators({},dispatch)\n}", "title": "" }, { "docid": "bb0da6c5b7545de78e5ea57cf8b357af", "score": "0.70397395", "text": "function mapDispatchToProps(dispatch){\n return{\n actions:bindActionCreators(actions,dispatch)\n }\n}", "title": "" }, { "docid": "295426bceaf1fafd902cfd076bd0e6c3", "score": "0.7022919", "text": "function mapDispatchToProps(dispatch){\n return bindActionCreators(ActionCreators, dispatch)\n}", "title": "" }, { "docid": "7d38bc560c2cd3f74f792d1e624ac7ce", "score": "0.7011687", "text": "function mapDispatchToProps(dispatch){\n return bindActionCreators(ActionCreators, dispatch);\n}", "title": "" }, { "docid": "299ecb0c7dce400aa5a03026c987b597", "score": "0.7007362", "text": "function mapDispatchToProps( dispatch ) {\n\n return {actions: bindActionCreators(actions, dispatch)} \n}", "title": "" }, { "docid": "87b262f006b5b24ee74958dca63aca1d", "score": "0.70013434", "text": "function mapStateToProps(store) {\n return {\n\n };\n}", "title": "" }, { "docid": "8aeea1e0bcc810f75b9be3e3c495674f", "score": "0.70006543", "text": "function mapDispatchToProps(dispatch){\n return bindActionCreators(actionCreators, dispatch)\n}", "title": "" }, { "docid": "722aecbb867e4e1a79849c1d43a1ef90", "score": "0.698238", "text": "function mapDispatchToProps(dispatch){\n return bindActionCreators(actionCreators, dispatch);\n}", "title": "" }, { "docid": "92631bab829715bad8d28f3af4123a92", "score": "0.69646823", "text": "function mapDispatchToProps(dispatch) {\n return {\n setState: newState => {\n dispatch({\n type: \"SET_STATE\",\n newState\n });\n },\n //设置数据集\n setSelectedDataset: selected => {\n dispatch({\n type: \"SWITCH_SELECTED_DATASET\",\n payload: selected\n });\n },\n //设置字段列表\n setFields: fields => {\n dispatch({\n type: \"SET_FIELDS\",\n payload: fields\n });\n }\n };\n}", "title": "" }, { "docid": "04dd45a3399c18378297ccc264f8c1f6", "score": "0.6930325", "text": "function mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators(Actions, dispatch),\n };\n}", "title": "" }, { "docid": "51cf03972b2c0c04121476cd8da6bf24", "score": "0.69103336", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(Actions, dispatch);\n}", "title": "" }, { "docid": "ef6c8686d93b0bfd3f457e698069073b", "score": "0.6906599", "text": "render() {\n\n //step 2 Reducer : state and Action\n\n const reducer = function (state, action) {\n switch (action.type) {\n case \"Attack\":\n return action.payload\n case \"GreenAttack\":\n return action.payload\n default:\n return state\n }\n // if (action.type === \"Attack\") {\n // return action.payload\n // }\n // if (action.type === \"GreenAttack\") {\n // return action.payload\n // }\n // return state;\n }\n\n //step 1 Store: reducer and state\n\n const store = createStore(reducer, \"Peace\");\n\n //step 3 Subscribe: \n store.subscribe(() => {\n console.log(\"Store is Now\", store.getState());\n })\n\n //step 4 Dispatch Action\n\n store.dispatch({ type: \"Attack\", payload: \"Iron Man\" })\n store.dispatch({ type: \"GreenAttack\", payload: \"Hulk\" })\n\n return (\n <div>\n test\n </div>\n );\n }", "title": "" }, { "docid": "a777611e1d4c2b69da09a9ffb2b5ff82", "score": "0.68938506", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(Actions, dispatch);\n}", "title": "" }, { "docid": "a777611e1d4c2b69da09a9ffb2b5ff82", "score": "0.68938506", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(Actions, dispatch);\n}", "title": "" }, { "docid": "c92192b3042b5cc807a7ada63b2dc6ba", "score": "0.6887529", "text": "function mapStateToProps(store) {\n return {\n };\n}", "title": "" }, { "docid": "4cff6a00f02663026a1e01b21de8c5e9", "score": "0.688705", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(ActionCreators, dispatch);\n}", "title": "" }, { "docid": "4cff6a00f02663026a1e01b21de8c5e9", "score": "0.688705", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(ActionCreators, dispatch);\n}", "title": "" }, { "docid": "65ac15eb4007ab25313fa6dba6204fe8", "score": "0.68736625", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(ActionCreators, dispatch);\n}", "title": "" }, { "docid": "65ac15eb4007ab25313fa6dba6204fe8", "score": "0.68736625", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(ActionCreators, dispatch);\n}", "title": "" }, { "docid": "e689df6e7a35d0dd6d2c9cc1dedf2adb", "score": "0.68618035", "text": "function mapStateToProps(state) {\n return {\n store: state,\n };\n}", "title": "" }, { "docid": "91c4d34b57b92f2fab13c184afec3c12", "score": "0.6861592", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(actionCreators, dispatch);\n}", "title": "" }, { "docid": "91c4d34b57b92f2fab13c184afec3c12", "score": "0.6861592", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(actionCreators, dispatch);\n}", "title": "" }, { "docid": "3e57bd42b6d0c257640b12fb19dbcb1e", "score": "0.68606156", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(getActions(dispatch), dispatch);\n}", "title": "" }, { "docid": "4c9f428cbb254614e34b437aeba5559f", "score": "0.68508124", "text": "function mapDispatchToProps(dispatch) {\n return { actions: bindActionCreators(actions, dispatch) };\n}", "title": "" }, { "docid": "cb5ae51a599609d47d498fe26a970f55", "score": "0.6847353", "text": "function mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators({...graphqlActions}, dispatch)\n }\n}", "title": "" }, { "docid": "99b29b1fbcd24969112cce6b3d5c06cc", "score": "0.6846372", "text": "function mapDispatchToProps(dispatch,state) {\n return {\n handleSubmit:function (ev){\n ev.preventDefault();\n var name = this._userName.value,\n password = this._userPassword.value;\n \n if(name==''||name.trim()==''){\n dispatch(loginError({errorMsg:'请填写用户名。'}));\n return;\n }\n \n if(password==''||password.trim()==''){\n dispatch(loginError({errorMsg:'请填写密码。'}));\n return;\n }\n dispatch(loginLoading());\n fetch(baseUrl('login'),{\n method: \"POST\",\n mode: 'cors',\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body:JSON.stringify({\n name:name,\n password:password\n })\n })\n .then(\n res=>{\n if(res.ok){\n res.json().then(user=>{\n try{\n window.socket.on('onlineIdAddSuccess',()=>{\n dispatch(loginSuccess());\n securityService.setCurrentUserInfo(user);\n this.context.router.history.replace('/app/chart');\n });\n window.socket.emit('userLogin',{id:user.id,name:user.name});\n }catch (e){\n dispatch(loginError({errorMsg:'登录失败,请重新登录。'}));\n }\n });\n }else{\n res.json().then(error=>{\n dispatch(loginError(error));\n });\n }\n }\n )\n .catch(\n error=>dispatch(loginError(error))\n );\n }\n }\n}", "title": "" }, { "docid": "97c681eb3c0e426f753b47edeae55e3b", "score": "0.68406636", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(actionCreators, dispatch);\n}", "title": "" }, { "docid": "97c681eb3c0e426f753b47edeae55e3b", "score": "0.68406636", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(actionCreators, dispatch);\n}", "title": "" }, { "docid": "97c681eb3c0e426f753b47edeae55e3b", "score": "0.68406636", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(actionCreators, dispatch);\n}", "title": "" }, { "docid": "97c681eb3c0e426f753b47edeae55e3b", "score": "0.68406636", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(actionCreators, dispatch);\n}", "title": "" }, { "docid": "834d746c11f6295de37a9efa1ef5253a", "score": "0.68276286", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators(actions, dispatch);\n}", "title": "" }, { "docid": "8e78448080e64bb52deba0975e08ae98", "score": "0.6825949", "text": "function mapDispatchToProps(dispatch) {\n return { actions: bindActionCreators(actionCreators, dispatch) };\n}", "title": "" }, { "docid": "d5a356b839e1e9174c2fc711edc13ecb", "score": "0.6822098", "text": "function mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators(actions, dispatch)\n }\n}", "title": "" }, { "docid": "b6e1686e632e23fa9d9a117dbf60ef22", "score": "0.68214875", "text": "function mapdispatchtoprops(dispatch) {\n//take an obj\n//\n\n\n return bindActionCreators({ selectbook: selectbook }, dispatch);\n\n\n}", "title": "" }, { "docid": "7c8b8cd5cf17e79c18cad00eb78193a8", "score": "0.68166596", "text": "function mapDispatchToProps(dispatch) {\n\t // Whenever selectBook is called, the result shoudl be passed\n\t // to all of our reducers\n\t return (0, _redux.bindActionCreators)({ loginUserGoogle: _index.loginUserGoogle, loginUserFacebook: _index.loginUserFacebook, logoutUser: _index.logoutUser }, dispatch);\n\t}", "title": "" }, { "docid": "268791b557bab58638a3a59b71a8f883", "score": "0.68162984", "text": "function mapStateToProps(state) {\n //only reads store state\n return state;\n }", "title": "" }, { "docid": "5c1be34896aa4c80461311514941a5b6", "score": "0.6813432", "text": "function mapDispatchToProps(dispath){\n return bindActionCreators(actions,dispath)\n}", "title": "" }, { "docid": "7785f3dbb2a0e91494ad2c27895135e2", "score": "0.6805847", "text": "function mapStateToProps(state) {\n return {\n data: state\n };\n}", "title": "" }, { "docid": "15ff978bc9d504f4b85026bce0720c98", "score": "0.68004465", "text": "function mapStateToProps(state) {\n // whatever gets returned will show up as props inside of dispatch fun\n return {\n theme: state.theme, \n layout: state.layout,\n history: state.history,\n weapons: state.weapons,\n targets: state.targets,\n options: state.options\n };\n}", "title": "" }, { "docid": "6b433565aa619cbbd57aa9b48f381ce3", "score": "0.6799143", "text": "function mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators(actionCreators, dispatch),\n };\n}", "title": "" }, { "docid": "bd3e7cae30e1ff6386d646d11cf6de46", "score": "0.6793195", "text": "function mapDispatchToProps(dispatch){\n //Whenever selectBook is called the result it passed to all reducers\n //dispatch function is responsible to transfer the action to all\n //reducers\n return bindActionCreators({selectBook: selectBook}, dispatch);\n}", "title": "" }, { "docid": "6424c42f3dbfefccd7b31dc3207b4a32", "score": "0.6789285", "text": "function mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators(CategoryActions, dispatch),\n ingredientActions: bindActionCreators(IngredientActions, dispatch),\n recipeActions: bindActionCreators(RecipesActions, dispatch),\n }\n}", "title": "" }, { "docid": "bd30675460952865624e4837e3341305", "score": "0.67883956", "text": "function mapDispatchToProps(dispatch){\n //whenever select book is called, the result should be passed to all of our reducers \n return bindActionCreators({selectBook:selectBook},dispatch);\n}", "title": "" }, { "docid": "f34caf54a0e561ba068aad71e7a9cef8", "score": "0.6778244", "text": "function mapDispatchToProps (dispatch) {\n return {\n productsActions: bindActionCreators(productsActionCreators, dispatch)\n };\n}", "title": "" }, { "docid": "19d6610bf2708c09b95601f7faf47e57", "score": "0.6776714", "text": "function mapDispatchToProps(dispatch) {\n// Whenever selectBook is called, the resullt should be passed to all of our reducers.\n// dispatch takes all the actions and funnels them to all the reducers in the application.\n// calling this.props.selectBook would call our action.\n return bindActionCreators({ selectBook: selectBook }, dispatch)\n}", "title": "" }, { "docid": "5577f7c4943981c52aeffac436e3218d", "score": "0.6775267", "text": "function mapDispatchToProps(dispatch) {\n\treturn {\n\t\tactions: bindActionCreators(actions, dispatch),\n\t\tdispatch\n\t};\n}", "title": "" }, { "docid": "f9a8f416f59e3f5045767c68bfa2d170", "score": "0.6771055", "text": "function mapDispatchToProps(dispatch) {\n}", "title": "" }, { "docid": "43ebc2dab58a9b4f0504e84c275c8af5", "score": "0.6764804", "text": "function mapDispathToProps(dispatch) {\n return {\n actions: bindActionCreators(userActions, dispatch),\n productActions: bindActionCreators(productActions, dispatch),\n customerActions: bindActionCreators(customerActions, dispatch),\n wishlistActions: bindActionCreators(wishlistActions, dispatch),\n orderActions: bindActionCreators(orderActions, dispatch),\n couponActions: bindActionCreators(couponActions, dispatch),\n cartActions: bindActionCreators(cartActions, dispatch),\n\n\n\n\n\n };\n //return bindActionCreators({logInUser, showOptionsAlert}, dispatch);\n}", "title": "" }, { "docid": "06f7e2402d73a7ae69eeb7cd56dac494", "score": "0.676192", "text": "function mapStateToProps(store) {\n return {\n app: store.app,\n intl: store.intl,\n auth: store.auth\n };\n}", "title": "" }, { "docid": "0da9ebf1d081fc22a12e7c58a05e65f5", "score": "0.6760362", "text": "function mapDispatchToProps(dispatch) {\n\n return {\n actions: bindActionCreators(DataActions, dispatch)\n };\n}", "title": "" }, { "docid": "0da9ebf1d081fc22a12e7c58a05e65f5", "score": "0.6760362", "text": "function mapDispatchToProps(dispatch) {\n\n return {\n actions: bindActionCreators(DataActions, dispatch)\n };\n}", "title": "" }, { "docid": "404c150daf12488d3437649d1da5d6be", "score": "0.6749193", "text": "function mapDispatchToProps(dispatch) {\n return {\n actions: bindActionCreators(productActions, dispatch),\n };\n}", "title": "" }, { "docid": "5e623106f6f476077948693f93a34d61", "score": "0.67408156", "text": "function mapStateToProps(state) {\n // this component gets its information from the redux info - commented out cuz no worky\n return {\n // drawer: state.drawer\n // .update('drawer', state.drawer.get('drawer').toList())\n // .toJS(),\n // widgets: state.widgets.toList().toJS(),\n };\n}", "title": "" }, { "docid": "7ea90dac6e214ee410b4bff7a845f4c9", "score": "0.67364484", "text": "function mapDispatchToProps(dispatch) {\n return {\n\t\thandleInputChange: (input) => { \n\t\t\tdispatch(actions.handleInputChange(input)) \n\t\t},\n\t\thandleSubmit: (txt) => { dispatch(actions.GetStock(txt)) }\n }\n }", "title": "" }, { "docid": "7238a9c83fad9f6a87f0b6ccbedfe871", "score": "0.6732123", "text": "function mapStateToProps(state) {\n return {\n productDataReducer: state.productDataReducer,\n };\n}", "title": "" }, { "docid": "2591a8afcb40be2a0c5e61999fc5b0cd", "score": "0.67176336", "text": "function mapStateToProps(reduxStoreState) {\n return { weather: reduxStoreState.weather };\n}", "title": "" }, { "docid": "df23b696de56e1a04bb0e881ff96a5cc", "score": "0.6702786", "text": "function mapStateToProps(store) {\n return {\n intl: store.intl,\n auth: store.auth,\n loggedIn: store.auth.data.loggedIn,\n username: store.auth.username,\n data: store.auth.data,\n token: store.auth.data.tokenID,\n // authget: getAuth(state),\n };\n}", "title": "" }, { "docid": "780ddf48d176edf28a76ec7d8721a4b0", "score": "0.6702519", "text": "function mapDispatchToProps(dispatch) {\n // we imported selectBook, a function, from actions/index.js\n // and this \"mapDispatchToProps\" will do this (if bound by \"connect\" to the comp):\n // whenever SelectBook is called, the result should be passed to all our reducers \n return bindActionCreators({ selectBook: selectBook }, dispatch)\n // dispatch is a smart function that knows all reducers and will notify them\n\n}", "title": "" }, { "docid": "3d24fb14bb81515751774a8377881acb", "score": "0.669824", "text": "function mapDispachToProps(dispatch) {\n return bindActionCreators(actions, dispatch);\n }", "title": "" }, { "docid": "b14184a050ee184a561ca2006726d0e0", "score": "0.66981316", "text": "function mapStateToProps(state){\n console.log(state)\n return{\n my_id: state.my_id,\n goods: state.goods,\n posts: state.posts,\n user_info: state.user_info\n };\n }", "title": "" }, { "docid": "b14184a050ee184a561ca2006726d0e0", "score": "0.66981316", "text": "function mapStateToProps(state){\n console.log(state)\n return{\n my_id: state.my_id,\n goods: state.goods,\n posts: state.posts,\n user_info: state.user_info\n };\n }", "title": "" }, { "docid": "880af917eec8ffcbf6937a0a406ed793", "score": "0.6694591", "text": "function mapDispathToProps(dispatch) {\n return {\n actions: bindActionCreators(userActions, dispatch),\n customerActions: bindActionCreators(customerActions, dispatch),\n wishlistActions: bindActionCreators(wishlistActions, dispatch),\n productActions: bindActionCreators(productActions, dispatch),\n cartActions: bindActionCreators(cartActions, dispatch),\n\n };\n //return bindActionCreators({logInUser,showOptionsAlert}, dispatch);\n}", "title": "" }, { "docid": "8f2da7685459b0c713fe551480ac67ed", "score": "0.66925395", "text": "function mapDispatchToProps(dispatch) {\n //when ever select book is called result should be pass to all our reducers\n // receive and then broadcast to all reducers\n return bindActionCreators({ selectBook: selectBook }, dispatch);//to container, this.props.selectBook\n}//selectBook is just a function return a js object, take this return to flow through reducers", "title": "" }, { "docid": "8e8b844bab78c28d85a1e84816b9405b", "score": "0.66905963", "text": "function mapDispatchToProps(dispatch) {// whenever <function below> is called result should be passed to all of our\n // reducers\n return bindActionCreators({\n LayoutChange: LayoutChange,\n WeaponChange: WeaponChange,\n TargetChange: TargetChange,\n OptionChange: OptionChange\n }, dispatch);\n}", "title": "" }, { "docid": "5e22f756dc4bd8dd9a31daf0d23a3622", "score": "0.66884166", "text": "function mapDispatchToProps(dispatch) {\n\t // Whenever selectBook is called, the result shoudl be passed\n\t // to all of our reducers\n\t return (0, _redux.bindActionCreators)({}, dispatch);\n\t}", "title": "" }, { "docid": "37b628b08bf51cb83b7643980405e3f4", "score": "0.6687584", "text": "function mapStateToProps(state){\n return state\n}", "title": "" }, { "docid": "375d48aff55f503cf202265c9b7e25d3", "score": "0.668058", "text": "function mapDispatchToProps(dispatch){\n return bindActionCreators({latestNews,articleNews,latestGallery},dispatch)\n}", "title": "" }, { "docid": "dd9c44883d8c7e7e3b4549f54af7c8cd", "score": "0.6679621", "text": "function mapDispatchToProps(dispatch) {\n\t // Whenever selectBook is called, the result shoudl be passed\n\t // to all of our reducers\n\t return (0, _redux.bindActionCreators)({}, dispatch);\n\t}", "title": "" }, { "docid": "c1f5ec1f6c78149057fb0df03f2bb969", "score": "0.6676786", "text": "function mapStateToProps() {\n //return whatever we want to pass from the global state into the properties\n return {}; //we don't need any redux global state, but if we do we can grab it from redux global state and map it to this props for this component. Until then we'll return a blank object.\n}", "title": "" }, { "docid": "a85f7da9d2f8b2248569d459464ef326", "score": "0.6673034", "text": "function mapDispatchToProps(dispatch){\n //whenever selectBook is called, the result should be passed to all of our reducers\n return bindActionCreators({selectBook:selectBook},dispatch);\n}", "title": "" }, { "docid": "a7edb7dfb64bff02db8e8dd0696d58e6", "score": "0.66722536", "text": "function mapDispatchToProps(dispatch){\n //Whenever selectBook is called, the result should be passed to all of\n //our reducers\n return bindActionCreators({selectBook : selectBook}, dispatch)\n}", "title": "" }, { "docid": "1c4c99e4ae1254145c74ae582cb9d6ff", "score": "0.6666703", "text": "function mapDispatchToProps(dispatch){\n //selectBook is the action creator that was imported at the top\n //whenever SelectBook is called, the result will be passed to all reducers\n return bindActionCreators({selectBook: selectBook}, dispatch);\n}", "title": "" }, { "docid": "78cb3e59a9c5aa3a8eba53a355eb3e0d", "score": "0.66644675", "text": "function mapDispatchToProps(dispatch) {\n return {\n actionMessage: function (message){\n return dispatch({\n type: 'SET_MESSAGE',\n message: message\n });\n },\n actionInitialUser: function (user){\n return dispatch({\n type: 'SET_INITIAL_USER',\n user: user\n });\n },\n actionSetUserID: function (userID){\n return dispatch({\n type: 'SET_USERID',\n userID: userID\n });\n },\n actionSetUserName: function (username){\n return dispatch({\n type: 'SET_USERNAME',\n username: username\n });\n },\n actionSetCoin: function (coin){\n return dispatch({\n type: 'SET_COIN',\n coin: coin\n });\n }\n };\n}", "title": "" }, { "docid": "fb1c276ab7a631c3ae206da9571a738d", "score": "0.6663798", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators({ registerSchoolDispatch, resetStore }, dispatch);\n}", "title": "" }, { "docid": "6911c91cdb09015bdba6ebb7a2b3cbb9", "score": "0.6663625", "text": "function mapDispatchToProps(dispatch) {\r\n //Whenever selectBook is called, the result should be pased to all of our reducers. \r\n return bindActionCreators({ selectBook: selectBook }, dispatch);\r\n}", "title": "" }, { "docid": "81aadd4f5457f2a2926453da156c5141", "score": "0.6656376", "text": "function mapDispatchToProps() {\n return {};\n}", "title": "" }, { "docid": "e576e139505ff45a7d8aa017c8eaa748", "score": "0.6655452", "text": "function mapStateToProps(state){\n return state;\n}", "title": "" }, { "docid": "d80f828e501f34bab1f1d3104d8c28ed", "score": "0.6655331", "text": "function mapDispatchToProps(dispatch) {\n return {\n studentActions: bindActionCreators(studentActions, dispatch),\n companyActions: bindActionCreators(companyActions, dispatch),\n tutorActions: bindActionCreators(tutorActions, dispatch)\n };\n}", "title": "" }, { "docid": "672d4e7e5ec75c6bceb3db4a6ae30297", "score": "0.6654952", "text": "function mapDispatchToProps(dispatch){\r\n //whenever selectBook is called, the result should be passed to all reducers \r\n //first arg is props here and secnd arg selectBook is action creator we imported from /action/index\r\n return bindActionCreators({selectBook:selectBook},dispatch);\r\n}", "title": "" }, { "docid": "d30ff34a2c309738a136389314b57fc8", "score": "0.6650954", "text": "function mapDispatchToProps(dispatch){\n //Whenever selectBook is called, the result should be passed to all our reducers\n return bindActionCreators({ selectBook: selectBook}, dispatch);\n}", "title": "" }, { "docid": "acdb90415e7f9e1ade8048755ccbd2fd", "score": "0.6647592", "text": "render() {\n const store = createStore(reducers, {}, applyMiddleware(ReduxThunk));\n\n return (\n <Provider store={store}>\n <Router />\n </Provider>\n );\n }", "title": "" }, { "docid": "dbf8f329225fd86327dc3af33eae6a4f", "score": "0.664565", "text": "function mapDispatchToProps(dispatch) {\n return {\n onIncreaseClick: () => dispatch(increaseAction()),\n onElseClick: () => dispatch(elseAction()),\n onShowWill: () => dispatch(showWill()),\n onShowHave: () => dispatch(showHave()),\n initSup: () => dispatch(initSup()),\n initPro: (name) => dispatch(initPro(name)),\n updateSupStatus: (data) => dispatch(updateSupStatus(data)),\n changeSupStatus: (supName) => dispatch(changeSupStatus(supName)),\n changeProStatus: (number) => dispatch(changeProStatus(number))\n }\n}", "title": "" }, { "docid": "e5dfe69e03cec7ac083926b1fc09de93", "score": "0.66431516", "text": "static mapDispatchToProps( dispatch ) {\n return {\n pageActions: bindActionCreators( {\n loadPoint: loadPoint,\n setMapCenter: setMapCenter,\n publishPoints: publishPoints\n }, dispatch ),\n wizardActions: bindActionCreators( {\n setDrawer: setDrawer,\n setSnackbar: setSnackbar\n }, dispatch )\n };\n }", "title": "" }, { "docid": "c08ceaaaa6f1388270322f5cb7a7b54a", "score": "0.6638126", "text": "function mapDispatchToProps(dispatch){\n //select book is the action creator\n //When selectBook is called, the result is passed to all the reducers\n return bindActionCreators({ selectBook: selectBook}, dispatch);\n}", "title": "" }, { "docid": "e5e86ce170ddf79c51a4748713f731c4", "score": "0.6635043", "text": "function mapStateToProps(state) {\n return {\n // addsDataFromStore : state.Adds_Data_Updater,\n // decCounter : state.decrementCounter.decrementState\n };\n}", "title": "" }, { "docid": "371fc528ea8db6f920009ffc9fc8bef1", "score": "0.66333765", "text": "function mapDispatchToProps(dispatch) {\n\n return bindActionCreators({\n LoadPollsRequest, LoadPollsSuccess, LoadPollsFailure,\n LoadPoll, LoadPollFailure, LoadPollSuccess, \n RemovePollFailure, RemovePollSuccess,RemovePollRequest,\n CloseModal, SubmitVote, SubmitVoteSuccess, SubmitVoteFailure\n }, dispatch);\n}", "title": "" }, { "docid": "e66343bb5de70761a3a10754d0048e1b", "score": "0.66291624", "text": "function mapDispatchToProps(dispatch) {\n return bindActionCreators({setUser: setUser, logOut: logOut,sendRequest: sendRequest }, dispatch);\n}", "title": "" }, { "docid": "da80f78d5baab9d7a3807436c718a4e6", "score": "0.66269594", "text": "function mapStateToProps(state) {\n return {\n fetchedData: state.dataStore.fetchedData,\n };\n}", "title": "" }, { "docid": "d3422f0ff4717d7490cd4f43a619e04d", "score": "0.66255575", "text": "function mapDispatchToProps(dispatch) {\n return {\n loadAllMI: (inputParams) => {\n return marketIntelligenceApi.getMI({\n params: inputParams\n }).then((resp) => {\n return resp;\n })\n\n },\n getUserList:(inputParams) => {\n return userApi.getUserList({\n params: inputParams\n }).then((resp) => {\n return resp;\n })\n },\n dispatchAction: (param) => {\n dispatch(param);\n }\n }\n}", "title": "" }, { "docid": "ef916e5573ed212a25cf7593e380823e", "score": "0.66251093", "text": "function mapDispatchToProps (dispatch) {\n return {\n spinnerOnOff: (data) => dispatch(spinnerOnOff(data)),\n getCommentCount: (data) => dispatch(getCommentCount(data)),\n getPostsCategoriesAndCommentsThunk: () => dispatch(getPostsCategoriesAndCommentsThunk())\n };\n}", "title": "" }, { "docid": "0402388c387fd916b035a88d439827fb", "score": "0.6623475", "text": "function matchDispatchToProps(dispatch){\n\nreturn bindActionCreators({ showEncounter: showEncounter,\n encounterIndex: encounterIndex,\n eventMessage: eventMessage,\n throwHit: throwHit,\n throwMiss: throwMiss,\n\n pokemonCaught: pokemonCaught,\n pokemonEncountered: pokemonEncountered,\n\n activeIndex: activeIndex,\n previewIndex: previewIndex,\n pokedexView: pokedexView\n }, dispatch);\n\n //connect-function\n // prop : action/function\n // dispatch (behind the scenes with redux to call func)\n\n}", "title": "" }, { "docid": "9f25a187eb880fae0fbb4e1efa5b2d21", "score": "0.6621928", "text": "function mapDispatchToProps(dispatch){\n return bindActionCreators(\n {\n f_fetchAPIData: fetchAPIData,\n f_addItem: addItem,\n f_removeItem: removeItem,\n f_submitOrder: submitOrder,\n f_emptyCart: emptyCart,\n f_setCategory: setCategory,\n f_setMenu: setMenu,\n f_fullMenu: fullMenu,\n f_setCurrentItem: setCurrentItem,\n f_updateName: updateName,\n f_yPos: yPos,\n f_setTip: setTip,\n f_toFirebase: toFirebase,\n f_clearFirebase: clearFirebase,\n f_updateTable: updateTable,\n f_addCustomPrice: addCustomPrice,\n f_subtractCustomPrice: subtractCustomPrice,\n removeCat: removeCat,\n addCat: addCat,\n\n }, dispatch)\n}", "title": "" }, { "docid": "80d7f155023126b1add114804a7cd3dc", "score": "0.66191906", "text": "function matchDispatchToProps(dispatch){\n\nreturn bindActionCreators({ pokedexView: pokedexView,\n activeIndex: activeIndex,\n previewIndex: previewIndex,\n\n showEncounter: showEncounter,\n showEvolve: showEvolve,\n\n eventMessage: eventMessage,\n\n encounterIndex: encounterIndex,\n evolveIndex1: evolveIndex1,\n evolveIndex2: evolveIndex2,\n\n pokemonEncountered: pokemonEncountered,\n pokemonCaught: pokemonCaught\n\n\n\n\n }, dispatch);\n\n //connect-function\n // prop : action/function\n // dispatch (behind the scenes with redux to call func)\n\n}", "title": "" }, { "docid": "1a2a0ea75cc18afa36d916dcf406a52d", "score": "0.66154855", "text": "function mapDispatchToProps(dispatch) {\n return {\n \n }\n}", "title": "" }, { "docid": "a33d74669a8b623e9ec78dc054356729", "score": "0.6613484", "text": "function mapDispatchToProps(dispatch){\n //whenever selectBook is called, the result should be passed to all of our reducers\n return bindActionCreators ({selectBook:selectBook},dispatch);\n}", "title": "" }, { "docid": "260ac674d0953ace75364f2bd6c9236f", "score": "0.6607659", "text": "function mapDispatchToProps(dispatch){\n return bindActionCreators({latestNews,articleNews,galleryNews},dispatch)\n}", "title": "" }, { "docid": "00ac709e630bf829d5ce1285f838db8e", "score": "0.66019297", "text": "function mapDispatchToProps(dispatch) {\n return {\n apiActions: bindActionCreators(apiActions, dispatch),\n authActions: bindActionCreators(authActions, dispatch),\n languageActions: bindActionCreators(languageActions, dispatch),\n notificationActions: bindActionCreators(notificationActions, dispatch),\n powerMeterActions: bindActionCreators(powerMeterActions, dispatch),\n reportActions: bindActionCreators(reportActions, dispatch),\n reportPeriodActions: bindActionCreators(reportPeriodActions, dispatch),\n userActions: bindActionCreators(userActions, dispatch),\n }\n}", "title": "" } ]
52073b48d79ae033a90b6a76906dafd8
Performs equality by iterating through keys on an object and returning false when any key has values which are not strictly equal between the arguments. Returns true when the values of all keys are strictly equal.
[ { "docid": "136117fa7e3823dc6aa76ecf2e24ebee", "score": "0.0", "text": "function shallowEqual(objA, objB) {\n if (is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (var i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n}", "title": "" } ]
[ { "docid": "43b4a0c4cc7b4282d25a465b210fc716", "score": "0.6866019", "text": "function objectKVPairsEqualTargetKVPairs(a, b) {\n return Object.keys(a)\n .map(key => deepLeftEquals(a[key], b[key]))\n .every(isTrue);\n}", "title": "" }, { "docid": "b1389d0e73e57e1d58807980ea668ef7", "score": "0.6593989", "text": "function equality(objectA, objectB) {\n var x;\n for (x in objectA) {\n // sets value of X to be a key in objectA\n var a = objectA[x];\n // 1st loop thru- a = value from key X for objectA\n // 2nd loop thru - a = resets X to be the second key. value from new key X for objectA\n var b = objectB[x];\n // 1st loop thru- b = value from key X for objectB\n // 2nd loop thru - b = value from new key X pair for objectB\n if (a == b) {\n return true\n // 1st lopo thru - is a = b? in this case, it's looking at the key name, a = Steven, b = Tamir. no, they don't match.\n // 2nd loop thru - is a = b? in this case, it's looking at the key age, a = 54, b = 54, so yes, true.\n }\n }\n}", "title": "" }, { "docid": "bcef1fd67b2f8fa9d8dcf362334d3c4d", "score": "0.6574613", "text": "function equalForKeys(a, b, keys) {\n if (!angular.isArray(keys) && angular.isObject(keys)) {\n keys = protoKeys(keys, [\"$$keys\", \"$$values\", \"$$equals\", \"$$validates\", \"$$new\", \"$$parent\"]);\n }\n if (!keys) {\n keys = [];\n for (var n in a) keys.push(n); // Used instead of Object.keys() for IE8 compatibility\n }\n\n for (var i = 0; i < keys.length; i++) {\n var k = keys[i];\n if (a[k] != b[k]) return false; // Not '===', values aren't necessarily normalized\n }\n return true;\n }", "title": "" }, { "docid": "d76ecb46c3199ec4fc4225921bede717", "score": "0.6420245", "text": "function is_equal(obj_1,obj_2){\n for (let key in obj_1) {\n if (obj_1[key] !== obj_2[key]){\n return false\n }\n }\n return true\n}", "title": "" }, { "docid": "11639b051b7977e9e2198550d27b1c1b", "score": "0.63636476", "text": "function deepEquals(o1, o2, strictMode) {\n var keys1 = Object.keys(o1).sort();\n var keys2 = Object.keys(o2).sort();\n var ignoreKeys = [];\n\n if (!strictMode) {\n keys1 = keys1.filter(function(k) {\n if (o1[k] === null) {\n ignoreKeys.push(k);\n return false;\n } else {\n return true;\n }\n });\n keys2 = keys2.filter(function(k2) {\n return ignoreKeys.indexOf(k2) == -1;\n });\n }\n\n if (keys1.length !== keys2.length) {\n console.log(\"The numbers of keys do not match. Expected keys are [\"\n + keys1 + \"], but [\" + keys2 + \"] found.\");\n return false;\n }\n\n return keys1.every(function(k) {\n if (typeof o1[k] == \"object\" && typeof o2[k] == \"object\") {\n return deepEquals(o1[k], o2[k], strictMode);\n } else {\n if (o1[k] != o2[k]) {\n console.log(\"The values of \\\"\" + k\n + \"\\\" do not match, expected value is \" + o1[k]\n + \", but \" + o2[k] + \" found.\");\n return false;\n } else {\n return true;\n }\n }\n });\n}", "title": "" }, { "docid": "79c3455263b6f52c85992b951d0d8793", "score": "0.62991595", "text": "objectsAreShallowlyEqual() {\n const [o1, o2] = this._args\n if (Object.keys(o1).length !== Object.keys(o2).length) return false\n if (Object.keys(o1).every((k) => o2.hasOwnProperty(k) && o1[k] === o2[k]))\n return true\n return false\n }", "title": "" }, { "docid": "691886b8bdcd23939128a2a98dc6a575", "score": "0.6213452", "text": "function Object$prototype$equals(other) {\n var self = this;\n var keys = Object.keys(this).sort();\n return equals(keys, Object.keys(other).sort()) &&\n keys.every(function(k) { return equals(self[k], other[k]); });\n }", "title": "" }, { "docid": "5ba92164a9ba6d9e3656a8a3f0f12dd3", "score": "0.61698604", "text": "function isEq(o1, o2) {\n if(o1 === o2) return true\n if(typeof o1 != 'object') return false\n if(typeof o2 != 'object') return false\n let k1 = Object.keys(o1)\n let k2 = Object.keys(o2)\n if(k1.length != k2.length) return false\n for(let i = 0;i < k1.length;i++) {\n let k = k1[i]\n if(!isEq(o1[k], o2[k])) return false\n }\n return true\n}", "title": "" }, { "docid": "449a17b6c09f68effa5f5d1e71a43917", "score": "0.6169453", "text": "objectsEqual(object1, object2){\n\t const keys1 = Object.keys(object1);\n\t const keys2 = Object.keys(object2);\n\n\t if (keys1.length !== keys2.length) {\n\t return false;\n\t }\n\n\t for (let key of keys1) {\n\t if (object1[key] !== object2[key]) {\n\t return false;\n\t }\n\t }\n\n \treturn true;\n\t}", "title": "" }, { "docid": "582884c3feb8a2e3d22a31796ee698c0", "score": "0.6161454", "text": "function KeyValueMatch(object1, object2) {\n\tfor (var key in object1) {\n\t\tif (object2[key] == object1[key]) {\n\t\t\tconsole.log(\"Do these two objects have a key-value match?\");\n\t\t\t\treturn true;\n\t\t}\n\t}\n\t\t\tconsole.log(\"Do these two objects have a key-value match?\");\n\t\t\t\treturn false;\n}", "title": "" }, { "docid": "b415b9e4efbc2b4672b8411ea60e1da1", "score": "0.61267453", "text": "function objectEquals(x, y) {\n if (typeof(x) === 'number') {\n x = x.toString();\n }\n if (typeof(y) === 'number') {\n y = y.toString();\n }\n if (typeof(x) != typeof(y)) {\n return false;\n }\n\n if (Array.isArray(x) || Array.isArray(y)) {\n return x.toString() === y.toString();\n }\n\n if (x === null && y === null) {\n return true;\n }\n\n if (typeof(x) === 'object' && x !== null) {\n x_keys = Object.keys(x);\n y_keys = Object.keys(y);\n if (x_keys.sort().toString() !== y_keys.sort().toString()) {\n console.error('Object do not have the same keys: ' +\n x_keys.sort().toString() + ' vs ' +\n y_keys.sort().toString()\n );\n return false;\n }\n equals = true;\n for (key of x_keys) {\n equals &= objectEquals(x[key], y[key]);\n }\n return equals;\n }\n return x.toString() === y.toString();\n }", "title": "" }, { "docid": "6dfdc1560d3971a20da71ccc86d0b0c5", "score": "0.61179227", "text": "objectEquals(oldObj, newObj, effectiveFields) {\n let oldVals = [];\n let newVals = [];\n\n effectiveFields.forEach(function (key) {\n oldVals.push(oldObj[key]);\n });\n effectiveFields.forEach(function (key) {\n newVals.push(newObj[key]);\n });\n\n // The following code is just an array.equals comparison\n for(let i = 0; i < oldVals.length; i++) {\n if (! this.flexibleEquals(oldVals[i], newVals[i])) {\n return false;\n }\n }\n // console.log(\"Returning true: same object\")\n // console.log(\"----------------\")\n\n return true;\n }", "title": "" }, { "docid": "256b83f3d30fecb970e1846a89b9b572", "score": "0.61102456", "text": "function keyval_match(keyval_object1, keyval_object2) {\n // Will be equal to true if key/value pairs are equal \n var boolean_test = false;\n \n for (var key1 in keyval_object1) {\n for (var key2 in keyval_object2) {\n if ((key1 == key2) && (keyval_object1[key1] == keyval_object2[key2])) {\n boolean_test = true;\n }\n }\n }\n \n return boolean_test;\n}", "title": "" }, { "docid": "159ef646de48bc698a1e2cbb98010300", "score": "0.6034661", "text": "function objectSame(x, y) {\n\t\tfor ( var key in x ) {\n\t\t\t// y must have every key that x does.\n\t\t\tif ( !(key in y) ) return false;\n\n\t\t\t// x and y must have the same values for every key.\n\t\t\tif ( !same(x[key], y[key]) ) return false;\n\t\t}\n\n\t\tfor ( var key in y ) {\n\t\t\t// x must have every key that y does.\n\t\t\tif ( !(key in x) ) return false;\n\t\t\t\n\t\t\t// we already know the values of shared keys are the same,\n\t\t\t// so there's no need to do an additional check.\n\t\t}\n\t\treturn true;\n\t}", "title": "" }, { "docid": "81b5440959941308563f1c97f0c6ad78", "score": "0.6024384", "text": "function equals(o1, o2) {\n if (o1 === o2)\n return true;\n if (o1 === null || o2 === null)\n return false;\n if (o1 !== o1 && o2 !== o2)\n return true; // NaN === NaN\n var t1 = typeof o1, t2 = typeof o2, length, key, keySet;\n if (t1 == t2 && t1 == 'object') {\n if (Array.isArray(o1)) {\n if (!Array.isArray(o2))\n return false;\n if ((length = o1.length) == o2.length) {\n for (key = 0; key < length; key++) {\n if (!equals(o1[key], o2[key]))\n return false;\n }\n return true;\n }\n }\n else {\n if (Array.isArray(o2)) {\n return false;\n }\n keySet = Object.create(null);\n for (key in o1) {\n if (!equals(o1[key], o2[key])) {\n return false;\n }\n keySet[key] = true;\n }\n for (key in o2) {\n if (!(key in keySet) && typeof o2[key] !== 'undefined') {\n return false;\n }\n }\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "d5a64bf558b0ec857fe1e2bc037df391", "score": "0.6009569", "text": "function objectCheck(obj1,obj2) {\r\n// keys in obj1\r\n for (key in obj1) {\r\n var key1 = key;\r\n }\r\n// keys in obj2\r\n for (key in obj2) {\r\n var key2 = key;\r\n }\r\n // does this even work? \r\n if (key1 == key2) {\r\n if ((obj1[key]) == (obj2[key])) {\r\n console.log(true);\r\n return true;\r\n } else {\r\n console.log(false);\r\n return false;\r\n }\r\n // return false\r\n } else {\r\n console.log(false);\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "5c215d610cdd4914a0d77c992a86d2bb", "score": "0.5967509", "text": "function has_all_of_keys(object) {\n\t\tvar keys = _.rest(arguments);\n\t\treturn _.isObject(object) && _.every(keys, function(key) {\n\t\t\treturn _.has(object, key);\n\t\t});\n\t}", "title": "" }, { "docid": "64264a1ae7d8a60f81b0dd5d3fed8d94", "score": "0.59609973", "text": "function deepEqual(a,b) {\n if (a === b) return true;\n\n if (a === null || b === null){\n return false;\n }\n\n if(typeof a === 'object' && typeof b === 'object'){\n\n var keys1 = Object.keys(a);\n var keys2 = Object.keys(b);\n\n //checks if number of keys are equal\n if(keys1.length !== keys2.length){\n return false;\n }\n\n for(var i in a){ //iterate over keys\n if(deepEqual(a[i], b[i]) === false){ //check if values are equal\n return false;\n }\n }\n return true; //if all keys and values are equal\n }\n\n //otherwise just return false.\n return false;\n}", "title": "" }, { "docid": "d84170db09b93bae96cb54735a5a286c", "score": "0.5956478", "text": "function key_value_match(object1, object2) {\r\n\r\n\tfor (var key1 in object1) {\r\n\t\tfor (var key2 in object2) {\r\n\t\t\tif (key1 == key2 && object1[key1] == object2[key2]) {\r\n\t\t\t\treturn true\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false\r\n}", "title": "" }, { "docid": "638578082f8bf214421c59b12306146a", "score": "0.59499156", "text": "function objectEq(a, b) {\n\t var akeys = Object.keys(a),\n\t bkeys = Object.keys(b),\n\t r;\n\n\t if (akeys.length !== bkeys.length) {\n\t return false;\n\t }\n\n\t r = true;\n\n\t detectRecursion(a, b, function () {\n\t var i, len, key;\n\n\t for (i = 0, len = akeys.length; i < len; i++) {\n\t key = akeys[i];\n\t if (!b.hasOwnProperty(key)) {\n\t r = false;break;\n\t }\n\t if (!eq(a[key], b[key])) {\n\t r = false;break;\n\t }\n\t }\n\t });\n\n\t return r;\n\t}", "title": "" }, { "docid": "12aceb13d45ae6351680104b6a681d29", "score": "0.59498024", "text": "function compareObjects(left, right) {\n var left_keys = Object.keys(left);\n var right_keys = Object.keys(right);\n if (!compareArrays(left_keys, right_keys)) {\n return false;\n }return left_keys.every(function (key) {\n return compare(left[key], right[key]);\n });\n}", "title": "" }, { "docid": "13c20a1e05af128b5bc22f239c276103", "score": "0.59434474", "text": "function hasPropsAndVals(obj, kv) {\n if (typeof (obj) !== 'object' || typeof (kv) !== 'object') {\n return (false);\n }\n\n if (Object.keys(kv).length === 0) {\n return (true);\n }\n\n return (Object.keys(kv).every(function (k) {\n return (obj[k] && obj[k] === kv[k]);\n }));\n}", "title": "" }, { "docid": "1b8eb955942205f054e6022081045d99", "score": "0.59299856", "text": "function compareObjects(obj1Keys, obj2Keys) {\r\n var iterateObj2 = function (obj1Key) {\r\n for (var i = 0; i < obj2Keys.length; i++) {\r\n if (obj2Keys[i] === obj1Key) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n var iterateObj1 = function () {\r\n for (var i = 0; i < obj1Keys.length; i++) {\r\n if (!iterateObj2(obj1Keys[i]))\r\n return false;\r\n }\r\n return true;\r\n };\r\n return iterateObj1();\r\n }", "title": "" }, { "docid": "d52f56844c2cafd38d98f9a57f3cdbbb", "score": "0.5917179", "text": "function _is_same(a, b){\n\t//bark('typeof(a, b): ' + typeof(a) + ',' + typeof(b));\n\n\tvar ret = false;\n\tif( a == b ){ // atoms, incl. null and 'string'\n\t //bark('true on equal atoms: ' + a + '<>' + b);\n\t ret = true;\n\t}else{ // is list or obj (ignore func)\n\t if( typeof(a) === 'object' && typeof(b) === 'object' ){\n\t\t//bark('...are objects');\n\t\t\n\t\t// Null is an object, but not like the others.\n\t\tif( a == null || b == null ){\n\t\t ret = false;\n\t\t}else if( Array.isArray(a) && Array.isArray(b) ){ // array equiv\n\t\t //bark('...are arrays');\n\t\t \n\t\t // Recursively check array equiv.\n\t\t if( a.length == b.length ){\n\t\t\tif( a.length == 0 ){\n\t\t\t //bark('true on 0 length array');\n\t\t\t ret = true;\n\t\t\t}else{\n\t\t\t ret = true; // assume true until false here\n\t\t\t for( var i = 0; i < a.length; i++ ){\n\t\t\t\tif( ! _is_same(a[i], b[i]) ){\n\t\t\t\t //bark('false on diff @ index: ' + i);\n\t\t\t\t ret = false;\n\t\t\t\t break;\n\t\t\t\t}\n\t\t\t }\n\t\t\t}\n\t\t }\n\n\t\t}else{ // object equiv.\n\n\t\t // Get unique set of keys.\n\t\t var a_keys = Object.keys(a);\n\t\t var b_keys = Object.keys(b);\n\t\t var keys = a_keys.concat(b_keys.filter(function(it){\n\t\t\treturn a_keys.indexOf(it) < 0;\n\t\t }));\n\t\t \n\t\t // Assume true until false.\n\t\t ret = true;\n\t\t for( var j = 0; j < keys.length; j++ ){ // no forEach - break\n\t\t\tvar k = keys[j];\n\t\t\tif( ! _is_same(a[k], b[k]) ){\n\t\t\t //bark('false on key: ' + k);\n\t\t\t ret = false;\n\t\t\t break;\n\t\t\t}\n\t\t }\n\t\t}\n\t }else{\n\t\t//bark('false by default');\n\t }\n\t}\n\t\n\treturn ret;\n }", "title": "" }, { "docid": "4b76b0e0d8e05f88243a55cf63b4b04b", "score": "0.5888248", "text": "function objectsEqual(obj1, obj2) {\n return Object.keys(obj1).every(key => {\n return key in obj2 && obj1[key] === obj2[key];\n });\n}", "title": "" }, { "docid": "197060f85fea6c66a7c3347c98b5f566", "score": "0.5861961", "text": "function objectsEqual(obj1, obj2, eqFn = (a, b) => a === b) {\n const keys1 = Object.keys(obj1);\n const keys2 = Object.keys(obj2);\n if (keys1.length !== keys2.length) return false;\n return keys1.reduce((eq, key) => eq && eqFn(obj1[key], obj2[key]), true);\n}", "title": "" }, { "docid": "572fc2d90ac1c39e5556fefedfcce398", "score": "0.5857236", "text": "function objectEquals(x, y) {\r\n\r\n // if both are function\r\n if (x instanceof Function) {\r\n if (y instanceof Function) {\r\n return x.toString() === y.toString();\r\n }\r\n return false;\r\n }\r\n if (x === null || x === undefined || y === null || y === undefined) { return x === y; }\r\n if (x === y || x.valueOf() === y.valueOf()) { return true; }\r\n\r\n // if one of them is date, they must had equal valueOf\r\n if (x instanceof Date) { return false; }\r\n if (y instanceof Date) { return false; }\r\n\r\n // if they are not function or strictly equal, they both need to be Objects\r\n if (!(x instanceof Object)) { return false; }\r\n if (!(y instanceof Object)) { return false; }\r\n var p = Object.keys(x);\r\n return Object.keys(y).every(function (i) { return p.indexOf(i) !== -1; }) ?\r\n p.every(function (i) { return objectEquals(x[i], y[i]); }) : false;\r\n}", "title": "" }, { "docid": "4128298fb23c0bff188e4215df685039", "score": "0.5847101", "text": "function _areEquals(a, b) {\n if (a === b) return true;\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n var arrA = Array.isArray(a), arrB = Array.isArray(b), i, length, key;\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0; ) if (!_areEquals(a[i], b[i])) return false;\n return true;\n }\n if (arrA != arrB) return false;\n var keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n for (i = length; i-- !== 0; ) if (!b.hasOwnProperty(keys[i])) return false;\n for (i = length; i-- !== 0; ) {\n key = keys[i];\n if (!_areEquals(a[key], b[key])) return false;\n }\n return true;\n }\n return a !== a && b !== b;\n }", "title": "" }, { "docid": "52c17e3bc7e68c4efecc1782b3bd5625", "score": "0.5839399", "text": "function objectsEqual(obj1, obj2) {\n if (obj1 === obj2) return true;\n\n return allKeysMatch(obj1, obj2) && allValuesMatch(obj1, obj2);\n}", "title": "" }, { "docid": "da2351558a819c02e10f091c82de617e", "score": "0.5835037", "text": "function looseEqual(a, b) {\n if (a === b) {\n return true\n }\n if (typeof a !== typeof b) {\n return false\n }\n let validTypesCount = [isDate(a), isDate(b)].filter(Boolean).length\n if (validTypesCount > 0) {\n return validTypesCount === 2 ? a.getTime() === b.getTime() : false\n }\n validTypesCount = [isFile(a), isFile(b)].filter(Boolean).length\n if (validTypesCount > 0) {\n return validTypesCount === 2 ? a === b : false\n }\n validTypesCount = [isArray(a), isArray(b)].filter(Boolean).length\n if (validTypesCount > 0) {\n return validTypesCount === 2\n ? a.length === b.length && a.every((e, i) => looseEqual(e, b[i]))\n : false\n }\n validTypesCount = [isObject(a), isObject(b)].filter(Boolean).length\n if (validTypesCount > 0) {\n /* istanbul ignore if: this if will probably never be called */\n if (validTypesCount === 1) {\n return false\n }\n const aKeysCount = keys(a).length\n const bKeysCount = keys(b).length\n if (aKeysCount !== bKeysCount) {\n return false\n }\n if (aKeysCount === 0 && bKeysCount === 0) {\n return String(a) === String(b)\n }\n // Using for loop over `Object.keys()` here since some class\n // keys are not handled correctly otherwise\n for (const key in a) {\n if (\n [a.hasOwnProperty(key), b.hasOwnProperty(key)].filter(Boolean).length === 1 ||\n !looseEqual(a[key], b[key])\n ) {\n return false\n }\n }\n return true\n }\n return false\n}", "title": "" }, { "docid": "a0c84746cbac2809ed49571f4263bd6e", "score": "0.58093494", "text": "function isEqual(a, b) {\n\t if (typeof a === 'function' && typeof b === 'function') {\n\t return true;\n\t }\n\t if (a instanceof Array && b instanceof Array) {\n\t if (a.length !== b.length) {\n\t return false;\n\t }\n\t for (var i = 0; i !== a.length; i++) {\n\t if (!isEqual(a[i], b[i])) {\n\t return false;\n\t }\n\t }\n\t return true;\n\t }\n\t if (isObject(a) && isObject(b)) {\n\t if (Object.keys(a).length !== Object.keys(b).length) {\n\t return false;\n\t }\n\t var _iteratorNormalCompletion3 = true;\n\t var _didIteratorError3 = false;\n\t var _iteratorError3 = undefined;\n\n\t try {\n\t for (var _iterator3 = Object.keys(a)[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n\t var key = _step3.value;\n\n\t if (!isEqual(a[key], b[key])) {\n\t return false;\n\t }\n\t }\n\t } catch (err) {\n\t _didIteratorError3 = true;\n\t _iteratorError3 = err;\n\t } finally {\n\t try {\n\t if (!_iteratorNormalCompletion3 && _iterator3['return']) {\n\t _iterator3['return']();\n\t }\n\t } finally {\n\t if (_didIteratorError3) {\n\t throw _iteratorError3;\n\t }\n\t }\n\t }\n\n\t return true;\n\t }\n\t return a === b;\n\t}", "title": "" }, { "docid": "ad3c2328a7f3f28445825a29f376002c", "score": "0.5808302", "text": "function isEquivalent(a,b) {\n //array property name\n\n var aProps = Object.getOwnPropertyName(a);\n var bProps = Object.getOwnPropertyName(b);\n\n //if their property lengths are different they are different objects\n if(aProps.length != bProps.lenght) {\n return false;\n\n for( var i=0; i< aProps.length; i++){\n var propName = aProps[i];\n\n //if the values of the property are different, not equal\n if(a[propName] !== b[propName]) {\n return false;\n }\n }\n\n // if everything matched, correct\n return true;\n console.log(\"ok\");\n}\n\nisEquivalent({'hi':12}, {'hi':12});}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.57995313", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.57995313", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.57995313", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.57995313", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.57995313", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.57995313", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.57995313", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.57995313", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "b3563210d64168e57cd78ebcabe08c6c", "score": "0.57995313", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n var it;\n if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n return true;\n }\n\n if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n if (a.size !== b.size) return false;\n it = a.entries();\n while (!(i = it.next()).done)\n if (!b.has(i.value[0])) return false;\n return true;\n }\n // END: Modifications\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (a[i] !== b[i]) return false;\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n // END: fast-deep-equal\n\n // START: react-fast-compare\n // custom handling for DOM elements\n if (hasElementType && a instanceof Element) return false;\n\n // custom handling for React/Preact\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n\n continue;\n }\n\n // all other properties should be traversed as usual\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n }\n // END: react-fast-compare\n\n // START: fast-deep-equal\n return true;\n }\n\n return a !== a && b !== b;\n}", "title": "" }, { "docid": "1469d0ec0f8c34340845e6ed0b53c5d9", "score": "0.579129", "text": "function propPathEq(keys, value, target) {\n if(!isArray(keys)) {\n throw new TypeError(\n 'propPathEq: Array of Non-empty Strings or Integers required for first argument'\n )\n }\n\n if(isNil(target)) {\n return false\n }\n\n var acc = target\n for(var i = 0; i < keys.length; i++) {\n var key = keys[i]\n\n if(!(isString(key) && !isEmpty(key) || isInteger(key))) {\n throw new TypeError(\n 'propPathEq: Array of Non-empty Strings or Integers required for first argument'\n )\n }\n\n if(isNil(acc)) {\n return false\n }\n\n acc = acc[key]\n\n if(!isDefined(acc)) {\n return false\n }\n }\n\n return equals(acc, value)\n}", "title": "" }, { "docid": "01359f76eee3a40f4fd476a7f3b305d3", "score": "0.578432", "text": "function compareObjects(object1, object2) {\n\tfor (var key in object1) {\n\t\tvar property = object1[key];\n\t\tvar one = (property + key);\n\t\tfor (var key2 in object2) {\n\t\t\tvar property2 = object2[key2];\n\t\t\tvar two = (property2 + key2);\n\t\t\tif (one == two){\n\t\t\t\treturn true;\n\t\t\t\tconsole.log(\"true\");\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t\tconsole.log(\"false\");\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "1633ee007a5528b084f230e1364d3842", "score": "0.5749604", "text": "function compareEquals(obj1, obj2) {\n const keysObj1 = Object.keys(obj1); //[\"c\", \"a\", \"n\"]\n const keysObj2 = Object.keys(obj2); //[\"c\", \"n\", \"a\"]\n\n if(keysObj1.length !== keysObj2.length) {\n return false\n }\n\n for (let i = 0; i < keysObj2.length; i += 1) {\n // the value of index is the index at which the key at index i in the second array could be found in the first array\n let index = keysObj1.indexOf(keysObj2[i]);\n \n //if an element from the second array can't be found in the first one OR\n //if inside the objects the value of the key from the second array (obj2 key) is different from the value of the same key from the first arr (obj1 key)\n if (index === -1 || obj2[keysObj2[i]] !== obj1[keysObj1[index]]) {\n return false\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "11467bf1f861cb2e955c0a7fd2d02d0b", "score": "0.5722226", "text": "function equal(a, b) {\n\t // START: fast-deep-equal es6/index.js 3.1.1\n\t if (a === b) return true;\n\t\n\t if (a && b && typeof a == 'object' && typeof b == 'object') {\n\t if (a.constructor !== b.constructor) return false;\n\t\n\t var length, i, keys;\n\t if (Array.isArray(a)) {\n\t length = a.length;\n\t if (length != b.length) return false;\n\t for (i = length; i-- !== 0;)\n\t if (!equal(a[i], b[i])) return false;\n\t return true;\n\t }\n\t\n\t // START: Modifications:\n\t // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n\t // to co-exist with es5.\n\t // 2. Replace `for of` with es5 compliant iteration using `for`.\n\t // Basically, take:\n\t //\n\t // ```js\n\t // for (i of a.entries())\n\t // if (!b.has(i[0])) return false;\n\t // ```\n\t //\n\t // ... and convert to:\n\t //\n\t // ```js\n\t // it = a.entries();\n\t // while (!(i = it.next()).done)\n\t // if (!b.has(i.value[0])) return false;\n\t // ```\n\t //\n\t // **Note**: `i` access switches to `i.value`.\n\t var it;\n\t if (hasMap && (a instanceof Map) && (b instanceof Map)) {\n\t if (a.size !== b.size) return false;\n\t it = a.entries();\n\t while (!(i = it.next()).done)\n\t if (!b.has(i.value[0])) return false;\n\t it = a.entries();\n\t while (!(i = it.next()).done)\n\t if (!equal(i.value[1], b.get(i.value[0]))) return false;\n\t return true;\n\t }\n\t\n\t if (hasSet && (a instanceof Set) && (b instanceof Set)) {\n\t if (a.size !== b.size) return false;\n\t it = a.entries();\n\t while (!(i = it.next()).done)\n\t if (!b.has(i.value[0])) return false;\n\t return true;\n\t }\n\t // END: Modifications\n\t\n\t if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n\t length = a.length;\n\t if (length != b.length) return false;\n\t for (i = length; i-- !== 0;)\n\t if (a[i] !== b[i]) return false;\n\t return true;\n\t }\n\t\n\t if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n\t if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n\t if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\t\n\t keys = Object.keys(a);\n\t length = keys.length;\n\t if (length !== Object.keys(b).length) return false;\n\t\n\t for (i = length; i-- !== 0;)\n\t if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\t // END: fast-deep-equal\n\t\n\t // START: react-fast-compare\n\t // custom handling for DOM elements\n\t if (hasElementType && a instanceof Element) return false;\n\t\n\t // custom handling for React/Preact\n\t for (i = length; i-- !== 0;) {\n\t if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n\t // React-specific: avoid traversing React elements' _owner\n\t // Preact-specific: avoid traversing Preact elements' __v and __o\n\t // __v = $_original / $_vnode\n\t // __o = $_owner\n\t // These properties contain circular references and are not needed when\n\t // comparing the actual elements (and not their owners)\n\t // .$$typeof and ._store on just reasonable markers of elements\n\t\n\t continue;\n\t }\n\t\n\t // all other properties should be traversed as usual\n\t if (!equal(a[keys[i]], b[keys[i]])) return false;\n\t }\n\t // END: react-fast-compare\n\t\n\t // START: fast-deep-equal\n\t return true;\n\t }\n\t\n\t return a !== a && b !== b;\n\t}", "title": "" }, { "docid": "ffc246f3fa72091b1822201261e2b3ea", "score": "0.5714558", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (areBothNaN(a, b))\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "36727a68f63f959f0900f35d6e916c6a", "score": "0.5701158", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && _typeof(a) == 'object' && _typeof(b) == 'object') {\n if (a.constructor !== b.constructor) return false;\n var length, i, keys;\n\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n\n for (i = length; i-- !== 0;) {\n if (!equal(a[i], b[i])) return false;\n }\n\n return true;\n } // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n\n\n var it;\n\n if (hasMap && a instanceof Map && b instanceof Map) {\n if (a.size !== b.size) return false;\n it = a.entries();\n\n while (!(i = it.next()).done) {\n if (!b.has(i.value[0])) return false;\n }\n\n it = a.entries();\n\n while (!(i = it.next()).done) {\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n }\n\n return true;\n }\n\n if (hasSet && a instanceof Set && b instanceof Set) {\n if (a.size !== b.size) return false;\n it = a.entries();\n\n while (!(i = it.next()).done) {\n if (!b.has(i.value[0])) return false;\n }\n\n return true;\n } // END: Modifications\n\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n\n for (i = length; i-- !== 0;) {\n if (a[i] !== b[i]) return false;\n }\n\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;) {\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n } // END: fast-deep-equal\n // START: react-fast-compare\n // custom handling for DOM elements\n\n\n if (hasElementType && a instanceof Element) return false; // custom handling for React/Preact\n\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n continue;\n } // all other properties should be traversed as usual\n\n\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n } // END: react-fast-compare\n // START: fast-deep-equal\n\n\n return true;\n }\n\n return a !== a && b !== b;\n} // end fast-deep-equal", "title": "" }, { "docid": "9d380ebec93579971ac2e9ff84267052", "score": "0.57005495", "text": "function objectsEqual(objA, objB) {\n var e_2, _a;\n var a = objA;\n var b = objB;\n if ((Array.isArray(a) && !Array.isArray(b)) ||\n (Array.isArray(b) && !Array.isArray(a))) {\n return false;\n }\n if (a instanceof Set && b instanceof Set) {\n a = __spread(a);\n b = __spread(b);\n }\n if (a instanceof Map && b instanceof Map) {\n a = Object.fromEntries(a);\n b = Object.fromEntries(b);\n }\n var aKeys = Object.keys(a);\n var bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n try {\n for (var aKeys_1 = __values(aKeys), aKeys_1_1 = aKeys_1.next(); !aKeys_1_1.done; aKeys_1_1 = aKeys_1.next()) {\n var key = aKeys_1_1.value;\n var aVal = a[key];\n var bVal = b[key];\n if (aVal && typeof aVal === 'object') {\n if (!objectsEqual(aVal, bVal)) {\n return false;\n }\n }\n else if (aVal !== bVal) {\n return false;\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (aKeys_1_1 && !aKeys_1_1.done && (_a = aKeys_1.return)) _a.call(aKeys_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n return true;\n}", "title": "" }, { "docid": "d630706703263579fa64900c43471a57", "score": "0.5696259", "text": "function objectsEqual(a, b)\n{\n if (a == null || b == null)\n {\n return a == b;\n }\n \n for (var key in a)\n {\n if (a[key] && b[key] && typeof a[key] == \"object\")\n {\n if (a[key].toString() != b[key].toString())\n {\n return false;\n }\n }\n else if (a[key] !== b[key])\n {\n return false;\n }\n }\n \n return true;\n}", "title": "" }, { "docid": "972ad4308704cfde800e9d1fffdfcc12", "score": "0.56885165", "text": "function equal(a, b) {\n // START: fast-deep-equal es6/index.js 3.1.1\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n var length, i, keys;\n\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n\n for (i = length; i-- !== 0;) {\n if (!equal(a[i], b[i])) return false;\n }\n\n return true;\n } // START: Modifications:\n // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code\n // to co-exist with es5.\n // 2. Replace `for of` with es5 compliant iteration using `for`.\n // Basically, take:\n //\n // ```js\n // for (i of a.entries())\n // if (!b.has(i[0])) return false;\n // ```\n //\n // ... and convert to:\n //\n // ```js\n // it = a.entries();\n // while (!(i = it.next()).done)\n // if (!b.has(i.value[0])) return false;\n // ```\n //\n // **Note**: `i` access switches to `i.value`.\n\n\n var it;\n\n if (hasMap && a instanceof Map && b instanceof Map) {\n if (a.size !== b.size) return false;\n it = a.entries();\n\n while (!(i = it.next()).done) {\n if (!b.has(i.value[0])) return false;\n }\n\n it = a.entries();\n\n while (!(i = it.next()).done) {\n if (!equal(i.value[1], b.get(i.value[0]))) return false;\n }\n\n return true;\n }\n\n if (hasSet && a instanceof Set && b instanceof Set) {\n if (a.size !== b.size) return false;\n it = a.entries();\n\n while (!(i = it.next()).done) {\n if (!b.has(i.value[0])) return false;\n }\n\n return true;\n } // END: Modifications\n\n\n if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n length = a.length;\n if (length != b.length) return false;\n\n for (i = length; i-- !== 0;) {\n if (a[i] !== b[i]) return false;\n }\n\n return true;\n }\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;) {\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n } // END: fast-deep-equal\n // START: react-fast-compare\n // custom handling for DOM elements\n\n\n if (hasElementType && a instanceof Element) return false; // custom handling for React/Preact\n\n for (i = length; i-- !== 0;) {\n if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner\n // Preact-specific: avoid traversing Preact elements' __v and __o\n // __v = $_original / $_vnode\n // __o = $_owner\n // These properties contain circular references and are not needed when\n // comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of elements\n continue;\n } // all other properties should be traversed as usual\n\n\n if (!equal(a[keys[i]], b[keys[i]])) return false;\n } // END: react-fast-compare\n // START: fast-deep-equal\n\n\n return true;\n }\n\n return a !== a && b !== b;\n} // end fast-deep-equal", "title": "" }, { "docid": "1041ca2c2faa0218541f6cdcee31c26a", "score": "0.568539", "text": "function shallowEqual(objA, objB) /* , noConsole */{\n var shallowPicks = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n if ((0, _is2.default)(objA, objB)) return true;\n\n if ((typeof objA === 'undefined' ? 'undefined' : (0, _typeof3.default)(objA)) !== 'object' || objA === null || (typeof objB === 'undefined' ? 'undefined' : (0, _typeof3.default)(objB)) !== 'object' || objB === null) return false;\n\n var keysA = (0, _keys3.default)(objA);\n var keysB = (0, _keys3.default)(objB);\n\n if (keysA.length !== keysB.length) return false;\n\n // Test for A's keys different from B.\n var _iteratorNormalCompletion11 = true;\n var _didIteratorError11 = false;\n var _iteratorError11 = undefined;\n\n try {\n for (var _iterator11 = (0, _getIterator3.default)(keysA), _step11; !(_iteratorNormalCompletion11 = (_step11 = _iterator11.next()).done); _iteratorNormalCompletion11 = true) {\n var key = _step11.value;\n\n if (!Object.hasOwnProperty.call(objB, key)) return false;\n\n var valAx = objA[key];\n var valBx = objB[key];\n var shouldShallowOrPicks = key in shallowPicks ? shallowPicks[key] : shallowPicks._ALL;\n if (shouldShallowOrPicks) {\n // shouldShallowBoolOrArg is either bool, or shallowPicksX\n var isBool = shouldShallowOrPicks === true;\n var shallowPicksX = isBool ? undefined : shouldShallowOrPicks;\n\n // if (!noConsole) console.log('shallowEqual on valAx:', valAx, 'valBx:', valBx, 'shallowPicksX:', shallowPicksX, 'result:', shallowEqual(valAx, valBx, shallowPicksX, true));\n if (!shallowEqual(valAx, valBx, shallowPicksX)) return false;\n } else {\n // if (!noConsole) console.log('equality on valAx:', valAx, 'valBx:', valBx, 'result:', Object.is(valAx, valBx));\n if (!(0, _is2.default)(valAx, valBx)) return false;\n }\n }\n } catch (err) {\n _didIteratorError11 = true;\n _iteratorError11 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion11 && _iterator11.return) {\n _iterator11.return();\n }\n } finally {\n if (_didIteratorError11) {\n throw _iteratorError11;\n }\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "91adb7e57eb496baad6f7fff5c549f42", "score": "0.56804293", "text": "function _shallowCompareKeys(objA, objB, keys) {\n return _filterKeys(objA, objB, keys).every(function (key) {\n return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && objA[key] === objB[key];\n });\n}", "title": "" }, { "docid": "bd6108dadab245ac02a14f227c71bb61", "score": "0.5678527", "text": "function allTrue(obj) {\n for (var o in obj)\n if (!obj[o]) return false;\n\n return true;\n}", "title": "" }, { "docid": "ce1bd4c20f9636cd99cffe25001f69de", "score": "0.5662224", "text": "function looseEqual(a,b){if(a===b){return true;}var isObjectA=isObject(a);var isObjectB=isObject(b);if(isObjectA&&isObjectB){try{var isArrayA=Array.isArray(a);var isArrayB=Array.isArray(b);if(isArrayA&&isArrayB){return a.length===b.length&&a.every(function(e,i){return looseEqual(e,b[i]);});}else if(a instanceof Date&&b instanceof Date){return a.getTime()===b.getTime();}else if(!isArrayA&&!isArrayB){var keysA=Object.keys(a);var keysB=Object.keys(b);return keysA.length===keysB.length&&keysA.every(function(key){return looseEqual(a[key],b[key]);});}else{/* istanbul ignore next */return false;}}catch(e){/* istanbul ignore next */return false;}}else if(!isObjectA&&!isObjectB){return String(a)===String(b);}else{return false;}}", "title": "" }, { "docid": "9c859d6e9b6ae25866032e07b674b429", "score": "0.5659103", "text": "function deepEqual(a, b) {\n if (a === null && b === null)\n return true;\n if (a === undefined && b === undefined)\n return true;\n if (typeof a !== \"object\")\n return a === b;\n var aIsArray = isArrayLike(a);\n var aIsMap = isMapLike(a);\n if (aIsArray !== isArrayLike(b)) {\n return false;\n }\n else if (aIsMap !== isMapLike(b)) {\n return false;\n }\n else if (aIsArray) {\n if (a.length !== b.length)\n return false;\n for (var i = a.length - 1; i >= 0; i--)\n if (!deepEqual(a[i], b[i]))\n return false;\n return true;\n }\n else if (aIsMap) {\n if (a.size !== b.size)\n return false;\n var equals_1 = true;\n a.forEach(function (value, key) {\n equals_1 = equals_1 && deepEqual(b.get(key), value);\n });\n return equals_1;\n }\n else if (typeof a === \"object\" && typeof b === \"object\") {\n if (a === null || b === null)\n return false;\n if (isMapLike(a) && isMapLike(b)) {\n if (a.size !== b.size)\n return false;\n // Freaking inefficient.... Create PR if you run into this :) Much appreciated!\n return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries());\n }\n if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length)\n return false;\n for (var prop in a) {\n if (!(prop in b))\n return false;\n if (!deepEqual(a[prop], b[prop]))\n return false;\n }\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "38cfb5e5b281375cc931997bf17e4723", "score": "0.56567", "text": "function equals(k1: any, k2: any): boolean {\n\tif (k1 === null || k1 === undefined) return false;\n\tif (k1 === k2) return true;\n\tif (typeof k1.equals === 'function') return k1.equals(k2);\n\treturn false;\n}", "title": "" }, { "docid": "db83281e491e789db413be5af3352dff", "score": "0.56550866", "text": "function objectsEqual(a, b) {\n if (a === b) { return true }\n if (Object.keys(a).length !== Object.keys(b).length) { return false };\n\n let keys = Object.keys(a);\n for (var i = 0; i < keys.length; i++) {\n let key = keys[i];\n if (a[key] !== b[key] || !(b.hasOwnProperty(key))) { return false };\n }\n\n return true;\n}", "title": "" }, { "docid": "a46a17bf4c763bfd32170280e4035ea7", "score": "0.56523", "text": "function areEqual(address1, address2) {\n for (let key in address1) {\n if (address1[key] === address2[key])\n console.log(true);\n else console.log(false);\n\n }\n}", "title": "" }, { "docid": "d30886a2a29b7bfae5c45e86789223ba", "score": "0.56513363", "text": "function _shallowCompareKeys(objA, objB, keys) {\r\n return _filterKeys(objA, objB, keys).every(function (key) {\r\n return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && objA[key] === objB[key];\r\n });\r\n }", "title": "" }, { "docid": "00b7decd1e007109ba2f419a235dece2", "score": "0.5647193", "text": "function _deepCompareKeys(objA, objB, keys) {\n return keys.every(function (key) {\n return objA.hasOwnProperty(key) === objB.hasOwnProperty(key) && deepCompareKeys(objA[key], objB[key]);\n });\n}", "title": "" }, { "docid": "057637b65d913c8e7c0e3162dae32ff3", "score": "0.56470627", "text": "async hasDuplicates (keysToCheck) {\n const allObjs = await this._fetchAll()\n keysToCheck.every(key => {\n allObjs.some(item => {\n if (item[key] === this[key]) {\n console.warn(`Duplicate value found in ${key}, value is ${item[key]}`)\n return true\n }\n return false\n })\n\n })\n }", "title": "" }, { "docid": "2f5d997cd143a5306f4e04d39ab47af7", "score": "0.5643446", "text": "function anyEqual(firstArg, anotherArg, etc) {\n var args = [].slice.apply(arguments);\n for (var i = 1; i < args.length; i++) {\n if (args[0] === args[i]) { return true };\n }\n return false;\n}", "title": "" }, { "docid": "192c626a56e225f27c41a3a023c7cec0", "score": "0.5642407", "text": "function deepEqualsObject (obj1, obj2, keys, changes, exactCompare) {\n if (typeof obj1 !== 'object' || typeof obj2 !== 'object' ||\n Array.isArray(obj1) || Array.isArray(obj2)) {\n throw new Error('Input must be two non-array objects');\n }\n\n exactCompare = arguments.length < 5 ? true : !!exactCompare;\n\n var keySet = getKeySet(obj1, obj2);\n\n for (var key in keySet) {\n keys.push(key);\n if (typeof obj1[key] !== typeof obj2[key]) {\n addToChanges(keys, obj1[key], obj2[key], changes);\n } else if (Array.isArray(obj1[key]) && Array.isArray(obj2[key])) {\n deepEqualsArray(obj1[key], obj2[key], keys, changes, exactCompare);\n } else if ((Array.isArray(obj1[key]) && !Array.isArray(obj2[key])) ||\n (!Array.isArray(obj1[key]) && Array.isArray(obj2[key]))) {\n addToChanges(keys, obj1[key], obj2[key], changes);\n } else if (typeof obj1[key] === 'object') {\n deepEqualsObject(obj1[key], obj2[key], keys, changes, exactCompare);\n } else if(obj1[key] !== obj2[key]) {\n addToChanges(keys, obj1[key], obj2[key], changes);\n }\n keys.pop();\n }\n \n return;\n }", "title": "" }, { "docid": "5067e5e22996b3542b0009501a645e5c", "score": "0.563977", "text": "function keyValueMatchMaker(object1, object2) {\n var match = false;\n\n for (var key in object1) {\n if (Object.is(object1[key], object2[key])) {\n match = true\n console.log(key + ': ' + object1[key]);\n }\n }\nreturn match;\n}", "title": "" }, { "docid": "ae5f441a5dbcb3aaf6996b833d49797d", "score": "0.5630701", "text": "function isEqual(a, b) {\n if (typeof a === 'function' && typeof b === 'function') {\n return true;\n }\n\n if (a instanceof Array && b instanceof Array) {\n if (a.length !== b.length) {\n return false;\n }\n\n for (var i = 0; i !== a.length; i++) {\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n }\n\n if (isObject(a) && isObject(b)) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n\n for (var _i3 = 0, _Object$keys = Object.keys(a); _i3 < _Object$keys.length; _i3++) {\n var key = _Object$keys[_i3];\n\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n\n return true;\n }\n\n return a === b;\n}", "title": "" }, { "docid": "099b3157624e98f83771d823f25a40dd", "score": "0.56256914", "text": "function equals(o1, o2) {\n /* jshint ignore:start */\n if (o1 === o2) return true;\n if (o1 === null || o2 === null) return false;\n if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN\n var t1 = typeof o1, t2 = typeof o2, length, key, keySet;\n if (t1 == t2) {\n if (t1 == 'object') {\n if (isArray(o1)) {\n if (!isArray(o2)) return false;\n if ((length = o1.length) == o2.length) {\n for(key=0; key<length; key++) {\n if (!equals(o1[key], o2[key])) return false;\n }\n return true;\n }\n } else if (isDate(o1)) {\n return isDate(o2) && o1.getTime() == o2.getTime();\n } else if (isRegExp(o1) && isRegExp(o2)) {\n return o1.toString() == o2.toString();\n } else {\n if (/*isScope(o1) || isScope(o2) ||*/ isWindow(o1) || isWindow(o2) || isArray(o2)) return false;\n keySet = {};\n for(key in o1) {\n if (key.charAt(0) === '$' || isFunction(o1[key])) continue;\n if (!equals(o1[key], o2[key])) return false;\n keySet[key] = true;\n }\n for(key in o2) {\n if (!keySet.hasOwnProperty(key) &&\n key.charAt(0) !== '$' &&\n o2[key] !== undefined &&\n !isFunction(o2[key])) return false;\n }\n return true;\n }\n }\n }\n /* jshint ignore:end */\n return false;\n}", "title": "" }, { "docid": "099b3157624e98f83771d823f25a40dd", "score": "0.56256914", "text": "function equals(o1, o2) {\n /* jshint ignore:start */\n if (o1 === o2) return true;\n if (o1 === null || o2 === null) return false;\n if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN\n var t1 = typeof o1, t2 = typeof o2, length, key, keySet;\n if (t1 == t2) {\n if (t1 == 'object') {\n if (isArray(o1)) {\n if (!isArray(o2)) return false;\n if ((length = o1.length) == o2.length) {\n for(key=0; key<length; key++) {\n if (!equals(o1[key], o2[key])) return false;\n }\n return true;\n }\n } else if (isDate(o1)) {\n return isDate(o2) && o1.getTime() == o2.getTime();\n } else if (isRegExp(o1) && isRegExp(o2)) {\n return o1.toString() == o2.toString();\n } else {\n if (/*isScope(o1) || isScope(o2) ||*/ isWindow(o1) || isWindow(o2) || isArray(o2)) return false;\n keySet = {};\n for(key in o1) {\n if (key.charAt(0) === '$' || isFunction(o1[key])) continue;\n if (!equals(o1[key], o2[key])) return false;\n keySet[key] = true;\n }\n for(key in o2) {\n if (!keySet.hasOwnProperty(key) &&\n key.charAt(0) !== '$' &&\n o2[key] !== undefined &&\n !isFunction(o2[key])) return false;\n }\n return true;\n }\n }\n }\n /* jshint ignore:end */\n return false;\n}", "title": "" }, { "docid": "ed3f7d4c89b7884cfeb0c500ca7a60ba", "score": "0.56256235", "text": "function looseEqual(a,b){if(a===b){return true;}var isObjectA=isObject(a);var isObjectB=isObject(b);if(isObjectA&&isObjectB){try{var isArrayA=Array.isArray(a);var isArrayB=Array.isArray(b);if(isArrayA&&isArrayB){return a.length===b.length&&a.every(function(e,i){return looseEqual(e,b[i]);});}else if(!isArrayA&&!isArrayB){var keysA=Object.keys(a);var keysB=Object.keys(b);return keysA.length===keysB.length&&keysA.every(function(key){return looseEqual(a[key],b[key]);});}else{/* istanbul ignore next */return false;}}catch(e){/* istanbul ignore next */return false;}}else if(!isObjectA&&!isObjectB){return String(a)===String(b);}else{return false;}}", "title": "" }, { "docid": "9aadad97a89cecb4e11961d40c93a008", "score": "0.5622645", "text": "function looseEqual(a,b){if(a===b){return true;}var isObjectA=isObject(a);var isObjectB=isObject(b);if(isObjectA&&isObjectB){try{var isArrayA=Array.isArray(a);var isArrayB=Array.isArray(b);if(isArrayA&&isArrayB){return a.length===b.length&&a.every(function(e,i){return looseEqual(e,b[i]);});}else if(!isArrayA&&!isArrayB){var keysA=(0,_keys4.default)(a);var keysB=(0,_keys4.default)(b);return keysA.length===keysB.length&&keysA.every(function(key){return looseEqual(a[key],b[key]);});}else{/* istanbul ignore next */return false;}}catch(e){/* istanbul ignore next */return false;}}else if(!isObjectA&&!isObjectB){return String(a)===String(b);}else{return false;}}", "title": "" }, { "docid": "0fc2c20206f01b265a7cb267cb056676", "score": "0.5622227", "text": "function compareObjects(first_object, second_object) {\n\tfor (var key in first_object) {\n\t\tfor (var other_key in second_object) {\n\t\t\tif (key == other_key) {\n\t\t\t\tif (first_object[key] == second_object[other_key]) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "eda1426ee1f22933ad5e95ed8ded5cc8", "score": "0.561353", "text": "function shallowCompareKeys(objA, objB, keys) {\n // treat `null` and `undefined` as the same\n if (objA == null && objB == null) {\n return true;\n }\n else if (objA == null || objB == null) {\n return false;\n }\n else if (Array.isArray(objA) || Array.isArray(objB)) {\n return false;\n }\n else if (keys != null) {\n return _shallowCompareKeys(objA, objB, keys);\n }\n else {\n // shallowly compare all keys from both objects\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n return (_shallowCompareKeys(objA, objB, { include: keysA }) && _shallowCompareKeys(objA, objB, { include: keysB }));\n }\n}", "title": "" }, { "docid": "b82b56b03f5a0e9f5e327afc56536262", "score": "0.56067836", "text": "function contains_all(obj, keys) {\n for (var i = 0; i < keys.length; ++i) {\n if (!obj[keys[i]])\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "45877399679f9b96a86963b9addcadb1", "score": "0.5603901", "text": "function isEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (generalType(a) != generalType(b)) {\n return false;\n }\n\n if (a == b) {\n return true;\n }\n\n if (typeof a != 'object') {\n return false;\n }\n\n // null != {}\n if (a instanceof Object != b instanceof Object) {\n return false;\n }\n\n if (a instanceof Date || b instanceof Date) {\n if (a instanceof Date != b instanceof Date ||\n a.getTime() != b.getTime()) {\n return false;\n }\n }\n\n var allKeys = [].concat(keys(a), keys(b));\n uniqueArray(allKeys);\n\n for (var i = 0; i < allKeys.length; i++) {\n var prop = allKeys[i];\n if (!isEqual(a[prop], b[prop])) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "3cde00d1f2527edc1d520d215ab4f3bf", "score": "0.55963445", "text": "function shallowCompareKeys(objA, objB, keys) {\r\n // treat `null` and `undefined` as the same\r\n if (objA == null && objB == null) {\r\n return true;\r\n }\r\n else if (objA == null || objB == null) {\r\n return false;\r\n }\r\n else if (Array.isArray(objA) || Array.isArray(objB)) {\r\n return false;\r\n }\r\n else if (keys != null) {\r\n return _shallowCompareKeys(objA, objB, keys);\r\n }\r\n else {\r\n // shallowly compare all keys from both objects\r\n var keysA = Object.keys(objA);\r\n var keysB = Object.keys(objB);\r\n return (_shallowCompareKeys(objA, objB, { include: keysA }) && _shallowCompareKeys(objA, objB, { include: keysB }));\r\n }\r\n }", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" }, { "docid": "86d27b7e8b3a80be028eda26f842db5d", "score": "0.5591385", "text": "function looseEqual (a, b) {\n if (a === b) { return true }\n var isObjectA = isObject(a);\n var isObjectB = isObject(b);\n if (isObjectA && isObjectB) {\n try {\n var isArrayA = Array.isArray(a);\n var isArrayB = Array.isArray(b);\n if (isArrayA && isArrayB) {\n return a.length === b.length && a.every(function (e, i) {\n return looseEqual(e, b[i])\n })\n } else if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime()\n } else if (!isArrayA && !isArrayB) {\n var keysA = Object.keys(a);\n var keysB = Object.keys(b);\n return keysA.length === keysB.length && keysA.every(function (key) {\n return looseEqual(a[key], b[key])\n })\n } else {\n /* istanbul ignore next */\n return false\n }\n } catch (e) {\n /* istanbul ignore next */\n return false\n }\n } else if (!isObjectA && !isObjectB) {\n return String(a) === String(b)\n } else {\n return false\n }\n}", "title": "" } ]
e40d1c2be58bdedeec19a1e17871b8f4
download of onscreen data
[ { "docid": "4a24470d3219323e6f6f471cdec6357e", "score": "0.0", "text": "function tsvProbeMatrix(heatmap, samples, fields, codes) {\n\tvar fieldNames = ['sample'].concat(fields);\n\tvar coded = _.map(fields, (f, i) => codes ?\n\t\t\t_.map(heatmap[i], _.propertyOf(codes)) :\n\t\t\theatmap[i]);\n\tvar transposed = _.zip.apply(null, coded);\n\tvar tsvData = _.map(samples, (sample, i) => [sample].concat(transposed[i]));\n\n\treturn [fieldNames, tsvData];\n}", "title": "" } ]
[ { "docid": "7e6043f62a22a1a7d77fb05e69c14e19", "score": "0.5983824", "text": "function getCanvasData () {\r\n \r\n var href = window.location.href.split('?')[1]\r\n , id = href.split('=')[1]\r\n , url = '/bin/?id=' + id\r\n , size = 8\r\n ;\r\n\r\n if (imageData) {\r\n convertAndDisplay(size);\r\n } else {\r\n $loader.css({'visibility': 'visible'});\r\n getData(url, function(err, data) {\r\n imageData = data;\r\n if (err) {\r\n console.log(err);\r\n } else {\r\n convertAndDisplay(size);\r\n $loader.css({'visibility': 'hidden'});\r\n }\r\n });\r\n }\r\n }", "title": "" }, { "docid": "09bcab6ceee6bfafbd7880ec0179f777", "score": "0.5960779", "text": "function download() {\n var canvas = canvasInstance.getCanvas();\n var tempFilename = filename + \"-instagramanous.jpg\";\n if(canvas != null) {\n var dt = canvas.toDataURL('image/jpeg');\n this.href = dt; \n this.download = tempFilename; \n }\n }", "title": "" }, { "docid": "45846bbf6b414850bf16d9212254bebf", "score": "0.5956354", "text": "download(result) {\n if ( this.fetching || this.activeButton ) {\n return;\n }\n this.fetching = result;\n VRSPACEUI.indicator.animate();\n VRSPACEUI.indicator.add(\"Download\");\n fetch(\"/sketchfab/download?uid=\"+result.uid)\n .then(response => {\n this.fetching = null;\n console.log(response);\n if ( response.status == 401 ) {\n console.log(\"Redirecting to login form\")\n this.sketchfabLogin();\n return;\n }\n response.json().then(res => {\n console.log(res);\n this.createSharedObject(res.mesh);\n });\n }).catch( err => {\n this.fetching = null;\n console.log(err);\n VRSPACEUI.indicator.remove(\"Download\");\n });\n }", "title": "" }, { "docid": "ddf3b5ebff067a10ba6aecd80b4c0714", "score": "0.592322", "text": "batchDownload() {\n this.context.navigate('https://www.encodeproject.org/files/ENCFF250UJY/@@download/ENCFF250UJY.tsv');\n }", "title": "" }, { "docid": "2bcc2f037edaddf93792f3aea0c8ea2b", "score": "0.59160507", "text": "function DownloadToDevice(fileurl) {\n let blob = null;\n const xhr = new XMLHttpRequest();\n xhr.open(\"GET\", fileurl);\n xhr.responseType = \"blob\"; //force the HTTP response, response-type header to be blob\n xhr.onload = function () {\n blob = xhr.response; //xhr.response is now a blob object\n //console.log(blob);\n let storageLocation = 'file:///storage/emulated/0/';\n const folderpath = storageLocation + \"Download\";\n //Creëer 4 random integers\n function rndInt() {\n return Math.floor(1000 + Math.random() * 9000)\n }\n const filename = \"Wallmania\"+rndInt()+\"-\"+rndInt()+\"-\"+rndInt()+\".png\";\n const DataBlob = blob;\n window.resolveLocalFileSystemURL(folderpath, function (dir) {\n dir.getFile(filename, {\n create: true\n }, function (file) {\n file.createWriter(function (fileWriter) {\n fileWriter.write(DataBlob);\n //Download was succesfull\n alert('Wallpaper has been downloaded!');\n }, function (err) {\n // Failed\n alert('Error, file could not be downloaded!')\n });\n });\n });\n };\n xhr.send();\n }", "title": "" }, { "docid": "6688fae4b68ebe291936cf1411b6caf2", "score": "0.59138286", "text": "downloadFile () {\n\n }", "title": "" }, { "docid": "34e6da51614702a46c0463e58fb6b47e", "score": "0.59095263", "text": "function downloadData(dataurl){\n dataURL = dataurl;\n disableMenue();\n var xhr = new XMLHttpRequest();\n xhr.addEventListener(\"progress\", updateProgress);\n xhr.addEventListener(\"error\", downloadError);\n xhr.open('GET',dataurl, true);\n xhr.send(null);\n xhr.onload = function(){\n try{\n theData = JSON.parse(xhr.responseText);\n currentData = theData.features;\n theData.features = theData.features.sort(function(a,b){\n return (getFeatureProperty(a,'time') - getFeatureProperty(b, 'time'));\n });\n \n \n }catch(err){\n moveBar(-3);\n console.log('error parasing ' + err);\n return;\n }\n //after loading the data, extract heat data and add them to map\n\n updateDataSummary(theData.features);\n if(!mymap)\n initMap();\n else\n initQuakeData();\n \n \n //hide download bar\n setTimeout(function(){\n moveBar(-1); \n \n }, 1000);\n \n \n };\n //calculate downloaded percent to update progress bar\n function updateProgress (oEvent) {\n if (oEvent.lengthComputable) {\n var percentComplete = oEvent.loaded / oEvent.total;\n moveBar(percentComplete);\n } else {\n moveBar(0);\n }\n }\n function downloadError(){\n moveBar(-2);\n }\n\n}", "title": "" }, { "docid": "9a87dcfe8a2adb1348231518f2666f63", "score": "0.5906929", "text": "function downloadInreach(query) {\r\n\r\n\tconsole.log('downloading ' + query);\r\n\t\r\n\tvar file = fs.createWriteStream('../tracks/feed.kml');\t// File to read locally\r\n\tvar s = 0;\r\n\r\n\thttps.get('https://inreach.garmin.com/Feed/Share/' + query, function(res) {\r\n\t\t//console.log('statusCode: ', res.statusCode);\r\n\t\t//console.log('headers: ', res.headers);\r\n\t\tres.on('data', function(data) {\r\n\t\t\ts += data.length;\r\n file.write(data);\r\n\t\t});\r\n\t res.on('end', function() {\r\n\t\t\tconsole.log (\"feed.kml done, \" + s + \" bytes\");\r\n\t\t\tfile.end();\r\n\t\t});\r\n\t});\r\n}", "title": "" }, { "docid": "f7b74d2088e5bc26afddbc37a1db3134", "score": "0.58858347", "text": "function downloadFile() {\n writeFileTextToFile(unlocked_Text,fileInfoObject.metaData);\n}", "title": "" }, { "docid": "676bce9cd21cc93d1f032272aeb25c8f", "score": "0.585516", "text": "function downloads(){\n\tvar dt = canvas.toDataURL();\n\tthis.href = dt;\n}", "title": "" }, { "docid": "15282596b94ab9004799874f26b393ef", "score": "0.58523935", "text": "function ls1mcs_dlnkphoto_download(cmdId, from, till) {\n $.ajax({\n type: \"POST\",\n url: api_url(\"command/usr/\" + cmdId + \"/photo/download\"),\n data: JSON.stringify({from: from, till: till}),\n success: function () {},\n dataType: \"json\"\n });\n}", "title": "" }, { "docid": "cacc2fb06f41570277e162bbbe1d35f1", "score": "0.5810521", "text": "function downloadFile(name, sshid) {\n var socket = io('/download');\n var sid = createId();\n socket.emit('filePath', { path: name, sshid: sshid, sid: sid });\n let fileName = name.substring(name.lastIndexOf(\"/\") + 1);\n allFileList.unshift({ sid: sid, status: 0, name: name, type: \"down\", fileName: fileName });\n showNum();\n socket.on('transferred:' + sid, function (msg) {\n if (msg) {\n var porcess = Math.ceil((msg.transferred / msg.total) * 100);\n changeAllFileListStatus(msg.sid, porcess);\n showProcess();\n }\n });\n socket.on('over:' + sid, function (msg) {\n if (msg) {\n changeAllFileListStatus(msg.sid, \"over\");\n showNum();\n showProcess();\n toastr.info(name + \" 下载完成!\");\n }\n });\n\n}", "title": "" }, { "docid": "a73a7cb9ff07e9b1dd0fb3f5f986ca0c", "score": "0.5802034", "text": "function downloadArt(name) {\n $('#main').empty();\n $('#main').append('<div class=\"loader\"></div>');\n $('#modal').toggle(100);\n socket.emit('downloadart', name);\n}", "title": "" }, { "docid": "06276b71d3cb8f285821be5600491141", "score": "0.5790572", "text": "function edownload(url, dst, opt) {\n var o = (opt || typeof dst==='string'? opt:dst)||{};\n var bar = o.progress===undefined? new Progress(FORMAT, OPTIONS):o.progress;\n return download(url, dst, opt).on('response', o.onresponse||(res => {\n if(bar==null) return;\n bar.total = res.headers['content-length'];\n res.on('data', dat => bar.tick(dat.length));\n }));\n}", "title": "" }, { "docid": "6192fbc0ceeca6e59ccf694826c99213", "score": "0.57665825", "text": "function loopAndDownload(theUrl, theAnchor) { \n var xhr = $.ajax({\n url: theUrl,\n type: 'GET'\n }).done(function(data) {\n console.log('\\t' + 'theUrl: ' + theUrl);\n \n //Get a reference to the web page\n var $thePage = $(data);\n\n //Create the anchor\n console.log('\\t' + 'anchor: ' + theAnchor);\n \n //Get the download link\n var theDownloadLink = getDownloadLink($thePage, theAnchor);\n\t\tscene.downloadUrl = theDownloadLink;\n\t\tconsole.log(scene);\n \n //GM_download(theDownloadLink, theAnchor);\n window.open(theDownloadLink);\n\t\tconsole.log('\\t' + 'theDownloadLink: ' + theDownloadLink);\n }).fail(function() {\n console.log('FAIL!');\n });\n\n}", "title": "" }, { "docid": "803c55d7d2a5833ae10f39b978a50be6", "score": "0.5731323", "text": "function displayDownloadable(){\n\t var canvas = document.getElementById('canvas');\n\n\t\tcanvas.toBlob(function(blob) {\n\t\t var newImg = document.createElement('img'),\n\t\t\t url = URL.createObjectURL(blob);\n\n\t\t newImg.onload = function() {\n\t\t\t// no longer need to read the blob so it's revoked\n\t\t\tURL.revokeObjectURL(url);\n\t\t };\n\n\t\t newImg.src = url;\n\t\t document.body.appendChild(newImg);\n\t\t });\n}", "title": "" }, { "docid": "803c55d7d2a5833ae10f39b978a50be6", "score": "0.5731323", "text": "function displayDownloadable(){\n\t var canvas = document.getElementById('canvas');\n\n\t\tcanvas.toBlob(function(blob) {\n\t\t var newImg = document.createElement('img'),\n\t\t\t url = URL.createObjectURL(blob);\n\n\t\t newImg.onload = function() {\n\t\t\t// no longer need to read the blob so it's revoked\n\t\t\tURL.revokeObjectURL(url);\n\t\t };\n\n\t\t newImg.src = url;\n\t\t document.body.appendChild(newImg);\n\t\t });\n}", "title": "" }, { "docid": "d6e0feffde78ba2664e866a1a038063b", "score": "0.57157093", "text": "download() {\n this.template.querySelector(\"c-ocean-export-main\").download();\n }", "title": "" }, { "docid": "dc3ee72187de7c5c1097bd3ff691c161", "score": "0.5706798", "text": "function downloadData() {\n fs.readFile(\"./data.json\", \"utf8\", (err, data) => {\n if (err) console.log(err);\n\n JSON.parse(data).forEach(e => {\n console.log('Downloading ' + e.filename);\n downloadImage(e.primaryImage, e.filename, function(){\n console.log('Finished Downloading ' + e.filename);\n });\n });\n\n });\n}", "title": "" }, { "docid": "a94f2268837413fdd7101a0cca980adf", "score": "0.5668367", "text": "function downloadProgramReport() {\n downloadFile(\"api/programs/csv\");\n }", "title": "" }, { "docid": "6bb62097ba3b292f6fecdc6c17ba5157", "score": "0.56656253", "text": "function onDownload(){\n log('#logs', \"Click the download button\");\n //if(detector && detector.isRunning){\n prepCSV();\n//\tdetector.download();\n\n //}\n\n}", "title": "" }, { "docid": "47b7e24cf56f5e19f657bf183cd96ef2", "score": "0.5651969", "text": "function displayDownload(){\r\n //uses same process as above typed.js to create downloading message\r\n var downloadingmessage = new Typed('#txtDownload', {\r\n strings: [\"Downloading...\"],\r\n typeSpeed: typePace,\r\n showCursor: false,\r\n });\r\n //shows loading bar after 1 second\r\n setTimeout(showBar, 1000);\r\n \r\n }", "title": "" }, { "docid": "61603d58954b79b01efae76c46e655c7", "score": "0.55874914", "text": "downloadImage() {\n this.download = true;\n this.processImage();\n }", "title": "" }, { "docid": "0c5fb8073ddfb7f5c278bdfa49446b38", "score": "0.55819255", "text": "function setDownloadData(screenCap, csv, id){\n // let them download the data.\n var scap = $(\"#screencap\");\n scap.attr(\"href\",screenCap);\n scap.attr(\"download\",id+\"_screencap.png\");\n var pairs = $(\"#pairwise\");\n pairs.attr(\"href\",\"data:text/plain;charset=utf-8,\"+encodeURIComponent(csv));\n pairs.attr(\"download\",id+\"_pairwise.csv\");\n}", "title": "" }, { "docid": "4e3c673bacf13017ed246eb3cdf04724", "score": "0.5570593", "text": "function downloaded() {\n var download = document.getElementById(\"downloader\");\n var image = document\n .getElementById(\"canvas\")\n .toDataURL(\"image/jpeg\")\n .replace(\"image/jpeg\", \"image/octet-stream\");\n download.setAttribute(\"href\", image);\n}", "title": "" }, { "docid": "7d4aa2f9523cb693b641d16599ea3d7d", "score": "0.555801", "text": "downloadSticker() {\n let that = this\n wx.cloud.downloadFile({\n fileID: that.cloudPath, // \n success: res => {\n console.log(\"download file succeed\", res)\n that.httpPath = res.tempFilePath\n that.saveToLocal(that.httpPath)\n },\n fail(res) {\n console.log(\"download file failed\", res)\n\n }\n })\n\n }", "title": "" }, { "docid": "eda1c2f05b801d9487276b2f0797d4d6", "score": "0.55515724", "text": "async function download() {\n const data = await request(URL, {json: true});\n const out = {};\n\n /**\n * This transforms the array of Connector objects from\n * loopback-workspace as follows:\n *\n * - Transforms the array into an object / map\n * - Transforms display:password to type:password so it can be used by CLI directly\n * - Transforms description to message so it can be used by CLI directly\n */\n data.forEach(item => {\n if (item.settings) {\n Object.values(item.settings).forEach(value => {\n if (value.display === 'password') {\n value.type = 'password';\n delete value.display;\n }\n\n if (value.description) {\n value.message = value.description;\n delete value.description;\n }\n });\n }\n out[item.name] = item;\n });\n\n // Write data to file\n await writeFileAsync(DEST, JSON.stringify(out, null, 2));\n}", "title": "" }, { "docid": "dfd4723127ec93ae3fdfbd149f128948", "score": "0.5546014", "text": "download(){\n var output = this.getOutput();\n\n if(output){\n FileSaver.saveAs( this.getOutput(), this.getMetadata(\"filename\"));\n }else{\n console.warn(\"No output computed yet.\");\n }\n }", "title": "" }, { "docid": "dfd4723127ec93ae3fdfbd149f128948", "score": "0.5546014", "text": "download(){\n var output = this.getOutput();\n\n if(output){\n FileSaver.saveAs( this.getOutput(), this.getMetadata(\"filename\"));\n }else{\n console.warn(\"No output computed yet.\");\n }\n }", "title": "" }, { "docid": "b465bb40a6e66b3d130bd00bff780709", "score": "0.5543642", "text": "function shpDownload() {\n zatvoriHamburger();\n wfsDownload(\"SHAPE-ZIP\");\n}", "title": "" }, { "docid": "e7a965a80d7cd3e174ed2596ccb9d88a", "score": "0.5542283", "text": "async function fetchData(filename) {\n const att = atts[filename];\n const path = encodeDocId(doc._id) + '/' + encodeAttachmentId(filename) +\n '?rev=' + doc._rev;\n\n const response = await ourFetch(genDBUrl(host, path));\n\n let blob;\n if ('buffer' in response) {\n blob = await response.buffer();\n } else {\n /* istanbul ignore next */\n blob = await response.blob();\n }\n\n let data;\n if (opts.binary) {\n const typeFieldDescriptor = Object.getOwnPropertyDescriptor(blob.__proto__, 'type');\n if (!typeFieldDescriptor || typeFieldDescriptor.set) {\n blob.type = att.content_type;\n }\n data = blob;\n } else {\n data = await new Promise(function (resolve) {\n blufferToBase64(blob, resolve);\n });\n }\n\n delete att.stub;\n delete att.length;\n att.data = data;\n }", "title": "" }, { "docid": "2ea4d1d4b8388ce3f8b87e0b21c1be6b", "score": "0.55420953", "text": "function downloadScreenshot() {\n\n var callback = function (canvas) {\n // Download the image\n var download = document.createElement(\"a\");\n download.href = canvas.toDataURL(\"image/png\");\n download.download = \"parallel-coordinate.png\";\n download.click();\n };\n yelpcoord.mergeParcoords(callback);\n}", "title": "" }, { "docid": "8cf9fa856a40797e4fb6fc59203e7ac4", "score": "0.5536974", "text": "function requestServerData()\n {\n sendCommand(\"JSON.stringify(Module_GetLastDataNative('\" + pageInstance.alias + \"'));\", handleServerData);\n }", "title": "" }, { "docid": "8a3ba0d5669b5016dbecb7911226f3e9", "score": "0.55343544", "text": "function download() {\n var link = document.createElement(\"a\");\n link.download = 'MSQ_Data.json';\n var json = JSON.stringify(CurScore);\n var blob = new Blob([json], {type: \"octet/stream\"});\n var url = window.URL.createObjectURL(blob);\n link.href = url;\n link.click();\n}", "title": "" }, { "docid": "6e7f526651df2b6d17f169b3b198aef5", "score": "0.5532981", "text": "function download_layout_general(url,data){\n var fields = {'data' : data};\n send_post(fields,url,false,false);\n }", "title": "" }, { "docid": "e7fe7e0282b1bc1ba957508e6a4ed746", "score": "0.5528822", "text": "function downloadData() {\n let outputType = getActiveOutput();\n if (finalRoutes.length == 0) {\n alert(\"No results\");\n } else {\n if (outputType == \"csv\") {\n downloadCSV(resultsToCSV(finalRoutes));\n } else if (outputType == \"geojson\") {\n downloadJSON(resultsToGeoJSON(finalRoutes));\n }\n }\n}", "title": "" }, { "docid": "0cd83240784fc057296498cb20915fed", "score": "0.5512003", "text": "function download() {\n\t// Make sure there's images left to download\n\tif(images.length > 0) {\n\t\t// Download the image\n\t\trequest(images[0].large_file_url).pipe(fs.createWriteStream(path.normalize(folder + images[0].id + path.extname(images[0].large_file_url)))).on('close', () => {\n\t\t\timages.splice(0, 1); // Remove it from the images array\n\t\t\tconsole.log(images.length + \" images left to download.\");\n\t\t\tdownload(); // Recall the function\n\t\t}).on('error', () => { // In case of error\n\t\t\tconsole.log(\"Unable to download picture \" + images[0].id);\n\t\t\timages.splice(0, 1);\n\t\t\tdownload();\n\t\t});\n\t} else { // We're done\n\t\tconsole.log(\"Done!\");\n\t}\n}", "title": "" }, { "docid": "24e9c465f080ed98a05d0494dab76ca5", "score": "0.5511623", "text": "async function dataDowload(input, dowload, client){\n await client.access(input)\n var text = []\n for await ( const [index, list] of dowload.entries()){\n //console.log(list.localFileName)\n //console.log(list.remoteFileName)\n await client.downloadTo(\"./\" + list.localFileName,\n \"./\" + list.remoteFileName)\n await readingLocal(list.localFileName, text, index);\n }\n //console.log(text)\n return text\n}", "title": "" }, { "docid": "7f76254133d286a3b5699311cfc4cf52", "score": "0.5503701", "text": "get(){\n var x = document.getElementById(\"container\");\n x.style.display = \"none\";\n var x = document.getElementById(\"download\");\n x.style.display = \"block\";\n var data = \"text/json;charset=utf-8,\" + encodeURIComponent(JSON.stringify(this.heartRates));\n var a = document.createElement('a');\n a.id=\"downloadlink\";\n a.href = 'data:' + data;\n a.download = 'data.json';\n a.innerHTML = 'download JSON';\n var container = document.getElementById('download');\n container.appendChild(a);\n }", "title": "" }, { "docid": "379f6db9f300fc3f4873194b909d8178", "score": "0.54951507", "text": "async downloadImg(){ \n const stream = await this.ctx.getFileStream();\n const filename = new Date().getTime() + path.extname(stream.filename).toLowerCase();\n const target = path.join(this.config.baseDir, 'app/public/uploads/IMG/BlogImg', filename);\n const writeStream = fs.createWriteStream(target);\n await pump(stream, writeStream);\n this.ctx.body = {\n code: 20000,\n data: {\n name: filename,\n // file: `/public/uploads/IMG/DownloadImg/${filename}` //正式地址\n // file: `http://127.0.0.1:7001/public/uploads/IMG/DownloadImg/${filename}` //临时服务器地址\n file: `http://127.0.0.1:7001/uploads/IMG/BlogImg/${filename}` //临时服务器地址\n }\n }\n console.log(this.ctx.body);\n }", "title": "" }, { "docid": "7b0347d29cb031f3728dc42f64fc363c", "score": "0.5485557", "text": "function fetchSNAPData() {\n var inputparams = {};\n var headerParams = {};\n var intgService = client.getIntegrationService(\"fetchSnapData\");\n intgService.invokeOperation(\"SNAPAppData\", headerParams, inputparams, fetchSNAPDataSuccessCallback, fetchSNAPDataErrorCallback);\n}", "title": "" }, { "docid": "3b4f99ce52ccd6da84ff48b9c8187d74", "score": "0.5484948", "text": "function download() {\n console.log('download called');\n const downloadDom = document.getElementById('download');\n const image = document.getElementById('draw-canvas')\n .toDataURL('image/png')\n .replace('image/png', 'image/octet-stream');\n downloadDom.setAttribute('href', image);\n //download.setAttribute('download', 'archive.png');\n}", "title": "" }, { "docid": "449bdc29ec1b250566b250de2534cde1", "score": "0.5483843", "text": "function downloadData(data,type,nonogramName){\n\tvar yesDownload = confirm(\"Nonogram Name: \"+nonogramName+\"\\nDownload Type: \"+type+\"\\n\\nContinue?\");\n\tif(!yesDownload){\n\t\tconsole.log(JSON.parse(data.split(\"*\")[1])); //log the data anyways in the console, just don't download\n\t\treturn;\n\t}\n\t\n\t//download:\n\t//create 'a' element\n\t//set download attribute to nonogram name\n\t//set href attribtue to correct type of data\n\t//initiate a click on the 'a' element\n\t\n\tvar a = document.createElement(\"a\");\n\ta.download = \"_\"+nonogramName+\"_nonogram\"+type[0].toUpperCase()+type.substring(1,type.length); //the '_' at the beginning is so it gets priority in alphabetization\n\ta.href = \"data:text/plain;charset=utf-8,\" + encodeURIComponent(data);\n\ta.click();\n}", "title": "" }, { "docid": "7f8731be3a1a738069bd562ef6148aa4", "score": "0.5477155", "text": "function startDownloadSource(data){\n fUtils.getFileSystem(function(err, fileSystem){\n if(err){\n console.log(\"getFileSystem\",err);\n return ;\n }\n fUtils.getRootPath(fileSystem,function(err, path){\n if(err){\n console.log(\"getRootPath\",err);\n console.log(err);\n return ;\n }\n sourcePath = path + \"fitmus/res/excs/\";\n console.log(\"getRootPath\",sourcePath);\n var keys = Object.keys(data.exercise);\n setTimeout(function(){\n async.eachSeries(keys,downloadSource,function(err){\n console.log(\"downloadSource end\",err);\n return ;\n });\n },0);\n })\n });\n }", "title": "" }, { "docid": "0da5f911c02277887829aa12d69b5f5a", "score": "0.54765874", "text": "function fetchRemoteImageContent() {\n\n }", "title": "" }, { "docid": "3fd9c106f605f6e0617bba168ef69d25", "score": "0.54723483", "text": "startDownload(data) {\n this.setState({\n width: data.width,\n height: data.height,\n downloadableOptions: data,\n creatingDownloadable: true\n });\n }", "title": "" }, { "docid": "9cf5c4cc53f633f386dfd3118e33dfd0", "score": "0.5470365", "text": "function onDownloadComplete()\n{\n console.log(\"onDownloadComplete\");\n\n main();\n}", "title": "" }, { "docid": "30fb3ccd5eee0ff83e246fa7154894a8", "score": "0.5458866", "text": "async fetchData()\n {\n // override with fetchData screen specific\n }", "title": "" }, { "docid": "db84536128482a8e69140e284d06593f", "score": "0.5449891", "text": "async function download() {\n progress.install();\n\n cleanupDB(); // delete old entries in db\n\n // get array of links for images\n manga.hashes = (await mangaData().catch((e) => {\n progress.nofetch();\n throw e;\n })).reader_page_urls;\n\n // check if new or old, while opening connection to db\n const status = await openDB();\n\n // if the download of this same manga was done previously but ended abruptly\n // then preserve previously downloaded images and download only new\n if (status === 'previous') {\n manga.hashes = [];\n await new Promise(resolve => requestIDB(\n transaction(manga.db, \"download\").index(\"buffer\").openCursor(IDBKeyRange.only(0)),\n e => cursor(e, ({ hash }) => manga.hashes.push(hash), resolve),\n ));\n }\n manga.length = manga.hashes.length;\n\n progress.onstart(manga.length);\n\n // download stuff after we know how many and where too\n return Promise.resolve(manga.hashes.reduce(\n (start, url) => start.then(queue => load(url).then(data => queue.concat(save(data)))),\n (async (queue = []) => queue)(),\n )).then(queued => Promise.all(queued)).then(async () => {\n // after everything is downloaded - start to merge 'em into zip file\n const zip = new JSZip();\n\n await new Promise((resolve, reject) => {\n requestIDB(\n transaction(manga.db, \"download\").openCursor(),\n e => cursor(e, ({ number, buffer }) => zip.file(`${number}.jpg`, buffer), resolve),\n reject,\n );\n });\n\n const file = await zip.generateAsync({ type: \"blob\", streamFiles: true });\n\n (Object.assign(document.createElement('a'), {\n download: `${document.title.replace(/\\s\\|\\sTsumino$/, '')}.zip`,\n href: URL.createObjectURL(file),\n target: '_blank',\n type: 'application/zip',\n })).click();\n URL.revokeObjectURL(file);\n\n // remove stuff in end\n manga.db.close();\n indexedDB.deleteDatabase(manga.id);\n const downloads = JSON.parse(localStorage.getItem('downloads'));\n delete downloads[manga.id];\n localStorage.setItem('downloads', JSON.stringify(downloads));\n\n progress.onloadend();\n }).catch((e) => {\n window.console.error(e);\n progress.onerror();\n });\n}", "title": "" }, { "docid": "cbd4c69e91af007b74de8173355aea0c", "score": "0.54448104", "text": "function httpGetFile(url,file,obj)\n{\n sys.puts(\"fetch \"+ file);\n var u = URL.parse(url);\n var cachepath = 'cache/'+u.pathname;\n if (isCached(cachepath,file,obj)) {\n return;\n }\n CreateDirectory(cachepath);\n\n // Fetch file from the server and convert it tyo PNG if it is not PNG format.\n var f = fs.openSync(cachepath,'w');\n sys.puts(\"f=\"+f);\n var headers={\n 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',\n 'Host':'211.23.50.144:8080',\n 'User-Agent':'MadButterfly',\n 'Content-Type':'application/x-www-form-urlencoded'\n };\n sys.puts(\"host=\"+u.host+' '+u.port+' '+u.pathname);\n for(k in u) {\n sys.puts(k+\"--->\"+u[k]);\n }\n var c = http.createClient(8080,'211.23.50.144');\n var req = c.request('GET',u.pathname,headers);\n req.end();\n req.on('response', function(res) {\n res.on('data',function(data) {\n fs.writeSync(f,data,0,data.length);\n\t});\n\tres.on('end',function() {\n\t fs.close(f);\n\t var fields = cachepath.split('.');\n\t var ext = fields.pop();\n\t if (ext != \"png\" && ext != 'jpg') {\n\t fields.push(\"png\");\n\t newf = fields.join(\".\");\n\t\tsys.puts(\"cachepath=\"+cachepath+\" newf=\"+newf);\n\t os.spawn(\"convert\",[cachepath,newf]);\n\t } else {\n\t newf = cachepath;\n\t }\n\t try {\n\t fs.unlinkSync(file);\n\t } catch(e) {\n\t }\n\t sys.puts(\"end of \"+cachepath+\" to \"+file);\n\t fs.symlinkSync(newf, file);\n\t obj.pend = obj.pend - 1;\n\t if (obj.pend == 0) {\n\t obj.onInitDone();\n\t\tsys.puts(\"done\");\n\t }\n\n\t});\n\n });\n}", "title": "" }, { "docid": "5aacc8d60f97eb6ce569798c36570706", "score": "0.54365903", "text": "function downloadPosterToDataURL() {\n let miniaturaPreview = document.getElementById('miniatura-preview');\n let miniatura = document.getElementById('poster-generado');\n\n if (miniatura != null) {\n miniaturaPreview.removeChild(miniatura);\n }\n const url = modelViewer.toDataURL();\n /*const a = document.createElement(\"a\");\n a.href = url;\n a.id = 'botonCrearMiniatura';\n a.download = \"modelViewer_toDataURL.png\";*/\n\n let image = new Image();\n image.src = url;\n image.id = 'poster-generado';\n\n miniaturaPreview.insertBefore(image, document.getElementById('downloadPoster'));\n URL.revokeObjectURL(url);\n}", "title": "" }, { "docid": "723658a0de8ceec99705af00f950c180", "score": "0.542592", "text": "function downloadUserReport() {\n downloadFile(\"api/users/csv\");\n }", "title": "" }, { "docid": "5fe08004b7a40ea20aa4a752485ee159", "score": "0.54257697", "text": "function download (tag, maxpull) { //e.g. \"26jan20\", 100\n stats.pulled = 0;\n stats.maxpull = maxpull || 1\n readTDF({dltag:tag, index:0,\n tdf:\"uids.tdf\", folder:\"musers\", spec:uspec,\n objsrc:{url:\"profbyid\", idparam:\"profid\"},\n picsrc:{fld:\"profpic\", url:\"profpic\", idparam:\"profileid\"}});\n readTDF({dltag:tag, index:0,\n tdf:\"tids.tdf\", folder:\"themes\", spec:tspec,\n objsrc:{url:\"ctmbyid\", idparam:\"coopid\"},\n picsrc:{fld:\"picture\", url:\"ctmpic\", idparam:\"coopid\"}});\n writeStats();\n }", "title": "" }, { "docid": "c71be5d443e0c5933ccece846fe5cb25", "score": "0.54132783", "text": "downloadFiles () {\n\n }", "title": "" }, { "docid": "d6c76ecc501f64192bde176f1956dc40", "score": "0.5409828", "text": "async function downloadGif (trendingGifs){\n let a = document.createElement(\"a\")\n let resp = await fetch (trendingGifs.images.downsized.url)\n let file = await resp.blob()\n \n a.download = trendingGifs.title + \".gif\"\n a.href = window.URL.createObjectURL(file)\n a.click()\n a.remove()\n }", "title": "" }, { "docid": "d6c76ecc501f64192bde176f1956dc40", "score": "0.5409828", "text": "async function downloadGif (trendingGifs){\n let a = document.createElement(\"a\")\n let resp = await fetch (trendingGifs.images.downsized.url)\n let file = await resp.blob()\n \n a.download = trendingGifs.title + \".gif\"\n a.href = window.URL.createObjectURL(file)\n a.click()\n a.remove()\n }", "title": "" }, { "docid": "619f80561d8adc198e5951d8ceb9c7b3", "score": "0.54085845", "text": "async getDownloadStream(deviceType, version) {\n\t\tconst stream = await this.balena.models.os.download(deviceType, version);\n\n\t\tstream.on('progress', data => {\n\t\t\tthis.logger.status({\n\t\t\t\tmessage: 'Download',\n\t\t\t\tpercentage: data.percentage,\n\t\t\t\teta: data.eta,\n\t\t\t});\n\t\t});\n\n\t\treturn stream;\n\t}", "title": "" }, { "docid": "07f2c946f8f86e964ecbadb1cadbaf59", "score": "0.5400048", "text": "function displayPage(res) {\n res.writeHead(200, {'Content-type':'text/html'});\n res.write('<style>');\n res.write(' h1 {text-align: center;}');\n res.write(' .footer {');\n res.write(' padding: 20px;');\n res.write(' text-align: center;');\n res.write(' background: #ddd;');\n res.write(' margin-top: 20px;');\n res.write(' }');\n res.write(' .cent {');\n res.write(' text-align: center;');\n res.write(' }');\n res.write('</style>');\n \n res.write('<h1>Welcome to eddn listener data download page for Elite Dangerous</h1>');\n res.write('<p>This page currently contains only 3h data from EDDN. Data is being\\\nconstantly updated and thus should be quite current. Optimal solution for this page\\\nwould be to use some kind of crontab or similar and download the file every 3h interval\\\nso that your data is constantly up to date</p>');\n res.write('<p class=\"cent\" ><a href=\"/elite/3hdata\">3hdata</a> ');\n res.write('<a href=\"/elite/3hdataCSV\">3hdataCSV</a> ');\n res.write('<a href=\"/elite/24hdataCSV\">24hdataCSV</a></p>');\n res.write('<div class=\"footer\">');\n res.write(' <p>Please feel free to contact me if you need further \\\nsupport or have improvement ideas, jarkko.vartiainen at googles most \\\nprominent web mail.com</p>');\n res.write(' <p class=\"cent\" >Eddn listener v.' + VERSION + '</p>');\n res.end();\n}", "title": "" }, { "docid": "5e6cec7ce5753d27409b29835a8f38bb", "score": "0.53997064", "text": "function load_list(){\n var xhr = new XMLHttpRequest();\n xhr.open('GET', 'http://wikireader.commondatastorage.googleapis.com/dumps.json?'+Math.random(), true);\n xhr.onload = function(){\n document.getElementById('download');\n var attrs = ['name', 'size', 'date'];\n JSON.parse(xhr.responseText).forEach(function(d){\n var row = document.createElement('tr');\n var installed = dumps.indexOf(d.code) != -1;\n if(installed){\n row.className += \" installed\"\n }\n attrs.forEach(function(a){\n var t = document.createElement('td');\n t.innerText = d[a];\n row.appendChild(t);\n });\n var dow = document.createElement('td');\n var a = document.createElement('a');\n a.href = 'javascript:void(0)';\n a.onclick = function(){\n downloadFile(d.file, d.code)\n }\n a.innerText = installed?'Update':\"Download\";\n dow.appendChild(a);\n row.appendChild(dow);\n document.getElementById('download').appendChild(row);\n \n })\n }\n xhr.onerror = function(){\n document.getElementById('offline').style.display = '';\n }\n xhr.send(null);\n}", "title": "" }, { "docid": "aa33d673b54a16432d6bf00cf25a1f11", "score": "0.53894925", "text": "fetchData(url, headers, context) {\n\t\tthis.delegate.sendSocketNotification(\"REQUEST\", { 'url': url, 'method': 'GET', 'headers': headers, 'context': context});\n\t}", "title": "" }, { "docid": "a24cf6b5404a9e6f03d2bf864e9976dd", "score": "0.5387002", "text": "function Download() {\n\t// Construct\n}", "title": "" }, { "docid": "1c7bec0d6a7e0b50aeb9bc3c8b9ff7ce", "score": "0.53754705", "text": "grabData() {\n\n // Add more file extensions here as needed\n const extensionIndex = /(mp3|wav)$/.exec(this.songLink).index;\n this.beatMapLink = \".\".concat(this.songLink.slice(0, extensionIndex).concat(\"json\"));\n this.data = require(this.beatMapLink);\n }", "title": "" }, { "docid": "f1c9939b515899f06c09d30a573a4d66", "score": "0.5363437", "text": "downloadState() {\n this.canvas.toBlob((blob) => {\n const url = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.download = 'snapshot.png';\n a.href = url;\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n });\n }", "title": "" }, { "docid": "0696338f5b28b54b9ae8768517b8fd09", "score": "0.53622526", "text": "function downloadDataUri(options) {\n\t\tif (!options.url)\n\t\t\toptions.url = \"http://download-data-uri.appspot.com/\";\n\t\t$('<form method=\"post\" action=\"' + options.url\n\t\t\t+ '\" style=\"display:none\"><input type=\"hidden\" name=\"filename\" value=\"'\n\t\t\t+ options.filename + '\"/><input type=\"hidden\" name=\"data\" value=\"'\n\t\t\t+ options.data + '\"/></form>').appendTo('body').submit().remove();\n\t}", "title": "" }, { "docid": "0696338f5b28b54b9ae8768517b8fd09", "score": "0.53622526", "text": "function downloadDataUri(options) {\n\t\tif (!options.url)\n\t\t\toptions.url = \"http://download-data-uri.appspot.com/\";\n\t\t$('<form method=\"post\" action=\"' + options.url\n\t\t\t+ '\" style=\"display:none\"><input type=\"hidden\" name=\"filename\" value=\"'\n\t\t\t+ options.filename + '\"/><input type=\"hidden\" name=\"data\" value=\"'\n\t\t\t+ options.data + '\"/></form>').appendTo('body').submit().remove();\n\t}", "title": "" }, { "docid": "0696338f5b28b54b9ae8768517b8fd09", "score": "0.53622526", "text": "function downloadDataUri(options) {\n\t\tif (!options.url)\n\t\t\toptions.url = \"http://download-data-uri.appspot.com/\";\n\t\t$('<form method=\"post\" action=\"' + options.url\n\t\t\t+ '\" style=\"display:none\"><input type=\"hidden\" name=\"filename\" value=\"'\n\t\t\t+ options.filename + '\"/><input type=\"hidden\" name=\"data\" value=\"'\n\t\t\t+ options.data + '\"/></form>').appendTo('body').submit().remove();\n\t}", "title": "" }, { "docid": "0696338f5b28b54b9ae8768517b8fd09", "score": "0.53622526", "text": "function downloadDataUri(options) {\n\t\tif (!options.url)\n\t\t\toptions.url = \"http://download-data-uri.appspot.com/\";\n\t\t$('<form method=\"post\" action=\"' + options.url\n\t\t\t+ '\" style=\"display:none\"><input type=\"hidden\" name=\"filename\" value=\"'\n\t\t\t+ options.filename + '\"/><input type=\"hidden\" name=\"data\" value=\"'\n\t\t\t+ options.data + '\"/></form>').appendTo('body').submit().remove();\n\t}", "title": "" }, { "docid": "fdf52f5e3f13ddca86bddb1623d8d3e9", "score": "0.5352692", "text": "function download() {\n const url = urls.shift();\n\n if (url == null) {\n console.log(\"All done.\");\n process.exit(0);\n }\n\n const parsedUrl = URL.parse(url);\n const url_options = {\n hostname: parsedUrl.hostname,\n path: parsedUrl.path,\n method: \"GET\"\n };\n\n const file_name = getFilename(url);\n const ws = fs.createWriteStream(path.join(__dirname, \"your-dir\", file_name));\n ws.on('finish', () => {\n console.log(file_name);\n download();\n });\n\n https.request(url_options, res => res.pipe(ws)).end();\n}", "title": "" }, { "docid": "c0eae3f8f9d38974489c2f8f2f890e18", "score": "0.53388464", "text": "download (obj) {\n if (obj.filename != null) {\n this.filename = obj.filename\n } else {\n // console.error 'no filename specified'\n return\n }\n\n if ((obj.itag == null)) {\n // console.error 'No format specified'\n return\n }\n\n this.itag = obj.itag\n if ((this.formats[this.itag] == null)) {\n // console.error 'Wrong format specified'\n return\n }\n\n this.parseTimes(obj)\n return this.getHeader(() => {\n return this.getChunks()\n })\n }", "title": "" }, { "docid": "816097fbe8bec55e3d32ac89be91510b", "score": "0.5332588", "text": "function downloadFile_1() {\n\t\t\tdownload(\"resources/docs/test.pdf\");\n\t\t}", "title": "" }, { "docid": "038ee8340662ffc1bfd6b3731a7b6c67", "score": "0.53295755", "text": "function showDownloadData(){\r\n\tvar hash, imgPath, template, tempParentDiv, steps;\r\n\t//getting hash without hash\r\n\thash = window.location.hash.substring(1);\r\n\tconsole.log(':'+hash);\r\n\tvar os = $.client.os;\r\n\tvar width = $(window).width();\r\n\tvar browser = $.client.browser;\r\n\r\n\tif(os == 'Windows'){\r\n\t\tconsole.log(os,width,browser);\r\n\t}\r\n\t\r\n\tif(os == 'Mac'){\r\n\t\tconsole.log(os,width,browser);\r\n\t}\r\n\t\r\n\tif(os == 'linux'){\r\n\t\talert(os,width,browser);\r\n\t}\r\n\t\r\n\t//first show hide div\r\n\t$('.cmnDiv').hide();\r\n\t$('#'+hash+'-data').slideDown('fast', function(){\r\n\t\t//hash = window.location.hash.substring(1);\r\n\t\t//set target\r\n\t\ttempParentDiv = $(\"#\"+hash+\"-sc .inner\");\r\n\t\t\r\n\t\t//appending child in loop\r\n\t\tsteps = $('#'+hash+'-data .push-feature');\r\n\t\tfor (var i=1;i<=steps.length;i++){\r\n\t\t\t//making a template \r\n\t\t\ttemplate = '<div class=\"screen-'+i+' allSc \"><img src=\"images/dData/'+hash+'-screens-'+i+'.jpg\" /></div>';\r\n\t\t\t//console.log(steps.length, i);\r\n\t\t\t$( template ).appendTo( tempParentDiv );\r\n\t\t\t\r\n\t\t}\r\n\t\t$('.screen-1').addClass('showYes');\r\n\t\t\r\n\t});\r\n\r\n}", "title": "" }, { "docid": "861cc1d673d0c610f216018e25e8d37f", "score": "0.5325677", "text": "downloadRaw(filename, content) {\n FileSaver.saveAs(content, filename);\n }", "title": "" }, { "docid": "04b6944458abf490bc299698d076f69a", "score": "0.5324573", "text": "function download_layout_general(url, data) {\n var fields = {\n 'data': data\n };\n send_post(fields, url, false, false);\n}", "title": "" }, { "docid": "410abddf4dc4cfd96e7fe468fe8f4685", "score": "0.53214204", "text": "function download(query)\n{\n//nel funzionamento è quasi uguale ad upload\n var xhr = new XMLHttpRequest();\n\n xhr.upload.addEventListener('progress', function(event) \n {\n console.log('progess', query, event.loaded, event.total);\n });\n xhr.addEventListener('readystatechange', function(event) \n {\n console.log(\n 'ready state', \n query, \n xhr.readyState, \n xhr.readyState == 4 && xhr.status\n );\n\n \tdocument.getElementById(\"Down\").style.display = 'none';\n\t\tdocument.getElementById(\"load\").style.display = 'block';\n if (xhr.readyState == 4 && xhr.status)\n {\n \tconsole.info(xhr.status)\n \t\n \tdocument.getElementById(\"Down\").style.display = 'block';\n\t\tdocument.getElementById(\"load\").style.display = 'none';\n\n \tresponse=JSON.parse(xhr.responseText);\n \t//code=response[\"code\"];\n \tcode = xhr.status;\n \tconsole.info(response)\n\n \tif (code==\"200\")\n \t{\n\n \t\talert(\"Done! \" + response[\"count\"])\n \t\tvar utc = new Date().toJSON().slice(0,10).replace(/-/g,'_');\n \t\tfile = JSON.parse(response['data']);\n \t\tdownloadObjectAsJson(file, \"bundle_\"+String(utc))\n \t\tlocation.reload();\n \t}\n \telse\n \t{\n \t\talert(\"Error: \"+ code)\n \t\tlocation.reload();\n \t}\n \t\n }\n \n });\n\n xhr.open('POST', \"/?action=download\", true);\n xhr.setRequestHeader('X-Filename', query);\n\n console.log('sending', query, query);\n xhr.send(query);\n}", "title": "" }, { "docid": "248ce5ac882833c37d4b3f68b4c93521", "score": "0.5320016", "text": "function _download(cb) {\n console.log('Downloading:' + op.url)\n request({ url: op.url })\n .on('response', function(res) {\n res\n .on('end', function() {\n cb() // deal with zip stream?\n })\n if (op.url.slice(-3).toLowerCase() === 'zip') {\n res\n .pipe(unzip.Parse())\n .on('entry', function(file) {\n file.pipe(fs.createWriteStream(op.file, {mode: 0777}))\n })\n } else {\n res.pipe(fs.createWriteStream(op.file))\n }\n })\n }", "title": "" }, { "docid": "3472b04794ca1298de5687e9c31c22bb", "score": "0.5319385", "text": "fetchdata(){\n // get datastream\n // axios\n }", "title": "" }, { "docid": "b4c6f1e884ae7533bb65125735d501ba", "score": "0.5311308", "text": "function download() {\n return (dispatch, getState) => {\n let data = getState().private;\n\n // if no selected file\\folder then nothing doing OR\n // if active element is \"..\" (go to parent folder).\n if (data.active == null || data.active == 0)\n return toast.warn(\"Please select a file or folder to download.\");\n\n // obj to send.\n let request = {};\n // set public or private store.\n request.store = \"private\";\n // set full path with file\\folder name.\n request.path = join(data.path, data.list[data.active].name);\n // set file name.\n request.name = data.list[data.active].name;\n // set property is it folder or not.\n request.isFolder = data.list[data.active].isFolder;\n\n // send to server.\n ipcRenderer.send(\"download\", request);\n };\n}", "title": "" }, { "docid": "5c92a25621014ed1d214b9f119150751", "score": "0.5304668", "text": "function start_download(freesound_sample_id) {\n console.log (\"Download called on \" + freesound_sample_id);\n var ajax = new XMLHttpRequest();\n\n // Just start the download and begin pinging the counter file.\n //\n ajax.onreadystatechange = function () {\n if (ajax.readyState == 4) {\n }\n };\n ajax.open(\"GET\", \"/cgi-bin/elementski/download.cgi?id=\" + freesound_sample_id, true);\n ajax.send(null);\n\n // Ping the CGI for status.\n //\n setTimeout(ping(freesound_sample_id), 100);\n}", "title": "" }, { "docid": "8a91baeaee105166444a1ed83953c101", "score": "0.5304565", "text": "function downloadCanvas(data, fileName) {\n let link = document.createElement(\"a\");\n document.body.appendChild(link);\n link.href = data;\n link.download = fileName;\n link.style = \"display: none;\";\n link.click();\n link.remove();\n}", "title": "" }, { "docid": "9162ff30a9802b7e1ca1b68311aca0e7", "score": "0.5300832", "text": "function download(){\n var blob = new Blob(recorderChunk, {\n type: \"video/mov\"\n });\n\n var url = URL.createObjectURL(blob);\n var a = document.createElement(\"a\");\n document.body.appendChild(a);\n a.style = \"display: none\";\n a.href = url;\n var d = new Date();\n var n = d.toUTCString();\n a.download = n+\".mov\";\n a.click();\n window.URL.revokeObjectURL(url);\n setRecorderChunk([]);\n }", "title": "" }, { "docid": "0edeb9f306c12588fca81caffd7c367f", "score": "0.5299527", "text": "async function downloadResource(url, filename) {\n if (!filename) filename = url.replace(/^.*[\\\\\\/]/, '');\n try {\n const response = await fetch(url, {\n headers: new Headers({\n 'Origin': location.origin\n }),\n mode: 'cors'\n });\n const blob = await response.blob();\n\n const blobUrl = window.URL.createObjectURL(blob);\n forceDownload(blobUrl, filename);\n }\n catch (err) {\n alert(\"Forbidden Image, please download it MANUALLY\");\n console.error(e);\n }\n}", "title": "" }, { "docid": "ce10a863f05fd4743c99805272239518", "score": "0.5298324", "text": "function globalDl(){\n\t\t//global download wont be available if audio not inited (button appears on COUNTER_READY)\n\t\tif(_downloadOn)return false;\n\t\tvar type = media_type;\n\t\t//console.log(type);\n\t\t\n\t\tif(!media_type){\n\t\t\tif(useAlertMessaging) alert(\"Invalid data-type for file download function! Quitting.\"); \n\t\t\t_downloadOn = false;\n\t\t\treturn false;\t\n\t\t}\n\t\tvar c = playlistManager.getCounter(), path = playlistDataArr[c].download, name = getTitle(c, false);\n\t\tvar dwn = getDownloadPath(type, name, path);\n\t\t//console.log(dwn.name, dwn.path);\n\t\t//return;\n\t\tcheckDownload(dwn.name, dwn.path);\t\n\t}", "title": "" }, { "docid": "c67f490418ddd1ead2d0d9360e4f2ddc", "score": "0.52963346", "text": "function download(entry, li, a) {\n\t\t\tmodel.getEntryFile(entry, \"Blob\", function(blobURL) {\n\t\t\t\tvar clickEvent = document.createEvent(\"MouseEvent\");\n\t\t\t\tif (unzipProgress.parentNode)\n\t\t\t\t\tunzipProgress.parentNode.removeChild(unzipProgress);\n\t\t\t\tunzipProgress.value = 0;\n\t\t\t\tunzipProgress.max = 0;\n\t\t\t\tclickEvent.initMouseEvent(\"click\", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n\t\t\t\ta.href = blobURL;\n\t\t\t\ta.download = entry.filename;\n\t\t\t\ta.dispatchEvent(clickEvent);\n\t\t\t}, function(current, total) {\n\t\t\t\tunzipProgress.value = current;\n\t\t\t\tunzipProgress.max = total;\n\t\t\t\tli.appendChild(unzipProgress);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "b149176717b32059e2c2c854b17b007c", "score": "0.5294858", "text": "function wireDownloadLink() {\n $('#downloadLink').click(function() {\n var uids = [];\n $.each(resources, function(i,obj) {\n uids.push(obj.uid);\n });\n document.location.href = baseUrl + \"/public/downloadDataSets?uids=\" + uids.join(',');\n return false;\n });\n}", "title": "" }, { "docid": "47acc5c591418db68da14eb319a5fc36", "score": "0.5294562", "text": "static async downloadIllust(mediaId, downloadType)\n {\n let mediaInfo = await ppixiv.mediaCache.getMediaInfo(mediaId);\n let userInfo = await ppixiv.userCache.getUserInfo(mediaInfo.userId);\n console.log(`Download ${mediaId} with type $[downloadType}`);\n\n if(downloadType == \"MKV\")\n {\n new PixivUgoiraDownloader(mediaInfo);\n return;\n }\n\n if(downloadType != \"image\" && downloadType != \"ZIP\")\n {\n console.error(\"Unknown download type \" + downloadType);\n return;\n }\n\n // If we're in ZIP mode, download all images in the post.\n //\n // Pixiv's host for images changed from i.pximg.net to i-cf.pximg.net. This will fail currently for that\n // host, since it's not in @connect, and adding that will prompt everyone for permission. Work around that\n // by replacing i-cf.pixiv.net with i.pixiv.net, since that host still works fine. This only affects downloads.\n let images = [];\n for(let page of mediaInfo.mangaPages)\n {\n let url = page.urls.original;\n url = url.replace(/:\\/\\/i-cf.pximg.net/, \"://i.pximg.net\");\n images.push(url);\n }\n\n // If we're in image mode for a manga post, only download the requested page.\n let mangaPage = helpers.mediaId.parse(mediaId).page;\n if(downloadType == \"image\")\n images = [images[mangaPage]];\n\n ppixiv.message.show(images.length > 1? `Downloading ${images.length} pages...`:`Downloading image...`);\n\n let results;\n try {\n results = await downloadUrls(images);\n } catch(e) {\n ppixiv.message.show(e.toString());\n return;\n }\n\n ppixiv.message.hide();\n\n // If there's just one image, save it directly.\n if(images.length == 1)\n {\n let url = images[0];\n let blob = new Blob([results[0]]);\n let ext = helpers.strings.getExtension(url);\n let filename = userInfo.name + \" - \" + mediaInfo.illustId;\n\n // If this is a single page of a manga post, include the page number.\n if(downloadType == \"image\" && mediaInfo.mangaPages.length > 1)\n filename += \" #\" + (mangaPage + 1);\n\n filename += \" - \" + mediaInfo.illustTitle + \".\" + ext;\n helpers.saveBlob(blob, filename);\n return;\n }\n\n // There are multiple images, and since browsers are stuck in their own little world, there's\n // still no way in 2018 to save a batch of files to disk, so ZIP the images.\n let filenames = [];\n for(let i = 0; i < images.length; ++i)\n {\n let url = images[i];\n let ext = helpers.strings.getExtension(url);\n let filename = i.toString().padStart(3, '0') + \".\" + ext;\n filenames.push(filename);\n }\n\n // Create the ZIP.\n let zip = new CreateZIP(filenames, results);\n let filename = userInfo.name + \" - \" + mediaInfo.illustId + \" - \" + mediaInfo.illustTitle + \".zip\";\n helpers.saveBlob(zip, filename);\n }", "title": "" }, { "docid": "57387aba750b59aac9ed71a6e08a7340", "score": "0.52906525", "text": "function displayDownload(downloadUrl) {\n let $final = $(\".final\");\n $(\"#loader\").remove();\n $final.append(downloadBtn);\n $final.append(downloadInfo);\n $(\"#download\")\n .find(\"a\")\n .attr(\"href\", downloadUrl);\n $(\"#download\")\n .find(\"a\")\n .attr(\"download\", downloadUrl);\n}", "title": "" }, { "docid": "7fe5d6bdc3d47f7e81657d16bee851a1", "score": "0.528844", "text": "download() {\n // call action to download file\\folder.\n this.props.download();\n }", "title": "" }, { "docid": "91535baa0839da393321808f228edf7e", "score": "0.528787", "text": "async function downloadGif (finalGifo){\n let a = document.createElement(\"a\")\n let resp = await fetch (finalGifo.images.original.url)\n let file = await resp.blob()\n \n a.download =finalGifo.title + \".gif\"\n a.href = window.URL.createObjectURL(file)\n a.click()\n a.remove()\n }", "title": "" }, { "docid": "91535baa0839da393321808f228edf7e", "score": "0.528787", "text": "async function downloadGif (finalGifo){\n let a = document.createElement(\"a\")\n let resp = await fetch (finalGifo.images.original.url)\n let file = await resp.blob()\n \n a.download =finalGifo.title + \".gif\"\n a.href = window.URL.createObjectURL(file)\n a.click()\n a.remove()\n }", "title": "" }, { "docid": "91535baa0839da393321808f228edf7e", "score": "0.528787", "text": "async function downloadGif (finalGifo){\n let a = document.createElement(\"a\")\n let resp = await fetch (finalGifo.images.original.url)\n let file = await resp.blob()\n \n a.download =finalGifo.title + \".gif\"\n a.href = window.URL.createObjectURL(file)\n a.click()\n a.remove()\n }", "title": "" }, { "docid": "91535baa0839da393321808f228edf7e", "score": "0.528787", "text": "async function downloadGif (finalGifo){\n let a = document.createElement(\"a\")\n let resp = await fetch (finalGifo.images.original.url)\n let file = await resp.blob()\n \n a.download =finalGifo.title + \".gif\"\n a.href = window.URL.createObjectURL(file)\n a.click()\n a.remove()\n }", "title": "" }, { "docid": "91535baa0839da393321808f228edf7e", "score": "0.528787", "text": "async function downloadGif (finalGifo){\n let a = document.createElement(\"a\")\n let resp = await fetch (finalGifo.images.original.url)\n let file = await resp.blob()\n \n a.download =finalGifo.title + \".gif\"\n a.href = window.URL.createObjectURL(file)\n a.click()\n a.remove()\n }", "title": "" }, { "docid": "91535baa0839da393321808f228edf7e", "score": "0.528787", "text": "async function downloadGif (finalGifo){\n let a = document.createElement(\"a\")\n let resp = await fetch (finalGifo.images.original.url)\n let file = await resp.blob()\n \n a.download =finalGifo.title + \".gif\"\n a.href = window.URL.createObjectURL(file)\n a.click()\n a.remove()\n }", "title": "" }, { "docid": "91535baa0839da393321808f228edf7e", "score": "0.528787", "text": "async function downloadGif (finalGifo){\n let a = document.createElement(\"a\")\n let resp = await fetch (finalGifo.images.original.url)\n let file = await resp.blob()\n \n a.download =finalGifo.title + \".gif\"\n a.href = window.URL.createObjectURL(file)\n a.click()\n a.remove()\n }", "title": "" }, { "docid": "91535baa0839da393321808f228edf7e", "score": "0.528787", "text": "async function downloadGif (finalGifo){\n let a = document.createElement(\"a\")\n let resp = await fetch (finalGifo.images.original.url)\n let file = await resp.blob()\n \n a.download =finalGifo.title + \".gif\"\n a.href = window.URL.createObjectURL(file)\n a.click()\n a.remove()\n }", "title": "" }, { "docid": "3d0dd2ead3a1a10cf079faea08dc0525", "score": "0.52875566", "text": "function download (url, finishedCallback = false, errorCallback = false) {\n this.url = url;\n this.finishedCallback = finishedCallback;\n this.errorCallback = errorCallback;\n logger.debug('File to request: '+this.url);\n this.finalCount = false;\n this.count = 7;\n this.second = Math.round(Date.now()/1000);\n // File of this name already exists. We need to change to a name that doesn't exist already\n if (fs.existsSync(`${ config.screenshotsLocation }/raidscreen_${ this.second }_9999_9999_99.jpg`)){\n logger.debug(`Filename 'raidscreen_${this.second}_9999_9999_99.jpg' already exists. Trying upcount`);\n while(true){\n if (!fs.existsSync(`${ config.screenshotsLocation }/raidscreen_${ this.second }_9999_9999_${ this.count }.jpg`)){\n this.finalCount = this.count;\n break;\n }\n this.count++;\n }\n }\n this.fileName = `raidscreen_${this.second}_9999_9999_${ this.finalCount ? this.finalCount : '99' }.jpg`;\n logger.debug(`Attempting to download to '${ this.fileName }'`);\n let that = this;\n request.get(url)\n .pipe(fs.createWriteStream(config.screenshotsLocation + '/' + that.fileName))\n .on('close', function(){\n logger.debug(`Finished adding file: ${ that.fileName }`);\n if (that.finishedCallback){\n that.finishedCallback();\n }\n })\n .on('error', function (err) {\n logger.error(err);\n if (that.errorCallback){\n that.errorCallback();\n }\n });\n}", "title": "" }, { "docid": "7548f66b9c030a88e307d89341752123", "score": "0.52855045", "text": "function downloadAndStore () {\n const https = require('https');\n const fs = require('fs');\n\n // The format of the url per segment will change depending on the source\n var base_url = \"https://dacasts3-vh.akamaihd.net/i/secure/152164/152164_,884983.raw,.csmil/segment\";\n\n for ( i=94; i<95; i++ ) {\n const file = fs.createWriteStream(\"file\"+i+\".mp4\");\n const request = https.get(base_url+\"\"+i+\"_0_av.ts?\", function(response) {\n response.pipe(file);\n });\n }\n}", "title": "" }, { "docid": "6effa3f1109e989367408e9ff0b5e1b5", "score": "0.52837855", "text": "function downloadOne(system, next) {\n var fetched = 0,\n downstream,\n bar;\n\n //\n // Create a temporary file for the system tarball and start the download.\n //\n system.tarball = common.tmpFile(dir, system.name, system.version, '.tgz');\n downstream = quill.systems.download(system.name, system.version, next);\n\n //\n // If there is a meter then create a bar and process the data.\n //\n if (options.meter) {\n bar = options.meter.stack.push('fetch'.grey + ': ' + system.name, 'bar');\n downstream.on('response', function (res) {\n length = res.headers['content-length'];\n });\n\n //\n // Update the bar on data\n //\n downstream.on('data', function (data) {\n fetched += data.length;\n bar.percent(\n ((fetched / length) * 100) | 0\n );\n });\n }\n\n downstream.pipe(fs.createWriteStream(system.tarball));\n }", "title": "" }, { "docid": "bc85b09d93f9a5c7a0328cf1a34f70e5", "score": "0.52811056", "text": "function handleDataAvailable(event) {\n let temp = recorderChunk;\n if (event.data.size > 0) {\n temp.push(event.data);\n setRecorderChunk(temp);\n setButtonDisabled(false);\n download();\n }\n }", "title": "" }, { "docid": "06fe166669f07bd64ab989ae725b7ae5", "score": "0.52769357", "text": "function download_data(){\n \n // Get length of current widgets\n var widget_length = side_panel_control.widgets().length()\n\n // Generate the download URL for training data\n var download_url = fc.getDownloadURL({\n format: \"json\",\n filename: \"Training_Data\"\n })\n \n // Generate the download URL for classification\n var geotiff_download = classified.getDownloadURL({\n name: \"Classified_Image\"\n })\n \n // Change display label to prompt user\n train_classify_label.setValue(\"GeoJSON Training Data:\");\n \n \n // Apply link to the label\n download_link_label.setUrl(download_url);\n download_geotiff_link_label.setUrl(geotiff_download);\n \n // Add label to UI that contains link\n side_panel_control.widgets().set((widget_length-2), download_link_label);\n side_panel_control.widgets().set((widget_length-3), download_geotiff_link_label);\n\n}", "title": "" }, { "docid": "704ad4194c9fb2687dfcaafb314c197d", "score": "0.5271943", "text": "function download(dataURL, filename) {\n var blob = dataURLToBlob(dataURL); \n var url = window.URL.createObjectURL(blob);\n \n var a = document.createElement(\"a\");\n a.style = \"display: none\";\n a.href = url;\n a.download = filename;\n\n document.body.appendChild(a);\n a.click();\n\n window.URL.revokeObjectURL(url);\n}", "title": "" } ]
22e92343338b957e0bd73ccb0f572344
Manually animate the Determinate indicator based on the specified percentage value (0100). Note: this animation was previously done using SCSS. generated 54K of styles use attribute selectors which had poor performances in IE
[ { "docid": "979fbaf9120c22b77c30927d68127a7f", "score": "0.6690561", "text": "function animateIndicator(value) {\n if ( !mode() ) return;\n\n leftC = leftC || angular.element(element[0].querySelector('.md-left > .md-half-circle'));\n rightC = rightC || angular.element(element[0].querySelector('.md-right > .md-half-circle'));\n gap = gap || angular.element(element[0].querySelector('.md-gap'));\n\n var gapStyles = removeEmptyValues({\n borderBottomColor: (value <= 50) ? \"transparent !important\" : \"\",\n transition: (value <= 50) ? \"\" : \"borderBottomColor 0.1s linear\"\n }),\n leftStyles = removeEmptyValues({\n transition: (value <= 50) ? \"transform 0.1s linear\" : \"\",\n transform: $mdUtil.supplant(\"rotate({0}deg)\", [value <= 50 ? 135 : (((value - 50) / 50 * 180) + 135)])\n }),\n rightStyles = removeEmptyValues({\n transition: (value >= 50) ? \"transform 0.1s linear\" : \"\",\n transform: $mdUtil.supplant(\"rotate({0}deg)\", [value >= 50 ? 45 : (value / 50 * 180 - 135)])\n });\n\n leftC.css(toVendorCSS(leftStyles));\n rightC.css(toVendorCSS(rightStyles));\n gap.css(toVendorCSS(gapStyles));\n\n }", "title": "" } ]
[ { "docid": "be0ecf42e5f5f36914693df14a2f8698", "score": "0.7028125", "text": "function animateIndicator(target,value){if(isDisabled||!mode())return;var to=$mdUtil.supplant(\"translateX({0}%) scale({1},1)\",[(value-100)/2,value/100]);var styles=toVendorCSS({transform:to});angular.element(target).css(styles);}", "title": "" }, { "docid": "95c7c3e2b9ead3a5ea6135223512d528", "score": "0.6811967", "text": "function animateIndicator(target, value) {\n if ( !mode() ) return;\n\n var to = $mdUtil.supplant(\"translateX({0}%) scale({1},1)\", [ (value-100)/2, value/100 ]);\n var styles = toVendorCSS({ transform : to });\n angular.element(target).css( styles );\n }", "title": "" }, { "docid": "95c7c3e2b9ead3a5ea6135223512d528", "score": "0.6811967", "text": "function animateIndicator(target, value) {\n if ( !mode() ) return;\n\n var to = $mdUtil.supplant(\"translateX({0}%) scale({1},1)\", [ (value-100)/2, value/100 ]);\n var styles = toVendorCSS({ transform : to });\n angular.element(target).css( styles );\n }", "title": "" }, { "docid": "95c7c3e2b9ead3a5ea6135223512d528", "score": "0.6811967", "text": "function animateIndicator(target, value) {\n if ( !mode() ) return;\n\n var to = $mdUtil.supplant(\"translateX({0}%) scale({1},1)\", [ (value-100)/2, value/100 ]);\n var styles = toVendorCSS({ transform : to });\n angular.element(target).css( styles );\n }", "title": "" }, { "docid": "4ed72d11d880e972b7b200b696955b90", "score": "0.67633456", "text": "function animateIndicator(target, value) {\r\n if ( !mode() ) return;\r\n\r\n var to = $mdUtil.supplant(\"translateX({0}%) scale({1},1)\", [ (value-100)/2, value/100 ]);\r\n var styles = toVendorCSS({ transform : to });\r\n angular.element(target).css( styles );\r\n }", "title": "" }, { "docid": "9f61b4bb67b8339584e4258b2448e129", "score": "0.66717374", "text": "function animateIndicator(value) {\r\n if ( !mode() ) return;\r\n\r\n leftC = leftC || angular.element(element[0].querySelector('.md-left > .md-half-circle'));\r\n rightC = rightC || angular.element(element[0].querySelector('.md-right > .md-half-circle'));\r\n gap = gap || angular.element(element[0].querySelector('.md-gap'));\r\n\r\n var gapStyles = removeEmptyValues({\r\n borderBottomColor: (value <= 50) ? \"transparent !important\" : \"\",\r\n transition: (value <= 50) ? \"\" : \"borderBottomColor 0.1s linear\"\r\n }),\r\n leftStyles = removeEmptyValues({\r\n transition: (value <= 50) ? \"transform 0.1s linear\" : \"\",\r\n transform: $mdUtil.supplant(\"rotate({0}deg)\", [value <= 50 ? 135 : (((value - 50) / 50 * 180) + 135)])\r\n }),\r\n rightStyles = removeEmptyValues({\r\n transition: (value >= 50) ? \"transform 0.1s linear\" : \"\",\r\n transform: $mdUtil.supplant(\"rotate({0}deg)\", [value >= 50 ? 45 : (value / 50 * 180 - 135)])\r\n });\r\n\r\n leftC.css(toVendorCSS(leftStyles));\r\n rightC.css(toVendorCSS(rightStyles));\r\n gap.css(toVendorCSS(gapStyles));\r\n\r\n }", "title": "" }, { "docid": "340fd5f741d4aa0207452abf4f3c416c", "score": "0.6670296", "text": "function animateIndicator(target, value) {\n if ( isDisabled || !mode() ) return;\n\n var to = $mdUtil.supplant(\"translateX({0}%) scale({1},1)\", [ (value-100)/2, value/100 ]);\n var styles = toVendorCSS({ transform : to });\n angular.element(target).css( styles );\n }", "title": "" }, { "docid": "340fd5f741d4aa0207452abf4f3c416c", "score": "0.6670296", "text": "function animateIndicator(target, value) {\n if ( isDisabled || !mode() ) return;\n\n var to = $mdUtil.supplant(\"translateX({0}%) scale({1},1)\", [ (value-100)/2, value/100 ]);\n var styles = toVendorCSS({ transform : to });\n angular.element(target).css( styles );\n }", "title": "" }, { "docid": "340fd5f741d4aa0207452abf4f3c416c", "score": "0.6670296", "text": "function animateIndicator(target, value) {\n if ( isDisabled || !mode() ) return;\n\n var to = $mdUtil.supplant(\"translateX({0}%) scale({1},1)\", [ (value-100)/2, value/100 ]);\n var styles = toVendorCSS({ transform : to });\n angular.element(target).css( styles );\n }", "title": "" }, { "docid": "e4419aa4e4b88b63d65464c64b2a4a2d", "score": "0.6258147", "text": "function startPercentageAnimations(){\n var animationDuration = 1000, //one second\n increments = animationDuration * 60/1000, //assume 60 frames per second\n percentageAnimations = document.querySelectorAll(\".data-num-svg\"),\n percentageElementObjects = [];\n\n for (var i=0; i<percentageAnimations.length; i++){\n var percentageElement = percentageAnimations[i];\n //set stroke-dashoffset to zero (548)\n percentageElement.querySelector(\"circle.svg-stroke\").setAttribute(\"stroke-dashoffset\", 548);\n //populate percentageElementObjects array with data objects\n percentageElementObjects.push(getPercentageAnimationObject(percentageElement, animationDuration, increments));\n }\n //start animating\n handlePercentageAnimation(percentageElementObjects, animationDuration/increments);\n}", "title": "" }, { "docid": "339c6b940a9eafc443dde21b087d4883", "score": "0.61250436", "text": "stepAnimate() {\n const { percent } = this.props;\n if (this.displayPercent === percent) clearInterval(this.animationLoop);\n if (this.displayPercent < percent) this.displayPercent++;\n else if (this.displayPercent > percent) this.displayPercent--;\n this.drawGauge();\n }", "title": "" }, { "docid": "6824067ec00b99d3805ae3a705d47048", "score": "0.6109175", "text": "setProgress(percent) {\n const offset = this.circumference - percent / 100 * this.circumference;\n\n let circle = this.container.querySelector('.radialcircle');\n circle.style.strokeDasharray = `${this.circumference} ${this.circumference}`;\n circle.style.strokeDashoffset = offset;\n\n if (this.segments) {\n\n let tickwidth = this.segments * 2;\n\n let seglength = (((this.radius * 2) * Math.PI) - tickwidth) / (this.segments);\n\n let tickmarks = this.container.querySelector('.tickmarks');\n tickmarks.style.strokeDasharray = `2px ${seglength}px`;\n tickmarks.style.strokeDashoffset = 0;\n\n }\n }", "title": "" }, { "docid": "eee1494ce03844146c6c909607c2024f", "score": "0.5801013", "text": "animateCircle(from, to) {\n // if the values are invalid or the same\n // don't do anything\n if (\n Number.isNaN(parseInt(from)) ||\n Number.isNaN(parseInt(to)) ||\n to > MAX_PERCENTAGE ||\n to < MIN_PERCENTAGE ||\n to === from\n ) {\n return;\n }\n\n // calculate the angle based on radius and % value\n const deg = to / 100 * 360;\n const diff = Math.abs(to - from) / 60;\n\n // At this point we need to cover some different scenarios\n // the CSS animation only gonna work from 0-50, 50-100\n\n // if the old and new values both < 50%\n if (from <= 50 && to <= 50) {\n this.animateNumber(to, diff);\n this.pieRight.style.transform = `rotate(${deg}deg)`;\n this.pieRight.style.transitionDuration = `${diff}s`;\n this.pieRight.style.transitionDelay = '0s';\n return;\n }\n\n // if the old and new values both > 50%\n if (to > MID_PERCENTAGE && from > MID_PERCENTAGE) {\n this.animateNumber(to, diff);\n this.pieLeft.style.transform = `rotate(${deg - 180}deg)`;\n this.pieLeft.style.transitionDuration = `${diff}s`;\n this.pieLeft.style.transitionDelay = '0s';\n return;\n }\n\n // If new value > 50% and old value < 50% we need to know\n // if the animation is forward or backward\n const forward = !!(to > MID_PERCENTAGE && from <= MID_PERCENTAGE);\n\n // Object to animate the first half\n const firstHalf = {\n rotate: forward ? 180 : 360 * to / 100,\n time: forward ? (MID_PERCENTAGE - from) / 60 : (MID_PERCENTAGE - to) / 60,\n delay: forward ? 0 : Math.abs((MID_PERCENTAGE - from) / 60),\n };\n\n // Object to animate second half\n const secondHalf = {\n rotate: forward ? 360 * to / MAX_PERCENTAGE - 180 : 0,\n time: forward ? (to - MID_PERCENTAGE) / 60 : (from - MID_PERCENTAGE) / 60,\n delay: forward ? (MID_PERCENTAGE - from) / 60 : 0,\n };\n this.animateNumber(to, firstHalf.time + secondHalf.time);\n\n // Applying CSS animations\n this.pieRight.style.transform = `rotate(${firstHalf.rotate}deg)`;\n this.pieRight.style.transitionDuration = `${firstHalf.time}s`;\n this.pieRight.style.transitionDelay = `${firstHalf.delay}s`;\n\n this.pieLeft.style.transform = `rotate(${secondHalf.rotate}deg)`;\n this.pieLeft.style.transitionDuration = `${secondHalf.time}s`;\n this.pieLeft.style.transitionDelay = `${secondHalf.delay}s`;\n }", "title": "" }, { "docid": "2df3e17ecf648e54b0f0c94e63619195", "score": "0.57601935", "text": "function percentControl(elm,num){\n elm.each(function (index) {\n var _this = $(this);\n \n jQuery({ Counter: 0 }).animate({ Counter: num[index] }, {\n duration: 1500,\n easing: 'swing',\n step: function () {\n _this.text(Math.ceil(this.Counter));\n }\n });\n });\n}", "title": "" }, { "docid": "3ab2be7ce3656863f718fb5fd53588fb", "score": "0.5709294", "text": "static increasePrecent(value) {\r\nconst selector = new DOMSelections;\r\n\r\n selector.result.style.display = 'block';\r\n selector.prog.setAttribute('style', `width:${value}%`);\r\n selector.progressPrecent.textContent = `${value}%`\r\n selector.textSucces.textContent = `${value}`\r\n }", "title": "" }, { "docid": "3ec21c276769053df07cd0cb10204eb3", "score": "0.56207603", "text": "applyValueIncreaseTransition(representativePct){\n var fadeIndexPos=-1;\n var transitionTime = INITIAL_DELAY_INTERVAL;\n for(var x=0;x<this.gaugeElements.length;x++){\n if(this.gaugeElements[x].isInRange(representativePct)){\n if(this.gaugeElements[x].setOpacity(DISPLAY_OPACITY_MAX, transitionTime)){\n fadeIndexPos=x;\n transitionTime += (TRANSITION_DELAY_INTERVAL*x);\n }\n }\n }\n\n if(fadeIndexPos!=-1&&fadeIndexPos<this.gaugeElements.length){\n for(var x=0;x<3;x++){\n if(fadeIndexPos+x<this.gaugeElements.length){\n this.gaugeElements[fadeIndexPos+x].setOpacity( fadeLevels[x],transitionTime);\n transitionTime += (TRANSITION_DELAY_INTERVAL*x);\n }\n }\n }\n }", "title": "" }, { "docid": "7115e98248ccdb705fdc37daf747cd23", "score": "0.55766696", "text": "function changeSpeed(percent) {\n speed = max_speed * percent;\n offset_increment = edge_pixels*(speed/edge_pixels);\n //console.log(offset_increment);\n}", "title": "" }, { "docid": "a0546f7c1337a261eb52d9714ed39c3b", "score": "0.55716336", "text": "function progressBar(progressVal,totalPercentageVal = 100) {\n var strokeVal = (4.64 * 100) / totalPercentageVal;\n\tvar x = document.querySelector('.progress-circle-prog');\n x.style.strokeDasharray = progressVal * (strokeVal) + ' 999';\n\t//$('.progress-text').data('progress', progressVal);\n}", "title": "" }, { "docid": "423ea9ceba32980aade7bf227cca99ec", "score": "0.55673677", "text": "function seekChange() {\n // percent modifyer is just to make sure the gradient breakboint is not visible outside the thumb\n var percent = Number(document.querySelector('.seek input').value)\n document.getElementById('progress').style.background = 'linear-gradient(to right, #41b6e6CC 0%, #41b6e6CC ' + ( percent < 50 ? percent+0.5 : percent-0.5 ) + '%, #d3d3d3 ' + ( percent < 50 ? percent+0.5 : percent-0.5 ) + '%, #d3d3d3 100%)'\n document.getElementById('progress').setAttribute('title',percent+'%')\n}", "title": "" }, { "docid": "0455dce86f9243699f9229e413b12a0b", "score": "0.5518519", "text": "_updateProgress() {\n super._updateProgress();\n\n const that = this,\n radius = that.indeterminate ? Math.PI * 100 : Math.PI * 100 - that._percentageValue * Math.PI * 100,\n isIE = /*@cc_on!@*/false || !!document.documentMode,\n isEdge = !isIE && !!window.StyleMedia;\n\n if (that.showProgressValue) {\n const percentage = parseInt(that._percentageValue * 100);\n\n that.$.label.innerHTML = that.formatFunction ? that.formatFunction(percentage) : percentage + '%';\n }\n else {\n that.$.label.innerHTML = '';\n }\n\n //Check if the browser is Edge to make the animation\n if (isIE || isEdge) {\n if (that.value === null || that.indeterminate) {\n that.$.value.style.strokeDashoffset = '';\n that.$.value.setAttribute('class', 'jqx-value jqx-value-animation-ms');\n return;\n }\n else {\n that.$.value.setAttribute('class', 'jqx-value');\n that.$.value.style.strokeDashoffset = that.inverted ? -radius : radius;\n return;\n }\n }\n\n that.$.value.style.strokeDashoffset = that.inverted ? -radius : radius;\n if (that.value === null || that.indeterminate) {\n that.$value.addClass('jqx-value-animation');\n return;\n }\n\n that.$value.removeClass('jqx-value-animation');\n }", "title": "" }, { "docid": "001042a84412a853f28bf83017e0838a", "score": "0.5495077", "text": "function AnimateProgress(elem) {\n\t// add className .animate-progress to the elem\n\telem.className = 'animate-progress';\n\t// set custom attribue to the elem base on the [data-progress]\n\telem.setAttribute('style', `--animate-progress:${elem.getAttribute('data-progress')}%;`);\n}", "title": "" }, { "docid": "0028459e1b5b4440a0ae39965ea15e21", "score": "0.54512316", "text": "setPercent(percent) { this._behavior('set percent', percent); }", "title": "" }, { "docid": "5b52a5d3ba03ccf416fbcdc2672ea2e4", "score": "0.54472566", "text": "update (percent) {\n let tween = game.tweens.create( this.bar);\n tween.to(\n { scaleX: percent },\n 500,\n Kiwi.Animations.Tweens.Easing.Sinusoidal.Out,\n true\n );\n tween.start();\n }", "title": "" }, { "docid": "cb4627783a38742bfad4be40065837be", "score": "0.5430015", "text": "function asciiLoading() {\n $(\"div div div\").empty();\n $(\"#central\").append(\"<span id='count1' class='pr-5 count-size'>98</span><span id='count2' class='pr-5 count-size'>114</span><span id='count3' class='pr-5 count-size'>97</span><span id='count4' class='pr-5 count-size'>100</span><span id='count5' class='pr-5 count-size'>108</span><span id='count6' class='pr-5 count-size'>101</span><span id='count7' class='pr-5 count-size'>121</span>\");\n function animateValue(obj, start, end, duration) { //courtesy of https://css-tricks.com/animating-number-counters/\n let startTimestamp = null;\n const step = (timestamp) => {\n if (!startTimestamp) startTimestamp = timestamp;\n const progress = Math.min((timestamp - startTimestamp) / duration, 1);\n obj.innerHTML = Math.floor(progress * (end - start) + start);\n if (progress < 1) {\n window.requestAnimationFrame(step);\n }\n };\n window.requestAnimationFrame(step);\n }\n setTimeout(function () {\n var obj = document.getElementById(\"count1\");\n animateValue(obj, 98, 76, 7000);\n setTimeout(function () { $(\"#count1\").addClass(\"matrix\") }, 7100);\n var obj = document.getElementById(\"count2\");\n animateValue(obj, 114, 79, 10000);\n setTimeout(function () { $(\"#count2\").addClass(\"matrix\") }, 10100);\n var obj = document.getElementById(\"count3\");\n animateValue(obj, 97, 65, 4500);\n setTimeout(function () { $(\"#count3\").addClass(\"matrix\") }, 4600);\n var obj = document.getElementById(\"count4\");\n animateValue(obj, 100, 68, 6000);\n setTimeout(function () { $(\"#count4\").addClass(\"matrix\") }, 6100);\n var obj = document.getElementById(\"count5\");\n animateValue(obj, 108, 73, 9000);\n setTimeout(function () { $(\"#count5\").addClass(\"matrix\") }, 9100);\n var obj = document.getElementById(\"count6\");\n animateValue(obj, 101, 78, 15000);\n setTimeout(function () { $(\"#count6\").addClass(\"matrix\") }, 15100);\n var obj = document.getElementById(\"count7\");\n animateValue(obj, 121, 71, 12000);\n setTimeout(function () { $(\"#count7\").addClass(\"matrix\") }, 12100);\n setTimeout(function () { window.location.href = \"cv.html\" }, 20000);\n }, 5000);\n setTimeout(function () { window.location.href = \"cv.html\" }, 20000);\n}", "title": "" }, { "docid": "273e51b45ab2822bb65bf81ba252158f", "score": "0.54275054", "text": "function progressBarAnimation(){\n var countCircles = 0;\n $('.circle').each(function(){\n var percent = $(this).data('percent') / 100;\n var circleColor = '#2C3E50';\n if(countCircles % 2 === 0){\n circleColor = '#E74C3C';\n }\n $(this).circleProgress({\n value: percent,\n size: 200,\n fill: {\n color: circleColor\n }\n }).on('circle-animation-progress', function(event, progress) {\n $(this).find('strong').html(Math.round($(this).data('percent') * progress) + '<i>%</i>');\n });\n countCircles++;\n });\n }", "title": "" }, { "docid": "aaa9679da12ab6a61676f62c0c89ebf9", "score": "0.54253435", "text": "function atualizaBarra() {\n intFeitasSc = document.querySelectorAll('[scorm=completed');\n var scrolled = ((intFeitasSc.length + 1) / totalInt) * 100;\n //console.log('intFeitasSc: ', intFeitasSc.length + 1);\n //console.log('totalInt: ', totalInt);\n //console.log('SCROLL: ', scrolled)\n $('#progresso').animate({ width: scrolled + \"%\" }, 100)\n}", "title": "" }, { "docid": "11761758e1d9c74841e96447f5c26f25", "score": "0.54059786", "text": "function updatePercent(percent) {\n $(\"#progress_bar\").removeClass(\"hide\").find(\".progress-bar\").attr(\"aria-valuenow\", percent)\n .css({\n width: percent + \"%\"\n });\n }", "title": "" }, { "docid": "9d49ed9420c34cf89943b72006dc8d69", "score": "0.5384701", "text": "function mkdfInitToCounterProgressBar(progressBar) {\n var percentage = parseFloat(progressBar.find('.mkdf-progress-content').data('percentage'));\n var percent = progressBar.find('.mkdf-progress-number .mkdf-percent');\n if(percent.length) {\n percent.each(function() {\n var thisPercent = $(this);\n thisPercent.parents('.mkdf-progress-number-wrapper').css('opacity', '1');\n thisPercent.countTo({\n from: 0,\n to: percentage,\n speed: 1500,\n refreshInterval: 50\n });\n });\n }\n }", "title": "" }, { "docid": "e968e53b3677ffa0ea2cd5f6675e6f8c", "score": "0.5383409", "text": "function animate_percentages() {\n\n $('#gantt .task_percent').each(function () {\n\n var width = $(this).attr('rel') + '%';\n\n $(this).animate(\n { width: width },\n {\n duration: 1000,\n step: function (now, fx) {\n var data = Math.round(now);\n $(this).html(data + '%');\n }\n //easing: \"linear\"\n }\n );\n });\n}", "title": "" }, { "docid": "7edd5f2cd1961dd543abe160a4c95012", "score": "0.5356927", "text": "animate() {\n let progress = 0;\n this.setState({ progress });\n setTimeout(() => {\n this.setState({ indeterminate: false });\n setInterval(() => {\n progress += Math.random() / 5;\n if (progress > this.props.athlete.performance.value) {\n progress = this.props.athlete.performance.value;\n }\n this.setState({ progress });\n }, 500);\n }, 1500);\n }", "title": "" }, { "docid": "c5a0d4fe4562b2dbb4ef96fc9dfad930", "score": "0.5334794", "text": "function eltdfInitToCounterProgressBar(progressBar, $percentage) {\n var percentage = parseFloat($percentage),\n percent = progressBar.find('.eltdf-pb-percent');\n\n if (percent.length) {\n percent.each(function () {\n var thisPercent = $(this);\n thisPercent.css('opacity', '1');\n\n thisPercent.countTo({\n from: 0,\n to: percentage,\n speed: 2000,\n refreshInterval: 50\n });\n });\n }\n }", "title": "" }, { "docid": "9a6cf72f8732d1ed134d75f493e7067d", "score": "0.5317277", "text": "function renderProgressBar(id, percentage){\r\n\tdocument.getElementById(id).innerHTML = '';\r\n\tvar bar = new ProgressBar.Line('#' + id, {\r\n\t\tstrokeWidth: 2,\r\n\t\teasing: 'easeInOut',\r\n\t\tduration: 1400,\r\n\t\tcolor: '#aabf9d',\r\n\t\ttrailColor: '#e27979',\r\n\t\ttrailWidth: 1,\r\n\t\tsvgStyle: {width: '100%', height: '100%'},\r\n\t\ttext: {\r\n\t\tstyle: {\r\n\t\t color: '#999',\r\n\t\t position: 'absolute',\r\n\t\t right: '5px',\r\n\t\t bottom: '5px',\r\n\t\t padding: 0,\r\n\t\t margin: 0,\r\n\t\t transform: null\r\n\t\t},\r\n\t\tautoStyleContainer: false\r\n\t\t},\r\n\t\tfrom: {color: '#FFEA82'},\r\n\t\tto: {color: '#ED6A5A'},\r\n\t\tstep: (state, bar) => {\r\n\t\tbar.setText('Code covered ' + \r\n\t\t\tMath.round(bar.value() * 100) + ' %');\r\n\t\t}\r\n\t});\r\n\r\n\tbar.animate(percentage / 100);\r\n\treturn bar;\r\n}", "title": "" }, { "docid": "75c58563eecf4b96be1155099eac7773", "score": "0.53115505", "text": "function displayProgressBar(id,percentage){\r\n\tvar circle = new ProgressBar.Circle('#progress'+id, {\r\n color: '#48D788',\r\n strokeWidth: 5,\r\n trailWidth: 5,\r\n trailColor: '#eee',\r\n duration: 1500,\r\n easing: 'easeInOut',\r\n text: {\r\n value: '0'\r\n },\r\n step: function(state, bar) {\r\n bar.setText((bar.value() * 100).toFixed(2)+\"%\");\r\n }\r\n });\r\n circle.animate(percentage);\r\n}", "title": "" }, { "docid": "02d64a0be40228a17390e7ebefda18e4", "score": "0.5298524", "text": "applyValueDecreaseTransition(representativePct){\n var targetCells = this.isolateTargetCells(this.gaugeElements, representativePct);\n console.log(`${targetCells.length} total cells require animation`);\n var newValues = this.assignNewOpacityLevels(new Array(targetCells.length));\n for(var x=targetCells.length-1;x>-1;x--){\n targetCells[x].setOpacity(newValues[x], (INITIAL_DELAY_INTERVAL+(TRANSITION_DELAY_INTERVAL*(targetCells.length-x))));\n }\n }", "title": "" }, { "docid": "fdc29acfdd8724e30d4ea9836d320bba", "score": "0.52983016", "text": "_updateProgress() {\n super._updateProgress();\n\n const that = this;\n\n //Label for Percentages\n if (that.showProgressValue) {\n const percentage = parseInt(that._percentageValue * 100);\n\n that.$.label.innerHTML = that.formatFunction ? that.formatFunction(percentage) : percentage + '%';\n }\n else {\n that.$.label.innerHTML = '';\n }\n\n if (that.value === null || that.indeterminate) {\n that.$value.addClass('jqx-value-animation');\n }\n else {\n that.$value.removeClass('jqx-value-animation');\n }\n\n that.$.value.style.transform = that.orientation === 'horizontal' ? 'scaleX(' + that._percentageValue + ')' : 'scaleY(' + that._percentageValue + ')';\n }", "title": "" }, { "docid": "361a26967b15918730508cb47843a83b", "score": "0.5297423", "text": "_getAnimationText() {\n const strokeCircumference = this._getStrokeCircumference();\n return INDETERMINATE_ANIMATION_TEMPLATE\n // Animation should begin at 5% and end at 80%\n .replace(/START_VALUE/g, `${0.95 * strokeCircumference}`)\n .replace(/END_VALUE/g, `${0.2 * strokeCircumference}`)\n .replace(/DIAMETER/g, `${this._spinnerAnimationLabel}`);\n }", "title": "" }, { "docid": "361a26967b15918730508cb47843a83b", "score": "0.5297423", "text": "_getAnimationText() {\n const strokeCircumference = this._getStrokeCircumference();\n return INDETERMINATE_ANIMATION_TEMPLATE\n // Animation should begin at 5% and end at 80%\n .replace(/START_VALUE/g, `${0.95 * strokeCircumference}`)\n .replace(/END_VALUE/g, `${0.2 * strokeCircumference}`)\n .replace(/DIAMETER/g, `${this._spinnerAnimationLabel}`);\n }", "title": "" }, { "docid": "3a6c5223860f19848eaed38bb75de009", "score": "0.52936256", "text": "function setAudienceMeters(a, b, c, d) {\n\n $(\"#meter1\").animate({\n width: a + \"%\"\n }, 1500);\n $(\"#meter2\").animate({\n width: b + \"%\"\n }, 1500);\n $(\"#meter3\").animate({\n width: c + \"%\"\n }, 1500);\n $(\"#meter4\").animate({\n width: d + \"%\"\n }, 1500);\n\n\n}", "title": "" }, { "docid": "caf276ab17af5da9adf9e4ffd10992ab", "score": "0.5277651", "text": "drawGauge() {\n const { bgcolor, color, animate, percent } = this.props;\n if (!animate) this.displayPercent = percent;\n this.ctx.clearRect(0, 0, this.width, this.height);\n this.drawArc(100, bgcolor);\n this.drawArc(this.displayPercent, color);\n this.drawText(this.displayPercent);\n }", "title": "" }, { "docid": "7495295c807111c05545e8e0baae4f29", "score": "0.5268609", "text": "function animation_flag_with_saturation (direccion){\n var index = '#filaIndice'+direccion;\n $(index).html(\"<img src='js/css/cross.png' border='0'/>\");\n $(index).effect(\"pulsate\",{times:3},500);\n}", "title": "" }, { "docid": "4072e11816cdbe4e6ffe3f491edf21f3", "score": "0.5265643", "text": "function UpdateIndicator(index) \n{\n\tvar busy=\"#F08080\";\n\tvar idle=\"#B0E0E6\";\n\tvar i = \"#progress_\" + (index + 1);\n\t$(\"#progress_1\").css(\"background-color\",idle);\n\t$(\"#progress_2\").css(\"background-color\",idle);\n\t$(\"#progress_3\").css(\"background-color\",idle);\n\t$(\"#progress_4\").css(\"background-color\",idle);\n\t$(\"#progress_5\").css(\"background-color\",idle);\n $(i).css(\"background-color\",busy);\n}", "title": "" }, { "docid": "7ccd5b57636c43c5bc2760cb8f41c605", "score": "0.52239573", "text": "function edgtfInitToCounterProgressBar(progressBar, $percentage, $isGradient){\n\t\tvar percentage = parseFloat($percentage),\n\t\t\tpercent = progressBar.find('.edgtf-pb-percent');\n\t\t\n\t\tif(percent.length) {\n\t\t\tpercent.each(function() {\n\t\t\t\tvar thisPercent = $(this).find('.edgtf-pb-percent-inner');\n\t\t\t\tthisPercent.css('opacity', '1');\n\t\t\t\t\n\t\t\t\tthisPercent.countTo({\n\t\t\t\t\tfrom: 0,\n\t\t\t\t\tto: percentage,\n\t\t\t\t\tspeed: 2000,\n\t\t\t\t\trefreshInterval: 50\n\t\t\t\t});\n\n\t\t\t\tif($isGradient) {\n\t\t\t\t\tvar position = percent.data('position');\n\n\t\t\t\t\tpercent.addClass('edgtf-active');\n\t\t\t\t\tpercent.animate({'left': position+'%'}, 2000);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "36b9a87b37213fdb7b0cb85e8b6b1ace", "score": "0.5215437", "text": "setProgress(percentage) {\n let bar = document.getElementById(\"loading_bar\");\n bar.style.width = percentage * 400 + \"px\";\n }", "title": "" }, { "docid": "7129774198dad8fa792740ff8060d9e7", "score": "0.52141535", "text": "function animateProgressBar() {\n\t$('.pro-bar').each(function (i, elem) {\n\t\tvar elem = $(this),\n\t\t\tpercent = elem.attr('data-pro-bar-percent'),\n\t\t\tdelay = elem.attr('data-pro-bar-delay');\n\n\t\tif (!elem.hasClass('animated'))\n\t\t\telem.css({\n\t\t\t\t'width': '0%'\n\t\t\t});\n\n\t\tif (elem.visible(true)) {\n\t\t\tsetTimeout(function () {\n\t\t\t\telem.animate({\n\t\t\t\t\t'width': percent + '%'\n\t\t\t\t}, 2000, 'easeInOutExpo').addClass('animated');\n\t\t\t}, delay);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "245909307745ca8edb1e02e0a5f7aea7", "score": "0.5213143", "text": "progress(percent) {\n this.loadingBar.setAttributeNS(null, 'width', percent * 155 + ''); // 155 = width of the bar\n }", "title": "" }, { "docid": "90bdec5beed0e1f9652dc838dce7e88c", "score": "0.5210688", "text": "function qodefInitToCounterProgressBar(progressBar, $percentage){\n\t\tvar percentage = parseFloat($percentage),\n\t\t\tpercent = progressBar.find('.qodef-pb-percent');\n\t\t\n\t\tif(percent.length) {\n\t\t\tpercent.each(function() {\n\t\t\t\tvar thisPercent = $(this);\n\t\t\t\tthisPercent.css('opacity', '1');\n\t\t\t\t\n\t\t\t\tthisPercent.countTo({\n\t\t\t\t\tfrom: 0,\n\t\t\t\t\tto: percentage,\n\t\t\t\t\tspeed: 1000,\n\t\t\t\t\trefreshInterval: 50\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "e9f1de666c7f96f262ed5037eec7f1d4", "score": "0.5190365", "text": "function animation_flag_with_saturation(direccion){\n var indice_mem=\"#filaIndice_mem_ext\"+direccion;\n $(indice_mem).html(\"<img src = 'js/css/cross.png' border = '0' />\");\n $(indice_mem).effect(\"pulsate\",{times:3},500);\n}", "title": "" }, { "docid": "ff6a5af1bffc8c1eb26182bf3cc9b748", "score": "0.518944", "text": "function effectProgress() {\n var bodyScroll = wind.scrollTop(),\n height = $(document).height() - wind.height();\n\n if (bodyScroll > 70) {\n TweenMax.to(e, 1, {ease: Back.easeOut.config(4), right: 40});\n e.find('.dsn-progress-path').css('stroke-dashoffset', 300 - Math.round(bodyScroll * 300 / height) + '%');\n\n } else {\n TweenMax.to(e, 1, {ease: Back.easeIn.config(4), right: -60});\n }\n }", "title": "" }, { "docid": "8d775ee587b1c166798a0cd54ba6a7cb", "score": "0.5188409", "text": "function edgtfInitToCounterProgressBar(progressBar, $percentage){\n\t\tvar percentage = parseFloat($percentage),\n\t\t\tpercent = progressBar.find('.edgtf-pb-percent');\n\t\t\n\t\tif(percent.length) {\n\t\t\tpercent.each(function() {\n\t\t\t\tvar thisPercent = $(this);\n\t\t\t\tthisPercent.css('opacity', '1');\n\t\t\t\t\n\t\t\t\tthisPercent.countTo({\n\t\t\t\t\tfrom: 0,\n\t\t\t\t\tto: percentage,\n\t\t\t\t\tspeed: 2000,\n\t\t\t\t\trefreshInterval: 50\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "8d775ee587b1c166798a0cd54ba6a7cb", "score": "0.5188409", "text": "function edgtfInitToCounterProgressBar(progressBar, $percentage){\n\t\tvar percentage = parseFloat($percentage),\n\t\t\tpercent = progressBar.find('.edgtf-pb-percent');\n\t\t\n\t\tif(percent.length) {\n\t\t\tpercent.each(function() {\n\t\t\t\tvar thisPercent = $(this);\n\t\t\t\tthisPercent.css('opacity', '1');\n\t\t\t\t\n\t\t\t\tthisPercent.countTo({\n\t\t\t\t\tfrom: 0,\n\t\t\t\t\tto: percentage,\n\t\t\t\t\tspeed: 2000,\n\t\t\t\t\trefreshInterval: 50\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "c560759e3ce3ca868b8d136559eeb950", "score": "0.5183957", "text": "function setPledgeMeter(year,percentage){\n $(\"#\"+year+\"pledgemeter\").show();\n percentage=Math.min(percentage,100);\n $(\"#\"+year+\"pledgemeter .pledgebaron\").css(\"width\",percentage+\"%\");\n $(\"#\"+year+\"pledgemeter .pledgebaron\").css(\"background-image\",\"url('\"+fixeddata.modulepath+\"/pledgemeterimages/baron.png')\");\n $(\"#\"+year+\"pledgemeter .pledgebaroff\").css(\"left\",percentage+\"%\");\n $(\"#\"+year+\"pledgemeter .pledgebaroff\").css(\"background-image\",\"url('\"+fixeddata.modulepath+\"/pledgemeterimages/baroff.png')\");\n $(\"#\"+year+\"pledgemeter .pledgebaroff\").css(\"width\",(100-percentage)+\"%\");\n $(\"#\"+year+\"pledgemeter .pledgebuttonleft\").css(\"background-image\",\"url('\"+fixeddata.modulepath+\"/pledgemeterimages/left\"+(percentage>0?\"on\":\"off\")+\".png')\");\n for(var i=25;i<=75;i+=25){\n $(\"#\"+year+\"pledgemeter .pledgebuttonmiddle.pledge\"+i).css(\"background-image\",\"url('\"+fixeddata.modulepath+\"/pledgemeterimages/middle\"+(percentage>=i?\"on\":\"off\")+\".png')\");\n }\n $(\"#\"+year+\"pledgemeter .pledgebuttonright\").css(\"background-image\",\"url('\"+fixeddata.modulepath+\"/pledgemeterimages/right\"+(percentage>=100?\"on\":\"off\")+\".png')\");\n }", "title": "" }, { "docid": "cb1c46cf14f83ca77f0beb0fa800faa7", "score": "0.517206", "text": "slider() {\n gsap\n .to(this.spans, {\n xPercent: -100,\n repeat: -1,\n duration: 10,\n ease: \"linear\"\n })\n .totalProgress(0.5);\n\n gsap.set(this.title, { xPercent: 0 });\n }", "title": "" }, { "docid": "202753170f3cdf7d5180662a1ddd8afd", "score": "0.51693535", "text": "function updatePercentColour(percent) {\n let progressPercent = document.querySelector(\".progressPercent\");\n if (percent > 50) {\n progressPercent.style.color = \"#2f243a\";\n } else {\n progressPercent.style.color = \"#fff\";\n }\n}", "title": "" }, { "docid": "ac7a11f996da7fe340a79e3af005e5e8", "score": "0.5165464", "text": "function watchAttributes() {\r\n attr.$observe('value', function(value) {\r\n var percentValue = clamp(value);\r\n element.attr('aria-valuenow', percentValue);\r\n\r\n if (mode() == MODE_DETERMINATE) {\r\n animateIndicator(percentValue);\r\n }\r\n });\r\n attr.$observe('mdMode',function(mode){\r\n switch( mode ) {\r\n case MODE_DETERMINATE:\r\n case MODE_INDETERMINATE:\r\n spinnerWrapper.removeClass('ng-hide');\r\n if (lastMode) spinnerWrapper.removeClass(lastMode);\r\n spinnerWrapper.addClass( lastMode = \"md-mode-\" + mode );\r\n break;\r\n default:\r\n if (lastMode) spinnerWrapper.removeClass( lastMode );\r\n spinnerWrapper.addClass('ng-hide');\r\n lastMode = undefined;\r\n break;\r\n }\r\n });\r\n }", "title": "" }, { "docid": "35a86552dfe79600ea6ffabc01a2c1eb", "score": "0.5153356", "text": "function setMeter(fraction) {\n var percent = fraction * 100;\n if(percent <= 100) {\n meter.setProgress(percent);\n }\n}", "title": "" }, { "docid": "28d628dbc96306811f04828cdeca451d", "score": "0.5148486", "text": "function getAnimationProportion( iProportion) {\n if( iProportion >= 1)\n return 1;\n else\n return DG.AnimationMath.DefaultAnimationTween( iProportion);\n }", "title": "" }, { "docid": "719da9c8b21314a0ea3932cdc7a6496c", "score": "0.51466167", "text": "_calculateValue(percentage) {\n return this.min + percentage * (this.max - this.min);\n }", "title": "" }, { "docid": "719da9c8b21314a0ea3932cdc7a6496c", "score": "0.51466167", "text": "_calculateValue(percentage) {\n return this.min + percentage * (this.max - this.min);\n }", "title": "" }, { "docid": "719da9c8b21314a0ea3932cdc7a6496c", "score": "0.51466167", "text": "_calculateValue(percentage) {\n return this.min + percentage * (this.max - this.min);\n }", "title": "" }, { "docid": "4aafaea1d2c8511126ec4ef120d555ea", "score": "0.5143602", "text": "function setIndicator(val, threshold, reverse, check){\n if(val == 0){\n return {val: val, indicator: '', spanClass: ''};\n }\n if(check){\n if(!reverse){\n if(val > threshold){\n var indicator = '';//'fa fa-level-up';\n var spanClass = 'badge badge-danger';\n }\n else{\n var indicator = '';//'fa fa-level-down';\n var spanClass = '';//'badge badge-danger';\n }\n }\n var obj = {val: val, indicator: indicator, spanClass: spanClass};\n }else{\n var obj = {val: val, indicator: '', spanClass: ''};\n }\n return obj;\n }", "title": "" }, { "docid": "b8dd46d8caf8b4dc7319ab3c38c6799b", "score": "0.5142882", "text": "function defineIncrementPixels(){\n\tmountain_start = (heightOfBrowser / 100) * 100;\n\tmountain_finish = (heightOfBrowser / 100) * 30;\n\tmountain_increment = total_heightOfAnimationDivs/(mountain_start - mountain_finish);\n\tmountain_increment = 1/mountain_increment;\n\n\taldeia_start = (heightOfBrowser / 100) * 150;\n\taldeia_finish = (heightOfBrowser / 100) * 50;\n\taldeia_increment = total_heightOfAnimationDivs/(aldeia_start - aldeia_finish);\n\taldeia_increment = 1 / aldeia_increment;\n\n\tcloud1_start = (heightOfBrowser / 100) * 70;\n\tcloud1_finish = (heightOfBrowser / 100) * 30;\n\tcloud1_increment = total_heightOfAnimationDivs/(cloud1_start - cloud1_finish);\n\tcloud1_increment = 1 / cloud1_increment;\n\n\tcloud2_start = (heightOfBrowser / 100) * 50;\n\tcloud2_finish = (heightOfBrowser / 100) * 30;\n\tcloud2_increment = total_heightOfAnimationDivs/(cloud2_start - cloud2_finish);\n\tcloud2_increment = 1 / cloud2_increment;\n\n\tcloud3_start = (heightOfBrowser / 100) * 90;\n\tcloud3_finish = (heightOfBrowser / 100) * 60;\n\tcloud3_increment = total_heightOfAnimationDivs/(cloud3_start - cloud3_finish);\n\tcloud3_increment = 1 / cloud3_increment;\n}", "title": "" }, { "docid": "b14248951ea2a2f348be441da4bce1d0", "score": "0.5140053", "text": "function doProgress(step){\n \n const progress = document.getElementById('progress');\n const width = (step * 10)*2; \n progress.setAttribute('style', `width:${width}%;`);\n}", "title": "" }, { "docid": "0d51704524ba4d137af95f45a5c9b62e", "score": "0.51376003", "text": "_animateProps(pct) {\n\t\tthis._metadata.isInitialized = true;\n\t\tlet nProps = {};\n\t\tfor (let prop in this._metadata.props) {\n\t\t\tlet value = false;\n\t\t\t// calculate the diff of to and from, multiply by percent, add to from\n\t\t\tif (this._metadata.isComplete) {\n\t\t\t\tvalue = this._metadata.props[prop].to;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvalue = (this._metadata.props[prop].to > this._metadata.props[prop].from) ?\n\t\t\t\t\t(this._metadata.props[prop].from + (this._metadata.props[prop].range * pct)) :\n\t\t\t\t\t(this._metadata.props[prop].from - (this._metadata.props[prop].range * pct));\n\t\t\t}\n\t\t\tif (value !== false) {\n\t\t\t\tlet val = value + ((this._metadata.props[prop].unit) ? this._metadata.props[prop].unit : \"\");\n\t\t\t\tif (!this._metadata.props[prop].isTransform && this._metadata.node && this._metadata.node[prop] !== undefined) this._metadata.node[prop] = val;\n\t\t\t\telse {\n\t\t\t\t\tif (this._metadata.props[prop].isTransform) {\n\t\t\t\t\t\tif (!nProps.transform) nProps.transform = {};\n\t\t\t\t\t\tnProps.transform[prop] = val;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tnProps[prop] = val;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._metadata.elmt.addStyle(nProps);\n\t}", "title": "" }, { "docid": "75204d518869d7f1d32752a333454ec8", "score": "0.51344854", "text": "function getAnimationProportion( iProportion) {\n if( iProportion >= 1)\n return 1;\n else\n return DG.AnimationMath.DefaultAnimationTween( iProportion);\n }", "title": "" }, { "docid": "75204d518869d7f1d32752a333454ec8", "score": "0.51344854", "text": "function getAnimationProportion( iProportion) {\n if( iProportion >= 1)\n return 1;\n else\n return DG.AnimationMath.DefaultAnimationTween( iProportion);\n }", "title": "" }, { "docid": "6aa1f8b5899a515f29d53a91e1c6330c", "score": "0.5132119", "text": "function transition(percentageOfStep) {\r\n // Transition head\r\n const head = tiles[snakePositions[snakePositions.length - 1]];\r\n const headDi = headDirection();\r\n const headValue = `${percentageOfStep * 100}%`;\r\n if (headDi == \"right\" || headDi == \"left\") head.style.width = headValue;\r\n if (headDi == \"down\" || headDi == \"up\") head.style.height = headValue;\r\n \r\n // Transition tail\r\n const tail = tiles[snakePositions[0]];\r\n const tailDi = tailDirection();\r\n const tailValue = `${100 - percentageOfStep * 100}%`;\r\n if (tailDi == \"right\" || tailDi == \"left\") tail.style.width = tailValue;\r\n if (tailDi == \"down\" || tailDi == \"up\") tail.style.height = tailValue;\r\n }", "title": "" }, { "docid": "8f8a88e8f362020c3bfe49ae20857400", "score": "0.5127951", "text": "function onProgress(value) {\n document.getElementById('counter').innerHTML = Math.round(value);\n }", "title": "" }, { "docid": "398e225ba57a68f0c6a28ba90177c9b0", "score": "0.51228315", "text": "function add_execution_style() {\n var $doms = $(\".passrate\");\n var i = 0;\n for (i; i < $doms.length; i+=1) {\n var val = parseInt($doms.eq(i).text().split(\"%\")[0]);\n\n if (val == 100) {\n $doms.eq(i).addClass(\"green\");\n } else if(val < 70) {\n $doms.eq(i).addClass(\"red\");\n } else {\n $doms.eq(i).addClass(\"orange\");\n }\n }\n }", "title": "" }, { "docid": "68691d33b4dfc25ace6d0b8ad8667d50", "score": "0.5122511", "text": "addPercentage(totalInc) {\n this.percentage = Math.round((this.value / totalInc) * 10000) / 100;\n }", "title": "" }, { "docid": "eda0591c60dca24a1d5ac96bb89cbab6", "score": "0.51021653", "text": "function MdProgressCircularDirective(e,r,a,n,t,i){function o(i,o,u){function v(a,t,o,u,d){var g=++y,v=n.now(),f=t-a,p=l(i.mdDiameter),h=p-m(p),M=o||r.easeFn,C=u||r.duration;t===a?F.attr(\"d\",s(t,p,h,d)):P=c(function w(r){var t=e.Math.max(0,e.Math.min((r||n.now())-v,C));F.attr(\"d\",s(M(t,a,f,C),p,h,d)),g===y&&C>t&&(P=c(w))})}function C(){v(b,A,r.easeFnIndeterminate,r.durationIndeterminate,q),q=(q+A)%100;var e=b;b=-A,A=-e}function w(){x||(x=t(C,r.durationIndeterminate+50,0,!1),C(),o.addClass(M).removeAttr(\"aria-valuenow\"))}function $(){x&&(t.cancel(x),x=null,o.removeClass(M))}var P,x,I=o[0],D=angular.element(I.querySelector(\"svg\")),F=angular.element(I.querySelector(\"path\")),b=r.startIndeterminate,A=r.endIndeterminate,q=0,y=0;a(o),o.toggleClass(h,u.hasOwnProperty(\"disabled\")),i.mdMode===p&&w(),i.$on(\"$destroy\",function(){$(),P&&g(P)}),i.$watchGroup([\"value\",\"mdMode\",function(){var e=I.disabled;return e===!0||e===!1?e:angular.isDefined(o.attr(\"disabled\"))}],function(e,r){var a=e[1],n=e[2],t=r[2];if(n!==t&&o.toggleClass(h,!!n),n)$();else if(a!==f&&a!==p&&(a=p,u.$set(\"mdMode\",a)),a===p)w();else{var i=d(e[0]);$(),o.attr(\"aria-valuenow\",i),v(d(r[0]),i)}}),i.$watch(\"mdDiameter\",function(e){var r=l(e),a=m(r),n=r/2+\"px\",t={width:r+\"px\",height:r+\"px\"};D[0].setAttribute(\"viewBox\",\"0 0 \"+r+\" \"+r),D.css(t).css(\"transform-origin\",n+\" \"+n+\" \"+n),o.css(t),F.css(\"stroke-width\",a+\"px\")})}function s(e,r,a,n){var t,i=3.5999,o=n||0,s=r/2,d=a/2,l=o*i,m=e*i,c=u(s,d,l),g=u(s,d,m+l),v=0>m?0:1;return t=0>m?m>=-180?0:1:180>=m?0:1,\"M\"+c+\"A\"+d+\",\"+d+\" 0 \"+t+\",\"+v+\" \"+g}function u(r,a,n){var t=(n-90)*v;return r+a*e.Math.cos(t)+\",\"+(r+a*e.Math.sin(t))}function d(r){return e.Math.max(0,e.Math.min(r||0,100))}function l(e){var a=r.progressSize;if(e){var n=parseFloat(e);return e.lastIndexOf(\"%\")===e.length-1&&(n=n/100*a),n}return a}function m(e){return r.strokeWidth/100*e}var c=e.requestAnimationFrame||angular.noop,g=e.cancelAnimationFrame||angular.noop,v=e.Math.PI/180,f=\"determinate\",p=\"indeterminate\",h=\"_md-progress-circular-disabled\",M=\"_md-mode-indeterminate\";return{restrict:\"E\",scope:{value:\"@\",mdDiameter:\"@\",mdMode:\"@\"},template:'<svg xmlns=\"http://www.w3.org/2000/svg\"><path fill=\"none\"/></svg>',compile:function(e,r){if(e.attr({\"aria-valuemin\":0,\"aria-valuemax\":100,role:\"progressbar\"}),angular.isUndefined(r.mdMode)){var a=angular.isDefined(r.value),n=a?f:p;r.$set(\"mdMode\",n)}else r.$set(\"mdMode\",r.mdMode.trim());return o}}}", "title": "" }, { "docid": "29c44a47eea6f8b3af00b2199cae2d74", "score": "0.5100189", "text": "function watchAttributes() {\n attr.$observe('value', function(value) {\n var percentValue = clamp(value);\n element.attr('aria-valuenow', percentValue);\n\n if (mode() == MODE_DETERMINATE) {\n animateIndicator(percentValue);\n }\n });\n attr.$observe('mdMode',function(mode){\n switch( mode ) {\n case MODE_DETERMINATE:\n case MODE_INDETERMINATE:\n spinnerWrapper.removeClass('ng-hide');\n if (lastMode) spinnerWrapper.removeClass(lastMode);\n spinnerWrapper.addClass( lastMode = \"md-mode-\" + mode );\n break;\n default:\n if (lastMode) spinnerWrapper.removeClass( lastMode );\n spinnerWrapper.addClass('ng-hide');\n lastMode = undefined;\n break;\n }\n });\n }", "title": "" }, { "docid": "29c44a47eea6f8b3af00b2199cae2d74", "score": "0.5100189", "text": "function watchAttributes() {\n attr.$observe('value', function(value) {\n var percentValue = clamp(value);\n element.attr('aria-valuenow', percentValue);\n\n if (mode() == MODE_DETERMINATE) {\n animateIndicator(percentValue);\n }\n });\n attr.$observe('mdMode',function(mode){\n switch( mode ) {\n case MODE_DETERMINATE:\n case MODE_INDETERMINATE:\n spinnerWrapper.removeClass('ng-hide');\n if (lastMode) spinnerWrapper.removeClass(lastMode);\n spinnerWrapper.addClass( lastMode = \"md-mode-\" + mode );\n break;\n default:\n if (lastMode) spinnerWrapper.removeClass( lastMode );\n spinnerWrapper.addClass('ng-hide');\n lastMode = undefined;\n break;\n }\n });\n }", "title": "" }, { "docid": "29c44a47eea6f8b3af00b2199cae2d74", "score": "0.5100189", "text": "function watchAttributes() {\n attr.$observe('value', function(value) {\n var percentValue = clamp(value);\n element.attr('aria-valuenow', percentValue);\n\n if (mode() == MODE_DETERMINATE) {\n animateIndicator(percentValue);\n }\n });\n attr.$observe('mdMode',function(mode){\n switch( mode ) {\n case MODE_DETERMINATE:\n case MODE_INDETERMINATE:\n spinnerWrapper.removeClass('ng-hide');\n if (lastMode) spinnerWrapper.removeClass(lastMode);\n spinnerWrapper.addClass( lastMode = \"md-mode-\" + mode );\n break;\n default:\n if (lastMode) spinnerWrapper.removeClass( lastMode );\n spinnerWrapper.addClass('ng-hide');\n lastMode = undefined;\n break;\n }\n });\n }", "title": "" }, { "docid": "29c44a47eea6f8b3af00b2199cae2d74", "score": "0.5100189", "text": "function watchAttributes() {\n attr.$observe('value', function(value) {\n var percentValue = clamp(value);\n element.attr('aria-valuenow', percentValue);\n\n if (mode() == MODE_DETERMINATE) {\n animateIndicator(percentValue);\n }\n });\n attr.$observe('mdMode',function(mode){\n switch( mode ) {\n case MODE_DETERMINATE:\n case MODE_INDETERMINATE:\n spinnerWrapper.removeClass('ng-hide');\n if (lastMode) spinnerWrapper.removeClass(lastMode);\n spinnerWrapper.addClass( lastMode = \"md-mode-\" + mode );\n break;\n default:\n if (lastMode) spinnerWrapper.removeClass( lastMode );\n spinnerWrapper.addClass('ng-hide');\n lastMode = undefined;\n break;\n }\n });\n }", "title": "" }, { "docid": "46a64df979c83f815b56ce0d2fb6407e", "score": "0.50900096", "text": "function animate(element) {\n // is element in view?\n\n\n if (inView(element)) {\n // element is in view, add class to element\n document.getElementById('progress_val1').classList.add('progress_val1');\n document.getElementById('progress_val2').classList.add('progress_val2');\n document.getElementById('progress_val3').classList.add('progress_val3');\n document.getElementById('progress_val4').classList.add('progress_val4');\n document.getElementById('progress_val5').classList.add('progress_val5');\n document.getElementById('progress_val6').classList.add('progress_val6');\n document.getElementById('progress_val7').classList.add('progress_val7');\n document.getElementById('progress_val8').classList.add('progress_val8');\n document.getElementById('progress_val9').classList.add('progress_val9');\n document.getElementById('progress_val10').classList.add('progress_val10');\n document.getElementById('progress_val11').classList.add('progress_val11');\n document.getElementById('progress_val12').classList.add('progress_val12');\n }\n \n}", "title": "" }, { "docid": "38369f46cd04659e74257dd63eb395ce", "score": "0.5087641", "text": "function updateStarCountUI() {\n $(\"#starprogress\").css(\"height\", 56 * ($scope.starCount / 50)); // adjust the star progress indicator CSS - (what % of goal) of height?\n $(\"#starprogress\").css(\"margin-top\", 59 - 56 * ($scope.starCount / 50)); // 56 is image height, 50 is goal. +3px for an offset compensation\n $(\"#starwrapper\").removeClass(\"animation-target\"); //try to remove so its not stacked up\n $(\"#starwrapper\").addClass(\"animation-target\"); //add CSS3 animation\n\n //$cordovaNativeAudio.play('highhat');\n\n }", "title": "" }, { "docid": "f488a2a347587a089a137438002926e3", "score": "0.5083073", "text": "function updateProgress() {\r\n var elem = $(\"#assessment-bar\")[0]; \r\n var current_question_number = question_number + 1;\r\n var percentage = (current_question_number / num_questions) * 100;\r\n elem.style.width = percentage + \"%\";\r\n elem.innerHTML = current_question_number + \" out of \" + num_questions; \r\n}", "title": "" }, { "docid": "4dfb0100da1f3e90a14986bffdeac492", "score": "0.50813", "text": "function MdProgressLinearDirective(e,a,r){function n(e,a,r){return e.attr(\"aria-valuemin\",0),e.attr(\"aria-valuemax\",100),e.attr(\"role\",\"progressbar\"),t}function t(r,n,t){function c(){t.$observe(\"value\",function(e){var a=i(e);n.attr(\"aria-valuenow\",a),g()!=m&&v(M,a)}),t.$observe(\"mdBufferValue\",function(e){v(_,i(e))}),t.$observe(\"disabled\",function(e){b=e===!0||e===!1?e:angular.isDefined(e),n.toggleClass(l,!!b)}),t.$observe(\"mdMode\",function(e){switch(f&&L.removeClass(f),e){case m:case d:case s:case o:L.addClass(f=\"_md-mode-\"+e);break;default:L.addClass(f=\"_md-mode-\"+o)}})}function u(){if(angular.isUndefined(t.mdMode)){var e=angular.isDefined(t.value),a=e?s:o;n.attr(\"md-mode\",a),t.mdMode=a}}function g(){var e=(t.mdMode||\"\").trim();if(e)switch(e){case s:case o:case d:case m:break;default:e=o}return e}function v(e,r){if(!b&&g()){var n=a.supplant(\"translateX({0}%) scale({1},1)\",[(r-100)/2,r/100]),t=p({transform:n});angular.element(e).css(t)}}e(n);var f,b=t.hasOwnProperty(\"disabled\"),p=a.dom.animator.toCss,_=angular.element(n[0].querySelector(\"._md-bar1\")),M=angular.element(n[0].querySelector(\"._md-bar2\")),L=angular.element(n[0].querySelector(\"._md-container\"));n.attr(\"md-mode\",g()).toggleClass(l,b),u(),c()}function i(e){return Math.max(0,Math.min(e||0,100))}var s=\"determinate\",o=\"indeterminate\",d=\"buffer\",m=\"query\",l=\"_md-progress-linear-disabled\";return{restrict:\"E\",template:'<div class=\"_md-container\"><div class=\"_md-dashed\"></div><div class=\"_md-bar _md-bar1\"></div><div class=\"_md-bar _md-bar2\"></div></div>',compile:n}}", "title": "" }, { "docid": "d4f25469402ba5f12c9b9b745060e42c", "score": "0.50800127", "text": "function eltdInitToCounterProgressBar(progressBar){\n var percentage = parseFloat(progressBar.find('.eltd-progress-content').data('percentage'));\n var percent = progressBar.find('.eltd-progress-number .eltd-percent');\n if(percent.length) {\n percent.each(function() {\n var thisPercent = $(this);\n thisPercent.parents('.eltd-progress-number-wrapper').css('opacity', '1');\n thisPercent.countTo({\n from: 0,\n to: percentage,\n speed: 1500,\n refreshInterval: 50\n });\n });\n }\n }", "title": "" }, { "docid": "10cefcafcecebae299953948de2ee80b", "score": "0.50688356", "text": "function relativePercentage(value) {\n\tvalue = value / chromosome[cid];\n\tvalue = value * 100 * 0.9 + 5;\n\treturn value += \"%\";\n}", "title": "" }, { "docid": "af87c1f2889b07135ba76eca62637223", "score": "0.50686276", "text": "function animation_flag_without_saturation (direction){\n var index = '#filaIndice'+direction; \n $(index).html(\"<img src='js/css/tilde.gif' border='0' />\");\n $(index).effect(\"pulsate\",{times:3},500);\n}", "title": "" }, { "docid": "20059e92c1d2236649a77479020183b8", "score": "0.5064679", "text": "function animation(elem,style,beginning,end,measurement,increase){\n var start = setInterval(function(){\n if (beginning < end){\n clearInterval(start);\n }\n else{\n beginning += increase;\n $(elem).css( style, ''+beginning+''+measurement);\n }\n },30);\n}", "title": "" }, { "docid": "67aacade1492b2b55f9e12143f60fb67", "score": "0.5063926", "text": "function relativePercentage(value) {\r\n\tvalue = (value - low) / (high - low);\r\n\tvalue = value * 100 * 0.9 + 5;\r\n\tvalue += \"%\";\r\n\treturn value;\r\n}", "title": "" }, { "docid": "ef56f8146d875ecb6aa814bb32c57d2e", "score": "0.5062632", "text": "function animation_flag_with_saturation (direction){\n var index = '#filaIndice'+direction;\n if (gen_inf['intr_key']){\n str = \"<img src='js/css/cross_yellow.png' border='0' />\";\n } else \n {\n\t str = \"<img src='js/css/cross.png' border='0' />\"; \n }\n $(index).html(str);\n $(index).effect(\"pulsate\",{times:3},500);\t\n}", "title": "" }, { "docid": "eb2976ffc5321dc8c27afd165af2c555", "score": "0.50582695", "text": "function animation_flag_without_saturation(direccion){\n var indice_mem = \"#filaIndice_mem_ext\"+direccion;\n $(indice_mem).html(\"<img src = 'js/css/tilde.gif' border = '0' />\");\n $(indice_mem).effect(\"pulsate\",{times:3},500);\t \n}", "title": "" }, { "docid": "e85d419aec4b5dc9046e3fbf95448817", "score": "0.5045178", "text": "function changePercentage(step, all_steps, maximum_steps) {\n\n var percentage = (step / all_steps) * 100;\n\n if( step <= maximum_steps && percentage <= 100 ) {\n $('.outline .inside')\n .html( Math.floor( percentage ) + \"%\" )\n .css('width', percentage + \"%\");\n }\n }", "title": "" }, { "docid": "1a97dc2b51bfa0719cd379a0126e3877", "score": "0.5044935", "text": "function updateProgress() {\r\n var elem = $(\"#assessment-bar\")[0];\r\n var current_question_number = question_number + 1;\r\n var percentage = (current_question_number / num_questions) * 100;\r\n elem.style.width = percentage + \"%\";\r\n elem.innerHTML = current_question_number + \" of \" + num_questions;\r\n}", "title": "" }, { "docid": "21bfb71aa059cdd03ccd27d10f85dbdb", "score": "0.5035142", "text": "function updatePercentage(){\n percentage = percentage + 10;\n $(\".progress-bar\").html(percentage + \"%\");\n $(\".progress-bar\").css(\"width\", percentage+\"%\")\n .attr(\"aria-valuenow\", percentage);\n}", "title": "" }, { "docid": "0dc095295d8dc9d9d1569bcc7e5ec6aa", "score": "0.5034029", "text": "function loadChart(){\n\n var start_val = 0;\n\n //add the percentage to the progress bar and transition the number\n d3.select(\"body\").selectAll(\".pattern\")\n .append(\"div\")\n .text(start_val)\n .attr(\"class\", \"percentage\")\n .transition()\n .delay(function(d, i) {\n return i * 200;\n })\n .duration(1000)\n .style(\"min-width\", function(d, i) {\n return (d.progress*3)/2 + \"px\"; \n console.log(1);\n })\n .tween(\".percentage\", function(d) {\n var i = d3.interpolate(this.textContent, d.progress),\n prec = (d.progress + \"\").split(\".\"),\n round = (prec.length > 1) ? Math.pow(10, prec[1].length) : 1;\n\n return function(t) {\n this.textContent = Math.round(i(t) * round) / round + \"%\";\n };\n });\n\n //transition the width of the path\n d3.select(\"body\").selectAll(\".path\")\n .transition()\n .delay(function(d, i) {\n return i * 200;\n })\n .duration(1000)\n .style(\"width\", function(d, i) {\n return d.progress*3 + \"px\"; \n });\n\n //transition between the different colors depending on the value\n d3.select(\"body\").selectAll(\".pattern\")\n //transition to first color\n .transition()\n .delay(function(d, i) {\n return i * 200;\n })\n .duration(250)\n .style(\"background-color\", function(d) {\n if(d.progress < 40) {\n return \"#608dbd\";\n }\n else {\n return \"#68838b\";\n }\n })\n //transition to second color\n .transition()\n .delay(function(d, i) {\n return (i * 200) + 250;\n })\n .duration(250)\n .style(\"background-color\", function(d) {\n if(d < 40) {\n return \"#608dbd\";\n }\n else if (d.progress < 60) {\n return \"#68838b\";\n }\n else {\n return \"#9c9c9c\";\n }\n })\n //transition to third color\n .transition()\n .delay(function(d, i) {\n return (i * 200) + 500;\n })\n .duration(250)\n .style(\"background-color\", function(d) {\n if(d.progress < 40) {\n return \"#608dbd\";\n }\n else if (d.progress < 60) {\n return \"#68838b\";\n }\n else if (d.progress < 80) {\n return \"#9c9c9c\";\n }\n else {\n return \"#d6d6d6\";\n }\n })\n //transition to fourth color\n .transition()\n .delay(function(d, i) {\n return (i * 200) + 750;\n })\n .duration(250)\n .style(\"background-color\", function(d) {\n if(d.progress < 40) {\n return \"#608dbd\";\n }\n else if (d.progress < 60) {\n return \"#68838b\";\n }\n else if (d.progress < 80) {\n return \"#9c9c9c\";\n }\n else if (d.progress < 100) {\n return \"#d6d6d6\";\n }\n else {\n return \"#ffffff\";\n }\n });\n\n //transition the sadow under the progress bar\n d3.select(\"body\").selectAll(\".shadow\")\n .transition()\n .delay(function(d, i) {\n return i * 200;\n })\n .duration(1000)\n .style(\"width\", function(d, i) {\n return d.progress*3-6 + \"px\"; \n });\n}", "title": "" }, { "docid": "210ce881bef6e67a385c1eda4a92c580", "score": "0.5030076", "text": "animate(timestamp = 0) {\n this.progress = super.animateBase(this, timestamp);\n if (this.progress > 0) { //Only proceed if there is a progress measurement\n let height = this.bHeight * (1 - this.progress); //Progress is a countdown, so reverse the progress to find how tall the bar should be right now\n this.elm.setAttribute(\"height\", height);\n //The height moves in reverse (y @ 0 = top), so find the y where the (current height + y) will put the bottom of the bar at the baseline\n let setLine = (this.bLine - this.fHeight) * this.progress;\n setLine += this.fHeight;\n this.elm.setAttribute(\"y\", setLine);\n } else if (this.progress === 0) { //Reset the bars to their starting positions once the animation is complete\n this.elm.setAttribute(\"height\", this.bHeight);\n this.elm.setAttribute(\"y\", this.fHeight);\n }\n }", "title": "" }, { "docid": "3471f5dadb90e38ddfc26aea599cd264", "score": "0.5028073", "text": "function animation_flag_without_saturation (direction){\n var index = '#filaIndice'+direction;\n $(index).html(\"<img src='js/css/tilde.gif' border='0' />\");\n $(index).effect(\"pulsate\",{times:3},500);\n}", "title": "" }, { "docid": "0b2b05251b8c8a3dc781e19037679481", "score": "0.50263304", "text": "function updateAnimation(volumeInputValue) {\n\n // Update the model\n volumeModel.setMeasurement(Number(volumeInputValue.toFixed(2)));\n\n // Convert the value into a percentage\n var percentage = Number((volumeInputValue / 20).toFixed(2));\n\n // Write the sliderElement's value as the new percentage\n document.querySelector('.volume-slider').value = percentage;\n\n // For the plunger to move\n volumeInput.update();\n\n // Output measurements to table\n recordMeasurements();\n return;\n }", "title": "" }, { "docid": "65d81d281f6646322473bad5f13bb3d8", "score": "0.5025674", "text": "function stroke_normal(d){\n return (d[\"percent_change_2018_2019\"]/20);\n}", "title": "" }, { "docid": "97edafd885f2dd5e2bf6c37aecebd4a4", "score": "0.5025223", "text": "function drawCharts() {\n var circles = document.querySelectorAll(\".percent-circle\");\n \n circles.forEach(function(el) {\n //pull the percentage and turn it into a fraction\n var percent = el.dataset.percent / 100;\n //work out the circumference from the width\n var diameter = el.offsetWidth;\n var circumference = Math.ceil(diameter * Math.PI);\n //now we have the circumference, we know how long the ouline should be\n var stroke = Math.ceil(circumference * percent);\n //also workout how long the line doesn't exist for\n var diff = circumference - stroke;\n \n //now add the strok dash array for the first two values\n //TODO : could this all be done with css?\n el.querySelector(\".percent-circle-inner\").style.strokeDasharray =\n stroke + \"px \" + diff + \"px\";\n });\n }", "title": "" }, { "docid": "11aadf6340a4026c92822424d1f74069", "score": "0.50208056", "text": "function pctChange(val){\r\n if(val > 0){\r\n return '<span style=\"color:green;\">' + val + '%</span>';\r\n }else if(val < 0){\r\n return '<span style=\"color:red;\">' + val + '%</span>';\r\n }\r\n return val;\r\n }", "title": "" }, { "docid": "833e5e04f0aa197a716b59e72199c055", "score": "0.5019758", "text": "function setContainerOffset(percent, animate) {\n\t\tcontainer.removeClass(\"animate\");\n\n\t\tif (animate) {\n\t\t\tcontainer.addClass(\"animate\");\n\t\t}\n\n\t\tif (Modernizr.csstransforms3d) {\n\t\t\tcontainer.css(\"transform\", \"translate3d(\" + percent + \"%,0,0) scale3d(1,1,1)\");\n\t\t}\n\t\telse if (Modernizr.csstransforms) {\n\t\t\tcontainer.css(\"transform\", \"translate(\" + percent + \"%,0)\");\n\t\t}\n\t\telse {\n\t\t\tvar px = ((pane_width * pane_count) / 100) * percent;\n\t\t\tcontainer.css(\"left\", px + \"px\");\n\t\t}\n\t}", "title": "" }, { "docid": "219bbe810119c8d22163c2aa39c2f24f", "score": "0.50174797", "text": "function watchAttributes(){attr.$observe('value',function(value){var percentValue=clamp(value);element.attr('aria-valuenow',percentValue);if(mode()!=MODE_QUERY)animateIndicator(bar2,percentValue);});attr.$observe('mdBufferValue',function(value){animateIndicator(bar1,clamp(value));});attr.$observe('disabled',function(value){if(value===true||value===false){isDisabled=!!value;}else{isDisabled=angular.isDefined(value);}element.toggleClass(DISABLED_CLASS,isDisabled);container.toggleClass(lastMode,!isDisabled);});attr.$observe('mdMode',function(mode){if(lastMode)container.removeClass(lastMode);switch(mode){case MODE_QUERY:case MODE_BUFFER:case MODE_DETERMINATE:case MODE_INDETERMINATE:container.addClass(lastMode=\"md-mode-\"+mode);break;default:container.addClass(lastMode=\"md-mode-\"+MODE_INDETERMINATE);break;}});}", "title": "" } ]
37a2a8dfb0f144efa439c9b8cdee0a84
Update state according to user input
[ { "docid": "820ddb9eff46249ce5351af5dca4b997", "score": "0.0", "text": "handleChange(event) {\n if (event.target.value != null) {\n let cid = event.target.value.split(\"-\")[0];\n\n // Update videos\n DataService.getAllTrendingVideos(cid).then(\n response => {\n let videos = response.data;\n\n this.setState({\n videos: videos\n })\n }\n );\n }\n }", "title": "" } ]
[ { "docid": "0664b2d5af795c5ed1085dd7954c5365", "score": "0.6835451", "text": "function updateState() {\n //Do whatever you need with the data here\n }", "title": "" }, { "docid": "f99846d4a37a352721290b5057cc22fc", "score": "0.6712085", "text": "updateState () {\n }", "title": "" }, { "docid": "141ccc1d50ea73fdbbe84c650a43cebf", "score": "0.6693019", "text": "handleInput(name, value) {\n const state = this.state.user;\n state[name] = value;\n this.setState({...state, isChanged: true});\n }", "title": "" }, { "docid": "049c0b95ae079cfc1482df8bef6d9782", "score": "0.65830344", "text": "function updateState() {\n let oldState = statePkg.loadState()\n let displays = yabai.queryDisplays()\n let spaces = yabai.querySpaces()\n statePkg.saveState(oldState, displays, spaces)\n}", "title": "" }, { "docid": "a26fd9412d14a6a20101901119bba67a", "score": "0.65443105", "text": "function update() {\n if (!$state.started) {\n handleStart();\n }\n\n if (!$state.completed) {\n handleChange();\n }\n\n if (!$state.completed && lastValue($data.user)) {\n handleComplete();\n }\n }", "title": "" }, { "docid": "11a968bafee6991161a887db6b78465a", "score": "0.64783293", "text": "appliesToState() {}", "title": "" }, { "docid": "f27454d26d4e51bed8062f937908ff6c", "score": "0.6468533", "text": "function setState() {\n\t\tconsole.log('setting state');\n\t\tstateStr = arguments.length === 1 ? arguments[0] : arguments[1];\n\t\tJSProblemState = JSON.parse(stateStr);\n\t\t\n\t\t// Update the sighted variable from the state\n\t\tsighted = (JSProblemState.sighted == 'true');\n\t\t\n\t\t// Put the cards in the correct locations based on what the problem state says.\n\t\tsetUpSpace();\n\t\tputMatchesBack();\n\t\t\n\t}", "title": "" }, { "docid": "7cfea5976105d675f7b3a52e4983a7a0", "score": "0.646626", "text": "_updateState() {\n console.log('State should be changed');\n }", "title": "" }, { "docid": "24ad5276af177e1755db4d3d3c727f75", "score": "0.64565617", "text": "update () {\n // update current state\n let state = this.states[this.currentState];\n if (state && state.update) {\n state.update(this);\n }\n }", "title": "" }, { "docid": "fd7e6f84b85f4ed50231b703b328a97b", "score": "0.64544624", "text": "onInput() {\n this.resetGraph();\n var input = this.sliderRef;\n var currentVal = parseInt(input.current.value);\n if (currentVal == this.state.states.length - 1) {\n this.setState({\n play: false\n });\n }\n this.setState(\n {\n value: currentVal,\n pseudoMap: setUpPseudocodeMap(\n this.state.pageName,\n this.state.states[currentVal].status\n ),\n index: currentVal\n },\n () => {\n this.updateGraph();\n this.draw();\n }\n );\n }", "title": "" }, { "docid": "1c3de89f5fca681e0556723b2b8a2238", "score": "0.64446086", "text": "function changeState() {\t\t\t\t\t\t\t\t\n\t\t\n\t\tupdatePersonality(); \t//Adds the values of the tempStats to the userStats\t\t\t\t\t\t\t\t\t\t\n\t\t\n\t\tif (quizActive) {\t\n\t\t\t\n\t\t\t/*True while the user has not reached the end of the quiz */\n\t\t\t\n\t\t\tinitText(questionState);\t//sets up next question based on user's progress through quiz\n\t\t\tquestionState++;\t\t\t//advances progress through quiz\n\t\t\t\n\t\t\tbuttonElement.disabled = true; //disables button until user chooses next answer\n\t\t\tbuttonElement.innerHTML = \"Please select an answer\";\t\t\t\n\t\t\tbuttonElement.style.opacity = 0.7;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t/*All questions answered*/\n\t\t\t\n\t\t\tsetCustomPage(); //runs set up for result page\n\t\t}\n\t}", "title": "" }, { "docid": "7ea60699421182ac4f8f1e99078d3775", "score": "0.6416386", "text": "function setState() {\n // call loadState, which returns array\n var arr = loadState(),\n reqRate = loadReqRate();\n // bind\n vm.state = {\n investments: arr[0],\n newTickerType: \"Stock\",\n requiredRate: reqRate\n };\n }", "title": "" }, { "docid": "fc1b8fb3514aefe8392a0605d6180b79", "score": "0.64058787", "text": "function handleState(e) {\n\tcurrentState = e;\n\tvar po = e - 1;\n\tvar aux = states[po];\n\t$(\"#headModal\").html(\"State \" + e);\n\t$(\"#is\").val(aux.socratic);\n\t$(\"#ig\").val(aux.guidance);\n\t$(\"#idi\").val(aux.didactic);\n\t$(\"#cb1\").prop('checked', aux.exact);\n\t//$(\"#cb2\").prop('checked', aux.include);\n\t//$(\"#cb3\").prop('checked', aux.sbu);\n\t$(\"#cbState\").prop('checked', aux.fState);\n\t$(\"#cbFinal\").prop('checked', aux.end);\n\tLoadState(po);\n}", "title": "" }, { "docid": "d4dbf1432d519c0b341f3e16ab53b4cf", "score": "0.6384676", "text": "inputOnChange(e) {\n e.target.value = e.target.value;\n this.props.dispatch(updateStateText(e.target.value));\n }", "title": "" }, { "docid": "51a49e5df1f0677bbf019a48039f8aa3", "score": "0.6374359", "text": "userInput(selectedInput) {\n if (typeof (selectedInput) === 'number') {\n let lastAction = this.state.lastActionWasOperation;\n lastAction = false;\n this.setState({\n lastActionWasOperation: lastAction,\n lastInputOperation: null\n }, () => {\n this.updateEquation(selectedInput); \n })\n } else {\n if (this.state.lastInputOperation === null) {\n let currentOperation = this.state.lastInputOperation;\n currentOperation = selectedInput;\n\n this.setState({\n lastInputOperation: currentOperation\n }, () => {\n this.updateEquation(selectedInput);\n });\n } else {\n if (this.state.lastInputOperation === selectedInput) { \n // sets up future users \n return false;\n } else {\n let currentEquation = this.state.equation;\n currentEquation.pop();\n currentEquation.push(selectedInput);\n this.setState({\n equation: currentEquation\n })\n this.updateDisplay();\n }\n }\n }\n }", "title": "" }, { "docid": "351bcb2b844ac3331480d25871fe27eb", "score": "0.63729507", "text": "handleInput(key, e) {\n /*Duplicating and updating the state */\n\n let state = this.props.currentLoanApp; \n state[key] = e.target.value;\n this.setState({newLoanApp: state });\n }", "title": "" }, { "docid": "0348d4fda56dc9146eb6f968e5595042", "score": "0.6332073", "text": "function update_game(new_state) {\n console.log(\"New state\", new_state);\n state = new_state;\n if (callback) {\n callback(new_state);\n }\n}", "title": "" }, { "docid": "a769dd75689728c748ba3c42cafd0a79", "score": "0.6308264", "text": "function update_state() {\n\t\t\n\t\tvar currentStateAndStat = getStateFromVideoTime(currentVideo, getCurrentTime());\n\t\tvar currentState = currentStateAndStat[0];\n\t\tvar currentEvent = currentStateAndStat[1];\n\t\t\n\t\tif (oldState.id != currentState.id) {\n\t\t\tif (drawGameState) {\n\t\t\t\tvar currentGame = dataManager.game;\n\t\t\t\tif (currentEvent != undefined) {\n\t\t\t\t\tcurrentGame = dataManager.games[currentEvent.getGameId()];\n\t\t\t\t}\n\t\t\t\tplayer.drawStateTable(currentGame, currentState);\n\t\t\t} else if (currentEvent != undefined) {\n\t\t\t\tdataManager.currentGameState = currentState.id;\n\t\t\t\tdataManager.game = dataManager.games[currentEvent.getGameId()];\n\t\t\t\tdataManager.game.currentGameState = currentState.id;\n\t\t\t\tLiveViewManager.notifyNewData();\n\t\t\t}\n\t\t}\n\t\n\t\toldState = currentState;\n\t}", "title": "" }, { "docid": "be8dd236526cef87023016214c01cd77", "score": "0.6301481", "text": "function update() {\n var generalState = 'valid';\n for (var key in info) {\n var infoState = info[key].state;\n if ((infoState === 'edit' || infoState === 'loading') && generalState !=='error') {\n generalState = 'edit';\n }\n if (infoState === 'invalid' && generalState === 'valid') {\n generalState = 'invalid';\n }\n if (infoState === 'error') {\n generalState = 'error';\n break;\n }\n }\n notifyListeners(generalState);\n }", "title": "" }, { "docid": "f6dcc54eb3d8f577637ebec8a8cf8f4d", "score": "0.62620777", "text": "updateInput(value) {\n this.setState({\n userInput: value,\n });\n }", "title": "" }, { "docid": "5e8b6387bc4d27e42ecf3132d8d1372a", "score": "0.6242617", "text": "function onchange (action, state, oldState) {\n yo.update(document.getElementById('app'), render(state))\n}", "title": "" }, { "docid": "bb705da349f2829c17e777350766a504", "score": "0.6213129", "text": "changeState(state) {\r\n //state is correct\r\n if(this.getStates().reduce((acum, item) => item == state ? acum += 1 : acum += 0, 0)) {\r\n this.state = state;\r\n this.storage.pushing(state);\r\n //save only last state\r\n this.storageReset.clearStorage();\r\n this.storageReset.pushing(state);\r\n }\r\n else {\r\n throw Error(\"Not correct state!\");\r\n }\r\n\r\n }", "title": "" }, { "docid": "2eb0de64ce3323f49a8463e5407dcdd2", "score": "0.6202454", "text": "_onChange() {\n this._updateState();\n }", "title": "" }, { "docid": "2eb0de64ce3323f49a8463e5407dcdd2", "score": "0.6202454", "text": "_onChange() {\n this._updateState();\n }", "title": "" }, { "docid": "fd95f29ababa2790e16bd66992111871", "score": "0.6194757", "text": "updateValue() {\n let newState = !this.state.value;\n this.setState({value: newState});\n this.props.input.onChange(newState);\n }", "title": "" }, { "docid": "1718d2435e5d319197dd86c6380cbe17", "score": "0.6174545", "text": "handleInputChange(field, event) {\n const newState = Object.assign({}, this.state);\n if (field == \"permission\" && event.target.value == \"unprivileged\") {\n newState[field] = \"noob\";\n } else {\n newState[field] = event.target.value;\n }\n this.setState(newState);\n }", "title": "" }, { "docid": "419ec799b1e6dbf4522564c5d3110f54", "score": "0.616187", "text": "handleInputChange(input) {\n this.setState({\n phrase : \"Sentiment for \" + input\n })\n }", "title": "" }, { "docid": "5ab54ea53ecd977deafc625760c1376b", "score": "0.6160106", "text": "update(t) {\n this.state.update(t)\n }", "title": "" }, { "docid": "dde0a3008b19b64bd2349927ee0aee93", "score": "0.6156797", "text": "function App(){\n\n const [state, setState] = useState({ //takeaway\n city: '',\n country: ''\n })\n\n let handleCity = (e) => { //takeaway\n setState({\n ...state, city: e.target.value //takeaway\n })\n }\n function handleCountry(e){\n setState({\n ...state, country: e.target.value\n })\n }\n\n return(\n <div className=\"mt-2 text-center\"> \n <form>\n <div>\n <input \n className=\"d-block mx-auto m-2\"\n placeholder=\"Enter your City\"\n type=\"text\"\n type=\"text\" value={state.city} //Set the value attribute to the state //takeaway\n //The value property sets or returns the value of the value attribute of a text field.\n onChange={handleCity} //takeaway\n />\n <input \n placeholder=\"Enter your State\"\n type=\"text\" value={state.country} //Set the value attribute to the state\n onChange={handleCountry} \n />\n </div>\n </form>\n <h2>You live in {state.city}, {state.country}</h2>\n \n </div>\n )\n\n}", "title": "" }, { "docid": "0f229f6dff7b06f531cc3547715c1edd", "score": "0.6145026", "text": "updateAnswer(e) {\n console.log(e.target.value)\n let updateResults = this.state.results\n updateResults[this.state.currentStage][e.target.name] = e.target.value\n this.setState({results: updateResults})\n }", "title": "" }, { "docid": "1f973dc07a9c02f4c77bc4e2f9c9a88e", "score": "0.6136502", "text": "handleInputChange(event) {\n let newState = {};\n newState[event.target.id] = event.target.value;\n this.setState(newState);\n }", "title": "" }, { "docid": "b532da2d9b7864b80d76ebba35530d76", "score": "0.6129974", "text": "function setNewState() {\n state.counter = 0;\n $(\"#total-score\").text(0);\n state.newNumberOptions = [];\n state.targetNumber = Math.floor(Math.random() * (180-19)) + 20;\n console.log(\"state: \", state, state.targetNumber, state.newNumberOptions);\n $(\"#number-to-guess\").text(state.targetNumber);\n}", "title": "" }, { "docid": "3b1c167b5795e708357b6ea2febda878", "score": "0.6129019", "text": "onInputChange(event) {\n\t\t//set the state value to the input changes.\n\t\tthis.setState({ term:event.target.value });\n\t}", "title": "" }, { "docid": "7aab680bb6ff92a487b73d8ebfdd1462", "score": "0.61218673", "text": "function changeState(name, value) {\n\t\tstate[name].value = value;\n\t}", "title": "" }, { "docid": "36ad3b98277becd9939180d168fb0fee", "score": "0.6120042", "text": "onInputChange(event) {\n //console.log(event.target.value);\n\n //Update Component state with the event.target.value\n //This will set the state to the input values entered by user\n this.setState({term: event.target.value})\n }", "title": "" }, { "docid": "06a8486557f7941d3e7c706d81ac5a2d", "score": "0.6117947", "text": "onSubmit(state) {\n this.status = 'answered';\n var choice = this.opt.choices.where({ value: state.value })[0];\n this.answer = choice.short || choice.name;\n\n // Re-render prompt\n this.render();\n this.screen.done();\n this.done(state.value);\n }", "title": "" }, { "docid": "06a8486557f7941d3e7c706d81ac5a2d", "score": "0.6117947", "text": "onSubmit(state) {\n this.status = 'answered';\n var choice = this.opt.choices.where({ value: state.value })[0];\n this.answer = choice.short || choice.name;\n\n // Re-render prompt\n this.render();\n this.screen.done();\n this.done(state.value);\n }", "title": "" }, { "docid": "8620c95d71ccaca15f25fec11e6e2747", "score": "0.6103888", "text": "handelChange(val) {\n this.setState({ userInput: val });\n }", "title": "" }, { "docid": "9bb0082f66d33474a85318719feddf74", "score": "0.61000925", "text": "function handleState() {\n\tif( gameState == states.INITIAL )\n\t\tgameState = states.STARTED;\n\telse if( gameState == states.GAMEOVER || gameState == states.GAMEWIN ) {\n\t\tsetInitial();\n\t\tgameState = states.STARTED;\n\t}\n}", "title": "" }, { "docid": "55bfaf8e77b37d04848c33cf096e6592", "score": "0.6089451", "text": "handleInput(event) {\n this.checkAccuracy(event.target.value);\n this.wordCount(event.target.value);\n let newState = this.state;\n newState.typedValue = event.target.value;\n newState.typedValue.length === newState.challenge.length ||\n this.state.timeLeft === 0\n ? (newState.displayForm = false)\n : (newState.displayForm = true);\n if (this.state.timeLeft > 59) {\n this.handleTime();\n }\n this.setState(newState);\n }", "title": "" }, { "docid": "22f1be44204e4705565e0e11c54fd413", "score": "0.6075632", "text": "update() {\n this.setState({\n numberOfGuests: this.props.model.getNumberOfGuests(),\n fullMenu: this.props.model.returnMenu()\n\n });\n }", "title": "" }, { "docid": "fd9b4f648d3db9f0eaa886b52ab53d7e", "score": "0.6074668", "text": "function updateSelectedState(state) {\n \tif (state) {\n\t\t state = state.split(' ').join('-');\n\t }\n statesBarVis.updateState(state);\n \tstatesMapVis.updateSelectedStateInMap(state);\n \tstateLineChartVis.updateSelectedStateInLineChart(state);\n }", "title": "" }, { "docid": "02e8efd8ac4725516420fa93907745c5", "score": "0.6069489", "text": "function handleInputChange(text) {\n // setName(text);\n // setState(text);\n setState({\n name: text,\n })\n }", "title": "" }, { "docid": "209fec38c5eb8e0172b77fb477ef8fc5", "score": "0.60658634", "text": "handleInputChange(event){\n this.setState({currentInput:event.target.value,load:false});\n }", "title": "" }, { "docid": "da96cefd9026b462f8bfb92e956f171e", "score": "0.60395896", "text": "handleInput(event){\n this.setState({status: event.target.value});\n }", "title": "" }, { "docid": "2d35d492a2bd1156972d742498ddb034", "score": "0.6036799", "text": "updateState(tile){\n\t\tthis.currentState = this.getState(tile)\n\t}", "title": "" }, { "docid": "74890b6d531799ea19c2281921657c1d", "score": "0.6036585", "text": "change_state(new_state) {\n this.current_state = new_state;\n }", "title": "" }, { "docid": "d84cb9378bbd55d063f691cff95a178c", "score": "0.6033327", "text": "changeValue() {\n this.props.onChange(\n this.props.name,\n this.state,\n this.validate(this.state.active, this.state.length)\n );\n }", "title": "" }, { "docid": "fe0b8e05ab6132d76a6ea0968d4d9fcc", "score": "0.60256326", "text": "function setState(newState) {\n if (newState.items) state.items = newState.items;\n if (newState.addItemInput) state.addItemInput = newState.addItemInput;\n if (newState.listNameInput) state.listNameInput = newState.listNameInput;\n if (newState.listName) state.listName = newState.listName;\n if (newState.importListInput) state.importListInput = newState.importListInput\n rerender();\n}", "title": "" }, { "docid": "278ca9dcba6b185bd111927393305c24", "score": "0.60192627", "text": "handleInputChange(value) {\n const dispatchPromise = () =>\n new Promise((resolve, reject) => {\n this.props.dispatch(updateGoal(value));\n resolve();\n });\n\n dispatchPromise().then(() => {\n fetch(`${API_BASE_URL}/list-state/${this.props.fullState.listName}`, {\n method: \"put\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify(this.props.fullState)\n });\n });\n this.props.dispatch(updateGoal(value));\n }", "title": "" }, { "docid": "1a6ddf1c7a7be3ccf01f0bf4d087960c", "score": "0.60133356", "text": "function setState(state) {\r\n\t\t\tif (_state != state) {\r\n\t\t\t\t_state = state;\r\n\t\t\t\tif (state == STATE.DEFAULT) {\r\n\t\t\t\t\t_mainMenu.visible = true;\r\n\t\t\t\t\t_hud.visible = false;\r\n\t\t\t\t\t_keyboard.visible = false;\r\n\t\t\t\t\tfor (var i = 0; i < _enemies.length; i++) {\r\n\t\t\t\t\t\t_enemies[i].visible = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfor (var i = 0; i < _bullets.length; i++) {\r\n\t\t\t\t\t\t_bullets[i].visible = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t_gameover.visible = false;\r\n\t\t\t\t} else if (state == STATE.GAMEPLAY) {\r\n\t\t\t\t\t_keyBuffer = [];\r\n\t\t\t\t\t_level = 1;\r\n\t\t\t\t\t_score = 0;\r\n\t\t\t\t\tgenerateLevel();\r\n\r\n\t\t\t\t\t_mainMenu.visible = false;\r\n\t\t\t\t\t_hud.visible = true;\r\n\t\t\t\t\t_keyboard.visible = true;\r\n\r\n\t\t\t\t\tsetPaused(false);\r\n\t\t\t\t\t_gameover.setScore(0);\r\n\t\t\t\t} else if (state == STATE.END) {\r\n\t\t\t\t\t_gameover.setScore(_score);\r\n\t\t\t\t\t_gameover.visible = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "97aa704ed7698084d03c52b0defa06fb", "score": "0.60079706", "text": "updateInput (newVal) {\n this.setState(() => {\n return {\n input: newVal\n };\n });\n this.selectionUpdate(0);\n }", "title": "" }, { "docid": "d66c6dec719b80cee9676a170ea2eb53", "score": "0.6001529", "text": "function recalculateInput(state) {\n\n\n const value = state.input[state.activeInput];\n const activeCurrency = state.currency[state.activeInput]\n\n const secondIndex = Math.abs(state.activeInput - 1);\n const secondCurrency = state.currency[secondIndex];\n\n const rate = getRate(activeCurrency, secondCurrency, state.usdRates);\n\n const result = value * rate;\n state.input[secondIndex] = parseFloat(result.toFixed(2));\n\n}", "title": "" }, { "docid": "7539ddb4dd416d50d435f80bd0704868", "score": "0.59967005", "text": "updateState(nextLang) {\n // go to the next language\n this.state.selectedLang = nextLang;\n\n // update the language\n this.state.text = this.state.langs[this.state.selectedLang];\n\n this.fetchData();\n }", "title": "" }, { "docid": "431635b7cdbe948e9fb1708d6c1a7c1e", "score": "0.5993253", "text": "function changeState(){\n let selected_state = document.getElementById('selectState').value;\n\n switch(selected_state){\n case '0':\n buildTable(buildNewArray(data, '0'), \"dataTable\");\n current_state = \"Success\";\n break;\n case '1':\n buildTable(buildNewArray(data, '1'), \"dataTable\");\n current_state = \"Warning\";\n break;\n case '2':\n buildTable(buildNewArray(data, '2'), \"dataTable\");\n current_state = \"Danger\";\n break;\n case '3':\n buildTable(buildNewArray(data, '3'), \"dataTable\");\n current_state = \"Error\";\n break;\n default:\n buildTable(data, \"dataTable\");\n current_state = \"Regular\";\n }\n}", "title": "" }, { "docid": "e813070e12fcbc8e59858c3937bae963", "score": "0.5990902", "text": "function changeState(newState) {\n if (newState == null) {\n currentState++;\n if (currentState > state.END) {\n currentState == state.PAY;\n }\n }\n else {\n currentState = newState;\n }\n switch (currentState) {\n case state.PAY:\n reset();\n texts[text.CHOOSE_TEXT].draw = true;\n texts[text.WIN_NUMS].draw = false;\n texts[text.WIN_TEXT].draw = false;\n for (let i = 0; i < 3; i++) {\n if (playerMoney >= betAmounts[i]) {\n textButtons[i].draw = true;\n }\n }\n textButtons[button.TRY_AGAIN].draw = false;\n break;\n case state.SELECTION:\n playerMoney -= currentBet;\n texts[text.PLAYER_MONEY].text = \"Your money: \" + playerMoney;\n texts[text.PLAYER_BET].text = \"Your bet: \" + currentBet;\n\n texts[text.CHOOSE_TEXT].draw = false;\n texts[text.PICK_TEXT].draw = true;\n for (let i = 0; i < 3; i++) {\n textButtons[i].draw = false;\n }\n for (let i = 3; i < 6; i++) {\n textButtons[i].draw = true;\n }\n if (debug) {\n for (let i = 7; i < 11; i++) {\n textButtons[i].draw = true;\n }\n }\n break;\n case state.ROLLING:\n for (let i = 3; i < 6; i++) {\n textButtons[i].draw = false;\n }\n if (debug) {\n for (let i = 7; i < 11; i++) {\n textButtons[i].draw = false;\n }\n }\n texts[text.PICK_TEXT].draw = false;\n texts[text.WIN_NUMS].draw = true;\n texts[text.WIN_NUMS].text = \"And the winning numbers are... <br> <br> \";\n break;\n case state.END:\n texts[text.WIN_TEXT].draw = true;\n if (numOfMatches <= 2) {\n texts[text.WIN_TEXT].text = \"You matched \" + numOfMatches + \" ball\";\n if (numOfMatches != 1) {\n texts[text.WIN_TEXT].text = texts[text.WIN_TEXT].text + \"s\";\n }\n texts[text.WIN_TEXT].text = texts[text.WIN_TEXT].text + \" unfortunately. <br> Select Play again to try again!\";\n }\n else {\n texts[text.WIN_TEXT].text = \"You matched \" + numOfMatches + \" balls! <br> You win \" + (currentBet * winningsAmount[numOfMatches]) + \"! <br> Congratulations!\";\n playerMoney += currentBet * winningsAmount[numOfMatches];\n texts[text.PLAYER_MONEY].text = \"Your money: \" + playerMoney;\n }\n if (playerMoney <= 0) {\n texts[text.WIN_TEXT].text = texts[text.WIN_TEXT].text + \" <br> You have ran out of money. <br> Please refresh the browser to play again!\";\n }\n else {\n textButtons[button.TRY_AGAIN].draw = true;\n }\n break;\n default:\n //Shouldn't reach this state\n }\n}", "title": "" }, { "docid": "6f3bb2b8ff9bd0b9a8af075c802bf636", "score": "0.598297", "text": "updateScores() {\n if(this.state.isPressed) {\n if (this.state.inputValue !== \"\") {\n if (this.state.outsValue === this.state.inputValue) {\n this.showPopUp(\"Correct!\", \"Continue\", \"Quit\");\n $(\"#input-box\").attr(\"disabled\", \"true\");\n this.setState({currentScore: this.state.currentScore + 10});\n if (this.state.currentScore >= this.state.highScore) {\n this.setState({highScore: this.state.highScore + 10});\n }\n this.setState({borderColor: \"#0f0\"});\n }\n else {\n this.decrementLives();\n this.showPopUp(\"Incorrect. The correct answer is \" + this.state.rightAnswerInfo.toString(), \"Continue\", \"Quit\");\n $(\"#input-box\").attr(\"disabled\", \"true\");\n if (!this.stillLives()) {\n this.showPopUp(\"Incorrect. The correct answer is \" + this.state.rightAnswerInfo.toString()+\" You lost! Do you want to try again?\", \"Yes\", \"No\");\n }\n this.setState({borderColor: \"#f00\"});\n }\n }\n }\n }", "title": "" }, { "docid": "a5b72176062e6c121267528d7a4ef478", "score": "0.5982181", "text": "_handleInputChange (key) {\n let updateObject = {};\n updateObject[key] = event.target.value;\n this.setState({\n settings: updateObject\n });\n }", "title": "" }, { "docid": "3aa6dd103ba4b677f186310325aba097", "score": "0.597909", "text": "update() {\n this.setState({\n numberOfGuests: this.props.model.getNumberOfGuests(),\n menu: this.props.model.getFullMenu()\n });\n }", "title": "" }, { "docid": "e2884e76db404d2e9616e06251ce8119", "score": "0.5964118", "text": "updateView(event, name) {\n console.log(\"UPDATE\", name, event.target.value);\n switch (name) {\n case \"color-switch\":\n rdx.setState((prevState) => ({\n controls: { ...prevState.controls, isColor: event.target.checked },\n }));\n break;\n case \"ascii-width\":\n rdx.setState((prevState) => ({\n controls: { ...prevState.controls, asciiWidth: event.target.value },\n }));\n break;\n case \"ascii-height\":\n rdx.setState((prevState) => ({\n controls: { ...prevState.controls, asciiHeight: event.target.value },\n }));\n break;\n case \"refresh-rate\":\n rdx.setRefresh(event);\n break;\n case \"console-color\":\n rdx.setState((prevState) => ({\n controls: { ...prevState.controls, consoleColor: event.target.value },\n }));\n break;\n default:\n return true;\n }\n }", "title": "" }, { "docid": "75f2a5178d12f7a1d83b501b934294d4", "score": "0.5960754", "text": "stateUpdater(e) {\n this.setState({ [e.target.name]: e.target.value });\n }", "title": "" }, { "docid": "41ee2b24615cf726c81e7a2202016b09", "score": "0.59604764", "text": "update() {\n this.setState({\n numberOfGuests: modelInstance.getNumberOfGuests(),\n fullMenu: modelInstance.getFullMenu()\n });\n }", "title": "" }, { "docid": "20f094b836a76ba6ed700de0d7ee5eb8", "score": "0.59504807", "text": "update(state) {\n this.render(state);\n }", "title": "" }, { "docid": "863e1f0a9cd338dfa363fafe41c18a91", "score": "0.5950235", "text": "update(state) {\n this.previous = this.current;\n this.current = state;\n }", "title": "" }, { "docid": "e761921894e7e8a5e46879881bf2500d", "score": "0.59491605", "text": "handleInputChange(event) {\r\n const target = event.target;\r\n const value = target.value;\r\n const name = snakeCase(target.name);\r\n\r\n if (this.state.edited === false) this.setState({edited: true})\r\n\r\n this.setState({\r\n [name]: value\r\n });\r\n }", "title": "" }, { "docid": "99465f9720da8fb2dcad0d2381130e8a", "score": "0.59454656", "text": "_onChange(){\n\t\tconsole.log('Setting state with new soundPath state..');\n\t\t// set state with new data from the store...\n\t\t// this.setState(getSoundPathsState());\n\t}", "title": "" }, { "docid": "ff792df73071a70342fd1b50448e8ef1", "score": "0.59433246", "text": "async handleInput(event) {\n let change = {}\n change[event.target.name] = event.target.value\n await this.setState(change)\n this.checkSuccess()\n }", "title": "" }, { "docid": "eeb590d215e0ac1b61f4d38b895a3487", "score": "0.59416425", "text": "handleInputChange(event) {\n const target = event.target;\n const value = target.type === 'checkbox' ? target.checked : target.value;\n const name = target.name;\n\n /*if the any value is change than the particular state has been change*/\n this.setState({\n [name]: value\n });\n }", "title": "" }, { "docid": "81c7a5a8c1bd73dbbd5ce326d343ecdf", "score": "0.5939296", "text": "updateState(ev) {\n ev.preventDefault()\n const value = this.input.value\n this.setState({\n query: value,\n })\n this.handleSearch(value)\n }", "title": "" }, { "docid": "efb1f9d9200ef50b3915a0bfab4ce41e", "score": "0.5938521", "text": "updateState(e, val) {\n val === undefined ? val = e.target.value : val; // catch location input field value since it behaves differently\n let key = e.target.name;\n // you must use a function to set state if the key is a variable\n let stateObj = function() {\n var obj = {};\n obj[key] = val;\n return obj;\n }.bind(e)();\n\n this.setState( stateObj );\n }", "title": "" }, { "docid": "9146732ea71526dbf86e17e80b780228", "score": "0.5935769", "text": "update_with(player_state) {\n this.mistypes = player_state.mistypes || this.mistypes;\n this.line_no = player_state.line_no || this.line_no;\n this.current_line = player_state.current_line || this.current_line;\n }", "title": "" }, { "docid": "6b71e499db653a1a366e948eee7a910b", "score": "0.59355664", "text": "function updateState(e){\n e.preventDefault();\n let start = e.target.startDate.value;\n let end = e.target.endDate.value;\n let invest = e.target.invest.value;\n let interval = e.target.interval.value;\n\n setForm({start:start, end:end, invest:invest , interval:interval})\n \n getAPIData(start, end, interval, invest)\n .then(dataObj => {\n // updateData({date:dataObj.date, price:dataObj.price, shares:dataObj.shares, investment:dataObj.investment, principal:dataObj.principal});\n \n let newData = calculateTotals(dataObj);\n\n // console.log('my newData', newData)\n \n updateData({costBasis:newData.costBasis, gain:newData.gain, percentageGain:newData.percentageGain, totalPrincipal:newData.totalPrincipal});\n\n // console.log('this is my state of data', data);\n updateShow(true);\n \n })\n\n\n }", "title": "" }, { "docid": "7ae43812ea4a0a7fa46a7960725e62cc", "score": "0.59342414", "text": "changeState(state) {\r\n if (!(state in this.states)) {\r\n throw new SyntaxError(\"The state is missing!\");\r\n } else {\r\n this.initial.length = this.head + 1; //Cut all states after head.\r\n this.initial.push(state);\r\n this.head++;\r\n }\r\n\r\n }", "title": "" }, { "docid": "312926e2da5b04502704fe8ec9bc01c8", "score": "0.5933146", "text": "handleChange (input, e) {\n var change = {};\n change[input] = e.target.value;\n this.setState(change);\n }", "title": "" }, { "docid": "3d273af0d2ee87eb36b4392430e5eee1", "score": "0.59328914", "text": "handelMath(input) {\n if (this.state.firstEntry) {\n // This only moves the input to state.sum\n this.setState({\n sum: this.state.input,\n math: input,\n firstEntry: false,\n });\n } else {\n switch(input) {\n case \"+\":\n this.setState({\n input: Addition(this.state.sum, this.state.input).toString(),\n sum: Addition(this.state.sum, this.state.input),\n math: \"+\",\n });\n break;\n case \"-\":\n this.setState({\n input: Subtract(this.state.sum, this.state.input).toString(),\n sum: Subtract(this.state.sum, this.state.input),\n math: \"-\"\n });\n break;\n case \"*\":\n this.setState({\n input: Multiply(this.state.sum, this.state.input).toString(),\n sum: Multiply(this.state.sum, this.state.input),\n math: \"*\"\n });\n break;\n case \"/\":\n this.setState({\n input: Divide(this.state.sum, this.state.input).toString(),\n sum: Divide(this.state.sum, this.state.input),\n math: \"/\"\n });\n break;\n case \"^\":\n this.setState({\n input: expo(this.state.sum, this.state.input).toString(),\n sum: expo(this.state.sum, this.state.input),\n math: \"^\"\n });\n break;\n default:\n break;\n }\n }\n }", "title": "" }, { "docid": "ae8062acc89cafb577b927aae86eebf0", "score": "0.5932518", "text": "function updateState(){\n initialBuffer = new Buffer([new Segment(editor.userId, editor.currentContent)]);\n editor.state = new State(initialBuffer, new Vector())\n}", "title": "" }, { "docid": "47811874ff8a6489b817554d995ad52f", "score": "0.591881", "text": "handelMathSwitch(latestInput) {\n if (typeof latestInput !== \"number\" && this.state.math !== latestInput) {\n this.setState({\n math: latestInput,\n }); \n } else {\n this.handelMath(this.state.math);\n this.setState({\n firstEntry: false,\n math: latestInput,\n resetNext: true\n });\n }\n }", "title": "" }, { "docid": "a24afed0e188247e5fc042373df37895", "score": "0.59170306", "text": "function incrementState() {\n state++;\n renderState();\n}", "title": "" }, { "docid": "b4a6af9fa4096956250623d6a62ee1c5", "score": "0.5911632", "text": "result(char) {\n const { score } = this.state;\n var { open, title, content, exit } = this.state;\n var update_score;\n open = true;\n exit = false;\n title = \"Result\";\n //the user wons if X\n if (char === \"X\") {\n content = \"Hurray! You WON\";\n update_score = score + 1;\n } else {\n content = \"You LOST\";\n update_score = score;\n }\n const stateUpdate = {\n open: open,\n exit: exit,\n title: title,\n content: content,\n count: 9,\n score: update_score\n };\n this.props.setScore(update_score);\n //to reset\n this.reset(stateUpdate);\n }", "title": "" }, { "docid": "ac4a87f76b612969e0fe5e336cd31abb", "score": "0.59062546", "text": "function updateState(el, val) {\n if(val < maxDifficulty){\n for (var j = 0; j < sliderStates.length; j++) {if (window.CP.shouldStopExecution(0)) break;\n if (_.contains(sliderStates[j].range, parseInt(val))) {\n currentState = sliderStates[j];\n // updateSlider();\n }\n }\n } else {\n currentState = sliderStates[2]; // if max difficulty, set to high difficulty\n }\n\n // Update handle color\n $handle.\n removeClass(function (index, css) {\n return (css.match(/(^|\\s)js-\\S+/g) || []).join(' ');\n }).\n addClass(\"js-\" + currentState.name);\n // Update tooltip\n $tooltip.html(currentState.tooltip);\n}", "title": "" }, { "docid": "b7c45d307ad7a6c312bbd3463833c1a8", "score": "0.5896998", "text": "onSubmit () {\n let {inputValue} = this.state\n let {onUpdate} = this.props\n this.updateInput('')\n onUpdate(inputValue)\n }", "title": "" }, { "docid": "0905210e69a9cc4ba57aada98ffb1b59", "score": "0.58892274", "text": "changeInput(nameInput) {\n this.setState({ nameInput });\n }", "title": "" }, { "docid": "2a9fc587a3e154096c4bc7a15c3dee66", "score": "0.58882684", "text": "changeState(state) {\r\n if(state !== 'normal' && state !== 'hungry' && state !== 'busy' && state !=='sleeping')\r\n throw new eer('Error');\r\n else\r\n {this.change = this.getSt;\r\n this.addstatetr.push(this.getSt);\r\n this.getSt = state;} //this.addstatetr.push(state); \r\n }", "title": "" }, { "docid": "9be3d2dc7920f38e605fe58165cfb790", "score": "0.5885383", "text": "function UIState() {}", "title": "" }, { "docid": "a3aed044a986d26313fe646042264b7b", "score": "0.5885144", "text": "updateState (previousState, newOutput, newSource)\n {\n // console.log( \"output:\" + previousState.output + \" \" + newOutput + \" \" + (previousState.output == newOutput) )\n // console.log( \"source:\" + previousState.source + \" \" + newSource + \" \" + (previousState.source == newSource) )\n if( previousState.output == newOutput && previousState.source == newSource )\n return;\n \n this.setState( { \n output: newOutput,\n source: newSource\n });\n }", "title": "" }, { "docid": "e996ab398c87194946438b2fe385460b", "score": "0.58835113", "text": "_handleInput(inputType, e) {\n let newState = Object.assign({}, this.state.values);\n newState[inputType] = e.target.value;\n this.setState({values: newState});\n }", "title": "" }, { "docid": "23202c5af419a685dd7cf89d8702d682", "score": "0.5882918", "text": "update(e) {\n // setState() is part of ReactComponent API\n this.setState({txt: e.target.value})\n }", "title": "" }, { "docid": "d5fd3c5951d9f6873fd85395a7d1826f", "score": "0.58801395", "text": "updateGame(e, state, mark){\n this.setState({\n nextTurnIs: state,\n mark: state ? 'O' : 'X' \n })\n }", "title": "" }, { "docid": "024ca2c98962adda67b33afffef2ed51", "score": "0.5878234", "text": "changeState(state) {\r\n this._config.states.hasOwnProperty(state) ? \r\n this._state = state : (throwError (`The state ${state} isn't exist`));\r\n \r\n \r\n }", "title": "" }, { "docid": "64788195b53c3dfeaf3567aeed126079", "score": "0.58762115", "text": "changeState(state) {\r\n var exception = 0;\r\n for (var keys in this.states) {\r\n if (keys == state){\r\n this.current = state;\r\n\t\t\t\tthis.history[this.historyCounter + 1] = state;\r\n this.historyCounter++;\r\n exception = 1;\r\n break;\r\n }\r\n }\r\n if (exception == 0){\r\n throw new exception(\"An exception occurs: Incorrent input data\");\r\n }\r\n }", "title": "" }, { "docid": "50bef6727e445a5e47a810ab605d307b", "score": "0.5871255", "text": "updateState() {\n this.setState(MainStore.getComputedState());\n }", "title": "" }, { "docid": "3dc1bb9d3ae0fb3c95bd7ccecc9a7d09", "score": "0.58666056", "text": "changeState(state) {\r\n if(!this.states.hasOwnProperty(state)) {\r\n return Err;\r\n }\r\n this.currentState = state;\r\n this.history = [...this.history,state];\r\n this.count += 1;\r\n }", "title": "" }, { "docid": "9e53df1d2c3d9535903a78d96fd6ee51", "score": "0.5858591", "text": "changeHandler(event) {\n let updateQuery = event.target.value;\n this.setState({\n query: updateQuery\n });\n }", "title": "" }, { "docid": "0086284ab991ec6370b6067e5da0f6d2", "score": "0.58571965", "text": "handleChange(e){\n\t let text = e.target.value;\n\t let piggy = translatePigLatin(this.state.input);\n \t this.setState({input:text, pig: piggy});\n }", "title": "" }, { "docid": "88fd36025945bf687a41692849a5eeb1", "score": "0.58544827", "text": "handleClick(event) {\n const value = event.target.value;// get the value from the target element (button)\n switch (value) {\n case '=': { //if it's an equal sign use the eval module to evaluate\n //converst the answer (in number) to String\n const answer = eval(this.state.question).toString();\n //update answer in our state\n this.setState({answer});\n break;\n }\n case 'C': {\n //if its the C sign, just clean out our question and anser in the state\n this.setState({ question: '', answer: ''});\n break;\n }\n default: {\n //for every other command, update the answer in the state\n this.setState({ question: this.state.question += value})\n break;\n }\n }\n }", "title": "" }, { "docid": "8f4a42871ebf0e95c7fd659e723e1895", "score": "0.5852332", "text": "handleInputChange(event) {\n const target = event.target;\n const value = target.value;\n const name = target.name;\n\n this.setState({\n [name]: value\n });\n if (name==\"data\") {document.getElementById(\"data\").value = this.state.data;}\n }", "title": "" }, { "docid": "5cde8c8367f0f439d0b86cccbb4802c0", "score": "0.5852126", "text": "function toState(newState) {\r\n const trans = `${state} -> ${newState}`;\r\n // console.warn(trans);\r\n if (newState === \"playing\") {\r\n if (state === \"paused\") {\r\n // paused -> playing\r\n fg.alpha = 1;\r\n } else if (state === \"title\" || state === \"gameOver\") {\r\n // title -> playing or gameOver -> playing\r\n scoresT.visible = false;\r\n music.title.stop();\r\n music.gameOver.stop();\r\n music.transition.stop();\r\n time = 0;\r\n coins = 0;\r\n vy = 0;\r\n fuel = INITIAL_FUEL;\r\n ship.position.x = 0;\r\n ship.position.y = INITIAL_SHIP_Y;\r\n fg.pivot.x = -W / 2;\r\n fg.pivot.y = -H / 2;\r\n titleT.visible = false;\r\n levelName = nextLevelName;\r\n loadLevel(levelName);\r\n } else {\r\n throw trans;\r\n }\r\n music.main.play();\r\n app.ticker.start();\r\n state = newState;\r\n renderFn = playingRender;\r\n } else if (newState === \"paused\") {\r\n countT.text = \"paused\";\r\n fg.alpha = 0.5;\r\n music.main.stop();\r\n state = newState;\r\n renderFn = pausedRender;\r\n } else if (newState === \"gameOver\") {\r\n const score = { c: coins, t: ~~time, f: fuel };\r\n saveScore(levelName, score);\r\n scoresT.text = \"HIGH SCORES:\\n\" + getScores(levelName);\r\n scoresT.visible = true;\r\n\r\n const obs = getHitObstacle();\r\n const madeIt = obs && obs._data && obs._data.k === \"end\";\r\n\r\n if (madeIt) {\r\n nextLevelName = window.levelMap[window.levelMap.indexOf(levelName) + 1];\r\n if (!nextLevelName) {\r\n nextLevelName = window.levelMap[0];\r\n }\r\n }\r\n\r\n countT.text = madeIt ? \"won!\" : \"game over!\";\r\n music.main.stop();\r\n\r\n if (madeIt) {\r\n sfx.win.play();\r\n music.transition.play();\r\n } else {\r\n sfx.crash.play();\r\n music.gameOver.play();\r\n }\r\n state = newState;\r\n renderFn = gameOverRender;\r\n }\r\n }", "title": "" }, { "docid": "ef338c37f6c4511340395c6c9d43998d", "score": "0.58519894", "text": "handleInput(type) {\n return (e) => { //return an arrow function that will set the state for me\n this.setState({ [type]: e.target.value }); //pass in JS object, and any keys matching our state, will get updated \n // e is the event object from the event handler\n //in order to make type the key value, i'll wrap in square ^ brackets, means the type will be evaluated before it gets assigned to the key\n };\n }", "title": "" }, { "docid": "369b081c73e6d56bbf0cdb4fd8182f01", "score": "0.58460563", "text": "changeState(){\n this.state = this.stateIterator.next().value;\n }", "title": "" }, { "docid": "6561861576862cf41c3a8a54dad53561", "score": "0.5844318", "text": "updateState(event) {\n this.setState({ nameInput: event.target.value });\n }", "title": "" }, { "docid": "647a2efa1dc09ef54cf46f82ca25c781", "score": "0.58401126", "text": "changeState(state) {\r\n if(this.config.states[state] !== undefined) {\r\n this.activeState = state;\r\n this.statesArray.push(this.activeState);\r\n this.undoState = false;\r\n } else throw new SyntaxError(Error);\r\n }", "title": "" } ]
17136c38b30b5c185717e31d7c39ebca
NoOp function used in method replacement
[ { "docid": "389e3415311ad14c7322a109b6882688", "score": "0.0", "text": "function noop() { }", "title": "" } ]
[ { "docid": "1ce209b2dd41dde3890338f510214ba7", "score": "0.78461725", "text": "function noOp () { }", "title": "" }, { "docid": "9dc819457efeda7f43f4acf84963dbe8", "score": "0.77861357", "text": "function noOp() {}", "title": "" }, { "docid": "d248db6c9a933f9c772938cc3391e5e4", "score": "0.7753824", "text": "function _no_op () { }", "title": "" }, { "docid": "b758d97934c5bc2ceccf8adfb06354c1", "score": "0.77367926", "text": "function noOp(){}", "title": "" }, { "docid": "9c7a318538c988cc3c996e65f460e432", "score": "0.7674837", "text": "function Noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.7613749", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.7613749", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.7613749", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.7613749", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.7613749", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.7613749", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.7613749", "text": "function _noop() {}", "title": "" }, { "docid": "0172fa21b5864847f54bc5039fdebef7", "score": "0.7613749", "text": "function _noop() {}", "title": "" }, { "docid": "968aae9c0dadf1a9919fe3ff1319a5e7", "score": "0.7600597", "text": "function NOOP() {}", "title": "" }, { "docid": "968aae9c0dadf1a9919fe3ff1319a5e7", "score": "0.7600597", "text": "function NOOP() {}", "title": "" }, { "docid": "1159b2a5572fb354373afa7f351dac79", "score": "0.75944674", "text": "function _noop () {}", "title": "" }, { "docid": "ce31c87d4797db56bb3a600ad7ae4b65", "score": "0.75870544", "text": "function NO_OP() {}", "title": "" }, { "docid": "f38c72a743e984629498115f8a897bf6", "score": "0.751757", "text": "function noOp() {\n }", "title": "" }, { "docid": "e989a30c5f59c71fe1240c53131b073b", "score": "0.7483196", "text": "function NOOP(){}", "title": "" }, { "docid": "23f0dc080fc5280988aecc50f5a09406", "score": "0.73793226", "text": "function noOP() {\n }", "title": "" }, { "docid": "f26856328ac5cd2b480a88e2fe15fcfb", "score": "0.7344682", "text": "function noOp() {\n /* no-op */\n }", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.7280697", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.7280697", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.7280697", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.7280697", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.7280697", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.7280697", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "946cecf853b2a8c51338fb054498b03b", "score": "0.7280697", "text": "function noop(){}// No operation performed.", "title": "" }, { "docid": "a3ec9d9834c6f5df49029af8747d676b", "score": "0.72602105", "text": "function noop () { }", "title": "" }, { "docid": "b675f706daf26463fe4f5fdef2715054", "score": "0.72588426", "text": "function nothing() {}", "title": "" }, { "docid": "c583071305dc5904b1b8b6b989710fca", "score": "0.725492", "text": "function noop () {}", "title": "" }, { "docid": "c583071305dc5904b1b8b6b989710fca", "score": "0.725492", "text": "function noop () {}", "title": "" }, { "docid": "c583071305dc5904b1b8b6b989710fca", "score": "0.725492", "text": "function noop () {}", "title": "" }, { "docid": "c583071305dc5904b1b8b6b989710fca", "score": "0.725492", "text": "function noop () {}", "title": "" }, { "docid": "c583071305dc5904b1b8b6b989710fca", "score": "0.725492", "text": "function noop () {}", "title": "" }, { "docid": "c583071305dc5904b1b8b6b989710fca", "score": "0.725492", "text": "function noop () {}", "title": "" }, { "docid": "c583071305dc5904b1b8b6b989710fca", "score": "0.725492", "text": "function noop () {}", "title": "" }, { "docid": "c583071305dc5904b1b8b6b989710fca", "score": "0.725492", "text": "function noop () {}", "title": "" }, { "docid": "c583071305dc5904b1b8b6b989710fca", "score": "0.725492", "text": "function noop () {}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "36dd70c5017276f20d98ab5b4364978d", "score": "0.72152394", "text": "function noop(){}", "title": "" }, { "docid": "ad063f99758dd2805eafd6aca92540ef", "score": "0.72110164", "text": "function doNothing() {}", "title": "" }, { "docid": "ad063f99758dd2805eafd6aca92540ef", "score": "0.72110164", "text": "function doNothing() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" }, { "docid": "b176bd25f68c04c54e9ea05f739f4c2f", "score": "0.71761715", "text": "function noop() {}", "title": "" } ]
64792fe6af78734c7ab76f7781381b60
Handle User search action with timeout, and show mention if needed
[ { "docid": "0d6a2007f4118f082d4247a6217898a2", "score": "0.72043353", "text": "function doSearchAndShow() {\n\n if (settings.timeOut > 0) {\n if (settings.globalTimeout !== null) {\n clearTimeout(settings.globalTimeout);\n }\n settings.globalTimeout = setTimeout(function () {\n settings.globalTimeout = null;\n\n settings.onDataRequest.call(this, 'search', currentMention.keyword, onDataRequestCompleteCallback);\n\n }, settings.timeOut);\n\n } else {\n settings.onDataRequest.call(this, 'search', currentMention.keyword, onDataRequestCompleteCallback);\n }\n }", "title": "" } ]
[ { "docid": "87e20b5edbbb81afff83ee24dc9203b3", "score": "0.6650691", "text": "function showQuery(searchText, message) {\n\n\tT.get('search/tweets', {\n\t\tq : searchText,\n\t\tcount : 5\n\t}, function (err, data, response) {\n\n\t\tvar mentionArray = [];\n\t\tstatuses = data.statuses\n\n\t\t\tif (statuses) {\n\t\t\t\tfor (i = 0; i < statuses.length; i++) {\n\t\t\t\t\t\n\t\t\t\t\tvar tweetText = ''\n\t\t\t\t\tjsonStatusData = statuses[i]\n\n\t\t\t\t\tif (jsonStatusData.text.toUpperCase().indexOf(\"ARMY\")> -1){\n\t\t\t\t\t\t\n\t\t\t\t\t\ttweetText = jsonStatusData.text.toUpperCase()\n\t\t\t\t\t\tif(tweetText.indexOf(\"RT\") == -1)\n\t\t\t\t\t\ttweetText = 'RT ' + jsonStatusData.text\n\t\t\t\t\t\telse \n\t\t\t\t\t\tscheduleTweet(tweetText)\n\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t\tif(jsonStatusData.text.toUpperCase().indexOf(\"KARAN\") || jsonStatusData.text.toUpperCase().indexOf(\"ARNAB\")) {\n\t\t\t\t\t\t\t//console.log(jsonStatusData.text);\n\n\t\t\t\t\t\t\tvar result = jsonStatusData.text.split(\" \");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t//Below code appends the twitter users in a tweet\n\t\t\t\t\t\t\tvar k = 0;\n\t\t\t\t\t\t\tfor (j = 0; j < result.length; j++) {\n\n\t\t\t\t\t\t\t\tif (result[j].charAt(0) == '@') {\n\t\t\t\t\t\t\t\t\t//console.log('Mentions = ' + result[j]);\n\t\t\t\t\t\t\t\t\tmentionArray[k] = result[j];\n\t\t\t\t\t\t\t\t\tk = k + 1;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t*/\n\n\t\t\t\t\t\t\tvar addMessage = true\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tfor (l = 0; l < mentionArray.length; l++) {\n\t\t\t\t\t\t\t\t\ttweetText += mentionArray[l] + \" \"\n\n\t\t\t\t\t\t\t\t\tif (l == randomizer()) {\n\t\t\t\t\t\t\t\t\t\taddMessage = false;\n\t\t\t\t\t\t\t\t\t\ttweetText += message[0] + \" \"\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (addMessage) {\n\t\t\t\t\t\t\t\t\ttweetText += message[1]\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (tweetText.length > 140) {\n\n\t\t\t\t\t\t\t\t\tscheduleTweet(tweetText.substring(0, 135) + ' 1/2')\n\t\t\t\t\t\t\t\t\tscheduleTweet(tweetText.substring(136) + ' 2/2')\n\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\tscheduleTweet(tweetText)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t});\n\n}", "title": "" }, { "docid": "b7b11b78ee8a01a0fe2538f2cb036952", "score": "0.65591043", "text": "handleUserSearch() {\n if (!this._debouncedSearch) {\n this._debouncedSearch = debounce(() => __awaiter(this, void 0, void 0, function* () {\n const loadingTimeout = setTimeout(() => {\n this._showLoading = true;\n }, 50);\n yield this.loadState();\n clearTimeout(loadingTimeout);\n this._showLoading = false;\n this.showFlyout();\n this._arrowSelectionCount = 0;\n }), 400);\n }\n this._debouncedSearch();\n }", "title": "" }, { "docid": "360411aa5e2741d6c1c1527c5c37b094", "score": "0.6398699", "text": "function handleQuery () {\n var searchText = $scope.searchText || '',\n term = searchText.toLowerCase();\n //-- if results are cached, pull in cached results\n if (!$scope.noCache && cache[ term ]) {\n ctrl.matches = cache[ term ];\n updateMessages();\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "title": "" }, { "docid": "360411aa5e2741d6c1c1527c5c37b094", "score": "0.6398699", "text": "function handleQuery () {\n var searchText = $scope.searchText || '',\n term = searchText.toLowerCase();\n //-- if results are cached, pull in cached results\n if (!$scope.noCache && cache[ term ]) {\n ctrl.matches = cache[ term ];\n updateMessages();\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "title": "" }, { "docid": "360411aa5e2741d6c1c1527c5c37b094", "score": "0.6398699", "text": "function handleQuery () {\n var searchText = $scope.searchText || '',\n term = searchText.toLowerCase();\n //-- if results are cached, pull in cached results\n if (!$scope.noCache && cache[ term ]) {\n ctrl.matches = cache[ term ];\n updateMessages();\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "title": "" }, { "docid": "cdec8e233603282ab0fdf86021ac35ac", "score": "0.63864934", "text": "function handleQuery(){var searchText=$scope.searchText||'',term=searchText.toLowerCase();//-- if results are cached, pull in cached results\nif(!$scope.noCache&&cache[term]){ctrl.matches=cache[term];updateMessages();setLoading(false);}else{fetchResults(searchText);}ctrl.hidden=shouldHide();}", "title": "" }, { "docid": "d6b5254062801b94ee2e600c67ec2682", "score": "0.63858557", "text": "function searchUser() {\n var WINDOW_LOCATION_SEARCH = \"?search={search}\"\n var term = $('#search').val().trim();\n if (term.length > 3) {\n var bySearchTermUrl = (active ? GET_USERS : GET_USERS_INACTIVE) + WINDOW_LOCATION_SEARCH.replace('{search}', term)\n fetchUsers(bySearchTermUrl)\n }\n}", "title": "" }, { "docid": "fa43ebd7629d7c156f56e64ae82ffe13", "score": "0.6371399", "text": "function handleQuery () {\r\n var searchText = $scope.searchText || '',\r\n term = searchText.toLowerCase();\r\n //-- if results are cached, pull in cached results\r\n if (!$scope.noCache && cache[ term ]) {\r\n ctrl.matches = cache[ term ];\r\n updateMessages();\r\n } else {\r\n fetchResults(searchText);\r\n }\r\n\r\n ctrl.hidden = shouldHide();\r\n }", "title": "" }, { "docid": "e8295d256ca8c08d376a5ffb86dd592d", "score": "0.6355328", "text": "function handleQuery() {\n var searchText = $scope.searchText || '',\n term = searchText.toLowerCase();\n //-- if results are cached, pull in cached results\n if (!$scope.noCache && cache[term]) {\n ctrl.matches = cache[term];\n updateMessages();\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "title": "" }, { "docid": "a878fea4a2b33a46db06ea1a810fa57a", "score": "0.6216047", "text": "onSearchInput () {\n //showhide(\"content-results\") \n clearTimeout(this.searchDebounce)\n this.searchDebounce = setTimeout(async () => {\n this.searchOffset = 0\n this.searchResults = await this.search()\n }, 100)\n }", "title": "" }, { "docid": "d055b4979768bb175f76c746c78908f5", "score": "0.62065756", "text": "function doneTyping () {\n //do something\n if ($search_user.val() == '') {\n showAllUser();\n return;\n }\n var searchReg = new RegExp($search_user.val(), 'ig');\n n = 0;\n for (var i = 0; i < userData.length; i++) {\n var match = false;\n for (var info in userData[i]) {\n if (info == 'password') continue;\n if (searchReg.test(userData[i][info])) {\n match = true;\n break;\n }\n }\n if (match) {\n n++;\n //$('tr[data-uid=' + userData[i].id + ']').show();\n $('tr[data-uid=' + userData[i].id + ']').attr(\"visible\",\"true\");\n $('tr[data-uid=' + userData[i].id + ']').attr(\"unum\",n);\n } else {\n //$('tr[data-uid=' + userData[i].id + ']').hide();\n $('tr[data-uid=' + userData[i].id + ']').attr(\"visible\",\"hide\");\n $('tr[data-uid=' + userData[i].id + ']').attr(\"unum\",-1);\n }\n }\n setMaxPage();\n userDisplay();\n }", "title": "" }, { "docid": "71ab4b7b4209c1edbf55a09f6cf9001e", "score": "0.6189", "text": "performSearch(){\n\t\tthis.props.onUserSearch(this.refs.searchField.value);\n\t}", "title": "" }, { "docid": "6fb0753772b6f38d701473b4d88c9694", "score": "0.6179371", "text": "function userSubmitHandler(event){\n event.preventDefault();\n var actorAvail = document.getElementById(\"actor\").value\n // Will not run search until user enters a value for actor/actress\n if(actorAvail){\n search();\n }\n else{\n $(\"#actorAlert\").css(\"display\", \"block\");\n }\n }", "title": "" }, { "docid": "ec527f15f875e9371adf84c3dc335911", "score": "0.6175473", "text": "_handleSearch(message){\n // Get incoming user Id and query\n const discord_user_id = message.author.id;\n const discord_user = message.author.username;\n const content = message.content;\n const query = _.join(_.slice(content.substring(1).split(' '),1), \" \");\n\n // CHeck if there is indeed a query string coming\n if(!query){\n this.logger.warn(`User ${discord_user} sent an empty search query`);\n message.channel.send(\"Please include a search query after !google\");\n }else{\n this.logger.info(`User ${discord_user} sent a search query \"${query}\"`);\n // If yes, first save the query in db\n saveQuery(discord_user_id,query).then((rows) => {\n // If the query is saved in history\n // then search it in google custom search\n googleSearch(query).then((results) => {\n // Send each result in separate replies\n this.logger.info(`User ${discord_user} successfully replied with search results`);\n results.forEach((result) => {\n message.channel.send({\n embed:{\n title: result.title,\n url: result.link,\n description: result.snippet\n }\n })\n })\n }).catch(() => {\n this.logger.error(`Error in doing google search for User ${discord_user}`);\n // If there is any error in search then send an error msg\n this._sendSimpleErrorMsg(message);\n })\n }).catch(() => {\n this.logger.error(`Error in saving history for User ${discord_user}`);\n // If there is an error in saving then send an error msg\n this._sendSimpleErrorMsg(message);\n })\n }\n\n }", "title": "" }, { "docid": "5d973abd16ad8256ac70e1699a23201e", "score": "0.6136335", "text": "function searchOtherUser() {\n info('Searching your fellow user...', colors.yellow);\n\n var data = {\n you: you,\n roomToken: roomToken\n };\n\n xhr('GetFellowUser', data,\n function(response) {\n if (response) {\n yourFellowUser = response;\n info('Found your friend: ' + yourFellowUser, colors.green);\n\n webrtc_offer.create_offer();\n } else setTimeout(searchOtherUser, 3000);\n }\n );\n}", "title": "" }, { "docid": "3eccaa239ea6a4073ed4cdfd2382d571", "score": "0.6128844", "text": "function getMatches(){\r\n $('.editdata').hide();\r\n userID = $('#search').val();\r\n \r\n \r\n}", "title": "" }, { "docid": "ccbb57e9a3642b142907d98d5f820b9d", "score": "0.60677105", "text": "function findUser(){\n\tvar queryname = getQueryVariable(\"name\");\n\tif (queryname){\n\t\tstate.haveName = true;\n\t\treturn queryname;\n\t}\n $('#header-message').html(\"Enter a Twitch name to get started\");\n\t$('#user-find').modal();\n\treturn false;\n\n}", "title": "" }, { "docid": "b0905062a70a3b2d622206e03926fdd1", "score": "0.6034486", "text": "async function searchUsers() {\n try {\n const errorPlaceholder = document.querySelector(\".search_error\");\n errorPlaceholder.textContent = \"\";\n errorPlaceholder.style.display = \"none\";\n\n const res = await fetch(\"/users/search\", {\n method: \"POST\",\n headers: { \"Content-Type\": \"application/json\" },\n body: JSON.stringify({ queryText: searchInput.value }),\n });\n const { errors, results } = await res.json();\n\n if (errors) {\n errorPlaceholder.textContent = errors.common.msg;\n errorPlaceholder.style.display = \"block\";\n } else {\n if (results.length > 0) {\n results.map((result) => {\n const avatar = result.avatar ? \"./uploads/avatars/\" + result.avatar : \"./assets/nophoto.png\";\n const resultHtml = `\n <div onclick=\"createConversation('${result._id}', '${result.name}', '${result.avatar}')\" class=\"result\">\n <div class=\"userImg\">\n <img src=\"${avatar}\" alt=\"${result.name}\" />\n </div>\n <p class=\"user_name\">${result.name}</p>\n </div>\n `;\n\n searchResultContainer.insertAdjacentHTML(\"afterbegin\", resultHtml);\n searchResultContainer.style.display = \"block\";\n });\n }\n }\n } catch (err) {\n console.log(err);\n }\n}", "title": "" }, { "docid": "638429a20e9bca600e36f1a2ac30802a", "score": "0.6029397", "text": "showSearchMemes (ev) {\n ev.preventDefault();\n\n // get searchTerm\n const searchTerm = document.getElementById(\"searchBar\").value;\n\n // set selectedMeme\n this.setSelectedMemeCategory(\"search\", searchTerm);\n\n // refresh [memes]\n this.refreshMemeList(searchTerm);\n }", "title": "" }, { "docid": "88e7f386c0e11f84d94c3d9a2e063688", "score": "0.60095173", "text": "function doSearch(){\r\n if(timeoutHnd) clearTimeout(timeoutHnd);\r\n timeoutHnd = setTimeout(nombreReload,500);\r\n}", "title": "" }, { "docid": "d2c6a0bfd95f15f83cf89b16d7741348", "score": "0.6001791", "text": "function doTimeout() {\n clearTimeout(self.searchTimeout);\n\n // Set currently searching flag to true here.\n self.currentlySearching = true;\n\n // Offset searches by 300 milliseconds.\n self.searchTimeout = setTimeout(function(){\n self._search(val);\n }, 300);\n }", "title": "" }, { "docid": "bbd6edf0be3b6b7d448590dcb1dc7698", "score": "0.59573495", "text": "function showSearchUser() {\n try {\n $j(\"#searchUser\").show(); //.css('display', 'block');\n $j(\"#showUser\").hide(); //css('display', 'none');\n\n } catch (ex) {\n jslog(errorLogPrefix + \" showSearchUser: \" + ex.message);\n }\n}", "title": "" }, { "docid": "2880e3d72f6be218ccefd5e3177d39cf", "score": "0.59471476", "text": "function performSearch(e) {\n e.preventDefault();\n var rawTerm = $(\"#search-input\").val();\n \n // unfocus from search bar to allow scrolling with keys\n $(\"#search-input\").blur();\n \n //scroll to top of page\n scrollToTop();\n \n // create twitter search loading message\n $(\"#messages\").empty();\n \n var $searchMessage = $(\"<p/>\").attr(\"id\", \"searching-tweets-message\");\n \n if(rawTerm.length == 0){\n $searchMessage.text(\"searching Twitter for tweets talking about anything... \")\n }\n else{\n $searchMessage.text(\"searching Twitter for tweets talking about \\'\"+rawTerm+\"\\'... \")\n }\n \n $searchMessage.append(makeLoadPercent)\n .append(makeLoaderGif()); \n \n $(\"#messages\").appendSlide($searchMessage);\n \n // change search term visual\n if(rawTerm.length == 0){\n $(\"#common-words-search-term\").text(\"anything\"); \n }\n else{\n $(\"#common-words-search-term\").text(\"\\'\"+rawTerm+\"\\'\");\n } \n\n // handle common word tab animating onto page\n $(\"#common-words-list\").slideUp(function(){\n $(this).empty();\n });\n $(\"#common-words-content\").slideDown(100);\n $(\"#common-words-tab\").fadeIn(100);\n $(\"#common-words-tab\").slideDown(100);\n $(\"#no-common-words-error\").fadeOut(100);\n \n // empty Isotope container\n emptyIsotopeImages();\n \n // perform search with Geolocation if option is toggled\n if($(\"#local-tweets-checkbox\").is(':checked')){\n console.log(navigator.geolocation);\n navigator.geolocation.getCurrentPosition(\n function(position){\n fetchTweets(rawTerm, position);\n }, \n function(){\n //console.log(\"error in getting location\");\n $(\"#messages\").appendSlide(\n $(\"<p/>\").text(\"Note: there was an error in getting your location, so we are using global tweets instead.\").attr(\"id\", \"location-error\")\n );\n setTimeout(function(){\n $(\"#location-error\").slideUp(function(){\n $(this).remove();\n });\n }, 3000);\n fetchTweets(rawTerm, null);\n }\n );\n }\n // perform search without geolocation\n else{\n fetchTweets(rawTerm, null);\n }\n}", "title": "" }, { "docid": "b899321eee45c006c743158352622364", "score": "0.5933313", "text": "handleSearchKeyword() {\n alert('You clicked me');\n \n if (this.searchValue !== '') {\n getContactList({\n searchKey: this.searchValue\n })\n .then(result => {\n // set @track contacts variable with return contact list from server \n this.contactsRecord = result;\n })\n .catch(error => {\n \n const event = new ShowToastEvent({\n title: 'Error',\n variant: 'error',\n message: error.body.message,\n });\n this.dispatchEvent(event);\n // reset contacts var with null \n this.contactsRecord = null;\n });\n } else {\n // fire toast event if input field is blank\n const event = new ShowToastEvent({\n variant: 'error',\n message: 'Search text missing..',\n });\n this.dispatchEvent(event);\n }\n }", "title": "" }, { "docid": "a3a6d2499d376964a7bc13297758498a", "score": "0.59314615", "text": "function handleQuery () {\n var searchText = $scope.searchText || '';\n var term = searchText.toLowerCase();\n\n // If caching is enabled and the current searchText is stored in the cache\n if (!$scope.noCache && cache[term]) {\n // The results should be handled as same as a normal un-cached request does.\n handleResults(cache[term]);\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "title": "" }, { "docid": "a3a6d2499d376964a7bc13297758498a", "score": "0.59314615", "text": "function handleQuery () {\n var searchText = $scope.searchText || '';\n var term = searchText.toLowerCase();\n\n // If caching is enabled and the current searchText is stored in the cache\n if (!$scope.noCache && cache[term]) {\n // The results should be handled as same as a normal un-cached request does.\n handleResults(cache[term]);\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "title": "" }, { "docid": "a3a6d2499d376964a7bc13297758498a", "score": "0.59314615", "text": "function handleQuery () {\n var searchText = $scope.searchText || '';\n var term = searchText.toLowerCase();\n\n // If caching is enabled and the current searchText is stored in the cache\n if (!$scope.noCache && cache[term]) {\n // The results should be handled as same as a normal un-cached request does.\n handleResults(cache[term]);\n } else {\n fetchResults(searchText);\n }\n\n ctrl.hidden = shouldHide();\n }", "title": "" }, { "docid": "2cbf4e9b46627f2305f166df7024dfa7", "score": "0.5919656", "text": "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "title": "" }, { "docid": "0aaf8cb69fc9b1c25bd313c9d7b50929", "score": "0.5887056", "text": "function search_suggestions(msg, destiny, sender_function)\n\t{\n\t\tvar dest = destiny.replace(/-/g, \" \");\n\t\tconsole.log(dest);\n\t\t var options = {\n\t url: 'http://www.metacritic.com/search/tv/' + dest + '/results',\n\t headers: {\n\t 'User-Agent': 'request'\n\t },\n\t enconding: 'ascii'\n\t };\n\t\t\n\t\t request(options, function(error, response, html){\n\t\tif (error)\n\t\tconsole.log(error);\n if(!error){\n var $ = cheerio.load(html);\n var suggestions;\n\t\t\tvar message;\n\t\t\tvar i=0;\n\t\t\tmessage = \"Maybe you meant: \\n\";\n\t\t\t\n\t\t\t$('ul.search_results.module').children().filter(function(){\n\t\t\t\t\tif ($(this).hasClass('result'))\n\t\t\t\t\t{\n\t\t\t\tvar data = $(this).children().last().children().first();\n\t\t\t\tvar title = data.children().first().children().first().text();\n\t\t\t\tvar release = data.children().last().children().children().first().children().last().text();\n\t\t\t\tvar type = $(this).children().first().children().first().text();\n\t\t\t\tmessage = message + title + \"\\n\" + \"Type: \" + type + \"\\n\" + \"Release date: \" + release + \"\\n\";\t\n\t\t\t\tmessage = message + \"\\n\";\n\t\t\t\t\t}\t\t\t\t\n })\n\t\t\tvar fromId = msg.chat.id;\n sender_function(fromId, message);\n }\n\t\t\t})\n\t\t\n\t\n\t}", "title": "" }, { "docid": "6fe896e1802acd52f7d94eabaa1c247d", "score": "0.5834246", "text": "getSuggestions(query) {\n this.debounce = setTimeout(() => {\n this.keyword = query;\n this.suggestions = this.model.getAutoCompleteList(query);\n this.resultView.renderSuggetsion(this.suggestions, query); \n }, this.debounceDelay);\n }", "title": "" }, { "docid": "f3c0827a5df51ceb0d8ab6662e16fdad", "score": "0.5832966", "text": "function searchUser() {\n api.get(`/${user}`)\n .then((response) => setUserDetails(response.data))\n .catch((err) => {\n console.error(\"ops! ocorreu um erro\" + err);\n });\n }", "title": "" }, { "docid": "cc63a77763fc612bf8a7efd7afcd5d2d", "score": "0.5818862", "text": "async function search(client, message, args, type) {\r\nconst search = args.join(\" \");\r\n let res;\r\n // Search for tracks using a query or url, using a query searches youtube automatically and the track requester object\r\n res = await client.manager.search({\r\n query: search,\r\n source: type.split(\":\")[1]\r\n }, message.author);\r\n // Check the load type as this command is not that advanced for basics\r\n if (res.loadType === \"LOAD_FAILED\") throw res.exception;\r\n\r\n var max = 10;\r\n var collected;\r\n if (res.tracks.length < max) max = res.tracks.length;\r\n track = res.tracks[0]\r\n\r\n var results = \"\";\r\n if(message.guild.me.permissionsIn(message.channel).has(\"EMBED_LINKS\")){\r\n results = res.tracks.slice(0, max).map((track, index) => `\\`${++index}.\\` [${String(track.title).split(\"[\").join(\"\\[\").split(\"]\").join(\"\\]\")}](${track.uri}) **[${format(track.duration).split(\" | \")[0]}]**`).join('\\n\\n');\r\n results += \"\\n\\n\\n**Type a number to make a choice. Type \\`cancel\\` to exit**\";\r\n results = new Discord.MessageEmbed()\r\n .setAuthor(message.author.username, message.author.displayAvatarURL({dynamic: true}), \"https://milrato.eu\")\r\n .setColor(ee.color)\r\n .setDescription(results)\r\n }else {\r\n results = res.tracks.slice(0, max).map((track, index) => `\\`${++index}.\\` \\`${String(track.title).split(\"[\").join(\"\\[\").split(\"]\").join(\"\\]\")}\\` **[${format(track.duration).split(\" | \")[0]}]**`).join('\\n\\n');\r\n results += \"\\n\\n\\n**Type a number to make a choice. Type \\`cancel\\` to exit**\";\r\n }\r\n \r\n let searchmsg = await message.channel.send(results)\r\n\r\n waitforanswer()\r\n function waitforanswer(){\r\n message.channel.awaitMessages(m => m.author.id == message.author.id, {\r\n max: 1,\r\n time: 30000,\r\n errors: ['time']\r\n }).then(collected => {\r\n searchmsg.delete().catch(e=>console.log(\"could not delete msg\"))\r\n \r\n const first = collected.first().content;\r\n if (first.toLowerCase() === 'cancel') {\r\n message.channel.send(\"✅\")\r\n if (player && player.queue && !player.queue.current) player.destroy().catch(e=>console.log(\"e\"));\r\n return;\r\n }\r\n const index = Number(first) - 1;\r\n if (index < 0 || index > max - 1) return waitforanswer();\r\n \r\n track = res.tracks[index];\r\n if (!res.tracks[0])\r\n return message.channel.send(new MessageEmbed()\r\n .setColor(ee.wrongcolor)\r\n .setFooter(ee.footertext, ee.footericon)\r\n .setTitle(String(\"❌ Error | Found nothing for: **`\" + search).substr(0, 256 - 3) + \"`**\")\r\n .setDescription(`Please retry!`)\r\n );\r\n // Create the player\r\n let player = client.manager.create({\r\n guild: message.guild.id,\r\n voiceChannel: message.member.voice.channel.id,\r\n textChannel: message.channel.id,\r\n selfDeafen: false,\r\n });\r\n if (player.state !== \"CONNECTED\") {\r\n // Connect to the voice channel and add the track to the queue\r\n player.connect();\r\n player.set(\"message\", message);\r\n player.set(\"playerauthor\", message.author.id);\r\n player.queue.add(track);\r\n player.play();\r\n } else {\r\n //add track\r\n player.queue.add(track);\r\n var time = 0;\r\n //create info msg embed\r\n let playembed = new Discord.MessageEmbed()\r\n .setAuthor(`Added to queue`, message.author.displayAvatarURL({dynamic: true}), \"https://milrato.eu\")\r\n .setURL(track.uri)\r\n .setTitle(\"**\" + track.title + \"**\").setColor(ee.color)\r\n .setThumbnail(`https://img.youtube.com/vi/${track.identifier}/mqdefault.jpg`)\r\n .addField(\"Channel\", track.author, true)\r\n .addField(\"Song Duration: \", track.isStream ? \"LIVE STREAM\" : format(track.duration).split(\" | \")[0], true)\r\n //timing for estimated time creation\r\n if(player.queue.size > 0) player.queue.map((track) => time += track.duration)\r\n time += player.queue.current.duration - player.position;\r\n time -= track.duration;\r\n playembed.addField(\"Estimated time until playing\", format(time).split(\" | \")[0], true)\r\n \r\n playembed.addField(\"Position in queue\", `${player.queue.length}`, true)\r\n //if bot allowed to send embed, do it otherwise pure txt msg\r\n if(message.guild.me.permissionsIn(message.channel).has(\"EMBED_LINKS\"))\r\n return message.channel.send(playembed);\r\n else\r\n return message.channel.send(`Added: \\`${track.title}\\` - to the Queue\\n**Channel:** ${track.author}\\n**Song Duration:** ${track.isStream ? \"LIVE STREAM\" : format(track.duration).split(\" | \")[0]}\\n**Estimated time until playing:** ${time}\\n**Position in queue:** ${player.queue.length}\\n${track.uri}`);\r\n }\r\n }).catch(e=>{\r\n searchmsg.edit({content: \"**:x: Timeout!**\", embed: null}) \r\n })\r\n }\r\n}", "title": "" }, { "docid": "7dc19748dd1b975051a8a194a2a4a210", "score": "0.5814603", "text": "onSearchTermChange(e) {\n\t\t\tlet searchTerm = e.target.value;\n\n\t\t\tif (searchTerm != \"\") {\n\t\t\t\tlet _this = this;\n\n\t\t\t\twindow.clearTimeout(prevTimer);\n\n\t\t\t\tprevTimer = window.setTimeout(() => {\n\t\t\t\t\t_this.setState({selectedRow: -1});\n\n\t\t\t\t\t// get token\n\n\t\t\t\t\tfirebase.auth().onAuthStateChanged(function(user) {\n\t\t \tif(user) {\n\t\t // user signed in \n\t\t console.log('logged in');\n\n\t\t user.getIdToken().then(function(token) {\n\t\t store.dispatch(searchSongs(token, _this.state.partyId, searchTerm, _this.state.sid));\n\t\t });\n\n\t\t }\n\t\t \t});\n\n\t\t\t\t}, 500);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "c777d00dc24e2620bc8404cd16209036", "score": "0.5810793", "text": "function searchUsers() {\n $.post(\n \"API/searchUsers.php\",\n $('#search-form').serialize()\n ).done(function(data) {\n if (!showFriends(data, \"#search-users-list\", 0, \"profile.php\", \"GET\")) {\n $(\"#search-users-list\").text(\"Niemand gevonden\");\n }\n });\n}", "title": "" }, { "docid": "ca6e86858bfa4f7d24421816c70c20bb", "score": "0.5781779", "text": "function startSearchTimeout() {\n if (searchTimeoutId !== null) {\n clearTimeout(searchTimeoutId);\n }\n searchTimeoutId = setTimeout(getSuggestions, stopTypingMs);\n }", "title": "" }, { "docid": "7126cf47709a16103d9d706ebc24cb86", "score": "0.5756506", "text": "function getUserInput() {\n botui.action.text({ // User inputs the keyword\n action: {\n delay: 3000,\n placeholder: \"Enter a keyword\"\n }\n }).then(function (res) { // fourth message\n keyword = res.value;\n sendKeyword(keyword);\n\n return botui.action.text({\n action: {\n delay: 3000,\n placeholder: \"Start search in year:\"\n }\n })\n }).then(function (res) {\n startYear = res.value;\n sendStartYear(startYear);\n\n return botui.action.text({\n action: {\n delay: 3000,\n placeholder: \"End search in year:\"\n }\n })\n }).then(function (res) {\n endYear = res.value;\n sendEndYear(endYear); // fifth message\n\n // Pre-perform the searches for more efficient conversation flow\n mySqlSearch();\n mongoDBSearch();\n luceneIndexSearch();\n bruteForceSearch();\n\n return botui.message.add({\n delay: 2200,\n loading: true,\n content: \"Okay, I'll search for \" + keyword + \" from \" + startYear + \" to \" + endYear\n })\n\n }).then(() => { // sixth message\n\n return botui.message.add({\n delay: 2200,\n loading: true,\n content: \"Searching with MySQL...\",\n })\n }).then(() => { // seventh message\n return botui.message.add( {\n delay: 2200,\n loading: true,\n content: \"It took me \" + window.mySqlResponse.runtime + \" milliseconds\" + \" to find the keyword '\" +\n window.mySqlResponse.keyword + \"' \" + window.mySqlResponse.hits + \" times\"\n })\n }).then(() => { // eighth message\n\n return botui.message.add({\n delay: 4500,\n loading: true,\n content: \"Searching with MongoDB...\",\n })\n }).then(() => { // ninth message\n return botui.message.add({\n delay: 2200,\n loading: true,\n content: \"It took me \" + window.mongoDBResponse.runtime + \" milliseconds\" + \" to find the keyword '\" +\n window.mongoDBResponse.keyword + \"' \" + window.mongoDBResponse.hits + \" times\"\n })\n }).then(() => { // tenth message\n\n return botui.message.add({\n delay: 4500,\n loading: true,\n content: \"Searching with Lucene Index...\",\n })\n }).then(() => { // eleventh message\n return botui.message.add({\n delay: 2200,\n loading: true,\n content: \"It took me \" + window.luceneResponse.runtime + \" milliseconds\" + \" to find the keyword '\" +\n window.luceneResponse.keyword + \"' \" + window.luceneResponse.hits + \" times\"\n })\n }).then(() => { // twelth message\n return botui.message.add({\n delay: 4500,\n loading: true,\n content: \"Searching with Brute Force...\",\n })\n }).then(() => { // thirteenth message\n return botui.message.add({\n delay: 2200,\n loading: true,\n content: \"It took me \" + window.bruteForeceResponse.runtime + \" milliseconds\" + \" to find the keyword '\" +\n window.bruteForeceResponse.keyword + \"' \" + window.bruteForeceResponse.hits + \" times\"\n })\n }).then(() => {\n return botui.message.add({\n delay: 4500,\n loading: true,\n content: \"I am done searching. Would you like to search again?\"\n })\n }).then(() => {\n return botui.action.text({\n action: {\n delay: 2000,\n placeholder: \"Enter yes or no\"\n }\n })\n }).then(function (res) {\n if (res.value === \"yes\" || res.value === \"Yes\") {\n getUserInput();\n } else {\n loadGraph();\n return botui.message.add({\n delay: 2000,\n loading: true,\n content: \"Alright, we're done searching. I'll plot the results now...\"\n })\n }\n })\n}", "title": "" }, { "docid": "de25d65a8cef6524b997964bc1a1a7d6", "score": "0.57218593", "text": "function searchFunction() {\n const input = document.querySelector('.search');\n const searchValue = input.value.toUpperCase();\n // Get all links.\n const links = container.querySelectorAll('a');\n\n for (let i = 0; i < links.length; i++) {\n let headlineName = links[i].querySelectorAll(\"h3\")[0];\n // Get the usernames of each member.\n let username = fetches[0].results[i].login.username;\n if (headlineName.innerHTML.toUpperCase().indexOf(searchValue) > -1 || username.toUpperCase().indexOf(searchValue) > -1) {\n links[i].style.display = '';\n } else {\n links[i].style.display = 'none';\n }\n }\n}", "title": "" }, { "docid": "c1839e20ada4c1f5b083d8a3a98d69f3", "score": "0.57193804", "text": "afterSearch( searchText, result ) {\n }", "title": "" }, { "docid": "5200da10239b4108d5b220226aeee239", "score": "0.57130224", "text": "smartSearch() {\n clearTimeout(this.timer);\n this.timer = setTimeout( () => this.setQuery(), 300 );\n }", "title": "" }, { "docid": "18b1b1ac39469a4cca934fed0fbae05c", "score": "0.57115084", "text": "function searchuser(div){\n \n \n \n\tvar term=$(\"#\"+div).val();\n \n\tterm=$.trim(term);\n\tif(term.length >=1){\nif(term==\"\"){\n\t\n\t}\n\telse if(term[0]=='$'){ \n\t\t$(\"#\".div).css(\"color\", \"RoyalBlue\");\n\t\t$(\"#\"+div).css(\"text-transform\", \"lowercase\");\t\n\t\tif(term=='$'){ }\n\t\telse{\n\t\tterm = term.substr(1); \n\t\t\t$.ajax({\n type:\"get\",\n url: \"searchuser_mem_ajax.php\",\n beforeSend: function() {\n $('#search_members').html(\"<div style='text-align:center;'><img src='images/copy.gif'/></div>\");\n },\n data: {term:term,tid:tid},\n success: function( data ) {\n\t \n $( \"#search_members\" ).html(data);\n \n },\n cache:false\n})\n\t\n\t}\n\t}\n\t\n\t\n\telse\n\t{\n\t$(\"#\"+div).css(\"color\", \"green\");\n\t\t$(\"#\"+div).css(\"text-transform\", \"uppercase\");\t\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\n\t$.ajax({\n type:\"get\",\n url: \"searchname_mem_ajax.php\",\n beforeSend: function() {\n $('#search_members').html(\"<div style='text-align:center;'><img src='images/copy.gif'/></div>\");\n },\n data: {term:term,tid:tid},\n success: function( data ) {\n\t \n $( \"#search_members\" ).html(data);\n },\n cache: false\n})\n\t\t\n\t\n\t\n\t}\n\t\n }\t\n \n}", "title": "" }, { "docid": "7f720e2491cfbeb4dccab9eedf8f67f8", "score": "0.5711219", "text": "function setUserResponse(message) {\n message_count++;\n var UserResponse = '<img class=\"userAvatar\" src=' + \"../static/img/userAvatar.jpg\" + '><p class=\"userMsg\" id=\"conversationMsg'+message_count.toString()+'\">' + message + ' </p><div class=\"clearfix\"></div>';\n $(UserResponse).appendTo(\".chats\").show(\"slow\");\n $(\".usrInput\").val(\"\");\n scrollToBottomOfResults();\n//showBotTyping();\n$(\".suggestions\").remove();\nif(message_count==1) {\n setTimeout(function() {\n $('#endConversation').removeClass('disabled');\n },180000);\n}\n}", "title": "" }, { "docid": "9a2ae1d00cfd7804db976524e53c2bd8", "score": "0.5707763", "text": "function onSearchResponse(response) {\n showResponse(response);\n}", "title": "" }, { "docid": "9a2ae1d00cfd7804db976524e53c2bd8", "score": "0.5707763", "text": "function onSearchResponse(response) {\n showResponse(response);\n}", "title": "" }, { "docid": "9a2ae1d00cfd7804db976524e53c2bd8", "score": "0.5707763", "text": "function onSearchResponse(response) {\n showResponse(response);\n}", "title": "" }, { "docid": "9a2ae1d00cfd7804db976524e53c2bd8", "score": "0.5707763", "text": "function onSearchResponse(response) {\n showResponse(response);\n}", "title": "" }, { "docid": "9a2ae1d00cfd7804db976524e53c2bd8", "score": "0.5707763", "text": "function onSearchResponse(response) {\n showResponse(response);\n}", "title": "" }, { "docid": "10eac33e7d240c9c14d3612ca0f1d914", "score": "0.570488", "text": "function findit(){var e=$(\"#search-text\").val(),t=$(\".search-item\").length+1;if(e.length>=1){$(\".search-content\").show(),$(\".search-filter\").attr(\"data-query\",e),$(\".search-result span\").show().html(\"Searching ...\");var r=\"/feeds/posts/default?max-results=12&start-index=\"+t+\"&alt=json&q=\"+e;$.ajax({type:\"GET\",url:r,async:!0,contentType:\"application/json\",dataType:\"jsonp\",success:function(t){$(\".more-result\").hide(),doSearch(t,e)}})}else $(\".search-content\").hide()}", "title": "" }, { "docid": "89c26218ffc284a5b056e1cad867e80a", "score": "0.5696982", "text": "function onSearchResponse(response) {\r\n showResponse(response);\r\n}", "title": "" }, { "docid": "68944143d03762d37fd38c3560a59af6", "score": "0.5687508", "text": "function querySearch (query) {\n $http({\n method: 'GET',\n url: \"/v1/api/users/search?q=\" + query\n }).then(function successCallback(response) {\n self.response = response.data || [];\n self.autoCompleteUsers = self.response.map(function (item) {\n return {\n value: item._id,\n display: item.topic\n };\n });\n },function errorCallback(response) {\n $scope.error = response.statusText; //TODO:\n });\n }", "title": "" }, { "docid": "204b41072b14b1273f6fdb31958a9987", "score": "0.5685825", "text": "function search(){\n const searchLink = `${apiUrl}/suggest/${searchItem.value}`;\n fetch(searchLink)\n .then(response => response.json())\n .then(songs => showResult(songs.data.slice(0,10)))\n .catch(e => {});\n }", "title": "" }, { "docid": "06c7b4e433162cfcf5eeefea44cc2991", "score": "0.56695396", "text": "function onSearchResponse(response) {\n showResponse(response);\n\n}", "title": "" }, { "docid": "06c7b4e433162cfcf5eeefea44cc2991", "score": "0.56695396", "text": "function onSearchResponse(response) {\n showResponse(response);\n\n}", "title": "" }, { "docid": "06c7b4e433162cfcf5eeefea44cc2991", "score": "0.56695396", "text": "function onSearchResponse(response) {\n showResponse(response);\n\n}", "title": "" }, { "docid": "06c7b4e433162cfcf5eeefea44cc2991", "score": "0.56695396", "text": "function onSearchResponse(response) {\n showResponse(response);\n\n}", "title": "" }, { "docid": "9462b5c99ed7cb561b1ea9c5567e0f54", "score": "0.5652001", "text": "function handler() {\n console.log(\"Handler called. q.value: '\" + qq.value + \"'\");\n\n // Check if hint is still applicable, if not, reset it\n if (hint.value.length) {\n if (hint.value.indexOf(qq.value.trim()) === -1) {\n // hint no longer contains the user query, so let's reset it\n hint.value = qq.value;\n }\n }\n\n // Let's reset the pointer, as new character was typed\n selected_pointer = -1;\n\n // Let's make the request to Rapid Suggest service\n var req = new window.XMLHttpRequest();\n req.onreadystatechange = function () {\n if (req.readyState === 4) { // DONE, the operation is complete\n if (req.status === 200) {\n var response = JSON.parse(req.responseText);\n terms = response.terms;\n displayResults(response.results); // [ terms : [..], results : []]\n } else {\n if (req.status !== 0) {\n console.warn(req.status, req.responseText);\n r.style.display = 'none';\n }\n }\n }\n };\n\n var url = location.protocol + '//' + location.host + '/rapidsuggest' + '?q=';\n req.open('GET', url + encodeURIComponent(qq.value.trim()), true);\n req.send();\n console.log(\"Requested autocomplete for '\" + qq.value.trim() + \"'\");\n }", "title": "" }, { "docid": "88e71bc6f4ff310a827518c2f126d818", "score": "0.5647991", "text": "function searchNusers(){\n\tvar value = $(\"#searchForField\").val();\n\tvar stype = $(\"#searchType\").val();\n\tvar resultBox = $(\"#searchResult\");\n\tvar resultsDiv = $(\"#allResultsDiv\");\n\tvar imageLoad = $(\"#searchLoad\");\n\tvar searchText = $(\"#searchText\");\n\t\n\tresultBox.show();\n\timageLoad.show();\n\tsearchText.text(\"searching\");\n\n\tif(value.trim().length < 1){\n\t\tresultBox.hide();\n\t\tresultsDiv.text(\"\");\n\t\timageLoad.hide();\n\t\tsearchText.text(\"\");\n\t\treturn false;\t\n\t}else{\n\t\t$(\"#searchForField\").css(\"border\",\"1px solid #ced4da\");\n\t\t$(\"#searchForField\").attr(\"placeholder\",\"Search users\");\n\t}\n\n\t$.ajax({\n\t\tmethod: \"GET\",\n\t\turl:nusersSearchResultAdmin,\n\t\tdata:{data:value,type:stype, _token:token},\n\t}).done(function(response){\n\t\timageLoad.hide();\n\t\tsearchText.text(\"resutls\");\n\t\tif(!$.isEmptyObject(response.resultFound)){\n\t\t\tresultsDiv.text(\"\");\n\t\t\tif(stype === \"name\"){\n\t\t\t\t$.each(response.resultFound,function(index,value){\n\t\t\t\t\tresultsDiv.append($(\"<a href='javascript:void(0)' onclick='getdata(\" + '\"' + value.fullName + '\"' + \")'>\").text(value.fullName));\n\t\t\t\t});\n\t\t\t}else if(stype === \"username\"){\n\t\t\t\t$.each(response.resultFound,function(index,value){\n\t\t\t\t\tresultsDiv.append($(\"<a href='javascript:void(0)' onclick='getdata(\" + '\"' + value.username + '\"' + \")'>\").text(value.username));\n\t\t\t\t});\n\t\t\t}\n\t\t}else{\n\t\t\tif(!$.isEmptyObject(response.resultNotFound)){\n\t\t\t\tresultsDiv.text(response.resultNotFound);\n\t\t\t\tresultsDiv.css(\"font-size\",\"12px\");\n\t\t\t}\n\t\t}\n\n\t}).fail(function(response){\n\t\timageLoad.hide();\n\t\tsearchText.text(\"resutls\");\n\t\tresultsDiv.text(\"oops! Someting went wrong!\");\n\t\tresultsDiv.css(\"font-size\",\"12px\");\n\t});\n}", "title": "" }, { "docid": "45c7b7ea19bd9c599b69720e5ab7ddc0", "score": "0.5645822", "text": "findUser( e ) { \n\t\tconst query = e.target.value.toLowerCase()\n\t\tconst people = this.props.contacts.array.filter( person => person.name.toLowerCase().indexOf( query ) == -1 ? false : true )\n\t\tthis.setState( { ...this.state, searchResults: people } )\n\t }", "title": "" }, { "docid": "39a74469250e2bdcc39d034a58609f67", "score": "0.5638326", "text": "function addSuggestion(textToAdd) {\n setTimeout(function() {\n var suggestions = textToAdd;\n var suggLength = textToAdd.length;\n var userThinking = '<img class=\"userAvatar\" src=' + \"../static/img/userAvatar.jpg\" + '><p class=\"userMsg\"> Oh Let me think...</p><div class=\"clearfix\"></div>';\n $(userThinking).appendTo('.chats');\n $(' <div class=\"singleCard\"> <div class=\"suggestions\"><div class=\"menu\"></div></div></div>').appendTo(\".chats\").hide().fadeIn(1000);\n// Loop through suggestions\nfor (i = 0; i < suggLength; i++) {\n\t$('<div class=\"menuChips\" data-payload=\"' + (suggestions[i].payload) + '\">' + suggestions[i].title + '</div>').appendTo(\".menu\");\n}\nscrollToBottomOfResults();\n}, 500);\n}", "title": "" }, { "docid": "8f7784d7bdbc1c418ba0b400f179422e", "score": "0.56275237", "text": "function searchTweets() {\n clearTimeout(window.timer);\n $('#countdown').empty();\n loadTweets('Searching tweets...');\n}", "title": "" }, { "docid": "82baca5b8854c9739c4e0d5e20134566", "score": "0.5622253", "text": "function onSearchResponse(response) {\n\tshowResponse(response);\n}", "title": "" }, { "docid": "bf02391c9ae5a1f105d2a64089bf2d53", "score": "0.56205755", "text": "function submit_message(text) {\n if (filtersList.includes(text)) {\n filterValues = '';\n getFilters(text);\n setTimeout(function () {\n console.log(filterValues);\n suggestion(filterValues);\n }, 1000);\n }\n // else {\n inputConversation(\"bot\", \"<div id=\\\"loading\\\"></div>\");\n $.post(\"/send_message\", {\n message: text\n }, handle_response);\n\n //Handles bot response\n function handle_response(data) {\n\n intentId = data.intentId.split(\"/\")[4]\n\n if (data.message.includes(\"|\")) {\n displayMovies(data.message);\n //inputConversation(\"bot\", \"Wanna dig deeper? Awesome! Go ahead and hit one of these filter by options...\")\n filters = getFilters('Filters');\n setTimeout(function() {\n filters = filters.replace(\"Language\", \"\");\n filters = filters.replace(\"Genre\", \"\");\n if (intentId === 'a9a3281b-5018-421b-b9d3-d3ef3adaafda' || intentId === '213a53db-ff41-4cd2-a516-b94c09a4a7a3') {\n inputConversation(\"bot\", \"Wanna dig deeper? Awesome! Go ahead and hit one of these filter by options...\");\n suggestion(filters);\n } else if (intentId === 'ea844afe-94b6-4f74-aeb0-9d8e1af10813' || intentId === '4fce1a0a-0062-4ed3-a4a3-4cbd9f2114cc') {\n inputConversation(\"bot\", \"Wanna dig deeper? Awesome! Go ahead and hit one of these filter by options...\");\n filters = filters.replace(\"Cast\", \"\");\n suggestion(filters);\n }\n else if ( intentId === \"91a3d9d4-eab9-4929-86da-6ab5bf9036bd\"|| intentId === \"a73b7784-eb58-45ff-80de-d78d252af250\" || intentId === \"7f75f273-7ec4-4f4f-8319-e7d0f3dae7d8\" || intentId === \"8893f055-4933-486a-8c8f-2c107aa100de\"){\n suggestion(\"Get Movie suggestions| Get TV-show suggestions\");\n }\n }, 1000);\n return;\n }\n\n document.getElementById(\"loading\").innerHTML = data.message;\n document.getElementById(\"loading\").id = \"\";\n\n console.log(intentId);\n if (intentId === \"467b18a3-3c3d-4833-885a-5d27f9a735b1\") {\n console.log(\"print this\");\n suggestion(\"Get Movie suggestions| Get TV-show suggestions\");\n } else if (intentId === \"5bb8d797-a892-4dc1-b461-a8576a0eb91b\") {\n filters = getFilters('Filters');\n setTimeout(function() {\n suggestion(filters);\n }, 1000);\n } else if (intentId === \"eaf81156-2629-4cd2-8506-d45b39eae48b\") {\n filters = getFilters('Filters');\n setTimeout(function() {\n filters = filters.replace(\"Cast\", \"\");\n suggestion(filters);\n }, 1000);\n }\n $(\"ul\").scrollTop($(\"ul\").prop('scrollHeight'));\n }\n // }\n}", "title": "" }, { "docid": "06f94b2cc442283edef27d681c149cca", "score": "0.5613404", "text": "showUserNotFound() {\n this.clearUI;\n this.profileUI.innerText = 'There is NOT any user by this username.';\n }", "title": "" }, { "docid": "23b764944a60766ecd1ea32232f0a7de", "score": "0.5610232", "text": "function runLiri(action, data) {\n\n\tappend('\\n==== New Search = ' + action + ' - ' +data+ ' ====\\n\\n');\n\n\tswitch(action) {\n\n\t\tcase 'my-tweets':\n\t\t\t\n\t\t\tvar screenName = {screen_name: data};\n\t\t\tclient.get('statuses/user_timeline', screenName, function(error, tweets, response) {\n\n\t\t\t\tif (!error) {\n\n\t\t\t\t\tif (tweets.length > 0) {\n\n\t\t\t\t\t\tfor (var i = 0; i < tweets.length; i++) {\n\t\t\t\t\t\t\tconsole.log(tweets[i].text);\n\t\t\t\t\t\t\tconsole.log(\"==================================\");\n\t\t\t\t\t\t\tappend(tweets[i].text+ '\\n');\n\t\t\t\t\t\t\tappend(\"=======================================\\n\")\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tconsole.log('Seach for another Twitter hangdle');\n\t\t\t\t\t\tappend('Seach for another Twitter hangdle');\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.log(\"error: \" + error);\n\t\t\t\t\tappend(\"error: \" + error + '\\n');\n\t\t\t\t}\n\t\t\t});\n\t\tbreak;\n\n\t\tcase 'spotify-this-song':\n\n\t\t\tspotify.search({type: 'track', query: data}, function(err, results) {\n\n\t\t\t\tif (err) {\n\t\t\t\t\tconsole.log('Error: ' + err);\n\t\t\t\t\tappend('Error: ' + err + '\\n');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (results.tracks.items[0].artists[0].name) {\n\t\t\t\t\tconsole.log(\"====================================\");\n\t\t\t\t\tconsole.log('Artists Name: ' + results.tracks.items[0].artists[0].name);\n\t\t\t\t\tconsole.log('Song Name: ' + results.tracks.items[0].name);\n\t\t\t\t\tconsole.log('URL: ' + results.tracks.items[0].artists[0].external_urls.spotify);\n\t\t\t\t\tconsole.log('Album Name: ' + results.tracks.items[0].album.name);\n\t\t\t\t\tconsole.log(\"====================================\");\n\t\t\t\t\tappend(\"====================================\\n\");\n\t\t\t\t\tappend('Artists Name: ' + results.tracks.items[0].artists[0].name + '\\n');\n\t\t\t\t\tappend('Song Name: ' + results.tracks.items[0].name + '\\n');\n\t\t\t\t\tappend('URL: ' + results.tracks.items[0].artists[0].external_urls.spotify + '\\n');\n\t\t\t\t\tappend('Album Name: ' + results.tracks.items[0].album.name + '\\n');\n\t\t\t\t\tappend(\"====================================\\n\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.log(\"NO RESULTS\");\n\t\t\t\t\tappend(\"NO RESULTS\\n\");\n\t\t\t\t}\n\t\t\t});\n\t\tbreak;\n\n\t\tcase 'movie-this':\n\n\t\t\trequest(\"http://www.omdbapi.com/?t='+data+'&y=&plot=short&tomatoes=true&r=json\", function (error, response, body) {\n\n\t\t\t\tif (!error && response.statusCode === 200) {\n\n\t\t\t\t\tbody = JSON.parse(body);\n\n\t\t\t\t\tconsole.log(\"Title: \" + body.Title);\n\t\t\t\t\tappend(\"Title: \" + body.Title+ \"\\n\");\n\n\t\t\t\t\tconsole.log(\"Year: \" + body.Year);\n\t\t\t\t\tappend(\"Year: \" + body.Year + \"\\n\");\n\n\t\t\t\t\tconsole.log(\"Country: \" + body.Country);\n\t\t\t\t\tappend(\"Country: \" + body.Country + \"\\n\");\n\n\t\t\t\t\tconsole.log(\"Language: \" + body.Language);\n\t\t\t\t\tappend(\"Language: \" + body.Language + \"\\n\");\n\n\t\t\t\t\tconsole.log(\"Short PLot: \" + body.Plot);\n\t\t\t\t\tappend(\"Short PLot: \" + body.Plot + \"\\n\");\n\n\t\t\t\t\tconsole.log(\"Actors: \" + body.Actors);\n\t\t\t\t\tappend(\"Actors: \" + body.Actors + \"\\n\");\n\n\t\t\t\t\tconsole.log(\"Rotten Tomatoes Rating: \" + body.tomatoUserRating);\n\t\t\t\t\tappend(\"RTR: \" + body.tomatoUserRating + \"\\n\");\n\n\t\t\t\t\tconsole.log(\"Tomatoes URL: \" + body.tomatoeURL);\n\t\t\t\t\tappend(\"Tomatoes URL: \" + body.tomatoeURL + \"\\n\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.log(\"Error: \" + error);\n\t\t\t\t\tappend(\"Error: \" + error + \"\\n\");\n\t\t\t\t}\n\t\t\t});\n\t\tbreak;\n\n\t\tcase 'do-what-it-says' :\n\n\t\t\tfs.readFile (data, \"utf8\", function(err, data) {\n\n\t\t\t\tvar array = data.split(\",\");\n\n\t\t\t\tvar fileAction = array[0];\n\t\t\t\tvar fileData = array[1];\n\n\t\t\t\trunLiri(fileAction, fileData)\n\t\t\t});\n\t\tbreak;\n\n\t\tdefault: \n\n\t\t\tconsole.log(\"USE A VALID FUNCTION\");\n\t\t\tappend(\"USE A VALID FUNCTION \\n\");\n\t}\t\n}", "title": "" }, { "docid": "1626d2041966871501e3553d437e0e66", "score": "0.56097114", "text": "function do_search(immediate) {\n\t\t\t\tvar query = input_box.val().toLowerCase();\n\n\t\t\t\tif (query && query.length) {\n\t\t\t\t\tif (query.length >= settings.minChars) {\n\t\t\t\t\t\tif (immediate) {\n\t\t\t\t\t\t\trun_search(query);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclearTimeout(timeout);\n\t\t\t\t\t\t\ttimeout = setTimeout(function(){run_search(query);}, settings.searchDelay);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "8d7648e05b753c3d9d3601e0afdf230c", "score": "0.5609029", "text": "function getResults() {\n var searchText = document.getElementById('search').value;\n \n //If no search query, display no-one\n if (searchText == \"\") {\n clearPeople();\n document.getElementById(\"newPersonButton\").style.display = \"none\";\n }\n\n //TODO: message if nobody found\n else {\n var resultList = fuse.search(searchText);\n displayPeople(resultList);\n document.getElementById(\"newPersonButton\").style.display = \"block\";\n }\n}", "title": "" }, { "docid": "f884f1714b9ca7a049c71f539f8f4071", "score": "0.56057966", "text": "async function onSearch(e) {\n\n e.preventDefault();\n try {\n imagesApiService.query = e.currentTarget.elements.query.value;\n imagesApiService.resetPage();\n const imagesList = await imagesApiService.fetchImages();\n const render = (hits) => {\n clearImagesContainer();\n appendImages(hits);\n }\n if (imagesList.length === 0 || imagesApiService.query === '') {\n alert('Try again! Incorrect input!');\n }\n return render(imagesList);\n } catch {\n alert('Sorry, the service cannot process your request😨. Try again, please.');\n }\n\n}", "title": "" }, { "docid": "1d87e7166092720705b00d9b20d9d751", "score": "0.5597915", "text": "function ajaxSearch() {\n\n //reset the timer\n clearTimeout(timer);\n\n updateSiteStatus(\"Searching...\");\n\n //set it again. when it times out, it will run. this method keeps fast typers from querying the database a lot\n timer = setTimeout(\"loadTasks()\",250);\n\n}", "title": "" }, { "docid": "4897da3dce068df756cfb5ffa48cda2e", "score": "0.5575411", "text": "function searchUser(query)\r\n{\r\n // console.log(\"Searching for user: \" + query);\r\n\r\n searchUserResults.visible = false;\r\n imageGallery.visible = false;\r\n searchNoResultsFound.visible = false;\r\n errorMessage.visible = false;\r\n\r\n loadingIndicator.running = true;\r\n loadingIndicator.visible = true;\r\n\r\n var req = new XMLHttpRequest();\r\n req.onreadystatechange = function()\r\n {\r\n // this handles the result for each ready state\r\n var jsonObject = network.handleHttpResult(req);\r\n\r\n // jsonObject contains either false or the http result as object\r\n if (jsonObject)\r\n {\r\n searchUserResults.clearList();\r\n\r\n var userCache = new Array();\r\n for ( var index in jsonObject.data )\r\n {\r\n userCache = [];\r\n\r\n userCache[\"username\"] = jsonObject.data[index].username;\r\n userCache[\"fullname\"] = jsonObject.data[index].full_name;\r\n if (userCache[\"fullname\"] === \"\") userCache[\"fullname\"] = userCache[\"username\"];\r\n userCache[\"profilepicture\"] = jsonObject.data[index].profile_picture;\r\n userCache[\"userid\"] = jsonObject.data[index].id;\r\n userCache[\"bio\"] = jsonObject.data[index].bio;\r\n\r\n searchUserResults.addToList({\r\n \"d_username\": userCache[\"username\"],\r\n \"d_fullname\": userCache[\"fullname\"],\r\n \"d_profilepicture\": userCache[\"profilepicture\"],\r\n \"d_userid\": userCache[\"userid\"],\r\n \"d_index\": index\r\n });\r\n\r\n // console.log(\"Appended list with ID: \" + imageCache[\"imageId\"] + \" in index: \" + index);\r\n }\r\n\r\n // check if list is empty and show message\r\n if (searchUserResults.numberOfItems < 1)\r\n {\r\n searchNoResultsFound.visible = true;\r\n }\r\n\r\n loadingIndicator.running = false;\r\n loadingIndicator.visible = false;\r\n\r\n imageGallery.visible = false;\r\n searchUserResults.visible = true;\r\n searchUserResults.focus = true;\r\n\r\n // console.log(\"Done searching users\");\r\n }\r\n else\r\n {\r\n // either the request is not done yet or an error occured\r\n // check for both and act accordingly\r\n if ( (network.requestIsFinished) && (network.errorData['code'] != null) )\r\n {\r\n // console.log(\"error found: \" + network.errorData['error_message']);\r\n\r\n // hide messages and notifications\r\n loadingIndicator.running = false;\r\n loadingIndicator.visible = false;\r\n\r\n // show the stored error\r\n errorMessage.showErrorMessage({\r\n \"d_code\":network.errorData['code'],\r\n \"d_error_type\":network.errorData['error_type'],\r\n \"d_error_message\":network.errorData['error_message']\r\n });\r\n\r\n // clear error message objects again\r\n network.clearErrors();\r\n }\r\n }\r\n }\r\n\r\n var instagramUserdata = auth.getStoredInstagramData();\r\n var url = instagramkeys.instagramAPIUrl + \"/v1/users/search?q=\" + query + \"&access_token=\" + instagramUserdata[\"access_token\"];\r\n\r\n req.open(\"GET\", url, true);\r\n req.send();\r\n}", "title": "" }, { "docid": "3252c08e7b8bc9c03cec97d487553794", "score": "0.5566876", "text": "initSearchListener() {\n searchBox.addEventListener('keyup', (event) => {\n // This Is What User Entered To Find\n const searchedText = event.target.value;\n if (searchedText != '') {\n /* Requset Git Class To Retrive Searched Text\n (then) After Receiving User And Repos, Pass Them to \n ShowUserProfile And ShowUserRepos To Display In UI. */\n this.git.getUserData(searchedText)\n .then( data => {\n // Check If Response Is Null\n if (data.user !== 'undefined') {\n this.showUserProfile(data.user);\n this.showUserRepos(data.reposList);\n }\n })\n // If Somethings Wrong With The Request\n .catch( error => {\n this.clearUI();\n this.showUserNotFound();\n });\n } else {\n // If Search Box Is Empty, We Have To Clear Profile And Repos UI\n this.clearUI();\n }\n });\n }", "title": "" }, { "docid": "cf8d0e6c6249d1a7a163c93972682f60", "score": "0.5561222", "text": "function goToAskUserName() {\n greetUser.fadeOut('fast');\n askNameBox.fadeIn();\n headerLeft.show();\n }", "title": "" }, { "docid": "1b6b5995f3c16177d1190586e9442ac4", "score": "0.5560604", "text": "function onSearchResponse(response) {\n showResponse(response);\n }", "title": "" }, { "docid": "30d30c17193638f48d574c015b4adf92", "score": "0.55526036", "text": "async function handleSearch(e) {\n //block reload page\n e.preventDefault();\n\n const data = {\n search,\n day,\n month,\n year\n };\n\n try {\n api.post('api/search', data).then(async (res) => {\n setResults(res.data.results);\n setIsHide(null);\n });\n } catch(err) {\n alert(err);\n }\n }", "title": "" }, { "docid": "60a1e09fbee7bd279f93efde1e3bc48d", "score": "0.55429685", "text": "function doneTyping (val) {\n\t\t\t\tvar search = val.toLowerCase();\n\n\t\t\t\t// Create the selector\n\t\t\t\tvar selector = settings.selector;\n\n\t\t\t\t// Refine the selector\n\t\t\t\tif (search !== '')\n\t\t\t\t{\n\t\t\t\t\tselector = settings.selector + '[data-search-content*=\"' + search + '\"]';\n\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t// Hide em all\n\t\t\t\tlist.children(settings.selector).hide();\n\t\t\t\t\n\t\t\t\tif (settings.paging === 'none')\n\t\t\t\t{\n\t\t\t\t\tlist.children(selector).fadeIn();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (settings.paging === 'more')\n\t\t\t\t{\n\t\t\t\t\t// How much is already revealed\n\t\t\t\t\tvar revealed = list.data('revealed');\n\t\t\t\t\tvar revealed_plus = list.children(selector).slice(0, revealed).size();\n\t\t\t\t\tvar filtered_list_length = list.children(selector).size();\n\t\t\t\t\t\n\t\t\t\t\t// Keep the number of revealed lines constant, change content as needed\n\t\t\t\t\tlist.children(selector)\n\t\t\t\t\t\t.slice(0, revealed)\n\t\t\t\t\t\t.fadeIn();\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t// If you have reached the end of the list...\n\t\t\t\t\tif (revealed_plus >= filtered_list_length)\n\t\t\t\t\t{\n\t\t\t\t\t\t$('#pufs-read-more').hide();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$('#pufs-read-more').show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (settings.paging === 'pagination')\n\t\t\t\t{\n\t\t\t\t\t// For paginated lists, revealed keeps track of what page we're on\n\t\t\t\t\tlist.data('page', 1);\n\t\t\t\t\t\n\t\t\t\t\tlist_length = list.children(selector).length;\n\n\t\t\t\t\t// Calculate the number of pages\n\t\t\t\t\tvar num_pages = Math.ceil(list_length / settings.page_length);\n\n\t\t\t\t\tvar pagination_html = '';\n\n\t\t\t\t\t// Add the list elements\n\t\t\t\t\tfor (var i = 1; i <= num_pages; i++) {\n\t\t\t\t\t\tpagination_html = pagination_html + '<li>' + i + '</li>';\n\t\t\t\t\t}\n\n\t\t\t\t\t$('#pufs-pagination').html(pagination_html);\n\t\t\t\t\t\n\t\t\t\t\tvar from = 0;\n\t\t\t\t\tvar to = settings.page_length;\n\n\t\t\t\t\tlist.children(selector)\n\t\t\t\t\t\t.slice(from, to)\n\t\t\t\t\t\t.fadeIn();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "2ec0528f12938638fe4175d5f5c51296", "score": "0.55356985", "text": "function aista_invoke_search(msg, token) {\n\n // Creating our URL.\n let url = `[[url]]/magic/system/openai/search?prompt=` + encodeURIComponent(msg) + '&type=[[type]]&max=[[max]]';\n if (token) {\n url += '&recaptcha_response=' + encodeURIComponent(token);\n }\n\n // Invoking backend, with reCAPTCHA response if we've got a site-key\n fetch(url, {\n method: 'GET',\n })\n .then(res => {\n\n // Enabling stuff again.\n const inp = document.getElementById('aistaSearchInput');\n inp.disabled = false;\n inp.select();\n inp.focus();\n document.getElementById('aistaSearchBtn').disabled = false;\n\n // Sanity checking result.\n if (res.status >= 200 && res.status <= 299) {\n return res.json();\n } else if (res.status === 499) {\n throw Error('Access denied, missing reCAPTCHA. Either configure your model to not use reCAPTCHA, or setup reCAPTCHA for your bot');\n } else if (res.status === 401) {\n throw Error('Your model requires authentication, and you are not authorised to invoking it. Either turn off all roles, or add JWT token to requests somehow.');\n } else if (res.status === 429) {\n throw Error('Seriously, it is not us! OpenAI is overloaded.');\n } else {\n throw Error(res.statusText);\n }\n })\n .then(data => {\n\n const aistaSearchResultWrp = document.getElementById('aista-search-result-wrp')\n aistaSearchResultWrp.innerHTML = '';\n\n if (data.snippets && data.snippets.length > 0) {\n const list = window.document.createElement('ul');\n for (const idx of data.snippets) {\n const idxLi = window.document.createElement('li');\n const idxLnk = window.document.createElement('a');\n idxLnk.innerHTML = idx.prompt;\n idxLnk.target = '_blank';\n idxLnk.href = idx.uri;\n idxLi.appendChild(idxLnk);\n list.appendChild(idxLi);\n }\n aistaSearchResultWrp.appendChild(list);\n }\n })\n .catch(error => {\n\n console.log(error);\n });\n}", "title": "" }, { "docid": "d75e4dee93875df0878cab45a3813a30", "score": "0.5533781", "text": "function search() {\n // clear cards\n cardContainerEl.innerHTML = \"\";\n\n // show data view\n dataViewEl.style.display = \"\";\n \n // get data from playlist retrieval API\n fetch(`/search/${userSearchInput.value}`)\n .then(response => response.json())\n .then(data => analyzeData(userSearchInput.value, data));\n }", "title": "" }, { "docid": "99f12996bde11ff062c65e6b5de85869", "score": "0.55230457", "text": "function suggest(query) {\n //if the search term is empty, clear the suggestion box.\n if (query === \"\") {\n suggestionBoxObj.innerHTML = \"\";\n return;\n }\n\n //proceed only if the search term isn't empty\n // open an asynchronous request to the server.\n xmlHttp.open(\"GET\", \"podcast_search.class.php?q=\" + query, true);\n\n //handle server's responses\n xmlHttp.onreadystatechange = function () {\n // proceed only if the transaction has completed and the transaction completed successfully\n if (xmlHttp.readyState === 4 && xmlHttp.status === 200) {\n // extract the JSON received from the server\n var titles = JSON.parse(xmlHttp.responseText);\n //console.log(titlesJSON);\n // display suggested titles in a div block\n displayTitles(titles);\n }\n };\n\n // make the request\n xmlHttp.send(null);\n}", "title": "" }, { "docid": "f0a0535e6c8fabb6d53bcb4e626013c9", "score": "0.5522752", "text": "function searchUserName() {\r\n var input, filter,nouser,j , ul, li, a, i, txtValue;\r\n input = document.getElementById(\"user_search\");\r\n filter = input.value.toUpperCase();\r\n ul = document.getElementById(\"allUser\");\r\n nouser = document.getElementById(\"nouser\");\r\n li = ul.getElementsByTagName(\"li\");\r\n j=0\r\n for (i = 0; i < li.length; i++) {\r\n a = li[i].getElementsByTagName(\"a\")[0];\r\n txtValue = a.textContent || a.innerText;\r\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\r\n li[i].style.display = \"\";\r\n nouser.style.display = \"none\";\r\n } else {\r\n j=j+1\r\n li[i].style.display = \"none\";\t\r\n }\r\n }\r\n if (li.length==j) {\r\n nouser.style.display = \"\";\r\n }\r\n}", "title": "" }, { "docid": "e5be37f64770a1baf075c49d7fdd0101", "score": "0.5517181", "text": "function authSearchUser(keyword){\n\tauthLogin();\n\tvar res = '';\n\t$.ajax({\n\t\ttype: 'post',\n\t\tasync: false,\n\t\turl: auth_root + 'authlocaluser/search',\n\t\tdataType: 'html',\n\t\tdata: \"keyword=\"+keyword,\n\t\tsuccess: function(resMsg){\n\t\t\tres = resMsg;\n/*\t\t\tvar ss = $('#resMsg');\n\t\t\t//$('#resMsg').html(resMsg);\n\t\t\t$(\"#resMsg\").load(auth_root + 'authlocaluser/search');*/\n\t\t},\n\t\terror: function(){\n\t\t\tres = '-1';\n\t\t}\n\t});\n\tauthLogout();\n\treturn res;\n}", "title": "" }, { "docid": "c9519725643f17526b0728e33b68473e", "score": "0.5513292", "text": "function handleUserSpeech(lovedThing) {\n // Stop listening for a moment\n annyang.pause();\n // Check if what the user said matches the request\n // Convert both to lowercase to make matching easier\n if (lovedThing.toLowerCase() === currentLove.toLowerCase()) {\n // If they got it right, emphasize it\n displayText = `That's right. You do love ${currentLove}.`;\n // Assign a new affirmation after five seconds\n setTimeout(newAffirmation, 5000);\n }\n else {\n // If they were wrong, mock them.\n displayText = `You love ${lovedThing}? No. Try again. Say \"I love ${currentLove}.\"`;\n }\n}", "title": "" }, { "docid": "7f89214a3de01a9c15b70679ab3a16d0", "score": "0.5506479", "text": "function autoSuggestSearch (searchbox){ \n showSuggestSearchList(searchbox); \n}", "title": "" }, { "docid": "3eef0becd92b7d7fdabd312fc64a4518", "score": "0.55037326", "text": "search(name, el) {\n if(this.config.users[name] !== undefined) {\n return;\n }\n\n let url = this.api.replace('{{NAME}}', name).replace('{{FIELDS}}', 'id,name,online,audience,featured,partnered,user,type');\n $.get(url, {cached: $.now()}, (data) => {\n if(data.length <= 0) {\n if(el !== undefined) {\n el.css('outline-color', '#e74c3c').val('Failed to find ' + name);\n }\n this.trace('Failed to get user data!', err);\n } else {\n let user = {\n id: data[0].id,\n name: data[0].user.username,\n title: data[0].name,\n audience: data[0].audience,\n featured: data[0].featured,\n partnered: data[0].partnered,\n online: data[0].online,\n avatar: data[0].user.avatarUrl\n }\n this.config = {users: {[name]: user}};\n if(el !== undefined) {\n el.css('outline-color', '#2ecc71');\n }\n\n $('#mixer-users').prepend(this.Card(user));\n }\n }, 'json').fail((err) => {\n if(el !== undefined) {\n el.css('outline-color', '#e74c3c').val('Failed to find ' + name);\n }\n this.trace('Failed to get user data!', err);\n });\n\n if(el !== undefined) {\n setTimeout(() => {\n el.css('outline-color', 'initial').val('');\n }, 2300);\n }\n }", "title": "" }, { "docid": "6cc326f7788eeb0241e33187a6aff504", "score": "0.5503412", "text": "function handleUpdate() {\n var $searchInput = $(target);\n var keyword = $searchInput.val();\n\n if (keyword === undefined || keyword.length == 0) {\n closeSearch();\n } else {\n launchSearch(keyword);\n }\n }", "title": "" }, { "docid": "abcb39cd6b23329b1cac4acb85e16efa", "score": "0.54988563", "text": "function onSearchButt() {\n\t\turi.setSearch({input: $(\"#search-input\").val(), source: $(\"#data-source-selection\").val()});\n\t\t\n\t\t// if user is dumb and pressed search on empty input\n\t\tif (! uri.search(true).input) {\n\t\t\thideContent(true)\n\t\t\t$(\"#emptySearch\").show()\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tsearch();\n\t\t// why is this return false here?\n\t\treturn false;\n\t}", "title": "" }, { "docid": "1b0a53f3cfcc4bba4db00e520f48b921", "score": "0.54974514", "text": "function setUserResponse(message) {\n\tvar UserResponse = '<img class=\"userAvatar\" src=' + \"/img/userAvatar.jpg\" + '><p class=\"userMsg\">' + message + ' </p><div class=\"clearfix\"></div>';\n\t$(UserResponse).appendTo(\".chats\").show(\"slow\");\n\n\t$(\".usrInput\").val(\"\");\n\tscrollToBottomOfResults();\n\tshowBotTyping();\n\t$(\".suggestions\").remove();\n}", "title": "" }, { "docid": "da3350cdca3e5c93b3b83a03e62aac93", "score": "0.5485441", "text": "typed(){\n\n\t\tlet query = $(\"#search\").val();\n\t\tthis.showResults(query, query.length)\n\n\t}", "title": "" }, { "docid": "cfaa2a7218eb3758bf1c989fe8ff413d", "score": "0.5477544", "text": "function handlesearch() {\n const movie = document.querySelector(\".movie\").value;\n fetch(`//api.tvmaze.com/search/shows?q=${movie}`)\n .then((response) => response.json())\n .then((data) => (movies = data))\n .then((_data) => showMovies());\n}", "title": "" }, { "docid": "7f4b804bb40f5fe0a4b361b93a36e8bc", "score": "0.54691565", "text": "function searchUser() {\n\t\tvar searchBox = [];\n\t\tsearchBox.push(document.getElementById('searchBox').value);\n\t\t/*if (value === '') {\n\t\t\talert('Please Enter a Valid UserName');\n\t\t}*/\n\t table.innerHTML = \"\";\n\t\tgetInfo(searchBox);\t\n\t}", "title": "" }, { "docid": "dbbf145261568f610a4bd93e8d760af7", "score": "0.5466131", "text": "function searchUser(){\n\tvar nickname = $(\"#searchNickname\").val();\n\tvar firstName = $(\"#searchFirstName\").val();\n\tvar name = $(\"#searchName\").val();\n\txHRObject.open(\"GET\", \"ChatServlet?action=searchUser&nickname=\"+nickname+\"&firstName=\"+firstName+\"&name=\"+name);\n\txHRObject.onreadystatechange = displayFoundUsers;\n\txHRObject.overrideMimeType('text/xml');\n\txHRObject.send(null);\n}", "title": "" }, { "docid": "26acf927207d0c39be9fa26156afdfae", "score": "0.54643524", "text": "function lookup_names(inputString) {\r\n var bottone = document.getElementById(\"caricaPersona\");\r\n if(inputString.length == 0) {\r\n\t\t\t\t// disabilita il pulsante cerca iscritti\r\n\t\t\t\tbottone.disabled=true;\r\n // Hide the suggestion box.\r\n\t\t\t\t$('#suggestions_names').hide();\r\n\t\t\t} else {\r\n\t\t\t\tbottone.disabled=false;\r\n $.post(\"rpc_names.php\", {queryString: \"\"+inputString+\"\"}, function(data){\r\n if(data.length >0) {\r\n $('#suggestions_names').show();\r\n\t\t\t\t\t\t$('#autoSuggestionsListNames').html(data);\r\n\t\t\t\t\t} else {\r\n $('#suggestions_names').hide();\r\n }\r\n\t\t\t\t});\r\n\t\t\t}\r\n} // lookup", "title": "" }, { "docid": "150ac553726f1cefaf7011f96af8f2cc", "score": "0.54633427", "text": "function debounceSearch() {\n var now = new Date().getMilliseconds();\n lastSearch = lastSearch || now;\n return ((now - lastSearch) < 300);\n }", "title": "" }, { "docid": "d8393e7a8a40130df20b7f51c4206f5f", "score": "0.54630345", "text": "function _searchIfRequired() {\n if (!FindUtils.isInstantSearchDisabled() && _findBar && _findBar._options.multifile && !_findBar._options.replace) {\n setTimeout(_defferedSearch, 100);\n }\n }", "title": "" }, { "docid": "aa966e5af74ff3f35cb418b8c022a575", "score": "0.5460903", "text": "function searchUsers(q) {\n $.ajax({\n url: searchUrl,\n type: \"GET\",\n dataType: \"jsonp\",\n jsonpCallback: \"handleResults\",\n data: {\n \"type\": \"User\",\n \"query\": q\n },\n success: function(data, status) {\n },\n error: function(data, status) {\n }\n });\n}", "title": "" }, { "docid": "14c4a46511e0a8b6dbfc8370c6da533b", "score": "0.54504365", "text": "searchUser(query) {\n this.setState({ queryText: query });\n }", "title": "" }, { "docid": "6bd49b1ed11a6d37f13bd16e0050bf45", "score": "0.543965", "text": "function debounceSearch() {\n var now = new Date().getMilliseconds();\n lastSearch = lastSearch || now;\n return ((now - lastSearch) < 300);\n }", "title": "" }, { "docid": "8b41c6555e2606d81fbb8a04ae5b7071", "score": "0.5432568", "text": "function handleSearch() {\n var term = this.dataset.term; // Gather the term from the button\n\n var queryURL = API_STRING + term; // Build the query using the API_STRING and term\n\n fetch( queryURL, { method: 'GET' } ) // Send a 'GET' Ajax request to Giphy API\n .then( function ( result ) { // Catch the response object\n return result.json(); // Parse the response into a javascript object\n } )\n .then( handleApiResponse );\n}", "title": "" }, { "docid": "f721e966eb73246511469002f7a9e2c7", "score": "0.54274136", "text": "function addChatTyping(username) {\n //addMessageToList(username, false, username + \" is searching\");\n $scope.loadingIndicator = true;\n $ionicScrollDelegate.scrollBottom();\n }", "title": "" }, { "docid": "e717fd7b26bc912d2ca0a186a244718c", "score": "0.54141223", "text": "function onSearch(e) {\n updateQuery(e.target.value);\n }", "title": "" }, { "docid": "6aad4cfb8e8c93cab5375713856bfc69", "score": "0.5412646", "text": "function doSearchInChange()\n {\n hourglass();\n window.status = \"Refreshing the page, it may take a minute, please wait.....\"\n document.searchParmsForm.actSelect.value = \"searchInSelect\";\n if (document.searchResultsForm != null)\n document.searchResultsForm.Message.style.visibility=\"visible\";\n document.searchParmsForm.submit();\n }", "title": "" }, { "docid": "481c5afe6546d5b1262c966775b5a14c", "score": "0.5405669", "text": "function searchUser(req, res, next) {\n var searchTerm = req.query.searchTerm;\n var cid = mongoose.Types.ObjectId(req.body.decoded_token.orgid);\n var sT = new RegExp(searchTerm, 'i');\n var api = true; // Call origin api or webApp\n sGet.searchUser(sT, cid, api, function(err, response){\n res.json({error: err, message: response});\n });\n }", "title": "" }, { "docid": "0fe94d4b61b1bd155c3aed1957aea11c", "score": "0.54006875", "text": "function startSearch(){\n counter = 0;\n goWiki(userInput.value());\n}", "title": "" } ]
45b69bea97f24dc30367820cb1f69726
! The buffer module from node.js, for the browser.
[ { "docid": "3fa5dd86b53e2f1bb151dfb1daa53104", "score": "0.0", "text": "function n(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0}", "title": "" } ]
[ { "docid": "7bd3f46bcc91a17b957f0f804cb9fac1", "score": "0.72848964", "text": "function typedBuffer() {\n}", "title": "" }, { "docid": "7bd3f46bcc91a17b957f0f804cb9fac1", "score": "0.72848964", "text": "function typedBuffer() {\n}", "title": "" }, { "docid": "7bd3f46bcc91a17b957f0f804cb9fac1", "score": "0.72848964", "text": "function typedBuffer() {\n}", "title": "" }, { "docid": "7bd3f46bcc91a17b957f0f804cb9fac1", "score": "0.72848964", "text": "function typedBuffer() {\n}", "title": "" }, { "docid": "7bd3f46bcc91a17b957f0f804cb9fac1", "score": "0.72848964", "text": "function typedBuffer() {\n}", "title": "" }, { "docid": "7bd3f46bcc91a17b957f0f804cb9fac1", "score": "0.72848964", "text": "function typedBuffer() {\n}", "title": "" }, { "docid": "87274892a62c5e9b290a779ad86447f2", "score": "0.7243122", "text": "function createBuffer() {\n var ptr = exports.hb_buffer_create();\n return {\n ptr: ptr,\n /**\n * Add text to the buffer.\n * @param {string} text Text to be added to the buffer.\n **/\n addText: function (text) {\n const str = createJsString(text);\n exports.hb_buffer_add_utf16(ptr, str.ptr, str.length, 0, str.length);\n str.free();\n },\n /**\n * Set buffer script, language and direction.\n *\n * This needs to be done before shaping.\n **/\n guessSegmentProperties: function () {\n return exports.hb_buffer_guess_segment_properties(ptr);\n },\n /**\n * Set buffer direction explicitly.\n * @param {string} direction: One of \"ltr\", \"rtl\", \"ttb\" or \"btt\"\n */\n setDirection: function (dir) {\n exports.hb_buffer_set_direction(ptr, {\n ltr: 4,\n rtl: 5,\n ttb: 6,\n btt: 7\n }[dir] || 0);\n },\n /**\n * Set buffer flags explicitly.\n * @param {string[]} flags: A list of strings which may be either:\n * \"BOT\"\n * \"EOT\"\n * \"PRESERVE_DEFAULT_IGNORABLES\"\n * \"REMOVE_DEFAULT_IGNORABLES\"\n * \"DO_NOT_INSERT_DOTTED_CIRCLE\"\n * \"PRODUCE_UNSAFE_TO_CONCAT\"\n */\n setFlags: function (flags) {\n var flagValue = 0\n flags.forEach(function (s) {\n flagValue |= _buffer_flag(s);\n })\n\n exports.hb_buffer_set_flags(ptr,flagValue);\n },\n /**\n * Set buffer language explicitly.\n * @param {string} language: The buffer language\n */\n setLanguage: function (language) {\n var str = createAsciiString(language);\n exports.hb_buffer_set_language(ptr, exports.hb_language_from_string(str.ptr,-1));\n str.free();\n },\n /**\n * Set buffer script explicitly.\n * @param {string} script: The buffer script\n */\n setScript: function (script) {\n var str = createAsciiString(script);\n exports.hb_buffer_set_script(ptr, exports.hb_script_from_string(str.ptr,-1));\n str.free();\n },\n\n /**\n * Set the Harfbuzz clustering level.\n *\n * Affects the cluster values returned from shaping.\n * @param {number} level: Clustering level. See the Harfbuzz manual chapter\n * on Clusters.\n **/\n setClusterLevel: function (level) {\n exports.hb_buffer_set_cluster_level(ptr, level)\n },\n /**\n * Return the buffer contents as a JSON object.\n *\n * After shaping, this function will return an array of glyph information\n * objects. Each object will have the following attributes:\n *\n * - g: The glyph ID\n * - cl: The cluster ID\n * - ax: Advance width (width to advance after this glyph is painted)\n * - ay: Advance height (height to advance after this glyph is painted)\n * - dx: X displacement (adjustment in X dimension when painting this glyph)\n * - dy: Y displacement (adjustment in Y dimension when painting this glyph)\n * - flags: Glyph flags like `HB_GLYPH_FLAG_UNSAFE_TO_BREAK` (0x1)\n **/\n json: function () {\n var length = exports.hb_buffer_get_length(ptr);\n var result = [];\n var infosPtr = exports.hb_buffer_get_glyph_infos(ptr, 0);\n var infosPtr32 = infosPtr / 4;\n var positionsPtr32 = exports.hb_buffer_get_glyph_positions(ptr, 0) / 4;\n var infos = heapu32.subarray(infosPtr32, infosPtr32 + 5 * length);\n var positions = heapi32.subarray(positionsPtr32, positionsPtr32 + 5 * length);\n for (var i = 0; i < length; ++i) {\n result.push({\n g: infos[i * 5 + 0],\n cl: infos[i * 5 + 2],\n ax: positions[i * 5 + 0],\n ay: positions[i * 5 + 1],\n dx: positions[i * 5 + 2],\n dy: positions[i * 5 + 3],\n flags: exports.hb_glyph_info_get_glyph_flags(infosPtr + i * 20)\n });\n }\n return result;\n },\n /**\n * Free the object.\n */\n destroy: function () { exports.hb_buffer_destroy(ptr); }\n };\n }", "title": "" }, { "docid": "34ad3de58f8233361ff6f11a759250e7", "score": "0.720156", "text": "function haveBuffer() {\n return typeof commonjsGlobal !== 'undefined' && typeof commonjsGlobal.Buffer !== 'undefined';\n}", "title": "" }, { "docid": "3bb8641ca6325883632b83d17e23ccd0", "score": "0.71088547", "text": "function Buffer(arg){if(!(this instanceof Buffer)){ // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\nif(arguments.length>1)return new Buffer(arg,arguments[1]);return new Buffer(arg);}if(!Buffer.TYPED_ARRAY_SUPPORT){this.length=0;this.parent=undefined;} // Common case.\nif(typeof arg==='number'){return fromNumber(this,arg);} // Slightly less common case.\nif(typeof arg==='string'){return fromString(this,arg,arguments.length>1?arguments[1]:'utf8');} // Unusual.\nreturn fromObject(this,arg);}", "title": "" }, { "docid": "a93a9a012caac46b72e32f1da3cd6a9e", "score": "0.7016356", "text": "function typedBuffer() {\n }", "title": "" }, { "docid": "d650b1187784b15d5ebd9af6ae900b2c", "score": "0.6897686", "text": "function isBuffer(f){return!!f.constructor&&\"function\"==typeof f.constructor.isBuffer&&f.constructor.isBuffer(f)}", "title": "" }, { "docid": "4390e542371bf5ea99c7cfd201f049cc", "score": "0.6876125", "text": "function isBuffer(val){\nreturn val.constructor&&typeof val.constructor.isBuffer==='function'&&val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "135053f8808b573062fcf5707fff92d7", "score": "0.67993796", "text": "function Buffer (arg) {\n\t\t if (!(this instanceof Buffer)) {\n\t\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t\t return new Buffer(arg)\n\t\t }\n\t\t\n\t\t this.length = 0\n\t\t this.parent = undefined\n\t\t\n\t\t // Common case.\n\t\t if (typeof arg === 'number') {\n\t\t return fromNumber(this, arg)\n\t\t }\n\t\t\n\t\t // Slightly less common case.\n\t\t if (typeof arg === 'string') {\n\t\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t\t }\n\t\t\n\t\t // Unusual.\n\t\t return fromObject(this, arg)\n\t\t}", "title": "" }, { "docid": "f25d2b36a900fa5a783a3adf44cadb55", "score": "0.6771843", "text": "function SyncBuffer(buffer)\n{\n this.buffer = buffer;\n this.byteLength = buffer.byteLength;\n}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.6756601", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.6756601", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.6756601", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.6756601", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.6756601", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.6756601", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "cce11bc7c3f251c6620d9099d5c34bc3", "score": "0.6756601", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "5667a3faf40572e6e5571de43f8df289", "score": "0.6752995", "text": "function wrapBuffer(buffer) {\n return buffer;\n}", "title": "" }, { "docid": "6108aecb40ac86f11f56df7fdb44d0f1", "score": "0.67455983", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "6108aecb40ac86f11f56df7fdb44d0f1", "score": "0.67455983", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "6108aecb40ac86f11f56df7fdb44d0f1", "score": "0.67455983", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "6108aecb40ac86f11f56df7fdb44d0f1", "score": "0.67455983", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "6108aecb40ac86f11f56df7fdb44d0f1", "score": "0.67455983", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "6108aecb40ac86f11f56df7fdb44d0f1", "score": "0.67455983", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.67258656", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.67258656", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.67258656", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.67258656", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.67258656", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.67258656", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "306bff33ccc62767071c7b5c17e70cb9", "score": "0.67258656", "text": "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6712946", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6712946", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6712946", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6712946", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6712946", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6712946", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6712946", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6712946", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6712946", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6712946", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6712946", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6712946", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6712946", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6712946", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6712946", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "2592b477c9e3b00e6b2baae58de285cd", "score": "0.6712946", "text": "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "title": "" }, { "docid": "f44564c8b8fc2b4b6178ace216c5f8dc", "score": "0.6696977", "text": "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "f44564c8b8fc2b4b6178ace216c5f8dc", "score": "0.6696977", "text": "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "f44564c8b8fc2b4b6178ace216c5f8dc", "score": "0.6696977", "text": "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "f44564c8b8fc2b4b6178ace216c5f8dc", "score": "0.6696977", "text": "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "f44564c8b8fc2b4b6178ace216c5f8dc", "score": "0.6696977", "text": "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "f44564c8b8fc2b4b6178ace216c5f8dc", "score": "0.6696977", "text": "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "title": "" }, { "docid": "23312aa37c242874a3323faba55bf0b7", "score": "0.6695265", "text": "function Buffer(arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1]);\n\t return new Buffer(arg);\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0;\n\t this.parent = undefined;\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg);\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8');\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg);\n\t}", "title": "" }, { "docid": "4c718d0643d96e89a15b054166fe7696", "score": "0.6690119", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\n\tif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.6687787", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "d5dbb254eedb73855abf1cf5d5bf6364", "score": "0.6687787", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "title": "" }, { "docid": "3baaef39beb666557d5b51790913924a", "score": "0.6684633", "text": "function isBuffer(value) {\n var _a;\n return typeof value === 'object' && ((_a = value === null || value === void 0 ? void 0 : value.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'Buffer';\n}", "title": "" }, { "docid": "239ca3b0d40d0423b414df93e5e87e81", "score": "0.667462", "text": "function Buffer(arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1]);\n\t return new Buffer(arg);\n\t }\n\n\t this.length = 0;\n\t this.parent = undefined;\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg);\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8');\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg);\n\t}", "title": "" }, { "docid": "9af0ff4cff70f2c5b8c0a1ed1a35c3b4", "score": "0.6670681", "text": "function StringBuffer()\n{ \n this.buffer = []; \n}", "title": "" }, { "docid": "a23a2eba21d16363f42186ce47bb3b0f", "score": "0.6664396", "text": "function Buffer(arg,encodingOrOffset,length){\n// Common case.\nif(typeof arg===\"number\"){if(typeof encodingOrOffset===\"string\"){throw new Error(\"If encoding is specified then the first argument must be a string\")}return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}", "title": "" }, { "docid": "8aa5753adfbc730bd331a2dbd05b2966", "score": "0.6644955", "text": "function Buffer(arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1]);\n\t return new Buffer(arg);\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0;\n\t this.parent = undefined;\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg);\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8');\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg);\n\t}", "title": "" }, { "docid": "8aa5753adfbc730bd331a2dbd05b2966", "score": "0.6644955", "text": "function Buffer(arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1]);\n\t return new Buffer(arg);\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0;\n\t this.parent = undefined;\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg);\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8');\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg);\n\t}", "title": "" }, { "docid": "2800f806b81c8a61cf6c6a1723910198", "score": "0.66303414", "text": "function getBufferFromIfPresent() {\n return root.Buffer && root.Buffer.from && root.Buffer.from.bind(root.Buffer);\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627303", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627303", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627303", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627303", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627303", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627303", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627303", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627303", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627303", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627303", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627303", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627303", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627303", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627303", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627303", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627303", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "7c7208ae74579ecb4d95214dc569d76b", "score": "0.6627303", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "9bb0c0b4ee51810133200fdecdc2b52e", "score": "0.65904045", "text": "function Buffer(arg,encodingOrOffset,length){// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The \"string\" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "9bb0c0b4ee51810133200fdecdc2b52e", "score": "0.65904045", "text": "function Buffer(arg,encodingOrOffset,length){// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The \"string\" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "title": "" }, { "docid": "e8a26321afd458e3ab060d7f53210c87", "score": "0.65772426", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n }", "title": "" }, { "docid": "621fa6b2e45c5ffef874b0b49db133d0", "score": "0.65736705", "text": "function loadBuffer(url) {\n if(typeof document !== 'undefined') {\n buffer = new Uint8Array([30]);\n } else {\n buffer = fs.readFileSync(url);\n }\n}", "title": "" }, { "docid": "e7b91a9ced485cd80218098b66960c53", "score": "0.6556578", "text": "function DBusBuffer(buffer, startPos, options) {\n if (typeof options !== 'object') {\n options = { ayBuffer: true, ReturnLongjs: false };\n } else if (options.ayBuffer === undefined) {\n // default settings object\n options.ayBuffer = true; // enforce truthy default props\n }\n this.options = options;\n this.buffer = buffer;\n (this.startPos = startPos ? startPos : 0), (this.pos = 0);\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65460664", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65460664", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65460664", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65460664", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65460664", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65460664", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65460664", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65460664", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65460664", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65460664", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" }, { "docid": "aab9241fd04991ae6c90cc213649f2f2", "score": "0.65460664", "text": "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "title": "" } ]
1b3df15174f06a8d3542e31a50000a72
Create/update multiple synonym objects at once, potentially replacing the entire list of synonyms if replaceExistingSynonyms is true.
[ { "docid": "68f095a8c2a934fdfee17757555f0f8a", "score": "0.621996", "text": "saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms, }, requestOptions) {\r\n if (!indexName) {\r\n throw new Error('Parameter `indexName` is required when calling `saveSynonyms`.');\r\n }\r\n if (!synonymHit) {\r\n throw new Error('Parameter `synonymHit` is required when calling `saveSynonyms`.');\r\n }\r\n const requestPath = '/1/indexes/{indexName}/synonyms/batch'.replace('{indexName}', encodeURIComponent(indexName));\r\n const headers = {};\r\n const queryParameters = {};\r\n if (forwardToReplicas !== undefined) {\r\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\r\n }\r\n if (replaceExistingSynonyms !== undefined) {\r\n queryParameters.replaceExistingSynonyms =\r\n replaceExistingSynonyms.toString();\r\n }\r\n const request = {\r\n method: 'POST',\r\n path: requestPath,\r\n queryParameters,\r\n headers,\r\n data: synonymHit,\r\n };\r\n return transporter.request(request, requestOptions);\r\n }", "title": "" } ]
[ { "docid": "831a5624ef71224730f85b6bc98abab3", "score": "0.6221651", "text": "insertNewSynonym() {\n this.data.synonyms.push(new RelationTypeSynonym());\n }", "title": "" }, { "docid": "f6ca9b92560e41002f030608cbfb79e0", "score": "0.51158565", "text": "saveSynonym({ indexName, objectID, synonymHit, forwardToReplicas }, requestOptions) {\r\n if (!indexName) {\r\n throw new Error('Parameter `indexName` is required when calling `saveSynonym`.');\r\n }\r\n if (!objectID) {\r\n throw new Error('Parameter `objectID` is required when calling `saveSynonym`.');\r\n }\r\n if (!synonymHit) {\r\n throw new Error('Parameter `synonymHit` is required when calling `saveSynonym`.');\r\n }\r\n if (!synonymHit.objectID) {\r\n throw new Error('Parameter `synonymHit.objectID` is required when calling `saveSynonym`.');\r\n }\r\n const requestPath = '/1/indexes/{indexName}/synonyms/{objectID}'\r\n .replace('{indexName}', encodeURIComponent(indexName))\r\n .replace('{objectID}', encodeURIComponent(objectID));\r\n const headers = {};\r\n const queryParameters = {};\r\n if (forwardToReplicas !== undefined) {\r\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\r\n }\r\n const request = {\r\n method: 'PUT',\r\n path: requestPath,\r\n queryParameters,\r\n headers,\r\n data: synonymHit,\r\n };\r\n return transporter.request(request, requestOptions);\r\n }", "title": "" }, { "docid": "b5bea995e6530f28bffdd792a27a7856", "score": "0.5034668", "text": "insertUpdatedMetaDocs() {\n return Promise.resolve().then(() => {\n return this.mongoShell.updateManyMetaDocs(this.updatedMetaDocs);\n })\n .then(() => {\n if (this.newTurtleMetaDocs.length > 0) {\n return this.mongoShell.command(this.mongoShell._meta, \"CREATE_MANY\", this.newTurtleMetaDocs);\n }\n })\n }", "title": "" }, { "docid": "0b06821bdf1b13ce7545ad110fcc5fa6", "score": "0.49956942", "text": "function insertSymptoms(symps) {\n\tsymptomList.find('ul').empty();\n\n\tsymps = symps || symptoms;\n\tfor (var i = 0; i < symps.length; i++) {\n\t\tcreateSymptomBlock(symps[i].symptom);\n\t}\n\treloadHandlers();\n}", "title": "" }, { "docid": "3b97390834aa98caa28b4355a794c10f", "score": "0.4925213", "text": "addSynonyms(event, data) {\n this.synService.create(this.botId, this.entityId, { keyword: data.keyword, synonym: event.target.value }).subscribe(res => {\n if (res.status === 200)\n this.getInfo();\n });\n }", "title": "" }, { "docid": "baf4a6a85666ff6290fb0df485017f8c", "score": "0.4832269", "text": "async addNoiseWords(noiseText) {\n //TODO\n let allwords = await this.words(noiseText); \n \t\tallwords.forEach(async function(element){ \n let m = await this.dbtable1.updateOne({word:element},{$set:{word:element}},{upsert:true});\n },this); \n }", "title": "" }, { "docid": "3edd93edf6564a4fcf351def0cc9fec7", "score": "0.47836983", "text": "async function createWorkspaces() {\n framedMediumLogging('Creating workspaces...');\n\n console.info('Configuring the workspaces', workspacesList);\n\n const workspaces = workspacesList.split(',');\n await asyncForEach(workspaces, async ws => {\n // create namespace URI from workspace name\n const nameSpaceUri = nameSpaceBaseUrl + ws;\n const wsCreated = await grc.namespaces.create(ws, nameSpaceUri);\n if (wsCreated) {\n console.info('Successfully created workspace', wsCreated);\n } else {\n console.error('Failed creating workspace (maybe already existing) ',\n ws, wsCreated);\n }\n });\n}", "title": "" }, { "docid": "d2f3244e1ce1330cc3bb2fa630a97bb5", "score": "0.4774437", "text": "function replaceWithMultiple(nodes) {\n\t this.resync();\n\n\t nodes = this._verifyNodeList(nodes);\n\t t.inheritLeadingComments(nodes[0], this.node);\n\t t.inheritTrailingComments(nodes[nodes.length - 1], this.node);\n\t this.node = this.container[this.key] = null;\n\t this.insertAfter(nodes);\n\n\t if (this.node) {\n\t this.requeue();\n\t } else {\n\t this.remove();\n\t }\n\t}", "title": "" }, { "docid": "b6afe6018589bb3435f682529685fb57", "score": "0.4772919", "text": "function replaceWithMultiple(nodes) {\n this.resync();\n\n nodes = this._verifyNodeList(nodes);\n t.inheritLeadingComments(nodes[0], this.node);\n t.inheritTrailingComments(nodes[nodes.length - 1], this.node);\n this.node = this.container[this.key] = null;\n this.insertAfter(nodes);\n\n if (this.node) {\n this.requeue();\n } else {\n this.remove();\n }\n}", "title": "" }, { "docid": "ce9b5250a303261b2f1697bcbaf5e0ce", "score": "0.46959946", "text": "static getAllSyndicates()\n {\n var output = [];\n\n for (var synd of defaultSyndicates)\n output.push(new Syndicate(synd.handle));\n\n return output;\n }", "title": "" }, { "docid": "7650eefca9dc235c597755fb07084092", "score": "0.46700406", "text": "function syncWithAll(){\r\n for(var svr of knownMasterServers){\r\n syncWithKnownMasterServer(svr);\r\n }\r\n}", "title": "" }, { "docid": "00f58668a88a6031869049b8a4e46392", "score": "0.45183855", "text": "function useEndonyms(result, doc) {\n try {\n // iterate over all dictionaries loaded above\n _.each(endonyms, (mapping, placetype) => {\n\n // find the parent ID and check for a corresponding alias map\n let parentID = _.first(_.castArray(_.get(doc, `parent.${placetype}_id`, [])));\n if (!_.has(mapping, parentID, [])) { return; } // no mapping for ID\n\n // find parent source and ensure it is WOF (either explicitely or by omission)\n let parentSrc = _.first(_.get(doc, `parent.${placetype}_source`, []));\n if (!!parentSrc && parentSrc !== 'whosonfirst') { return; }\n\n // add each alias which is not already defined\n _.difference(\n _.get(mapping, parentID, []),\n _.castArray(_.get(doc, `parent.${placetype}`, []))\n ).forEach(alias => {\n // note: addParent can throw an error if, for example, alias is an empty string\n doc.addParent(placetype, alias, parentID);\n });\n });\n }\n catch (err) {\n logger.warn('failed to set endonym', err);\n }\n}", "title": "" }, { "docid": "5433bd2b2a4e7ef5c2c02e86c82bb920", "score": "0.45104024", "text": "putRestaurants(restaurants, forceUpdate = false) {\n if (!restaurants.push) restaurants = [restaurants];\n return this.db.then(db => {\n const store = db.transaction('restaurants', 'readwrite').objectStore('restaurants');\n Promise.all(restaurants.map(networkRestaurant => {\n return store.get(networkRestaurant.id).then(idbRestaurant => {\n if (forceUpdate) return store.put(networkRestaurant);\n if (!idbRestaurant || new Date(networkRestaurant.updatedAt) > new Date(idbRestaurant.updatedAt)) {\n return store.put(networkRestaurant);\n }\n });\n })).then(function () {\n return store.complete;\n });\n });\n }", "title": "" }, { "docid": "9113fb06b5ef6878be69cc33fb25cd5a", "score": "0.44960046", "text": "function bulkSaveConcepts (concepts) {\n console.log(\"start time : \" + (new Date()));\n scope.warningConcepts = [];\n scope.errorConcepts = [];\n scope.validConcepts = [];\n scope.template = null;\n var originalConcepts = angular.copy(concepts);\n console.log(concepts);\n // looking for error/warning/valid concepts from local\n angular.forEach(concepts, function(concept, i) {\n if (componentAuthoringUtil.checkConceptComplete(concept).length > 0) {\n concept.errorMsg = 'Incomplete';\n scope.errorConcepts.push(concept);\n scope.batchTableParams.reload();\n $rootScope.$broadcast('batchEditing.conceptSavedWithErrors');\n } else if (isDuplicatedConcept(concept, i, originalConcepts)) {\n scope.warningConcepts.push(concept);\n } else {\n scope.validConcepts.push(concept);\n }\n });\n console.log(scope.validConcepts);\n\n // validate against Term-server for valid concepts\n var copiedValidConcepts = [];\n for (var i = 0; i < scope.validConcepts.length; i++) {\n scope.validConcepts[i].tableAction = 'Validating...';\n scope.validConcepts[i].validation = null;\n var copiedConcept = angular.copy(scope.validConcepts[i]);\n terminologyServerService.cleanConcept(copiedConcept, true);\n copiedValidConcepts.push(copiedConcept);\n }\n scope.template = scope.validConcepts[0].template;\n\n bulkValidateConcepts(copiedValidConcepts).then(function(){\n if (scope.validConcepts.length > 0) {\n var clonedConcepts = []; \n for (var i = 0; i < scope.validConcepts.length; i++) { \n scope.validConcepts[i].tableAction = 'Saving...';\n var copiedConcept = angular.copy(scope.validConcepts[i]);\n terminologyServerService.cleanConcept(copiedConcept, false);\n clonedConcepts.push(copiedConcept); \n } \n console.log(clonedConcepts);\n // bulk save concepts\n terminologyServerService.bulkUpdateConcept(scope.branch,clonedConcepts,true).then(function(response){\n terminologyServerService.bulkRetrieveFullConcept(response.conceptIds,scope.branch).then(function(concepts){\n console.log(\"bulk save finish time : \" + (new Date()));\n // Save all warning concepts one-by-one\n if ( scope.warningConcepts.length > 0) {\n saveAllHelper(scope.warningConcepts);\n }\n\n bulkStoreAndLogTempleteConcept(concepts).then(function() {\n // Remove concept from editing and table\n angular.forEach(scope.validConcepts, function(concept) {\n batchEditingService.removeBatchConcept(concept.conceptId, true).then(function () {\n removeViewedConcept(concept.conceptId);\n scope.batchTableParams.reload();\n }, function (error) {\n notificationService.sendError('Unexpected error removing batch concept: ' + error);\n });\n });\n\n // update state after remove\n batchEditingService.updateBatchUiState();\n $rootScope.$broadcast('batchEditing.batchSaveConceptsComplete', {numberSavedConcepts : scope.validConcepts.length});\n });\n });\n }, function (error) {\n notificationService.sendError('Unexpected error saving batch concept: ' + error);\n });\n }\n\n // Save all warning concepts one-by-one\n if (scope.validConcepts.length == 0 && scope.warningConcepts.length > 0) {\n saveAllHelper(scope.warningConcepts);\n }\n });\n }", "title": "" }, { "docid": "4ebbc87066d74a0ea79b8cb022b1143b", "score": "0.447273", "text": "function insert_data_to_weather_query(coordinates) {\n var array_first_n = getfromquery()\n var array_sec_n = getfromquery1()\n array_first_n = lemma_data_orgenizer(array_first_n)\n array_sec_n = lemma_data_orgenizer(array_sec_n)\n // array_first_n.push.apply(array_first_n,array_sec_n)\n var returnd = lemma_data_orgenizer(array_first_n)\n MongoClient.connect('mongodb://ronenpi18:[email protected]:27017,cluster0-shard-00-01-n9k3j.mongodb.net:27017,cluster0-shard-00-02-n9k3j.mongodb.net:27017/test?ssl=true&replicaSet=Cluster0-shard-0&authSource=admin', function (err, db) {\n if (err) throw err;\n for(var i=0;i<69;i++) {\n db.collection('beaches').findOneAndUpdate(\n array_first_n[i][0].place, // query\n [['_id', 'asc']], // sort order\n {$set: {weather_general: array_first_n[i]}}, // replacement, replaces only the field \"hi\"\n {}, // options\n function (err, object) {\n if (err) {\n console.warn(err.message); // returns error if no matching object found\n } else {\n // console.dir(object);\n console.log(\"good\")\n }\n });\n }\n for(var j=0;j<67;j++) {\n db.collection('beaches').findOneAndUpdate(\n array_sec_n[j][0].place, // query\n [['_id', 'asc']], // sort order\n {$set: {weather_general: array_sec_n[j]}}, // replacement, replaces only the field \"hi\"\n {}, // options\n function (err, object) {\n if (err) {\n console.warn(err.message); // returns error if no matching object found\n } else {\n // console.dir(object);\n console.log(\"good\")\n }\n });\n }\n // for(var i=0;i<coordinates.length-1;i++) {\n //\n // db.collection('beaches').findAndModify(\n // returnd[i][0].place, // query\n // [['_id', 'asc']], // sort order\n // {$set: {weather_general: returnd[i]}}, // replacement, replaces only the field \"hi\"\n // {}, // options\n // function (err, object) {\n // if (err) {\n // console.warn(err.message); // returns error if no matching object found\n // } else {\n // // console.dir(object);\n // // console.log(\"good\")\n // }\n // });\n // }\n db.close((function(closeResult){\n console.log(\"ok.. lets see what up\")\n }));\n });\n\n}", "title": "" }, { "docid": "a4f9126c517970996883ebed24a264c7", "score": "0.44547236", "text": "async postMapping({ bodyStream, bulk = false, bulkReplace = true }) {\n if (!bodyStream) {\n throw new MalformedBodyError()\n }\n\n let isMultiple = true\n\n // As a workaround, build body from bodyStream\n // TODO: Use actual stream\n let mappings = await new Promise((resolve) => {\n const body = []\n bodyStream.on(\"data\", mapping => {\n body.push(mapping)\n })\n bodyStream.on(\"isSingleObject\", () => {\n isMultiple = false\n })\n bodyStream.on(\"end\", () => {\n resolve(body)\n })\n })\n\n let response\n\n // Adjust all mappings\n mappings = await Promise.all(mappings.map(async mapping => {\n try {\n // Add created and modified dates.\n const now = (new Date()).toISOString()\n if (!bulk || !mapping.created) {\n mapping.created = now\n }\n mapping.modified = now\n // Validate mapping\n if (!validateMapping(mapping)) {\n throw new InvalidBodyError()\n }\n if (mapping.partOf) {\n throw new InvalidBodyError(\"Property `partOf` is currently not allowed.\")\n }\n // Check cardinality for 1-to-1\n if (config.mappings.cardinality == \"1-to-1\" && jskos.conceptsOfMapping(mapping, \"to\").length > 1) {\n throw new InvalidBodyError(\"Only 1-to-1 mappings are supported.\")\n }\n // Add mapping schemes if necessary (e.g. from concepts' `inScheme` property)\n utils.addMappingSchemes(mapping)\n // Check if schemes are available and replace them with URI/notation only\n await this.schemeService.replaceSchemeProperties(mapping, [\"fromScheme\", \"toScheme\"])\n // Reject mapping if either fromScheme or toScheme is missing\n for (let field of [\"fromScheme\", \"toScheme\"]) {\n if (!mapping[field]) {\n throw new InvalidBodyError(`Property \\`${field}\\` is missing.`)\n }\n }\n this.checkWhitelists(mapping)\n // _id and URI\n delete mapping._id\n let uriBase = config.baseUrl + \"mappings/\"\n if (mapping.uri) {\n let uri = mapping.uri\n // URI already exists, use if it's valid, otherwise move to identifier\n if (uri.startsWith(uriBase) && utils.isValidUuid(uri.slice(uriBase.length, uri.length))) {\n mapping._id = uri.slice(uriBase.length, uri.length)\n } else {\n mapping.identifier = (mapping.identifier || []).concat([uri])\n }\n }\n if (!mapping._id) {\n mapping._id = utils.uuid()\n mapping.uri = uriBase + mapping._id\n }\n // Make sure URI is a https URI when in production\n if (config.env === \"production\") {\n mapping.uri.replace(\"http:\", \"https:\")\n }\n // Set mapping identifier\n mapping.identifier = jskos.addMappingIdentifiers(mapping).identifier\n // Set mapping type to mappingRelation if not set\n if (!mapping.type || !mapping.type.length) {\n mapping.type = [\"http://www.w3.org/2004/02/skos/core#mappingRelation\"]\n }\n\n return mapping\n } catch(error) {\n if (bulk) {\n return null\n }\n throw error\n }\n }))\n mappings = mappings.filter(m => m)\n\n if (bulk) {\n // Use bulkWrite for most efficiency\n mappings.length && await Mapping.bulkWrite(utils.bulkOperationForEntities({ entities: mappings, replace: bulkReplace }))\n response = mappings.map(c => ({ uri: c.uri }))\n } else {\n response = await Mapping.insertMany(mappings, { lean: true })\n }\n\n return isMultiple ? response : response[0]\n }", "title": "" }, { "docid": "d934f3cc9113c57620d47d0c4c83fcee", "score": "0.44254842", "text": "function addSkillToMentors(mentorsArr, newSkill) {\n mentorsArr.forEach((obj) => {\n obj.addSkill(newSkill);\n });\n}", "title": "" }, { "docid": "91fc7112097b57ac9f6b4e7c1f274f7f", "score": "0.44046763", "text": "updateDynamics() {\n const smoNote = this.previousNote;\n const tickCursor = this.tickCursor;\n const newArray = [];\n this.dynamics.forEach((dynamic) => {\n if (tickCursor >= dynamic.offset) {\n // TODO: change the smonote name of this interface\n smoNote.addModifier(new SmoDynamicText({ text: dynamic.dynamic }));\n } else {\n newArray.push(dynamic);\n }\n });\n this.dynamics = newArray;\n }", "title": "" }, { "docid": "a6a1161351d76f872f6be05a03c534bc", "score": "0.4362781", "text": "function assignRealSyls(sentences, raw_sentences){\n return _.map(sentences,function(sentence,sentence_index){\n return _.map(sentence,function(word,word_index){\n var parsed_syls = word,\n phoword = raw_sentences[sentence_index][word_index];\n return [word,translateWord(phoword,parsed_syls)[1]];\n });\n });\n }", "title": "" }, { "docid": "c9ae88cb7918967a15e5dd8140d95c71", "score": "0.43405694", "text": "visitCreate_synonym(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "c87104d5c013347c59d49d77ae15c9a7", "score": "0.43360126", "text": "updateMultiple() {}", "title": "" }, { "docid": "9681886ef5221c654f8876fc62ed44bf", "score": "0.43108723", "text": "set objectives(newObjectives) {\n this._objectives = newObjectives;\n for (i=0; i<this.newObjectives.length; i++) {\n scorm.set(`cmi.interactions.${this.index}.objectives.$[i}.id`, this._objectives[i].id);\n }\n scorm.save();\n }", "title": "" }, { "docid": "3df72b42beea2932626856f88e036a7f", "score": "0.42846775", "text": "async function addNames(newName) {\n let allNames = await read();\n allNames.push(newName);\n await write(allNames);\n}", "title": "" }, { "docid": "e9eb3907300372fdd482d2984e627c92", "score": "0.4268685", "text": "async function createObjectsS(n, a) {\n const objcts = Array.apply(null, Array(n)).map(() => {\n const o = mkValidObject();\n o.set('account', a.user.account);\n return o;\n });\n\n for (const o of objcts) {\n await o.save(null, { sessionToken: a.user.getSessionToken() });\n }\n}", "title": "" }, { "docid": "f8de1404180289a74a6a41040cfb4860", "score": "0.42577258", "text": "async addNoiseWords(noiseText) {\n //TODO\n const noiseWordsSet = noiseText.split('\\n');\n const noiseTable = this.db.collection(this.noiseSet);\n try{\n await noiseTable.insertOne({\n _id: 1,\n item: 'polarizing_filter',\n tags:[]\n });\n for(const word of noiseWordsSet){\n await noiseTable.updateOne({_id: 1}, {$addToSet: { tags: word }}); \n } \n }catch(err){\n console.log('insert noise words error!');\n throw err;\n }\n }", "title": "" }, { "docid": "b397b47c0b3b0f9b647654f5901ce8e9", "score": "0.42448166", "text": "function _sharedOntologiesUpdated(newSharedOntologyIds, oldSharedOntologyIds) {\n //console.debug(\"_sharedOntologiesUpdated::\", newSharedOntologyIds);\n var invalidIntegrationColumns = self.getIntegrationColumns().filter(function(column) {\n return newSharedOntologyIds.indexOf(column.ontologyId) === -1;\n });\n }", "title": "" }, { "docid": "e7a0a977c4c5521c77f1b78dcb3071d3", "score": "0.4229275", "text": "function BulkUpdateItems(docArray) {\n var deferred = $.Deferred();\n var itemArray = [];\n for (var i = 0; i < docArray.length; i++) {\n var documentID = docArray[i].ID;\n var oListItem = oList.getItemById(documentID);\n var isEmpty = false;\n\n for (var j = 0; j < metadataFieldConfigArray.length; j++) {\n\n var mmsValue = docArray[i][metadataFieldConfigArray[j]];\n\n if (mmsValue != \"\" && mmsValue != null) {\n\n var field = oList.get_fields().getByInternalNameOrTitle(metadataFieldConfigArray[j]);\n var taxField = clientContext.castTo(field, SP.Taxonomy.TaxonomyField);\n\n var mmsValArray = mmsValue.split('|');\n var termValue = new SP.Taxonomy.TaxonomyFieldValue();\n termValue.set_label(mmsValArray[0]);\n termValue.set_termGuid(mmsValArray[1]);\n termValue.set_wssId(-1);\n taxField.setFieldValueByValue(oListItem, termValue);\n clientContext.load(taxField);\n } else {\n isEmpty = true;\n }\n\n }\n\n if (!isEmpty) {\n oListItem.update();\n itemArray[i] = oListItem;\n\n clientContext.load(itemArray[i]);\n }\n }\n\n clientContext.executeQueryAsync(function (sender, args) {\n deferred.resolve();\n }, function (sender, args) {\n deferred.reject(args.get_message());\n });\n return deferred.promise();\n}", "title": "" }, { "docid": "9a1236352187678b71f5b44b13db374c", "score": "0.42221954", "text": "clearAllSynonyms({ indexName, forwardToReplicas }, requestOptions) {\r\n if (!indexName) {\r\n throw new Error('Parameter `indexName` is required when calling `clearAllSynonyms`.');\r\n }\r\n const requestPath = '/1/indexes/{indexName}/synonyms/clear'.replace('{indexName}', encodeURIComponent(indexName));\r\n const headers = {};\r\n const queryParameters = {};\r\n if (forwardToReplicas !== undefined) {\r\n queryParameters.forwardToReplicas = forwardToReplicas.toString();\r\n }\r\n const request = {\r\n method: 'POST',\r\n path: requestPath,\r\n queryParameters,\r\n headers,\r\n };\r\n return transporter.request(request, requestOptions);\r\n }", "title": "" }, { "docid": "6138ccbeb2386cbe587e2b8c9853d257", "score": "0.41935292", "text": "function update_managers(data, database, done)\n{\n async.each(data, function(item, callback) {\n database.managers.update({ dn: item.dn }, item, { upsert : true },\n function(err, result) {\n // no error reporting here\n callback(); // item updated\n });\n }, function(err) {\n if(err)\n console.log(err);\n done();\t\t// all items are done\n });\n}", "title": "" }, { "docid": "2e9ce080d1c96a258061e773e9f9d761", "score": "0.41879767", "text": "function addSkill(mentors, skill) {\n for (var i = 0; i < mentors.length; i++) {\n var mentor = mentors[i];\n mentor.addSkill(skill);\n }\n}", "title": "" }, { "docid": "a64fec0452dae920788cefb37f784673", "score": "0.41865262", "text": "function registerAliases(req, res) {\n\tlogger.info(\"saving aliases\", {requestBody: req.body});\n\n\tif (req.body == null) return;\n\n\tvar participants = _.isArray(req.body) ? req.body : [req.body];\n\n\tdbCall(function (db) {\n\t\tvar statement = db.prepare(\"INSERT INTO alias (participantId, alias) VALUES ($participantId, $alias)\");\n\t\tvar updateStatement = db.prepare(\"UPDATE alias SET alias=$alias WHERE participantId=$participantId\");\n\t\tvar checkStatement = db.prepare(\"SELECT count(*) FROM alias WHERE participantId=$participantId AND alias=$alias\");\n\t\tvar errors = [];\n\t\tvar updates = [];\n\t\tvar checkDuplicates = [];\n\t\tvar duplicates = [];\n\t\tinsert();\n\n\t\tfunction insert() {\n\t\t\tlogger.info(\"insert\");\n\t\t\t_.each(participants, function (participant) {\n\t\t\t\t// TODO: probably should be more secure....\n\t\t\t\tvar params = {\n\t\t\t\t\t$alias: participant.alias,\n\t\t\t\t\t$participantId: participant.participantId,\n\t\t\t\t};\n\t\t\t\tstatement.run(params, function (err) {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tif (err.errno === 19 && err.toString().match(\"column alias is not unique\")) {\n\t\t\t\t\t\t\t// somebody has this alias (possibly this participantId)\n\t\t\t\t\t\t\tcheckDuplicates.push(params);\n\t\t\t\t\t\t\tlogger.warn(\"alias not unique\", {params: params});\n\t\t\t\t\t\t} else if (err.errno === 19 && err.toString().match(\"column participantId is not unique\")) {\n\t\t\t\t\t\t\t// update the participantId to use the new alias\n\t\t\t\t\t\t\tupdates.push(params);\n\t\t\t\t\t\t\tlogger.warn(\"participantId not unique\", {params: params});\n\t\t\t\t\t\t}\telse {\n\t\t\t\t\t\t\tlogger.error(\"error\", {err: err, params: params});\n\t\t\t\t\t\t\terrors.push(err);\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// send response after all participants have been added\n\t\t\tstatement.finalize(function (err) {\n\t\t\t\tif (updates.length) {\n\t\t\t\t\tupdate();\n\t\t\t\t} else if (checkDuplicates.length) {\n\t\t\t\t\tcheck();\n\t\t\t\t} else {\n\t\t\t\t\tsendResponse(err);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tfunction update() {\n\t\t\tlogger.info(\"update %j\", updates);\n\t\t\t_.each(updates, function (params) {\n\t\t\t\tupdateStatement.run(params, function (err) {\n\t\t\t\t\tlogger.info(\"ran update\", {changes: this.changes, params: params});\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\terrors.push(err);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tupdateStatement.finalize(function (err) {\n\t\t\t\tif (checkDuplicates.length) {\n\t\t\t\t\tcheck();\n\t\t\t\t} else {\n\t\t\t\t\tsendResponse(err);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tfunction check() {\n\t\t\tlogger.info(\"check \", {checkDuplicates: checkDuplicates });\n\t\t\t_.each(checkDuplicates, function (params) {\n\t\t\t\tcheckStatement.get(params, function (err, row) {\n\t\t\t\t\tlogger.info(\"ran check\", {err: err, changes: this.changes, params: params});\n\t\t\t\t\tif (row[\"count(*)\"]) {\n\t\t\t\t\t\tlogger.info(\"ALREADY IN DB\", {params: params});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlogger.info(\"ALIAS DUPLICATED ERROR\", {params: params});\n\t\t\t\t\t\tduplicates.push({ alias: params.$alias, participantId: params.$participantId });\n\t\t\t\t\t}\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\terrors.push(err);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tcheckStatement.finalize(sendResponse);\n\t\t}\n\n\t\tfunction sendResponse(err) {\n\t\t\tlogger.info(\"sending response\");\n\t\t\tif (err || errors.length) {\n\t\t\t\tif (err) {\n\t\t\t\t\tlogger.error(err);\n\t\t\t\t}\n\t\t\t\tif (errors.length) {\n\t\t\t\t\tlogger.error(errors);\n\t\t\t\t}\n\n\t\t\t\tres.send(500);\n\t\t\t} else {\n\t\t\t\tvar result = {};\n\t\t\t\tif (duplicates.length) {\n\t\t\t\t\tresult.duplicates = duplicates;\n\t\t\t\t}\n\t\t\t\tres.send(200, result);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "e50523d18bc67c2f6ef7fdbb31608c85", "score": "0.41861597", "text": "searchSynonyms({ indexName, type, page, hitsPerPage, searchSynonymsParams, }, requestOptions) {\r\n if (!indexName) {\r\n throw new Error('Parameter `indexName` is required when calling `searchSynonyms`.');\r\n }\r\n const requestPath = '/1/indexes/{indexName}/synonyms/search'.replace('{indexName}', encodeURIComponent(indexName));\r\n const headers = {};\r\n const queryParameters = {};\r\n if (type !== undefined) {\r\n queryParameters.type = type.toString();\r\n }\r\n if (page !== undefined) {\r\n queryParameters.page = page.toString();\r\n }\r\n if (hitsPerPage !== undefined) {\r\n queryParameters.hitsPerPage = hitsPerPage.toString();\r\n }\r\n const request = {\r\n method: 'POST',\r\n path: requestPath,\r\n queryParameters,\r\n headers,\r\n data: searchSynonymsParams ? searchSynonymsParams : {},\r\n useReadTransporter: true,\r\n cacheable: true,\r\n };\r\n return transporter.request(request, requestOptions);\r\n }", "title": "" }, { "docid": "ec304ae4684d771cbbdf328911518927", "score": "0.41770878", "text": "function handleText(textNode) \n{\n\n var v = textNode.nodeValue;\n if(analyze_word(v)){\n \n for (i = 0; i < word_list.length; i++) { \n \n var synonym = generate_synonym(v);\n synonym = synonym[0];\n v = v.replace(v, synonym);\n textNode.nodeValue = v;\n } \n }\n \n \n}", "title": "" }, { "docid": "dde8e8b52b25692257c12ecc15848811", "score": "0.41734633", "text": "function ServerBehavior_setForceMultipleUpdate(bForce)\n{\n this.bForceMultipleUpdate = bForce;\n}", "title": "" }, { "docid": "fced609833093de151497c387ed668b3", "score": "0.4170257", "text": "function setWorkflows() {\n self.workflows.removeAll();\n\n for (var i = 0; i < self.allWorkflows().length; i++) {\n var workflow = self.allWorkflows()[i];\n self.workflows.push(workflow);\n }\n }", "title": "" }, { "docid": "15583749de4056112d014a98379426f1", "score": "0.41625306", "text": "function _eachSynonym(synonym, cb){\n\n // expand token permutations\n const phrases = _permutations(synonym);\n\n // filter out permutations which do not match phrases in the index\n async.filterSeries( phrases, _indexContainsPhrase.bind(this), (err, matchedPhrases) => {\n return cb( null, _groups(synonym, matchedPhrases) );\n });\n}", "title": "" }, { "docid": "ae630c60222f0008b9c4b4a1c037215a", "score": "0.41468936", "text": "async function createMultiple(req, res) {\n try {\n if(!req.body.actors[0])\n throw new Error(\"Empty List, Please Supply Some Names.\")\n for await (const actor of req.body.actors) {\n\n // check if the actor's name already exists\n const temp = await Actor.findOne({ where: { name: actor } });\n\n // if exists do nothing\n if (temp) continue;\n else {\n // create a new entry\n await Actor.create({ name: actor });\n console.log(actor + \" Added\");\n }\n }\n res.send({ message: \"Added Successfully\" });\n } catch (err) {\n res.send({ message: err.message });\n }\n}", "title": "" }, { "docid": "45498482f8d256bacf0afdb5ccb29c9c", "score": "0.41392756", "text": "function generateEditors() {\n for (var i=0; i<editorInstances.length; i++) {\n var editInst = editorInstances[i];\n editInst.ReplaceTextarea();\n }\n}", "title": "" }, { "docid": "69a518c26ea571d291fa1ce1da06d85d", "score": "0.41389582", "text": "createStories(stories) {\n const me = this;\n const updatedStories = stories.map(story => {\n return new Promise(resolve => {\n resolve(me.createStory(story));\n });\n });\n\n return Promise.all(updatedStories);\n }", "title": "" }, { "docid": "93c905b09a2d5dd008bbdbc398486ae9", "score": "0.4133935", "text": "function putObjects(req, res, appdata) {\n var objectName = req.param(smConstants.KEY_NAME),\n objectUrl = \"/\" + objectName,\n postData = req.body;\n\n sm.put(objectUrl, postData, appdata, function (error, resultJSON) {\n if (error != null) {\n commonUtils.handleJSONResponse(formatErrorMessage(error), res);\n } else {\n commonUtils.handleJSONResponse(null, res, resultJSON);\n }\n });\n\n smCache.deleteRedisCache(smConstants.REDIS_TAG_VALUES);\n}", "title": "" }, { "docid": "c7c928dc54a0651863bc26a8c357818a", "score": "0.41305658", "text": "function processThings(things) {\n let wikidataLookups = [];\n things.forEach(thing => {\n let wikidataURL = getWikidataURL(thing.urls);\n if (wikidataURL === undefined) {\n // We want a result array that maps against the original query, so\n // we pad it with 'null' values for any unexpectedly missing URLs\n wikidataLookups.push(Promise.resolve(null));\n return;\n }\n\n if (thing.sync === undefined)\n thing.sync = {};\n if (thing.sync.description === undefined) {\n thing.sync.description = {\n active: true,\n source: 'wikidata'\n };\n }\n wikidataLookups.push(limit(() => wikidata.lookup(wikidataURL)));\n });\n Promise\n .all(wikidataLookups)\n .then(wikidataResults => {\n let thingUpdates = [];\n\n things.forEach((thing, index) => {\n\n let syncActive = thing.sync && thing.sync.description && thing.sync.description.active,\n hasDescription = wikidataResults[index] &&\n wikidataResults[index].data && wikidataResults[index].data.description;\n\n if (syncActive && hasDescription) {\n thing.description = wikidataResults[index].data.description;\n thing.sync.description.updated = new Date();\n thing.sync.description.source = 'wikidata';\n thingUpdates.push(thing.save());\n }\n });\n Promise\n .all(thingUpdates)\n .then(updatedThings => {\n console.log(`Sync complete. ${updatedThings.length} items updated.`);\n console.log(`Updating search index now.`);\n Promise\n .all(updatedThings.map(search.indexThing))\n .then(() => {\n console.log('Search index updated.');\n process.exit();\n })\n .catch(error => {\n console.log('Problem updating search index. The error was:');\n console.log(error);\n process.exit(1);\n });\n })\n .catch(error => {\n console.log('Problem performing updates. The error was:');\n console.log(error);\n process.exit(1);\n });\n })\n .catch(error => {\n console.log('Problem performing lookups for sync. The error was:');\n console.log(error);\n process.exit(1);\n });\n\n}", "title": "" }, { "docid": "57764704f79989d3fe4908969098eacf", "score": "0.41222337", "text": "function createMulti(req, res) {\n\n var newFavorites = req.body.map(function (item) {\n return { name: item, name_lower: item.toLowerCase() };\n });\n return _favorite2.default.create(newFavorites).then(function (res) {\n res.map(function (fr) {\n // debugger\n _event2.default.update({ name_lower: fr._doc.name_lower }, { favorite: true });\n _performer2.default.update({ name_lower: fr._doc.name_lower }, { favorite: true }).then(function (ttt) {\n return console.log(\"Perf:\", ttt);\n });\n _performer2.default.find({ name_lower: fr._doc.name_lower }).then(function (list) {\n list = list.map(function (item) {\n return item.id;\n });\n _event2.default.update({ performer: { $in: list } }, { favorite: true }).then(function (res) {\n return console.log(res);\n });\n var ev = _event2.default.find({ performer: { $in: list } }).then(function (res) {\n return console.log(res);\n });\n //console.log('list', ev);\n });\n });\n return res;\n }).then(respondWithResult(res, 201)).catch(handleError(res));\n\n //console.log(newFavorites);\n\n //return res.status(200).json(req.body);\n}", "title": "" }, { "docid": "33c9875bea9fc643210b46185733f226", "score": "0.41142505", "text": "function saveApis(data) {\n \n defineDBSchema(2);\n firstDBShemaVersion(1);\n db.open();\n\n /* data.forEach(function(item) {\n db.apis.put(item);\n console.log('saved api', item.apiName);\n });\n */\n\n db.transaction('rw', db.apis, function() {\n data.forEach(function(item) {\n db.apis.put(item);\n console.log('added api from txn', item.apiName);\n });\n }).catch(function(error) {\n console.error('error', error);\n });\n \n\n // .finally(function() {\n // db.close(); \n // });\n }", "title": "" }, { "docid": "48c6d567b77364996ce9de276bf60e5b", "score": "0.41141725", "text": "addWorkspaces(workspaces) {\n workspaces.forEach((workspace) => {\n\n // if there is a workspace ID, add empty projects\n if (workspace.id) {\n this.projectsPerWorkspace.set(workspace.id, []);\n }\n\n this.workspaces.set(workspace.id, workspace);\n });\n\n }", "title": "" }, { "docid": "8e0c4b8ebc0832f1e7aa5603be427e9e", "score": "0.41119787", "text": "function reloadAllArtists(names) {\n\tfor (var i = 0; i < names.length; i++) {\n\t\treloadArtist(names[i]);\n\t}\n}", "title": "" }, { "docid": "4cd440fa74153d5e980e96d42cdadb1a", "score": "0.4100961", "text": "function postObjects(req, res, appdata) {\n var objectName = req.param(smConstants.KEY_NAME),\n objectUrl = \"/\" + objectName,\n postData = req.body;\n\n check4DuplicateId(res, objectName, postData[objectName][0].id, function () {\n sm.put(objectUrl, postData, appdata, function (error, resultJSON) {\n if (error != null) {\n commonUtils.handleJSONResponse(formatErrorMessage(error), res);\n } else {\n commonUtils.handleJSONResponse(null, res, resultJSON);\n }\n });\n });\n}", "title": "" }, { "docid": "71d6e4d73c2508eeadd20204fe255b43", "score": "0.40903795", "text": "static async saveCollection(remotes) {\n const q = `\nPREFIX nfo: <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#>\nPREFIX mu: <http://mu.semte.ch/vocabularies/core/>\nPREFIX nie: <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#>\nPREFIX adms: <http://www.w3.org/ns/adms#>\nPREFIX dct: <http://purl.org/dc/terms/>\n\nINSERT DATA {\n GRAPH <http://mu.semte.ch/graphs/public> {\n ${(remotes.map(remote => new RemoteDataObject(remote).toSPARQL()).join('\\n '))}\n }\n}`;\n\n try {\n await update(q);\n } catch (e) {\n console.log(`Something went wrong while updating/saving the remote-data-objects`);\n console.log(e);\n throw e;\n }\n }", "title": "" }, { "docid": "e144f130fb817d72aff2c65ec57f6413", "score": "0.40750036", "text": "multiple_update(agents, listener) {\n\t\t\tlet data = { agents: {} }\n\t\t\tfor (var i = agents.length - 1; i >= 0; i--) {\n\t\t\t\tlet agent = agents[i]\n\t\t\t\tdata.agents[agent.agent_id] = { ...agent.updates, agent_type: agent.agent_type }\n\t\t\t}\n\t\t\tcall(\"PUT\", \"agents/multiple\", setParams(data), listener)\n\t\t}", "title": "" }, { "docid": "44381941b4b76c661c6d786eaebba314", "score": "0.4046698", "text": "function batchSetValue(variablesAndValues) {\n variablesAndValues.forEach(function (variableAndValue) {\n var variable = variableAndValue[0];\n variable.write(variableAndValue[1]);\n });\n}", "title": "" }, { "docid": "0ac345059578ff611204b822c8ef260e", "score": "0.40413657", "text": "function wordCreate() {\n\n word[0] = new Words('flower');\n word[1] = new Words('dove');\n word[2] = new Words('unicorn');\n word[3] = new Words('smiley');\n word[4] = new Words('rainbow');\n\n for (var j = 0; j < word.length; j++) {\n var file = 'words.json'\n var obj = JSON.stringify(word[j]) + ',\\n';\n\n fs.appendFile(file, obj, (err) => {\n if (err) throw err;\n });\n }\n}", "title": "" }, { "docid": "610fa679faab7d7b40fc760e00e9f45c", "score": "0.4040734", "text": "async spellsAdder(actor, spells) {\n if (!spells || Object.keys(spells).length == 0)\n return;\n const spellList = await this._prepareSpellsObject(spells, actor.name);\n for (var spell of spellList){\n try {\n await actor.createEmbeddedDocuments(\"Item\", [spell.toObject()]);\n }\n catch (e) {\n Utilts.notificationCreator('error', `There has been an error while creating ${itemName}`);\n console.error(e);\n }\n }\n }", "title": "" }, { "docid": "81d7e52ceadc1b33c777540def173e88", "score": "0.40376517", "text": "function writeMeaningToFile(inputStream, filename) {\n let stream = fs.createWriteStream(filename, { flags: 'a' });\n let toWrite = \"\";\n let result = JSON.parse(inputStream);\n let synonyms = \"synonyms: \";\n let synonymsList = [];\n let isSynonymAvailable = false;\n if(result[0] === undefined) return; // return if no word definition is found\n toWrite += \"- \" + result[0].word + \"\\n\";\n result[0].meanings.forEach(meaning => {\n toWrite += \" - \" + meaning.partOfSpeech + \"\\n\";\n meaning.definitions.forEach(definition => {\n toWrite += \" - \" + definition.definition + \"\\n\";\n if(definition.example !== undefined){\n toWrite += \" - ex: \" + definition.example + \"\\n\";\n }\n if (definition.synonyms !== undefined) {\n isSynonymAvailable = true;\n synonymsList.push(...definition.synonyms)\n }\n });\n });\n if (isSynonymAvailable)\n // remove duplicate and write comma separated synonyms\n toWrite += \" - \" + synonyms + [...new Set(synonymsList)].join(', ') + \"\\n\";\n stream.write(toWrite);\n stream.end();\n}", "title": "" }, { "docid": "0c5f5ae54fa159e04ae989b712f26418", "score": "0.40368667", "text": "function saveAllHelper(concepts) {\n\n if (concepts.length === 0) {\n $rootScope.$broadcast('batchEditing.batchSaveComplete');\n return;\n }\n var concept = concepts[0];\n\n var tableConcept;\n\n try {\n tableConcept = scope.batchTableParams.data.filter(function (c) {\n return c.conceptId === concept.conceptId;\n })[0];\n } catch (e) {\n // do nothing\n }\n\n\n scope.saveConcept(tableConcept ? tableConcept : concept, true).then(function (response) {\n if (tableConcept) {\n tableConcept.tableAction = null;\n scope.batchTableParams.reload();\n }\n var temp = concepts.slice(1);\n if(!response.validation.hasErrors && !response.validation.hasWarnings){\n $rootScope.$broadcast('batchEditing.conceptSaved');\n tableConcept.tableAction = 'Saved...';\n $timeout(function () {\n scope.removeConcept(concept);\n scope.batchTableParams.reload();\n }, 2500);\n }\n else if(response.validation.hasErrors){\n $rootScope.$broadcast('batchEditing.conceptSavedWithErrors');\n }\n else {\n $rootScope.$broadcast('batchEditing.conceptSavedWithWarnings');\n }\n saveAllHelper(temp);\n\n }, function (error) {\n if (tableConcept) {\n tableConcept.tableAction = null;\n } else {\n concept.tableAction = null;\n }\n $rootScope.$broadcast('batchEditing.conceptSavedWithErrors');\n saveAllHelper(concepts.slice(1));\n });\n }", "title": "" }, { "docid": "afd5eb3757c24afc69cf28fc0b062c92", "score": "0.40326312", "text": "function setLinksAndPreferredManuals()\n {\n let seed = +$('#rule-seed-input').val();\n let seedHash = (seed === 1 ? '' : '#' + seed);\n for (let mod of modules)\n {\n let manual = null;\n if (mod.Manuals.length > 0)\n {\n manual = getDefaultManual(mod);\n\n if (mod.Name in preferredManuals)\n {\n // Remove it from preferredManuals if it’s the default anyway\n if (preferredManuals[mod.Name] === manual.Name.substr(mod.Name.length + 1))\n delete preferredManuals[mod.Name];\n else\n {\n // Remove preferred manuals that no longer exist\n let prefManual = mod.Manuals.filter(m => m.Name.substr(mod.Name.length + 1) === preferredManuals[mod.Name])[0];\n if (!prefManual)\n delete preferredManuals[mod.Name];\n else\n manual = prefManual;\n }\n }\n\n for (let fnc of mod.FncsSetManualLink)\n fnc(manual === null ? null : manual.Url + seedHash);\n }\n for (let fnc of mod.FncsSetSelectable)\n fnc(selectable === 'manual' ? (manual === null ? null : manual.Url + seedHash) : (initSelectables.filter(sl => sl.PropName === selectable).map(sl => sl.UrlFunction(mod))[0] || null));\n }\n lStorage.setItem('preferredManuals', JSON.stringify(preferredManuals));\n }", "title": "" }, { "docid": "f77c0cd9d2728a8dc229bd3fd39aed6c", "score": "0.40318117", "text": "async function updateTempAndNullJobs() {\n var tempAndNullJobs = await getTempAndNullJobs();\n MongoClient.connect(process.env.PROD_MONGODB, async function(err, db) {\n for(i = 0; i < tempAndNullJobs.length; i++){\n db.collection('jobs').updateOne(\n {_id: new ObjectID(tempAndNullJobs[i]._id)},\n {$set: {\"jobType\": \"temporary\"}},\n {upsert: false}\n );\n\t}\n\tawait db.close();\n });\n}", "title": "" }, { "docid": "045217794bbc214c73658662489e2caf", "score": "0.40308514", "text": "addStudentsToMap(txt,students){\r\n let lines = txt.split(\"\\n\");//split the text of Students.txt line by line\r\n for(let line of lines) {\r\n let student = this.createStudent(line);\r\n students.set(student.id,student);\r\n }\r\n }", "title": "" }, { "docid": "d9636f5e7d07c19f840e2ddfc5247d8b", "score": "0.40238336", "text": "function populateSongs (songs, list) {\n\n\t\tfor (var song of songs) {\n\n\t\t\tvar songTemplate = importTemplate('album-song-template');\n\n\t\t\tsongTemplate.querySelector('.song-name').textContent = song.name;\n\t\t\tsongTemplate.querySelector('.album-song').value = song.number;\n\n\t\t\tvar addButton = songTemplate.querySelector('.add-song');\n\t\t\taddButton.addEventListener('click', emitEvent('add-song', song));\n\n\t\t\tlist.appendChild(songTemplate);\n\n\t\t}\n\n\t}", "title": "" }, { "docid": "d75d44760cecc4f3f765eec4e00d71e3", "score": "0.4021945", "text": "function syncObjects(adapterInstance, iobObjects, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n // Parse options and choose defaults\n const { overwriteExisting = false, removeUnused = false, except } = options;\n // Validate objects\n iobObjects.forEach(iobObject => {\n validateObject(iobObject);\n });\n // Ensure that the entire object tree is complete and no intermediate objects are missing\n validateObjectTree(iobObjects);\n // Find out which objects are new, which are going to be overwritten and which might need to be deleted\n const existingObjects = Object.values(yield adapterInstance.getAdapterObjectsAsync());\n // Using Sets allows us to ignore duplicates (which shouldn't happen, but you never know)\n const existingObjectIDs = new Set(existingObjects.map(o => o._id));\n const desiredObjectIDs = new Set(iobObjects.map(o => o.id));\n // Objects that exist but are no longer needed\n const unusedIDs = new Set([...existingObjectIDs].filter(id => !desiredObjectIDs.has(id)));\n // TODO: Use this so we can merge changed objects instead of completely overwriting them\n // // Objects that don't exist yet\n // const newIDs = new Set([...desiredObjectIDs].filter(id => !existingObjectIDs.has(id)));\n // // Objects that already exist and should be kept\n // const existingIDs = new Set([...desiredObjectIDs].filter(id => existingObjectIDs.has(id)));\n // Clean up unused objects if desired\n if (removeUnused) {\n // Create a matcher function to check which unused IDs to keep\n const shouldKeep = !except ? () => true\n : typeof except === \"string\" ? (id) => id === except\n : Array.isArray(except) ? (id) => except.includes(id)\n : util.types.isRegExp(except) ? (id) => except.test(id)\n : typeof except === \"function\" ? (id) => except(id)\n : () => true;\n for (const id of unusedIDs) {\n if (!shouldKeep(id))\n yield adapterInstance.delObjectAsync(id);\n }\n }\n // Create new objects (and update existing if desired)\n for (const obj of iobObjects) {\n if (!overwriteExisting) {\n yield adapterInstance.setObjectNotExistsAsync(obj.id, obj.object);\n }\n else {\n yield adapterInstance.setObjectAsync(obj.id, obj.object);\n }\n if (obj.value !== undefined) {\n yield adapterInstance.setStateAsync(obj.id, { val: obj.value, ack: true });\n }\n }\n });\n}", "title": "" }, { "docid": "7395d7380e54a604bc5feeeb45b66df6", "score": "0.40155417", "text": "async createOrUpdate(rep) {}", "title": "" }, { "docid": "83b2194ac3024de460e6cf238c467f19", "score": "0.40116325", "text": "async function updatePhrases(id, newText, newSpeed, newCss) {\n const startingPhrases = phrases;\n\n for (let i = 0; i < startingPhrases.length; i++) {\n if (startingPhrases[i].id === id) {\n startingPhrases[i].text = newText;\n startingPhrases[i].speed = newSpeed;\n startingPhrases[i].css = newCss;\n }\n }\n setPhrases([...startingPhrases]);\n }", "title": "" }, { "docid": "de1e1cd798001fae000635a141f1c4f9", "score": "0.40102622", "text": "function updateScheduleJobs(tasks) {\n for (index in tasks) {\n updateScheduleJob(tasks[index])\n }\n}", "title": "" }, { "docid": "0034c6253386d8b30f317d918bc399f0", "score": "0.40078172", "text": "function addSchedule (schedules) {\n schedules.push({});\n }", "title": "" }, { "docid": "0034c6253386d8b30f317d918bc399f0", "score": "0.40078172", "text": "function addSchedule (schedules) {\n schedules.push({});\n }", "title": "" }, { "docid": "ab0e1f360c4303a1efb1e54876687a12", "score": "0.40075278", "text": "async function writeToLocationsTable(locations){\n\n for (let i=0, len=locations.length; i<len; i++){\n await models.location.upsert({\n locationid:locations[i].locationId,\n locationname: locations[i].name,\n addressline1: locations[i].postalAddressLine1,\n addressline2: locations[i].postalAddressLine2,\n towncity: locations[i].postalAddressTownCity,\n county: locations[i].postalAddressCounty,\n postalcode: locations[i].postalCode,\n mainservice: (locations[i].gacServiceTypes.length>0) ? locations[i].gacServiceTypes[0].name : null\n })\n }\n }", "title": "" }, { "docid": "b41e346d0f0bc229f85bdc7d92b374a4", "score": "0.39975208", "text": "async addNoiseWords(noiseText) {\n\t\tvar noise_words_mongo = []\n\t\tvar noisearray = noiseText.split(\"\\n\")\n\t for (const word of noisearray){\n\t\t\t// to make sure that we do not insert duplicates\n\t\t\tif ( word != \"\" && !(this.noise_words.has(word)) ) {\n\t\t\t\tthis.noise_words.set(word,true)\n \t\tnoise_words_mongo.push( { _id : word , content : true } )\t\n\t\t\t}\n \t}\n\n\t\t// insert all noise words at onece for optimization\n\t\tif ( noise_words_mongo.length > 0 ) {\n\t\t\t// insert many\n\t\t\tawait this.insertDocument(noise_words_mongo, this.noisewordsTB , true)\n\t\t}\n\n \t}", "title": "" }, { "docid": "3b188bfbd19f8b4fbfafda2bc6a1f4cb", "score": "0.39922512", "text": "async updateUserSkills(user, newSkills) {\n try {\n //update or add new skills asynchronously \n await Promise.all(newSkills.map(async (newSkill) => {\n //get the old skill instance\n const skillInstance = user.skills.filter(skill => skill.name == newSkill.name);\n\n //if the user already has the skill, update its rating if necessary\n if (skillInstance.length > 0) {\n if (skillInstance[0].usersSkills.rating != newSkill.rating) {\n await skillInstance[0].usersSkills.update({ rating: newSkill.rating });\n }\n //if the user does not has the skill, associate the user with the new skill\n } else {\n //to-do: put the following code to SkillService: getSkillNameFromId\n //get the skillId from the skill name \n const skill = await this.skillModel.findOne({\n where: { 'name': newSkill.name },\n attributes: [\"id\"]\n });\n\n //throw an error if skill doesn't exist\n if (!skill) {\n let err = new Error(`The skill: ${newSkill.name} does not exist in our database.`);\n err.status = 500;\n throw err;\n };\n\n //associate user with the new skill\n await user.addSkill(skill, { through: { rating: newSkill.rating } });\n }\n }));\n } catch (err) {\n throw err;\n }\n }", "title": "" }, { "docid": "95a5951a18259e10826b3bcdf16d244d", "score": "0.39853215", "text": "function addStudentLikes(mentors) {\n for (var i = 0; i < mentors.length; i++) {\n var mentor = mentors[i];\n mentor.addStudentLikes();\n }\n}", "title": "" }, { "docid": "c525efffe412bd8689a94f16597e0778", "score": "0.39820486", "text": "function updateForces() {\n // get each force by name and update the properties\n simulation.force(\"center\")\n .x(width * forceProperties.center.x)\n .y(height * forceProperties.center.y);\n simulation.force(\"charge\")\n .strength(forceProperties.charge.strength * forceProperties.charge.enabled)\n .distanceMin(forceProperties.charge.distanceMin)\n .distanceMax(forceProperties.charge.distanceMax);\n simulation.force(\"collide\")\n .strength(forceProperties.collide.strength * forceProperties.collide.enabled)\n .radius(forceProperties.collide.radius)\n .iterations(forceProperties.collide.iterations);\n simulation.force(\"forceX\")\n .strength(forceProperties.forceX.strength * forceProperties.forceX.enabled)\n .x(width * forceProperties.forceX.x);\n simulation.force(\"forceY\")\n .strength(forceProperties.forceY.strength * forceProperties.forceY.enabled)\n .y(height * forceProperties.forceY.y);\n simulation.force(\"link\")\n .id(function (d) {\n return d.index;\n })\n .distance(forceProperties.link.distance)\n .iterations(forceProperties.link.iterations)\n .links(forceProperties.link.enabled ? graph.links : []);\n\n // updates ignored until this is run\n // restarts the simulation (important if simulation has already slowed down)\n simulation.alpha(1).restart();\n }", "title": "" }, { "docid": "ea4b0af93f09382003bc7a7846083002", "score": "0.3972828", "text": "function bulkCreateOrUpdateDictionary(req, res) {\n var inputDictionaries = req.body;\n var i = 0;\n var transaction = new Transaction(true);\n\n // Validate input\n // Check empty\n if (!inputDictionaries.length) return res.send({ code: 400, message: \"Invalid input data!\" });\n // Check duplicate\n\n\n // Check all input Keywords then insert or update to the db\n var dictionary = inputDictionaries[i];\n // Correct input data\n dictionary.keyword = dictionary.keyword.trim();\n dictionary.description = dictionary.description.trim();\n // Check exist & prepare the transaction\n checkExist(dictionary, transaction)\n .then(result => {\n // On checking done\n console.log(\"On finish checking existence of Dictionary\");\n })\n .catch(err => {\n logger.error(\"Error at function: DictionaryController.bulkCreateOrUpdateDictionary->checkExistAndPrepareTransaction\", err);\n return onTransactionError();\n })\n\n // Start executing the transaction\n function finishTransaction() {\n transaction.run()\n .then(result => {\n //console.log(result);\n res.send({ code: 200, message: \"All the dictionary were saved or updated\" });\n transaction.clean();\n })\n .catch(err => {\n transaction.rollback().catch(console.error);\n transaction.clean();\n })\n }\n\n // onCompletePrepareTransaction\n function onCompletePrepareTransaction() {\n i = i + 1;\n if (i < inputDictionaries.length) {\n // Continue with the orther dictionary in the input list \n dictionary = inputDictionaries[i];\n // Check exist & prepare the transaction \n checkExist(dictionary, transaction)\n .then(result => {\n // On checking done\n console.log(\"On finish checking existence of Dictionary\", result);\n })\n .catch(err => {\n logger.error(\"Error at function: DictionaryController.bulkCreateOrUpdateDictionary->checkExistAndPrepareTransaction\", err);\n return onTransactionError();\n })\n } else {\n return finishTransaction();\n }\n }\n\n // Send error to client\n function onTransactionError(err) {\n logger.error(\"Error at function: DictionaryController.bulkCreateOrUpdateDictionary->onTransactionError\", err);\n res.send({ code: 400, message: \"Can not save or update dictionaries\" });\n }\n\n // Check exist dictionary to insert or update\n function checkExist(dictionary, transaction) {\n return new Promise((resolve, reject) => {\n var _keyword = dictionary.keyword.trim().toLowerCase();\n var query = Dictionary.find({ 'keyword': { $regex: new RegExp('^' + _keyword + '$', \"i\") } });\n\n // execute the query\n query.exec(function (err, dictionaries) {\n if (err) reject(err);\n if (dictionaries.length <= 0) { // Case of create new \n prepareDictionaryAndTransaction(dictionary, transaction, false)\n .then(result => {\n setTimeout(onCompletePrepareTransaction, config.translate.delay);\n })\n .catch(err => {\n logger.error(\"Error at function: DictionaryController.bulkCreateOrUpdateDictionary->checkExistAndPrepareTransaction(Insert)\", err);\n onTransactionError(err);\n })\n } else { // Case of update existing object\n dictionary._id = dictionaries[0]._id; // Get the existed object'is and pass to the new dictionary (using for later update)\n prepareDictionaryAndTransaction(dictionary, transaction, true)\n .then(result => {\n setTimeout(onCompletePrepareTransaction, config.translate.delay);\n })\n .catch(err => {\n logger.error(\"Error at function: DictionaryController.bulkCreateOrUpdateDictionary->checkExistAndPrepareTransaction(Update)\", err);\n onTransactionError(err);\n })\n }\n resolve(dictionaries);\n });\n });\n }\n\n // Prepare the dictionary to insert/update\n function prepareDictionaryAndTransaction(dictionary, transaction, isUpdate) {\n return new Promise((resolve, reject) => {\n getKeywordAudio(dictionary.keyword)\n .then(kurl => {\n getDescriptionAudio(kurl, dictionary.description)\n .then(urls => {\n // Finish getting audios --> Update the urls to dictionary object\n dictionary.kaudio = urls.kurl;\n dictionary.daudio = urls.durl;\n dictionary.daudios = [urls.durl]; // HASHCODE <---------\n //resolve(dictionary);\n // Check condition to prepare corresponding transaction\n if (!isUpdate) transaction.insert('Dictionary', dictionary);\n else transaction.update('Dictionary', dictionary._id, dictionary);\n resolve(dictionary);\n })\n .catch(err => {\n logger.error(\"Error at function: DictionaryController.bulkCreateOrUpdateDictionary->getDescriptionAudio\", err);\n reject(err);\n })\n })\n .catch(err => {\n logger.error(\"Error at function: DictionaryController.bulkCreateOrUpdateDictionary->getKeywordAudio\", err);\n reject(err);\n })\n })\n }\n}", "title": "" }, { "docid": "a12f30bbc1de77015cf354b8d308e370", "score": "0.3960341", "text": "function append_match_ids_to_set() {\n\t\tdb.client.sadd(week_key, new_match_ids, function(err,reply) {\n\t\t\tif (err) return _error(err);\n\n\t\t\treturn res.json({success: true});\n\t\t});\t\n\t}", "title": "" }, { "docid": "7444f0281807de8e10250c9af5d21a30", "score": "0.39563626", "text": "function createNewEnvelopesForAssertionShare() {\n for (var i=0;i<newAssertionShareEnvelopeList.length;i++) {\n if (newAssertionShareEnvelopeList[i].assigned) {\n var asr = assertionMap[currentAssertionShareId];\n if (asr && asr != null) {\n var nase = newAssertionShareEnvelopeList[i];\n var newAe = new AssertionEnvelope();\n newAe.name = nase.name;\n newAe.addAssertion(asr);\n newAe.addOwner(EcIdentityManager.ids[0].ppk.toPk());\n addAssertionReadersFromNewAssertionShareEnvelopReaders(newAe,nase);\n newAe.generateId(repo.selectedServer);\n assertionEnvelopeListToSave[newAe.shortId()] = newAe;\n }\n }\n }\n}", "title": "" }, { "docid": "2097fc7e23dd54ccc0e8b6f6ce7cc15e", "score": "0.39554468", "text": "replace (existing, fresh) {\n if (!Array.isArray(existing)) {\n existing = [existing]\n }\n if (!Array.isArray(fresh)) {\n fresh = [fresh]\n }\n existing.forEach((m) => this.delete(m))\n fresh.forEach((m) => this.add(m))\n }", "title": "" }, { "docid": "a87a0ea6db00b0c28764a8198a51b8ac", "score": "0.39545587", "text": "swapAtoms(targetSite) {\n if (targetSite && targetSite.canMove()) {\n [this.atom, targetSite.atom] = [targetSite.atom, this.atom];\n }\n }", "title": "" }, { "docid": "c9b13800f5d5e38387c55df3916f9131", "score": "0.3947045", "text": "function update_shortcuts() {\n let names = new Set();\n\n for (let id = 1; id <= 3; id ++) {\n let tab = _(`.tab[data-x=\"shortcut_${id}\"]`),\n shortcut = Y[`shortcut_${id}`];\n if (!tab)\n continue;\n\n if (shortcut) {\n let target = _(`.tab[data-x=\"${shortcut}\"]`);\n if (target && !target.dataset['t'])\n target = _('[data-t]', target);\n if (target) {\n let name = target.dataset['t'];\n tab.dataset['t'] = SHORTCUT_NAMES[name] || name;\n translate_nodes(tab.parentNode);\n let node = CacheId(`shortcut_${id}`),\n table = CacheId(`table-${shortcut}`);\n\n // not in tables => direct copy, ex: \"stats\"\n HTML(node, HTML(table));\n names.add(shortcut);\n }\n }\n S(tab, shortcut);\n }\n\n // resize\n for (let name of names)\n resize_table(name);\n}", "title": "" }, { "docid": "e51c4b206d065221c3022b642d8a818e", "score": "0.3939375", "text": "function insertAll(Model, foods) {\n return Model.create(foods)\n}", "title": "" }, { "docid": "0a1b21a714303feab14b5221bcac138f", "score": "0.39267498", "text": "getSynonym({ indexName, objectID }, requestOptions) {\r\n if (!indexName) {\r\n throw new Error('Parameter `indexName` is required when calling `getSynonym`.');\r\n }\r\n if (!objectID) {\r\n throw new Error('Parameter `objectID` is required when calling `getSynonym`.');\r\n }\r\n const requestPath = '/1/indexes/{indexName}/synonyms/{objectID}'\r\n .replace('{indexName}', encodeURIComponent(indexName))\r\n .replace('{objectID}', encodeURIComponent(objectID));\r\n const headers = {};\r\n const queryParameters = {};\r\n const request = {\r\n method: 'GET',\r\n path: requestPath,\r\n queryParameters,\r\n headers,\r\n };\r\n return transporter.request(request, requestOptions);\r\n }", "title": "" }, { "docid": "73026d129de96756b113faa67c78b265", "score": "0.3926176", "text": "function updateForces() {\n // get each force by name and update the properties\n simulation.force(\"center\")\n .x(width * forceProperties.center.x)\n .y(height * forceProperties.center.y);\n simulation.force(\"charge\")\n .strength(forceProperties.charge.strength * forceProperties.charge.enabled)\n .distanceMin(forceProperties.charge.distanceMin)\n .distanceMax(forceProperties.charge.distanceMax);\n simulation.force(\"collide\")\n .strength(forceProperties.collide.strength * forceProperties.collide.enabled)\n .radius(forceProperties.collide.radius)\n .iterations(forceProperties.collide.iterations);\n simulation.force(\"forceX\")\n .strength(forceProperties.forceX.strength * forceProperties.forceX.enabled)\n .x(width * forceProperties.forceX.x);\n simulation.force(\"forceY\")\n .strength(forceProperties.forceY.strength * forceProperties.forceY.enabled)\n .y(height * forceProperties.forceY.y);\n simulation.force(\"link\")\n .id(function (d) { return d.id; })\n .distance(forceProperties.link.distance)\n .iterations(forceProperties.link.iterations)\n .links(forceProperties.link.enabled ? graph.links : []);\n\n // updates ignored until this is run\n // restarts the simulation (important if simulation has already slowed down)\n simulation.alpha(1).restart();\n}", "title": "" }, { "docid": "bddb85ef007cabb334cc1bba5cf3567b", "score": "0.39214537", "text": "async function recalculateMultiple() {\n const ownCounts = await model.Space.aggregate([\n { $match: { type: \"special-building\" } },\n {\n $group: {\n _id: \"$ownedBy\",\n count: { $sum: 1 },\n },\n },\n ]).exec();\n\n await Promise.all(\n ownCounts.map(async (ownCount) => {\n const { _id: ownedBy, count: multiple } = ownCount;\n if (ownedBy === \"\") {\n await model.Space.updateMany(\n { type: \"special-building\", ownedBy },\n { multiple: 0 }\n ).exec();\n } else {\n await model.Space.updateMany(\n { type: \"special-building\", ownedBy },\n { multiple }\n ).exec();\n }\n })\n );\n\n // return changed spaces' nums\n const spaces = await model.Space.find({ type: \"special-building\" }).exec();\n return spaces.map((space) => space.num);\n}", "title": "" }, { "docid": "ea0534c3fb00023f082728cd5c2a18a2", "score": "0.3916649", "text": "function Save(newDomains) {\n newDomains.forEach(dom => {\n manualBlocks[dom] = true;\n })\n}", "title": "" }, { "docid": "92da8a2241a7d1cb88ea374e17b23e69", "score": "0.39148057", "text": "async synchronizeGuilds() {\n await this.createMissingEntries();\n await this.removeGhostEntries();\n }", "title": "" }, { "docid": "83b3ea0bb6555f65f02ac3341932f025", "score": "0.3913541", "text": "initializeSchema({ sequelize, force = false }) {\n const types = this.types();\n Object.keys(types).forEach((type) => {\n this.models[type] = sequelize.define(type, types[type], { underscored: true });\n });\n\n const syncList = new Set();\n const relationships = this.relationships();\n Object.keys(relationships).forEach((owner) => {\n syncList.add(owner);\n relationships[owner].forEach((ownee) => {\n this.models[ownee].belongsTo(this.models[owner]);\n this.models[owner].hasMany(this.models[ownee]);\n syncList.add(ownee);\n });\n });\n\n let syncPromise = Promise.resolve();\n syncList.forEach((type) => {\n syncPromise = syncPromise\n .then(() => this.models[type].sync({ force }));\n });\n return syncPromise\n .then(() => this.models);\n }", "title": "" }, { "docid": "8b997c4ff8a8f32d8411480a9a057c08", "score": "0.39131406", "text": "function addSourceRefIdToExistingRefs(data) {\n\n return function () {\n\n var start = new Date().getTime();\n\n if (_.size(data.refNormIdToSourceRefIdMap)) {\n\n var normids = _.keys(data.refNormIdToSourceRefIdMap);\n\n return Promise.resolve()\n .then(function fetchSourceEntitiesWithRefsReferringRefNorms() {\n\n // SourceRefIds were added to a collection of refnorms (refNormIdToSourceRefIdMap). \n // Find the SourceEntities that contain references to any of these Refnorms\n\n // pluck: save bandwidth\n return tableSourceEntity.getAll.apply(tableSourceEntity, normids.concat({\n index: '_refNormIds'\n })).pluck(\"id\", \"_refNormIds\", \"_refToSourceRefIdMap\");\n\n })\n .then(function updateSourceEntitiesWithRefsReferringRefNorms(docs) {\n\n //Create an array of SourceEntity-docs (partial updates) that need to be updated. \n //Each partial doc contains 2 fields:\n //1. id\n //2. _refToSourceRefIdMap (partial)\n //\n //_refToSourceRefIdMap is a map containing Refnormid -> sourceRefId and thus\n //has the same format as refNormIdToSourceRefIdMap we're feeding from.\n //\n //Using a separate property `_refToSourceRefIdMap` to store these references\n //avoids potential racing writes on updating, say, _refs otherwise.\n //\n var sourceEntitiesToPartiallyUpdate = _.map(docs, function (d) {\n\n //Get normIds that might need updating.\n var intersectNormIds = _.intersection(d._refNormIds, normids);\n\n if (!intersectNormIds.length) {\n var err = new Error(\"refNormid instersection is length zero. Should not happen?\");\n err.halt = true;\n throw err;\n }\n\n //init _refToSourceRefIdMap\n d._refToSourceRefIdMap = d._refToSourceRefIdMap || {};\n\n var refToSourceRefIdMapDelta = _.reduce(intersectNormIds, function (agg, normId) {\n //only need to update if key/value not already present\n if (!d._refToSourceRefIdMap[normId]) {\n agg[normId] = data.refNormIdToSourceRefIdMap[normId];\n }\n return agg;\n }, {});\n\n if (!_.size(refToSourceRefIdMapDelta)) {\n return undefined; // there's nothing to update on this doc. \n }\n\n return {\n id: d.id,\n _refToSourceRefIdMap: refToSourceRefIdMapDelta\n };\n\n });\n\n //remove sourceEntities that don't need updating.\n sourceEntitiesToPartiallyUpdate = _.compact(sourceEntitiesToPartiallyUpdate);\n\n return tableSourceEntity.insert(sourceEntitiesToPartiallyUpdate, {\n conflict: \"update\",\n returnChanges: false\n });\n\n })\n .then(function () {\n data.time.addSourceRefIdToExistingRefs += new Date().getTime() - start;\n });\n }\n };\n }", "title": "" }, { "docid": "31d8675b1ec377d786fc503a094487fb", "score": "0.39111358", "text": "set correct_responses(newResponses) {\n this.correct_responses = newResponses;\n for (i=0; i<this.correct_responses.length; i++) {\n scorm.set(`cmi.interactions.${this.index}.correct_responses.${i}.pattern`, this._correct_responses[i]);\n }\n scorm.save();\n }", "title": "" }, { "docid": "dbaabbcd50ccec82ebe68f7000c1bfd7", "score": "0.39072973", "text": "addById(ids) {\n if (!this.target.relationships) this.target.relationships = {}\n if (!this.target.relationships[this.name]) {\n this.target.relationships[this.name] = { data: [] }\n }\n\n ids = Array.isArray(ids) ? ids : [ids]\n\n const newRelations = ids\n .filter(id => !this.existsById(id))\n .map(id => ({\n _id: id,\n _type: this.doctype\n }))\n\n this.target.relationships[this.name].data.push(...newRelations)\n this.updateMetaCount()\n\n return this.save(this.target)\n }", "title": "" }, { "docid": "e3a26288f93008dd14d7ab1f5f0e3fcc", "score": "0.3906944", "text": "function createNewRecords() {\n var _dictOfExistingItems = dictOfExistingItems;\n //mixin un copied records\n sh.each(dictOfExistingItems, function addToNewRecords(i, eRecord) {\n if (eRecord == null) {\n //already updated\n return;\n }\n //console.error('creating new instance of id on', eRecord.id)\n eRecord.id = null;\n newRecords.push(eRecord);\n });\n\n\n if ( self.settings.debugUpsert ) {\n self.proc(self.name, ':', 'upsert-newRecords', newRecords.length)\n }\n\n if (newRecords.length > 0) {\n\n\n self.Table.bulkCreate(newRecords).then(function (objs) {\n if ( self.settings.debugUpsert ) {\n self.proc('all records created', objs.length);\n }\n //sh.each(objs, function (i, eRecord) {\n // var match = dict[eRecord.id_timestamp.toString() + eRecord.source]\n // eRecord.updateAttributes(match)\n // })\n sh.callIfDefined(fx, results);\n\n }).catch(function (err) {\n console.error(err, err.stack)\n throw err\n })\n } else {\n if ( self.settings.debugUpsert ) {\n self.proc('no records to create')\n }\n sh.callIfDefined(fx, results)\n }\n\n\n /* sh.callIfDefined(fx)*/\n\n }", "title": "" }, { "docid": "f8f1b7164da518f62cd4227fe551f5d5", "score": "0.39056784", "text": "async addNotifications(subscriptionId, notifications) {\n const notificationsWithSubscriptionId = notifications.map((notification) => ({ ...notification, subscriptionId }));\n const lastNotificationId = notifications.at(-1).id;\n await this.db.notifications.bulkPut(notificationsWithSubscriptionId);\n await this.db.subscriptions.update(subscriptionId, {\n last: lastNotificationId,\n });\n }", "title": "" }, { "docid": "eab8c96dfe17fa35c8d7372dd9b10ba1", "score": "0.38981992", "text": "function sync(force=false, retries=0, maxRetries=5) {\n return db.sync({force: true})\n .then(ok => console.log(`Synced models to db ${connectionString}`))\n .then(() => {\n console.log('Seeding databse');\n return seed();\n })\n .catch(fail => {\n // Don't do this auto-create nonsense in prod, or\n // if we've retried too many times.\n if (process.env.NODE_ENV === 'production' || retries > maxRetries) {\n console.error(chalk.red(`********** database error ***********`))\n console.error(chalk.red(` Couldn't connect to ${connectionString}`))\n console.error()\n console.error(chalk.red(fail))\n console.error(chalk.red(`*************************************`))\n return\n }\n // Otherwise, do this autocreate nonsense\n console.log(`${retries ? `[retry ${retries}]` : ''} Creating database ${name}...`)\n return new Promise((resolve, reject) =>\n require('child_process').exec(`createdb \"${name}\"`, resolve)\n ).then(() => sync(true, retries + 1))\n })\n}", "title": "" }, { "docid": "fbc154c78e871a8f77437028e90a4d16", "score": "0.38914502", "text": "function insertAll(foods) {\n return Food.create(foods)\n}", "title": "" }, { "docid": "ee5c746a3f5afd8f9b9758c3a36511b7", "score": "0.38909024", "text": "function AddISBN(Array) {\n for (var i = 0; i < Array.length; i++) {\n Array[i].ISBN = GenerateISBN();\n }\n}", "title": "" }, { "docid": "18c1ae77330df06129db7548c8c3b0a5", "score": "0.38898775", "text": "function initModels(models, db) {\r\n models.map(model => {\r\n model.setDatabase(db);\r\n if (model.updateDB)\r\n model.updateDB();\r\n })\r\n}", "title": "" }, { "docid": "8cabde951dbc96297987a0d225228166", "score": "0.38666797", "text": "function fetchExistingAndInsertNewRefNormsForReferences(data) {\n\n return function () {\n\n var start = new Date().getTime();\n\n //refnorms should be fetched (or created) for the following sourceIds.\n var sourceIdsToSupport = _.uniq(_.pluck(data.unlinkedRefsWithSourceId, \"_sourceId\"));\n\n return Promise.resolve()\n .then(function fetchRefNormsForReferences() {\n\n //fetch refNorms given sourceIds\n if (sourceIdsToSupport.length) {\n\n return tableRefNorms.getAll.apply(tableRefNorms, sourceIdsToSupport.concat({\n index: '_sourceId'\n })).then(function (refs) {\n\n //Create a map of refNorms with sourceId as key. \n //Note: due to edge-cases (see `updateExistingAndInsertNewRefNorms`) there may \n //be multiple refNorms per sourceId. This selects any of them. That's okay.\n data.sourceIdToRefNormMap = _.zipObject(_.pluck(refs, \"_sourceId\"), refs);\n\n //select the sourceIds for which a refNorm is found. \n //This is used to know which refNorms should still be created\n return _.pluck(refs, \"_sourceId\");\n\n });\n } else {\n return undefined; //for sake of clarify\n }\n\n })\n .then(function upsertNewRefNormsForReferences(sourceIdsFound) {\n\n //get a list of all sourceIds for which refNorms needs to be created\n //since no refNorm yet exists...\n var refNormsWithSourceIdsToCreate = _.difference(sourceIdsToSupport, sourceIdsFound);\n\n //.. consequently, the refNorms to insert...\n var refNormsToUpsert = _.map(refNormsWithSourceIdsToCreate, function (sourceId) {\n return {\n _sourceId: sourceId\n };\n });\n\n //... as well as the actual inserting\n return tableRefNorms.insert(refNormsToUpsert, {\n conflict: \"update\",\n returnChanges: true //We want results back from this insert...\n })\n .then(function (refNorms) {\n\n //... which are fetched from the changes object.\n var refNormsNew = _.pluck(refNorms.changes, \"new_val\");\n\n //Now, the newly added refNorms are added to the refNorm map\n _.each(refNormsNew, function (refNormNew) {\n var sourceId = refNormNew._sourceId;\n if (data.sourceIdToRefNormMap[sourceId]) {\n throw new Error(\"Sanity check: _sourceId found in existing sourceIdToRefNormMap, while we just checked it wasn't there: \" + sourceId);\n }\n data.sourceIdToRefNormMap[sourceId] = refNormNew;\n });\n }).then(function () {\n data.time.fetchExistingAndInsertNewRefNormsForReferences += new Date().getTime() - start;\n });\n });\n };\n }", "title": "" }, { "docid": "28f2a4106fecf3f2d86ab843a12fa493", "score": "0.38636327", "text": "function updateAll() {\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"/update\",\n\t\tsuccess: function (data, result, jqXHR) {\n\t\t\tspawnData(data);\n\t\t\tsetDivs();\n\t\t\tupdateDivs();\n\t\t\tupdateMarquis();\n\t\t}\n\t})\n}", "title": "" }, { "docid": "8a4de77cd8a12c059d082ea8c70eb059", "score": "0.3858657", "text": "function declareUpdates(startIndex, endIndex) {\n for (let i = startIndex; i < endIndex; i++) {\n const ctrl = ctrls[i] || (ctrls[i] = new Controller(null, state.flush));\n let update = propsFn ? propsFn(i, ctrl) : props[i];\n\n if (update) {\n update = updates[i] = declareUpdate(update);\n\n if (i == 0) {\n refProp.current = update.ref;\n update.ref = undefined;\n }\n }\n }\n }", "title": "" }, { "docid": "af71bf0e3af3cf0ca633971e31152b9a", "score": "0.38518548", "text": "replicateAll() {\n this.db.replicateAllDBs();\n }", "title": "" }, { "docid": "bbac7ea9d0a9e27258a593c807a8d1aa", "score": "0.38493648", "text": "function updateDatabase () {\n var deferred = q.defer();\n var promises = [];\n var i;\n var j;\n\n for (i = 0; i < this.termIds.length; i++) {\n for (j = 0; j < this.hiddenIds.length; j++) {\n promises.push(setStrength(this.termIds[i], this.hiddenIds[j], 0, this.weightsInputToHidden[i][j]));\n }\n }\n\n for (i = 0; i < this.hiddenIds.length; i++) {\n for (j = 0; j < this.resultIds.length; j++) {\n promises.push(setStrength(this.hiddenIds[i], this.resultIds[j], 1, this.weightsHiddenToResults[i][j]));\n }\n }\n\n q.all(promises).then(function () {\n deferred.resolve();\n });\n\n return deferred.promise;\n }", "title": "" }, { "docid": "122504d24463b15ae65c56b4ae21e890", "score": "0.384767", "text": "function appendNameAliases() {\n for (var i = 0; i < vm.ctrpOrg.name_aliases.length; i++) {\n vm.addedNameAliases.push({\n id: vm.ctrpOrg.name_aliases[i].id,\n name: vm.ctrpOrg.name_aliases[i].name,\n _destroy: false\n });\n }\n }", "title": "" }, { "docid": "530f5adf4fbe3f65421d0f05bc7bcaaa", "score": "0.3845854", "text": "async addNoiseWords(noiseText) {\n await this.database.collection('noiseWords').updateOne({},{$set:{words:noiseText}},{upsert:true});\n }", "title": "" }, { "docid": "163a51cfd59104f235a0a9020c3b5376", "score": "0.38400793", "text": "function UpdateBulkItems() {\n BulkUpdateItems(finalDocArray[cntr])\n\t.then(\n\t\tfunction () {\n\t\t cntr++;\n\t\t if (cntr < finalDocArray.length) {\n\t\t UpdateBulkItems();\n\t\t }\n\t\t else {\n\t\t alert('Metadata Updated Successfully');\n\t\t }\n\t\t},\n\t\tfunction (error) {\n\t\t console.log('Metadata Updation failed: ' + error);\n\t\t}\n\t);\n}", "title": "" }, { "docid": "32b8705ffb39db844210adf077b3cf25", "score": "0.38391775", "text": "writeMany(indices, tensors) {\n if (indices.length !== tensors.length) {\n throw new Error(`TensorArray ${this.name}: could not write multiple tensors,` + `because the index size: ${indices.length} is not the same as tensors size: ${tensors.length}.`);\n }\n\n indices.forEach((i, index) => this.write(i, tensors[index]));\n }", "title": "" }, { "docid": "650072d45667a813141d59abac45c374", "score": "0.38381016", "text": "static async getAllSyndicatesAndItems()\n {\n var syndicates = Syndicate.getAllSyndicates();\n\n for (var syndi of syndicates)\n {\n await syndi.fetchOfferingsAndPrices();\n }\n\n return syndicates;\n }", "title": "" } ]
89104ef36baf01b5bcef8ae6253dec05
Stack words on homepage hero
[ { "docid": "38a053c8f0604ff34a937bef5f522109", "score": "0.6465392", "text": "function stackWords(text) {\n\n var newText = '<div class=\"headerText\"><p>';\n\n for (var i = 0; i < text.length; i++) {\n\n if (text[i] === \" \") {\n newText += '</p><div class=\"textUnderline\"></div></div><div class=\"headerText\"><p>';\n } else {\n newText += text[i];\n }\n }\n\n return newText + '</p><div class=\"textUnderline\"></div></div>';\n\n }", "title": "" } ]
[ { "docid": "5e853e27c83b420911186517ce4d566e", "score": "0.64089", "text": "function addHaiku() {\n // Gets the section we will put the page content into\n let section = document.getElementById(`haiku`);\n // Loop through the array of strings\n let line1=random(haikuLines.fiveSyllables);\n for (let i = 0; i < line1.length; i++) {\n // Create a <p> element\n let paragraph = document.createElement(`p`);\n // Get an array of individual words from the current string of lorem ipsum\n // by splitting it at every space character\n let words = line1[i].split(``);\n // Go through every word\n for (let j = 0; j < words.length; j++) {\n // Create a <span> element\n let span = document.createElement(`span`);\n // Add the \"word\" class to the span (not really doing much right now)\n span.classList.add(`word`);\n // Set the text of the span to the current word so it will display\n span.innerText = `${words[j]} `;\n // Add a mouse enter listener so we can change the span's color\n span.addEventListener(`mouseenter`, mouseEnterWord);\n // Add the current span (word) the current paragraph\n paragraph.appendChild(span);\n }\n // Add the current paragraph to the main section on the webpage\n section.appendChild(paragraph);\n }\n}", "title": "" }, { "docid": "999c591b9f332d81dabf92b1a0137dfe", "score": "0.59377503", "text": "function createHellos() {\n if ($('.word').length == 20) {\n clearInterval(helloTimer);\n }\n let width = $('header').get(0).offsetWidth;\n let height = $('header').get(0).offsetHeight;\n addHello(width, height); \n }", "title": "" }, { "docid": "f52815789e8bffa7c1187334cfefad4a", "score": "0.59220046", "text": "function homeAnimation() {\r\n\r\n // What word(s) will animate.\r\n var string = \"Home\";\r\n var home = string.split(\"\");\r\n // Gets the element by the id of where the word will animate.\r\n var el = document.getElementById(\"home\");\r\n (function animate() {\r\n home.length > 0 ? el.innerHTML += home.shift() : clearTimeout(running);\r\n // How long it takes for the words to animate.\r\n var running = setTimeout(animate, 90);\r\n })();\r\n}", "title": "" }, { "docid": "9185f4897e5165fff3ad91ca28d4535d", "score": "0.5879483", "text": "function setFirstScreen() {\n let words = story.match(/\\S+/g);\n // let storyHTML = \"\";\n let word = \"\";\n\n // go over every word in story\n // put every word/sentence(surrounded by *xxx*) that needs to be marked in a \"to-mark\" div\n // put any other word in a \"word\" div\n for (let i = 0; i < words.length; i++) {\n storyHTML += \" \";\n word = words[i];\n\n // there is a * in the word => class=\"to-mark\"\n if (word.search(/\\*/) != -1) {\n storyHTML += word.substring(0, word.search(/\\*/));\n word = word.substring(word.search(/\\*/) + 1);\n\n // there isnt a closing * in the word => add words until there is \n if (word.search(/\\*/) == -1) {\n storyHTML += \"<div class='to-mark'>\" + word;\n if (i < words.length - 1) {\n i++;\n word = words[i];\n\n while (word.search(/\\*/) == -1) {\n storyHTML += \" \" + word;\n i++;\n if (i < words.length) {\n word = words[i];\n }\n else {\n break;\n }\n }\n }\n storyHTML += \" \" + word.substring(0, word.search(/\\*/)) + \"</div>\";\n storyHTML += word.substring(word.search(/\\*/) + 1);\n }\n // there is a closing * in the word => add the word to storyHTML(in a to-mark div)\n else {\n storyHTML += \"<div class='to-mark'>\" + word.substring(0, word.search(/\\*/)) + \"</div>\" + word.substring(word.search(/\\*/) + 1);\n }\n }\n // there is not a * in the word => class=\"word\"\n else {\n storyHTML += \"<div class='word'>\" + word + \"</div>\";\n }\n\n }\n\n // add story to speech bubble\n document.querySelector(\".speech\").innerHTML = storyHTML;\n\n // add listeners for words that need to be marked\n let toMark = document.querySelectorAll(\".speech > .to-mark\");\n for (let index = 0; index < toMark.length; index++) {\n // toMark[index].innerHTML = toMark[index].innerHTML.replace(/(<div class=\"word\">|<\\/div>)/g, \"\");s\n wordBank.push(toMark[index].innerText);\n toMark[index].addEventListener(\"click\", mark);\n }\n\n //add listeners for words that *DONT* need to be marked\n let wrong = document.querySelectorAll(\".speech >.word\");\n for (let index = 0; index < wrong.length; index++) {\n wrong[index].addEventListener(\"click\", mark);\n }\n\n document.querySelector(\".marking .counter\").innerText = \"0/\" + document.querySelectorAll(\".marking .to-mark\").length;\n}", "title": "" }, { "docid": "0f37ca57b576be3a2ee25798ebfead2f", "score": "0.5847195", "text": "function generateWords () {\n getAliveSharks().forEach(shark =>\n shark.appendChild(\n document.createTextNode(randomWords(1))\n )\n)\n document.getElementById('sharkOne').style.marginLeft = Math.random() * 50 + 'vw'\n document.getElementById('sharkTwo').style.marginLeft = Math.random() * 80 + 'vw'\n document.getElementById('sharkThree').style.marginLeft = Math.random() * 100 + 'vw'\n document.getElementById('sharkFour').style.marginLeft = Math.random() * 30 + 'vw'\n document.querySelector('ul').classList.add('school')\n}", "title": "" }, { "docid": "fd8bb4616c7c12b70c7070252922a1ba", "score": "0.578124", "text": "function changeWords() {\n // console.log('changing words ' + idx);\n topWords.innerHTML = topSayings[idx];\n bottom.innerHTML = bottomSayings[idx];\n // signup.innerHTML = signupSayings[idx];\n // idxIterator();\n setTimeout(fadeInLeft, 10);\n // return idx;\n }", "title": "" }, { "docid": "46455bbc30660c0acd1d2eafe89e8886", "score": "0.57276005", "text": "function machineGun(text) {\n\t\tvar words = text.split(\" \"),\n\t\t tl = new TimelineMax({ delay: 0.6, repeat: 2, repeatDelay: 4 }),\n\t\t wordCount = words.length,\n\t\t time = 0,\n\t\t word,\n\t\t element,\n\t\t duration,\n\t\t isSentenceEnd,\n\t\t i;\n\n\t\tfor (i = 0; i < wordCount; i++) {\n\t\t\tword = words[i];\n\t\t\tisSentenceEnd = _sentenceEndExp.test(word);\n\t\t\telement = function () {\n\t\t\t\tvar child = document.createElement('h3');\n\t\t\t\tchild.innerHTML = word;\n\t\t\t\tcontainer.appendChild(child);\n\t\t\t\treturn child;\n\t\t\t}();\n\t\t\t//$(\"<h3>\" + word + \"</h3>\").appendTo(container);\n\t\t\tduration = Math.max(0.5, word.length * 0.15); //longer words take longer to read, so adjust timing. Minimum of 0.5 seconds.\n\t\t\tif (isSentenceEnd) {\n\t\t\t\tduration += 0.6; //if it's the last word in a sentence, drag out the timing a bit for a dramatic pause.\n\t\t\t}\n\t\t\t//set opacity and scale to 0 initially. We set z to 0.01 just to kick in 3D rendering in the browser which makes things render a bit more smoothly.\n\t\t\tTweenLite.set(element, { autoAlpha: 0, scale: 0, z: 0.01 });\n\t\t\t//the SlowMo ease is like an easeOutIn but it's configurable in terms of strength and how long the slope is linear. See http://www.greensock.com/v12/#slowmo and http://api.greensock.com/js/com/greensock/easing/SlowMo.html\n\t\t\ttl.to(element, duration, {\n\t\t\t\tscale: 1.2,\n\t\t\t\tease: SlowMo.ease.config(0.25, 0.9)\n\t\t\t}, time)\n\t\t\t//notice the 3rd parameter of the SlowMo config is true in the following tween - that causes it to yoyo, meaning opacity (autoAlpha) will go up to 1 during the tween, and then back down to 0 at the end. \n\t\t\t.to(element, duration, { autoAlpha: 1, ease: SlowMo.ease.config(0.25, 0.9, true) }, time);\n\t\t\ttime += duration - 0.05;\n\t\t\tif (isSentenceEnd) {\n\t\t\t\ttime += 0.6; //at the end of a sentence, add a pause for dramatic effect.\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "34b32e699a1864038c9e7698cfc982ac", "score": "0.57142556", "text": "makeText(numWords = 100) {\n let currentIndex = Math.floor(Math.random() * this.words.length);\n let currentWord = this.words[currentIndex];\n let markovText = [];\n let nextWord;\n\n while(markovText.length < numWords - 1 && currentWord !== null) {\n currentIndex = Math.floor(Math.random() * this.wordChains[currentWord].length);\n nextWord = this.wordChains[currentWord][currentIndex];\n markovText.push(currentWord);\n currentWord = nextWord;\n };\n return markovText.join(' ');\n }", "title": "" }, { "docid": "6d3d887931c7801d84894db376033ade", "score": "0.5708391", "text": "function displayWords(expression)\n{\n console.log(\"the expression is \"+expression);\n if(expression === \"happy\")\n {\n fill(255,255,random(10,200));\n textSize(28);\n text(words[0],windowWidth/6, windowHeight/2);\n text(words[1],windowWidth/12, 7*windowHeight/12);\n text(words[2],windowWidth/6+windowWidth/1.6, windowHeight/2);\n text(words[3],windowWidth/12+windowWidth/1.6, 7*windowHeight/12);\n fill(0);\n text(words[4],windowWidth/7, windowHeight/4);\n text(words[8],windowWidth/5, windowHeight/3);\n text(words[12],windowWidth/8.5, 3*windowHeight/4);\n text(words[5],windowWidth/10, 5*windowHeight/6);\n text(words[9],windowWidth/5, 2*windowHeight/5);\n text(words[13],windowWidth/9, 8*windowHeight/12);\n text(words[6],windowWidth/7+windowWidth/1.6, windowHeight/4);\n text(words[10],windowWidth/5+windowWidth/1.6, windowHeight/3);\n text(words[14],windowWidth/8.5+windowWidth/1.6, 3*windowHeight/4);\n text(words[7],windowWidth/10+windowWidth/1.6, 5*windowHeight/6);\n text(words[11],windowWidth/5+windowWidth/1.6, 2*windowHeight/5);\n text(words[15],windowWidth/9+windowWidth/1.6, 8*windowHeight/12);\n }\n if(expression === \"sad\")\n {\n fill(random(0,40),random(0,40), random(200,255));\n textSize(28);\n text(words[4],windowWidth/7, windowHeight/4);\n text(words[5],windowWidth/10, 5*windowHeight/6);\n text(words[6],windowWidth/7+windowWidth/1.6, windowHeight/4);\n text(words[7],windowWidth/10+windowWidth/1.6, 5*windowHeight/6);\n fill(0);\n text(words[8],windowWidth/5, windowHeight/3);\n text(words[12],windowWidth/8.5, 3*windowHeight/4);\n text(words[1],windowWidth/12, 7*windowHeight/12);\n text(words[9],windowWidth/5, 2*windowHeight/5);\n text(words[13],windowWidth/9, 8*windowHeight/12);\n text(words[2],windowWidth/6+windowWidth/1.6, windowHeight/2);\n text(words[10],windowWidth/5+windowWidth/1.6, windowHeight/3);\n text(words[14],windowWidth/8.5+windowWidth/1.6, 3*windowHeight/4);\n text(words[3],windowWidth/12+windowWidth/1.6, 7*windowHeight/12);\n text(words[11],windowWidth/5+windowWidth/1.6, 2*windowHeight/5);\n text(words[15],windowWidth/9+windowWidth/1.6, 8*windowHeight/12);\n text(words[0],windowWidth/6, windowHeight/2);\n }\n if(expression === \"angry\")\n {\n\n fill(random(200,255), random(0,40),random(0,40));\n textSize(28);\n text(words[8],windowWidth/5, windowHeight/3);\n text(words[9],windowWidth/5, 2*windowHeight/5);\n text(words[10],windowWidth/5+windowWidth/1.6, windowHeight/3);\n text(words[11],windowWidth/5+windowWidth/1.6, 2*windowHeight/5);\n fill(0);\n text(words[0],windowWidth/6, windowHeight/2);\n text(words[4],windowWidth/7, windowHeight/4);\n text(words[1],windowWidth/12, 7*windowHeight/12);\n text(words[5],windowWidth/10, 5*windowHeight/6);\n text(words[13],windowWidth/9, 8*windowHeight/12);\n text(words[2],windowWidth/6+windowWidth/1.6, windowHeight/2);\n text(words[6],windowWidth/7+windowWidth/1.6, windowHeight/4);\n text(words[14],windowWidth/8.5+windowWidth/1.6, 3*windowHeight/4);\n text(words[3],windowWidth/12+windowWidth/1.6, 7*windowHeight/12);\n text(words[7],windowWidth/10+windowWidth/1.6, 5*windowHeight/6);\n text(words[12],windowWidth/8.5, 3*windowHeight/4);\n text(words[15],windowWidth/9+windowWidth/1.6, 8*windowHeight/12);\n }\n\n if(expression === \"surprised\")\n {\n fill(245,245,245);\n textSize(28);\n text(words[12],windowWidth/8.5, 3*windowHeight/4);\n text(words[13],windowWidth/9, 8*windowHeight/12);\n text(words[14],windowWidth/8.5+windowWidth/1.6, 3*windowHeight/4);\n text(words[15],windowWidth/9+windowWidth/1.6, 8*windowHeight/12);\n fill(0);\n text(words[0],windowWidth/6, windowHeight/2);\n text(words[4],windowWidth/7, windowHeight/4);\n text(words[8],windowWidth/5, windowHeight/3);\n text(words[1],windowWidth/12, 7*windowHeight/12);\n text(words[5],windowWidth/10, 5*windowHeight/6);\n text(words[9],windowWidth/5, 2*windowHeight/5);\n text(words[2],windowWidth/6+windowWidth/1.6, windowHeight/2);\n text(words[6],windowWidth/7+windowWidth/1.6, windowHeight/4);\n text(words[10],windowWidth/5+windowWidth/1.6, windowHeight/3);\n text(words[3],windowWidth/12+windowWidth/1.6, 7*windowHeight/12);\n text(words[7],windowWidth/10+windowWidth/1.6, 5*windowHeight/6);\n text(words[11],windowWidth/5+windowWidth/1.6, 2*windowHeight/5);\n \n }\n}", "title": "" }, { "docid": "3de9b618c277f9d9c0d19dfa9206f856", "score": "0.57082987", "text": "function wordFind() {\n setGameEnded(false) \n clearGrid();\n const proxy = new Array(size).fill('').map(() => new Array(size).fill(''));\n setWords(words.sort((a, b) => b.length - a.length));\n\n for (let word of words) {\n if (backwards) {\n let directions = [\"forwards\", \"backwards\"]\n let direction = directions[Math.floor(Math.random() * directions.length)];\n if (direction === 'backwards') word = word.split('').reverse().join('');\n }\n \n\n const possiblePoints = getPossibleStartingPoints(word, orientations, proxy);\n placeWord(word, possiblePoints, proxy);\n }\n for (let i = 0; i < size; i++) {\n for (let j = 0; j < size; j++) {\n if (proxy[i][j] === '') proxy[i][j] = getRandomChar();\n }\n }\n setGrid(proxy);\n }", "title": "" }, { "docid": "5d0f49448dfcf6f84a3cf5ce2d811191", "score": "0.5691118", "text": "function generateHero() {\n let name = nameGen();\n let word = mottoWords[numGen(mottoWords.length)];\n let motto = `I am ${name}!<br>Here I come to ${word} the day!`\n //console.log(motto);\n document.getElementById('motto').innerHTML = motto\n}", "title": "" }, { "docid": "5adb543268282ebc3127b9038f92666c", "score": "0.5682063", "text": "getInitialWords(text, headline) {\n return text.replace(headline, \"\").split(\" \").slice(0, 25).join(\" \") + \"...\";\n }", "title": "" }, { "docid": "cff4985f1917e38026b9846b4a49104e", "score": "0.56783634", "text": "function showWord(words) {\n switch (gameMode) {\n case mode.image:\n imageTest();\n break; \n default:\n let wordIndex = Math.floor(Math.random() * words.length); \n currentWord.innerHTML = words[wordIndex];\n break;\n }\n}", "title": "" }, { "docid": "bdb0619ca1b90c71ec9469139abe9da4", "score": "0.5652013", "text": "function showWord(words) {\r\n const randIndex = Math.floor(Math.random() * words.length);\r\n currentWord.innerHTML = words[randIndex];\r\n}", "title": "" }, { "docid": "f5d8a91822b29f7892b5e45dbf8ae0a9", "score": "0.56225115", "text": "function revealWord () {\n var temp = \"\",\n theWordArray = theWord.split(\"\");\n\n for (var i = 0; i < theWordArray.length; i++) {\n var correct = false;\n for (var x = 0; x < rightGuesses.length; x++) {\n if (theWordArray[i].indexOf(rightGuesses[x]) > -1) {\n temp += '<span class=\"playerCor\">' + theWordArray[i] + '</span>';\n correct = true;\n }\n }\n if (correct == false) { temp += '<span class=\"playerWro\">' + theWordArray[i] + '</span>'; }\n }\n\n // Set the word on the game board to the temp one this function created\n theWordID.innerHTML = temp;\n}", "title": "" }, { "docid": "c109f5dc1f15cd75a2f2be5464edd35c", "score": "0.55914444", "text": "function addWord(word, wordsearch, word_locations){\n // Initialize/declare variables and constants\n const DIRECTIONS = [\"hoz\", \"vert\", \"diag\"];\n var fits = false;\n var first_letter = true;\n var last_letter = false;\n var starting_row;\n var starting_col;\n var direction;\n\n // Set the path for the link \n var path;\n if (word == \"home\") {\n path = \"index.html\";\n } else {\n path = word + \".html\"\n }\n\n // Keeps choosing a new starting location until one is found where the word fits\n while (!fits){\n starting_row = Math.floor(Math.random() * 10); \n starting_col = Math.floor(Math.random() * 10); \n direction = DIRECTIONS[Math.floor(Math.random() * 3)];\n fits = wordFits(starting_row, starting_col, word, direction, wordsearch);\n }\n\n // Add location to dicitionary for use later \n word_locations[word] = [starting_row, starting_col, direction]\n\n // Fills spaces in wordsearch with each letter of the predefined words\n switch(direction){\n case \"hoz\":\n for (var i = 0; i < word.length; i++){\n // includes html links so words can be used as naviation\n // TODO: add attribute highlighted and id of word??\n if (first_letter) {\n wordsearch [starting_row] [starting_col + i] = \"<a href=\\\"\" + path + \"\\\" class=\\\"\" + word + \"\\\" id=\\\"\" + word +\"_first\\\">\" + word[i].toUpperCase() + \" </a>\";\n first_letter = false;\n } else {\n wordsearch [starting_row] [starting_col + i] = \"<a href=\\\"\" + path + \"\\\" class=\\\"\" + word + \"\\\">\" + word[i].toUpperCase() + \" </a>\";\n }\n }\n break;\n case \"vert\":\n for (var i = 0; i < word.length; i++){\n\n if (first_letter) {\n wordsearch [starting_row + i] [starting_col] = \"<a href=\\\"\" + path + \"\\\" class=\\\"\" + word + \"\\\" id=\\\"\" + word +\"_first\\\">\" + word[i].toUpperCase() + \" </a>\";\n first_letter = false;\n } else {\n wordsearch [starting_row + i] [starting_col] = \"<a href=\\\"\" + path + \"\\\" class=\\\"\" + word + \"\\\">\" + word[i].toUpperCase() + \" </a>\";\n }\n }\n break;\n case \"diag\":\n for (var i = 0; i < word.length; i++){\n if (first_letter) {\n wordsearch [starting_row + i] [starting_col + i] = \"<a href=\\\"\" + path + \"\\\" class=\\\"\" + word + \"\\\" id=\\\"\" + word +\"_first\\\">\" + word[i].toUpperCase() + \" </a>\";\n first_letter = false;\n } else {\n wordsearch [starting_row + i] [starting_col + i] = \"<a href=\\\"\" + path + \"\\\" class=\\\"\" + word + \"\\\">\" + word[i].toUpperCase() + \" </a>\";\n }\n //wordsearch [starting_row + i] [starting_col + i] = \"<a href=\\\"\" + path + \"\\\" >\" + word[i].toUpperCase() + \"</a> \";\n }\n break;\n default:\n break;\n }\n \n return wordsearch;\n\n}", "title": "" }, { "docid": "f4e5435075ecbb2e3d42336c1ae326b8", "score": "0.5589283", "text": "function initText(){\n poem.innerHTML = '<span class=\"word\">' + text.map(function (char) {\n if(char == \"%\"){\n return '</span><br><span class=\"word\">';\n }else if(char == \"*\"){\n return '</span><br><br><span class=\"word\">'\n }else if(char == \" \"){\n return '</span> <span class=\"word\">'\n }else{\n if($.inArray(char, voyelles) !== -1){\n return '<span class=\"voy\">' + char + '</span>';\n }else{\n return '<span>' + char + '</span>';\n }\n }\n }).join('');\n poem.innerHTML += '</span>';\n words = $('.word');\n letters = $('.word > span');\n letters.each(function(i){\n $(this).data({'offsetTop' : $(this).offset().top, 'offsetLeft' : $(this).offset().left, 'letter' : $(this).text().toLowerCase(), 'hidden' : true});\n });\n bigChar.each(function(i){\n $(this).data({'offsetTop' : $(this).offset().top, 'offsetLeft' : $(this).offset().left, 'letter' : $(this).text().toLowerCase()});\n });\n allVoy = $('.voy');\n }", "title": "" }, { "docid": "ee831b84f60ff54576b0ac687d98cce0", "score": "0.5585916", "text": "function showWord(words) {\n //Generate random array index\n const randIndex = Math.floor(Math.random() * words.length);\n\n //output a random word\n currentWord.innerHTML = words[randIndex];\n}", "title": "" }, { "docid": "1b59de27c423c59f65083a62104638a4", "score": "0.55560106", "text": "makeText(numWords = 100){\n\n let minWords = this.words.length>=10 ? 10:1; \n let nextWord = this.selectRandomWord(this.capitalWords)\n let text = [nextWord];\n\n while(nextWord != null && numWords>0 && !(this.checkEnd(nextWord) && text.length > minWords)){\n\n numWords--;\n nextWord = this.selectRandomWord(this.chains[nextWord]);\n text.push(nextWord);\n }\n\n text = text.join(' ');\n this.text = text;\n }", "title": "" }, { "docid": "2ce6fdf562b2f745e7f11f5eb329138b", "score": "0.5542831", "text": "function showWord(words) {\n //Generate random array index\n const randIndex = Math.floor(Math.random() * words.length);\n //Output random word\n currentWord.innerHTML = words[randIndex];\n}", "title": "" }, { "docid": "9e4819a9b1432c7c760b92b413d21197", "score": "0.55392504", "text": "function Main() {\n\n\n \n useEffect(()=>{\n const screen = window.matchMedia('screen and (max-width:1024px)');\n // plugins\n gsap.registerPlugin(TextPlugin);\n gsap.registerPlugin(ScrollTrigger);\n let vh = window.innerHeight * 0.01;\n document.documentElement.style.setProperty('--vh', `${vh}px`);\n // main txt word array\n const words =[\" Full Stack Developer.\",\" UI/UX Designer.\",\" Freelancer.\",\" Student.\"];\n gsap.to('.blinker',{opacity:0,duration:0.8,repeat:-1})\n const texttl = gsap.timeline({repeat:-1,delay:10});\n // gsap.from('.profile',{opacity:0,x: window.innerWidth * 1,scale:0,duration:2,ease:\"back\",delay:12})\n words.forEach(word=>{\n let tl = gsap.timeline({repeat:1,yoyo:true,repeatDelay:2});\n tl.to('.iam_txt',{duration:2.3,text: word})\n texttl.add(tl)\n });\n // scrolltrigger begins\n\n setTimeout(()=>{\n const s_tl= gsap.timeline({\n scrollTrigger:{\n trigger:\".main\",\n start:\"top top\",\n scrub:1,\n pin:true,\n end:\"bottom -200px\"\n },\n }) \n\n // if(screen.matches){\n // s_tl.to(\".profile\",{opacity:0,duration:2,ease:\"linear\"},\"-=1\");\n // }else{\n // }\n // // s_tl.to(\".main\",{background:\"#333\",duration:2,ease:\"linear\"},\"-=1\")\n if(screen.matches){\n // s_tl.from(\".about\",{y:(window.innerHeight* 1),duration:5,ease:\"linear\"})\n // s_tl.to(\".home\",{y:-(window.innerHeight* 1),opacity:0,duration:6,ease:\"linear\"},\"-=5\")\n // s_tl.from(\".skills\",{y:window.innerHeight * 1,duration:7,ease:\"linear\"},\"-=1\")\n // s_tl.to(\".about\",{y:-(window.innerHeight* 1),opacity:0,duration:8,ease:\"linear\"},\"-=7\")\n // s_tl.to(\".skills\",{y:-(window.innerHeight * 1),duration:8,ease:\"linear\"},\"-=1\") \n // s_tl.fromTo(\".contact\",{y:window.innerHeight * 1},{y:-(100-vh),duration:7,ease:\"linear\"},\"-=1\")\n }else{\n s_tl.to('.scroll-indicator',{opacity:0})\n s_tl.to(\".main_info\",{x:window.innerWidth * -1,duration:2,ease:\"linear\"})\n s_tl.to(\".profile\",{x:-(window.innerWidth-600),duration:5,ease:\"linear\"},\"-=1\");\n s_tl.from(\".about\",{x:(window.innerWidth * 1),duration:2,ease:\"linear\"},\"-=1\")\n // s_tl.from(\".about_head\",{width:100,opacity:0,duration:5,ease:\"linear\"},\"-=1\")\n // s_tl.from(\".about_txt\",{x:window.innerWidth * 1,opacity:5,duration:6,ease:\"linear\"})\n s_tl.from(\".skills\",{y:window.innerHeight * 1,duration:7,ease:\"linear\"},\"+=1.5\")\n s_tl.to(\".about\",{y:-(window.innerHeight * 1),duration:5,ease:\"linear\"},\"-=5\")\n s_tl.to(\".profile\",{y:-(window.innerHeight * 1),duration:6.5,ease:\"linear\"},\"-=7\")\n s_tl.from(\".skill_item\",{opacity:0,stagger:0.4,duration:6.5,ease:\"power2\"},\"-=6\")\n s_tl.to(\".skills\",{y:-(window.innerHeight),duration:10,ease:\"linear\"},'-=5.7')\n s_tl.from(\".contact\",{y:window.innerHeight * 1,duration:7,ease:\"linear\"},\"-=8\")\n }\n },7000)\n\n },[])\n return (\n <div className=\"main\" > \n <div className=\"home\">\n <div className=\"profile\">\n <img src={prof} alt=\"me\"></img>\n </div> \n <div className=\"main_info\">\n <p>Hello There</p>\n <p>I Am Yashwanth Muddana</p>\n <p>I Am A \n <span className=\"iam_txt\"></span>\n <span className=\"blinker\">_</span>\n </p>\n\n </div>\n \n <div className=\"scroll-indicator\">\n {/* <div className=\"scroll_dot\"></div> */}\n <img src={down} className=\"scroll_ind_sec\" alt=\"scroll\"/>\n <img src={down} className=\"scroll_ind_main\" alt=\"scroll\"/>\n </div>\n\n </div>\n <div className=\"about\" >\n <p className=\"about_head\">About Me</p>\n <p className=\"about_txt\" id=\"about\">Hi, I am Yashwanth Muddana, I am a full stack web developer, UI/UX designer, and a freelancer. Currently I am a full stack developer working for Ideal business solutions which is a startup with great idea and ideology. I am enthusiastic towards growing technologies, I am very happy to connect the bridge between people by making businesses online. I am highly experienced in designing websites and developing them, I am looking forward to work with any who makes the day to day life better.I am a 2nd year student at VIT University Vellore India. </p>\n </div>\n <div className=\"skills\" id=\"skills\">\n <p className=\"skill_head\">Skills</p>\n <div className=\"skill_items\" >\n <Tilt className=\"skill_item \" \n tiltMaxAngleX={30}\n tiltMaxAngleY={30}\n perspective={800}\n transitionSpeed={1500}\n glareEnable={true}\n glareMaxOpacity={0.45}\n >\n <img src={html} alt=\"html\"/>\n </Tilt>\n <Tilt className=\"skill_item \" \n tiltMaxAngleX={30}\n tiltMaxAngleY={30}\n perspective={800}\n transitionSpeed={1500}\n glareEnable={true}\n glareMaxOpacity={0.45}\n >\n <img src={css} alt=\"css\"/>\n </Tilt>\n <Tilt className=\"skill_item \" \n tiltMaxAngleX={30}\n tiltMaxAngleY={30}\n perspective={800}\n transitionSpeed={1500}\n glareEnable={true}\n glareMaxOpacity={0.45}\n >\n <img src={js} alt=\"js\"/>\n </Tilt>\n <Tilt className=\"skill_item \" \n tiltMaxAngleX={30}\n tiltMaxAngleY={30}\n perspective={800}\n transitionSpeed={1500}\n glareEnable={true}\n glareMaxOpacity={0.45}\n >\n <img src={bootstrap} alt=\"bootstrap\"/>\n </Tilt>\n <Tilt className=\"skill_item \" \n tiltMaxAngleX={30}\n tiltMaxAngleY={30}\n perspective={800}\n transitionSpeed={1500}\n glareEnable={true}\n glareMaxOpacity={0.45}\n >\n <img src={mui} alt=\"mui\"/>\n </Tilt>\n <Tilt className=\"skill_item \" \n tiltMaxAngleX={30}\n tiltMaxAngleY={30}\n perspective={800}\n transitionSpeed={1500}\n glareEnable={true}\n glareMaxOpacity={0.45}\n >\n <img src={react} alt=\"react\"/>\n </Tilt>\n <Tilt className=\"skill_item \" \n tiltMaxAngleX={30}\n tiltMaxAngleY={30}\n perspective={800}\n transitionSpeed={1500}\n glareEnable={true}\n glareMaxOpacity={0.45}\n >\n <img src={angular} alt=\"angular\"/>\n </Tilt>\n <Tilt className=\"skill_item \" \n tiltMaxAngleX={30}\n tiltMaxAngleY={30}\n perspective={800}\n transitionSpeed={1500}\n glareEnable={true}\n glareMaxOpacity={0.45}\n >\n <img src={ionic} alt=\"ionic\"/>\n </Tilt>\n <Tilt className=\"skill_item \" \n tiltMaxAngleX={30}\n tiltMaxAngleY={30}\n perspective={800}\n transitionSpeed={1500}\n glareEnable={true}\n glareMaxOpacity={0.45}\n >\n <img src={node} alt=\"node\"/>\n </Tilt>\n <Tilt className=\"skill_item \" \n tiltMaxAngleX={30}\n tiltMaxAngleY={30}\n perspective={800}\n transitionSpeed={1500}\n glareEnable={true}\n glareMaxOpacity={0.45}\n >\n <img src={express} alt=\"express\"/>\n </Tilt>\n <Tilt className=\"skill_item \" \n tiltMaxAngleX={30}\n tiltMaxAngleY={30}\n perspective={800}\n transitionSpeed={1500}\n glareEnable={true}\n glareMaxOpacity={0.45}\n >\n <img src={mdb} alt=\"mdb\"/>\n </Tilt>\n <Tilt className=\"skill_item \" \n tiltMaxAngleX={30}\n tiltMaxAngleY={30}\n perspective={800}\n transitionSpeed={1500}\n glareEnable={true}\n glareMaxOpacity={0.45}\n >\n <img src={php} alt=\"php\"/>\n </Tilt>\n <Tilt className=\"skill_item \" \n tiltMaxAngleX={30}\n tiltMaxAngleY={30}\n perspective={800}\n transitionSpeed={1500}\n glareEnable={true}\n glareMaxOpacity={0.45}\n >\n <img src={sql} alt=\"sql\"/>\n </Tilt>\n <Tilt className=\"skill_item \" \n tiltMaxAngleX={30}\n tiltMaxAngleY={30}\n perspective={800}\n transitionSpeed={1500}\n glareEnable={true}\n glareMaxOpacity={0.45}\n >\n <img src={python} alt=\"python\"/>\n </Tilt>\n \n </div>\n </div>\n <div className=\"contact\">\n <p className=\"contact_head\">Contact Me</p>\n <p className=\"contact_txt\">Want to make your bussiness online with website? Yeah Your on the right place. I can build your ideas into a perfect website with reasonable price. Your satisfaction is my priority. You can contact me through these below. </p>\n <div className=\"contact_items\">\n <a href=\"mailto:[email protected]\"><Tilt className=\"contact_item\" glareEnable={true} glareMaxOpacity={0.45} perspective={1000} >\n <img src={mail} alt=\"gmail\"/>\n <span>[email protected]</span>\n </Tilt>\n </a>\n <a href=\"tel:9347451840\"><Tilt className=\"contact_item\" glareEnable={true} glareMaxOpacity={0.45} perspective={1000} >\n <img src={call} alt=\"gmail\"/>\n <span>9347451840</span>\n </Tilt></a>\n </div>\n <div style={{\"textAlign\":\"center\",\"color\":\"lightgrey\",\"marginTop\":\"80px\",\"fontFamily\":\"'Changa', sans-serif\"}}>Designed And Developed By Yashwanth Muddana</div>\n </div>\n </div>\n )\n}", "title": "" }, { "docid": "6135cc66c4e754dce58e5c7cf8ef7b4d", "score": "0.552728", "text": "function showWord(words) {\n // Generate random array index\n const randIndex = Math.floor(Math.random() * words.length);\n // Output random word \n currentWord.innerHTML = words[randIndex];\n}", "title": "" }, { "docid": "95c48be8d4e7159c4d12b05ec270d7ee", "score": "0.55246675", "text": "function showWord(words) {\n // Generate random array index\n const randIndex = Math.floor(Math.random() * words.length);\n // Output random word\n currentWord.innerHTML = words[randIndex];\n}", "title": "" }, { "docid": "5647319fb25fb9b1679474c6b4c65128", "score": "0.55208534", "text": "function showWord(words)\r\n{\r\n //Generate array index\r\n const randIndex = Math.floor(Math.random() * words.length);\r\n //output random word\r\n currentWord.innerHTML = words[randIndex];\r\n}", "title": "" }, { "docid": "d419aa5de6868e2f268623b704302571", "score": "0.55142534", "text": "function displayNewWord()\n {\n \tvar newWord = \"<div class='word font\" + Math.ceil(Math.random()*10) + \" animation\" + Math.ceil(Math.random()*4) + \"' style='top: \" + Math.ceil(Math.random()*90) + \"%'>\" + getRandomWord() + \"</div>\";\n \t$(\".gameBoard\").append(newWord);\n }", "title": "" }, { "docid": "bd372f1ded83c5556d802b361cd7f4ee", "score": "0.55113965", "text": "function showWord(words){\n //Generate random array index\n const randIndex = Math.floor(Math.random() *words.length);\n //Output random word\n currentWord.innerHTML = words[randIndex];\n}", "title": "" }, { "docid": "f87b9a682abe6c58f330c96a621f317f", "score": "0.5504389", "text": "function addWelcome() {\n const aboutMe =\n ['Welcome', \n 'Bienvenido', \n 'herzlich willkommen', \n '欢迎', \n 'akeyi'];\n\n // Pick a random welcome.\n const moreText = aboutMe[Math.floor(Math.random() * aboutMe.length)];\n\n // Add it to the page.\n const moreContainer = document.getElementById('more-container');\n moreContainer.innerText = moreText;\n}", "title": "" }, { "docid": "5b6ad0f50b28b52d8150ef3748412a1f", "score": "0.54981947", "text": "function displayInitialSentence()\n{\n\tvar lastx = 10;\n\tupdate = true;\n\tfor(var i = 0; i < currentProcessedSentence.length; i++)\n\t{\n\t\tvar word = createWordUI(currentProcessedSentence[i]);\n\t\tword.addEventListener('click', onWordClick, true);\n\t\tword.addEventListener('mousedown', onWordMouseDown, true);\n\t\tword.addEventListener('pressmove', onWordPressMove, true);\n\t\tword.addEventListener('pressup', onWordPressUp, true);\n\t\t//word.x = lastx;\n\t\tword.x = lastx + 400;\n\t\tword.y = 10;\n\t\tword.alpha = 0;\n\t\t//createjs.Tween.get(word).wait(i*250).to({x:lastx,y:10}, 500 + i*200, createjs.Ease.elasticOut).call(function(){\n\t\tcreatejs.Tween.get(word).wait(i*150).to({x:lastx,y:10, alpha:100}, 500 + i*100, createjs.Ease.bounceOut).call(function(){\n\t\t\t\n\t\t });\n\t\tvar bounds = word.getBounds();\n\t\tlastx = lastx+bounds.width+15;\n\t\tstage.addChild(word);\n\t}\n\tboardDroppedWords = [];\n}", "title": "" }, { "docid": "05872b26dba0af7c861723c5ffda6de3", "score": "0.5474219", "text": "function randWords(){\n displayWord.style.color = \"black\"\n displayWord.textContent = allWords[num.randIndex];\n }", "title": "" }, { "docid": "37c074a8eb6045c0a77a039f2e930ed8", "score": "0.5462048", "text": "makeText(numWords = 100) {\n\n let word = this.words[Math.floor( (Math.random() * this.words.length ) )];\n let text = \"\"\n\n while( numWords && word ){\n \n --numWords\n text = text.concat( word + \" \" )\n word = this.chains[ word ][\n Math.floor( (Math.random() * this.chains[ word ].length ) )\n ]; \n }\n\n return text\n }", "title": "" }, { "docid": "5ed362ab33663dcaed6d7e6bd71da49e", "score": "0.5454906", "text": "function showWord(easy){\r\n\t//generate random word\r\n\tconst randIndex=Math.floor(Math.random() * easy.length);\r\n\t//output random word\r\n\tcurrentWord.innerHTML =easy[randIndex];\r\n}", "title": "" }, { "docid": "afa682853c6401b6e6fd72e4739f4cff", "score": "0.5446143", "text": "function showWord(words) {\n //Generar un index random dentro del array de words\n const randIndex = Math.floor(Math.random() * words.length);\n\n //Generar una palabra random\n\n currentWord.innerHTML = words[randIndex];\n}", "title": "" }, { "docid": "7bec1efd05aa5979bf4c590a9bf13e5a", "score": "0.54457486", "text": "function showWord(words) {\n if (words === undefined) {\n words = word;\n }\n // Generate random array index\n const randIndex = Math.floor(Math.random() * words.length);\n // Output random word\n currentWord.innerHTML = words[randIndex];\n}", "title": "" }, { "docid": "714188d582a10cf0654c0325700499f8", "score": "0.5444752", "text": "function moveBackToList(word) { \r\n\tvar i; //index\r\n\ti = words8.indexOf(word);\r\n\twordElems[i].innerHTML = words8[i];\r\n} // End moveBackToList", "title": "" }, { "docid": "2ec48f58753a910c0d9d7a5a01c2574c", "score": "0.5441022", "text": "function wordCapture() {\n var word = document.querySelector('#overlay > div > div.text').textContent.slice(14);\n if (localStorage.getItem(wordlist).search(word) === -1){\n \tif (word.endsWith('word!') === false){\nlocalStorage.setItem(wordlist,localStorage.getItem(wordlist) + ',\"' + word + '\"'); //updates localstorage\n}\n }\n}", "title": "" }, { "docid": "775577d549d191368b741e1f8eba3e0d", "score": "0.54247826", "text": "function revealText(textEl) {\n var mySplitText = new SplitText(textEl, {type:\"chars, words\"}),\n tl = new TimelineMax(),\n numChars = mySplitText.chars.length;\n\n for(var i = 0; i < numChars; i++){\n //random value used as position parameter\n //OG-KM tl.from(mySplitText.chars[i], 2, {opacity:0}, Math.random() * 2);\n tl.from(mySplitText.chars[i], 3, {opacity:0}, Math.random() * 2);\n }\n}", "title": "" }, { "docid": "d168e80b29d53294f4c052641700863e", "score": "0.5412942", "text": "function createWordTemplate() {\n for (let i = 0; i < (randomWord.length); i++) {\n answerArray[i] = \"_\"\n }\n $(\"h3\").text(answerArray.join(\" \"))\n// Hides replay button so nobody can cheat\n if (completionProgress !== 0 && lives !== 0) {\n $(\"#again\").hide()\n $(\"#againsub\").hide()\n }\n}", "title": "" }, { "docid": "6260b7acce840dbedb2d6197fd8d1c42", "score": "0.5408778", "text": "function initWord() {\n w.el.innerHTML = \"\";\n for (let i in w.map) {\n let chunk = generateChunk(i);\n if (w.map[ i ].raw.match(/\\[|\\]/g))\n chunk.classList.add(w.parenthesisedClass);\n w.el.append(chunk);\n w.map[ i ].el = chunk;\n }\n }", "title": "" }, { "docid": "5f468d467d3d16927d8752e0bca712d8", "score": "0.53972447", "text": "function randomSweet() {\n sweets = gameWord [Math.floor(Math.random() * gameWord.length)];\n sweets = sweets.toLowerCase();\n sweetsLetters = sweets.split(\"\");\n \n\n // puts the letters from random word in the div created for it\n randomWord.textContent = sweetsLetters.join(\"\");\n console.log(sweetsLetters);\n\n // displays the number of letters in the random\n\n }", "title": "" }, { "docid": "e7719f97ad10cbb6797c53318694a3b7", "score": "0.5387427", "text": "function showWord(words){\n const randIndex= Math.floor(Math.random() * words.length);\n //Output random word\n\ncurrentWord.innerHTML = words[randIndex];\n}", "title": "" }, { "docid": "d1c50f679e9c7de2f1991d94a5adf8f1", "score": "0.53860706", "text": "function continueStory() {\n\tvar eSavedHash = localStorage.getItem('save_point').slice(1);\n\tlocalStorage.setItem('save_point', eSavedHash);\n\tvar dSavedHash = decrypt(eSavedHash);\n\tvar gameStack = dSavedHash.split(',');\n\tvar dHash = \"#\";\n\tfor (var i = 1; i<gameStack.length; i++) {\t\t\t\t\t\t\n\t\tdHash = dHash + \",\" + gameStack[i];\n\t\tvar eHash = encrypt(dHash);\n\t\thistory.pushState({}, \"\", eHash);\n\t};\t\t\n\tname = localStorage.getItem('name');\n\t$(\"#intro\").append(\"Text-Based Horror\");\n\tinitialize_choice_arrays();\n\tadjustGrid();\n\t$(\"#instructions\").css(\"text-align\", \"left\");\n\tadvanceStory();\n}", "title": "" }, { "docid": "aedffb0c16c66e2568642f7d7218c37a", "score": "0.53858644", "text": "addPhraseToDisplay() {\r\n const letter = this.phrase.split('')\r\n const phraseElement = document.querySelector('#phrase ul')\r\n for (let i = 0; i < letter.length; i++) {\r\n const child = document.createElement('li')\r\n child.innerHTML = letter[i]\r\n child.className = `hide letter ${letter[i]}`\r\n phraseElement.appendChild(child)\r\n if (letter[i] === ' ')\r\n child.className = `space`\r\n }\r\n }", "title": "" }, { "docid": "b94dd36ade9079d6db9851d23922c06b", "score": "0.5385733", "text": "function displayexample()\r\n{\r\n var str=words[nxt].sent.split(\" \");\r\n var strngs;\r\n \r\n for (var j = 0; j < str.length; j++) \r\n {\r\n if(str[j].search(words[nxt].word)!=-1)\r\n {\r\n str[j]=\"__________\"; \r\n }\r\n \r\n strngs=str.join(\" \"); \r\n }\r\n\r\n\r\n document.getElementById(\"new\").style.display=\"block\";\r\n document.getElementById(\"new\").innerHTML=\"<b>Sentence:</b><p style=color:'green'>\"+strngs+\"</p>\";\r\n document.getElementById(\"eg\").style.display=\"none\";\r\n \r\n chances(--chnc);\r\n \r\n}", "title": "" }, { "docid": "7b629e7aed28cf42781f9998b3ba4fe8", "score": "0.53842103", "text": "onSubmit (e) {\n e.preventDefault() //dont do the default form action\n const words = this.state.insult\n \n \n var insultText = document.createElement('h1');\n\n insultText.innerHTML = words;\n\n insultText.style.position = 'absolute';\n\n insultText.style.top = (Math.floor(Math.random() * (600 - 200 + 1)) + 200) + 'px';\n insultText.style.left = (Math.floor(Math.random() * (1000 - 5 + 1)) + 100) + 'px';\n \n var elem = document.getElementById(\"app\");\n \n elem.parentNode.insertBefore(insultText, elem.nextSibling);\n\n {console.log(this.state.insult)}\n }", "title": "" }, { "docid": "b9f0b03c507a9af9851ceef9f5f5518a", "score": "0.5380917", "text": "startGame(){\n const rndPhrase = this.getRandomPhrase();\n this.phrase = new Phrase(rndPhrase);\n this.phrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "1ed30ac25c569b72bf1563816d5a7e01", "score": "0.537934", "text": "function gemerateSemtemce3(words) {\n let semtemce = [];\n\n if (semtemce.length < words) {\n for (let i = 0; i < words; i++) {\n semtemce.push(lomgemIpsum[Math.floor(Math.random()*lomgemIpsum.length)]);\n };\n };\n\n if (semtemce.length === words) {\n semtemce = semtemce.join(' ');\n var firstLetter = semtemce.slice(0, 1);\n var remainingLetters = semtemce.slice(1);\n semtemce = firstLetter.toUpperCase() + remainingLetters;\n semtemce += pumctuatiom2[Math.floor(Math.random() * pumctuatiom2.length)];\n passage.push(semtemce);\n };\n\n return;\n}", "title": "" }, { "docid": "eddcfa82e7e624bf5343dfb7108fb160", "score": "0.5378261", "text": "function wordLoader() {\n if (splitWord.length === 0) {\n setTimeout(function() {\n splashTextInsert()\n }, 1000);\n } else if (x <= splitWord.length && x>=0) {\n setTimeout(function() {\n $(\"#splashLoader\").append(splitWord[x]);\n x++;\n wordLoader();\n }, Math.floor(Math.random() * 400) + 100);\n } else if (x > splitWord.length && x>=0) {\n\n setTimeout(function() {\n $(\"#splashLoader\").empty();\n splitWord.pop();\n $(\"#splashLoader\").text(splitWord.join(\"\"));\n --x;\n wordLoader();\n }, 200);\n }\n}", "title": "" }, { "docid": "9a2fa2b0eda1c4b19fa43fd407c4f60f", "score": "0.5376256", "text": "function createLanguageWordFlyIn(word) {\n styles.slideOutRight.top = `${_.random(10, 90)}%`;\n styles.slideOutRight.animation = `x ${_.random(8, 25)}s linear infinite`;\n\n return (\n <p\n style={{ ...styles.slideOutRight }}\n className=\"language-word-fly-in\"\n key={`${word}-${_.random(0, 1000)}`}\n >\n {word}\n </p>\n );\n }", "title": "" }, { "docid": "a608996a4506f22c7039403917de1537", "score": "0.5376026", "text": "function addHello (width, height) {\n let randomWord = hellos[Math.floor(Math.random() * hellos.length)];\n let randomX = produceRandom(width);\n let randomY = produceRandom(height);\n while (conditions(randomX, randomY, width, height)) {\n randomX = produceRandom(width);\n randomY = produceRandom(height);\n }\n let word = document.createElement('div');\n word.classList.add('word');\n word.style.position = 'absolute';\n word.innerText = randomWord;\n word.style.top = randomY + 'px';\n word.style.left = randomX + 'px';\n $('#header').append(word);\n $('.word').animate({ opacity: 0.4}, 1000);\n }", "title": "" }, { "docid": "3212d0d574ccf42f90c592f81e265d29", "score": "0.5356985", "text": "function startGame() {\n if (wordList.length<2) {\n wordList = [\"BAT MAN\", \"AQUA MAN\", \"HIT GIRL\", \"SPIDER GIRL\", \"SPIDER WOMAN\", \"THOR\", \"HE MAN\", \"PLASTIC MAN\", \"STATIC SHOCK\", \"ELONGATED MAN\", \"SPIDER GWEN\", \"BLACK SCORPIAN\", \"DARE DEVIL\", \"JESSICA JONES\"];\n }\n select = Math.floor(Math.random()*wordList.length);\n chosenWord = wordList[select];\n gameWord = new Word(chosenWord);\n gameWord.makeWord();\n if (select > -1) {\n wordList.splice(select, 1);\n }\n console.log(\"\\nYou get 8 letter guesses to figure out the super hero.\\n\")\n promptUser();\n}", "title": "" }, { "docid": "43fab1c1130fcfa2e4d035ab4bd064f4", "score": "0.5356616", "text": "addPhraseToDisplay() {\r\n \t\t\r\n \t\tphraseArray = this.phrase.split('');\r\n\r\n \t\tlet letterString;\r\n\r\n \t\tconst letterLi = (letter) => { \r\n\t \t\t\tif(letter === \" \"){\r\n\t \t\t\t\tletterString = `<li class=\"space\"> </li>`\r\n\t \t\t\t\treturn letterString;\t\t\r\n\t \t\t\t}else{\r\n\t\t \t\t\tletterString = `<li class=\"hide letter ${letter}\">${letter}</li>`\r\n\t\t \t\t\treturn letterString;\r\n\t\t \t\t}\r\n \t\t\t}\r\n \t\t\r\n \t\tphraseArray.forEach(letter => {\r\n \t\t\tletterString = letterLi(letter);\r\n\r\n \t\t\t//convert string into html element//\r\n \t\t\tconst tempLiDiv = document.createElement('div');\r\n \t\t\ttempLiDiv.innerHTML= letterString;\r\n \t\t\tconst letterElement = tempLiDiv.firstChild;\r\n \t\t\tul.append(letterElement);\r\n \t\t})\r\n\r\n\r\n \t //When the player correctly guesses a letter, the empty box is replaced with the matched letter (see the showMatchedLetter() method below). Make sure the phrase displayed on the screen uses the letter CSS class for letters and the space CSS class for spaces.\r\n\r\n \t }", "title": "" }, { "docid": "3775a59de8044e3db97cbf81c81007dc", "score": "0.53482354", "text": "makeText(numWords = 100) {\n // TODO\n let markov = []\n let words = Array.from(this.chains.keys())\n let nextWord = getRandWord(words)\n\n while (markov.length < numWords && nextWord !== null) {\n markov.push(nextWord)\n nextWord = getRandWord(this.chains.get(nextWord))\n }\n return markov.join(\" \")\n }", "title": "" }, { "docid": "63b46be09ce05c698bf6080888ddb150", "score": "0.5347549", "text": "function displayWord()\n {\n var text;\n var wordCnt = curWord.length;\n var blankCount = 0;\n var tempWord = curWord.toUpperCase();\n var tempGuesses = [];\n var word = \"\";\n var letter;\n \n text = \"<h3>\";\n \n \n for(i=0;i<guesses.length;i++)\n {\n tempGuesses[i] = guesses[i].toUpperCase();\n }\n \n for(i=0; i<wordCnt; i++)\n { \n //Check if non-letter needs to be displayed\n if(specialChars.indexOf(curWord[i]) != -1)\n text+=curWord[i];\n else if(tempGuesses.indexOf(tempWord[i]) != -1)\n {\n text+=curWord[i];\n }\n else\n {\n text+=\"_\";\n blankCount++;\n }\n }\n\n //Guessed letter was not found in the show title\n if(!bFound)\n {\n wrongGuess++;\n }\n\n //Word has been guessed\n if(blankCount == 0)\n {\n var imgText = \"\";\n\n imgText = \"<img src=\\\"assets/images/\" + gameData[index].pic + \"\\\" class=\\\"img-responsive center-block\\\" id=\\\"mysteryPic\\\">\";\n wins++;\n document.querySelector(\"#tvDiv\").innerHTML = imgText;\n audioTheme.src = 'assets/sounds/'+gameData[index].theme;\n audioTheme.play();\n\n /*Tried to add a popup to display You Won or You lost at the end of the game, but couldn't get it to display properly\n var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n */\n\n }\n else if(!bFound)\n {\n remaining--;\n \n }\n\n //Determine if this is a win or loss and change display appropriately\n text += \"</h3><br>\";\n if(blankCount == 0 && wrongGuess == 0)\n {\n earned++;\n text += \"<h3>You have earned an extra life</h3>\";\n text += \"<h3>per game for not missing one letter!</h3>\";\n console.log(\"Guesses: \"+guesses);\n console.log(\"Word: \" + curWord);\n }\n text += \"<h3>Tries Remaining: \" + (remaining+earned) + \" </h3>\";\n text += \"<h3>Wins: \"+ wins + \"</h3>\";\n text += \"<h3>Losses: \" + losses + \"</h3>\";\n document.querySelector(\"#title\").innerHTML = text; \n \n if(remaining+earned == 0)\n {\n losses++;\n var imgText = \"\";\n\n imgText = \"<img src=\\\"assets/images/tvTransparent.png\\\" class=\\\"img-responsive center-block\\\" id=\\\"mysteryPic\\\">\";\n wins++;\n document.querySelector(\"#tvDiv\").innerHTML = imgText;\n audioTheme.src = 'assets/sounds/suicide.mp3'\n audioTheme.play(); text = \"<h2>\" + curWord + \" </h2>\";\n text += \"<h3>Tries Remaining: \" + (remaining+earned) + \" </h3>\";\n text += \"<h3>Wins: \"+ wins + \"</h3>\";\n text += \"<h3>Losses: \" + losses + \"</h3>\";\n document.querySelector(\"#title\").innerHTML = text;\n /*var popup = document.getElementById(\"myPopup\");\n popup.classList.toggle(\"show\");\n popup.text = \"YOU LOST\"; */\n }\n\n //Start next game automatically\n if(blankCount == 0 || (remaining +earned)== 0)\n { \n bStarted = false; \n } \n }", "title": "" }, { "docid": "3531bd79c3df05079b3006935e499d21", "score": "0.5347346", "text": "function shell(){ // Pick a random word\n word = wordList[Math.floor(Math.random() * wordList.length)];\n // Set up the answer array\n target = [];\n for (var i = 0; i < word.length; i++) {\n target[i] = \"_\";\n }\n\n document.getElementById(\"answer\").innerHTML= target.join(\" \");\n document.getElementById(\"pic\").src= \"Futurama-Fry.jpg\";\n document.getElementById(\"message\").innerHTML= \"Pick a letter. Hit Guess.\";\n document.getElementById(\"guessed\").innerHTML= guessedLetters;\n document.getElementById(\"lives\").innerHTML= \"u have \" + lives + \" more guesses\"\n\n}", "title": "" }, { "docid": "bda627bdf1fbe173a7fc8cd0921ace2a", "score": "0.5340007", "text": "function showWord(words){\r\n // generer liste random\r\n randIndex = Math.floor(Math.random() * words.length);\r\n currentWord.innerHTML = words[randIndex];\r\n return currentWord;\r\n\r\n}", "title": "" }, { "docid": "813a4fdf14690082a0ee2b8ad7022fa7", "score": "0.5339543", "text": "startGame(){\n const pickedPhrase = this.getRandomPhrase();\n thisPhrase = new Phrase(pickedPhrase);\n thisPhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "86c7ab68540da0243411a62c50038475", "score": "0.5339384", "text": "function initTitle(){\n\tfor(var i=0; i<numWords; i++){\n\t\ttl.from(titleText.chars[i], .5, {\n\t\t\tforce3D: true, // forces the GPU to process the information a bit later\n\t\t\topacity: 0,\n\t\t\tx: -500,\n\t\t\ttransformOrigin: \"0 50%\",\n\t\t\tease: Back.easeOut\n\t\t}, Math.random());\n\t}\n}", "title": "" }, { "docid": "69cff0bb463da343d57fdcf14e42a456", "score": "0.5334137", "text": "addPhraseToDisplay(){\n const phrase = game.activePhrase.phrase; \n const placeholder = document.querySelector('#phrase ul'); \n // Splits the phrase into an array of each character\n const lettersInPhrase = phrase.split(\"\");\n let letterBox;\n\n // Loop through each letter/item in the array of letter and add classes\n // Also appends to placehoder 'DIV'\n for(let i = 0; i < lettersInPhrase.length; i++){\n letterBox = document.createElement('li');\n letterBox.append(lettersInPhrase[i]);\n if( lettersInPhrase[i].includes(' ') ){\n letterBox.classList.remove('hide','letter');\n letterBox.classList.add('space'); \n } else {\n // Also uses template literals to add letter as a class\n letterBox.classList.add('hide','letter',`${lettersInPhrase[i]}`);\n }\n placeholder.appendChild(letterBox);\n }; \n }", "title": "" }, { "docid": "9a242166481f0c68db0cfb89e3343e8c", "score": "0.5330049", "text": "function addPhraseToDisplay(array){\n array = getRandomPhraseArray(array);\n for (let i=0; i < array.length; i++) {\n let listCharacter = document.createElement('li');\n let arrayCharacter = array[i];\n listCharacter.textContent = arrayCharacter;\n phraseUl.appendChild(listCharacter);\n if (arrayCharacter !== ' ') {\n listCharacter.classList.add('letter');\n } else {\n listCharacter.classList.add('space');\n }\n }\n}", "title": "" }, { "docid": "5befef022af6884b8570f92197ce7c61", "score": "0.53282154", "text": "function nextWord() {\n\t\t// clean up / animate previous word away\n\t\tif ( word ) {\n\n\t\t\t// letters and icon fall down\n\t\t\tfor ( var i = 0; i < wordContainer.numChildren; i++ ) {\n\t\t\t\tvar letter = wordContainer.getChild( i );\n\t\t\t\tvar tw = new Tween( letter,\n [ 'y', 'angle' ], [ letter.y, 0 ], [ letter.y + 64, Math.random() * 90 - 45 ],\n 1, Ease.In ).finished = function ( tween ) {\n\t\t\t\t\t// if not wordIcon, remove on complete\n\t\t\t\t\tif ( tween.target != wordIcon ) tween.target.parent = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// clear useful and missed\n\t\t\tfor ( var i = 0; i < game.letters.length; i++ ) { game.letters[ i ].useful = game.letters[ i ].missed = false; }\n\n\t\t\t// word accepted sound\n\t\t\tscene.success.play();\n\n\t\t\t// free memory\n\t\t\tgc();\n\t\t}\n\n\t\t// pick new word\n\t\tcurWord = ( curWord + 1 ) % allWords.length;\n\t\tword = allWords[ curWord ];\n\t\tword.word = word.words[ scene.language ];\n\t\t// split into array\n\t\tvar cc = word.word.charCodeAt( 0 );\n\t\tif ( cc > 128 ) { // utf8\n\t\t\t// split by pairs\n\t\t\tvar ww = [];\n\t\t\tfor ( var i = 0; i < word.word.length; i += 2 ) ww.push( word.word.substr( i, 2 ) );\n\t\t\tword.word = ww;\n\t\t} else word.word = word.word.split( '' );\n\t\tcollisionEnabled = false;\n\t\tacceptingEnabled = false;\n\n\t\t// when the old word is gone\n\t\twordIcon.async( function () {\n\n\t\t\t// set new word icon\n\t\t\twordIcon.render.texture = word.icon;\n\t\t\twordIcon.render.outlineRadius = 2;\n\t\t\twordIcon.scale = 1;\n\t\t\twordIcon.angle = 0;\n\t\t\twordIcon.x = 320 + wordIcon.render.originalWidth * 0.5;\n\t\t\twordIcon.y = -( wordIcon.render.originalHeight * 0.5 + 16 );\n\t\t\tscene.begin.play();\n\t\t\t// move icon to right corner\n\t\t\twordIcon.moveTo( 300 - wordIcon.render.originalWidth * 0.5, wordIcon.y, 0.5, Ease.Out ).finished = function (){\n\t\t\t\t// wait a bit\n\t\t\t\twordIcon.async( function () {\n\t\t\t\t\t// scale down and move to default pos\n\t\t\t\t\twordIcon.scaleTo( Math.min( 32 / wordIcon.render.originalHeight, 32 / wordIcon.render.originalWidth ),\n\t\t\t\t\t 0.7, Ease.InOut );\n\t\t\t\t\twordIcon.moveTo( 18, -32, 0.5, Ease.In ).finished = function () {\n\t\t\t\t\t\twordIcon.render.outlineRadius = 0;\n\t\t\t\t\t\twordIcon.moveTo( 18, 20, 0.5, Ease.Out, Ease.Bounce );\n\t\t\t\t\t\tcollisionEnabled = true;\n\t\t\t\t\t};\n\t\t\t\t\t// add letter cards on bottom\n\t\t\t\t\tfor ( var i = 0; i < word.word.length; i++ ) {\n\t\t\t\t\t\tvar letter = wordContainer.addChild( {\n\t\t\t\t\t\t\tname: word.word[ i ],\n\t\t\t\t\t\t\tindex: i,\n\t\t\t\t\t\t\ty: 12,\n\t\t\t\t\t\t\trender: new RenderText( {\n\t\t\t\t\t\t\t\ttext: word.word[ i ],\n\t\t\t\t\t\t\t\toutlineColor: 0x0,\n\t\t\t\t\t\t\t\toutlineRadius: 2,\n\t\t\t\t\t\t\t\toutlineOffsetY: 1,\n\t\t\t\t\t\t\t\tsize: 20,\n\t\t\t\t\t\t\t\tpivotY: 0.2,\n\t\t\t\t\t\t\t\tantialias: false,\n\t\t\t\t\t\t\t} ),\n\t\t\t\t\t\t\thidden: true,\n\t\t\t\t\t\t\tmakeCurrent: makeCurrent,\n\t\t\t\t\t\t\taccept: accept\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tletter.render.measure();\n\t\t\t\t\t\tletter.cover = letter.addChild( {\n\t\t\t\t\t\t\tname: \"Cover\",\n\t\t\t\t\t\t\trender: new RenderShape( {\n\t\t\t\t\t\t\t\tshape: Shape.RoundedRectangle,\n\t\t\t\t\t\t\t\tradius: 4,\n\t\t\t\t\t\t\t\twidth: 30, height: 30,\n\t\t\t\t\t\t\t\tcentered: true,\n\t\t\t\t\t\t\t\tcolor: 0x192666,\n\t\t\t\t\t\t\t} ),\n\t\t\t\t\t\t\tx: Math.floor( ( letter.render.width - 30 ) * 0.5 + 15 ),\n\t\t\t\t\t\t\ty: 8,\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tletter.cover.defaultX = letter.cover.x;\n\t\t\t\t\t\tletter.cover.defaultY = letter.cover.y;\n\t\t\t\t\t\tletter.x = 300 + ( 48 + i * 32 ) + ( 6 - letter.cover.x );\n\t\t\t\t\t\t// animate each letters in sequence\n\t\t\t\t\t\tletter.async( function () {\n\t\t\t\t\t\t\tthis.moveBy( -300, 0, 1, Ease.Out, Ease.Bounce );\n\t\t\t\t\t\t\tif ( this.index == 0 ) {\n\t\t\t\t\t\t\t\tacceptingEnabled = true;\n\t\t\t\t\t\t\t\t// force one correct letter spawn\n\t\t\t\t\t\t\t\tspawnLetter( -1 );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tscene.letter.async( scene.letter.play, 0.5 );\n\t\t\t\t\t\t}, 0.4 * i );\n\t\t\t\t\t} // end for\n\n\t\t\t\t\t// animation to highlight letter as current\n\t\t\t\t\tfunction makeCurrent() {\n\t\t\t\t\t\tvar coverCopy = clone( this.cover );\n\t\t\t\t\t\tcoverCopy.setTransform( this.cover.defaultX, this.cover.defaultY, 0 );\n\t\t\t\t\t\tcoverCopy.render.color = 0xFFFFFF;\n\t\t\t\t\t\tcoverCopy.render.stipple = 1;\n\t\t\t\t\t\tcoverCopy.scale = 2;\n\t\t\t\t\t\tcoverCopy.z = 1;\n\t\t\t\t\t\tcoverCopy.scaleTo( 1, 1, Ease.Out );\n\t\t\t\t\t\tthis.addChild( coverCopy );\n\t\t\t\t\t\t(new Tween( coverCopy.render, 'stipple', 1, 0, 1 )).finished = function(){\n\t\t\t\t\t\t\tthis.cover.render.color = coverCopy.render.color;\n\t\t\t\t\t\t\tcoverCopy.parent = null;\n\t\t\t\t\t\t}.bind( this );\n\t\t\t\t\t}\n\n\t\t\t\t\t// animation to show, or hide letter again (penalty)\n\t\t\t\t\tfunction accept( val ) {\n\t\t\t\t\t\t// letter is accepted\n\t\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\t\t// uncover\n\t\t\t\t\t\t\tthis.hidden = false;\n\t\t\t\t\t\t\tthis.render.addColor = [ 0.2, 0.8, 1, 0 ];\n\t\t\t\t\t\t\tthis.cover.render.color = 0xFFFFFF;\n\t\t\t\t\t\t\tthis.cover.rotateTo( ( this.index % 2 ? 1 : -1 ) * 360 * ( 2 + Math.random() * 2 ), 2, Ease.Out );\n\t\t\t\t\t\t\tthis.cover.scaleTo( 0.7, 2, Ease.In );\n\t\t\t\t\t\t\tthis.cover.z = 1;\n\t\t\t\t\t\t\tvar dx = 20 - Math.random() * 40;\n\t\t\t\t\t\t\tthis.cover.moveBy( dx * 0.5, -(32 + 16 * Math.random()), 0.5, Ease.Out ).finished = function (){\n\t\t\t\t\t\t\t\tthis.cover.render.color.hexTo( '192666', 1 );\n\t\t\t\t\t\t\t\tthis.cover.moveBy( dx * 0.5, 200, 1, Ease.In ).finished = function (){\n\t\t\t\t\t\t\t\t\t// reset\n\t\t\t\t\t\t\t\t\tthis.cover.active = false;\n\t\t\t\t\t\t\t\t\tthis.cover.z = 0;\n\t\t\t\t\t\t\t\t\tthis.cover.scale = 1;\n\t\t\t\t\t\t\t\t\tthis.cover.setTransform( this.cover.defaultX, this.cover.defaultY );\n\t\t\t\t\t\t\t\t\tthis.render.addColor.rgbaTo( 0, 0, 0, 2, Ease.Out );\n\t\t\t\t\t\t\t\t}.bind( this );\n\t\t\t\t\t\t\t}.bind( this );\n\t\t\t\t\t\t\t// next letter\n\t\t\t\t\t\t\tnextLetter();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// TODO\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// if in order mode, highlight next letter\n\t\t\t\t\tif ( inOrderMode ) {\n\t\t\t\t\t\tcurLetter = -1;\n\t\t\t\t\t\twordContainer.async( nextLetter, 0.25 );\n\t\t\t\t\t}\n\n\t\t\t\t}, 1 );\n\t\t\t};\n\t\t}, 1.25 );\n\n\t}", "title": "" }, { "docid": "6fef4694692767af248fba3c4558c69b", "score": "0.532607", "text": "makeText(numWords = 100) {\n // TODO\n this.textArray = [];\n \n this.propNamesArray = Object.getOwnPropertyNames(this.chains);\n this.startWord = this.propNamesArray[Math.floor((Math.random() * this.propNamesArray.length))];\n this.textArray.push(this.startWord);\n\n for (let i = 0; i < numWords; i++) {\n if ((this.textArray.length < numWords) && (!this.textArray.includes(null))) {\n const word = this.textArray[i];\n const wordValues = this.chains[word];\n\n const randomIndex = Math.floor(Math.random() * wordValues.length);\n const nextWord = wordValues[randomIndex];\n this.textArray.push(nextWord);\n }\n }\n\n if (this.textArray.length > numWords){\n this.textArray.pop();\n }\n this.textString = this.textArray.join(' ');\n \n }", "title": "" }, { "docid": "80ddface31e01c2f69aed84b354376fe", "score": "0.5323138", "text": "addPhraseToDisplay() {\n // Use for loop to iterate over chosen string elements because it's not an array\n for (let i = 0; i < this.phrase.length; i++) {\n // Set variable to element at current index of string\n const phraseElement = this.phrase[i];\n // Create a list element with the appropriate class for the current element\n if (phraseElement != \" \") {\n $(\"#phrase ul\").append(`<li class=\"hide letter ${phraseElement}\"><span>${phraseElement}</span></li>`);\n }\n else {\n $(\"#phrase ul\").append('<li class=\"space\"> </li>');\n }\n }\n }", "title": "" }, { "docid": "72d56958920ccc0819fea33eeaeb3e11", "score": "0.53204894", "text": "addPhraseToDisplay() {\n \t\t//converts the phrase to HTML and inserts it in the phrase attribute\n \t\tlet phraseHTML = '<div id=\"phrase\" class=\"section\"> <ul>';\n \t\tfor(let i = 0; i < this.phrase.length; i++) {\n \t\t\t//if the letter in the phrase is not a space then add the hide letter class corresponding to that letter is added to the HTML phrase\n \t\t\tif(this.phrase[i] != ' ') {\n \t\t\t\tphraseHTML += '<li class=\"hide letter ' + this.phrase[i].toLowerCase() + '\">' + this.phrase[i] +'</li>';\n \t\t\t} //if the letter is a space then it is given the space class and added to the HTML phrase\n \t\t\telse {\n \t\t\t\tphraseHTML += '<li class=\"space\"> </li>';\n \t\t\t}\n \t\t} document.getElementById('phrase').innerHTML = phraseHTML;\n\n \t}", "title": "" }, { "docid": "3f234eee9b4408b71322dae2f7001dcf", "score": "0.53136003", "text": "startGame() {\r\n const phrase = this.getRandomPhrase();\r\n \r\n overlay.style.display = 'none';\r\n overlay.className = '';\r\n qwerty.classList.remove('no-nav');\r\n phrase.addPhraseToDisplay();\r\n this.activePhrase = phrase;\r\n\r\n // reset scoreboard\r\n heartLis.forEach(li => {\r\n li.firstElementChild.setAttribute('src', 'images/liveHeart.png');\r\n });\r\n }", "title": "" }, { "docid": "9deb183ba4cc1459d2632f7409705748", "score": "0.53108394", "text": "function finishGame() {\n wordIndexToUse++;\n startNewWord();\n }", "title": "" }, { "docid": "17e1cbd719ccb96b6b343dd61df914bf", "score": "0.5310394", "text": "function showGame(chosenWords) {\n var wordContainer = document.getElementById('word-container');\n for (let i = 0; i < chosenWords.length; i++) {\n wordContainer.insertAdjacentHTML('beforeend', `<li class=\"chosen-word\">${chosenWords[i]}</li>`);\n }\n\n // Get all the words on the list and attach to variable\n chosenWordsList = document.getElementsByClassName('chosen-word');\n\n // Play game\n playGame(chosenWordsList);\n}", "title": "" }, { "docid": "f31920b007fa7930776d5bf58d60e18c", "score": "0.53098375", "text": "function addPhraseToDisplay(array) {\n let letters = getRandomPhraseArray(array);\n for (let i = 0; i < letters.length; i++) {\n let letter = letters[i];\n let li = document.createElement('li');\n li.className = \"letter\";\n li.textContent = letter;\n if (li.textContent === \" \") {\n li.className = \"space\";\n }\n ul.appendChild(li);\n }\n return letters;\n}", "title": "" }, { "docid": "4c1bc53615149d2a2ef955f2e6d4a9ed", "score": "0.5309772", "text": "function addPhraseToDisplay(phrase) {\n\tlet word=\"<div>\";\n\tphrase.forEach((letter, index) => {\n\t\tif (index !== 0 && letter === '') {\n\t\t\tword += \"</div>\";\n\t\t\tphraseUl.innerHTML += word;\n\t\t\tword = \"</div>\";\n\t\t}\n\t\t\n\t\tif (letter !== \" \") {\n\t\t\tword += `<li class=\"letter\">${letter}</li>`;\n\t\t} else {\n\t\t\tword += `<li class=\"space\">${letter}</li>`;\t\t\t\n\t\t}\n if (index === phrase.length - 1) {\n word += \"</div>\";\n phraseUl.innerHTML += word;\n }\n\n });\n}", "title": "" }, { "docid": "b4faf1938598ede9e99ccbfa6aa2a975", "score": "0.5298396", "text": "function addPhraseToDisplay(arr) {\n const array = getRandomPhraseAsArray(arr);\n const ul = document.querySelector(\"#phrase ul\");\n for (let i = 0; i < array.length; i += 1) {\n let add = array[i];\n let addLi = document.createElement(\"li\");\n if (add !== \" \") {\n addLi.className = \"letter\";\n } else {\n addLi.className = \"space\";\n }\n addLi.textContent = add;\n ul.appendChild(addLi);\n }\n}", "title": "" }, { "docid": "d08c7aba1f6458e79178a549a15d5f3d", "score": "0.52905744", "text": "function displayWords(arr) {\n\twordlist.innerHTML = \"\";\n\tfor(var i=0; i < arr.length; i++) {\n\t\twordlist.innerHTML += \"<div class='indword'>\"+arr[i]+\"</div>\";\n\t\twordlist.innerHTML += \" \";\n\t}\n}", "title": "" }, { "docid": "ca47bec31b7aa8e6032f75187d26adc2", "score": "0.5289499", "text": "function addToFavorites(){\n localStorage.setItem(`word-${localStorage.length}`, `${$word.html()}`);\n }", "title": "" }, { "docid": "ea3149f5dc91f9150cfdc7007c6414e3", "score": "0.5283655", "text": "function displayWord() {\n display.textContent = words[count];\n count++;\n}", "title": "" }, { "docid": "1098680c956fa7064dec47df43ab02c7", "score": "0.52807724", "text": "function getWord()\n {\n audio.pause();\n imageNode.src = \"assets/images/hang0.png\";\n if (hang === true)\n {\n oldWord = [word];\n Array.prototype.push.apply(dictionary, oldWord);\n hang = false;\n }\n if (dictionary.length === 0)\n fullwin();\n var wordNode = document.getElementById(\"gameword\");\n lettersGuessed.length = 0;\n wordDisplay.length = 0;\n wordNode.innerHTML = wordDisplay;\n prevGuessed.innerHTML = lettersGuessed;\n remainingGuesses = 7;\n word = dictionary[Math.floor(Math.random() * dictionary.length)];\n var wordlist = Array.from(word);\n\n for (i = 0; i < wordlist.length; i++)\n {\n wordDisplay[i] = \"_\";\n wordNode.innerHTML += wordDisplay[i] + \" \";\n }\n // console.log(word);\n var pos = dictionary.indexOf(word);\n var remove = dictionary.splice(pos, 1);\n return wordlist;\n }", "title": "" }, { "docid": "055731e749446bf3b7f883a716a4e809", "score": "0.527987", "text": "addPhraseToDisplay() {\r\n const hiddenPhrase = document.querySelector('#phrase ul');\r\n this.phrase.split('').forEach(word => {\r\n const li = document.createElement('li');\r\n hiddenPhrase.appendChild(li);\r\n\r\n if (word === \" \"){\r\n li.classList.add(\"space\");\r\n\r\n } else {\r\n li.classList.add(\"hide\");\r\n li.classList.add(\"letter\");\r\n li.innerHTML = `${word}`;\r\n }\r\n });\r\n }", "title": "" }, { "docid": "4604f418f496c886516845460a9e1c0f", "score": "0.527453", "text": "function renderWords(displayData) {\n return <div>\n <h1 class=\"poem\">\n {\"Poem \" + displayData.IDofFirstPoem}\n <br></br>\n {renderPoem(displayData.poemA)}</h1>\n <h1 class=\"poem\">\n {\"Poem \" + displayData.IDofSecondPoem}\n <br></br>\n {renderPoem(displayData.poemB)}</h1>\n </div>;\n}", "title": "" }, { "docid": "3443071c201a3e10a8f4b099697aa13f", "score": "0.5274462", "text": "function getWord() {\r\n //var abjad = var game = $('.temp_information').data('temp'); \r\n // abjad = $('.temp_information').data('temp'); \r\n // HERE , WE CHECK ON THE LETTER AND ACCORDINGLY DECIDE THE WORDS !\r\n // we handle pictures in line 56 (HANGLETTER)\r\n var a = new Array(\"بطة\",\"بنت\",\"برتقالة\");\r\n var b = new Array (\"1\",\"2\",\"3\");\r\n switch (hangletter) {\r\n case 1:\r\n a = new Array(\"أرنب\",\"أبرة\",\"أذن\");\r\n \r\n break;\r\n case 2:\r\n a = new Array(\"بطة\",\"بنت\",\"برتقالة\");\r\n \r\n break;\r\n case 3:\r\n a = new Array(\"تاج\",\"تمساح\",\"تفاحة\");\r\n \r\n break;\r\n\r\n case 4:\r\n a = new Array(\"ثعلب\",\"ثمار\",\"ثعبان\");\r\n \r\n break;\r\n case 7:\r\n a = new Array(\"خروف\",\"خيار\",\"خبز\");\r\n \r\n break;\r\n case 11:\r\n a = new Array(\"زرافة\",\"زينة\",\"زجاجة\");\r\n \r\n break; \r\n case 12:\r\n a = new Array(\"سمكة\",\"سنجاب\",\"سكر\");\r\n \r\n break; \r\n case 26:\r\n a = new Array(\"هرم\",\"هلال\",\"هدهد\");\r\n \r\n break; \r\n \r\n}\r\n\t//var a = new Array('abate','aberrant','abscond','accolade','acerbic','acumen','adulation','adulterate','aesthetic','aggrandize','alacrity','alchemy','amalgamate','ameliorate','amenable','anachronism','anomaly','approbation','archaic','arduous','ascetic','assuage','astringent','audacious','austere','avarice','aver','axiom','bolster','bombast','bombastic','bucolic','burgeon','cacophony','canon','canonical','capricious','castigation','catalyst','caustic','censure','chary','chicanery','cogent','complaisance','connoisseur','contentious','contrite','convention','convoluted','credulous','culpable','cynicism','dearth','decorum','demur','derision','desiccate','diatribe','didactic','dilettante','disabuse','discordant','discretion','disinterested','disparage','disparate','dissemble','divulge','dogmatic','ebullience','eccentric','eclectic','effrontery','elegy','eloquent','emollient','empirical','endemic','enervate','enigmatic','ennui','ephemeral','equivocate','erudite','esoteric','eulogy','evanescent','exacerbate','exculpate','exigent','exonerate','extemporaneous','facetious','fallacy','fawn','fervent','filibuster','flout','fortuitous','fulminate','furtive','garrulous','germane','glib','grandiloquence','gregarious','hackneyed','halcyon','harangue','hedonism','hegemony','heretical','hubris','hyperbole','iconoclast','idolatrous','imminent','immutable','impassive','impecunious','imperturbable','impetuous','implacable','impunity','inchoate','incipient','indifferent','inert','infelicitous','ingenuous','inimical','innocuous','insipid','intractable','intransigent','intrepid','inured','inveigle','irascible','laconic','laud','loquacious','lucid','luminous','magnanimity','malevolent','malleable','martial','maverick','mendacity','mercurial','meticulous','misanthrope','mitigate','mollify','morose','mundane','nebulous','neologism','neophyte','noxious','obdurate','obfuscate','obsequious','obstinate','obtuse','obviate','occlude','odious','onerous','opaque','opprobrium','oscillation','ostentatious','paean','parody','pedagogy','pedantic','penurious','penury','perennial','perfidy','perfunctory','pernicious','perspicacious','peruse','pervade','pervasive','phlegmatic','pine','pious','pirate','pith','pithy','placate','platitude','plethora','plummet','polemical','pragmatic','prattle','precipitate','precursor','predilection','preen','prescience','presumptuous','prevaricate','pristine','probity','proclivity','prodigal','prodigious','profligate','profuse','proliferate','prolific','propensity','prosaic','pungent','putrefy','quaff','qualm','querulous','query','quiescence','quixotic','quotidian','rancorous','rarefy','recalcitrant','recant','recondite','redoubtable','refulgent','refute','relegate','renege','repudiate','rescind','reticent','reverent','rhetoric','salubrious','sanction','satire','sedulous','shard','solicitous','solvent','soporific','sordid','sparse','specious','spendthrift','sporadic','spurious','squalid','squander','static','stoic','stupefy','stymie','subpoena','subtle','succinct','superfluous','supplant','surfeit','synthesis','tacit','tenacity','terse','tirade','torpid','torque','tortuous','tout','transient','trenchant','truculent','ubiquitous','unfeigned','untenable','urbane','vacillate','variegated','veracity','vexation','vigilant','vilify','virulent','viscous','vituperate','volatile','voracious','waver','zealous');\r\n //var a = new Array(\"حمار\",\"أسبوع\",\"سنة\",\"شهر\",\"يوم\",\"قطة\",\"كلب\",\"دب\",\"تمساح\",\"تفاح\",\"تمر\",\"أسد\",\"عصفور\",\"منضدة\",\"كرسي\",\"سيارة\",\"طفل\",\"حصان\",\"نمر\",\"ساعة\",\"موز\",\"يوسفي\",\"برتقال\");\r\n //THIS IS THE ONE \r\n // var a = new Array(\"فيل\",\"قطة\",\"كلب\",\"دب\",\"تمساح\",\"تُفّاح\",\"قرد\",\"أسد\",\"عصفور\",\"سمكة\",\"كرسي\",\"شجرة\",\"حصان\",\"زرافة\",\"ساعة\",\"موز\",\"أناناس\",\"برتقال\");\r\n\r\n//randWord=parseInt(Math.random()* a.length);\r\n//lettoindex++;\r\n arabicSound = b[lettoindex];\r\n\treturn a[lettoindex];\r\n}", "title": "" }, { "docid": "db718c10cc6a3c5d638afd73b7e6f8f6", "score": "0.5270943", "text": "function pickWords() {\n wtt = [];\n\n for (let i = 0; i < 3; i++) {\n wtt.push(wordArr[Math.floor(Math.random() * (wordArr.length - 0))]);\n }\n\n word1.innerText = wtt[0];\n word2.innerText = wtt[1];\n word3.innerText = wtt[2];\n}", "title": "" }, { "docid": "0a4c514a47f33840b12be2f480671473", "score": "0.5267763", "text": "function find_word_frame(lett, myCube, direction){\n//\tconsole.log(\"find_word_frame(\"+lett+',cube:'+myCube+',direction'+direction+')');\nvar this_word = new Array(7);\n\t/* The minicubes are held as objects in an array 0 to 7*64 +7*7 +6.\n\tThe position in this array is by HTU number.\n\ttherefore the relevant minicubes are start, start+1, start +2, start+3, start+4, start+5, start+6\n\t*/\n\tif(direction == 'A') {\n\t\tHTU0 = myCube.HTU_number;\n\t\tthis_word[0] = myCube.cube_letter;\n\n\t\tminicube1 = mini_cubes[HTU0+1];\n\t\tthis_word[1] = minicube1.cube_letter;\n\t\t\n\t\tminicube2 = mini_cubes[HTU0+2];\n\t\tthis_word[2] = minicube2.cube_letter;\n\n\t\tminicube3 = mini_cubes[HTU0+3];\n\t\tthis_word[3] = minicube3.cube_letter;\n\t\t\n\t\tminicube4 = mini_cubes[HTU0+4];\n\t\tthis_word[4] = minicube4.cube_letter;\n\n\t\tminicube5 = mini_cubes[HTU0+5];\n\t\tthis_word[5] = minicube5.cube_letter;\n\n\t\tminicube6 = mini_cubes[HTU0+6];\n\t\tthis_word[6] = minicube6.cube_letter;\n\t}\n\tif(direction == 'C') {\t//Climb\n\t\tHTU0 = myCube.HTU_number;\n\t\tconsole.log('Climb from HTU'+HTU0);\n\t\tminicube0 = mini_cubes[HTU0];\n\t\tthis_word[0] = minicube0.cube_letter;\n\n\t\tminicube1 = mini_cubes[HTU0+49];\n\t\tthis_word[1] = minicube1.cube_letter;\n\t\t\n\t\tminicube2 = mini_cubes[HTU0 + 98];\n\t\tthis_word[2] = minicube2.cube_letter;\n\n\t\tminicube3 = mini_cubes[HTU0 + 147];\n\t\tthis_word[3] = minicube3.cube_letter;\n\t\t\n\t\tminicube4 = mini_cubes[HTU0 + 196];\n\t\tthis_word[4] = minicube4.cube_letter;\n\n\t\tminicube5 = mini_cubes[HTU0 + 245];\n\t\tthis_word[5] = minicube5.cube_letter;\n\n\t\tminicube6 = mini_cubes[HTU0 + 294];\n\t\tthis_word[6] = minicube6.cube_letter;\n\t}\n\tif(direction == 'B') {\t//Behind or Back\n\t\tHTU0 = myCube.HTU_number;\n\t\tconsole.log('BACK from HTU'+HTU0);\n\t\tminicube0 = mini_cubes[HTU0];\n\t\tthis_word[0] = minicube0.cube_letter;\n\n\t\tminicube1 = mini_cubes[HTU0 - 7];\n\t\tthis_word[1] = minicube1.cube_letter;\n\t\t\n\t\tminicube2 = mini_cubes[HTU0 - 14];\n\t\tthis_word[2] = minicube2.cube_letter;\n\n\t\tminicube3 = mini_cubes[HTU0 - 21];\n\t\tthis_word[3] = minicube3.cube_letter;\n\t\t\n\t\tminicube4 = mini_cubes[HTU0 - 28];\n\t\tthis_word[4] = minicube4.cube_letter;\n\n\t\tminicube5 = mini_cubes[HTU0 - 35];\n\t\tthis_word[5] = minicube5.cube_letter;\n\n\t\tminicube6 = mini_cubes[HTU0 - 42];\n\t\tthis_word[6] = minicube6.cube_letter;\n\t}\n//\tconsole.log('this_word = '+this_word);\n\tg_word_frame = this_word;\n\n}", "title": "" }, { "docid": "2fe5f670ac68893be4274b0aced88e0e", "score": "0.5262185", "text": "startGame() {\n\noverlay.style.display = \"none\";\nthis.activePhrase = this.getRandomPhrase();\nthis.activePhrase.addPhraseToDisplay();\n\n\n}", "title": "" }, { "docid": "17851214ca0fe7aabfd52ff46198150a", "score": "0.525964", "text": "function typeWords(word) {\n let page = document.getElementsByClassName(\"about-page-text\")[0];\n\n let i = 0;\n let timer = setInterval(function () {\n let wordLength = word.length;\n if (i < wordLength) {\n page.innerHTML += word[i];\n }\n else {\n clearInterval(timer)\n }\n i++;\n\n }, 100)\n}", "title": "" }, { "docid": "18464a2e408c55856f91b128127b62c4", "score": "0.5255818", "text": "function wordBank() {\n var storeWords1 = [\"THE \", \"ALL \", \"THIS \", \"HELLO \", \"GOODBYE \"];\n var storeWords2 = [\"GREEN \", \"RED \", \"BLUE \", \"WHITE \", \"GRAY \"];\n var storeWords3 = [\"MANGO\", \"BANANA\", \"KIWI\", \"STRAWBERRY\", \"SMOOTHIE\"]\n\n var words = storeWords1[Math.floor(Math.random() * 5)] +\n storeWords2[Math.floor(Math.random() * 5)] +\n storeWords3[Math.floor(Math.random() * 5)];\n\n return words;\n }", "title": "" }, { "docid": "27b390ed827d2dfda2ceebbed285fb42", "score": "0.5255399", "text": "addPhraseToDisplay() {\n const phraseDivUl = document.querySelector('#phrase ul');\n let phraseHTML = ``;\n\n for (let i = 0; i < this.phrase.length; i++) {\n const letter = this.phrase[i];\n if( letter === ' ' ) {\n phraseHTML += `<li class=\"space\"> </li>`;\n } else {\n phraseHTML += `<li class=\"hide letter ${letter}\">${letter}</li>`;\n }\n }\n\n phraseDivUl.innerHTML = phraseHTML;\n }", "title": "" }, { "docid": "47f2bc86d4c705075b3260467a8fc37d", "score": "0.52527374", "text": "function showWord(array){\n // Generate random array index\n const randIndex = Math.floor(Math.random() * array.length);\n\n // Output random word\n currentWord.innerHTML = array[randIndex];\n}", "title": "" }, { "docid": "6415b461e86aea13cc231a0dedb0f8b1", "score": "0.5252492", "text": "function displayWords() {\r\n wordDisplay.innerHTML = \"\";\r\n let word = wordsArray[Math.floor(Math.random() * wordsArray.length)]; //generate random word\r\n let wordArray = word.split(\"\"); // splitting each letter of the word into an array\r\n wordArray.forEach(letter => {\r\n //Putting each letter into a span element\r\n let spanElement = document.createElement(\"span\");\r\n spanElement.innerHTML = letter;\r\n wordDisplay.appendChild(spanElement);\r\n });\r\n inputWord.value = \"\";\r\n startTimer();\r\n}", "title": "" }, { "docid": "fa0567b3ad3ab3acbd5c975f9bf613a5", "score": "0.5238952", "text": "function inject() {\n if(!$(parent.parentElement).hasClass(\"markup\") && !$(parent.parentElement).hasClass(\"message-content\")) { return; }\n\n var parentInnerHTML = parent.innerHTML;\n var words = parentInnerHTML.split(/\\s+/g);\n\n if(!words) return;\n\n words.some(function(word) {\n\n if(word.slice(0, 4) == \"[!s]\" ) {\n\n parentInnerHTML = parentInnerHTML.replace(\"[!s]\", \"\");\n var markup = $(parent).parent();\n var reactId = markup.attr(\"data-reactid\");\n \n if(spoilered.indexOf(reactId) > -1) {\n return;\n }\n\n markup.addClass(\"spoiler\");\n markup.on(\"click\", function() {\n $(this).removeClass(\"spoiler\");\n spoilered.push($(this).attr(\"data-reactid\"));\n });\n\n return;\n }\n\n if(word.length < 4) {\n return;\n }\n\n\t\t\tif(word == \"ClauZ\") {\n\t\t\t\tparentInnerHTML = parentInnerHTML.replace(\"ClauZ\", '<img src=\"https://cdn.frankerfacez.com/emoticon/70852/1\" style=\"width:25px; transform:translate(-29px, -14px);\"></img>');\n\t\t\t\treturn;\n\t\t\t}\n\n if($.inArray(word, bemotes) != -1) return;\n\n if (emotesTwitch.emotes.hasOwnProperty(word)) {\n var len = Math.round(word.length / 4);\n var name = word.substr(0, len) + \"\\uFDD9\" + word.substr(len, len) + \"\\uFDD9\" + word.substr(len * 2, len) + \"\\uFDD9\" + word.substr(len * 3);\n var url = twitchEmoteUrlStart + emotesTwitch.emotes[word].image_id + twitchEmoteUrlEnd;\n parentInnerHTML = parentInnerHTML.replace(word, '<div class=\"emotewrapper\"><img class=\"emote\" alt=\"' + name + '\" src=\"' + url + '\" /><input onclick=\\'quickEmoteMenu.favorite(\\\"'+name+'\\\", \\\"'+url+'\\\");\\' class=\"fav\" title=\"Favorite!\" type=\"button\"></div>');\n return;\n }\n\n if (typeof emotesFfz !== 'undefined' && settingsCookie[\"bda-es-1\"]) {\n if (emotesFfz.hasOwnProperty(word)) {\n var len = Math.round(word.length / 4);\n var name = word.substr(0, len) + \"\\uFDD9\" + word.substr(len, len) + \"\\uFDD9\" + word.substr(len * 2, len) + \"\\uFDD9\" + word.substr(len * 3);\n var url = ffzEmoteUrlStart + emotesFfz[word] + ffzEmoteUrlEnd;\n \n parentInnerHTML = parentInnerHTML.replace(word, '<div class=\"emotewrapper\"><img class=\"emote\" alt=\"' + name + '\" src=\"' + url + '\" /><input onclick=\\'quickEmoteMenu.favorite(\\\"'+name+'\\\", \\\"'+url+'\\\");\\' class=\"fav\" title=\"Favorite!\" type=\"button\"></div>');\n return;\n }\n }\n\n if (typeof emotesBTTV !== 'undefined' && settingsCookie[\"bda-es-2\"]) {\n if (emotesBTTV.hasOwnProperty(word)) {\n var len = Math.round(word.length / 4);\n var name = word.substr(0, len) + \"\\uFDD9\" + word.substr(len, len) + \"\\uFDD9\" + word.substr(len * 2, len) + \"\\uFDD9\" + word.substr(len * 3);\n var url = emotesBTTV[word];\n parentInnerHTML = parentInnerHTML.replace(word, '<div class=\"emotewrapper\"><img class=\"emote\" alt=\"' + name + '\" src=\"' + url + '\" /><input onclick=\\'quickEmoteMenu.favorite(\\\"'+name+'\\\", \\\"'+url+'\\\");\\' class=\"fav\" title=\"Favorite!\" type=\"button\"></div>');\n return;\n }\n }\n \n if(typeof emotesBTTV2 !== 'undefined' && settingsCookie[\"bda-es-2\"]) {\n if(emotesBTTV2.hasOwnProperty(word)) {\n var len = Math.round(word.length / 4);\n var name = word.substr(0, len) + \"\\uFDD9\" + word.substr(len, len) + \"\\uFDD9\" + word.substr(len * 2, len) + \"\\uFDD9\" + word.substr(len * 3);\n var url = bttvEmoteUrlStart + emotesBTTV2[word] + bttvEmoteUrlEnd;\n parentInnerHTML = parentInnerHTML.replace(word, '<div class=\"emotewrapper\"><img class=\"emote\" alt=\"' + name + '\" src=\"' + url + '\" /><input onclick=\\'quickEmoteMenu.favorite(\\\"'+name+'\\\", \\\"'+url+'\\\");\\' class=\"fav\" title=\"Favorite!\" type=\"button\"></div>');\n return;\n }\n }\n\n if (subEmotesTwitch.hasOwnProperty(word)) {\n var len = Math.round(word.length / 4);\n var name = word.substr(0, len) + \"\\uFDD9\" + word.substr(len, len) + \"\\uFDD9\" + word.substr(len * 2, len) + \"\\uFDD9\" + word.substr(len * 3);\n var url = twitchEmoteUrlStart + subEmotesTwitch[word] + twitchEmoteUrlEnd;\n parentInnerHTML = parentInnerHTML.replace(word, '<div class=\"emotewrapper\"><img class=\"emote\" alt=\"' + name + '\" src=\"' + url + '\" /><input onclick=\\'quickEmoteMenu.favorite(\\\"'+name+'\\\", \\\"'+url+'\\\");\\' class=\"fav\" title=\"Favorite!\" type=\"button\"></div>');\n return;\n }\n });\n\n if(parent.parentElement == null) return;\n\n var oldHeight = parent.parentElement.offsetHeight;\n parent.innerHTML = parentInnerHTML.replace(new RegExp(\"\\uFDD9\", \"g\"), \"\");\n var newHeight = parent.parentElement.offsetHeight;\n\n //Scrollfix\n var scrollPane = $(\".scroller.messages\").first();\n scrollPane.scrollTop(scrollPane.scrollTop() + (newHeight - oldHeight));\n }", "title": "" }, { "docid": "9c02ce41ae692b47f3c291d7d5bdec7b", "score": "0.5238368", "text": "function newWord($page, index, L) {\r\n click = 0;\r\n if (clickYes == 1) {\r\n $page.empty();\r\n clickYes = 0;\r\n return;\r\n }\r\n if (clickRead == 1) {\r\n $page.empty();\r\n return;\r\n }\r\n if (l < L-1) {\r\n l = l + 1;\r\n index = l;\r\n writeWords($page, practice, index, L);\r\n return;\r\n } //closes if\r\n if (wait == 0) {\r\n l = 0;\r\n shuffle(practice);\r\n console.log(\"shuffle\");\r\n writeWords($page, practice, index, L);\r\n wait = 1;\r\n return;\r\n }\r\n if (wait == 1) {\r\n l = 0;\r\n shuffle(practice);\r\n console.log(\"shuffle\");\r\n writeWords($page, practice, index, L);\r\n wait = 2;\r\n return;\r\n }\r\n if (wait == 2){\r\n $('#yes').css('display', 'block');\r\n l = 0;\r\n shuffle(practice);\r\n console.log(\"shuffle\");\r\n writeWords($page, practice, index, L);\r\n wait = 2;\r\n return;\r\n }\r\n}", "title": "" }, { "docid": "1b7703fa101d67d60b4653eb64c0e63d", "score": "0.5236348", "text": "function usedSword() {\n goblinDefeated = true;\n gameMap[1][0].exits = [\"north\", \"east\", \"west\"];\n gameMap[1][0].items.push(\"medallion\");\n gameMap[1][0].description = \"The goblin lies face down against the Southern wall of the tunnel. With it out of the way, you can now pass to the North and East.\";\n}", "title": "" }, { "docid": "87f4a31f0f20e07668e1565f78acec3c", "score": "0.52352166", "text": "function showWord() {\n\n //random number generator\n var i = Math.floor(Math.random()*(displayWords.length));\n \n\n //word to display\n var wordChoice = displayWords[i];\n \n\n //display word\n displayChoice.html(wordChoice);\n \n}", "title": "" }, { "docid": "bea6b62f6bcb0997d706cd299521025d", "score": "0.52343", "text": "function getRandomWord()\n{\n words = [\"advice\",\n\"anger\",\n\"answer\",\n\"apple\",\n\"arithmetic\",\n\"badge\",\n\"basket\",\n\"basketball\",\n\"battle\",\n\"beast\",\n\"beetle\",\n\"beggar\",\n\"brain\",\n\"branch\",\n\"bubble\",\n\"bucket\",\n\"cactus\",\n\"cannon\",\n\"cattle\",\n\"celery\",\n\"cellar\",\n\"cloth\",\n\"coach\",\n\"coast\",\n\"crate\",\n\"cream\",\n\"daughter\",\n\"donkey\",\n\"earthquake\",\n\"feast\",\n\"fifth\",\n\"finger\",\n\"flock\",\n\"frame\",\n\"furniture\",\n\"geese\",\n\"ghost\",\n\"giraffe\",\n\"governor\",\n\"honey\",\n\"hope\",\n\"hydrant\",\n\"icicle\",\n\"income\",\n\"island\",\n\"jeans\",\n\"judge\",\n\"lace\",\n\"lamp\",\n\"lettuce\",\n\"marble\",\n\"month\",\n\"north\",\n\"ocean\",\n\"patch\",\n\"plane\",\n\"playground\",\n\"riddle\",\n\"scale\",\n\"seashore\",\n\"sheet\",\n\"sidewalk\",\n\"skate\",\n\"sleet\",\n\"smoke\",\n\"stage\",\n\"station\",\n\"thrill\",\n\"throat\",\n\"throne\",\n\"title\",\n\"toothbrush\",\n\"turkey\",\n\"underwear\",\n\"vacation\",\n\"vegetable\",\n\"visitor\",\n\"voyage\",\n\"year\"];\nreturn words[Math.floor(Math.random()*words.length)]; //returns a random index\n}", "title": "" }, { "docid": "43d938482d9962f95b4e357566385736", "score": "0.52299464", "text": "startGame() {\n overlay.style.display = \"none\";\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "7a1a6af0135fd8950786ed4a3dd238b9", "score": "0.5224033", "text": "function place_logo_words(el, word_dim) {\n // resize top word and place within .logo class\n var new_word = $(el), counter = 0\n\n while (Math.abs(new_word.width() - word_dim.width) > 4 && counter < 256 && word_dim.font_size < 240) {\n if (new_word.width() > word_dim.width) {\n // make it smaller\n new_word.css('font-size', --word_dim.font_size + 'px')\n } else {\n // make it bigger\n new_word.css('font-size', ++word_dim.font_size + 'px')\n }\n counter++\n }\n\n if (word_dim.font_size >= 240) {\n word_dim.font_size = 239\n new_word.css('font-size', word_dim.font_size + 'px')\n }\n\n // align\n new_word.offset({top: word_dim.bottom - new_word.height()})\n}", "title": "" }, { "docid": "d477fd4e676d3c262ef77a61dced1cc4", "score": "0.52239984", "text": "triggerHungry() {\n if (this.hungerTimer <= 10 && this.wordToFeed === \"\") {\n this.wordToFeed = words[Math.floor(Math.random() * words.length)];\n document.querySelector(`#word-${this.id}`).textContent = this.wordToFeed;\n }\n }", "title": "" }, { "docid": "7fd7acb4eb5ff608878ac15a980b8cc5", "score": "0.5221914", "text": "function nextWord() {\n clear();\n randomTile();\n updateIndicators(); //not working properly\n nextRound();\n }", "title": "" }, { "docid": "8def8ee23a02e1de8c7701b923bfe0f5", "score": "0.52159846", "text": "addPhraseToDisplay() {\n for (let letter of this.phrase) {\n const playSpace = document.querySelector('#phrase').firstElementChild;\n let li = document.createElement('li');\n li.textContent = letter;\n if (letter !== ' ') {\n li.className = `hide letter ${letter}`;\n } else {\n li.className = `hide space`;\n }\n playSpace.appendChild(li);\n }\n }", "title": "" }, { "docid": "fd0d6437c5780a6b4fa6e22648a7b3a1", "score": "0.52158964", "text": "startGame() {\n document.getElementById('overlay').style.display = 'none';\n let randomPhrase = this.getRandomPhrase();\n randomPhrase.addPhraseToDisplay();\n this.activePhrase = randomPhrase;\n }", "title": "" }, { "docid": "5090990a3349586425d64cc57faaaa74", "score": "0.5214233", "text": "play_word() {\n let temp = this.state.player_tiles;\n let placedtiles = temp.filter(([_, index]) => { return index > 0 });\n let letters = placedtiles.map(([ll, _]) => (ll));\n let pos = placedtiles.map(([_, pos]) => pos);\n\n this.channel.push(\"play_word\", { letters: letters, position: pos })\n .receive(\"ok\", this.got_view.bind(this));\n }", "title": "" }, { "docid": "c2a539d771a960142c2a6202a80b6341", "score": "0.52103597", "text": "startGame() {\r\n const overlay = document.getElementById('overlay');\r\n const phrase = this.getRandomPhrase();\r\n this.activePhrase = phrase;\r\n phrase.addPhraseToDisplay();\r\n overlay.style.display = \"none\";\r\n document.body.style.background= 'url(https://media.giphy.com/media/U3qYN8S0j3bpK/giphy.gif)';\r\n }", "title": "" }, { "docid": "7f38aa3a50fd043abfea4528f1800eed", "score": "0.52082795", "text": "function randomWord(){\n lives = 12;\n guesses = [''];\n hiddenAnswer = [''];\n answer = words[Math.floor(Math.random() * words.length)];\n letters = answer.split('');\n}", "title": "" }, { "docid": "635d255d2c80e7a84390304a1104f1af", "score": "0.52065706", "text": "function wordsFront(words, n) {\n let wordReturn = [];\n for(let i = 0; i < n; i++) {\n wordReturn.push(words[i]);\n }\n return wordReturn;\n}", "title": "" }, { "docid": "0be2e8e8456e231244194b76c18c7234", "score": "0.52058065", "text": "function addToSentance(word)\n {\n \tfinalSentence += \" \" + word;\n \t$(\".footer\").text(finalSentence);\n }", "title": "" } ]
5c48c99d7bacd24c4e12c038cdf77c19
Actually applies the filter
[ { "docid": "685011fb9e609c97314b8f63dfa501de", "score": "0.0", "text": "function applyPaletteFilter(string, filter) {\n var output = \"\", substr, i, len;\n for(i = 0, len = string.length; i < len; i += digitsize) {\n substr = string.substr(i,digitsize);\n output += filter[substr] || substr;\n }\n return output;\n}", "title": "" } ]
[ { "docid": "faa66c063a561e3079270266168409ec", "score": "0.7742543", "text": "_applyFilters () {\n\t\tlet surface = this.target.cacheCanvas;\n\t\tlet filters = this.target.filters;\n\n\t\tlet w = this._drawWidth;\n\t\tlet h = this._drawHeight;\n\n\t\t// setup\n\t\tlet data = surface.getContext(\"2d\").getImageData(0,0, w,h);\n\n\t\t// apply\n\t\tlet l = filters.length;\n\t\tfor (let i=0; i<l; i++) {\n\t\t\tfilters[i]._applyFilter(data);\n\t\t}\n\n\t\t//done\n\t\tsurface.getContext(\"2d\").putImageData(data, 0,0);\n\t}", "title": "" }, { "docid": "dbdd2bf58cd2a14ba2cf094f2ac65ffc", "score": "0.7153494", "text": "function processFilters() {\n console.log(\"processing filters...\");\n\n if(workSpace.currentDoc) {\n workSpace.currentDoc.filter(function(filterElement) {\n var hueRotate = filterElement.colorMatrix('hueRotate', 180);\n\n // Add filter to entire SVG element. At some point I want to\n // let the user choose which layer/node to apply a filter to\n // but this should get us started playing around with filters\n // at least.\n workSpace.currentDoc.attr(\"filter\", \"url(#\" + filterElement.attr(\"id\") + \")\");\n }); \n }\n }", "title": "" }, { "docid": "62a2cdc6d5afb20e50c780d99dbb8727", "score": "0.71084166", "text": "function applyCurrentFilter() {\n return currentFilter.call(this);\n }", "title": "" }, { "docid": "53a0d42b9e55760048b327bdfdf57768", "score": "0.69983906", "text": "function applyAdjust() {\n\tlet style = \"\";\n\tfilterControls.forEach(function (item, index) {\n\t\tif (item.getAttribute(\"data-filter\") != '') {\n\t\t\tif (item.getAttribute(\"data-filter\") == 'drop-shadow') {\n\t\t\t\tstyle += item.getAttribute(\"data-filter\") + '(' + item.value + item.getAttribute(\"data-scale\") + ' ' + item.value + item.getAttribute(\"data-scale\") + ' ' + item.value + item.getAttribute(\"data-scale\") + ' ' + 'gray' + ')';\n\t\t\t} else {\n\t\t\t\tstyle += item.getAttribute(\"data-filter\") + '(' + item.value + item.getAttribute(\"data-scale\") + \") \";\n\t\t\t}\n\t\t}\n\n\t});\n\timage.style.filter = style;\n\n\tlet filterApplied = style.replace(/filter|:|;/gi, '');\n\tlocalStorage.setItem('filterApplied', filterApplied);\n}", "title": "" }, { "docid": "85d862320d12d67fc5079a24d3ac34a5", "score": "0.69904506", "text": "function applyFilter(){toggleCss();self.filtered=self.gridController.rawItems.filter(self.filterFunc);self.gridController.doFilter();}", "title": "" }, { "docid": "0fc0276b5834ea9c3fd3a34cea82829d", "score": "0.69720995", "text": "apply(filterManager, input, output, clear) {\n this.uniforms.uTime = this.delta <= 0 ? 2.0 : this.delta;\n filterManager.applyFilter(this, input, output, clear);\n }", "title": "" }, { "docid": "fe07e3a232729e70b16d902a8be35fda", "score": "0.696434", "text": "function applyFilter(backCtx, filter) {\n if (filter == \"bw\") {\n backCtx.filter = 'grayscale(1)';\n } else if (filter == \"sepia\") {\n backCtx.filter = 'sepia(1)';\n }\n\n return;\n}", "title": "" }, { "docid": "50455efa6ef854ce27b4652b40486444", "score": "0.6959962", "text": "function applyFilter () {\n\n // get the data from the input element\n var filterDataString = this.value;\n if (filterDataString != undefined) {\n // make the data readable\n var filterDataArray = filterDataString.split(\"-|-\");\n if (filterDataArray != undefined && filterDataArray.length === 2) {\n var filterId = Number(filterDataArray[0]);\n var data = Number(filterDataArray[1]);\n // validate\n if (filterId != undefined && data != undefined && data != \"\") {\n // try to access the data with the given information.\n var fileData = getDataOfFileById(\"fluorideWater\");\n if (fileData) {\n\n // now get the filter\n var filterData = fileData.filterData;\n if (filterData != undefined) {\n var filter = filterData[filterId];\n if (filter != undefined) {\n\n // update the filter\n filter.defaultValue = new Date(data);\n\n // reload/update the graph\n callDataRequestersBack (fileData);\n }\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "264126d811c39e89c28797117659a1a9", "score": "0.6935326", "text": "function apply() {\n if (interactionEnabled) {\n filterActive = true;\n _showSelected();\n }\n }", "title": "" }, { "docid": "74b7173cc1bc8606d2c5e62729fc581d", "score": "0.68621135", "text": "function filterChange() {\n // console.log('filterChange');\n\n SvgModule.Data.Tag.style.filter = Common.getFiltersCss(\n PageData.Controls.Brightness.value,\n PageData.Controls.Contrast.value,\n PageData.Controls.Hue.value,\n PageData.Controls.Saturation.value);\n}", "title": "" }, { "docid": "0332d609723b6ef7380e450141b59676", "score": "0.6822149", "text": "apply(filterManager, input, output, clear) {\n this.uniforms.dimensions[0] = input.filterFrame.width;\n this.uniforms.dimensions[1] = input.filterFrame.height;\n\n // named `seed` because in the most programming languages,\n // `random` used for \"the function for generating random value\".\n this.uniforms.seed = this.seed;\n\n filterManager.applyFilter(this, input, output, clear);\n }", "title": "" }, { "docid": "614a7f461cafa3983b36ea961b7b1908", "score": "0.6750822", "text": "function filter() {\n Caman(\"#photo\", newImg, function () {\n bright.addEventListener(\"change\", (e) => {\n e.preventDefault();\n let value = parseInt(bright.value);\n spanValueBright.innerHTML = value;\n adjustBrightness(value);\n });\n\n saturation.addEventListener(\"change\", (e) => {\n e.preventDefault();\n let value = parseInt(saturation.value);\n spanValueSaturation.innerHTML = value;\n adjustSaturation(value);\n });\n\n stackBlur.addEventListener(\"change\", (e) => {\n e.preventDefault();\n let value = parseInt(stackBlur.value);\n spanValueBlur.innerHTML = value;\n adjustStackBlur(value);\n });\n\n hue.addEventListener(\"change\", (e) => {\n e.preventDefault();\n let value = parseInt(hue.value);\n spanValueHue.innerHTML = value;\n adjustHue(value);\n });\n\n sepia.addEventListener(\"change\", (e) => {\n e.preventDefault();\n let value = parseInt(sepia.value);\n spanValueSepia.innerHTML = value;\n adjustSepia(value);\n });\n });\n}", "title": "" }, { "docid": "b8171649d4bccfd70b6e7045f3c63c05", "score": "0.6734826", "text": "setFiltro () { \n let color = 0, index = 0;\n let retorno = new ImageData( this.width, this.height );\n for (let x = 0; x < this.width; x++) {\n for (let y = 0; y < this.height; y++) {\n index = ( x + y * this.width ) * 4;\n if ( this.compareTo( this.getAverage ( x, y ) ) > 0 ) \n color = 0;\n else \n color = 225;\n this.setData ( retorno, color, index );\n }\n }\n this.context.putImageData( retorno, 0, 0);\n }", "title": "" }, { "docid": "1426771fb23ed61b46927866134cf771", "score": "0.66828114", "text": "function drawFilter() {\n filterTab.forEach(function(filter) {\n context.drawImage(document.getElementById(filter), 0, 0, width, height);\n });\n}", "title": "" }, { "docid": "cef624637b040b8ef6dbe80d212a4e06", "score": "0.6603102", "text": "setFilter(filter){\n }", "title": "" }, { "docid": "bf418b62a58b24a16e94aa9db1af6639", "score": "0.65665066", "text": "_applyFilters() {\n if (!this._filters || this._filters.length <= 0) {\n this._data = this._originalData;\n return;\n }\n const groupedFilters = _groupBy(this._filters, \"category\");\n const filteredGroups = Object.values(groupedFilters).map((filterGroup) => {\n const filteredData = filterGroup.map((filterItem) =>\n filterItem.filterFn(this._originalData)\n );\n return deepArrayOperation(filteredData, _union);\n });\n\n this._data = deepArrayOperation(filteredGroups, _intersection);\n }", "title": "" }, { "docid": "1aff2115191d5f1cbbb064d80ca18838", "score": "0.6564192", "text": "_runFilter() {\n // If the filter has been reset, remove all filtering\n if (!this.filter) {\n this.querySelectorAllArray('.layer-item-filtered').forEach(item => item.removeClass('layer-item-filtered'));\n }\n\n // Run all filtering\n else {\n for (let i = 0; i < this.childNodes.length; i++) {\n const listItem = this.childNodes[i];\n if (listItem.item instanceof Layer.Root) {\n listItem._runFilter(this.filter);\n }\n }\n }\n }", "title": "" }, { "docid": "75c68aad00d524496e95ae1db3facc63", "score": "0.6525591", "text": "function filterHandler(){\n}", "title": "" }, { "docid": "3f0ba51eba7b818af5bc21e12c2871ed", "score": "0.65132946", "text": "function updateFilter() {\n // Update all the value of each filter whenever a filter is used\n gCeid = gAprtFilter.map(function(d) {return d.ceid});\n gCeid = getUniqueValue(gCeid);\n\n gL2 = gAprtFilter.map(function(d) {return d.ceid});\n gL2 = getUniqueValue(gL2);\n\n gEntity = gAprtFilter.map(function(d) {return d.entity});\n gEntity = getUniqueValue(gEntity);\n\n gOperation = gAprtFilter.map(function(d) {return d.operation});\n gOperation = getUniqueValue(gOperation);\n\n gProduct = gAprtFilter.map(function(d) {return d.prodgroup3});\n gProduct = getUniqueValue(gProduct);\n}", "title": "" }, { "docid": "ca828afaff696fe950ab89bba63b9956", "score": "0.6488164", "text": "function applyFilters(){\n allFilter(allSections);\n getData(filters);\n}", "title": "" }, { "docid": "3ae4090537c4d51e1f12427edf5c8cab", "score": "0.6486606", "text": "function runFilter(isInit) {\n if (settings.custom_filter.length) {\n $.each(settings.custom_filter, function(key, func) {\n if (typeof func == 'string') {\n func = window[func];\n }\n\n func(canvas, isInit);\n });\n }\n }", "title": "" }, { "docid": "7bc4ddbadb539a9fbe052bee22e4eda2", "score": "0.64339876", "text": "function remove_from_filters(){\n\n}", "title": "" }, { "docid": "aa4dc0bdb781b2e6dc0002029825d64e", "score": "0.64239645", "text": "_setFilter() {\n if (this._oldColor === this.item.color) return;\n // There is at least one filter value which need to set\n this._atLeastOneFilter = false;\n\n // Reset filter\n this._filter.reset();\n // For each filter from props\n _.each(this.item.color, (filterValue, filterName) => {\n if (filterValue) {\n // Get filter object from setting\n const filter = IMAGE_COLOR_FILTERS.find(fil => fil.name === filterName);\n // Value props need to divide on divider to prepare what filter numbers required\n this._filter.addFilter(filterName, filterValue / filter.divider);\n this._atLeastOneFilter = true;\n }\n });\n // Save new filter as old\n this._oldColor = this.item.color;\n }", "title": "" }, { "docid": "dd9b625173133fa6b3bb3655e0806b32", "score": "0.64230186", "text": "reApplyFilter(filter) {\r\n console.log(\"geography:: reapply\", filter);\r\n this.drawnitems.clearLayers();\r\n if (filter.region != undefined) {\r\n //???\r\n }\r\n if (filter.topLeft != undefined) {\r\n // fixme box in wrong place\r\n var bounds = [[filter.bottomRight[1], filter.topLeft[0]], [filter.topLeft[1], filter.bottomRight[0]]];\r\n // create an orange rectangle\r\n console.log(bounds);\r\n L.rectangle(bounds).addTo(this.drawnitems);\r\n// this.drawnitems.addLayer();\r\n }\r\n Filters.addSpatial(filter,true);\r\n \r\n }", "title": "" }, { "docid": "3edce1c78b90ed56e459376a280a7a6b", "score": "0.640122", "text": "function filter() {\n var filter = currentFilter;\n \n var scale = d3.scale.linear().domain([\n d3.min(data, function(c) { return d3.min(c[filter], function(v) { return v; }); }),\n d3.max(data, function(c) { return d3.max(c[filter], function(v) { return v; }); })\n ]).range([5, 60]);\n\n d3.selectAll('.country')\n .transition()\n .duration(400)\n .attr('cy', function(d, i) {\n var degrees = d.s / data.length * 360;\n var radians = degrees * Math.PI / 180;\n\n return rd(d.percentage[currentYear]) * Math.sin(radians);\n })\n .attr('cx', function(d, i) {\n var degrees = d.s / data.length * 360;\n var radians = degrees * Math.PI / 180;\n\n return rd(d.percentage[currentYear]) * Math.cos(radians);\n })\n .attr('r', function(d, i) { return scale(d[filter][currentYear]); });\n }", "title": "" }, { "docid": "159f5396b543ae1925e0ac7baa6de7d5", "score": "0.63643265", "text": "filterCanvasOption(option){\n const selectedFilter = this.filtersMap[option];\n this.filterCanvas((selectedFilter).filter.bind(selectedFilter)); // make sure 'this' context is correct for the filtering function\n }", "title": "" }, { "docid": "df0df53b0533db05f0e024fe24d6b67e", "score": "0.6361535", "text": "_onApplyFilter(perValue, perConditions, dataInfo) {\n this.worker.postMessage({ action: 'FILTER', perValue, perConditions, dataInfo});\n this._selectColumn(null);\n }", "title": "" }, { "docid": "721d8bd0b93fa06f7e7ea5b99a874716", "score": "0.6359669", "text": "_setFilteredImage() {\n this._setFilter();\n\n // If there are filter\n if (this._atLeastOneFilter) {\n // Use filter\n this._filteredImage = this._filter.apply(this.element);\n } else {\n // Otherwise use plain element wo filters\n this._filteredImage = this.element;\n }\n\n // Set image to fabric element\n this._setImageToFabric();\n }", "title": "" }, { "docid": "20ef921f4aa9bef3d6951345206a0a51", "score": "0.6353843", "text": "updateColorFilter() {\n var source = this.getSource();\n if (source instanceof ImageSource) {\n if (this.getBrightness() != 0 || this.getContrast() != 1 || this.getSaturation() != 1 ||\n this.getSharpness() != 0) {\n // put the colorFilter in place if we are colorized or the current color is different from the default\n source.addImageFilter(this.colorFilter_);\n } else {\n source.removeImageFilter(this.colorFilter_);\n }\n }\n }", "title": "" }, { "docid": "6bd3997f619e3c2ad385830d14be0e06", "score": "0.6340096", "text": "function brush() {\n// context.filter();\n }", "title": "" }, { "docid": "ea72116570c79a9d28f56346e0bc1925", "score": "0.6334889", "text": "function applyFilter (filterFunction){\n for(var i = 0; i < image.length; i++){\n for (var j = 0; j < image[i].length; j++){\n var rgbString = image[i][j];\n var rgbNumbers = rgbStringToArray(rgbString);\n filterFunction(rgbNumbers);\n var rgbString = rgbArrayToString(rgbNumbers);\n image[i][j] = rgbString;\n }\n }\n}", "title": "" }, { "docid": "6a39ee6822356deead11e61748f10b80", "score": "0.6297524", "text": "function ApplyFilter (eID, filterStr) {\n\n\tif (! FullDHTML ())\n\t\treturn;\n\n\teID.style.filter = filterStr;\n\t}", "title": "" }, { "docid": "b1fefcf8c085e8a1b7aacc810f709fc0", "score": "0.6291995", "text": "function applyFilter(e) {\n result.className = 'result ' + e.target.id\n}", "title": "" }, { "docid": "6a5d389332d56486504203a65157d0fb", "score": "0.62866956", "text": "filterCanvas(filter){\n const currFrame = this.animationProject.getCurrFrame();\n const currLayer = currFrame.getCurrCanvas();\n const context = currLayer.getContext(\"2d\");\n const width = currLayer.getAttribute('width');\n const height = currLayer.getAttribute('height');\n const imgData = context.getImageData(0, 0, width, height);\n\n // save current image to snapshots stack for undo\n currFrame.addSnapshot(imgData);\n\n // grab a new copy of image data so we don't mess with the snapshot data we just stored\n const filteredImageData = filter(context.getImageData(0, 0, width, height));\n context.putImageData(filteredImageData, 0, 0);\n }", "title": "" }, { "docid": "cea84bbd15102839c56140d2e637a4d7", "score": "0.6286526", "text": "function filterUpdated() {\n gWaterfallDataIsDirty = true;\n}", "title": "" }, { "docid": "9ce992641568c28caf586cb29d4aafcc", "score": "0.6278866", "text": "FILTER_MODIFY(state, filter, changes) {\n /* Ensure filter is in filters list\n Not strictly necessary, but it would nice to know we're only operating\n on data we own */\n if (state.filters.includes(filter)) {\n Object.assign(filter, changes);\n }\n }", "title": "" }, { "docid": "3dfa3c90255872116f7a090263ddafc5", "score": "0.6266496", "text": "function applyFilter(filterFunction) {\n for (var r = 0; r < image.length; r++) { \n for (var c = 0; c < image[r].length; c++) { \n var rgbString = image[r][c];\n var rgbNumbers = rgbStringToArray(rgbString);\n filterFunction(rgbNumbers);\n rgbString = rgbArrayToString(rgbNumbers);\n image[r][c] = rgbString;\n }\n }\n}", "title": "" }, { "docid": "54dec04ba9e4bbfd0291c789f438bec9", "score": "0.62616545", "text": "function ColorizeFilter() {\n var _this = _super.call(this) || this;\n _this.className = \"ColorizeFilter\";\n // Create elements\n // NOTE: we do not need to add each individual element to `_disposers`\n // because `filterPrimitives` has an event handler which automatically adds\n // anything added to it to `_disposers`\n _this.feColorMatrix = _this.paper.add(\"feColorMatrix\");\n _this.feColorMatrix.attr({ \"type\": \"matrix\" });\n //this.feColorMatrix.setAttribute(\"in\", \"SourceAlpha\");\n _this.filterPrimitives.push(_this.feColorMatrix);\n // Set default properties\n _this.intensity = 1;\n _this.applyTheme();\n return _this;\n }", "title": "" }, { "docid": "9849ebbbd43c09469de051d9c2565230", "score": "0.62538093", "text": "function filterOn() {\n //this.filters = [outlineFilterRed]\n}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.6239822", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.6239822", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.6239822", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.6239822", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.6239822", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.6239822", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.6239822", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.6239822", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.6239822", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.6239822", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.6239822", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.6239822", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.6239822", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.6239822", "text": "function setFilters(){}", "title": "" }, { "docid": "2b8927ff33e51e433ea4e63b5190bcd5", "score": "0.6239822", "text": "function setFilters(){}", "title": "" }, { "docid": "d85495ff9765d483f79a5567777b13e3", "score": "0.62276965", "text": "function initialize() {\n filterFunction()\n}", "title": "" }, { "docid": "6898ef868b13f0359f69e4dcd9e217c8", "score": "0.6224597", "text": "function reApplyFilter(){\n for (var key in filterList) {\n for (let i = 0; i < filterList[key].length; i++) {\n if (filterList[key][i] == true) {\n for (let j = 0; j < inst.length; j++) {\n var element = inst[j];\n\n if (element[filterType].toLowerCase() != inst_filters[filterType][filterIndex]) {\n hideElement(element.nome);\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" }, { "docid": "f06f643b4147e28940e9532e1b259722", "score": "0.62237334", "text": "function setFilters() {}", "title": "" } ]
e20083c1ec2c0bc0c545c559225b1bd7
calls functions to update the variables of the game and determine if changes need to be made/redrawn
[ { "docid": "5d38a7b24a80514ff322e71d093682e0", "score": "0.70555407", "text": "function update() {\n\tmoveCars();\n\tmoveLogs();\n\tfrogOnLog();\n\tisFly();\n\tif (vars.frogDead == true) {\n\t\tdeathWait();\n\t}\n\telse {\n\t\tcheckHome();\n\t\tcheckDead();\n\t\taddPoints();\n\t\tvars.time++;\n\t}\n\tvars.lastKey = null;\n\tvars.landedFrog = false;\t\n\tvars.flyBonus = false;\n}", "title": "" } ]
[ { "docid": "94f6bcc6e4876572a2c146e6e1ffdfd4", "score": "0.76612854", "text": "function update(){\n //Main Game Loop\n //Check if game is over\n isGameOver();\n //If it's not, update the field\n updateDisplays();\n draw();\n }", "title": "" }, { "docid": "f62fa00f65723f9378b90d5112b7300a", "score": "0.7157042", "text": "function update() {\n showTable();\n showNames();\n if (game[\"viewWelcomeScreen\"] == false) {\n hideWelcomeScreen();\n }\n /* If one player filled out the input fields with names and clicked the let's play button, the names will appear in the player panel on both screens. */\n showActivePlayer();\n /* If one of both players made 3 shapes in a row, column or diagonal. */\n checkForWinner();\n /* If one player pushed the restart button, the game restarts on both screens. */\n if (game[\"gameOver\"] == false && game[\"counter\"] == 0) {\n restart();\n }\n}", "title": "" }, { "docid": "f80268503eeebea6fcd075dabc9774c2", "score": "0.711746", "text": "function updateGameArea() {\n myGameArea.clear();\n gameMap.update();\n calendar.update();\n daysLeft.update();\n receptionFace.update();\n cityReception.update($cityReception);\n paint1.update();\n district1.update();\n paint2.update();\n district2.update();\n paint3.update();\n district3.update();\n drops[0].update();\n drops[1].update();\n drops[2].update();\n }", "title": "" }, { "docid": "227046a09c3927229a01fcb322b3354a", "score": "0.70402247", "text": "function updateDisplay() {\n drawUI()\n drawYourHand()\n drawPlayers()\n drawPlayerPictures()\n drawPiles()\n drawDrawCounter()\n drawTurnDirection()\n}", "title": "" }, { "docid": "73da5318316a8b565949c885e5279f2d", "score": "0.69735146", "text": "function update() {\n draw()\n controlGame()\n }", "title": "" }, { "docid": "adf3eca8158cb0c100ee91481682d60a", "score": "0.6968379", "text": "function update() {\n\tcontext.clearRect(0, 0, canvas.width, canvas.height);\n\tcontext_right.clearRect(0, 0, canvas_right.width, canvas_right.height);\n\tif (flag_start_check == 0) {\n\t\tdrawBackground();\n\t\tdrawContentRight();\n\t\tdrawWelcome();\n\t}\n\tif (flag_start_check == 1) {\n\t\tdrawBackground();\n\t\tdrawContentRight();\n\t\tdrawMoney();\n\t\tdrawMonster();\n\t}\n\tif (flag_start_check == 3) {\n\t\tdrawBackground();\n\t\tdrawContentRight();\n\t\tdrawWin();\n\t}\n\tif (flag_start_check == 4) {\n\t\tdrawBackground();\n\t\tdrawContentRight();\n\t\tdrawLose();\n\t}\n}", "title": "" }, { "docid": "cb1f3f43ccbbbc82db7a13b82b849314", "score": "0.6943299", "text": "function updateGameStatus() {\n if (checkRows() || checkColumns() || checkDiagonals()) {\n window.alert(`${markers[player]} won!`);\n gameIsOver = true;\n } else if (numEmptyCells === 0) {\n window.alert(`It's a draw!`);\n gameIsOver = true;\n }\n}", "title": "" }, { "docid": "4d96de7aa505458aa77db92735df0b81", "score": "0.6938657", "text": "updateScreen()\n\t{\n\n\t\t// print score\n\t\tdocument.getElementById(\"playerScore\").innerHTML = this.playerScore;\n\t\tdocument.getElementById(\"botScore\").innerHTML = this.botScore;\n\n\t\t// Check if game is finished\n\t\tif(this.isGameOver())\n\t\t{\n\t\t\tthis.gameOver();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.board.printBoard();\n\t\t\t\n\t\t\tif(this.turn == -1)\n\t\t\t\tthis.possibleMoves = this.board.findPossibleMoves(this.xPlayer, this.yPlayer, this.numRows);\n\t\t\telse this.possibleMoves = this.board.findPossibleMoves(this.xBot, this.yBot, this.numRows);\n\t\t\t\n\t\t\tthis.board.highlightPossibleMoves(this.possibleMoves, this);\t\n\t\t}\n\t}", "title": "" }, { "docid": "a4b5cb80231e47b4c8baa8754681d81f", "score": "0.6895188", "text": "function update(){\n updateSnake()\n updateFood()\n checkDeath()\n}", "title": "" }, { "docid": "d3ceab8983c4686d1218da131dd29798", "score": "0.6884271", "text": "update(delta){\n\n //gets user keyboard input\n let keyboard = this.input.keyboard;\n if (keyboard.checkDown(keyboard.addKey('ONE')) || keyboard.checkDown(keyboard.addKey('NUMPAD_ONE')) || keyboard.checkDown(keyboard.addKey(35))) {\n this.checkWinState(1);\n }\n if (keyboard.checkDown(keyboard.addKey('TWO')) || keyboard.checkDown(keyboard.addKey('NUMPAD_TWO')) || keyboard.checkDown(keyboard.addKey(40))) {\n this.checkWinState(2);\n }\n if (keyboard.checkDown(keyboard.addKey('THREE')) || keyboard.checkDown(keyboard.addKey('NUMPAD_THREE')) || keyboard.checkDown(keyboard.addKey(34))) {\n this.checkWinState(3);\n } \n\n //handles the math for the loading bar\n var nowtime = new Date();\n var deltaTime = (nowtime-this.oldtime)/(time * 1112);\n this.oldtime = nowtime;\n num += deltaTime;\n this.loadingBar.fillRect(0, this.game.renderer.height / 1.3, this.game.renderer.width * num, 20);\n\n //helps place the checkmark if the user guessed\n if (this.guessPlaced > 0){\n this.checkMark.setDepth(3);\n }\n }", "title": "" }, { "docid": "b6d0a7b98a5d8696af2f82506906ca4d", "score": "0.68694025", "text": "function update() {\n\tframes++;\n\n\tif (currentstate !== states.Score) {\n\t\tfgpos = (fgpos - 2) % 14;\n\t} else {\n\t\t// set best score to maximum score\n\t\tbest = Math.max(best, score);\n\t\ttry {\n\t\t\tlocalStorage.setItem(\"best\", best);\n\t\t} catch(err) {\n\t\t\t//needed for safari private browsing mode\n\t\t}\n\t\tscrollTextPos = width*1.5;\n\t}\n\tif (currentstate === states.Game) {\n\t\tpipes.update();\n\t}\n\n\tbird.update();\n\tbackgroundFx.update();\n\tforegroundFx.update();\n}", "title": "" }, { "docid": "ed402936ba1dc7e552ee0da8560abd0a", "score": "0.6838548", "text": "function gameLogicUpdate() {\n scoreUpdate();\n handlePipe();\n checkForWin();\n}", "title": "" }, { "docid": "411f1333b9ad28e01a872c493483d41e", "score": "0.68266326", "text": "function gameLoop() {\n\tgoodGuyUpdate()\n\tbadGuyUpdate()\n\tdrawScreen()\n\tdrawScore()\n}", "title": "" }, { "docid": "015b10cd6574178446faf28bedaaa52d", "score": "0.6764813", "text": "function updateDisplay() {\n createSpan(\"#player-1-wins\", player1.wins);\n createSpan(\"#player-2-wins\", player2.wins);\n createSpan(\"#ties\", ties);\n\n if (player1.gesture === \"paper\") {\n updateImage(1, player1.gesture, gestureImages.player1.paper);\n }\n else if (player1.gesture === \"scissors\") {\n updateImage(1, player1.gesture, gestureImages.player1.scissors);\n }\n else {\n updateImage(1, player1.gesture, gestureImages.player1.rock);\n }\n\n if (player2.gesture === \"paper\") {\n updateImage(2, player2.gesture, gestureImages.player2.paper);\n }\n else if (player2.gesture === \"scissors\") {\n updateImage(2, player2.gesture, gestureImages.player2.scissors);\n }\n else {\n updateImage(2, player2.gesture, gestureImages.player2.rock);\n }\n\n updateRounds();\n }", "title": "" }, { "docid": "bb1302807e82ed8307e1230309956dcb", "score": "0.6755976", "text": "function onUpdate() {\n document.getElementById(\"points\").innerHTML = \"Points : \" + points;\n for (var i = 0; i < tileArray.length; i++) {\n for (var j = 0; j < tileArray[i].length; j++) {\n if (tileArray[i][j].tileDesc.letter !== \".\" && tileArray[i][j].tileDesc.show) {\n let tile = tileArray[i][j].tileDesc.letter.charCodeAt(0) - 65;\n // \"frame\" and \"value\" are custom attributes\n tileArray[i][j].frame = tile;\n tileArray[i][j].value = tile;\n }\n }\n }\n\n let anyLeft = false;\n for (var i = 0; i < tileArray.length; i++) {\n for (var j = 0; j < tileArray[i].length; j++) {\n if (tileArray[i][j].tileDesc.letter !== \".\" && !tileArray[i][j].tileDesc.show) {\n anyLeft = true;\n }\n }\n }\n if (!anyLeft) {\n document.getElementById(\"restartButton\").disabled = false;\n document.getElementById(\"letters\").innerHTML = \"Good game, well played. Ez.\";\n\n }\n\n}", "title": "" }, { "docid": "2543fad4a6e961efdbf8626f33e29dfb", "score": "0.6721271", "text": "function updateStuff(data) {\n\n // error is only set if the player tries to move if it's not his turn or the game is over\n if (data.error == undefined) {\n \n player = $('#playerStatus');\n enemy = $('#enemyStatus');\n\n //todo: check if something has changed before redrawing\n if (data.board != undefined) {\n gameState = data.board; \n buildTokens();\n }\n\n // is only invoked if the game is still running\n if (data.finished == 'false' || data.finished == undefined || !data.finished) {\n \n // mark the right player as active\n if (data.turn != activePlayer) {\n \n $('.playerStatus.active').removeClass('active');\n activePlayer = data.turn;\n\n if (data.turn == playernum) {\n player.addClass('active');\n } else {\n enemy.addClass('active');\n }\n } \n\n // if the game is over, mark winner and loser\n //todo: only do this the first time\n } else {\n\n $('#gameStatus').text('GAME OVER');\n $('.playerStatus.active').removeClass('active');\n\n if (data.turn == playernum) {\n player.addClass('loser');\n enemy.addClass('winner');\n } else {\n player.addClass('winner');\n enemy.addClass('loser');\n }\n $('#links').html(\"<a href='/index.php'>Menu</a>\");\n \n }\n } \n }", "title": "" }, { "docid": "54fe20ad8eeebf0f773b253e0f10d79c", "score": "0.67123395", "text": "update() {\n if (!this.gameOver) {\n if (this.frog) this.frog.update(this.cursors);\n if (this.cameraPanning) this.panCamera();\n this.updateGameObjects();\n }\n }", "title": "" }, { "docid": "333a05bb50138abef1ceab40ed7a24ab", "score": "0.6702117", "text": "function refresh() {\n drawProgram();\n drawTalks();\n addDrag();\n}", "title": "" }, { "docid": "557377d0ca63b6c84704be7791f49832", "score": "0.6690525", "text": "function update() {\n\t\tcheckSides();\n\t\tredrawAndMoveBox();\n\t}", "title": "" }, { "docid": "4f2448e59b8d724cad3afe748ed8a4b9", "score": "0.6675093", "text": "function reloadGraphics(){\n\t\n\t\n\t//Removes all art. Byebye!\n\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\t//defaults everything back to false.\n\tclearLoadedImages();\n\n\t//0 is main menu\n\tif (state == 0){\n\t\t//screenMainMenu.js\n\t\tloadMainMenu();\n\t}\n\t\t//1 is gameplay.\n\tif (state == 1){\n\t\t//screenGame.js\n \t\tloadGame();\n\t}\n\t\t//2 is result screen\n\tif (state == 2){\n\t\t//levelFinishBackgroundImg() is in screenResult.js file\n\t\tloadResult();\n\t}\n\t\t//3 is pause menu screen\n\tif (state == 3){\n\t\t//screenPauseMenu.js\n\t\tloadPauseMenu();\n\t}\n\t\t//4 is scoreboard screen\n\tif (state == 4){\n\t\t//screenScoreboard.js\n\t\tloadScoreboard();\n\t}\n\t\t//5 is credits screen\n\tif (state == 5){\n\t\t//screenCredits.js\n\t\tloadCreditsMenu();\n\t}\n\t\t//6 achievements screen\n\tif (state == 6){\n\t\tloadAchievements();\n\t\t//screenAchievements.js\n\t}\n\t\t//7 back to main confirm screen\n\tif (state == 7){\n\t\t//screenPauseMenu.js\n\t\tloadBackToMainMenuConfirmMenu();\n\t}\n\t\t//8 item select screen\n\tif (state == 8){\n\t\t//screenSelect.js\n\t\tloadCharSelection();\n\t}\n\t //tutorial level\n\tif (state == 9){\n\t\t//screenTutorial.js\n\t\tloadTutorialMenu();\t\n\t}\n\t\t//score submission screen\n\tif (state == 10){\n\t\t//screenScoreboard.js\n\t\tloadScoreSubmission();\t\n\t}\n \n //11 restart confirm menu\n if (state == 11){\n //screenPauseMenu.js\n loadRestartConfirmMenu();\n }\n\n}", "title": "" }, { "docid": "99d03e96344cffed47d59f45fd6119ce", "score": "0.6667211", "text": "update() { }", "title": "" }, { "docid": "99d03e96344cffed47d59f45fd6119ce", "score": "0.6667211", "text": "update() { }", "title": "" }, { "docid": "99d03e96344cffed47d59f45fd6119ce", "score": "0.6667211", "text": "update() { }", "title": "" }, { "docid": "99d03e96344cffed47d59f45fd6119ce", "score": "0.6667211", "text": "update() { }", "title": "" }, { "docid": "fc6e2580e93f25772806068b747a5b62", "score": "0.66382575", "text": "_updateAll() {\n const self = this;\n\n self._rounds();\n self._checkAllCollision();\n \n if (!self.isFightMode) {\n self.godzilla.update();\n self.gamera.update();\n }\n }", "title": "" }, { "docid": "80dcb80e0f61e12c1c10358d42cb6de3", "score": "0.6623748", "text": "function refreshStat() { \r\n if (!running) { \r\n running = true; \r\n draw(); \r\n running = false; \r\n } \r\n}", "title": "" }, { "docid": "a55b00a1fe16a9612183075d429aaf77", "score": "0.6614671", "text": "update() {\n super.update();\n this.bark();\n this.checkIfWin();\n }", "title": "" }, { "docid": "c05d8488a81a7f86a9e422d6e3f9a71e", "score": "0.6612057", "text": "function update(){\r\n currentFrame ++;\r\n if(currentFrame%framesPerTurn === 0){\r\n turnNumber++;\r\n currentTurn = true;\r\n }\r\n // Check keys and update map scrolling accordingly\r\n if(viewChanged){\r\n if (keys[37]) { \r\n // left arrow\r\n mapXOffset > 0 ? mapXOffset-- : mapXOffset = mapSize-1; \r\n }\r\n if (keys[38]) {\r\n // up arrow\r\n mapYOffset > 0 ? mapYOffset--: mapYOffset = mapSize-1;\r\n }\r\n if (keys[39]) {\r\n // right arrow\r\n mapXOffset < mapSize-1 ? mapXOffset++ : mapXOffset = 0;\r\n }\r\n if (keys[40]){\r\n // down arrow\r\n mapYOffset < mapSize-1 ? mapYOffset++ : mapYOffset = 0;\r\n } \r\n } \r\n if(simulationRunning && currentTurn){\r\n vegChanged = true;\r\n if(roundsVegRandomize > 0){\r\n spawnVegetation(true);\r\n roundsVegRandomize--;\r\n //Check to see how many vegetation species populated world, if less than designated percentage then restart\r\n console.log(vegSpeciesAlive.length+\" veg species alive\")\r\n if(roundsVegRandomize === 0 && vegSpeciesAlive.length < numVegSpecies*0.3){\r\n mapChanged = true;\r\n }\r\n }else{\r\n spawnVegetation(false);\r\n }\r\n }\r\n //If map has been changed then create new Vegetation Species to inhabit\r\n if(mapChanged){\r\n vegSpeciesAlive = [];\r\n roundsVegRandomize = 3;\r\n createVegetationSpecies();\r\n }\r\n for(var i=0; i<mapSize; i++){\r\n for(var j=0; j<mapSize; j++){\r\n var iOffset, jOffset;\r\n i+mapXOffset >= mapSize ? iOffset = i+mapXOffset-mapSize : iOffset = i+mapXOffset;\r\n j+mapYOffset >= mapSize ? jOffset = j+mapYOffset-mapSize : jOffset = j+mapYOffset;\r\n //Update vegetation maturity if correct frame dependent on maturity rate\r\n if(simulationRunning && map[i][j].vegetation && map[i][j].vegetation.maturity<100 && turnNumber%map[i][j].vegetation.maturityRate === 0){\r\n map[i][j].vegetation.maturity++;\r\n //console.log(map[i][j].vegetation.maturity);\r\n }\r\n //Redraw map if anything about it changed\r\n if(mapChanged){\r\n //Reset all vegetation\r\n map[i][j].vegetation = null;\r\n\r\n //Update tile biome based on variant \r\n if(map[i][j].elevation <= oceanLevel){\r\n map[i][j].biome = \"Ocean\";\r\n }else{\r\n var adjElevTemp = map[i][j].temperature-Math.round(((2*maxTempStep*(map[i][j].elevation-oceanLevel))/maxElevation)-maxTempStep);\r\n if(adjElevTemp<0){\r\n adjElevTemp = 0;\r\n }else if(adjElevTemp>maxTemperature){\r\n adjElevTemp = maxTemperature;\r\n }\r\n var tempLevel = Math.floor(Math.floor(((adjElevTemp/maxTemperature)*(highTemp-lowTemp))+lowTemp)*6/maxTemperature);\r\n var precLevel = Math.floor(((precipitationDensity+map[i][j].precipitation/maxPrecipitation)/2*map[i][j].precipitation)*6/maxPrecipitation);\r\n if(tempLevel === 6){tempLevel = 5;}\r\n if(precLevel === 6){precLevel = 5;}\r\n map[i][j].biome = biomeKey[tempLevel][precLevel];\r\n }\r\n map[i][j].soilRichness = biomeStats[map[i][j].biome].soilRichness/8;\r\n }\r\n if(viewChanged){\r\n //Colors for various Views\r\n ctx.fillStyle = 'rgb('+biomeStats[map[i][j].biome].color+')';\r\n \r\n if(currentView === \"elevation\"){\r\n if(map[i][j].biome === \"Ocean\"){\r\n var elevationColor = Math.floor(255*(map[i][j].elevation/maxElevation));\r\n var averageR = Math.floor(0.4*parseInt(ctx.fillStyle.substring(1,3), 16) + 0.6*elevationColor);\r\n var averageG = Math.floor(0.4*parseInt(ctx.fillStyle.substring(3,5), 16) + 0.6*elevationColor);\r\n var averageB = Math.floor(0.4*parseInt(ctx.fillStyle.substring(5), 16) + 0.6*elevationColor);\r\n ctx.fillStyle = 'rgb('+averageR+','+averageG+','+averageB+')';\r\n }else{\r\n var averageR = Math.floor((((map[i][j].elevation-oceanLevel)/maxElevation)*0.75+0.25)*parseInt(ctx.fillStyle.substring(1,3), 16));\r\n var averageG = Math.floor((((map[i][j].elevation-oceanLevel)/maxElevation)*0.75+0.25)*parseInt(ctx.fillStyle.substring(3,5), 16));\r\n var averageB = Math.floor((((map[i][j].elevation-oceanLevel)/maxElevation)*0.75+0.25)*parseInt(ctx.fillStyle.substring(5), 16));\r\n ctx.fillStyle = 'rgb('+averageR+','+averageG+','+averageB+')';\r\n }\r\n \r\n }\r\n else if(currentView === \"precipitation\"){\r\n var overlayG = Math.floor((1-map[i][j].precipitation/maxPrecipitation)*(parseInt(ctx.fillStyle.substring(3,5), 16)/2) + Math.floor((map[i][j].precipitation/maxPrecipitation)*255));\r\n var overlayB = Math.floor((1-map[i][j].precipitation/maxPrecipitation)*(parseInt(ctx.fillStyle.substring(5), 16)/2) + Math.floor((map[i][j].precipitation/maxPrecipitation)*255));\r\n var averageG = Math.floor((1-precipitationDensity)*(parseInt(ctx.fillStyle.substring(3,5), 16)/2) + Math.floor(precipitationDensity*overlayG));\r\n var averageB = Math.floor((1-precipitationDensity)*(parseInt(ctx.fillStyle.substring(5), 16)/2) + Math.floor(precipitationDensity*overlayB));\r\n ctx.fillStyle = 'rgb('+Math.floor(parseInt(ctx.fillStyle.substring(1,3), 16)/2)+','+averageG+','+averageB+')';\r\n }\r\n else if(currentView === \"temperature\"){\r\n var localTemp = Math.floor((map[i][j].temperature/maxTemperature)*(highTemp-lowTemp))+lowTemp;\r\n if(map[i][j].biome !== \"Ocean\"){\r\n var adjElevTemp = map[i][j].temperature-Math.round(((2*maxTempStep*(map[i][j].elevation-oceanLevel))/maxElevation)-maxTempStep);\r\n if(adjElevTemp<0){\r\n adjElevTemp = 0;\r\n }else if(adjElevTemp>maxTemperature){\r\n adjElevTemp = maxTemperature;\r\n }\r\n localTemp = Math.floor((adjElevTemp/maxTemperature)*(highTemp-lowTemp))+lowTemp;\r\n }\r\n var halfG = Math.floor(parseInt(ctx.fillStyle.substring(3,5), 16)/2);\r\n var averageB = Math.floor((1-localTemp/maxTemperature)*parseInt(ctx.fillStyle.substring(5), 16)+Math.floor(255*(1-localTemp/maxTemperature)));\r\n ctx.fillStyle = 'rgb('+Math.round(255*(localTemp/maxTemperature))+','+halfG+','+averageB+')';\r\n }\r\n ctx.fillRect(iOffset*cellSize, jOffset*cellSize, cellSize, cellSize);\r\n\r\n //Draw Vegetation\r\n if(map[i][j].vegetation){\r\n ctx.fillStyle = 'rgba('+map[i][j].vegetation.color+',0.65)';\r\n var vegSize = (0.1*cellSize) + cellSize * 0.65 * (map[i][j].vegetation.maturity/100);\r\n ctx.fillRect(iOffset*cellSize+(cellSize-vegSize)/2, jOffset*cellSize+(cellSize-vegSize)/2, vegSize, vegSize);\r\n }\r\n }\r\n if(vegChanged && map[i][j].vegetation){\r\n //Draw Vegetation\r\n ctx.fillStyle = 'rgba('+map[i][j].vegetation.color+',0.65)';\r\n var vegSize = (0.1*cellSize) + cellSize * 0.65 * (map[i][j].vegetation.maturity/100);\r\n ctx.fillRect(iOffset*cellSize+(cellSize-vegSize)/2, jOffset*cellSize+(cellSize-vegSize)/2, vegSize, vegSize);\r\n }\r\n }\r\n }\r\n viewChanged = false;\r\n mapChanged = false;\r\n vegChanged = false;\r\n currentTurn = false;\r\n requestAnimationFrame(update);\r\n}", "title": "" }, { "docid": "439f308bb0de3ab81428a5ef565d10b1", "score": "0.6603561", "text": "updateGame(time) {\n\t\t\t\n\t\t\tif ( gameObject.state.wasPaused ) {\n\t\t\t\tgameObject.state.wasPaused = false;\n\t\t\t\tgameObject.time.currentTime = time;\n\t\t\t}\n\n\t\t\t// Updating time values\n\n\n\t\t\tgameObject.time.pastTime = gameObject.time.currentTime;\n\t\t\tgameObject.time.currentTime = time;\n\t\t\tgameObject.time.delta =\n\t\t\tgameObject.time.currentTime - gameObject.time.pastTime;\n\t\t\tgameObject.time.deltaRate = gameObject.time.delta / 16;\n\n\t\t\t// Checking screens to behave accordingly\n\n\t\t\t// Switch hack better than 1000's of if-else-if, don't you think ?\n\n\t\t\tswitch( true ) {\n\n\t\t\t\tcase gameObject.screen.onLoadingScreen:\n\n\t\t\t\t\tif ( gameObject.loader.loaded ) {\n\t\t\t\t\t\tgameObject.audio.playSound(\n\t\t\t\t\t\t\tgameObject.media.gameTracks[3], true, true\n\t\t\t\t\t\t);\n\t\t\t\t\t\tgameObject.screen.changeScreen( 'onIntroScreen' );\n\t\t\t\t\t}\n\t\t\t\t\telse if ( !gameObject.loader.loading ) {\n\t\t\t\t\t\tgameObject.loader.loading = true;\n\t\t\t\t\t\tgameObject.loader.load();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\n\t\t\t\t\t\t// Draw loading screen\n\n\t\t\t\t\t\tgameObject.graphics.clear();\n\t\t\t\t\t\tgameObject.graphics.drawBackground();\n\t\t\t\t\t\tgameObject.graphics.drawLoadingScreen();\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase gameObject.screen.onIntroScreen:\n\n\t\t\t\t\tgameObject.interface.scrollText.move();\n\t\t\t\t\tgameObject.interface.scrollText.update();\n\n\t\t\t\t\t// Drawing scrolling text\n\n\t\t\t\t\tgameObject.graphics.clear();\n\t\t\t\t\tgameObject.graphics.drawBackground();\n\t\t\t\t\tgameObject.graphics.drawScrollText();\n\n\t\t\t\t\tif ( gameObject.interface.scrollText.finished ) {\n\n\t\t\t\t\t\t// Reseting properties for ending\n\n\t\t\t\t\t\tgameObject.interface.scrollText.reset();\n\t\t\t\t\t\tgameObject.screen.changeScreen( 'onTitleScreen' );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase gameObject.screen.onTitleScreen:\n\n\t\t\t\t\tgameObject.interface.title.update();\n\t\t\t\t\tgameObject.graphics.clear();\n\t\t\t\t\tgameObject.graphics.drawBackground();\n\t\t\t\t\tgameObject.graphics.drawTitle();\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase gameObject.screen.onCreditScreen ||\n\t\t\t\t\t\t gameObject.screen.onHowToScreen ||\n\t\t\t\t\t\t gameObject.screen.onOptionScreen:\n\n\t\t\t\t gameObject.interface.backBtn.update();\n\t\t\t\t\tgameObject.graphics.clear();\n\t\t\t\t\tgameObject.graphics.drawBackground();\n\n\t\t\t\t\tif ( gameObject.screen.onCreditScreen ) {\n\t\t\t\t\t\tgameObject.graphics.drawCredits();\n\t\t\t\t\t}\n\t\t\t\t\telse if ( gameObject.screen.onHowToScreen ) {\n\t\t\t\t\t\tgameObject.graphics.drawHowTo();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tgameObject.interface.options.update();\n\t\t\t\t\t\tgameObject.graphics.drawOptions();\n\t\t\t\t\t}\n\n\t\t\t\t\tgameObject.graphics.drawBackBtn();\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase gameObject.screen.onPlayingScreen:\n\n\t\t\t\t\t/* We won't handle everything about the game here for code\n\t\t\t\t\t * readability and maintenance purposes. Instead for most tasks \n\t\t\t\t\t * we'll call specific components' methods if some condition is met.\n\t\t\t\t\t */\n\n\t\t\t\t\tif ( !gameObject.state.started &&\n\t\t\t\t\t !gameObject.state.inTransition ) {\n\t\t\t\t\t\tgameObject.state.inTransition = true;\n\t\t\t\t\t\tgameObject.audio.changeTrack(\n\t\t\t\t\t\t\tgameObject.media.gameTracks[4],\n\t\t\t\t\t\t\ttrue,\ttrue, false\n\t\t\t\t\t\t);\n\t\t\t\t\t\tshowSmallController();\t// For small viewports\n\t\t\t\t\t}\n\t\t\t\t\telse if ( gameObject.state.inTransition ) {\n\n\t\t\t\t\t\tif ( gameObject.audio.transitionFinished &&\n\t\t\t\t\t\t gameObject.screen.transitionReady ) {\n\t\t\t\t\t\t\tgameObject.audio.transitionFinished = false;\n\t\t\t\t\t\t\tgameObject.state.inTransition = false;\n\t\t\t\t\t\t\tgameObject.state.started = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tgameObject.screen.transitionScreen();\n\n\t\t\t\t\t}\n\n\t\t\t\t\t// Game Started\n\n\t\t\t\t\telse if ( gameObject.state.started &&\n\t\t\t\t\t\t\t\t\t\t!gameObject.state.gameOver.started ) {\n\n\t\t\t\t\t\t// Changing states based on game progression\n\n\t\t\t\t\t\tif ( !gameObject.state.level1.started ) {\n\t\t\t\t\t\t\tgameObject.state.level1.started = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Registering victory in level 1\n\t\t\t\t\t\telse if ( gameObject.state.level1.bossFinished &&\n\t\t\t\t\t\t\t\t\t\t\t!gameObject.state.level1.inVictory &&\n\t\t\t\t\t\t\t\t\t\t\tgameObject.audio.transitionFinished )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tgameObject.state.level1.inVictory = true;\n\t\t\t\t\t\t\tgameObject.state.victory.intervalReferenceTime =\n\t\t\t\t\t\t\tgameObject.time.currentTime;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Registering victory in level 2\n\t\t\t\t\t\telse if ( gameObject.state.level2.bossFinished &&\n\t\t\t\t\t\t\t\t\t\t\t!gameObject.state.level2.inVictory &&\n\t\t\t\t\t\t\t\t\t\t\tgameObject.audio.transitionFinished )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tgameObject.state.level2.inVictory = true;\n\t\t\t\t\t\t\tgameObject.state.victory.intervalReferenceTime =\n\t\t\t\t\t\t\tgameObject.time.currentTime;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Performing actions\n\n\t\t\t\t\t\tgameObject.components.update();\n\t\t\t\t\t\tgameObject.components.moveAll();\n\t\t\t\t\t\tgameObject.components.checkAll();\n\n\t\t\t\t\t\t// Drawing\n\n\t\t\t\t\t\tgameObject.graphics.clear();\n\t\t\t\t\t\tgameObject.graphics.drawBackground();\n\t\t\t\t\t\tgameObject.graphics.drawPowerUps();\n\t\t\t\t\t\tgameObject.graphics.drawShots();\n\t\t\t\t\t\tgameObject.graphics.drawPlayer();\n\t\t\t\t\t\tgameObject.graphics.drawEnemies();\n\t\t\t\t\t\tgameObject.graphics.drawInfo();\n\n\t\t\t\t\t\t/* These will be level transitions that will mainly provide\n\t\t\t\t\t\t * a room for the background or screen to change\n\t\t\t\t\t\t */\n\n\t\t\t\t\t\t// Level 1 transition\n\n\t\t\t\t\t\tif (\tgameObject.state.level1.inVictory &&\n\t\t\t\t\t\t\t\t\t!gameObject.state.level2.started &&\n\t\t\t\t\t\t\t\t\tgameObject.time.currentTime -\n\t\t\t\t\t\t\t\t\tgameObject.state.victory.intervalReferenceTime >\n\t\t\t\t\t\t\t\t\tgameObject.state.victory.intervalTime )\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\tgameObject.screen.transitionScreen();\n\n\t\t\t\t\t\t\tif ( gameObject.screen.transitionReady &&\n\t\t\t\t\t\t\t\t\t !gameObject.state.level1.finished ) {\n\n\t\t\t\t\t\t\t\tgameObject.state.level1.finished = true;\n\t\t\t\t\t\t\t\tgameObject.audio.changeTrack(\n\t\t\t\t\t\t\t\t\tgameObject.media.gameTracks[5],\n\t\t\t\t\t\t\t\t\ttrue, true, false\n\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if ( gameObject.screen.transitionFinished ) {\n\n\t\t\t\t\t\t\t\tgameObject.state.level2.started = true;\n\n\t\t\t\t\t\t\t\t// Reseting transition properties\n\n\t\t\t\t\t\t\t\tgameObject.screen.transitionScreen();\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* Level 2 transition. If there were more levels, this would\n\t\t\t\t\t\t * be almost the same as level 1 conditionals. We could even\n\t\t\t\t\t\t * write a general check for all of these, but the goal here\n\t\t\t\t\t\t * is just to provide a base structure\n\t\t\t\t\t\t */\n\n\n\t\t\t\t\t\telse if ( gameObject.state.level2.inVictory &&\n\t\t\t\t\t\t\t\t\t !gameObject.state.level2.finished &&\n\t\t\t\t\t\t\t\t\t gameObject.time.currentTime -\n\t\t\t\t\t\t\t\t\t\t\tgameObject.state.victory.intervalReferenceTime >\n\t\t\t\t\t\t\t\t\t\t\tgameObject.state.victory.intervalTime )\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\tgameObject.screen.transitionScreen();\n\n\t\t\t\t\t\t\tif ( gameObject.screen.transitionReady ) {\n\n\t\t\t\t\t\t\t\tgameObject.state.level2.finished = true;\n\t\t\t\t\t\t\t\tgameObject.audio.changeTrack(\n\t\t\t\t\t\t\t\t\tgameObject.media.gameTracks[5],\n\t\t\t\t\t\t\t\t\ttrue, true, false\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tgameObject.screen.changeScreen( 'onEndingScreen' );\n\t\t\t\t\t\t\t\thideSmallController();\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Handling end of start and eventual game over transitions\n\n\t\t\t\t\t\t// This will be at last as it needs to be drawn over everything\n\n\t\t\t\t\t\tif ( gameObject.screen.transitionStarted &&\n\t\t\t\t\t\t !gameObject.screen.transitionFinished &&\n\t\t\t\t\t\t !gameObject.state.gameOver.inTransition &&\n\t\t\t\t\t\t !gameObject.state.gameOver.started ) {\n\n\t\t\t\t\t\t\tgameObject.screen.transitionScreen();\n\n\t\t\t\t\t\t\t// To restart properties, in case we need more transitions\n\n\t\t\t\t\t\t\tif ( gameObject.screen.transitionFinished ) {\n\t\t\t\t\t\t\t\tgameObject.screen.transitionScreen();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ( gameObject.state.gameOver.inTransition &&\n\t\t\t\t\t\t\t\t\t\t\t!gameObject.screen.transitionReady ) {\n\n\t\t\t\t\t\t\tgameObject.screen.transitionScreen();\n\n\t\t\t\t\t\t\tif ( gameObject.screen.transitionReady ) {\n\t\t\t\t\t\t\t\tgameObject.audio.changeTrack(\n\t\t\t\t\t\t\t\t\tgameObject.media.gameTracks[0],\n\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\ttrue,\n\t\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tgameObject.state.gameOver.inTransition = false;\n\t\t\t\t\t\t\t\tgameObject.state.gameOver.started = true;\n\t\t\t\t\t\t\t\tgameObject.state.resetGame();\n\t\t\t\t\t\t\t\tgameObject.screen.changeScreen( 'onGameOverScreen' );\n\t\t\t\t\t\t\t\thideSmallController();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase gameObject.screen.onGameOverScreen:\n\n\t\t\t\t\t/* Audio will be loaded from the last conditional of playing\n\t\t\t\t\t * screen, so we can use it to activate the timer for game over\n\t\t\t\t\t * animation\n\t\t\t\t\t */\n\n\t\t\t\t\tif ( gameObject.audio.transitionFinished &&\n\t\t\t\t\t !gameObject.state.gameOver.audioLoaded ) {\n\t\t\t\t\t\tgameObject.audio.transitionFinished = false;\n\t\t\t\t\t\tgameObject.state.gameOver.audioLoaded = true;\n\t\t\t\t\t\tgameObject.state.gameOver.intervalReferenceTime =\n\t\t\t\t\t\tgameObject.time.currentTime;\n\t\t\t\t\t\tgameObject.graphics.clear();\n\t\t\t\t\t\tgameObject.graphics.drawGameOver(); // Else we get a flicker\n\t\t\t\t\t}\n\t\t\t\t\telse if ( gameObject.state.gameOver.audioLoaded &&\n\t\t\t\t\t\t\t\t\t\tgameObject.time.currentTime -\n\t\t\t\t\t\t\t\t\t\tgameObject.state.gameOver.intervalReferenceTime >=\n\t\t\t\t\t\t\t\t\t\tgameObject.state.gameOver.intervalTime) {\n\n\t\t\t\t\t\t// Changing to initial track\n\n\t\t\t\t\t\tif ( !gameObject.state.gameOver.finished ) {\n\t\t\t\t\t\t\tgameObject.state.gameOver.finished = true;\n\t\t\t\t\t\t\tgameObject.audio.changeTrack(\n\t\t\t\t\t\t\t\tgameObject.media.gameTracks[3],\n\t\t\t\t\t\t\t\ttrue, true, false\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ( gameObject.audio.transitionFinished ) {\n\t\t\t\t\t\t\t// Reseting audio state for future transitions\n\t\t\t\t\t\t\tgameObject.audio.transitionFinished = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Title background, not actually there yet\n\n\t\t\t\t\t\tgameObject.graphics.clear();\n\t\t\t\t\t\tgameObject.graphics.drawTitle();\n\t\t\t\t\t\tgameObject.screen.transitionScreen();\n\n\t\t\t\t\t\t/* If transitionScreen method has already reseted properties,\n\t\t\t\t\t\t * it's over\n\t\t\t\t\t\t */\n\n\t\t\t\t\t\tif ( !gameObject.screen.transitionStarted ) {\n\n\t\t\t\t\t\t\t// Reseting game over properties\n\n\t\t\t\t\t\t\tgameObject.state.gameOver.inTransition = false;\n\t\t\t\t\t\t\tgameObject.state.gameOver.started = false;\n\t\t\t\t\t\t\tgameObject.state.gameOver.finished = false;\n\t\t\t\t\t\t\tgameObject.state.gameOver.audioLoaded = false;\n\n\t\t\t\t\t\t\t// Back to title\n\n\t\t\t\t\t\t\tgameObject.screen.changeScreen( 'onTitleScreen' );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tgameObject.graphics.clear();\n\t\t\t\t\t\tgameObject.graphics.drawGameOver();\t\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t// Ending screen will show ending text and reset game\n\n\t\t\t\tcase gameObject.screen.onEndingScreen:\n\n\t\t\t\t\tgameObject.interface.scrollText.move();\n\t\t\t\t\tgameObject.interface.scrollText.update();\n\n\t\t\t\t\tgameObject.graphics.clear();\n\t\t\t\t\tgameObject.graphics.drawBackground();\n\t\t\t\t\tgameObject.graphics.drawScrollText();\n\n\t\t\t\t\tif ( gameObject.interface.scrollText.finished ) {\n\n\t\t\t\t\t\t// Transitioning screen back to title\n\n\t\t\t\t\t\tgameObject.graphics.drawTitle();\n\t\t\t\t\t\tgameObject.screen.transitionScreen();\n\n\t\t\t\t\t\tif ( gameObject.screen.transitionFinished ) {\n\n\t\t\t\t\t\t\t// Reseting screen states\n\n\t\t\t\t\t\t\tgameObject.screen.transitionScreen();\n\n\t\t\t\t\t\t\t// Reseting game and scrollText properties\n\n\t\t\t\t\t\t\tgameObject.state.resetGame();\n\t\t\t\t\t\t\tgameObject.interface.scrollText.reset();\n\n\t\t\t\t\t\t\t// Actually changing to title screen\n\n\t\t\t\t\t\t\tgameObject.screen.changeScreen( 'onTitleScreen' );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tgameObject.graphics.drawBackground();\n\n\t\t\t}\n\n\t\t\tgameObject.id = requestAnimationFrame( gameManager.updateGame );\n\n\t\t}", "title": "" }, { "docid": "ae4d932fba040dfd9a46122516837c6a", "score": "0.660344", "text": "function draw() {\r\n background(startbg);\r\n\r\n //conditions for GAMESTATE to change from 0 to 1 to 2\r\n if (playerCount === 4 && carsAtFinishLine < 4 ) {\r\n \r\n /*\r\n function call to change existing value of gameState to a \r\n new one based on the value of paramter passed in the database\r\n */\r\n gameObj.updateState(1);\r\n }\r\n\r\n if (gameState === 1) {\r\n clear();\r\n /*\r\n function call to activate the gameObj to START 1 mode and \r\n aligned all players to starting positions at the start line\r\n */\r\n gameObj.play();\r\n }\r\n\r\n if (carsAtFinishLine === 4) {\r\n console.log(\"carsAtFinishLine before updating GS to 2: \" + carsAtFinishLine);\r\n /*\r\n function call to change existing value of gameState to a \r\n new one based on the value of paramter passed in the database\r\n */\r\n gameObj.updateState(2);\r\n }\r\n\r\n if (gameState === 2) {\r\n /*\r\n function call to activate the gameObj to START 1 mode and \r\n aligned all players to starting positions at the start line\r\n */\r\n gameObj.end();\r\n }\r\n}", "title": "" }, { "docid": "17ff99e350838b3b9fae2bc608b0a379", "score": "0.6603098", "text": "function update() {\r\n\t\t\tupdateuserPos();\r\n\t\t\tfadeColours();\r\n\t\t}", "title": "" }, { "docid": "9b193e5cba7ddb2e5128c0e7971f5460", "score": "0.6586965", "text": "static update(){\n\t\tfor (var i = 0; i < gameObjs.length; i++){\n\t\t\tif (!gameObjs[i]._start_was_called || !gameObjs[i].canUpdate)\n\t\t\t\tcontinue;\n\t\t\tgameObjs[i].update();\t\n\t\t}\n\t}", "title": "" }, { "docid": "45da19792fa539fc3d1070bfb3a78456", "score": "0.65726095", "text": "function update() {\r\n movePaddle();\r\n moveBall();\r\n ballWallCollision();\r\n ballPaddleCollision();\r\n ballBrickCollision();\r\n levelUp();\r\n gameOver();\r\n // if(life == 0) { alert(\"Not Nice!\") };\r\n}", "title": "" }, { "docid": "10770d12e4637f7f52922356346b25e8", "score": "0.65719116", "text": "updateGame() {\n this.switches.update()\n this.maps.updateWorld()\n }", "title": "" }, { "docid": "9b7eb889116cd65c906869b72904d868", "score": "0.6566219", "text": "function newFrame() {\n if (pause == false) {\n redrawGameItem(player1);\n redrawGameItem(player2);\n\n checkWalls(player1);\n checkWalls(player2);\n\n checkSelf(player1, player2);\n checkSelf(player2, player1);\n }\n }", "title": "" }, { "docid": "02a0b02f944b86cd88e1aa25479153ef", "score": "0.65617913", "text": "function updateSimulation(du) { \n \n // No updates if the game hasn't started or it the game is over\n if (g_hasGameStarted && !g_isGameOver) {\n\n // Update balls\n for (var i = 0; i < g_ballsAlive; i++) {\n g_ball[i].update(du);\n }\n \n g_paddle.update(du);\n\n // update items\n for (var i = 0; i < g_itemCount; i++) {\n if (g_item[i].relevant) g_item[i].update(du);\n }\n\n // update bullets\n for (var i = 0; i < g_bulletsAlive; i++) {\n g_bullet[i].update(du);\n }\n }\n\n\n}", "title": "" }, { "docid": "2640bb973ac9952023b326c2f2a3fc1a", "score": "0.65599", "text": "function update () {\n\t\tGamePad.update();\n\t}", "title": "" }, { "docid": "814188664e5ec5fe5a958163d275159d", "score": "0.6558947", "text": "function update() {\n\n stats[0].update();\n\n // TODO -> update class lists etc..\n for(let g = 0; g < gui_list.length; g++){\n gui_list[g].update();\n }\n\n ground_list.forEach(function(element) {\n element.update();\n });\n\n\n ceiling_list.forEach(function(element) {\n element.update();\n });\n\n left_wall_list.forEach(function(element) {\n element.update();\n });\n\n right_wall_list.forEach(function(element) {\n element.update();\n });\n\n\n for(let g = 0; g < player_list.length; g++){\n player_list[g].update();\n }\n\n \n\n \n for(let g = 0; g < mob_list.length; g++){\n mob_list[g].update();\n }\n\n // only 1 stats so no loop\n\n \n\n\n // MARK: trigger render function call \n render();\n \n // IMPORTANT: Call MAX Frame Nano Time...----> Callback...\n window.requestAnimationFrame(update);\n\n// end of global update... \n}", "title": "" }, { "docid": "0d92fcf4edfa5d6a6316c6ee1f412295", "score": "0.6539542", "text": "function updateCanvas() {\r\n\trestartTimer++;\r\n\tif (gameOver()===true){\r\n\t\tlife--;\r\n\t\t// mrPacman.dieAnimation();\r\n\t\tshowLives();\r\n\t\tif (life>0){\r\n\t\t\tsleep(500);\r\n\t\t\tclearInterval(intervalId);\r\n\t\t\tfixGrids(mrPacman.x, mrPacman.y);\r\n\t\t\tfor(var i=0; i<ghosts.length; i++){\r\n\t\t\t\tfixGrids(ghosts[i].x, ghosts[i].y);\r\n\t\t\t}\r\n\t\t\trun();\r\n\t\t}\r\n\t\telse {\r\n\t\t\tclearInterval(intervalId);\r\n\t\t\tsleep(500);\r\n\t\t\tloseMessage();\r\n\t\t}\r\n\r\n\t}\r\n\telse if (pacmanWon()===true){\r\n\t\tclearInterval(intervalId);\r\n\t\tsleep(500);\r\n\t\twinMessage();\r\n\t}\r\n\telse{\r\n\t\tif(weakCounter>0 && weakCounter<2000/timerDelay){\r\n\t\t\tfor(var i=0; i<ghosts.length; i++){\r\n\t\t\t\tghosts[i].isBlinking = !ghosts[i].isBlinking;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(weakCounter>0){\r\n\t\t\tweakCounter--;\r\n\t\t}\r\n\t\tif(weakCounter===0){\r\n\t\t\tfor(var i=0; i<ghosts.length; i++){\r\n\t\t\t\tghosts[i].isDead = false;\r\n\t\t\t\tghosts[i].isWeak = false;\r\n\t\t\t\tghosts[i.isBlinking = false];\r\n\t\t\t\tweakBonus= 200;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\teatBean();\r\n\t\teatGhost();\r\n\t\tmrPacman.move();\r\n\r\n\t\tfor(var i=0; i<ghosts.length; i++){\r\n\t\t\tif(ghosts[i].isDead === false){\r\n\t\t\t\tghosts[i].move();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t \tfixGrids(mrPacman.x, mrPacman.y);\r\n\t \tfor(var i=0; i<ghosts.length; i++){\r\n\t\t\tfixGrids(ghosts[i].x, ghosts[i].y);\r\n\t\t}\r\n\r\n\t mrPacman.draw();\r\n\t for(var i=0; i<ghosts.length; i++){\r\n\t\t\tghosts[i].draw();\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "2039eb837fd001949e6d03dde77393ba", "score": "0.65394765", "text": "function Update() { \r\n\r\n //Pintar fondo\r\n DrawBackground(); \r\n\r\n //Comprobar si hay game over \r\n if (player_1.dead) {\r\n game_over = true;\r\n localStorage.setItem(\"win\", 0);\r\n window.location.href = \"game_over.html\"; //carga pantalla game over\r\n return;\r\n } \r\n //Si no, comprobar si se ha vencido al enemigo\r\n else if (enemy_2.dead) {\r\n the_end = true;\r\n SaveScore(); //calcular y guardar puntuaciones\r\n window.location.href = \"level3_m.html\"; //cargar siguiente nivel\r\n return;\r\n }\r\n\r\n //Antes de dibujar, calculamos el z-index (carril) de los jugadores\r\n player_1.zindex = player_carril_n(player_1);\r\n \r\n //Dibujar personajes, balas y ui\r\n DrawChars();\r\n DrawBullets();\r\n ShowLife();\r\n\r\n //Colisiones\r\n CheckCollisions(player_1, enemy_2); //colisiones del enemigo con las balas del jugador 1\r\n CheckCollisions(enemy_2, player_1); //colisiones del jugador 1 con las balas del enemigo\r\n \r\n }", "title": "" }, { "docid": "05b343b830ce8cb43519e624e191a367", "score": "0.6535818", "text": "function draw() {\n //if its gameover show the background for gameover. If win is true, show the win background. If the game hasent started, show the intro.\n if (showGameOver === true) {\n image(gameOverBackground, 0, 0, windowWidth, windowHeight);\n } else if (showGameWin === true) {\n image(winningBackground, 0, 0, windowWidth, windowHeight);\n } else if (gameStart === false) {\n introScreen(); //main screen\n } else {\n //setting the background to a dark night grass background\n image(backgroundNight, 0, 0, windowWidth, windowHeight); // display background\n\n //check gameOver (if its game over or not)\n checkGameOver();\n checkIfWon();\n CourageBar();\n PowerBar();\n timeCounter();\n hintsFound();\n\n //item pie replenish the courage gauge\n itemPie.RaiseCourage(couragePlayer);\n //item poison that kills you instantly\n itemPoison.DropCourage(couragePlayer);\n //handleInput, display and move for courage\n couragePlayer.move();\n couragePlayer.display();\n couragePlayer.handleInput();\n\n //Display and Eats the pie or poison // constrain items to screen\n itemPie.constrainToScreen();\n itemPie.display();\n itemPoison.constrainToScreen();\n itemPoison.display();\n\n //for loop Arrays for the Monsters'move, display\n for (let i = 0; i < badMonsters.length; i++) {\n badMonsters[i].move();\n badMonsters[i].display();\n //Once the special skill has been activated, Courage will be able to shoot the monsters\n couragePlayer.updateBullets(badMonsters[i]);\n }\n\n //Arrays for the clues. The clues will move and display. Courage will be able to collect clues and have \"the clues found\" score updated at the top.\n for (let i = 0; i < cluesFind.length; i++) {\n if (cluesFind[i].isAlive === true) {\n cluesFind[i].move();\n cluesFind[i].display();\n couragePlayer.handleEatingClue(cluesFind[i]);\n }\n }\n }\n}", "title": "" }, { "docid": "65babe303b8deca061e172223bed0d18", "score": "0.6534052", "text": "function updateGameState () {\n if (userChar.health <= 0) {\n losses++;\n displayGameState();\n $(\"#battleground\").text(\"You suck\");\n loseGame();\n } else if (defender.health <= 0) {\n wins++;\n $(defender.elementName).hide();\n $(\"#user-pick-one\").append($(defender.elementName));\n defSlotfilled = false;\n displayGameState();\n $(\"#battleground\").text(\"You have won, but how about the next....\");\n }\n if (userChar.health >= 0 && wins === 3) {\n displayGameState();\n $(\"#battleground\").text(\"You have whooped ass\");\n }\n}", "title": "" }, { "docid": "08c084a143352838ed058721240a7ae9", "score": "0.65249145", "text": "function updateUnrealizedGains(){\n\n}", "title": "" }, { "docid": "d1828aae0cd51984a072acfde5b0af20", "score": "0.6519182", "text": "update() {\r\n\r\n }", "title": "" }, { "docid": "d1828aae0cd51984a072acfde5b0af20", "score": "0.6519182", "text": "update() {\r\n\r\n }", "title": "" }, { "docid": "d1828aae0cd51984a072acfde5b0af20", "score": "0.6519182", "text": "update() {\r\n\r\n }", "title": "" }, { "docid": "da3085c9bb3482ac860e5e6fb5689ae6", "score": "0.6516536", "text": "function updateInterface() {\n updateCornerColour();\n updateComputerSelection();\n updateScore();\n updateRoundMessage();\n}", "title": "" }, { "docid": "6886571d71c2e18ec3b06acfa13ee824", "score": "0.6494005", "text": "function update(){\n //Update text bars\n updateStats();\n\n //Update the buttons\n let player = null;\n for (p in players) { //Retreive player data -- read only necessary\n if(players[p].isActive){ player = players[p]; }\n }\n\n for (obj in objects){\n if(objects[obj].type === \"button\" && playerturn){\n if ((!player.hand[turnhand].standDeck('check') &&\n ((obj === \"Hit Button\" && player.hand[turnhand].getValue() < 21) ||\n (obj === \"Split Button\" && player.checksplit(turnhand)) ||\n (obj === \"DD Button\" && player.placebet(player.bet, true) && player.hand[turnhand].doubledUp() && player.hand[turnhand].getValue() < 21) ||\n ( !player.hasSplit && (\n (obj === \"B+1 Button\" && player.placebet(1, true) && player.hand[turnhand].deck.length == 2) ||\n (obj === \"B-1 Button\" && player.placebet(-1, true) && player.hand[turnhand].deck.length == 2) ||\n (obj === \"B+10 Button\" && player.placebet(10, true) && player.hand[turnhand].deck.length == 2) ||\n (obj === \"B-10 Button\" && player.placebet(-10, true) && player.hand[turnhand].deck.length == 2))))\n ) || (obj === \"Stand Button\"))\n { \n objects[obj].active = true;\n }\n else {\n objects[obj].active = false;\n }\n }\n else {\n objects[obj].active = false;\n }\n }\n\n //Update the out-of canvas elements\n let time = document.getElementById(\"time\");\n let sco = document.getElementById(\"score\");\n if(gameon){\n runGame();\n time.textContent = (parseInt(time.textContent) + 1).toString();\n for (p in players) {\n if(players[p].isActive){\n sco.textContent = (players[p].money + players[p].wins).toString();\n }\n }\n }\n else{\n time.textContent = 0;\n sco.textContent = 0;\n }\n}", "title": "" }, { "docid": "c5748ce9e59bc70c61a28c8cd642b81c", "score": "0.64925236", "text": "function update() {\n\n //if the game is not over or paused, run the game.\n if(!game_controller.game_paused && !game_controller.game_over) {\n //draw old images back on the canvas, but gradually lower their alphas\n //creates a fading effect. Source: http://rectangleworld.com/blog/archives/214\n var last_image = main_ctx.getImageData(0,0,canvas_w,canvas_h);\n var i;\n var pixel_data = last_image.data;\n var len = pixel_data.length;\n for (i = 3; i < len; i += 4) {\n //change alpha\n pixel_data[i] -= 1.5;\n }\n\n //allow the missile controller to fire missiles at random intervals.\n //TODO: replace this with a better system. Make the missiles fire more frequently\n // as difficulty increases. \n var fire = Math.floor(Math.random() * 100);\n\n if(fire == 0) {\n if(game_controller.missiles_fired != game_controller.missiles_to_fire) {\n missile_controller.launch();\n \n game_controller.missiles_fired++;\n game_controller.missiles_active++;\n } \n }\n\n main_ctx.putImageData(last_image,0,0);\n\n //draw the turret text, and draw all of the active missiles in the turret's arsenals.\n turret1.draw(); \n turret1.drawMissiles();\n turret2.draw(); \n turret2.drawMissiles();\n\n //draw all active enemy missiles and explosions.\n missile_controller.drawMissiles();\n explosion_controller.drawExplosions();\n }\n //always allow the game_controller to run, whether or not the game is paused/over.\n game_controller.step();\n}", "title": "" }, { "docid": "9bdc0efd423c86d90d054d8473b0a0bd", "score": "0.6483817", "text": "function init() {\n // document.oncontextmenu = function() {return false;} //disable the right click context menu.\n \n gGame.isGameOver = false;\n gGame.isGameOn = false;\n\n gGame.flagedBombsCount = 0;\n gGame.markedCellsCount = 0;\n gGame.bombedCellsCount = 0;\n gGame.amountOfBombs = 0;\n gGame.safeClickCount = 3;\n gGame.areaHintCount = 3;\n\n gGame.health = LEVELS[gGame.levelIdx].health;\n gGame.isFirstClick = true;\n gGame.isAreaHint = false;\n gGame.isManualMinePosMod = false;\n gGame.isManualPosOn = false;\n\n gTimeParts.miliSec = 0;\n gTimeParts.sec = 0;\n gTimeParts.min = 0;\n gTimeParts.milSecStr = '00';\n gTimeParts.secondsStr= '00';\n gTimeParts.minutesStr = '00';\n \n clearInterval(gGame.timerInterval);\n gGame.timerInterval = null;\n\n gGame.bestTime = (localStorage.getItem(gGame.level+'BestTime'))? gGame.bestTime : Infinity;\n\n gGame.board = creatBoard(gGame.boardSize);\n renderBoard(gGame.board);\n renderHealth();\n\n document.querySelector('.game-container .game-statuse').innerText = GAME_ON;\n document.querySelector('.game-container .hint-buttons .safe-button span').innerText = gGame.safeClickCount;\n document.querySelector('.game-container .hint-buttons .hint-area-button span').innerText = gGame.areaHintCount;\n document.querySelector('.game-container .high-score h3 span').innerText = (gGame.bestTimeStr)? gGame.bestTimeStr : 'There is no best time..';\n document.querySelector('.game-container .stopwatch span').innerText = '00:00:00';\n\n gPrevStates = [];\n gCurrStateIdx = -1;\n gGame.playCount = 0;\n setNewState();\n}", "title": "" }, { "docid": "5fee0a11a130a663a8f5f30332c9838e", "score": "0.6483177", "text": "update() {\r\n this.moving();\r\n this.return();\r\n this.draw();\r\n }", "title": "" }, { "docid": "b4fefc567df174e2fd85d47453d28c3a", "score": "0.64788085", "text": "function update() {\n\tframes++;\n\n\tif (currentstate !== states.Score) {\n\t\tfgpos = (fgpos - 2) % 14;\n\t} else {\n\t\t// set best score to maximum score\n\t\tbest = Math.max(best, score);\n\t\tlocalStorage.setItem(\"best\", best);\n\t}\n\tif (currentstate === states.Game) {\n\t\tpipes.update();\n\t}\n\n\tbird.update();\n}", "title": "" }, { "docid": "1c52952b774391337cf1822035279b8f", "score": "0.6475744", "text": "function update(){\n g.update();\n g.updateMovement();\n startNextScreenIfAny();\n}", "title": "" }, { "docid": "3bab67f5080699aa6483e349918b7b5a", "score": "0.6473021", "text": "update() {\n this.moving();\n this.return();\n this.draw();\n }", "title": "" }, { "docid": "e507f826ac23b5d08834e33ef7a83f63", "score": "0.64710474", "text": "function refresh() {\n\t\tif (!xd && !yd) return;\n\t\tpastHead = { ...head };\n\t\thx += xd;\n\t\thy += yd;\n\t\trunTests();\n\t\thead = { x: hx, y: hy };\n\t\tupdateUnique(head);\n\n\t\t// creates tail on first game move\n\t\tif (trail.length < 1) {\n\t\t\ttrail.push(pastHead);\n\t\t\tupdateUnique(pastHead);\n\t\t}\n\n\t\tupdateSnake();\n\t\tpaintCanvas();\n\t\tpaintRocks();\n\t\tpaintFruits();\n\t\tpaintTrail();\n\t\tpaintHead();\n\t\t$(\"#score\").html(getScore()); // prints updated score (body - defaulted count of 1)\n\t\tcycleActive = false;\n\t}", "title": "" }, { "docid": "539c6f0ae6ecae3512561274cc9f21a4", "score": "0.64700353", "text": "function update () {\n // Update positions for background, shots and buggers if necessary\n\n //Limpiar el canvas para que no deje estela cuando se mueve\n canvas.width = canvas.width;\n buffer.width = buffer.width;\n\n background.scroll();\n shotsGroup.updateShots();\n buggersGroup.updateBuggers();\n player.render();\n particleManager.draw();\n printHUD();\n\n listenGameActionEvents();\n draw();\n }", "title": "" }, { "docid": "55e1c27c10643b66a8e1eb01981fb184", "score": "0.646495", "text": "function update() {\n\tupdateEverything();\t\n}", "title": "" }, { "docid": "93bc98c3f98f44378c3ee8e0e63b19e5", "score": "0.6448246", "text": "function draw() {\n//background(0);\n// the main screen\nif (state === 'title') {\n title();\n}\n// the first level simulation\nelse if (state === 'simulation'){\n simulation();\n}\n// the loose screen\nelse if (state === 'lose'){\n lose();\n}\n// the screen that appears when\nelse if (state === 'neptuneWin') {\n neptuneWin();\n}\n\n// this is the simulation that runs teh secound level\nelse if (state === 'simulation2') {\n simulation2();\n}\n\n//this is screen that pops up when you reach the next level\nelse if (state === 'marsWin') {\n marsWin();\n}\n\n// this is the simulation that displays the third level\nelse if (state === 'simulation3'){\nsimulation3();\n}\n\n// this is the state that shows up when you reaxch the final level\nelse if (state === 'earthWin'){\n earthWin();\n}\n}", "title": "" }, { "docid": "e8566ec2d5a7bdb0a7cd7b7966b67a83", "score": "0.64394945", "text": "function update() {\n frames++;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n board.draw();\n coche1.draw();\n\n //si es 2do turno dibuja al coche2\n if (personaje2 === true) {\n coche2.draw();\n }\n\n\n //score\n coolness1.draw();\n coolness2.draw();\n\n //objetos\n generateObjects();\n drawObjects();\n generateMemphisObject();\n drawMemphisObjects();\n\n //checa funciones\n checkCollision();\n checkCollisionMemphis();\n checkCollision2();\n checkCollisionMemphis2();\n checkJumping();\n}", "title": "" }, { "docid": "235659609c96c518653e6b18bae1d0a1", "score": "0.64303166", "text": "update() {\r\n\r\n }", "title": "" }, { "docid": "235659609c96c518653e6b18bae1d0a1", "score": "0.64303166", "text": "update() {\r\n\r\n }", "title": "" }, { "docid": "707f009209f083c88a751a689fffce34", "score": "0.64245725", "text": "function updateDisplays(){\n\t //update turn\n\t document.getElementById(\"turnDisplay\").innerHTML = turn;\n\t //update hand items\n\t if (ship) {\n\t \tdocument.getElementById(\"handDisplay\").innerHTML = \"Ship\";\n\t }\n\t if (captain) {\n\t \tdocument.getElementById(\"handDisplay\").innerHTML = \"Ship, Captian\";\n\t }\n\t if (crew) {\n\t \tdocument.getElementById(\"handDisplay\").innerHTML = \"Ship, Captian, Crew\";\n\t }\n\t //update score\n\t if (score !== 0) {\n\t \tdocument.getElementById(\"scoreDisplay\").innerHTML = \"with a score of \"+score;\n\t }\n\t}", "title": "" }, { "docid": "3290799dbd04ef9e91a57e420366573f", "score": "0.6421967", "text": "function update() {\n //Start the animation loop\n sg.animationID = requestAnimationFrame(update);\n\n //Switch based on client state\n //Note that these screens really should each have their own module. I did them all in the game module to save on time\n switch (sg.clientState) {\n //If assets are still loading\n case se.LOADING:\n //Show the loading screen\n updateLoading();\n return;\n //If viewing tutorial\n case se.TUTORIAL_SCREEN:\n //Display tutorial\n updateTutorial();\n return;\n //If on the start screen\n case se.START_SCREEN:\n //Show start screen\n updateStartScreen();\n return;\n //If connecting\n case se.CONNECTING:\n //Show connecting screen\n updateConnecting();\n return;\n //The default. Update as normal\n case se.PLAYING:\n break;\n }\n\n //Play background music if it isn't already playing and if the game isn't over\n if (!s.audio.sounds[\"backgroundMusic.mp3\"].playing && sg.gameState != s.e.GAME_OVER) {\n s.audio.sounds[\"backgroundMusic.mp3\"].start();\n s.audio.sounds[\"backgroundMusic.mp3\"].gain.gain.value = s.e.MUSIC_VOLUME;\n }\n //Create a particle emitter if it doesn't already exist\n if (!sg.attackerEmitter) {\n sg.attackerEmitter = new a.particle.Emitter(new Victor(sg.gu, sg.gu), new Victor(0.0, 0.1));\n }\n\n //Update all client-side modules\n a.time.update();\n a.physics.update();\n a.playerUpdates.update();\n a.audio.update();\n a.scoring.update();\n\n //Store the drawing context shorthand\n let c = a.ctx;\n //Re-draw the background\n c.fillStyle = \"white\";\n c.fillRect(0, 0, a.viewport.width, a.viewport.height);\n\n //Draw everything in the image module (tiles and backgrounds)\n a.image.draw();\n\n //Update the attacker's emitter\n sg.attackerEmitter.update();\n\n //Draw all players\n for (const p in sg.players) {\n //Get and update the player\n let player = sg.players[p];\n player.update();\n\n //Get the player sprite to draw\n let playerSprite = \"p1\";\n //Get relative position of the player in the view\n let relativePos = sv.active.getObjectRelativePosition(player.gameObject, true);\n\n //Move the particle emitter to the attacking player\n if (sg.players[p].attacking) {\n sg.attackerEmitter.pos = sg.players[p].gameObject.pos.clone();\n sg.attackerEmitter.pos.x += sg.players[p].gameObject.width / 2;\n sg.attackerEmitter.pos.y += sg.players[p].gameObject.height / 2;\n //Draw as the attacking player\n playerSprite = \"p2\";\n }\n\n //Select which sprite to draw based on player movement state\n //Jumping and falling sprites\n if (player.gameObject.drop) {\n if (player.gameObject.vel.x >= 0) {\n playerSprite += \"DropRight\";\n } else {\n playerSprite += \"DropLeft\";\n }\n } else if (player.gameObject.vel.y < 0) {\n if (player.gameObject.vel.x >= 0) {\n playerSprite += \"JumpRight\";\n } else {\n playerSprite += \"JumpLeft\";\n }\n //Not moving vertically\n } else {\n if (player.gameObject.vel.x > 0) {\n playerSprite += \"RightWalk\";\n } else if (player.gameObject.vel.x < 0) {\n playerSprite += \"LeftWalk\";\n } else {\n playerSprite += \"Stand\";\n }\n }\n //Draw the player sprite (automatically animates based on delta time)\n si.sprites[playerSprite].draw(c, relativePos.x, relativePos.y, player.gameObject.width * sg.gu, player.gameObject.height * sg.gu);\n }\n\n //Make the view follow the client player\n if (sg.players[sg.clientID] != undefined) {\n sv.active.follow(sg.players[sg.clientID].gameObject.center().clone().multiplyScalar(sg.gu));\n }\n\n //Draw GUI\n drawGUI();\n\n //If the game is paused, draw the pause pause screen\n if (sg.clientState == se.PAUSED) {\n updatePaused();\n }\n }", "title": "" }, { "docid": "45ad4486edbade8bdd6aa9bbcac4352e", "score": "0.64130324", "text": "update() {\n if (this._physics && this._physics.update) {\n this._physics.update();\n }\n\n if (this._graphics && this._graphics.update) {\n this._graphics.update();\n }\n }", "title": "" }, { "docid": "7d75b8f636c2aec2c5ca298f44e35599", "score": "0.6402335", "text": "update(){ }", "title": "" }, { "docid": "6b96c6bdfafa9c6785875aab6c250a84", "score": "0.64019376", "text": "function draw() {\n switch (gameState){\n case GameStates.Running:{\n for (var i = 0; i < bground.length; ++i) {\n bground[i].show();\n bground[i].update();\n }\n if (bground[0].needsNew()) {\n bground.push(new Background(width));\n bground.splice(0, 1);\n }\n\n for (var i = 0; i < fground.length; ++i) {\n fground[i].show();\n fground[i].update();\n }\n\n if (fground[0].needsNew()) {\n fground.push(new Foreground(width));\n fground.splice(0, 1);\n }\n player.update();\n player.show();\n noStroke();\n fill(0);\n textSize(20);\n // text(\"Time:\" + stopwatch.getElapsedTime(), width / 2, height / 2);\n text(\"Score: \" + score, width * .8, height *.1);\n break;\n }\n case GameStates.Over:{\n // gameover stuff here\n textAlign(CENTER, CENTER);\n stroke(0);\n fill(230,100,100);\n textSize(20);\n text(\"GAME OVER\", width / 2, height / 2);\n document.getElementById(\"gameMusic\").pause();\n var button = document.getElementById(\"menuButton\");\n button.style.visibility = \"visible\";\n var highScore = document.getElementById(\"scoresButton\");\n highScore.style.visibility = 'visible';\n // highScore.innerHTML = highscores;\n break;\n }\n case GameStates.Menu:{\n window.location.href = \"./index.html\"; \n break;\n }\n default:\n break;\n }\n}", "title": "" }, { "docid": "4e642e716c4c6d70fbc4dc9af04b0fcc", "score": "0.6399419", "text": "update() {\n // Validate the settings\n this.width = Math.max(3, this.width);\n this.height = Math.max(3, this.height);\n this.k = Math.max(3, Math.min(this.k, Math.max(this.width, this.height)));\n\n fireUpdateGame({\n width: this.width,\n height: this.height,\n k: this.k\n });\n }", "title": "" }, { "docid": "c03d4b2f42a9615af40ff9587092b622", "score": "0.6397353", "text": "function refreshGame(){\n\t\t//update HDashes\n\t\tfor(var y = 0; y < HDashes.length; y++){\n\t\t\tfor(x = 0; x < HDashes[y].length; x++){\n\t\t\t\tif(HDashes[y][x] == 0)\n\t\t\t\t\t$('#even-x_'+x+'-y_'+y).css('background-color','#222');\n\t\t\t\tif(HDashes[y][x] == 1)\n\t\t\t\t\t$('#even-x_'+x+'-y_'+y).css('background-color','blue');\n\t\t\t\tif(HDashes[y][x] == 2)\n\t\t\t\t\t$('#even-x_'+x+'-y_'+y).css('background-color','#FFF');\n\t\t\t}\n\t\t}\n\t\t//update VDashes\n\t\tfor(var y = 0; y < VDashes.length; y++){\n\t\t\tfor(x = 0; x < VDashes[y].length; x++){\n\t\t\t\tif(VDashes[x][y] == 0)\n\t\t\t\t\t$('#odd-x_'+x+'-y_'+y).css('background-color','#222');\n\t\t\t\tif(VDashes[x][y] == 1)\n\t\t\t\t\t$('#odd-x_'+x+'-y_'+y).css('background-color','blue');\n\t\t\t\tif(VDashes[x][y] == 2)\n\t\t\t\t\t$('#odd-x_'+x+'-y_'+y).css('background-color','#FFF');\n\t\t\t}\n\t\t}\n\t\t//update Boxes\n\t\tfor(var iter = 0; iter < Boxes.length; iter++){\n\t\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "75f8a471613777d389b4c492d8a30bb4", "score": "0.63923025", "text": "function update() {\n // useful variables\n var canvasWidth = app.canvas.width;\n var canvasHeight = app.canvas.height;\n var groundY = ground.y;\n tree.x--;\n tree.y--;\n\n // TODO 4: Part 2 - Move the tree!\n if (tree.x < -200) {\n tree.x = canvasWidth;\n }\n if (tree.y < -400) {\n tree.y = canvasHeight;\n }\n\n // TODO 5: Part 2 - Parallax\n buildings.forEach(moveAndCheck);\n \n } // end of update function - DO NOT DELETE", "title": "" }, { "docid": "33a3d4e8760e1db51233bcf5664fd6c1", "score": "0.6391833", "text": "function resestAllGameSettings()\n{\n // Reset game stats\n level_currentLevel = 1;\n level_currentScore = 0;\n level_highScore = 0;\n level_totalFilledTiles = 0;\n level_totalEmptyTiles = (MAP_TILE_HEIGHT - (2 * MAP_BORDER_THICKNESS)) * (MAP_TILE_WIDTH - (2 * MAP_BORDER_THICKNESS));\n isGamePaused = false;\n isPlayerMovementDisabled = false;\n isCharacterDeadAlready = false;\n\n isBallMovementDisabled = false;\n isPlayerMovementDisabled = false;\n isGamePaused = false;\n isCharacterDeadAlready = false;\n isCharInDangerZone = false;\n isSoundEffectsEnabled = true;\n\n level_numberOfBalls = 0;\n level_playerLives = 0;\n level_currentLevel = 0;\n level_percentComplete = 0.0;\n level_targetPercentComplete = 0.0;\n level_totalFilledTiles = 0;\n level_totalEmptyTiles = 0;\n level_currentScore = 0;\n level_highScore = 0;\n \n showMuteXIcon(isSoundMuted);\n\n // Reset the character tween if it is in progress\n if (playerTween != null && playerTween.isRunning)\n {\n playerTween.stop();\n }\n\n allBallXVelocities = [];\n allBallYVelocities = [];\n endangeredTiles = [];\n}", "title": "" }, { "docid": "ccec170ae193f227c47e35d75539e68a", "score": "0.63859165", "text": "function update() {\n drawBoard();\n\n}", "title": "" }, { "docid": "1040529cb7a597271fba2803a06ce880", "score": "0.63832086", "text": "function update() {\n\t\t\n\t}", "title": "" }, { "docid": "cadb81f5d45575a87bf3a59873a236d2", "score": "0.6382568", "text": "function update(){\n frames++;\n ctx.clearRect(0,0,canvas.width,canvas.height);\n board.draw();\n warf.draw();\n barf.draw();\n //drag1.draw()\n drawSpear();\n drawSpear2();\n generateDragons();\n drawDragons();\n checkIfSpearTouchADragon();\n checkIfSpearTouchADragonP2();\n generateKillerDragons();\n drawdragk();\n\n}", "title": "" }, { "docid": "87d8fcc2245edee33b6969d3626471ae", "score": "0.638227", "text": "function update() {\n\tgame.clear();\n\t\n\tif(initmode){\t//ask user for the username and show instructions and loading screen\n\t\n\t}else{\t//if it is not initialization mode, update with game loop code\n\t\tlocalPlayer.update(STANDARD_WIDTH, STANDARD_HEIGHT);\n\t\t//update the server on my position only on change\n\t\tif(localPlayer.update()){\n\t\t\tsocket.emit(\"move player\", {id: localPlayer.getID(), x: localPlayer.getX(), y: localPlayer.getY(), shapeid: localPlayer.getShapeID()});\n\t\t};\n\t\t\n\t\t//draw all remote players to canvas\n\t\tvar i;\n\t\tfor(i=0; i<remotePlayers.length; i++){\n\t\t\tremotePlayers[i].draw(game);\n\t\t};\n\t\t\n\t\t//draw all flying shapes to canvas\n\t\tvar i;\n\t\tfor(i=0; i<flyingObject.length; i++){\n\t\t\tflyingObject[i].draw(game);\n\t\t};\n\t\t\n\t\t//alert server to send updates shapes coordinates\n\t\tsocket.emit(\"move shape\", {id: localPlayer.getID()});\n\t\t\n\t\t//check for collisions\n\t\tcheckCollision();\n\t\t\n\t}\t\n\tdraw();\n}", "title": "" }, { "docid": "886f46bcdffb40d400e5a1d4c5873753", "score": "0.637721", "text": "function newFrame() {\n updateSnakePosition();\n drawSnake();\n checkWallCollision();\n checkAppleCollision();\n checkSnakeCollision();\n canInput = true;\n }", "title": "" }, { "docid": "b579626904fee11d52d6117e9993b890", "score": "0.63761646", "text": "display() {\n if (this.gameMode == XMLscene.gameMode.BOT_VS_BOT || (this.gameMode == XMLscene.gameMode.PLAYER_VS_BOT && this.player == 2)) {\n this.botHandler();\n } else if (this.gameMode == XMLscene.gameMode.MOVIE) {\n this.movieHandler();\n } else {\n this.checkCurrentState();\n }\n this.player1.displayPawns();\n this.player1.displayWalls();\n this.player1.displayStepOverButton();\n this.player1.displayBackButton();\n\n this.player2.displayPawns();\n this.player2.displayWalls();\n this.player2.displayStepOverButton();\n this.player2.displayBackButton();\n\n this.scene.pushMatrix();\n this.scene.translate(this.startPos11[0], 0.35, this.startPos11[2]);\n this.materialp1.apply();\n this.StartPos11Circle.display();\n this.scene.popMatrix();\n\n this.scene.pushMatrix();\n this.scene.translate(this.startPos12[0], 0.35, this.startPos12[2]);\n this.materialp1.apply();\n this.StartPos12Circle.display();\n this.scene.popMatrix();\n\n this.scene.pushMatrix();\n this.scene.translate(this.startPos21[0], 0.35, this.startPos21[2]);\n this.materialp2.apply();\n this.StartPos21Circle.display();\n this.scene.popMatrix();\n\n this.scene.pushMatrix();\n this.scene.translate(this.startPos22[0], 0.35, this.startPos22[2]);\n this.materialp2.apply();\n this.StartPos22Circle.display();\n this.scene.popMatrix();\n\n }", "title": "" }, { "docid": "5fb025787672961505a9a0f7dcf3697d", "score": "0.6373495", "text": "update () {\n\n }", "title": "" }, { "docid": "e75f033e5609238ddb0ce711b89ae675", "score": "0.637169", "text": "update()\n\t{\n\t\tvar now = Date.now();\n\t\tvar dt = now - gameNs.game.lastUpdate;\n\t\tgameNs.game.lastUpdate = now;\n\t\tgameNs.game.sceneManager.update(dt, gameNs.game.ws);\n\t\tgameNs.game.draw();\n\t\twindow.requestAnimationFrame(gameNs.game.update); \n\t}", "title": "" }, { "docid": "ff14f77f2c596ecd248fdfe4cac13243", "score": "0.6369336", "text": "function updateGame(){\n\tif(!gamePause){\n\t\tfor(n=0; n<ballnumber_arr.length; n++){\n\t\t\tvar tNumber = ballnumber_arr[n];\n\t\t\tvar _soccerBall=getBox2dData('soccerBall'+tNumber);\n\t\t\tif(_soccerBall!=null){\n\t\t\t\t$.ballHolder['ball'+tNumber].x=_soccerBall.GetPosition().x*boxScale;\n\t\t\t\t$.ballHolder['ball'+tNumber].y=_soccerBall.GetPosition().y*boxScale;\n\t\t\t\t$.ballHolder['ball'+tNumber].rotation=_soccerBall.GetPosition().x*boxScale;\n\t\t\t\t\n\t\t\t\t$.ballShadowHolder['ball'+tNumber].x=$.ballHolder['ball'+tNumber].x;\n\t\t\t\t$.ballShadowHolder['ball'+tNumber].scaleX=$.ballShadowHolder['ball'+tNumber].scaleY=($.ballHolder['ball'+tNumber].y/canvasH)*1;\n\t\t\t}\n\t\t}\n\t\tcheckBallCollision();\n\t\tcheckMovePlayerAnimation();\n\t\tupdateBox2dPlayerPos(gamePlayer.x, gamePlayer.y);\n\t}\t\n}", "title": "" }, { "docid": "779de14524c17dd0514f2032c1702b00", "score": "0.63662034", "text": "function logicUpdate() {\n\t\tfor(ii=0;ii<stepsBetweenDraw + skinnerbox*stepsBetweenDraw*Math.random();ii++) {\n\t\t\toldX=agentLocation[0];\n\t\t\toldY=agentLocation[1];\n\n\t\t\taction = agent.choose(agentLocation);\n\t\t\treward = env.step(action);\n\n\t\t\txmask=[];\n\t\t\tymask=[];\n\t\t\tif(y>0){ xmask.push(0); ymask.push(-1);}\n\t\t\tif(x<xPix-1) { xmask.push(1); ymask.push(0);}\n\t\t\tif(y<yPix-1) { xmask.push(0); ymask.push(1);}\n\t\t\tif(x>0) { xmask.push(-1); ymask.push(0);}\n\t\t\tpredictedX = oldX+xmask[action];\n\t\t\tpredictedY = oldY+ymask[action];\n\t\t\tnewX=agentLocation[0];\n\t\t\tnewY=agentLocation[1];\n\n\t\t\t/// ugg, this is such a kludge. Basically we're updating the value of the square we just moved off\n\t\t\t// of unless we didn't move cause there's a block where we're trying to move to,\n\t\t\t// in which case we update the value of the square we're trying to move to.\n\t\t\t// this whole thing is because I stupidly used state values instead of state-action values because\n\t\t\t// I thought \"Oh, the dynamics of the environment are simple and state values will visualize better!\"\n\t\t\t// (read in high pitch mocking voice) But no. I was a fool!\n\t\t\tif(oldX==newX && oldY==newY){\n\t\t\t\tremoveFromEQ(agent.eligibilityQueue,[oldX,oldY]);\n\t\t\t\tagent.eligibilityQueue.push([oldX,oldY]);\n\t\t\t\tremoveFromEQ(agent.eligibilityQueue,[predictedX,predictedY]);\n\t\t\t\tagent.eligibilityQueue.push([predictedX,predictedY]);\n\t\t\t}else{\n\t\t\t\tremoveFromEQ(agent.eligibilityQueue,[oldX,oldY]);\n\t\t\t\tagent.eligibilityQueue.push([oldX,oldY]);\n\t\t\t}\n\t\t\tif((agent.eligibilityQueue.length > imgTailLength) || (stepcount%4 ==0 && agent.eligibilityQueue.length>1)) agent.eligibilityQueue.shift();\n\n\n\t\t\tsurprise = reward + gamma*valueFunction[newX][newY] - valueFunction[oldX][oldY];// a surprise can be positive or negative.\n\t\t\tif (Math.abs(surprise) > jadedness) {\n\t\t\t\t//Nice eligibility value function update\n\t\t\t\teligibility = 1;\n\t\t\t\tfor (jj=agent.eligibilityQueue.length-1; !(jj<0 || jj<agent.eligibilityQueue.length-logicTailLength); jj--){\n\t\t\t\t\tx = agent.eligibilityQueue[jj][0];\n\t\t\t\t\ty = agent.eligibilityQueue[jj][1];\n\t\t\t\t\tvalueFunction[x][y] = valueFunction[x][y] + alpha * surprise * eligibility;\n\t\t\t\t\teligibility = gamma * lambda * eligibility;\n\t\t\t\t}\n\t\t\t\tagent.policyUpdate();\n\t\t\t}\n\t\t\tif(reward) console.log(\"Yay\");\n\t\t}\n\t}", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.63499486", "text": "update() {\n\n }", "title": "" }, { "docid": "8546fe6eeea3f117ced9ee1cc21ed557", "score": "0.63499486", "text": "update() {\n\n }", "title": "" }, { "docid": "9e9538c589d8806c7e4f0741d0e2d7da", "score": "0.6346786", "text": "function updateGameState() {\n}", "title": "" }, { "docid": "f67dbc3d62ab5e4a70afeeb758e415e5", "score": "0.63432604", "text": "function update() {\n player.update();\n if(fireball.exists){\n fireball.update();\n };\n if(laser.exists){\n laser.update();\n };\n if(protoman.getPlasmaBall().exists){\n protoman.getPlasmaBall().update();\n };\n \n protoman.update();\n health.update();\n}", "title": "" }, { "docid": "227adec16be791772321db5ba69ae4ac", "score": "0.6342269", "text": "function updateFrame() {\r\n this.clear();\r\n\r\n // drawing figures\r\n circles.forEach((circle)=>circle.draw());\r\n if (parallelogram) parallelogram.draw();\r\n if (bigCircle) bigCircle.draw();\r\n\r\n // updating circle positions on sidemenu (I dont want to merge this with update, because of readability)\r\n let coords = document.getElementsByClassName('coord');\r\n // clear coords first\r\n for (i = 0; coords[i]; i++) coords[i].getElementsByClassName('point-coord')[0].innerHTML = ``;\r\n circles.forEach((circle, i) => coords[i].getElementsByClassName('point-coord')[0].innerHTML = `(x: ${circle.pos.x} y:${circle.pos.y})`);\r\n\r\n // now update squares\r\n document.getElementById('figure1').innerHTML = parallelogram === null ? '' : parallelogram.calculateSquare().toFixed(2);\r\n document.getElementById('figure2').innerHTML = bigCircle === null ? '' : bigCircle.calculateSquare().toFixed(2);\r\n\r\n requestAnimationFrame(this.updateFrame);\r\n}", "title": "" }, { "docid": "358b0229c2fc14e6a4708f32cf8fd18f", "score": "0.6335721", "text": "function redraw_state() {\n for(x=0;x<9;x++) {\n for(y=0;y<9;y++) {\n if(board_state_x[xy_to_1d(x,y)]) {\n drawX(x,y);\n } else if(board_state_o[xy_to_1d(x,y)]) {\n drawO(x,y);\n }\n }\n }\n\n if( moves.length > 0) {\n overlay_x = moves[moves.length-1][0] % 3;\n overlay_y = moves[moves.length-1][1] % 3;\n\n if(xTurn) {\n highlight_grid(overlay_x,overlay_y, '#03f');\n } else {\n highlight_grid(overlay_x,overlay_y, '#f30');\n }\n }\n}", "title": "" }, { "docid": "4b81c836b804a071b7e6e90aa0714d9b", "score": "0.63326544", "text": "function updateLogic()\n{\n\tswitch(currScene)\n\t{\n\t\tcase 'egg': \tupdateEgg(); break;\n\t\tcase 'nom': \tupdateNom(); break;\n\t\tcase 'hatch':\tupdateHatch(); break;\n\t\tcase 'sunset': updateSunset(); break;\n\t}\n\n\t//. . . . . . . . . . . . . . .\n\t// Handle Transition \n\tif(transTime == undefined)\n\t{\n\t\treturn;\n\t}\n\n\tif(transState == 'out')\n\t{\n\t\ttransTime -= 0.1;\n\n\t\tif(transTime < 0)\n\t\t{\n\t\t\ttransTime = 0;\n\t\t\tnextScene();\n\t\t}\n\t}\n\telse if(transState == 'in')\n\t{\n\t\ttransTime += 0.1;\n\n\t\tif(transTime > 5)\n\t\t{\n\t\t\ttransTime = 5;\n\t\t\ttransState = undefined;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f3e6d0c014fc0138b36d8fd73c7b6c4a", "score": "0.6329373", "text": "function update(){\n\t\tcalcVisibility();\n\t}", "title": "" }, { "docid": "396ed0344f23d9fe4d82e7e6aab26a4f", "score": "0.6327638", "text": "function updateGame(state){\n window.game.updateMessageBox(infoEnemyChoice);\n window.game.updateMessageBox(infoMissiles);\n window.game.setGameState(state);\n}", "title": "" }, { "docid": "992375afa6d266b067f1374452c2f802", "score": "0.63230014", "text": "function draw() {\n // spelstatus is 1, 2 of 3\n\n if (spelStatus === 1) {\n // dit is het uitlegscherm\n // teken hier alles wat daarvoor nodig is\n\n // stel ik druk de spatiebalk in (in spelstatus 1), dan maak ik van spelstatus 2\n }\n\n\n\n\n else if (spelStatus === 2) {\n // dit is de game, teken de game etc.\n }\n\n else if (spelStatus === 3) {\n // hier teken ik het gameover scherm\n }\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n switch (spelStatus) {\n case UITLEG:\n var mijnVar = 0;\n background(0, 0, 255);\n fill(255, 255, 255);\n textSize(24);\n text(\"Druk op de spatiebalk om te starten\", 200, 200, 500, 50);\n\n if (keyIsPressed === true && key === \" \") {\n console.log(\"pressed space\");\n spelStatus = SPELEN;\n aantalLevens = 3;\n score = 0;\n }\n break;\n case SPELEN:\n beweegVijand();\n beweegKogel();\n beweegSpeler();\n \n // check voor iedere vijand of een kogel 'm raakt: \n for (var i = 0; i < vijandenX.length; i++) {\n if (checkVijandGeraakt(i)) {\n // punten erbij\n score++;\n\n if (score % 10 === 0) {\n kogelDiameter = 40;\n }\n else {\n kogelDiameter = 10;\n }\n\n // nieuwe vijand maken\n verwijderVijand(i);\n maakNieuweVijand();\n }\n }\n\n if (checkSpelerGeraakt()) {\n aantalLevens--;\n // leven eraf of gezondheid verlagen\n // eventueel: nieuwe speler maken\n }\n\n\n\n tekenVeld();\n tekenVijanden();\n tekenKogels();\n tekenSpeler(spelerX, spelerY);\n tekenTimer();\n tekenScore();\n\n if (checkGameOver()) {\n spelStatus = GAMEOVER;\n }\n break;\n case GAMEOVER:\n // hier komt het GAMEOVER scherm\n\n break;\n }\n}", "title": "" }, { "docid": "1179794188c97f044336bb7343a4d0b0", "score": "0.63224024", "text": "function draw() {\n currentState.update();\n}", "title": "" }, { "docid": "fa4bab183474a894869e6b73ed6c2a15", "score": "0.6317894", "text": "function draw() {\n if (state === `start`) {\n intro();\n } else if (state === `diffSelect`) {\n diffSelect();\n } else if (state === `warning`) {\n warningScreen();\n } else if (state === `simulation`) {\n simulation();\n } else if (state === `winEnding`) {\n winEnding();\n } else if (state === `loseEnding`) {\n loseEnding();\n }\n}", "title": "" }, { "docid": "b03164fe1bc08912907f408f63cfa90d", "score": "0.6315581", "text": "function updateGame(event){\r\n\tif(gameData.updateBackground){\r\n\t\tbeerShadow.x = beer.x;\r\n\t\t\r\n\t\tvar stickX = canvasW/100 * 98;\r\n\t\tif(tableTarget.x + (tableTarget.image.naturalWidth/2) < stickX){\r\n\t\t\tdistanceBg.x = tableTarget.x + (tableTarget.image.naturalWidth/2);\r\n\t\t}else{\r\n\t\t\tdistanceBg.x = stickX;\r\n\t\t}\r\n\t\ttxtDistance.x = distanceBg.x - 110;\r\n\t\t\r\n\t\tif(gameData.status == 'focus'){\r\n\t\t\tif(beer.oldX != beer.x){\r\n\t\t\t\tgameData.speed = beer.oldX - beer.x;\r\n\t\t\t\tbeer.oldX = beer.x;\r\n\t\t\t}else{\r\n\t\t\t\tgameData.speed = 0;\t\r\n\t\t\t}\r\n\t\t\tupdateBackground();\r\n\t\t}else{\r\n\t\t\tplaySlidingSound();\r\n\t\t\tif(tableEnd.x <= canvasW/100 * 80){\r\n\t\t\t\tbeer.x += gameData.speed;\r\n\t\t\t\t\r\n\t\t\t\tif(beer.x >= tableEnd.x){\r\n\t\t\t\t\tstopSlidingSound();\r\n\t\t\t\t\tanimateBeerFall();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tupdateBackground();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(gameData.speed > 0){\r\n\t\t\t\tgameData.speed -= gameData.decreaseSpeed;\r\n\t\t\t}else{\r\n\t\t\t\tgameData.speed = 0;\t\r\n\t\t\t\tif(beer.x < tableTarget.x){\r\n\t\t\t\t\tcheckGameEnd(false);\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tupdateScore();\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "71de070e6ac39ed9647365352e1ef8d9", "score": "0.63113064", "text": "function newFrame() {\n checkPoints();\n doCollide(ball, leftPaddle);\n doCollide(ball, rightPaddle);\n repositionPaddles();\n repositionBall();\n redrawGameItems();\n updatePoints();\n\n }", "title": "" }, { "docid": "744f8bbbc14937b4afc4d69335575fbc", "score": "0.63098", "text": "function update() {\n currentTime = (new Date()).getTime()\n calculateXVelocity()\n calculateYVelocity()\n updatePosition()\n handle_state()\n}", "title": "" }, { "docid": "c346364159a8468c231ab484ce420430", "score": "0.63089633", "text": "function game(){\n\tupdate();\n\trender();\n}", "title": "" }, { "docid": "c346364159a8468c231ab484ce420430", "score": "0.63089633", "text": "function game(){\n\tupdate();\n\trender();\n}", "title": "" }, { "docid": "aee6f05097e971a61eca0759634385a7", "score": "0.63077974", "text": "update() {\n }", "title": "" }, { "docid": "aee6f05097e971a61eca0759634385a7", "score": "0.63077974", "text": "update() {\n }", "title": "" }, { "docid": "aee6f05097e971a61eca0759634385a7", "score": "0.63077974", "text": "update() {\n }", "title": "" } ]
6259343138d208439f22002d879de6ab
returns RGB color from a given slot s 02 from color array a
[ { "docid": "25b65aa5d046b42fb2c2b61fcddbd7b3", "score": "0.62027764", "text": "function rgbStr(a, s) {\n\treturn \"rgb(\" + a[s][0] + \",\" + a[s][1] + \",\" + a[s][2] + \")\";\n}", "title": "" } ]
[ { "docid": "3e75506d247c6603dbaf2c7a24dbdab1", "score": "0.6768225", "text": "function rgbBri(a, s) {\n\tvar R = a[s][0], G = a[s][1], B = a[s][2];\n\treturn 0.2126*R + 0.7152*G + 0.0722*B;\n}", "title": "" }, { "docid": "3e75506d247c6603dbaf2c7a24dbdab1", "score": "0.6768225", "text": "function rgbBri(a, s) {\n\tvar R = a[s][0], G = a[s][1], B = a[s][2];\n\treturn 0.2126*R + 0.7152*G + 0.0722*B;\n}", "title": "" }, { "docid": "9bca59a9089419b737fcd98346fec0be", "score": "0.6731282", "text": "function getColor(color, idx) {\r\n\t\t\treturn typeof color == 'string' ? color : color[idx % color.length]\r\n\t\t}", "title": "" }, { "docid": "fda46403fb9aca3f2e7f08458be63bec", "score": "0.6709212", "text": "function getColor(color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "e39fa48950130a1f1d84bc168153eed3", "score": "0.6697102", "text": "function getColor (color, idx) {\n\t return typeof color == 'string' ? color : color[idx % color.length]\n\t }", "title": "" }, { "docid": "e39fa48950130a1f1d84bc168153eed3", "score": "0.6697102", "text": "function getColor (color, idx) {\n\t return typeof color == 'string' ? color : color[idx % color.length]\n\t }", "title": "" }, { "docid": "ed12ad58586cd5b32a3b4213754c048b", "score": "0.66944766", "text": "function getColor(color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "ed12ad58586cd5b32a3b4213754c048b", "score": "0.66944766", "text": "function getColor(color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "85bee12d3b792efebdb5f1ffae844747", "score": "0.6688126", "text": "function getColor (color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "85bee12d3b792efebdb5f1ffae844747", "score": "0.6688126", "text": "function getColor (color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "85bee12d3b792efebdb5f1ffae844747", "score": "0.6688126", "text": "function getColor (color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "85bee12d3b792efebdb5f1ffae844747", "score": "0.6688126", "text": "function getColor (color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "85bee12d3b792efebdb5f1ffae844747", "score": "0.6688126", "text": "function getColor (color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "85bee12d3b792efebdb5f1ffae844747", "score": "0.6688126", "text": "function getColor (color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "85bee12d3b792efebdb5f1ffae844747", "score": "0.6688126", "text": "function getColor (color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "85bee12d3b792efebdb5f1ffae844747", "score": "0.6688126", "text": "function getColor (color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "85bee12d3b792efebdb5f1ffae844747", "score": "0.6688126", "text": "function getColor (color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "a583a95ff872f460d860868d4e4e1e5c", "score": "0.668328", "text": "function getColor(color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "a583a95ff872f460d860868d4e4e1e5c", "score": "0.668328", "text": "function getColor(color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "a583a95ff872f460d860868d4e4e1e5c", "score": "0.668328", "text": "function getColor(color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "a583a95ff872f460d860868d4e4e1e5c", "score": "0.668328", "text": "function getColor(color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "a583a95ff872f460d860868d4e4e1e5c", "score": "0.668328", "text": "function getColor(color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "a583a95ff872f460d860868d4e4e1e5c", "score": "0.668328", "text": "function getColor(color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "a583a95ff872f460d860868d4e4e1e5c", "score": "0.668328", "text": "function getColor(color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "a583a95ff872f460d860868d4e4e1e5c", "score": "0.668328", "text": "function getColor(color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "a583a95ff872f460d860868d4e4e1e5c", "score": "0.668328", "text": "function getColor(color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "a583a95ff872f460d860868d4e4e1e5c", "score": "0.668328", "text": "function getColor(color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "a583a95ff872f460d860868d4e4e1e5c", "score": "0.668328", "text": "function getColor(color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "a583a95ff872f460d860868d4e4e1e5c", "score": "0.668328", "text": "function getColor(color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length]\n }", "title": "" }, { "docid": "8ae2cfdf6d7b4bad3812456d0d0aa58b", "score": "0.6654444", "text": "function GetColor (index : int) : Color32 {\n\t\tindex=index%colorLength;\n\t\treturn color[index];\n\t}", "title": "" }, { "docid": "e3e4b5f654e26b83f54d71ce9cf54c07", "score": "0.66497415", "text": "function getColor(){\n if(j == 7) { j = 0; }\n return (colors[j]);\n}", "title": "" }, { "docid": "11ba25503333995d04fba021191a2607", "score": "0.66362", "text": "function getColor(color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length];\n }", "title": "" }, { "docid": "d28672d07e3ef90da6de6839f07bec33", "score": "0.662971", "text": "function getColor(count, arr){\n var index = getIndex(count, arr);\n // var colorArr = [\"#1C1C1C\",\"#363636\",\"\t#4F4F4F\",\"#696969\",\"#828282\",\"#9C9C9C\",\"#B5B5B5\",\"#CFCFCF\",\"#E8E8E8\"];\n var colorArr = [\"#E8E8E8\",\"#CFCFCF\",\"#B5B5B5\",\"#9C9C9C\",\"#828282\",\"#696969\",\"#4F4F4F\",\"#363636\",\"#1C1C1C\"];\n return colorArr[9 - index];\n}", "title": "" }, { "docid": "938c18601625b802ce8e90e885c4ac3a", "score": "0.6622443", "text": "function getColor(color, idx) {\r\n return typeof color == 'string' ? color : color[idx % color.length];\r\n}", "title": "" }, { "docid": "938c18601625b802ce8e90e885c4ac3a", "score": "0.6622443", "text": "function getColor(color, idx) {\r\n return typeof color == 'string' ? color : color[idx % color.length];\r\n}", "title": "" }, { "docid": "938c18601625b802ce8e90e885c4ac3a", "score": "0.6622443", "text": "function getColor(color, idx) {\r\n return typeof color == 'string' ? color : color[idx % color.length];\r\n}", "title": "" }, { "docid": "4bbea9e44c4764dfba0b00385467a4d4", "score": "0.66200805", "text": "function getColorIndex(r, g, b) {\n return (r << (2 * sigbits)) + (g << sigbits) + b;\n }", "title": "" }, { "docid": "f5be3a64a6b2520d787fec1bac492134", "score": "0.66111934", "text": "function getPickingColor(index) {\n return [(index + 1) % 256, Math.floor((index + 1) / 256) % 256, Math.floor((index + 1) / 256 / 256) % 256];\n}", "title": "" }, { "docid": "f5be3a64a6b2520d787fec1bac492134", "score": "0.66111934", "text": "function getPickingColor(index) {\n return [(index + 1) % 256, Math.floor((index + 1) / 256) % 256, Math.floor((index + 1) / 256 / 256) % 256];\n}", "title": "" }, { "docid": "f5be3a64a6b2520d787fec1bac492134", "score": "0.66111934", "text": "function getPickingColor(index) {\n return [(index + 1) % 256, Math.floor((index + 1) / 256) % 256, Math.floor((index + 1) / 256 / 256) % 256];\n}", "title": "" }, { "docid": "95e840218d189a69b74fab7322ad66d6", "score": "0.65856534", "text": "function getColorIndex(r, g, b) {\n return (r << (2 * sigbits)) + (g << sigbits) + b;\n }", "title": "" }, { "docid": "95e840218d189a69b74fab7322ad66d6", "score": "0.65856534", "text": "function getColorIndex(r, g, b) {\n return (r << (2 * sigbits)) + (g << sigbits) + b;\n }", "title": "" }, { "docid": "95e840218d189a69b74fab7322ad66d6", "score": "0.65856534", "text": "function getColorIndex(r, g, b) {\n return (r << (2 * sigbits)) + (g << sigbits) + b;\n }", "title": "" }, { "docid": "aa66d71d38033f63c6c37f6c355417f2", "score": "0.6576921", "text": "function getColor(color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length];\n}", "title": "" }, { "docid": "aa66d71d38033f63c6c37f6c355417f2", "score": "0.6576921", "text": "function getColor(color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length];\n}", "title": "" }, { "docid": "aa66d71d38033f63c6c37f6c355417f2", "score": "0.6576921", "text": "function getColor(color, idx) {\n return typeof color == 'string' ? color : color[idx % color.length];\n}", "title": "" }, { "docid": "258c85399d9f87425094deeedb355b52", "score": "0.65764946", "text": "function rgb(color){\n return [color[0]/255, color[1]/255, color[2]/255];\n}", "title": "" }, { "docid": "1e6d4df11f235bf05df465d5dc8262f1", "score": "0.6554976", "text": "function colorConv(color) {\r\n\t\t\t\t//covert 0-2 position hex into decimal in rgb[0]\r\n\t\t\t\t//covert 2-4 position hex into decimal in rgb[1]\r\n\t\t\t\t//covert 4-6 position hex into decimal in rgb[2]\r\n\t\t\t\tvar rgb = [parseInt(color.substring(0,2),16),\r\n\t\t\t\tparseInt(color.substring(2,4),16),\r\n\t\t\t\tparseInt(color.substring(4,6),16)];\r\n\t\t\t\t//return array containing rgb[0], rgb[1], rgb[2]\r\n\t\t\t\treturn rgb;\r\n\t\t\t}", "title": "" }, { "docid": "87a2382a1927ff33d2271b12709626c8", "score": "0.65521735", "text": "function returnColor(arr) {\r\n // subtract 10% of each individual rgb color value\r\n const r = Math.floor(parseInt(arr[0]) - 0.1 * (parseInt(arr[0])));\r\n const g = Math.floor(parseInt(arr[1]) - 0.1 * parseInt(arr[1]));\r\n const b = Math.floor(parseInt(arr[2]) - 0.1 * parseInt(arr[2]));\r\n // return the new color\r\n return `rgb(${r}, ${g}, ${b})`;\r\n}", "title": "" }, { "docid": "304f5e98c347dbefa13b8181a3ca6b12", "score": "0.65344673", "text": "function getColor(x) {\n var f = parseInt(x.slice(0,2));\n var n = parseInt(x.slice(3,5));\n var color = \"rgb( 2\" + (f*2) + \", 2\" + (f*2) + \", 2\" + (n-5) + \")\";\n return color;\n}", "title": "" }, { "docid": "6c4c2c54bd11f2c771072b1117c3cbf5", "score": "0.6515145", "text": "function rgb(color){\n\treturn [color[0]/255, color[1]/255, color[2]/255];\n}", "title": "" }, { "docid": "7d9ed38db99b49021ce7674d8e1f38e7", "score": "0.65042996", "text": "function getColor(color, idx) {\n return typeof color === 'string' ? color : color[idx % color.length];\n } // Built-in defaults", "title": "" }, { "docid": "51c893751106d2bf4e071599d2fb08ec", "score": "0.65037435", "text": "function getColor( a, binSize, colors ) {\r\n\r\n var v = Math.floor( (a + CLIP) / binSize );\r\n if ( v > colors.length - 1 ) {\r\n v = colors.length - 1;\r\n }\r\n return colors[v];\r\n }", "title": "" }, { "docid": "d737ccf1a94f2b83281bc3fb1314a5d5", "score": "0.6497595", "text": "function getColorFromHexString(str) {\n var value = color.colors.black;\n\n if (str.length == 3) {\n var redStr = str[0] + str[0];\n var r = parseInt(redStr, 16);\n\n var greenStr = str[1] + str[1];\n var g = parseInt(greenStr, 16);\n\n var blueStr = str[2] + str[2];\n var b = parseInt(blueStr, 16);\n\n value = [r, g, b];\n } else if (str.length == 6) {\n var redStr = str[0] + str[1];\n var r = parseInt(redStr, 16);\n\n var greenStr = str[2] + str[3];\n var g = parseInt(greenStr, 16);\n\n var blueStr = str[4] + str[5];\n var b = parseInt(blueStr, 16);\n\n value = [r, g, b];\n }\n\n return value;\n }", "title": "" }, { "docid": "d27503904ef748739346e42065e0a85d", "score": "0.64907515", "text": "function getRGB(color) {\n\t\tvar result;\n\n\t\t// Check if we're already dealing with an array of colors\n\t\tif ( color && color.constructor == Array && color.length == 3 )\n\t\t\treturn color;\n\n\t\t// Look for rgb(num,num,num)\n\t\tif (result = /rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.exec(color))\n\t\t\treturn [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)];\n\n\t\t// Look for rgb(num%,num%,num%)\n\t\tif (result = /rgb\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/.exec(color))\n\t\t\treturn [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];\n\n\t\t// Look for #a0b1c2\n\t\tif (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))\n\t\t\treturn [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];\n\n\t\t// Look for #fff\n\t\tif (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))\n\t\t\treturn [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];\n\n\t\t// Look for rgba(0, 0, 0, 0) == transparent in Safari 3\n\t\tif (result = /rgba\\(0, 0, 0, 0\\)/.exec(color))\n\t\t\treturn colors['transparent'];\n\n\t\t// Otherwise, we're most likely dealing with a named color\n\t\treturn colors[$.trim(color).toLowerCase()];\n\t}", "title": "" }, { "docid": "b41a1b9a46e7a9398af3a7283bbaf215", "score": "0.6454794", "text": "function getRGB(color) {\n\t\tvar result;\n\n\t\t// Check if we're already dealing with an array of colors\n\t\tif ( color && color.constructor == Array && color.length == 3 )\n\t\t\t\treturn color;\n\n\t\t// Look for rgb(num,num,num)\n\t\tif (result = /rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.exec(color))\n\t\t\t\treturn [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)];\n\n\t\t// Look for rgb(num%,num%,num%)\n\t\tif (result = /rgb\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/.exec(color))\n\t\t\t\treturn [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];\n\n\t\t// Look for #a0b1c2\n\t\tif (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))\n\t\t\t\treturn [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];\n\n\t\t// Look for #fff\n\t\tif (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))\n\t\t\t\treturn [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];\n\n\t\t// Look for rgba(0, 0, 0, 0) == transparent in Safari 3\n\t\tif (result = /rgba\\(0, 0, 0, 0\\)/.exec(color))\n\t\t\t\treturn colors['transparent'];\n\n\t\t// Otherwise, we're most likely dealing with a named color\n\t\treturn colors[$.trim(color).toLowerCase()];\n}", "title": "" }, { "docid": "08360277419b3663dea572545520610d", "score": "0.6454794", "text": "function getRGB(color) {\n\t\tvar result;\n\n\t\t// Check if we're already dealing with an array of colors\n\t\tif ( color && color.constructor == Array && color.length == 3 )\n\t\t\t\treturn color;\n\n\t\t// Look for rgb(num,num,num)\n\t\tif (result = /rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.exec(color))\n\t\t\t\treturn [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)];\n\n\t\t// Look for rgb(num%,num%,num%)\n\t\tif (result = /rgb\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/.exec(color))\n\t\t\t\treturn [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];\n\n\t\t// Look for #a0b1c2\n\t\tif (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))\n\t\t\t\treturn [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];\n\n\t\t// Look for #fff\n\t\tif (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))\n\t\t\t\treturn [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];\n\n\t\t// Look for rgba(0, 0, 0, 0) == transparent in Safari 3\n\t\tif (result = /rgba\\(0, 0, 0, 0\\)/.exec(color))\n\t\t\t\treturn colors['transparent'];\n\n\t\t// Otherwise, we're most likely dealing with a named color\n\t\treturn colors[jQuery.trim(color).toLowerCase()];\n}", "title": "" }, { "docid": "b41a1b9a46e7a9398af3a7283bbaf215", "score": "0.6454794", "text": "function getRGB(color) {\n\t\tvar result;\n\n\t\t// Check if we're already dealing with an array of colors\n\t\tif ( color && color.constructor == Array && color.length == 3 )\n\t\t\t\treturn color;\n\n\t\t// Look for rgb(num,num,num)\n\t\tif (result = /rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.exec(color))\n\t\t\t\treturn [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)];\n\n\t\t// Look for rgb(num%,num%,num%)\n\t\tif (result = /rgb\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/.exec(color))\n\t\t\t\treturn [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];\n\n\t\t// Look for #a0b1c2\n\t\tif (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))\n\t\t\t\treturn [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];\n\n\t\t// Look for #fff\n\t\tif (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))\n\t\t\t\treturn [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];\n\n\t\t// Look for rgba(0, 0, 0, 0) == transparent in Safari 3\n\t\tif (result = /rgba\\(0, 0, 0, 0\\)/.exec(color))\n\t\t\t\treturn colors['transparent'];\n\n\t\t// Otherwise, we're most likely dealing with a named color\n\t\treturn colors[$.trim(color).toLowerCase()];\n}", "title": "" }, { "docid": "3169d35b1cf855acd796b9c4b716efe3", "score": "0.64346147", "text": "function getRGB(color) {\n var result;\n\n // Check if we're already dealing with an array of colors\n if ( color && color.constructor == Array && color.length == 3 )\n return color;\n\n // Look for rgb(num,num,num)\n if (result = /rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.exec(color))\n return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];\n\n // Look for rgb(num%,num%,num%)\n if (result = /rgb\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/.exec(color))\n return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];\n\n // Look for #a0b1c2\n if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))\n return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];\n\n // Look for #fff\n if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))\n return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];\n\n // Look for rgba(0, 0, 0, 0) == transparent in Safari 3\n if (result = /rgba\\(0, 0, 0, 0\\)/.exec(color))\n return colors['transparent']\n\n // Otherwise, we're most likely dealing with a named color\n return colors[jQuery.trim(color).toLowerCase()];\n}", "title": "" }, { "docid": "a95660e2705fdb21c8f99e9f8b67905d", "score": "0.6416198", "text": "function getRGB(color) {\n var result;\n\n // Check if we're already dealing with an array of colors\n if ( color && color.constructor == Array && color.length == 3 )\n return color;\n\n // Look for rgb(num,num,num)\n if (result = /rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.exec(color))\n return [parseInt(result[1],10), parseInt(result[2],10), parseInt(result[3],10)];\n\n // Look for rgb(num%,num%,num%)\n if (result = /rgb\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/.exec(color))\n return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];\n\n // Look for #a0b1c2\n if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))\n return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];\n\n // Look for #fff\n if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))\n return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];\n\n // Look for rgba(0, 0, 0, 0) == transparent in Safari 3\n if (result = /rgba\\(0, 0, 0, 0\\)/.exec(color))\n return colors['transparent'];\n\n // Otherwise, we're most likely dealing with a named color\n return colors[$.trim(color).toLowerCase()];\n }", "title": "" }, { "docid": "894c13d7f187e09e0b7260ab1517fade", "score": "0.6412732", "text": "function colorForIndex(n, s, l)\n{\n\tvar val = n * 282;\n\tval = mod(val, 360);\n\treturn {'color':'hsl(' + val.toString() + ', 100%, 65%)'};\n}", "title": "" }, { "docid": "20d5a170e490e96e7a161429dc0d58ca", "score": "0.6395598", "text": "function getRGB(color) {\r\n\t\tvar result;\r\n\r\n\t\t// Check if we're already dealing with an array of colors\r\n\t\tif ( color && color.constructor == Array && color.length == 3 )\r\n\t\t\treturn color;\r\n\r\n\t\t// Look for rgb(num,num,num)\r\n\t\tif (result = /rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.exec(color))\r\n\t\t\treturn [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];\r\n\r\n\t\t// Look for rgb(num%,num%,num%)\r\n\t\tif (result = /rgb\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/.exec(color))\r\n\t\t\treturn [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];\r\n\r\n\t\t// Look for #a0b1c2\r\n\t\tif (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))\r\n\t\t\treturn [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];\r\n\r\n\t\t// Look for #fff\r\n\t\tif (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))\r\n\t\t\treturn [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];\r\n\r\n\t\t// Otherwise, we're most likely dealing with a named color\r\n\t\treturn colors[jQuery.trim(color).toLowerCase()];\r\n\t}", "title": "" }, { "docid": "8733b34de2219e09dcdfbf4ec951b8cc", "score": "0.63897", "text": "function getColorIndex(r, g, b) {\n if (r === 0 && g === 0 && b === 0) {\n return 0;}\n\n return (r << 2 * sigbits) + (g << sigbits) + b;}", "title": "" }, { "docid": "a062ae26833a14aa6494698b886d1c64", "score": "0.63895035", "text": "function hsv2rgb(hue,sat,val) {\n //alert(\"Hue:\"+hue);\n var rgbArr = new Array();\n if ( sat == 0) {\n rgbArr[\"red\"] = Math.round(val * 255);\n rgbArr[\"green\"] = Math.round(val * 255);\n rgbArr[\"blue\"] = Math.round(val * 255);\n }\n else {\n var h = hue / 60;\n var i = Math.floor(h);\n var f = h - i;\n if (i % 2 == 0) {\n f = 1 - f;\n }\n var m = val * (1 - sat); \n var n = val * (1 - sat * f);\n switch(i) {\n case 0:\n rgbArr[\"red\"] = val;\n rgbArr[\"green\"] = n;\n rgbArr[\"blue\"] = m;\n break;\n case 1:\n rgbArr[\"red\"] = n;\n rgbArr[\"green\"] = val;\n rgbArr[\"blue\"] = m;\n break;\n case 2:\n rgbArr[\"red\"] = m;\n rgbArr[\"green\"] = val;\n rgbArr[\"blue\"] = n;\n break;\n case 3:\n rgbArr[\"red\"] = m;\n rgbArr[\"green\"] = n;\n rgbArr[\"blue\"] = val;\n break;\n case 4:\n rgbArr[\"red\"] = n;\n rgbArr[\"green\"] = m;\n rgbArr[\"blue\"] = val;\n break;\n case 5:\n rgbArr[\"red\"] = val;\n rgbArr[\"green\"] = m;\n rgbArr[\"blue\"] = n;\n break;\n case 6:\n rgbArr[\"red\"] = val;\n rgbArr[\"green\"] = n;\n rgbArr[\"blue\"] = m;\n break;\n }\n rgbArr[\"red\"] = Math.round(rgbArr[\"red\"] * 255);\n rgbArr[\"green\"] = Math.round(rgbArr[\"green\"] * 255);\n rgbArr[\"blue\"] = Math.round(rgbArr[\"blue\"] * 255);\n }\n return rgbArr;\n}", "title": "" }, { "docid": "238cf4873dfda5470995e6ff23d8f1f6", "score": "0.6385045", "text": "function getRGB(color) { var result; /* Check if we're already dealing with an array of colors */ if ( color && color.constructor == Array && color.length == 3 ) return color; /* Look for rgb(num,num,num) */ if (result = /rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.exec(color)) return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])]; /* Look for rgb(num%,num%,num%) */ if (result = /rgb\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/.exec(color)) return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55]; /* Look for #a0b1c2 */ if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color)) return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)]; /* Look for #fff */ if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color)) return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)]; /* Look for rgba(0, 0, 0, 0) == transparent in Safari 3 */ if (result = /rgba\\(0, 0, 0, 0\\)/.exec(color)) return colors['transparent']; /* Otherwise, we're most likely dealing with a named color */ return colors[jQuery.trim(color).toLowerCase()]; }", "title": "" }, { "docid": "87075b51e68dca8df8a1607033f9051f", "score": "0.63747394", "text": "function getRGB(color) {\n\t\tvar result;\n\n\t\t// Check if we're already dealing with an array of colors\n\t\tif ( color && color.constructor == Array && color.length == 3 )\n\t\t\treturn color;\n\n\t\t// Look for rgb(num,num,num)\n\t\tif (result = /rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.exec(color))\n\t\t\treturn [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];\n\n\t\t// Look for rgb(num%,num%,num%)\n\t\tif (result = /rgb\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/.exec(color))\n\t\t\treturn [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];\n\n\t\t// Look for #a0b1c2\n\t\tif (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))\n\t\t\treturn [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];\n\n\t\t// Look for #fff\n\t\tif (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))\n\t\t\treturn [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];\n\n\t\t// Otherwise, we're most likely dealing with a named color\n\t\treturn colors[jQuery.trim(color).toLowerCase()];\n\t}", "title": "" }, { "docid": "87075b51e68dca8df8a1607033f9051f", "score": "0.63747394", "text": "function getRGB(color) {\n\t\tvar result;\n\n\t\t// Check if we're already dealing with an array of colors\n\t\tif ( color && color.constructor == Array && color.length == 3 )\n\t\t\treturn color;\n\n\t\t// Look for rgb(num,num,num)\n\t\tif (result = /rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.exec(color))\n\t\t\treturn [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];\n\n\t\t// Look for rgb(num%,num%,num%)\n\t\tif (result = /rgb\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/.exec(color))\n\t\t\treturn [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];\n\n\t\t// Look for #a0b1c2\n\t\tif (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))\n\t\t\treturn [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];\n\n\t\t// Look for #fff\n\t\tif (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))\n\t\t\treturn [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];\n\n\t\t// Otherwise, we're most likely dealing with a named color\n\t\treturn colors[jQuery.trim(color).toLowerCase()];\n\t}", "title": "" }, { "docid": "87075b51e68dca8df8a1607033f9051f", "score": "0.63747394", "text": "function getRGB(color) {\n\t\tvar result;\n\n\t\t// Check if we're already dealing with an array of colors\n\t\tif ( color && color.constructor == Array && color.length == 3 )\n\t\t\treturn color;\n\n\t\t// Look for rgb(num,num,num)\n\t\tif (result = /rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.exec(color))\n\t\t\treturn [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];\n\n\t\t// Look for rgb(num%,num%,num%)\n\t\tif (result = /rgb\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/.exec(color))\n\t\t\treturn [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];\n\n\t\t// Look for #a0b1c2\n\t\tif (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))\n\t\t\treturn [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];\n\n\t\t// Look for #fff\n\t\tif (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))\n\t\t\treturn [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];\n\n\t\t// Otherwise, we're most likely dealing with a named color\n\t\treturn colors[jQuery.trim(color).toLowerCase()];\n\t}", "title": "" }, { "docid": "87075b51e68dca8df8a1607033f9051f", "score": "0.63747394", "text": "function getRGB(color) {\n\t\tvar result;\n\n\t\t// Check if we're already dealing with an array of colors\n\t\tif ( color && color.constructor == Array && color.length == 3 )\n\t\t\treturn color;\n\n\t\t// Look for rgb(num,num,num)\n\t\tif (result = /rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.exec(color))\n\t\t\treturn [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];\n\n\t\t// Look for rgb(num%,num%,num%)\n\t\tif (result = /rgb\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/.exec(color))\n\t\t\treturn [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];\n\n\t\t// Look for #a0b1c2\n\t\tif (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))\n\t\t\treturn [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];\n\n\t\t// Look for #fff\n\t\tif (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))\n\t\t\treturn [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];\n\n\t\t// Otherwise, we're most likely dealing with a named color\n\t\treturn colors[jQuery.trim(color).toLowerCase()];\n\t}", "title": "" }, { "docid": "25cb73b4c936f889aba35c6d85b410e0", "score": "0.63698024", "text": "function getRGB(color) {\n var result;\n\n // Check if we're already dealing with an array of colors\n if ( color && color.constructor == Array && color.length == 3 )\n return color;\n\n // Look for rgb(num,num,num)\n if (result = /rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.exec(color))\n return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];\n\n // Look for rgb(num%,num%,num%)\n if (result = /rgb\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/.exec(color))\n return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];\n\n // Look for #a0b1c2\n if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))\n return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];\n\n // Look for #fff\n if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))\n return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];\n\n // Look for rgba(0, 0, 0, 0) == transparent in Safari 3\n if (result = /rgba\\(0, 0, 0, 0\\)/.exec(color))\n return colors['transparent'];\n\n // Otherwise, we're most likely dealing with a named color\n return colors[jQuery.trim(color).toLowerCase()];\n }", "title": "" }, { "docid": "7af8240278d4afa2d5ee57357a17df0e", "score": "0.6367516", "text": "function getRGB(color) {\n\t\tvar result;\n\n\t\t// Check if we're already dealing with an array of colors\n\t\tif (color && color.constructor == Array && color.length == 3)\n\t\t\treturn color;\n\n\t\t// Look for rgb(num,num,num)\n\t\tif (result = /rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/\n\t\t\t\t.exec(color))\n\t\t\treturn [parseInt(result[1]), parseInt(result[2]),\n\t\t\t\t\tparseInt(result[3])];\n\n\t\t// Look for rgb(num%,num%,num%)\n\t\tif (result = /rgb\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/\n\t\t\t\t.exec(color))\n\t\t\treturn [parseFloat(result[1]) * 2.55, parseFloat(result[2]) * 2.55,\n\t\t\t\t\tparseFloat(result[3]) * 2.55];\n\n\t\t// Look for #a0b1c2\n\t\tif (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/\n\t\t\t\t.exec(color))\n\t\t\treturn [parseInt(result[1], 16), parseInt(result[2], 16),\n\t\t\t\t\tparseInt(result[3], 16)];\n\n\t\t// Look for #fff\n\t\tif (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))\n\t\t\treturn [parseInt(result[1] + result[1], 16),\n\t\t\t\t\tparseInt(result[2] + result[2], 16),\n\t\t\t\t\tparseInt(result[3] + result[3], 16)];\n\n\t\t// Otherwise, we're most likely dealing with a named color\n\t\treturn colors[jQuery.trim(color).toLowerCase()];\n\t}", "title": "" }, { "docid": "41e99c29165c8685cf3d6183dc97aee7", "score": "0.63539296", "text": "function generateColorVariation(rgb ,char) {\n\t\tvar rgbNuevo = [ ];\n\n\t\tvar substract = Math.min(parseInt(char, 16) / 16 * 30 , 30);\n\n\t\tfor (var i = 0; i < 3; i++) {\n\t\t\trgbNuevo.push( rgb[i] - substract ); \n\t\t}\n\t\treturn rgbNuevo;\n\t}", "title": "" }, { "docid": "cb7b542b1151f06d993a07cfed15f7d6", "score": "0.6331532", "text": "function GetColor (index : int) : Color32 {\n\t\tindex=index%positionLength;\n\t\treturn paintPositions[index].color;\n\t}", "title": "" }, { "docid": "ebd9f24b2d488108c52460d859c679d6", "score": "0.6330376", "text": "function colorConv(color) {\r\n\tvar rgb = [parseInt(color.substring(0, 2), 16), parseInt(color.substring(2, 4), 16), parseInt(color.substring(4, 6), 16)];\r\n\treturn rgb;\r\n}", "title": "" }, { "docid": "ec43c1bf00b1be96ada4f04c42546304", "score": "0.63297075", "text": "function colorConv(color) {\n var rgb = [parseInt(color.substring(0,2),16), \n parseInt(color.substring(2,4),16), \n parseInt(color.substring(4,6),16)];\n return rgb;\n}", "title": "" }, { "docid": "7fa6cc32dece918575b990172b8ebe21", "score": "0.63258797", "text": "function colorCodeArr (x) {\n if (x == 'green') {\n return [0, 50, 52]\n } else if (x == 'red') {\n return [13, 11, 57]\n } else if (x == 'blue') {\n return [26, 24, 62]\n } else {\n return [39, 37, 67]\n }\n}", "title": "" }, { "docid": "cafc8d737cb774c7340fee3c8828a3e2", "score": "0.6299087", "text": "function getRGB(color) {\n var result;\n\n // Check if we're already dealing with an array of colors\n if (color && color.constructor == Array && color.length == 3)\n return color;\n\n // Look for rgb(num,num,num)\n if (result = /rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.exec(color))\n return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];\n\n // Look for rgb(num%,num%,num%)\n if (result = /rgb\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/.exec(color))\n return [parseFloat(result[1]) * 2.55, parseFloat(result[2]) * 2.55, parseFloat(result[3]) * 2.55];\n\n // Look for #a0b1c2\n if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))\n return [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)];\n\n // Look for #fff\n if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))\n return [parseInt(result[1] + result[1], 16), parseInt(result[2] + result[2], 16), parseInt(result[3] + result[3], 16)];\n\n // Otherwise, we're most likely dealing with a named color\n return colors[jQuery.trim(color).toLowerCase()];\n }", "title": "" }, { "docid": "101213fe36582089e46ec9d20f23a1b8", "score": "0.62983215", "text": "arrayToColor(stats) {\n\n let r = ((stats[0] + stats[1]) / 2 / this.maxRange) * 255;\n let g = ((stats[2] + stats[3]) / 2 / this.maxRange) * 255;\n let b = ((stats[4] + stats[5]) / 2 / this.maxRange) * 255;\n\n // 1 ------- 255\n // 0.8 ----- x\n\n return [r, g, b];\n }", "title": "" }, { "docid": "edaf2d525c923d752607420e2744702d", "score": "0.62942886", "text": "function color2rgb(color) {\n var r = parseInt(color.substr(1, 2), 16);\n var g = parseInt(color.substr(3, 2), 16);\n var b = parseInt(color.substr(5, 2), 16);\n return new Array(r, g, b);\n }", "title": "" }, { "docid": "edaf2d525c923d752607420e2744702d", "score": "0.62942886", "text": "function color2rgb(color) {\n var r = parseInt(color.substr(1, 2), 16);\n var g = parseInt(color.substr(3, 2), 16);\n var b = parseInt(color.substr(5, 2), 16);\n return new Array(r, g, b);\n }", "title": "" }, { "docid": "53d2dd959f3460d7587b5ecdbbc11661", "score": "0.62489605", "text": "function _2RGB_pri(a) {\n return [+a[0] / 255, +a[1] / 255, +a[2] / 255];\n }", "title": "" }, { "docid": "f218b88e40c1c7d2ee4023d506db2bed", "score": "0.62449896", "text": "GetColorArray() {}", "title": "" }, { "docid": "f5e4bf2b0d0dc035f5e1105d354a54f0", "score": "0.6198715", "text": "static rgbArray(){\n\t\t\tif(arguments.length == 0) return null;\n\t\t\tvar rtn = [];\n\n\t\t\tfor(var i=0,c,p; i < arguments.length; i++){\n\t\t\t\tif(arguments[i].length < 6) continue;\n\t\t\t\tc = arguments[i];\t\t//Just an alias(copy really) of the color text, make code smaller.\n\t\t\t\tp = (c[0] == \"#\")?1:0;\t//Determine starting position in char array to start pulling from\n\n\t\t\t\trtn.push(\n\t\t\t\t\tparseInt(c[p]\t+c[p+1],16)\t/ 255.0,\n\t\t\t\t\tparseInt(c[p+2]\t+c[p+3],16)\t/ 255.0,\n\t\t\t\t\tparseInt(c[p+4]\t+c[p+5],16)\t/ 255.0\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn rtn;\n\t\t}", "title": "" }, { "docid": "9ebbdda04a1d2803f5e7e35efab36007", "score": "0.6184111", "text": "function hexToRgb(e){var a=/^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;e=e.replace(a,function(e,a,t,i){return a+a+t+t+i+i});var t=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}", "title": "" }, { "docid": "9ebbdda04a1d2803f5e7e35efab36007", "score": "0.6184111", "text": "function hexToRgb(e){var a=/^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;e=e.replace(a,function(e,a,t,i){return a+a+t+t+i+i});var t=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}", "title": "" }, { "docid": "9ebbdda04a1d2803f5e7e35efab36007", "score": "0.6184111", "text": "function hexToRgb(e){var a=/^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;e=e.replace(a,function(e,a,t,i){return a+a+t+t+i+i});var t=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}", "title": "" }, { "docid": "9ebbdda04a1d2803f5e7e35efab36007", "score": "0.6184111", "text": "function hexToRgb(e){var a=/^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;e=e.replace(a,function(e,a,t,i){return a+a+t+t+i+i});var t=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}", "title": "" }, { "docid": "9ebbdda04a1d2803f5e7e35efab36007", "score": "0.6184111", "text": "function hexToRgb(e){var a=/^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;e=e.replace(a,function(e,a,t,i){return a+a+t+t+i+i});var t=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}", "title": "" }, { "docid": "9ebbdda04a1d2803f5e7e35efab36007", "score": "0.6184111", "text": "function hexToRgb(e){var a=/^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;e=e.replace(a,function(e,a,t,i){return a+a+t+t+i+i});var t=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}", "title": "" }, { "docid": "9ebbdda04a1d2803f5e7e35efab36007", "score": "0.6184111", "text": "function hexToRgb(e){var a=/^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;e=e.replace(a,function(e,a,t,i){return a+a+t+t+i+i});var t=/^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}", "title": "" }, { "docid": "6f0c7993d442ad33e3bc95583043218b", "score": "0.6179815", "text": "get colors32() {}", "title": "" }, { "docid": "b1eabd1f2e068ccfc0b40c5e598434cf", "score": "0.61680704", "text": "function rgb(c) {\n return [ (c >> 16) & 0xff, (c >> 8) & 0xff, c & 0xff ];\n}", "title": "" }, { "docid": "6ff005d60741792472d21e154bffd3ed", "score": "0.6162278", "text": "function decodePickingColor(color) {\n // assert(color instanceof Uint8Array);\n var _color = _slicedToArray(color, 3),\n i1 = _color[0],\n i2 = _color[1],\n i3 = _color[2];\n // 1 was added to seperate from no selection\n\n\n var index = i1 + i2 * 256 + i3 * 65536 - 1;\n return index;\n}", "title": "" }, { "docid": "fc1e626b65c613021b24dfa1eec1ca7a", "score": "0.615176", "text": "function getColor(data, index){\n return data.color;\n }", "title": "" }, { "docid": "2c44b65a4e2f708ba6badea30d92fa38", "score": "0.61363107", "text": "function get_colors(color){\n\t// color example -> #33BB33\n\tvar r = color.substring(1,3);\n\tvar g = color.substring(3,5);\n\tvar b = color.substring(5,7);\n\n\tr = parseInt(r, 16)/255.0;\n\tg = parseInt(g, 16)/255.0;\n\tb = parseInt(b, 16)/255.0;\n\t\n\treturn [r,g,b];\n}", "title": "" }, { "docid": "311b9dc90a6e3726d9f1f02407bd6f09", "score": "0.61274016", "text": "function getColor(row){\n\treturn soundData[row].color\n}", "title": "" }, { "docid": "e1a2e97682cfb3a41621893920edaa71", "score": "0.61253226", "text": "function rgbGet(currentColor) {\n let str = currentColor.slice(4);\n let r = str.slice(0, str.indexOf(','));\n str = str.slice(str.indexOf(',')+2);\n let g = str.slice(0, str.indexOf(','));\n str = str.slice(str.indexOf(',')+2);\n let b = str.slice(0, str.indexOf(')'));\n \n return [r, g, b];\n}", "title": "" }, { "docid": "37d9513842d6dea7d3787f1d1d54d2e4", "score": "0.60981864", "text": "encodePickingColor(i) {\n const {xResolution, yResolution} = this.props;\n\n const xIndex = i % xResolution;\n const yIndex = (i - xIndex) / xResolution;\n\n return [\n xIndex / (xResolution - 1) * 255,\n yIndex / (yResolution - 1) * 255,\n 1\n ];\n }", "title": "" }, { "docid": "2f944f7bb2cb07a6d394c38e88bed1b7", "score": "0.6081297", "text": "function displayColor(array) {\n\n}", "title": "" } ]
771adb79973de9884d3bf3056c0d9e98
This is a cleanroom implementation of adler32 designed for detecting if markup is not what we expect it to be. It does not need to be cryptographically strong, only reasonably good at detecting if markup generated on the server is different than that on the client.
[ { "docid": "c92cb4df0c9272593b4f4ef7a99645cb", "score": "0.49827486", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t for (var i = 0; i < data.length; i++) {\n\t a = (a + data.charCodeAt(i)) % MOD;\n\t b = (b + a) % MOD;\n\t }\n\t return a | (b << 16);\n\t}", "title": "" } ]
[ { "docid": "9897ee6cb069a81f4ae768f5dfd3ff69", "score": "0.5341523", "text": "function expectMarkupMismatch(serverElement, clientElement) {\n return testMarkupMatch(serverElement, clientElement, false);\n }", "title": "" }, { "docid": "d9d0a542aa5c62acf584a8ed056c0b2d", "score": "0.5214859", "text": "function checkCrypt(encryptMessage) {\n\tswitch (encryptMessage) {\n\t\tcase `TT'u\\u0013\\u001ce\n\\u0016\nYe([^]%\\u0004]PuF\\u0001\\\"?\\u0004\\u0019`:\n\t\t\treturn 1;\n\t\tcase `\\\"$7\\u0002?*\\u001f#0<,\\u001f ,4E`:\n\t\t\treturn 2;\n\t\tcase `U\\u0015'\\u0001B*`:\n\t\t\treturn 3;\n\t\tdefault:\n\t\t\treturn 0;\n\t}\n}", "title": "" }, { "docid": "9c6976a76ebc60a6104bd6df1b6def02", "score": "0.51583254", "text": "function CanTranslate(elem)\r\n{\r\n var Text = elem.innerText;\r\n if (!Text)\r\n return 0;\r\n if(String(\",STYLE,SCRIPT,\").indexOf(\",\"+elem.tagName+\",\")>=0)\r\n return 0;\r\n\r\n if(!elem.innerHTML)\r\n return 0;\r\n\r\n Text=Text.trim();\r\n if (elem.innerHTML.trim() !== Text)\r\n return 0;\r\n\r\n if (Text.substr(0,1)===\"$\")//template\r\n return 0;\r\n\r\n if (Text.toUpperCase() == Text.toLowerCase())//numbers\r\n return 0;\r\n\r\n return 1;\r\n}", "title": "" }, { "docid": "8f56d799095ccf8808f19ebdc0971285", "score": "0.51269245", "text": "function adler32(data){var a=1;var b=0;for(var i=0;i<data.length;i++){a=(a+data.charCodeAt(i))%MOD;b=(b+a)%MOD;}return a|b<<16;}", "title": "" }, { "docid": "a61c8d8cf32b077699dd117af8bab5b5", "score": "0.5114512", "text": "function formatVerifier(hand) {\n if (handLengthVerifier(hand) && inputVerifier(hand)) {\n return true\n }\n return false;\n}", "title": "" }, { "docid": "43101f1dccb31e139b76f3fd95774587", "score": "0.5045035", "text": "function hasInvalidTag(str){\n\tvar reason;\n\tif(str.indexOf('script') > -1 ){\n\t\treason = 'script';\n\t}else if(str.indexOf('iframe') > -1){\n\t\treason = 'iframe';\n\t}else if(str.indexOf('javascript') > -1){\n\t\treason = 'javascript';\n\t}else{\n\n\t}\n\n\tif(reason){\n\t\treturn reason;\n\t}else\n\t\treturn false;\n}", "title": "" }, { "docid": "3ad8f2710871c72ff955c30774490ba6", "score": "0.5035777", "text": "function expectMarkupMatch(serverElement, clientElement) {\n return testMarkupMatch(serverElement, clientElement, true);\n }", "title": "" }, { "docid": "a25537fbf540b89780c8435848e5cdbb", "score": "0.502614", "text": "function onion_v3valid(onionstr) {\n return !!onion_v3decode(onionstr);\n}", "title": "" }, { "docid": "5d26a3406d414c88bef3d41dcc84360b", "score": "0.5025679", "text": "function check (buffer) {\n if (buffer.length < 8) return false\n if (buffer.length > 72) return false\n if (buffer[0] !== 0x30) return false\n if (buffer[1] !== buffer.length - 2) return false\n if (buffer[2] !== 0x02) return false\n\n var lenR = buffer[3]\n if (lenR === 0) return false\n if (5 + lenR >= buffer.length) return false\n if (buffer[4 + lenR] !== 0x02) return false\n\n var lenS = buffer[5 + lenR]\n if (lenS === 0) return false\n if ((6 + lenR + lenS) !== buffer.length) return false\n\n if (buffer[4] & 0x80) return false\n if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) return false\n\n if (buffer[lenR + 6] & 0x80) return false\n if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) return false\n return true\n}", "title": "" }, { "docid": "5d26a3406d414c88bef3d41dcc84360b", "score": "0.5025679", "text": "function check (buffer) {\n if (buffer.length < 8) return false\n if (buffer.length > 72) return false\n if (buffer[0] !== 0x30) return false\n if (buffer[1] !== buffer.length - 2) return false\n if (buffer[2] !== 0x02) return false\n\n var lenR = buffer[3]\n if (lenR === 0) return false\n if (5 + lenR >= buffer.length) return false\n if (buffer[4 + lenR] !== 0x02) return false\n\n var lenS = buffer[5 + lenR]\n if (lenS === 0) return false\n if ((6 + lenR + lenS) !== buffer.length) return false\n\n if (buffer[4] & 0x80) return false\n if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) return false\n\n if (buffer[lenR + 6] & 0x80) return false\n if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) return false\n return true\n}", "title": "" }, { "docid": "5d26a3406d414c88bef3d41dcc84360b", "score": "0.5025679", "text": "function check (buffer) {\n if (buffer.length < 8) return false\n if (buffer.length > 72) return false\n if (buffer[0] !== 0x30) return false\n if (buffer[1] !== buffer.length - 2) return false\n if (buffer[2] !== 0x02) return false\n\n var lenR = buffer[3]\n if (lenR === 0) return false\n if (5 + lenR >= buffer.length) return false\n if (buffer[4 + lenR] !== 0x02) return false\n\n var lenS = buffer[5 + lenR]\n if (lenS === 0) return false\n if ((6 + lenR + lenS) !== buffer.length) return false\n\n if (buffer[4] & 0x80) return false\n if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) return false\n\n if (buffer[lenR + 6] & 0x80) return false\n if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) return false\n return true\n}", "title": "" }, { "docid": "5d26a3406d414c88bef3d41dcc84360b", "score": "0.5025679", "text": "function check (buffer) {\n if (buffer.length < 8) return false\n if (buffer.length > 72) return false\n if (buffer[0] !== 0x30) return false\n if (buffer[1] !== buffer.length - 2) return false\n if (buffer[2] !== 0x02) return false\n\n var lenR = buffer[3]\n if (lenR === 0) return false\n if (5 + lenR >= buffer.length) return false\n if (buffer[4 + lenR] !== 0x02) return false\n\n var lenS = buffer[5 + lenR]\n if (lenS === 0) return false\n if ((6 + lenR + lenS) !== buffer.length) return false\n\n if (buffer[4] & 0x80) return false\n if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) return false\n\n if (buffer[lenR + 6] & 0x80) return false\n if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) return false\n return true\n}", "title": "" }, { "docid": "f32eff3cf21463af3b62bdc5b00c44c6", "score": "0.502246", "text": "function testTruste(ad) {\n if (!ad) {\n return false;\n }\n var p = ad.parentNode;\n while (true) {\n if (!p) {\n break;\n }\n try {\n for (var i = 0; i < p.children.length; i++) {\n var el = p.children[i];\n if (el && el.id && el.id.indexOf(\"te-clearads\") >= 0) {\n return true;\n }\n }\n } catch (e) {}\n p = p.parentNode;\n }\n return false;\n }", "title": "" }, { "docid": "813e435d95ecea99c58c43048e4ab421", "score": "0.50215137", "text": "function check (buffer) {\n\t if (buffer.length < 8) return false\n\t if (buffer.length > 72) return false\n\t if (buffer[0] !== 0x30) return false\n\t if (buffer[1] !== buffer.length - 2) return false\n\t if (buffer[2] !== 0x02) return false\n\n\t var lenR = buffer[3]\n\t if (lenR === 0) return false\n\t if (5 + lenR >= buffer.length) return false\n\t if (buffer[4 + lenR] !== 0x02) return false\n\n\t var lenS = buffer[5 + lenR]\n\t if (lenS === 0) return false\n\t if ((6 + lenR + lenS) !== buffer.length) return false\n\n\t if (buffer[4] & 0x80) return false\n\t if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) return false\n\n\t if (buffer[lenR + 6] & 0x80) return false\n\t if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) return false\n\t return true\n\t}", "title": "" }, { "docid": "476f7dc341708d7ad84b5971aba0b64e", "score": "0.5011696", "text": "function check (buffer) {\n\t if (buffer.length < 8) return false\n\t if (buffer.length > 72) return false\n\t if (buffer[0] !== 0x30) return false\n\t if (buffer[1] !== buffer.length - 2) return false\n\t if (buffer[2] !== 0x02) return false\n\t\n\t var lenR = buffer[3]\n\t if (lenR === 0) return false\n\t if (5 + lenR >= buffer.length) return false\n\t if (buffer[4 + lenR] !== 0x02) return false\n\t\n\t var lenS = buffer[5 + lenR]\n\t if (lenS === 0) return false\n\t if ((6 + lenR + lenS) !== buffer.length) return false\n\t\n\t if (buffer[4] & 0x80) return false\n\t if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) return false\n\t\n\t if (buffer[lenR + 6] & 0x80) return false\n\t if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) return false\n\t return true\n\t}", "title": "" }, { "docid": "ffde8891bcc58cd54d152abea5e791a8", "score": "0.5005457", "text": "function IsDVI(buffer) {\n if (buffer[0] != PRE) return false;\n if (buffer[buffer.length-4] != 223) return false; // 223?\n return true;\n}", "title": "" }, { "docid": "07bec520761b721732a388f8c131bc05", "score": "0.50004655", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l & ~0x3;while(i < m) {var n=Math.min(i + 4096,m);for(;i < n;i += 4) {b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));}a %= MOD;b %= MOD;}for(;i < l;i++) {b += a += data.charCodeAt(i);}a %= MOD;b %= MOD;return a | b << 16;}", "title": "" }, { "docid": "07bec520761b721732a388f8c131bc05", "score": "0.50004655", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l & ~0x3;while(i < m) {var n=Math.min(i + 4096,m);for(;i < n;i += 4) {b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));}a %= MOD;b %= MOD;}for(;i < l;i++) {b += a += data.charCodeAt(i);}a %= MOD;b %= MOD;return a | b << 16;}", "title": "" }, { "docid": "07bec520761b721732a388f8c131bc05", "score": "0.50004655", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l & ~0x3;while(i < m) {var n=Math.min(i + 4096,m);for(;i < n;i += 4) {b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));}a %= MOD;b %= MOD;}for(;i < l;i++) {b += a += data.charCodeAt(i);}a %= MOD;b %= MOD;return a | b << 16;}", "title": "" }, { "docid": "07bec520761b721732a388f8c131bc05", "score": "0.50004655", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l & ~0x3;while(i < m) {var n=Math.min(i + 4096,m);for(;i < n;i += 4) {b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));}a %= MOD;b %= MOD;}for(;i < l;i++) {b += a += data.charCodeAt(i);}a %= MOD;b %= MOD;return a | b << 16;}", "title": "" }, { "docid": "07bec520761b721732a388f8c131bc05", "score": "0.50004655", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l & ~0x3;while(i < m) {var n=Math.min(i + 4096,m);for(;i < n;i += 4) {b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));}a %= MOD;b %= MOD;}for(;i < l;i++) {b += a += data.charCodeAt(i);}a %= MOD;b %= MOD;return a | b << 16;}", "title": "" }, { "docid": "20c3d4842fc433b4a4234218ba04ab6c", "score": "0.49494013", "text": "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | b << 16;\n}", "title": "" }, { "docid": "1d23ef1e7422d0814604ad2004e8163d", "score": "0.49477553", "text": "isIbanValid(iban) {\n var ibanLen = {\n NO: 15,\n BE: 16,\n DK: 18,\n FI: 18,\n FO: 18,\n GL: 18,\n NL: 18,\n MK: 19,\n SI: 19,\n AT: 20,\n BA: 20,\n EE: 20,\n KZ: 20,\n LT: 20,\n LU: 20,\n CR: 21,\n CH: 21,\n HR: 21,\n LI: 21,\n LV: 21,\n BG: 22,\n BH: 22,\n DE: 22,\n GB: 22,\n GE: 22,\n IE: 22,\n ME: 22,\n RS: 22,\n AE: 23,\n GI: 23,\n IL: 23,\n AD: 24,\n CZ: 24,\n ES: 24,\n MD: 24,\n PK: 24,\n RO: 24,\n SA: 24,\n SE: 24,\n SK: 24,\n VG: 24,\n TN: 24,\n PT: 25,\n IS: 26,\n TR: 26,\n FR: 27,\n GR: 27,\n IT: 27,\n MC: 27,\n MR: 27,\n SM: 27,\n AL: 28,\n AZ: 28,\n CY: 28,\n DO: 28,\n GT: 28,\n HU: 28,\n LB: 28,\n PL: 28,\n BR: 29,\n PS: 29,\n KW: 30,\n MU: 30,\n MT: 31\n };\n iban = iban.replace(/\\s/g, \"\");\n if (!iban.match(/^[\\dA-Z]+$/)) return false;\n var len = iban.length;\n if (len != ibanLen[iban.substr(0, 2)]) return false;\n iban = iban.substr(4) + iban.substr(0, 4);\n for (var s = \"\", i = 0; i < len; i += 1) s += parseInt(iban.charAt(i), 36);\n for (var m = s.substr(0, 15) % 97, s = s.substr(15); s; s = s.substr(13))\n m = (m + s.substr(0, 13)) % 97;\n return m == 1;\n }", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "0b12cdc1d59bc44e4f45ca90121a7301", "score": "0.49425822", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t for (; i < Math.min(i + 4096, m); i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "2c7810238ee45e0f145c08e31aeb1c11", "score": "0.49382836", "text": "function adler32(data) {\n\t\t var a = 1;\n\t\t var b = 0;\n\t\t var i = 0;\n\t\t var l = data.length;\n\t\t var m = l & ~0x3;\n\t\t while (i < m) {\n\t\t var n = Math.min(i + 4096, m);\n\t\t for (; i < n; i += 4) {\n\t\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t\t }\n\t\t a %= MOD;\n\t\t b %= MOD;\n\t\t }\n\t\t for (; i < l; i++) {\n\t\t b += a += data.charCodeAt(i);\n\t\t }\n\t\t a %= MOD;\n\t\t b %= MOD;\n\t\t return a | b << 16;\n\t\t}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.49358398", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.49358398", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.49358398", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.49358398", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.49358398", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.49358398", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.49358398", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.49358398", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.49358398", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.49358398", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "53b0acf0c8d431c3749fb19e18bf3f0a", "score": "0.49358398", "text": "function adler32(data){var a=1;var b=0;var i=0;var l=data.length;var m=l&~0x3;while(i<m){var n=Math.min(i+4096,m);for(;i<n;i+=4){b+=(a+=data.charCodeAt(i))+(a+=data.charCodeAt(i+1))+(a+=data.charCodeAt(i+2))+(a+=data.charCodeAt(i+3));}a%=MOD;b%=MOD;}for(;i<l;i++){b+=a+=data.charCodeAt(i);}a%=MOD;b%=MOD;return a|b<<16;}", "title": "" }, { "docid": "180523ebb026377f9e35b9cb905a6274", "score": "0.49273652", "text": "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "title": "" }, { "docid": "180523ebb026377f9e35b9cb905a6274", "score": "0.49273652", "text": "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "title": "" }, { "docid": "180523ebb026377f9e35b9cb905a6274", "score": "0.49273652", "text": "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "title": "" }, { "docid": "180523ebb026377f9e35b9cb905a6274", "score": "0.49273652", "text": "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "title": "" }, { "docid": "180523ebb026377f9e35b9cb905a6274", "score": "0.49273652", "text": "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "title": "" }, { "docid": "180523ebb026377f9e35b9cb905a6274", "score": "0.49273652", "text": "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "title": "" }, { "docid": "180523ebb026377f9e35b9cb905a6274", "score": "0.49273652", "text": "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "title": "" }, { "docid": "180523ebb026377f9e35b9cb905a6274", "score": "0.49273652", "text": "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "title": "" }, { "docid": "180523ebb026377f9e35b9cb905a6274", "score": "0.49273652", "text": "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "title": "" }, { "docid": "180523ebb026377f9e35b9cb905a6274", "score": "0.49273652", "text": "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "title": "" }, { "docid": "180523ebb026377f9e35b9cb905a6274", "score": "0.49273652", "text": "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "title": "" }, { "docid": "180523ebb026377f9e35b9cb905a6274", "score": "0.49273652", "text": "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "title": "" }, { "docid": "180523ebb026377f9e35b9cb905a6274", "score": "0.49273652", "text": "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "title": "" }, { "docid": "180523ebb026377f9e35b9cb905a6274", "score": "0.49273652", "text": "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "title": "" }, { "docid": "180523ebb026377f9e35b9cb905a6274", "score": "0.49273652", "text": "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "title": "" }, { "docid": "180523ebb026377f9e35b9cb905a6274", "score": "0.49273652", "text": "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "title": "" }, { "docid": "180523ebb026377f9e35b9cb905a6274", "score": "0.49273652", "text": "function adler32(data) {\n var a = 1;\n var b = 0;\n for (var i = 0; i < data.length; i++) {\n a = (a + data.charCodeAt(i)) % MOD;\n b = (b + a) % MOD;\n }\n return a | (b << 16);\n}", "title": "" }, { "docid": "cd2b9baa932e09bf432eb6cba402689c", "score": "0.49167627", "text": "function decrypter(crypte, transfURL) { // \"transfURL\" peut être true ou flase\r\n\theader = substr(crypte, 0, 6);\r\n\t//crypte = htmlentities(crypte); // Ceci est il vraiment utile ?\r\n\tcrypte = str_replace(\"\\x20\", \"\", crypte);\r\n\tcrypte = str_replace(\"\\x0D\", \"\", crypte);\r\n\tcrypte = str_replace(\"\\x0A\", \"\", crypte);\r\n\tcrypte = substr(crypte, 6);\r\n\r\n\tif (header == \"TWL2.0\") {\r\n\t\t// Suite a des petits... hum bug d'encodage... le TWL2.0 faisait des remplacements mal venus. Donc on les inverse ic (voir code source php)\r\n\t\tstr = \"\";\r\n\t\tfor (i=0; i < strlen(crypte); i=i+2) {\r\n\t\t\tc = substr(crypte, i, 2);\r\n\t\t\tif (c==\"AD\")\r\n\t\t\t\tstr += \"A0D0\";\r\n\t\t\telse\r\n\t\t\t\tstr += c;\r\n\t\t}\r\n\t\tcrypte = str;\t\t\r\n\t}\r\n\r\n\tcrypte = strrev(crypte);\r\n\tdecrypte = hex2ascii(crypte);\r\n\tif(transfURL) { // Si on ne travaille pas dans un input\r\n\t\tdecrypte = htmlentities(decrypte);\r\n\t\tdecrypte = nl2br(decrypte);\r\n\t\t//decrypte = str_replace(\"&Uacute;\", \"<br />\", decrypte);\r\n\t\tvar reg = new RegExp(\"([a-zA-Z0-9]+(://)[^ <>]+)+\",\"gi\");\r\n\t\tdecrypte = decrypte.replace(reg, \"<a href='http://twl2.fr.nf/no-referer.php?u=$1' target=_blank>$1</a>\");\t\r\n\t}\r\n\treturn decrypte;\r\n}", "title": "" }, { "docid": "a30f1f68435b89825f10a75dc70804d1", "score": "0.49111933", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "a30f1f68435b89825f10a75dc70804d1", "score": "0.49111933", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "a30f1f68435b89825f10a75dc70804d1", "score": "0.49111933", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "a30f1f68435b89825f10a75dc70804d1", "score": "0.49111933", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "a30f1f68435b89825f10a75dc70804d1", "score": "0.49111933", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "a30f1f68435b89825f10a75dc70804d1", "score": "0.49111933", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "a30f1f68435b89825f10a75dc70804d1", "score": "0.49111933", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "a30f1f68435b89825f10a75dc70804d1", "score": "0.49111933", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "a30f1f68435b89825f10a75dc70804d1", "score": "0.49111933", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "a30f1f68435b89825f10a75dc70804d1", "score": "0.49111933", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "a30f1f68435b89825f10a75dc70804d1", "score": "0.49111933", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "a30f1f68435b89825f10a75dc70804d1", "score": "0.49111933", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "a30f1f68435b89825f10a75dc70804d1", "score": "0.49111933", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "a30f1f68435b89825f10a75dc70804d1", "score": "0.49111933", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "a30f1f68435b89825f10a75dc70804d1", "score": "0.49111933", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "a30f1f68435b89825f10a75dc70804d1", "score": "0.49111933", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "a30f1f68435b89825f10a75dc70804d1", "score": "0.49111933", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" }, { "docid": "a30f1f68435b89825f10a75dc70804d1", "score": "0.49111933", "text": "function adler32(data) {\n\t var a = 1;\n\t var b = 0;\n\t var i = 0;\n\t var l = data.length;\n\t var m = l & ~0x3;\n\t while (i < m) {\n\t var n = Math.min(i + 4096, m);\n\t for (; i < n; i += 4) {\n\t b += (a += data.charCodeAt(i)) + (a += data.charCodeAt(i + 1)) + (a += data.charCodeAt(i + 2)) + (a += data.charCodeAt(i + 3));\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t }\n\t for (; i < l; i++) {\n\t b += a += data.charCodeAt(i);\n\t }\n\t a %= MOD;\n\t b %= MOD;\n\t return a | b << 16;\n\t}", "title": "" } ]
83c3f9863283bf567768b300e053fe3f
Creates a promise which is resolved once the specified element is removed from the DOM
[ { "docid": "e99c1477e543e8dea84406cad762266a", "score": "0.71519876", "text": "function waitForRemove(elem, arg, timeout) {\n\t\tif (timeout === undefined) timeout = null;\n\t\tif (!elem.isConnected) return Promise.resolve(arg);\n\t\tinit_waitForRender();\n\t\treturn new Promise(function(ok, err){\n\t\t\t\n\t\t\twaitForRender_list.push({\n\t\t\t\telem:elem,\n\t\t\t\tfn:ok,\n\t\t\t\terr:err,\n\t\t\t\targ:arg,\n\t\t\t\ttime:Date.now(),\n\t\t\t\ttimeouts: timeout,\n\t\t\t\tst:false\n\t\t\t});\n\t\t});\n\t\t\n\t}", "title": "" } ]
[ { "docid": "c232ed1374ec661ac87ddb571514368b", "score": "0.6580488", "text": "function removeElement(element, skip_anim) {\n\t\tif (!element.isConnected) return Promise.resolve();\n\t\tif (element.dataset.closeAnim && !skip_anim) {\t\t\t\n\t\t var remopen = element.dataset.openAnim;\n\t\t\tif (remopen && !element.classList.contains(remopen)) {\n\t\t\t\t\treturn removeElement(element,true);\n\t\t\t}\t\t\t\n\t\t\tvar closeAnim = element.dataset.closeAnim;\n\t\t\treturn waitForDOMUpdate().then(function() {\n\t\t\t\tif (remopen) \n\t\t\t\t\telement.classList.remove(remopen);\n\t\t\t\telement.classList.add(closeAnim);\n\t\t\t\tvar anim = new Animation(element);\n\t\t\t\tif (anim.isAnimation()) \n\t\t\t\t\tanim.restart();\t\t\t\t\n\t\t\t\treturn anim.wait();\n\t\t\t}).then(function() {\n\t\t\t\treturn removeElement(element,true);\t\t\t\n\t\t\t})\n\t\t} else {\n\t\t\tvar event = new Event(\"remove\");\n\t\t\telement.parentElement.removeChild(element);\n\t\t\telement.dispatchEvent(event);\n\t\t\treturn Promise.resolve();\n\t\t}\t\t\n\t}", "title": "" }, { "docid": "c25d2bba9fadaec7dd6c5537c549b1c6", "score": "0.64508337", "text": "function deleteElementDOM(element) {\n element.remove();\n}", "title": "" }, { "docid": "5550c8dbe75082e3eb2b4e1322e0e6ba", "score": "0.6405837", "text": "remove() {\n this.element.remove();\n this.element = null;\n }", "title": "" }, { "docid": "cfedf287f5be3dd5a4ae292864087b0e", "score": "0.6352483", "text": "function deleteTask(elementToDelete) {\n elementToDelete.parentElement.remove()\n}", "title": "" }, { "docid": "96d008d71de9b9dd732a91fb00433da0", "score": "0.62004834", "text": "function deleteElementFromDom(element){\n element.remove();\n}", "title": "" }, { "docid": "69e7be87e44443a7f2f3d867551ed511", "score": "0.6174683", "text": "function delete_one_dev(el) {\n return Promise.resolve(delete_one(el));\n}", "title": "" }, { "docid": "97cc9850ca3223223f7f1ca657e89110", "score": "0.61529195", "text": "exit() {\n return new Promise((resolve, reject) => {\n while (this._parentElement.firstChild) {\n this._parentElement.removeChild(this._parentElement.firstChild);\n }\n resolve(true);\n });\n }", "title": "" }, { "docid": "01f57172b9bbf00d70d754c74b4848fa", "score": "0.61036456", "text": "function onRemove(scope, element, opts) {\n opts.isRemoved = true;\n element.addClass('md-leave')\n .removeClass('md-clickable');\n\n // Disable resizing handlers\n angular.element($window).off('resize', opts.resizeFn);\n angular.element($window).off('orientationchange', opts.resizeFn);\n opts.resizeFn = undefined;\n\n // Wait for animate out, then remove from the DOM\n return $mdUtil.transitionEndPromise(element, { timeout: 350 }).then(function() {\n element.removeClass('md-active');\n opts.backdrop && opts.backdrop.remove();\n if (element[0].parentNode === opts.parent[0]) {\n opts.parent[0].removeChild(element[0]);\n }\n opts.restoreScroll && opts.restoreScroll();\n });\n }", "title": "" }, { "docid": "a2abefc3829855a91707d5bc6511609a", "score": "0.6058435", "text": "function removeDeletedTaskfromUI(element){\n element.parentNode.parentNode.removeChild(element.parentNode);\n\n TASKLIST[element.id].deleted = true;\n}", "title": "" }, { "docid": "6914503805d6adc4dab9c70e27552d8c", "score": "0.6058316", "text": "function mg_exit_and_remove(elem) {\n elem.exit().remove();\n}", "title": "" }, { "docid": "f10f89b061e41e88aaee3901a8e5c012", "score": "0.6021814", "text": "function removeItem(element){\n var id = $(element).attr('id');\n $.get(\"/post/delete\", {id: id}, function(res){\n $(element).parent().remove(); \n },'text'); \n}", "title": "" }, { "docid": "8a68a62205ea6197fa3ed051a335233d", "score": "0.59867114", "text": "public remove(path : string) : Promise<any> {\r\n return new Promise((resolve : Function) => {\r\n this.localforage.removeItem(path).then(() => {\r\n resolve();\r\n })\r\n });\r\n }", "title": "" }, { "docid": "c6a929bd5fe80f1af6e2cb66059e46bd", "score": "0.5944518", "text": "function deleteElement(eid)\r\n{\r\n\tlet element = document.querySelector(\"#element-\" + eid);\r\n\telement.parentNode.removeChild(element);\r\n} // deleteElement()", "title": "" }, { "docid": "237c8860cff4f8a407b4cea332b6fa5b", "score": "0.5940569", "text": "function removeEl(element) {\n element.parentNode.removeChild(element);\n}", "title": "" }, { "docid": "564ddb77c30896f0ac034e007d0708b8", "score": "0.593232", "text": "function deleteTheMaths() {\n console.log('here is my attempt at a delete function...');\n $.ajax({\n method: 'DELETE',\n url: '/calculate'\n }).then(removeFromDom);\n}", "title": "" }, { "docid": "1acff397cc88440b884cdaaf4681ff46", "score": "0.58831865", "text": "function mg_exit_and_remove(elem) {\n\t elem.exit().remove();\n\t}", "title": "" }, { "docid": "1acff397cc88440b884cdaaf4681ff46", "score": "0.58831865", "text": "function mg_exit_and_remove(elem) {\n\t elem.exit().remove();\n\t}", "title": "" }, { "docid": "0a75966724bf53b57f2b5581b690b527", "score": "0.5876522", "text": "dom_removal() {\n var that = this;\n that.was_destroyed = true;\n if (is_specified(that.resize_observer)) {\n that.resize_observer.disconnect();\n delete that.resize_observer;\n }\n if (is_specified(that.$sup)) { // Gracefully handle a double dom_removal().\n\n // that.$sup.off();\n // that.$sup.find('*').off();\n // that.$sup.removeData();\n // NOTE: These should not be necessary. See quotes above.\n\n that.$sup.remove();\n delete that.$sup;\n // NOTE: If this causes deferred code to choke, then deferred code should\n // be checking is_specified($sup)\n } else {\n console.error(\"Cannot remove an unrendered contribution\", that);\n }\n }", "title": "" }, { "docid": "48bebd93e37107a3f216f4e408d1d164", "score": "0.5872096", "text": "destroy() {\n this.element.remove()\n }", "title": "" }, { "docid": "48bebd93e37107a3f216f4e408d1d164", "score": "0.5872096", "text": "destroy() {\n this.element.remove()\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "1dc6bcb1201c3688f4f0ec69a513b6b9", "score": "0.5857895", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "a85ca2bda99a913ff588cddc8bc98d98", "score": "0.5848218", "text": "function eliminarMedioDePago(element){\r\n swal({\r\n title: 'Está Seguro?',\r\n text: \"Esta seguro que desea quitar el medio de pago!\",\r\n icon: 'warning',\r\n buttons: {\r\n cancel: {\r\n text: \"Cancel\",\r\n value: false,\r\n visible: true,\r\n className: \"\",\r\n closeModal: true,\r\n },\r\n confirm: {\r\n text: \"OK\",\r\n value: true,\r\n visible: true,\r\n className: \"\",\r\n closeModal: true\r\n }},\r\n }).then((result) => {\r\n if (result) {\r\n $(element).closest(\"tr\").remove();\r\n }\r\n });\r\n}", "title": "" }, { "docid": "a59e326ce46643d7e174e21cb1d9548d", "score": "0.5842366", "text": "static deleteTask(element) {\n if(element.classList.contains('delete')) {\n element.parentElement.parentElement.remove();\n }\n }", "title": "" }, { "docid": "7a8f4e820fd5f1a7d9574ab70edf2e5c", "score": "0.5836017", "text": "function onRemove(scope, element, opts) {\n opts.cleanupInteraction();\n opts.cleanupResizing();\n opts.hideBackdrop();\n\n // For navigation $destroy events, do a quick, non-animated removal,\n // but for normal closes (from clicks, etc) animate the removal\n\n return (opts.$destroy === true) ? detachAndClean() : animateRemoval().then( detachAndClean );\n\n /**\n * For normal closes, animate the removal.\n * For forced closes (like $destroy events), skip the animations\n */\n function animateRemoval() {\n return $animateCss(element, {addClass: 'md-leave'}).start();\n }\n\n /**\n * Detach the element\n */\n function detachAndClean() {\n element.removeClass('md-active');\n detachElement(element, opts);\n opts.alreadyOpen = false;\n }\n\n }", "title": "" }, { "docid": "cc78408e5aa8b0c7114d71de48bfa359", "score": "0.58237857", "text": "function onRemove(scope, element, opts) {\n opts.cleanupInteraction && opts.cleanupInteraction();\n opts.cleanupResizing();\n opts.hideBackdrop();\n\n // For navigation $destroy events, do a quick, non-animated removal,\n // but for normal closes (from clicks, etc) animate the removal\n\n return (opts.$destroy === true) ? detachAndClean() : animateRemoval().then( detachAndClean );\n\n /**\n * For normal closes, animate the removal.\n * For forced closes (like $destroy events), skip the animations\n */\n function animateRemoval() {\n return $animateCss(element, {addClass: 'md-leave'}).start();\n }\n\n /**\n * Detach the element\n */\n function detachAndClean() {\n element.removeClass('md-active');\n detachElement(element, opts);\n opts.alreadyOpen = false;\n }\n\n }", "title": "" }, { "docid": "f6eebe76984ae240495e32e3e87052d3", "score": "0.58221483", "text": "removeTag(username, tag) {\n\t\treturn new Promise((resolve, reject) => {\n\n\t\t\tlet sql = \"DELETE FROM tags WHERE tag = ? AND user = ?\";\n\t\t\tlet inserts = [tag, username];\n\t\t\tsql = mysql.format(sql, inserts);\n\t\t\tlet res = this.query(sql);\n\n\t\t\tres.then(function (ret) {\n\t\t\t\tconsole.log('Deleted Tag Succesfully');\n\t\t\t\tresolve(ret);\n\t\t\t}, function (error) {\n\t\t\t\tconsole.log('Unable To Delete Tag');\n\t\t\t\treject(\"Failed to validate query.\");\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "0fa8baeaf734671a2e2e558983ce9299", "score": "0.58205974", "text": "function onRemove(scope, element, opts) { // 22893\n opts.cleanupInteraction(); // 22894\n opts.cleanupResizing(); // 22895\n opts.hideBackdrop(); // 22896\n // 22897\n // For navigation $destroy events, do a quick, non-animated removal, // 22898\n // but for normal closes (from clicks, etc) animate the removal // 22899\n // 22900\n return (opts.$destroy === true) ? detachAndClean() : animateRemoval().then( detachAndClean ); // 22901\n // 22902\n /** // 22903\n * For normal closes, animate the removal. // 22904\n * For forced closes (like $destroy events), skip the animations // 22905\n */ // 22906\n function animateRemoval() { // 22907\n return $animateCss(element, {addClass: 'md-leave'}).start(); // 22908\n } // 22909\n // 22910\n /** // 22911\n * Detach the element // 22912\n */ // 22913\n function detachAndClean() { // 22914\n element.removeClass('md-active'); // 22915\n detachElement(element, opts); // 22916\n opts.alreadyOpen = false; // 22917\n } // 22918\n // 22919\n } // 22920", "title": "" }, { "docid": "350a677114b0e80e4d68f9600f65cfc9", "score": "0.5819478", "text": "remove() {\n validateWritablePath('OnDisconnect.remove', this._path);\n const deferred = new _firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"Deferred\"]();\n repoOnDisconnectSet(this._repo, this._path, null, deferred.wrapCallback(() => {}));\n return deferred.promise;\n }", "title": "" }, { "docid": "584e84255e18998d7002270c2f0a569e", "score": "0.5812773", "text": "function onRemove(scope, element, opts) { // 14478\n opts = opts || { }; // 14479\n opts.cleanupInteraction(); // 14480\n opts.cleanupResizing(); // 14481\n opts.hideBackdrop(); // 14482\n // 14483\n // For navigation $destroy events, do a quick, non-animated removal, // 14484\n // but for normal closes (from clicks, etc) animate the removal // 14485\n // 14486\n return (opts.$destroy === true) ? cleanElement() : animateRemoval().then( cleanElement ); // 14487\n // 14488\n /** // 14489\n * For normal closes (eg clicks), animate the removal. // 14490\n * For forced closes (like $destroy events from navigation), // 14491\n * skip the animations // 14492\n */ // 14493\n function animateRemoval() { // 14494\n return $animateCss(element, {addClass: 'md-leave'}).start(); // 14495\n } // 14496\n // 14497\n /** // 14498\n * Restore the element to a closed state // 14499\n */ // 14500\n function cleanElement() { // 14501\n // 14502\n element.removeClass('md-active'); // 14503\n element.attr('aria-hidden', 'true'); // 14504\n element[0].style.display = 'none'; // 14505\n // 14506\n announceClosed(opts); // 14507\n // 14508\n if (!opts.$destroy && opts.restoreFocus) { // 14509\n opts.target.focus(); // 14510\n } // 14511\n } // 14512\n // 14513\n } // 14514", "title": "" }, { "docid": "5269a3375423e6e467eaa7063bbe7299", "score": "0.5812202", "text": "destroy() {\n return this.element.remove();\n }", "title": "" }, { "docid": "1d0751696737351d54dfd48dc89c138c", "score": "0.5810524", "text": "remove() {\n this.unobserveAllElements();\n }", "title": "" }, { "docid": "5f2bab1f0464d67273002283fc553100", "score": "0.58011174", "text": "function find_and_remove_dev(arr){\n return Promise.resolve( find_and_remove(arr) )\n}", "title": "" }, { "docid": "141b1d3f0bf766b9e1bb172019cc0c02", "score": "0.5799553", "text": "function deleteElement(element) {\n\tmanager.deleteElement(element);\n}", "title": "" }, { "docid": "6a76697c06e1b857181e0dfb33b34cb5", "score": "0.5797576", "text": "function delete_one_from_list_dev(currentEl){\n return Promise.resolve(delete_one_from_list(currentEl))\n}", "title": "" }, { "docid": "9c12dc95048ee4ae47ad7828cbb4b385", "score": "0.57903016", "text": "function CloseSelected(element) {\n\n try {\n var woeid = element.getAttribute('woeid');\n\n $.ajax({\n method: 'get',\n url: location.protocol + '//' + location.host + '/' + $('#CurrentLang').val() + '/api/APIProfile/removebranchcity?woeid=' + woeid,\n contentType: 'application/json; charset=utf-8',\n headers: {\n 'Authorization': 'Bearer ' + sessionStorage.getItem('accessToken')\n },\n success: function (data) {\n\n var container = document.getElementById('SelectedLocationContainer');\n container.removeChild(element);\n },\n fail: function (data) {\n ShowError('Error during removing element from server, please, contact our support!');\n }\n });\n\n } catch (e) {\n\n LogError(e);\n }\n\n window.event.stopPropagation();\n return false;\n}", "title": "" }, { "docid": "223cf319638cdd7c4ab55ee2effe709e", "score": "0.5790271", "text": "function eliminaDatos(index) {\n return new Promise(resolve => {\n while (contenidoVariables[index].firstChild) {\n contenidoVariables[index].removeChild(contenidoVariables[index].firstChild);\n }\n resolve();\n })\n}", "title": "" }, { "docid": "17bc95977d8f85ddde6717e6043cc631", "score": "0.57885146", "text": "destroy () {\n this.element.remove()\n }", "title": "" }, { "docid": "d93bdda93105e27807ce8e04d3934cb9", "score": "0.57785946", "text": "function removerProductoPedido(element){\r\n swal({\r\n title: 'Está Seguro?',\r\n text: \"Esta seguro que desea quitar el producto con sus cantidades!\",\r\n icon: 'warning',\r\n buttons: {\r\n cancel: {\r\n text: \"Cancel\",\r\n value: false,\r\n visible: true,\r\n className: \"\",\r\n closeModal: true,\r\n },\r\n confirm: {\r\n text: \"OK\",\r\n value: true,\r\n visible: true,\r\n className: \"\",\r\n closeModal: true\r\n }},\r\n }).then((result) => {\r\n if (result) {\r\n $(element).closest(\"tr[name=rowPrducto]\").remove();\r\n calcularTotalPedido();\r\n DeshabilitarBtnDeCerrarPedido();\r\n }\r\n });\r\n}", "title": "" }, { "docid": "715d1f7c834548d7136f38ba4ce0c0a3", "score": "0.5777552", "text": "removeElement(path) {\n // Now almighty GC can claim this soul\n const element = this.elements[path]\n delete this.elements[path]\n this.length--\n return element\n }", "title": "" }, { "docid": "96b12093c610edec90ec7773f8fca2aa", "score": "0.5765304", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "96b12093c610edec90ec7773f8fca2aa", "score": "0.5765304", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "96b12093c610edec90ec7773f8fca2aa", "score": "0.5765304", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "96b12093c610edec90ec7773f8fca2aa", "score": "0.5765304", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "96b12093c610edec90ec7773f8fca2aa", "score": "0.5765304", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "96b12093c610edec90ec7773f8fca2aa", "score": "0.5765304", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "96b12093c610edec90ec7773f8fca2aa", "score": "0.5765304", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "96b12093c610edec90ec7773f8fca2aa", "score": "0.5765304", "text": "destroy() {\n this.element.remove();\n }", "title": "" }, { "docid": "ee2060702ca7babd5a598a567df0f4c9", "score": "0.57652277", "text": "delete(element) {\n // implement\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" }, { "docid": "caa71934cd4d02f06051bcf3486cef3d", "score": "0.5759058", "text": "function removeElement(element) {\n element && element.parentNode && element.parentNode.removeChild(element);\n }", "title": "" } ]
9fdb546a4ddd201ee90a542cf9d558a1
Function for only minutes are set when invoking plugin.
[ { "docid": "a17bb4cadfa915e434a36af4e8386d68", "score": "0.6788125", "text": "function onlyMinutes($this, opts) {\n var id = $this.attr('id');\n var time = \"\";\n if (window['minutes_M' + id] === opts.minutes && window['seconds_M' + id] === opts.seconds) {\n time = prepareTime($this, opts, 0, 0, 0, 0, window['minutes_M' + id], 0);\n html($this, time, opts);\n if (typeof window['beforeExpiry_M' + id] !== 'undefined') {\n beforeExpiryTime($this, opts, time, 'M');\n }\n window['seconds_M' + id] = 60 - opts.tickInterval;\n if (window['minutes_M' + id] !== 0) {\n window['minutes_M' + id]--;\n } else {\n clearTimerInterval($this, \"M\", opts);\n }\n if ($this.data('countdowntimer').destroy === true) clearTimerInterval($this, \"M\", opts);\n } else {\n time = prepareTime($this, opts, 0, 0, 0, 0, window['minutes_M' + id], window['seconds_M' + id]);\n html($this, time, opts);\n if (typeof window['beforeExpiry_M' + id] !== 'undefined') {\n beforeExpiryTime($this, opts, time, 'M');\n }\n window['seconds_M' + id] -= opts.tickInterval;\n if (window['minutes_M' + id] !== 0 && window['seconds_M' + id] < 0) {\n window['minutes_M' + id]--;\n window['seconds_M' + id] = 60 - opts.tickInterval;\n }\n if ((window['minutes_M' + id] === 0 && window['seconds_M' + id] < 0) || $this.data('countdowntimer').destroy === true) {\n clearTimerInterval($this, \"M\", opts);\n }\n }\n id = null;\n }", "title": "" } ]
[ { "docid": "51ae3df83a3dcf08d9f5db3daeb1481f", "score": "0.70672196", "text": "function turnHoursToMinutes() { }", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.6986085", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.6986085", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.6986085", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.6986085", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.6986085", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.6986085", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.6986085", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "70c83f49eca83ba41d8b6d3831c273ca", "score": "0.69859177", "text": "function turnHoursToMinutes (){\n \n}", "title": "" }, { "docid": "3a0e258573eccf2d3e23008971cead44", "score": "0.69366175", "text": "function turnHoursToMinutes(){}", "title": "" }, { "docid": "5aee132f47b61d2adfd42602874cd9e7", "score": "0.6915921", "text": "function turnHoursToMinutes() {\n\n}", "title": "" }, { "docid": "5aee132f47b61d2adfd42602874cd9e7", "score": "0.6915921", "text": "function turnHoursToMinutes() {\n\n}", "title": "" }, { "docid": "14c13adb48cb5a559c87faed74f15823", "score": "0.6725977", "text": "function hoursToMinutes() {\n\n}", "title": "" }, { "docid": "14c13adb48cb5a559c87faed74f15823", "score": "0.6725977", "text": "function hoursToMinutes() {\n\n}", "title": "" }, { "docid": "64a66fb47a383c6fab03223c64b138c2", "score": "0.653926", "text": "get minutes() {\n return Math.floor(this.currentTime / SECONDS_IN_MINUTE) % MINUTES_IN_HOUR;\n }", "title": "" }, { "docid": "43e2b8db6588c7c246554411d9ef653b", "score": "0.6364893", "text": "get Minute() {\n return this._minutes;\n }", "title": "" }, { "docid": "1eb026bef0338ec435b45cd54af1242e", "score": "0.6262912", "text": "getMinutesUTC() {}", "title": "" }, { "docid": "bf875b89cbc0ad45bc3645e88b4a9fca", "score": "0.6250915", "text": "getMinutes(){\n return parseInt(this.currentTime / 60);\n }", "title": "" }, { "docid": "9c09b1dda38d1a5cde4f573f995b3554", "score": "0.62445086", "text": "setMinutes(minutes) {\n\t\tif (minutes == this.minutes) return\n\t\tthis.minutes = minutes\n\t\t//Wait why did I do this here too? I have no clue but it's too close to the due date to try removing it\n\t\tlet mask = this.parent.find(`.minutesClockWrapper #spinner`)\n\t\tmask.css(\"transform\", `rotate({minutes * 6} 66.146 66.146)`)\n\t\tthis.showTime()\n\t}", "title": "" }, { "docid": "de251872ee527581a4beaf0ae2385303", "score": "0.6237169", "text": "function minute () {\n console.log('Minute starting')\n setTimeout(() => {\n console.log('Minute', get())\n minute()\n }, 60000)\n}", "title": "" }, { "docid": "de251872ee527581a4beaf0ae2385303", "score": "0.6237169", "text": "function minute () {\n console.log('Minute starting')\n setTimeout(() => {\n console.log('Minute', get())\n minute()\n }, 60000)\n}", "title": "" }, { "docid": "de2635eb7fc9de4f8a5917b86e08e783", "score": "0.617707", "text": "function hoursMinutes($this, opts) {\n var id = $this.attr('id');\n var time = \"\";\n if (window['minutes_HM' + id] === opts.minutes && window['hours_HM' + id] === opts.hours) {\n time = prepareTime($this, opts, 0, 0, 0, window['hours_HM' + id], window['minutes_HM' + id], 0);\n html($this, time, opts);\n if (typeof window['beforeExpiry_HM' + id] !== 'undefined') {\n beforeExpiryTime($this, opts, time, 'HM');\n }\n if (window['hours_HM' + id] !== 0 && window['minutes_HM' + id] === 0) {\n window['hours_HM' + id]--;\n window['minutes_HM' + id] = 59;\n window['seconds_HM' + id] = 60 - opts.tickInterval;\n } else if (window['hours_HM' + id] === 0 && window['minutes_HM' + id] !== 0) {\n window['seconds_HM' + id] = 60 - opts.tickInterval;\n window['minutes_HM' + id]--;\n } else {\n window['seconds_HM' + id] = 60 - opts.tickInterval;\n window['minutes_HM' + id]--;\n }\n if (window['hours_HM' + id] === 0 && window['minutes_HM' + id] === 0 && window['seconds_HM' + id] == 60) {\n clearTimerInterval($this, \"HM\", opts);\n }\n if ($this.data('countdowntimer').destroy === true) clearTimerInterval($this, \"HM\", opts);\n } else {\n time = prepareTime($this, opts, 0, 0, 0, window['hours_HM' + id], window['minutes_HM' + id], window['seconds_HM' + id]);\n html($this, time, opts);\n if (typeof window['beforeExpiry_HM' + id] !== 'undefined') {\n beforeExpiryTime($this, opts, time, 'HM');\n }\n window['seconds_HM' + id] -= opts.tickInterval;\n if (window['minutes_HM' + id] !== 0 && window['seconds_HM' + id] < 0) {\n window['minutes_HM' + id]--;\n window['seconds_HM' + id] = 60 - opts.tickInterval;\n }\n if (window['minutes_HM' + id] === 0 && window['seconds_HM' + id] < 0 && window['hours_HM' + id] !== 0) {\n window['hours_HM' + id]--;\n window['minutes_HM' + id] = 59;\n window['seconds_HM' + id] = 60 - opts.tickInterval;\n }\n if ((window['minutes_HM' + id] === 0 && window['seconds_HM' + id] < 0 && window['hours_HM' + id] === 0) || $this.data('countdowntimer').destroy === true) {\n clearTimerInterval($this, \"HM\", opts);\n }\n }\n id = null;\n }", "title": "" }, { "docid": "884f1a4d2a5ec71eaa711098f154b955", "score": "0.605826", "text": "getMinutesLocalTime() {}", "title": "" }, { "docid": "75ce94bc0fbd601214d5028d3aeb5c8f", "score": "0.5999502", "text": "function getMinutes() {\n return tehDate.getMinutes();\n }", "title": "" }, { "docid": "75ce94bc0fbd601214d5028d3aeb5c8f", "score": "0.5999502", "text": "function getMinutes() {\n return tehDate.getMinutes();\n }", "title": "" }, { "docid": "e42e77da88492b88db7e1a95e8bc892d", "score": "0.5951739", "text": "function OnMinuteTimer()\n{\n var Now = new Date();\n\n if (_minimized) {\n // Draw the time in the title bar in 12 hour format\n var Hours = Now.getHours();\n if(Hours > 12)\n Hours -= 12;\n\n if( Hours < 10 )\n Hours = \"0\" + Hours;\n\n var Minutes = Now.getMinutes();\n if( Minutes < 10 )\n Minutes = \"0\" + Minutes;\n\n view.caption = Hours + ':' + Minutes;\n\n } else {\n UpdateMinuteHand(Now);\n UpdateHourHand(Now);\n }\n\n var Timeout = (61 - Now.getSeconds()) * 1000\n SetTimeout(OnMinuteTimer, Timeout);\n}", "title": "" }, { "docid": "1d6b163c4d3b43440e25d53ae220cb5f", "score": "0.5887099", "text": "function setMinute(timepicker, minutes){\n var minEl = timepicker.getElementsByClassName(\"tp_minutes\")[0];\n if(minutes < 10){\n minEl.innerHTML = \"0\" + minutes;\n } else {\n minEl.innerHTML = minutes;\n }\n}", "title": "" }, { "docid": "f3803c52420b4882a4402560519af393", "score": "0.58665264", "text": "toMinute() {\n\t\t\tconst rate = Dinero({ amount: hourlyRate }).divide(60);\n\t\t\treturn wrapDinero(rate);\n\t\t}", "title": "" }, { "docid": "8533e42d3dc62a1a248790b0af6b9285", "score": "0.58432716", "text": "function changeMinutesHour(timepicker) {\n if(getTypeHourMinute(timepicker) == MIN){\n changeDayNight(timepicker);\n } else {\n fillClock(MINS, timepicker.getElementsByClassName(\"tp_clock\")[0], false);\n }\n timepicker.getElementsByClassName(\"tp_hour\")[0].classList.toggle(\"time_active\");\n timepicker.getElementsByClassName(\"tp_minutes\")[0].classList.toggle(\"time_active\");\n}", "title": "" }, { "docid": "ba88e40ed862f88b30b8e6c343407516", "score": "0.5813481", "text": "function setHoursFromInputs() {\n if (self.hourElement === undefined || self.minuteElement === undefined)\n return;\n var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined\n ? (parseInt(self.secondElement.value, 10) || 0) % 60\n : 0;\n if (self.amPM !== undefined) {\n hours = ampm2military(hours, self.amPM.textContent);\n }\n var limitMinHours = self.config.minTime !== undefined ||\n (self.config.minDate &&\n self.minDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.minDate, true) ===\n 0);\n var limitMaxHours = self.config.maxTime !== undefined ||\n (self.config.maxDate &&\n self.maxDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.maxDate, true) ===\n 0);\n if (limitMaxHours) {\n var maxTime = self.config.maxTime !== undefined\n ? self.config.maxTime\n : self.config.maxDate;\n hours = Math.min(hours, maxTime.getHours());\n if (hours === maxTime.getHours())\n minutes = Math.min(minutes, maxTime.getMinutes());\n if (minutes === maxTime.getMinutes())\n seconds = Math.min(seconds, maxTime.getSeconds());\n }\n if (limitMinHours) {\n var minTime = self.config.minTime !== undefined\n ? self.config.minTime\n : self.config.minDate;\n hours = Math.max(hours, minTime.getHours());\n if (hours === minTime.getHours() && minutes < minTime.getMinutes())\n minutes = minTime.getMinutes();\n if (minutes === minTime.getMinutes())\n seconds = Math.max(seconds, minTime.getSeconds());\n }\n setHours(hours, minutes, seconds);\n }", "title": "" }, { "docid": "7b7d67bff3576a40e88b3e1c565abb93", "score": "0.5807961", "text": "function C009_Library_Yuki_TwoMinutes() {\n\tCurrentTime = CurrentTime + 110000;\t\n}", "title": "" }, { "docid": "09cea0c57bd5ed9d888cd3716af08c73", "score": "0.5803512", "text": "function setHoursFromInputs() {\n if (self.hourElement === undefined || self.minuteElement === undefined)\n return;\n var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24,\n minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined\n ? (parseInt(self.secondElement.value, 10) || 0) % 60\n : 0;\n if (self.amPM !== undefined) {\n hours = ampm2military(hours, self.amPM.textContent);\n }\n var limitMinHours = self.config.minTime !== undefined ||\n (self.config.minDate &&\n self.minDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.minDate, true) ===\n 0);\n var limitMaxHours = self.config.maxTime !== undefined ||\n (self.config.maxDate &&\n self.maxDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.maxDate, true) ===\n 0);\n if (limitMaxHours) {\n var maxTime = self.config.maxTime !== undefined\n ? self.config.maxTime\n : self.config.maxDate;\n hours = Math.min(hours, maxTime.getHours());\n if (hours === maxTime.getHours())\n minutes = Math.min(minutes, maxTime.getMinutes());\n if (minutes === maxTime.getMinutes())\n seconds = Math.min(seconds, maxTime.getSeconds());\n }\n if (limitMinHours) {\n var minTime = self.config.minTime !== undefined\n ? self.config.minTime\n : self.config.minDate;\n hours = Math.max(hours, minTime.getHours());\n if (hours === minTime.getHours() && minutes < minTime.getMinutes())\n minutes = minTime.getMinutes();\n if (minutes === minTime.getMinutes())\n seconds = Math.max(seconds, minTime.getSeconds());\n }\n setHours(hours, minutes, seconds);\n }", "title": "" }, { "docid": "e8b4ebd8adbf1be6b74544b61fc083b8", "score": "0.57968974", "text": "function setHoursFromInputs() {\n if (self.hourElement === undefined || self.minuteElement === undefined)\n return;\n var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined\n ? (parseInt(self.secondElement.value, 10) || 0) % 60\n : 0;\n if (self.amPM !== undefined) {\n hours = ampm2military(hours, self.amPM.textContent);\n }\n var limitMinHours = self.config.minTime !== undefined ||\n (self.config.minDate &&\n self.minDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.minDate, true) ===\n 0);\n var limitMaxHours = self.config.maxTime !== undefined ||\n (self.config.maxDate &&\n self.maxDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.maxDate, true) ===\n 0);\n if (limitMaxHours) {\n var maxTime = self.config.maxTime !== undefined\n ? self.config.maxTime\n : self.config.maxDate;\n hours = Math.min(hours, maxTime.getHours());\n if (hours === maxTime.getHours())\n minutes = Math.min(minutes, maxTime.getMinutes());\n if (minutes === maxTime.getMinutes())\n seconds = Math.min(seconds, maxTime.getSeconds());\n }\n if (limitMinHours) {\n var minTime = self.config.minTime !== undefined\n ? self.config.minTime\n : self.config.minDate;\n hours = Math.max(hours, minTime.getHours());\n if (hours === minTime.getHours())\n minutes = Math.max(minutes, minTime.getMinutes());\n if (minutes === minTime.getMinutes())\n seconds = Math.max(seconds, minTime.getSeconds());\n }\n setHours(hours, minutes, seconds);\n }", "title": "" }, { "docid": "02d4f6084ffe213f83b1f7bf4253862b", "score": "0.5796801", "text": "function hoursMinutes() {\r\n return nf(twelveHour(), 2) + ':' + nf(minute(), 2);\r\n}", "title": "" }, { "docid": "128ceb853bae89042ddf3683c42284f2", "score": "0.57892346", "text": "function checkMinute() {\n\tvar date = new Date;\n\tvar minute = date.getMinutes();\n\tif (minute == 0 || minute ==30) {\n\t\tconsole.log(\"Time to update\");\n\t\tgetNewWeather();\n\t\tconsole.log(\"Done updating the weather\");\n\t}\n\telse {\n\t\tconsole.log(\"Minute is: \" + minute + \". It's not time yet.\");\n\t}\n}", "title": "" }, { "docid": "0f70936b725b9f7da3e8c3b07fb07811", "score": "0.578882", "text": "function minutesSeconds($this, opts) {\n var id = $this.attr('id');\n var time = \"\";\n if (window['minutes_MS' + id] === opts.minutes && window['seconds_MS' + id] === opts.seconds) {\n time = prepareTime($this, opts, 0, 0, 0, 0, window['minutes_MS' + id], window['seconds_MS' + id]);\n html($this, time, opts);\n if (typeof window['beforeExpiry_MS' + id] !== 'undefined') {\n beforeExpiryTime($this, opts, time, 'MS');\n }\n if (window['minutes_MS' + id] !== 0 && window['seconds_MS' + id] === 0) {\n window['minutes_MS' + id]--;\n window['seconds_MS' + id] = 60 - opts.tickInterval;\n } else if (window['minutes_MS' + id] === 0 && window['seconds_MS' + id] === 0) {\n clearTimerInterval($this, \"MS\", opts);\n } else {\n window['seconds_MS' + id] -= opts.tickInterval;\n }\n if ($this.data('countdowntimer').destroy === true) clearTimerInterval($this, \"MS\", opts);\n } else {\n time = prepareTime($this, opts, 0, 0, 0, 0, window['minutes_MS' + id], window['seconds_MS' + id]);\n html($this, time, opts);\n if (typeof window['beforeExpiry_MS' + id] !== 'undefined') {\n beforeExpiryTime($this, opts, time, 'MS');\n }\n window['seconds_MS' + id] -= opts.tickInterval;\n if (window['minutes_MS' + id] !== 0 && window['seconds_MS' + id] < 0) {\n window['minutes_MS' + id]--;\n window['seconds_MS' + id] = 60 - opts.tickInterval;\n }\n if ((window['minutes_MS' + id] === 0 && window['seconds_MS' + id] < 0) || $this.data('countdowntimer').destroy === true) {\n clearTimerInterval($this, \"MS\", opts);\n }\n }\n id = null;\n }", "title": "" }, { "docid": "eb50b3e49c1d7d61eb3e134204e4b632", "score": "0.5787984", "text": "function setTimeFunc() {\n\tsetInterval(function() {\n\t\tgetAllParams();\n\t\tif(getDictionaryLength(allParams[\"selfLoc\"]) > 0 && allParams[\"settings\"][\"positioning\"]) {\n\t\t\t__showCurrentLocation(false);\n\t\t}\n\t}, parseInt(run_peroid));\n}", "title": "" }, { "docid": "3bee8fd936b8927f6f7239009d6abd15", "score": "0.5787055", "text": "function setHoursFromInputs() {\n if (self.hourElement === undefined || self.minuteElement === undefined)\n return;\n var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined\n ? (parseInt(self.secondElement.value, 10) || 0) % 60\n : 0;\n if (self.amPM !== undefined) {\n hours = ampm2military(hours, self.amPM.textContent);\n }\n var limitMinHours = self.config.minTime !== undefined ||\n (self.config.minDate &&\n self.minDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.minDate, true) ===\n 0);\n var limitMaxHours = self.config.maxTime !== undefined ||\n (self.config.maxDate &&\n self.maxDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.maxDate, true) ===\n 0);\n if (limitMaxHours) {\n var maxTime = self.config.maxTime !== undefined\n ? self.config.maxTime\n : self.config.maxDate;\n hours = Math.min(hours, maxTime.getHours());\n if (hours === maxTime.getHours())\n minutes = Math.min(minutes, maxTime.getMinutes());\n if (minutes === maxTime.getMinutes())\n seconds = Math.min(seconds, maxTime.getSeconds());\n }\n if (limitMinHours) {\n var minTime = self.config.minTime !== undefined\n ? self.config.minTime\n : self.config.minDate;\n hours = Math.max(hours, minTime.getHours());\n if (hours === minTime.getHours())\n minutes = Math.max(minutes, minTime.getMinutes());\n if (minutes === minTime.getMinutes())\n seconds = Math.max(seconds, minTime.getSeconds());\n }\n setHours(hours, minutes, seconds);\n }", "title": "" }, { "docid": "3bee8fd936b8927f6f7239009d6abd15", "score": "0.5787055", "text": "function setHoursFromInputs() {\n if (self.hourElement === undefined || self.minuteElement === undefined)\n return;\n var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined\n ? (parseInt(self.secondElement.value, 10) || 0) % 60\n : 0;\n if (self.amPM !== undefined) {\n hours = ampm2military(hours, self.amPM.textContent);\n }\n var limitMinHours = self.config.minTime !== undefined ||\n (self.config.minDate &&\n self.minDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.minDate, true) ===\n 0);\n var limitMaxHours = self.config.maxTime !== undefined ||\n (self.config.maxDate &&\n self.maxDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.maxDate, true) ===\n 0);\n if (limitMaxHours) {\n var maxTime = self.config.maxTime !== undefined\n ? self.config.maxTime\n : self.config.maxDate;\n hours = Math.min(hours, maxTime.getHours());\n if (hours === maxTime.getHours())\n minutes = Math.min(minutes, maxTime.getMinutes());\n if (minutes === maxTime.getMinutes())\n seconds = Math.min(seconds, maxTime.getSeconds());\n }\n if (limitMinHours) {\n var minTime = self.config.minTime !== undefined\n ? self.config.minTime\n : self.config.minDate;\n hours = Math.max(hours, minTime.getHours());\n if (hours === minTime.getHours())\n minutes = Math.max(minutes, minTime.getMinutes());\n if (minutes === minTime.getMinutes())\n seconds = Math.max(seconds, minTime.getSeconds());\n }\n setHours(hours, minutes, seconds);\n }", "title": "" }, { "docid": "3bee8fd936b8927f6f7239009d6abd15", "score": "0.5787055", "text": "function setHoursFromInputs() {\n if (self.hourElement === undefined || self.minuteElement === undefined)\n return;\n var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined\n ? (parseInt(self.secondElement.value, 10) || 0) % 60\n : 0;\n if (self.amPM !== undefined) {\n hours = ampm2military(hours, self.amPM.textContent);\n }\n var limitMinHours = self.config.minTime !== undefined ||\n (self.config.minDate &&\n self.minDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.minDate, true) ===\n 0);\n var limitMaxHours = self.config.maxTime !== undefined ||\n (self.config.maxDate &&\n self.maxDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.maxDate, true) ===\n 0);\n if (limitMaxHours) {\n var maxTime = self.config.maxTime !== undefined\n ? self.config.maxTime\n : self.config.maxDate;\n hours = Math.min(hours, maxTime.getHours());\n if (hours === maxTime.getHours())\n minutes = Math.min(minutes, maxTime.getMinutes());\n if (minutes === maxTime.getMinutes())\n seconds = Math.min(seconds, maxTime.getSeconds());\n }\n if (limitMinHours) {\n var minTime = self.config.minTime !== undefined\n ? self.config.minTime\n : self.config.minDate;\n hours = Math.max(hours, minTime.getHours());\n if (hours === minTime.getHours())\n minutes = Math.max(minutes, minTime.getMinutes());\n if (minutes === minTime.getMinutes())\n seconds = Math.max(seconds, minTime.getSeconds());\n }\n setHours(hours, minutes, seconds);\n }", "title": "" }, { "docid": "3bee8fd936b8927f6f7239009d6abd15", "score": "0.5787055", "text": "function setHoursFromInputs() {\n if (self.hourElement === undefined || self.minuteElement === undefined)\n return;\n var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined\n ? (parseInt(self.secondElement.value, 10) || 0) % 60\n : 0;\n if (self.amPM !== undefined) {\n hours = ampm2military(hours, self.amPM.textContent);\n }\n var limitMinHours = self.config.minTime !== undefined ||\n (self.config.minDate &&\n self.minDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.minDate, true) ===\n 0);\n var limitMaxHours = self.config.maxTime !== undefined ||\n (self.config.maxDate &&\n self.maxDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.maxDate, true) ===\n 0);\n if (limitMaxHours) {\n var maxTime = self.config.maxTime !== undefined\n ? self.config.maxTime\n : self.config.maxDate;\n hours = Math.min(hours, maxTime.getHours());\n if (hours === maxTime.getHours())\n minutes = Math.min(minutes, maxTime.getMinutes());\n if (minutes === maxTime.getMinutes())\n seconds = Math.min(seconds, maxTime.getSeconds());\n }\n if (limitMinHours) {\n var minTime = self.config.minTime !== undefined\n ? self.config.minTime\n : self.config.minDate;\n hours = Math.max(hours, minTime.getHours());\n if (hours === minTime.getHours())\n minutes = Math.max(minutes, minTime.getMinutes());\n if (minutes === minTime.getMinutes())\n seconds = Math.max(seconds, minTime.getSeconds());\n }\n setHours(hours, minutes, seconds);\n }", "title": "" }, { "docid": "3bee8fd936b8927f6f7239009d6abd15", "score": "0.5787055", "text": "function setHoursFromInputs() {\n if (self.hourElement === undefined || self.minuteElement === undefined)\n return;\n var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined\n ? (parseInt(self.secondElement.value, 10) || 0) % 60\n : 0;\n if (self.amPM !== undefined) {\n hours = ampm2military(hours, self.amPM.textContent);\n }\n var limitMinHours = self.config.minTime !== undefined ||\n (self.config.minDate &&\n self.minDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.minDate, true) ===\n 0);\n var limitMaxHours = self.config.maxTime !== undefined ||\n (self.config.maxDate &&\n self.maxDateHasTime &&\n self.latestSelectedDateObj &&\n compareDates(self.latestSelectedDateObj, self.config.maxDate, true) ===\n 0);\n if (limitMaxHours) {\n var maxTime = self.config.maxTime !== undefined\n ? self.config.maxTime\n : self.config.maxDate;\n hours = Math.min(hours, maxTime.getHours());\n if (hours === maxTime.getHours())\n minutes = Math.min(minutes, maxTime.getMinutes());\n if (minutes === maxTime.getMinutes())\n seconds = Math.min(seconds, maxTime.getSeconds());\n }\n if (limitMinHours) {\n var minTime = self.config.minTime !== undefined\n ? self.config.minTime\n : self.config.minDate;\n hours = Math.max(hours, minTime.getHours());\n if (hours === minTime.getHours())\n minutes = Math.max(minutes, minTime.getMinutes());\n if (minutes === minTime.getMinutes())\n seconds = Math.max(seconds, minTime.getSeconds());\n }\n setHours(hours, minutes, seconds);\n }", "title": "" }, { "docid": "ccfc8bd5e18f5cfa1ec3514ebc4d95a7", "score": "0.57832754", "text": "function TimeSetter() {}", "title": "" }, { "docid": "a23afca237dbd5ad7247bf699123c0ae", "score": "0.5774913", "text": "constructor() {\n this.hour = 0;\n this.minute = 0;\n }", "title": "" }, { "docid": "30337e336907807335217792b4ca20d3", "score": "0.5707236", "text": "set minuteStep(step) {\n this._minuteStep = isInteger(step) ? step : this._config.minuteStep;\n }", "title": "" }, { "docid": "30337e336907807335217792b4ca20d3", "score": "0.5707236", "text": "set minuteStep(step) {\n this._minuteStep = isInteger(step) ? step : this._config.minuteStep;\n }", "title": "" }, { "docid": "30337e336907807335217792b4ca20d3", "score": "0.5707236", "text": "set minuteStep(step) {\n this._minuteStep = isInteger(step) ? step : this._config.minuteStep;\n }", "title": "" }, { "docid": "4578e96463a6fd09ad8dec3f2b242ee6", "score": "0.57059264", "text": "function setTime(minutes) {\n //Save the time limit in the database\n localStorage.setItem('timeLimitNoPrompt', minutes * 60) //time limit stored in seconds\n displayCountdownOrBlock()\n}", "title": "" }, { "docid": "15cc6d9d8215d7f56e46815e7f13ce1d", "score": "0.5699946", "text": "function hoursMinutes() {\n return nf(twelveHour(), 2) + ':' + nf(minute(), 2);\n}", "title": "" }, { "docid": "15cc6d9d8215d7f56e46815e7f13ce1d", "score": "0.5699946", "text": "function hoursMinutes() {\n return nf(twelveHour(), 2) + ':' + nf(minute(), 2);\n}", "title": "" }, { "docid": "15cc6d9d8215d7f56e46815e7f13ce1d", "score": "0.5699946", "text": "function hoursMinutes() {\n return nf(twelveHour(), 2) + ':' + nf(minute(), 2);\n}", "title": "" }, { "docid": "a10b64554524e223e3b2733174d6fd26", "score": "0.5659079", "text": "function getMinutes(date) {\n var clockMinutes = date.getMinutes();\n\n if (clockMinutes < 10) {\n clockMinutes = \"0\" + clockMinutes;\n }\n\n return clockMinutes;\n}", "title": "" }, { "docid": "0c8690e4014e60a5f4af688ff0b5dbf4", "score": "0.56585157", "text": "function Awake (){\n\tstartTime = 60;\n}", "title": "" }, { "docid": "b73bbc3eafed60cf3f35914feddf9f34", "score": "0.56462526", "text": "function time(arg1, arg2) {\n let startHours = Number(arg1);\n let startMinutes = Number(arg2) + 15;\n let timeInMin = startHours * 60 + startMinutes;\n let finalHours = Math.floor(timeInMin / 60)\n let finalMinutes = timeInMin % 60\n\n if (finalHours >= 24) {\n finalHours -= 24;\n }\n if (finalMinutes < 10) {\n console.log(`${finalHours}:0${finalMinutes}`);\n } else {\n console.log(`${finalHours}:${finalMinutes}`)\n }\n}", "title": "" }, { "docid": "91d7bcd9f34b77c69fa445609f6ad6fa", "score": "0.5635627", "text": "sanitizeMinutes(e) {\n let minutes = e.target.value;\n // handle invalid values of minutes\n if (minutes < 0){\n minutes = 0;\n e.target.value = minutes;\n }\n \n return minutes;\n }", "title": "" }, { "docid": "c164e5cb9ed815bc3587c089cd2c7d63", "score": "0.5618257", "text": "function hoursMinutesSeconds($this, opts) {\n var id = $this.attr('id');\n var time = \"\";\n if (window['minutes_HMS' + id] === opts.minutes && window['seconds_HMS' + id] === opts.seconds && window['hours_HMS' + id] === opts.hours) {\n time = prepareTime($this, opts, 0, 0, 0, window['hours_HMS' + id], window['minutes_HMS' + id], window['seconds_HMS' + id]);\n html($this, time, opts);\n if (typeof window['beforeExpiry_HMS' + id] !== 'undefined') {\n beforeExpiryTime($this, opts, time, 'HMS');\n }\n if (window['hours_HMS' + id] === 0 && window['minutes_HMS' + id] === 0 && window['seconds_HMS' + id] === 0) {\n clearTimerInterval($this, \"HMS\", opts);\n } else if (window['hours_HMS' + id] !== 0 && window['minutes_HMS' + id] === 0 && window['seconds_HMS' + id] === 0) {\n window['hours_HMS' + id]--;\n window['minutes_HMS' + id] = 59;\n window['seconds_HMS' + id] = 60 - opts.tickInterval;\n } else if (window['hours_HMS' + id] === 0 && window['minutes_HMS' + id] !== 0 && window['seconds_HMS' + id] === 0) {\n window['minutes_HMS' + id]--;\n window['seconds_HMS' + id] = 60 - opts.tickInterval;\n } else if (window['hours_HMS' + id] !== 0 && window['minutes_HMS' + id] !== 0 && window['seconds_HMS' + id] === 0) {\n window['minutes_HMS' + id]--;\n window['seconds_HMS' + id] = 60 - opts.tickInterval;\n } else {\n window['seconds_HMS' + id] -= opts.tickInterval;\n }\n if ($this.data('countdowntimer').destroy === true) clearTimerInterval($this, \"HMS\", opts);\n } else {\n time = prepareTime($this, opts, 0, 0, 0, window['hours_HMS' + id], window['minutes_HMS' + id], window['seconds_HMS' + id]);\n html($this, time, opts);\n if (typeof window['beforeExpiry_HMS' + id] !== 'undefined') {\n beforeExpiryTime($this, opts, time, 'HMS');\n }\n window['seconds_HMS' + id] -= opts.tickInterval;\n if (window['minutes_HMS' + id] !== 0 && window['seconds_HMS' + id] < 0) {\n window['minutes_HMS' + id]--;\n window['seconds_HMS' + id] = 60 - opts.tickInterval;\n }\n if (window['minutes_HMS' + id] === 0 && window['seconds_HMS' + id] < 0 && window['hours_HMS' + id] !== 0) {\n window['hours_HMS' + id]--;\n window['minutes_HMS' + id] = 59;\n window['seconds_HMS' + id] = 60 - opts.tickInterval;\n }\n if ((window['minutes_HMS' + id] === 0 && window['seconds_HMS' + id] < 0 && window['hours_HMS' + id] === 0) || $this.data('countdowntimer').destroy === true) {\n clearTimerInterval($this, \"HMS\", opts);\n }\n }\n id = null;\n }", "title": "" }, { "docid": "5fd1987ea7ddbafb1474c8ba0e274931", "score": "0.5613061", "text": "function tpStartSelect( time, endTimePickerInst ) {\n $('#timepicker_end').timepicker('option', {\n minTime: {\n hour: endTimePickerInst.hours,\n minute: endTimePickerInst.minutes\n }\n });\n}", "title": "" }, { "docid": "1e6eb230936f1a6f55ee791a01177ef4", "score": "0.560801", "text": "function getBreak(5) {\n var minutes\n}", "title": "" }, { "docid": "585c2be9924664639ca0485cd08e35bb", "score": "0.56067336", "text": "function calculateMinutes(minutes){\n var minutesFromMinutes = minutes.split(\"min\")\n return minutesFromMinutes[0]\n }", "title": "" }, { "docid": "23fdeee2c7bfb4358951f375b4a28e0c", "score": "0.56063116", "text": "function callBack(){\n minute++\n\n if(minute === 60){\n minute = 00;\n hour++\n }\n \n}", "title": "" }, { "docid": "0733a4f8f0fb02bfd363bfbd2e1d2299", "score": "0.5567209", "text": "function minute_update(){\n if (minute_timer === 0){\n minutes = \"00\"\n }\n if (minute_timer < 10){\n minutes = \"0\"+minute_timer\n }\n }//end minute update", "title": "" }, { "docid": "250e5a890233fae273bf2a586c64a85d", "score": "0.5489668", "text": "function getMinutes( hours ) {\r\n return hours * 60;\r\n}", "title": "" }, { "docid": "4f27eceb99de13c7a619b94286292837", "score": "0.547902", "text": "function hoursMinutes() {\n return nf(humanHour(), 2) + ':' + nf(minute(), 2);\n}", "title": "" }, { "docid": "cd549b69c506fd493f90e35ddcbea40b", "score": "0.54784715", "text": "function setStartTime() {\n\n}", "title": "" }, { "docid": "2cb8e65ebad50c32282b7d2a1d506050", "score": "0.5464796", "text": "function getMinutes(event) {\r\n // Prevent the page to update when the mins are submitted\r\n event.preventDefault();\r\n // console.log(this.minutes.value);\r\n // Save the input value in a variable\r\n const mins = this.minutes.value;\r\n // Change mins to seconds and use the input value in the function to set the timer\r\n timer(mins * 60);\r\n // reset the input field\r\n this.reset();\r\n}", "title": "" }, { "docid": "ae875a81371475926ee596a693bbf13d", "score": "0.5448663", "text": "set_current_time(hours, minutes) {\n this.current.time = new Date(3600000 * hours + 60000 * minutes);\n if (this.start_time === undefined) {\n this.start_time = this.current.time;\n }\n }", "title": "" }, { "docid": "5273c8eb51cac12c82c81bac359ab2e8", "score": "0.54322267", "text": "function SlidergetTime(hours, minutes) \r\n{\r\n var time = null;\r\n minutes = minutes + \"\";\r\n\r\n if (minutes.length == 1) {\r\n minutes = \"0\" + minutes;\r\n }\r\n return hours + \":\" + minutes;\r\n}", "title": "" }, { "docid": "ecb1f7a230993b484b40bffbd9475328", "score": "0.5430951", "text": "function convert(minutes)\r\n{\r\n return minutes*60;\r\n}", "title": "" }, { "docid": "c6bd929c05269c7332a8f9e6337a262e", "score": "0.5414599", "text": "_set12HourMode () {\n this.setHourMode(12);\n }", "title": "" }, { "docid": "8fb8950781b37dd4745c541ad13a46dd", "score": "0.5393772", "text": "showMinutes() {\n\t\t//Select minutes button visually\n\t\tthis.parent.find(\".hoursButton\").removeClass(\"buttonSelected\")\n\t\tthis.parent.find(\".minutesButton\").addClass(\"buttonSelected\")\n\t\tthis.parent.find(\".amPmButton\").removeClass(\"buttonSelected\")\n\t\t//Show the minutes clock, not the hours clock\n\t\tthis.parent.find(\".hoursClockWrapper\").fadeOut(200)\n\t\tthis.parent.find(\".minutesClockWrapper:hidden\").fadeIn(200)\n\t}", "title": "" }, { "docid": "1871e93f896dd9b874bba2e08a968b59", "score": "0.53902787", "text": "function cronometro(){\n if ((min==2)&&(seg==0)){\n min = min-1;\n seg = 59;\n }\n if ( min ==1){\n if(seg!=0){\n seg = seg-1;\n }\n if(seg==0){\n min=min-1;\n seg=59;\n\n }\n }\n if( min == 0){\n seg = seg-1;\n }\n if(( min==0)&&(seg==0)){\n clearInterval(reloj);\n vaciarTablero();\n $('.panel-tablero').hide('fold','slow', function(){\n $('.panel-score').animate({\n width :\"100%\",\n },4000);\n });\n $('.time').hide();\n }\n $(\"#timer\").html(\"0\"+min+\":\"+seg);\n}", "title": "" }, { "docid": "42e5993711a471bbd406665e477335e1", "score": "0.5389433", "text": "function addMinutes(date, amount) {\n return add(date, amount, \"minutes\");\n}", "title": "" }, { "docid": "42e5993711a471bbd406665e477335e1", "score": "0.5389433", "text": "function addMinutes(date, amount) {\n return add(date, amount, \"minutes\");\n}", "title": "" }, { "docid": "42e5993711a471bbd406665e477335e1", "score": "0.5389433", "text": "function addMinutes(date, amount) {\n return add(date, amount, \"minutes\");\n}", "title": "" }, { "docid": "dc4d47ce438bccfea3d23960223f08b2", "score": "0.53665423", "text": "function cronometro ( selector, minute, second) {\n var tiempo = { minuto: minute, segundo: second };\n tiempo_corriendo = setInterval(function(){\n\n // Segundos\n tiempo.segundo++;\n if(tiempo.segundo >= 60) { tiempo.segundo = 0; tiempo.minuto++; }\n // Minutos\n if( (tiempo.minuto >= 40 && partido.tiempo==1) || (tiempo.minuto >= 80 && partido.tiempo==2) ) {\n $(\".top_data .partido_d p.time\").css('color', \"#ff0000\");\n } else {\n $(\".top_data .partido_d p.time\").css('color', \"#ffffff\");\n }\n\n partido.segundo = tiempo.segundo < 10 ? '0' + tiempo.segundo : tiempo.segundo;\n partido.minuto = tiempo.minuto < 10 ? '0' + tiempo.minuto : tiempo.minuto;\n\n $(selector).find(\".second\").text('');\n $(selector).find(\".minute\").text('');\n\n $(selector).find(\".second\").text(partido.segundo);\n $(selector).find(\".minute\").text(partido.minuto);\n\n }, 1000);\n}", "title": "" }, { "docid": "4b1117cce8f09f010f4931d853630b5c", "score": "0.5346955", "text": "function addMinutes() {\r\n //if ctrl is pressd\r\n if (ctrl == 1 && shift != 1) {\r\n //if minutesis above or equl to 49 set minutes to 0 and check hours\r\n if (minutes >= 49) {\r\n minutes = 0;\r\n //if hours is above or equel to 99 set hours to 99\r\n if (hours >= 99) {\r\n hours = 99;\r\n update();\r\n }\r\n //else add 1 to hours\r\n else {\r\n hours++;\r\n minutes = 0;\r\n update();\r\n }\r\n }\r\n //else add 10 to minutes\r\n else {\r\n minutes = minutes + 10;\r\n update();\r\n }\r\n }\r\n //if shift is pressd\r\n else {\r\n //if minutes above or equl to 59 set minutes to 0 and check hours\r\n if (minutes >= 59) {\r\n minutes = 0;\r\n //if hours is above or equel to 99 set hours to 99\r\n if (hours >= 99) {\r\n hours = 99;\r\n update();\r\n }\r\n //else add 1 to hours\r\n else {\r\n hours++;\r\n minutes = 0;\r\n update();\r\n }\r\n }\r\n //else add 1 to minutes\r\n else {\r\n minutes++;\r\n update();\r\n }\r\n }\r\n}", "title": "" }, { "docid": "2f12c8af7c444146f7b5799826618d34", "score": "0.53221315", "text": "function tpEndSelect( time, startTimePickerInst ) {\n $('#timepicker_start').timepicker('option', {\n maxTime: {\n hour: startTimePickerInst.hours,\n minute: startTimePickerInst.minutes\n }\n });\n}", "title": "" }, { "docid": "e1e789670b95eed7d0b3d04d0cc05a2e", "score": "0.5318531", "text": "function convertCurrentTimeToMinutes() {\n var currentHours = moment().hours();\n var currentMinutes = moment().minutes();\n \n // Calculation to add up the minutes.\n currentTimeTotalMin = currentMinutes + currentHours*60;\n }", "title": "" }, { "docid": "447b47caada6970902e8fefe0c7ec8a3", "score": "0.53091884", "text": "function minutes(min, max) {\r\n min = 10;\r\n max = 15;\r\n return Math.floor(Math.random() * (max - min + 1) + min);\r\n }", "title": "" }, { "docid": "effa4ca9abb4753dfceaf052a27b17fe", "score": "0.53072965", "text": "function runMeEveryMinute(descriptor, currentTime) {\n return `${currentTime} today - ${descriptor}`\n}", "title": "" }, { "docid": "fabd461059ce8d339e271b89141470a5", "score": "0.529177", "text": "function getCurrentMinutes() {\n var d = new Date();\n return 60 * d.getHours() + d.getMinutes();\n}", "title": "" }, { "docid": "c4b0b12a7bcde36360eece8b62ed7729", "score": "0.52868164", "text": "function changeMin (command, time) {\n let t;\n if (time == \"focus\")\n t = focusDurationVal;\n else if (time == \"short\")\n t = shortDurationVal;\n else\n t = longDurationVal;\n\n if (command == true) {\n if (t == 60) {\n return;\n }\n t += 1;\n }\n else {\n if(t == 1) {\n return;\n }\n t -= 1;\n }\n\n if (time == \"focus\")\n focusDurationVal = t;\n else if (time == \"short\")\n shortDurationVal = t;\n else\n longDurationVal = t;\n}", "title": "" }, { "docid": "778be3e90b0328aa1846ba8851b45ae1", "score": "0.5283721", "text": "function setTime() {\n var minutes;\n if (status === \"Working\") {\n minutes = workMinutesInput.value.trim();\n } else {\n minutes = restMinutesInput.value.trim();\n }\n clearInterval(interval);\n totalSeconds = 75;\n}", "title": "" }, { "docid": "5c5d908e3fc62b7b96aa535222a92ca1", "score": "0.5280336", "text": "function timeMi(){ \n min = min - 1;\n document.querySelector('.minutes').innerHTML = min;\n }", "title": "" }, { "docid": "adc1ad78b38286885d74335abc87f96b", "score": "0.527647", "text": "function setUpMinuteHands() {\n // More tricky, this needs to move the minute hand when the second hand hits zero\n var containers = document.querySelectorAll('.minutes-container');\n var secondAngle = containers[containers.length - 1].getAttribute('data-second-angle');\n console.log(secondAngle);\n if (secondAngle > 0) {\n // Set a timeout until the end of the current minute, to move the hand\n var delay = (((360 - secondAngle) / 6) + 0.1) * 1000;\n console.log(delay);\n setTimeout(function () {\n moveMinuteHands(containers);\n }, delay);\n }\n }", "title": "" }, { "docid": "7708e826b190aa526ca720405aa9f50d", "score": "0.5271584", "text": "function checkMinutes(minutes) {\n if (minutes == 0) {\n console.log('Game Over');\n // deactivate input\n var inputElement = document.getElementById('get-state');\n inputElement.disabled = true;\n alert('Times up');\n clearInterval(tiempo);\n clearStatesArray();\n // reset minutes and seconds\n minutesElement.innerText = startingMinutes;\n secondsElement.innerText = startingSeconds;\n doFetch();\n return true;\n }\n }", "title": "" }, { "docid": "6f138e37e46ed6da55d39587d6f33328", "score": "0.5268511", "text": "function convertMinutesToJStime(UserMinutes) {\n jsTimer = Number(UserMinutes) * 60\n}", "title": "" }, { "docid": "bf50c7f9c1718345f826efb26141401e", "score": "0.5264826", "text": "initial() {\n const minutes = 25;\n this.totalTime = minutesToSeconds(minutes);\n this.timeElapsed = 0;\n }", "title": "" }, { "docid": "78127738873e6151039802035344ad05", "score": "0.5263015", "text": "function setupMinuteHands() {\n var containers = document.querySelectorAll('.minutes-container');\n var secondAngle = containers[0].getAttribute(\"data-second-angle\");\n if(secondAngle > 0) {\n // sets a timeout until the end of the current minute, then it moves the hand\n var delay = (((360 - secondAngle) / 6) + 0.1) * 1000;\n setTimeout(function() {\n moveMinuteHands(containers);\n }, delay);\n }\n}", "title": "" }, { "docid": "1fc08e3893b1df759fbbbf0f32181ff2", "score": "0.525959", "text": "static set fixedTime(value) {}", "title": "" }, { "docid": "040497491b89befbc4d9ad6d7c7918a8", "score": "0.525665", "text": "function convertMinutes( time ) {\n var hours = 0;\n while ( time > 60 ) {\n time = time - 60;\n hours++;\n }\n return hours + ':' + time;\n }", "title": "" }, { "docid": "a6684383d2f45e5048e0e25aa0c8df6b", "score": "0.52528876", "text": "refrehMe() {\n // mbgGame.log(\"clock refresh\");\n this.hour.angle = -moment().hour() * 360 / 12;\n this.minute.angle = -moment().minute() * 360 / 60;\n }", "title": "" }, { "docid": "815b558d8c3fe834cf23869e70210233", "score": "0.52474517", "text": "function roundMinute(minutes) {\n var rounded = (Math.round(minutes / 5).toFixed(0) * 5)\n , out\n ;\n\n if (minutes > 30 )\n out = 60 - rounded;\n else\n out = rounded;\n\n return out;\n\n}", "title": "" }, { "docid": "d35e0980f930c8bf313c3e258f76e346", "score": "0.5246826", "text": "function minutes_in_hours(m) {\n return m / 60;\n}", "title": "" }, { "docid": "db6127c6e9c396fcb5c69ab2e06fefc1", "score": "0.524009", "text": "function convertMinutes(y){\n //y is value in minutes\n return (y * 60);\n}", "title": "" }, { "docid": "3f0935bc18dc705fe8e59da5a6881b93", "score": "0.52397805", "text": "static set time(value) {}", "title": "" }, { "docid": "832b39e06a2fd6ef1199f88f9314bedd", "score": "0.5231214", "text": "onChangeTime() {}", "title": "" }, { "docid": "bd2d3931aa78380404dd338beb84eb17", "score": "0.52307355", "text": "function resetCurrentMinutes(){\n\t\t/*\n\t\t\tGets the minutes display elements\n\t\t*/\n\t\tlet minuteSelectors = document.querySelectorAll('.amplitude-current-minutes');\n\n\t\t/*\n\t\t\tIterates over all of the minute selectors and sets the inner HTML\n\t\t\tto 00.\n\t\t*/\n\t\tfor( let i = 0; i < minuteSelectors.length; i++ ){\n\t\t\tminuteSelectors[i].innerHTML = '00';\n\t\t}\n\t}", "title": "" }, { "docid": "849ef16e6c65560db140097d67850891", "score": "0.52287984", "text": "static set unscaledTime(value) {}", "title": "" }, { "docid": "ebdeb48e9c3a854c6b4728882f8ff7db", "score": "0.5226326", "text": "function changeDefaultTimeOut() {\n let user = db.ref('users/' + userId);\n\n const newDefaultTime = app.getArgument('newDefaultTime');\n\n if (newDefaultTime && (newDefaultTime * 60) > 0) {\n let minutes = parseInt(newDefaultTime) * 60;\n let promise = user.set({userId: userId, defaultCheckOutTime: minutes});\n console.log(minutes);\n\n app.tell(`Done. The default checkout time as been updated to ${newDefaultTime} hours`);\n } else {\n app.tell(`Please say set the default time out to 8 hours or set timeout to 10 hours`);\n }\n }", "title": "" } ]
394bddb52d4b7681b374b952d49908ea
get the items in the tree that are currently selected
[ { "docid": "6f07f3e22df741256e025c63309d3f5b", "score": "0.7692929", "text": "function getCurrentTreeSelectedObjs() {\r\n \tvar tree = $.jstree.reference(\"#jstree_div\"); //get tree instance\r\n \tvar selNodes = tree.get_selected(true);\r\n\r\n \treturn selNodes;\r\n }", "title": "" } ]
[ { "docid": "f5aaf621809bc58b5180c648eb293fe4", "score": "0.73515934", "text": "function getCurrentPbtypeTreeSelectedObjs() {\r\n \tvar tree = $.jstree.reference(\"#jstree_div_pbtype\"); //get tree instance\r\n \tvar selNodes = tree.get_selected(true);\r\n\r\n \treturn selNodes;\r\n }", "title": "" }, { "docid": "6016c80c1851b7492227f65b2aa16ddf", "score": "0.70899147", "text": "function TreeGetCheckedItems()\n{\n var tree = this;\n return tree.checkedItems;\n}", "title": "" }, { "docid": "92b0cfc55ea489693da61a903bd6b1f8", "score": "0.6956895", "text": "get itemsInSelection() {\n return this._itemsInSelection;\n }", "title": "" }, { "docid": "a189a56a38a64ec6d24ed22bd213c4f6", "score": "0.68418926", "text": "function getCurrentlySelectedItems() {\n\t\t\t\tvar selectedRows = [];\n\n\t\t\t\tvm.grns.forEach(function addToSelected(item) {\n\t\t\t\t\tif (item.isSelected === true) {\n\t\t\t\t\t\tselectedRows.push(item);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn selectedRows;\n\t\t\t}", "title": "" }, { "docid": "b09ce326c3d2339df3d4c540979fcfb6", "score": "0.65787536", "text": "selectedChildren() {\n\t\t\treturn this.$refs.passages.filter(p => p.selected);\n\t\t}", "title": "" }, { "docid": "aee6ae10bab864c44ae7cc1c8c0c6de0", "score": "0.6542592", "text": "function getAllSelectedItems() {\n var selectedData = [];\n var selectedIds = getAllSelectedIds();\n selectedIds.forEach(function (id) {\n selectedData.push(self.getItemById(id));\n });\n return selectedData;\n }", "title": "" }, { "docid": "21330eb6a98827eb4ddfddd4de476251", "score": "0.6440575", "text": "function getSelectedCollection() {\n var id = tree.getSelections()[0];\n return tree.getDataById(id);\n}", "title": "" }, { "docid": "f1e3f98f0ee0ffed49d578e36c4d83e6", "score": "0.6394483", "text": "function selected() {\n return self.itemAt( $scope.selectedIndex );\n }", "title": "" }, { "docid": "093ab792ab3bac3f34280c5c90fe0fca", "score": "0.6302007", "text": "function select_tree_item(event) {\n // find current item and other items\n var item = event.currentTarget;\n var all = $(item).closest('.tree').find('.tree-selected');\n\n // remove highlighting\n if(all.length && $(all)[0] !== $(item)[0]) {\n all.removeClass('tree-selected');\n }\n\n // toggle highlighting\n if($(item).hasClass('tree-selected')) {\n $(item).removeClass('tree-selected');\n } else {\n $(item).addClass ('tree-selected');\n }\n }", "title": "" }, { "docid": "ad31c9751257f886fc1cd85a03319ca3", "score": "0.62880015", "text": "get selected() {\n var _a, _b;\n return this.multiple ? (((_a = this._selectionModel) === null || _a === void 0 ? void 0 : _a.selected) || []) :\n (_b = this._selectionModel) === null || _b === void 0 ? void 0 : _b.selected[0];\n }", "title": "" }, { "docid": "34321d7dadf83b3142c8e2dd871e1181", "score": "0.62852085", "text": "function traverse(nodes) {\n\t for (var i = 0, l = nodes.length; i < l; i++) {\n\t var node = nodes[i];\n\t if (node.isSelected()) {\n\t result.push(node);\n\t }\n\t else {\n\t // if not selected, then if it's a group, and the group\n\t // has children, continue to search for selections\n\t if (node.group && node.children) {\n\t traverse(node.children);\n\t }\n\t }\n\t }\n\t }", "title": "" }, { "docid": "83fed3f3c0e8330b27835240bd8c327e", "score": "0.6271493", "text": "function traverse(nodes) {\n for (var i = 0, l = nodes.length; i < l; i++) {\n var node = nodes[i];\n\n if (node.isSelected()) {\n result.push(node);\n } else {\n // if not selected, then if it's a group, and the group\n // has children, continue to search for selections\n if (node.group && node.children) {\n traverse(node.children);\n }\n }\n }\n }", "title": "" }, { "docid": "4c08bdc262aed99208506bce6da9021d", "score": "0.62680817", "text": "function getSelections( current, tree ) {\n\tconst project = current.project || Object.keys( tree ).sort()[ 0 ];\n\tconst owner = current.owner || Object.keys( _get( tree, [ project ], [] ) ).sort()[ 0 ];\n\tconst branch = current.branch || Object.keys( _get( tree, [ project, owner ], [] ) ).sort()[ 0 ];\n\tconst version = current.version ||\n\t\tgetVersions( {\n\t\t\ttree,\n\t\t\tselectedProject: project,\n\t\t\tselectedOwner: owner,\n\t\t\tselectedBranch: branch,\n\t\t\tpullBuild: current.pullBuild\n\t\t} )[ 0 ];\n\n\treturn {\n\t\tproject,\n\t\towner,\n\t\tbranch,\n\t\tversion,\n\t\thost: current.host,\n\t\tpullBuild: current.pullBuild\n\t};\n}", "title": "" }, { "docid": "776a5d3903519e4a3335a935f7631e2f", "score": "0.62545687", "text": "function traverse(nodes) {\n for (var i = 0, l = nodes.length; i < l; i++) {\n var node = nodes[i];\n if (node.isSelected()) {\n result.push(node);\n }\n else {\n // if not selected, then if it's a group, and the group\n // has children, continue to search for selections\n if (node.group && node.children) {\n traverse(node.children);\n }\n }\n }\n }", "title": "" }, { "docid": "776a5d3903519e4a3335a935f7631e2f", "score": "0.62545687", "text": "function traverse(nodes) {\n for (var i = 0, l = nodes.length; i < l; i++) {\n var node = nodes[i];\n if (node.isSelected()) {\n result.push(node);\n }\n else {\n // if not selected, then if it's a group, and the group\n // has children, continue to search for selections\n if (node.group && node.children) {\n traverse(node.children);\n }\n }\n }\n }", "title": "" }, { "docid": "776a5d3903519e4a3335a935f7631e2f", "score": "0.62545687", "text": "function traverse(nodes) {\n for (var i = 0, l = nodes.length; i < l; i++) {\n var node = nodes[i];\n if (node.isSelected()) {\n result.push(node);\n }\n else {\n // if not selected, then if it's a group, and the group\n // has children, continue to search for selections\n if (node.group && node.children) {\n traverse(node.children);\n }\n }\n }\n }", "title": "" }, { "docid": "776a5d3903519e4a3335a935f7631e2f", "score": "0.62545687", "text": "function traverse(nodes) {\n for (var i = 0, l = nodes.length; i < l; i++) {\n var node = nodes[i];\n if (node.isSelected()) {\n result.push(node);\n }\n else {\n // if not selected, then if it's a group, and the group\n // has children, continue to search for selections\n if (node.group && node.children) {\n traverse(node.children);\n }\n }\n }\n }", "title": "" }, { "docid": "776a5d3903519e4a3335a935f7631e2f", "score": "0.62545687", "text": "function traverse(nodes) {\n for (var i = 0, l = nodes.length; i < l; i++) {\n var node = nodes[i];\n if (node.isSelected()) {\n result.push(node);\n }\n else {\n // if not selected, then if it's a group, and the group\n // has children, continue to search for selections\n if (node.group && node.children) {\n traverse(node.children);\n }\n }\n }\n }", "title": "" }, { "docid": "776a5d3903519e4a3335a935f7631e2f", "score": "0.62545687", "text": "function traverse(nodes) {\n for (var i = 0, l = nodes.length; i < l; i++) {\n var node = nodes[i];\n if (node.isSelected()) {\n result.push(node);\n }\n else {\n // if not selected, then if it's a group, and the group\n // has children, continue to search for selections\n if (node.group && node.children) {\n traverse(node.children);\n }\n }\n }\n }", "title": "" }, { "docid": "695a809a450dc598931936759a17554e", "score": "0.62373453", "text": "get selectedComponents() {\n return this.selection.map( oid => this.getEditableComponentForOid(oid) ).filter(Boolean);\n }", "title": "" }, { "docid": "4f2b9d6ced1c205f0911cdcf51482ca9", "score": "0.62265027", "text": "function getSelectedFiles() {\r\n var allFilesArray = new Array();\r\n var allSelectedFilesArray = new Array();\r\n var selItems = new Array();\r\n if (app.project != null) {\r\n var items = app.project.items;\r\n for (var i = 1; i <= items.length; i += 1) {\r\n if (items[i] instanceof FootageItem && items[i].mainSource instanceof FileSource) {\r\n allFilesArray[allFilesArray.length] = items[i];\r\n }\r\n }\r\n }\r\n \r\n var i = app.project.selection.length;\r\n while (i--) {\r\n\t\t\t\tvar theItem = app.project.selection[i];\r\n if (theItem instanceof FootageItem && theItem.mainSource instanceof FileSource) {\r\n allSelectedFilesArray[allSelectedFilesArray.length] = theItem\r\n \r\n } else if (theItem instanceof FolderItem) {\r\n getSubContents(theItem)\r\n }\r\n \r\n }\r\n \r\n function getSubContents(folder) {\r\n\t\t\t\tif (folder != null && folder instanceof FolderItem) {\r\n\t\t\t\t\tvar i = folder.numItems;\r\n\t\t\t\t\twhile (i > 0) {\r\n\t\t\t\t\t\tprojItem = folder.items[i];\r\n\t\t\t\t\t\tallSelectedFilesArray[allSelectedFilesArray.length] = projItem;\r\n\t\t\t\t\t\tif (projItem instanceof FolderItem) {\r\n\t\t\t\t\t\t\tgetSubContents(projItem)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ti--;\r\n\t\t\t\t\t}\r\n //alert(allSelectedFilesArray);\r\n\t\t\t\t}\r\n\t\t\t}\r\n \r\n return allSelectedFilesArray;\r\n }", "title": "" }, { "docid": "17220d57a8b347acb0aaa2aaf9a68d37", "score": "0.6224319", "text": "get selection(){ return this._selection || []; }", "title": "" }, { "docid": "409991a650d165c025b3953147829f06", "score": "0.6216558", "text": "function getChildrenIds () {\n var childrenIds = [];\n var elements = Array.from($('.selected'));\n elements.forEach(el => {\n var children = Array.from($(el).children());\n children.forEach(ch => {\n childrenIds.push($(ch)[0].id);\n });\n });\n return childrenIds;\n}", "title": "" }, { "docid": "b6cd699ff045cb1b8c03a060bcd2d59f", "score": "0.62060076", "text": "getSelections() {\n const selections = this.doc.listSelections();\n if (selections.length > 0) {\n return selections.map(selection => this._toSelection(selection));\n }\n const cursor = this.doc.getCursor();\n const selection = this._toSelection({ anchor: cursor, head: cursor });\n return [selection];\n }", "title": "" }, { "docid": "b6cd699ff045cb1b8c03a060bcd2d59f", "score": "0.62060076", "text": "getSelections() {\n const selections = this.doc.listSelections();\n if (selections.length > 0) {\n return selections.map(selection => this._toSelection(selection));\n }\n const cursor = this.doc.getCursor();\n const selection = this._toSelection({ anchor: cursor, head: cursor });\n return [selection];\n }", "title": "" }, { "docid": "2789ce1ff32a031967898e57210e1f19", "score": "0.6181302", "text": "function getCurrentMenuAndSelection() {\n var retval = {menu:null, selected:null};\n var selected = dojo.query(\".\" + config.classes.selected);\n if (selected.length > 0) {\n retval.selected = selected[0];\n retval.menu = getMenuOf(retval.selected);\n }\n return retval;\n}", "title": "" }, { "docid": "e7f05b322e9edb2cc8abf2422bb4b07d", "score": "0.61601025", "text": "function itemsselected(keyname) {\n // clear out the array\n itemselected = [];\n for (var i=0; i < keyname.options.length; i++){\n if (keyname.options[i].selected==true){\n itemselected.push(keyname.options[i].text);\n }\n }\n return itemselected\n}", "title": "" }, { "docid": "7876458b8fd4aab0a30671e2cdf4b64b", "score": "0.6107521", "text": "getChildren() {\n\t\treturn this.items;\n\t}", "title": "" }, { "docid": "4cfa423bd343e3b95cc5c6b0f7e625da", "score": "0.6106624", "text": "function getCurrentlySelectedDocuments() {\n\t\t\t\tvar selectedRows = [];\n\n\t\t\t\tvm.documents.forEach(function addToSelected(item) {\n\t\t\t\t\tif (item.isSelected === true) {\n\t\t\t\t\t\tselectedRows.push(item);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\treturn selectedRows;\n\t\t\t}", "title": "" }, { "docid": "d6b0416a4b60cee83d4a9c857f6297af", "score": "0.6105422", "text": "getCellsSelected() {\n return this.graph.getSelectionCells();\n }", "title": "" }, { "docid": "49d1720d82ca6f58522dbf595f23d318", "score": "0.6098806", "text": "function get_selected_features ()\n {\n return (CURRENT_SELECTION);\n }", "title": "" }, { "docid": "95837064a95cb9bd88e2f6ca2bbfa066", "score": "0.60694724", "text": "function getSelectedNodes(objectName) {\n var selected = findObject(objectName).selectedNodes;\n return selected;\n}", "title": "" }, { "docid": "b2c4db3f6c9cc5fd4b9ba025b266bc54", "score": "0.6062175", "text": "function getSelected() {\n return arrSelectedTasks;\n }", "title": "" }, { "docid": "86d2d3abad32f36cdf01314330c7aa33", "score": "0.6021332", "text": "get selectedItem() {\n return Array.isArray(this.items) && this.selectedIndex > -1 ? this.items[this.selectedIndex] : null;\n }", "title": "" }, { "docid": "86d2d3abad32f36cdf01314330c7aa33", "score": "0.6021332", "text": "get selectedItem() {\n return Array.isArray(this.items) && this.selectedIndex > -1 ? this.items[this.selectedIndex] : null;\n }", "title": "" }, { "docid": "6e48edc24959a224b0b4c8279dee8724", "score": "0.5990212", "text": "function getSelectedComps()\r\n\t\t{\r\n\t\t\tvar comps = new Array();\r\n\t\t\tvar items = app.project.selection;\r\n\t\t\t\r\n\t\t\tfor (var i=0; i<items.length; i++)\r\n\t\t\t{\r\n\t\t\t\tif (items[i] instanceof CompItem)\r\n\t\t\t\t\tcomps[comps.length] = items[i];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn comps;\r\n\t\t}", "title": "" }, { "docid": "e20634da7392757ea8cb136830a7904d", "score": "0.5987567", "text": "get selectedElements() {\n return (this.props.controller && this.props.controller.selectedElements) || [];\n }", "title": "" }, { "docid": "44543a202056826021de9ee76f6ade7f", "score": "0.59580845", "text": "static get ITEM_SELECTED() {\n\t\treturn 1;\n\t}", "title": "" }, { "docid": "8baf903db669f5bdbacfc19948ea9b00", "score": "0.5955435", "text": "get selected() {\n return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];\n }", "title": "" }, { "docid": "8baf903db669f5bdbacfc19948ea9b00", "score": "0.5955435", "text": "get selected() {\n return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];\n }", "title": "" }, { "docid": "8baf903db669f5bdbacfc19948ea9b00", "score": "0.5955435", "text": "get selected() {\n return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];\n }", "title": "" }, { "docid": "8baf903db669f5bdbacfc19948ea9b00", "score": "0.5955435", "text": "get selected() {\n return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];\n }", "title": "" }, { "docid": "8baf903db669f5bdbacfc19948ea9b00", "score": "0.5955435", "text": "get selected() {\n return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];\n }", "title": "" }, { "docid": "8baf903db669f5bdbacfc19948ea9b00", "score": "0.5955435", "text": "get selected() {\n return this.multiple ? this._selectionModel.selected : this._selectionModel.selected[0];\n }", "title": "" }, { "docid": "a5da7e3545efd2aaa9717ce5541c4923", "score": "0.59397584", "text": "get selected() {\n return this.multiple ? this.selectionModel.selected : this.selectionModel.selected[0];\n }", "title": "" }, { "docid": "59cfbf20585f7a2ae9a5d38f252f8c56", "score": "0.59245485", "text": "getSelections() {\n return this.viewer.currentOverlays.map((overlay) => {\n if (overlay.element.className === 'selection-overlay') {\n return this.overlayToImageRect(overlay);\n }\n });\n }", "title": "" }, { "docid": "fb2154b9040ac458be720671720b6ae9", "score": "0.5915821", "text": "allFiltered() {\n const selection = this.selection;\n const res = [];\n for (let i = 0, len = this.data.length; i < len; i++) {\n if (selection.isSelected(i)) {\n res.push(this.data[i]);\n }\n }\n return res;\n }", "title": "" }, { "docid": "12f4c94d54d26b13bf819b13508aade2", "score": "0.5912614", "text": "function _getSelectedNodeArray() {\n // Code goes here...\n var selData = $el.data('selData');\n var nodes = new Array;\n if(isIe){\n \t\t$el.find('select').children().each(function(){\n \t\t\tif( $(this).attr(\"selected\") ==\"selected\"){\n \t\t\t\tnodes.push( selData[$(this).attr('index')])\n \t\t\t}\n \t\t})\n }else{\n\t $el.find('option:selected').each(function(){\n\t \tnodes.push( selData[$(this).attr('index')])\n\t });\n }\n return nodes ;\n }", "title": "" }, { "docid": "02fe7a45a7ae5de1dcc125fc750b032e", "score": "0.58993226", "text": "get selections() {\n return this.modelDB.get('selections');\n }", "title": "" }, { "docid": "e4abca9220c9309f1d17b74712b23775", "score": "0.5877366", "text": "function _getSelectedNodes(){\n \tif(isIe){\n \t\tvar indexs = new Array;\n \t\t$el.find('select').children().each(function(){\n \t\t\tif( $(this).attr(\"selected\") ==\"selected\"){\n \t\t\t\t//push option's id in indexs array\n \t\t\t\tindexs.push($(this).attr(\"id\")); \n \t\t\t}\n \t\t});\n \t\treturn indexs;\n \t}else{\n \t\treturn $el.find('select option:selected'); \n \t}\n }", "title": "" }, { "docid": "de3eb151dfd24b4bdfd2952ef3c6cfd1", "score": "0.5863798", "text": "function getSelectedItem() {\n return self.itemAt($scope.selectedIndex);\n }", "title": "" }, { "docid": "bbf484b6be050a5395de3d0ff2fb478a", "score": "0.5823282", "text": "selection() {\n return selection;\n }", "title": "" }, { "docid": "241d26bbea29f871a5dbd7fede75862d", "score": "0.58173347", "text": "function onCheck() {\r\n var checkedNodes = [],\r\n treeView = $(\"#treelist\").data(\"kendoTreeView\"),\r\n message;\r\n checkedNodeIds(treeView.dataSource.view(), checkedNodes);\r\n if (checkedNodes.length > 0) {\r\n selectedMenu = checkedNodes.toString();\r\n }\r\n else {\r\n selectedMenu = \"\";\r\n }\r\n console.log(selectedMenu);\r\n}", "title": "" }, { "docid": "f4a50232176974f9c01fc18ef614ddce", "score": "0.5786876", "text": "getSelected() {\n\treturn this.model.store[this.model.selected];\n }", "title": "" }, { "docid": "42e1cdc0b585bea0186823290dd76d91", "score": "0.5785893", "text": "getSelectedForceNodes() {\n const key2fnodeMap = this.force.key2fnodeMap;\n const selectedForceNodes = this.props.nodes\n .filter(n=>n.selected)\n .map(n=>key2fnodeMap[getNodeKey(n)]);\n return selectedForceNodes;\n }", "title": "" }, { "docid": "e58719a98e8e8a56236513f3f338d9d4", "score": "0.5770789", "text": "function getAllSelectedIds(){\n return selectedRowIds;\n }", "title": "" }, { "docid": "64b2f7806b95fd91b4ff030599ce9df9", "score": "0.57637286", "text": "function get_selected_items_bounds(){\n\n // ned to initialize accumulator\n var acc = project.selectedItems[0].bounds\n\n return _.reduce(project.selectedItems, function(sel_bounds, sel_item) {\n return sel_bounds.unite(sel_item.bounds);\n }, acc);\n}", "title": "" }, { "docid": "58826cd5c2a821ec5c20e2c62f37dbce", "score": "0.57421476", "text": "selectAll() {\n return this.expandSelectionsForward(selection => selection.selectAll());\n }", "title": "" }, { "docid": "841d9ca4e9b4bc97434052b602eb73c2", "score": "0.57358074", "text": "function selectAll(){\n numberOfItems = app.activeDocument.pathItems.length;\n for (var i = 0; i < numberOfItems; i++){\n app.activeDocument.pathItems[i].selected = true;\n } // end for\n } //end selectAll", "title": "" }, { "docid": "92bc6facc4daa3cf249f100675f7ecbc", "score": "0.5730311", "text": "function menu_find_current_selected(){\r\r\n/* 332 */ \t\tfor(i=0; i<menu_link_itens.length; i++){\r\r\n/* 333 */ \t\t\tif(menu_link_itens.eq(i).is(\".selected\")){\r\r\n/* 334 */ \t\t\t\treturn i;\r\r\n/* 335 */ \t\t\t}\r\r\n/* 336 */ \t\t}\r\r\n/* 337 */ \t\treturn 0;\r\r\n/* 338 */ \t}", "title": "" }, { "docid": "b56fba18b761551a8831d5f29ed85e9f", "score": "0.57201666", "text": "get selection() {\n return (this.props.controller && this.props.controller.selection) || [];\n }", "title": "" }, { "docid": "a42573ca6a5cf51586264d854f570e43", "score": "0.57159466", "text": "function getSelection(list) {\n return list.querySelector('[data-ui-type=\"item-list-item\"].state--selected');\n }", "title": "" }, { "docid": "6fe626c10f0e59c3a80296a3e6011ba6", "score": "0.5711595", "text": "function _get_selected(){\n \tvar ret_list = [];\n\tvar selected_strings =\n\t jQuery('#'+ sul_id).sortable('toArray', {'attribute': 'value'});\n \teach(selected_strings,\n \t function(in_thing){\n\t\t if( in_thing && in_thing != '' ){\n\t\t ret_list.push(in_thing);\n\t\t }\n\t });\n\treturn ret_list;\n }", "title": "" }, { "docid": "727deb68d18c9da6c8e5ddaa1300750d", "score": "0.57094663", "text": "function _getSelectedObject(){\n \tif(isIe){\n \t\tvar indexs = new Array;\n \t\t$el.find('select').children().each(function(){\n \t\t\tif( $(this).attr(\"selected\") ==\"selected\"){\n \t\t\t\t//push option's id in indexs array\n \t\t\t\tindexs.push($(this)); \n \t\t\t}\n \t\t});\n \t\treturn indexs;\n \t}else{\n \t\treturn $el.find('select option:selected:visible'); \n \t}\n }", "title": "" }, { "docid": "58c029fe516310cdada2c4aad718cca9", "score": "0.5705693", "text": "get selectedValues() {\n\t\treturn this.nativeElement ? this.nativeElement.selectedValues : undefined;\n\t}", "title": "" }, { "docid": "f8c849574ca4242a085ff67b304001b3", "score": "0.5702178", "text": "get selection () {\n return this.attributes.selection || []\n }", "title": "" }, { "docid": "69129fb014d8c8a58845d3718c2ba13a", "score": "0.5695529", "text": "function fnGetSelected(oTableLocal) {\r\n var aReturn = new Array();\r\n var aTrs = oTableLocal.fnGetNodes();\r\n for (var i = 0 ; i < aTrs.length ; i++) {\r\n if ($(aTrs[i]).hasClass('row_selected')) {\r\n aReturn.push( aTrs[i] );\r\n }\r\n }\r\n return aReturn;\r\n}", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "58cfc74890902aa2999c4bed577344ad", "score": "0.5690291", "text": "get selected() { return this._selected; }", "title": "" }, { "docid": "2f11f14503f440f487fdbd21e2313fa9", "score": "0.5686063", "text": "selectItem (i) { this.toggSel(true, i); }", "title": "" }, { "docid": "1ec9d924986d67de453d83b100e1e57a", "score": "0.5685201", "text": "getChildren() {\n return this.root.querySelectorAll('paper-tree-node');\n }", "title": "" } ]
28a143fae6a366415d372b51b1d0f64f
v8 likes predictible objects
[ { "docid": "5eda6cb4f4707fa36cbceb42f873714d", "score": "0.0", "text": "function Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}", "title": "" } ]
[ { "docid": "3669c09af51aaafb746fd6a5a507bdc0", "score": "0.5913733", "text": "static get properties() { return { liked: Boolean }}", "title": "" }, { "docid": "2e4b471a5c2f9e59c45f7e0a6ada545f", "score": "0.51889557", "text": "likePete(targetPete){\n //Error if target no es un pete\n if(targetPete===undefined) throw new Error (\"target is not defined\");\n if(targetPete.constructor.name!==\"Pete\") throw new TypeError(targetPete +\" is not a Pete\");\n if(!this.liked.includes(targetPete)){\n this.liked.push(targetPete);\n targetPete.liked(this);\n }\n \n //TODO dislike pete\n\n }", "title": "" }, { "docid": "fef2378b3d9451065d1c7368022cde47", "score": "0.5187491", "text": "function objectify(){\r\n\t\r\n}", "title": "" }, { "docid": "15209cfc9dc763355bab640e160145bc", "score": "0.51517326", "text": "function like(data, archetype) {\n var name;\n\n for (name in archetype) {\n if (archetype.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof archetype[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], archetype[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "c97828c870c9217ef1557f9f40859af7", "score": "0.51347053", "text": "get likes() { return this._likes; }", "title": "" }, { "docid": "d59c191c48d41f8af82d2164fe2d14db", "score": "0.51302594", "text": "function like (data, archetype) {\n var name;\n\n for (name in archetype) {\n if (archetype.hasOwnProperty(name)) {\n if (data.hasOwnProperty(name) === false || typeof data[name] !== typeof archetype[name]) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], archetype[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "21b211f4c80563ea3007daa247a4d6c9", "score": "0.5095552", "text": "get liked() {\n return this._liked;\n }", "title": "" }, { "docid": "f3dbe4de0a20e5d1745edc82572b6ce2", "score": "0.5054643", "text": "isMarker(object){return object&&object.___marker===true;}", "title": "" }, { "docid": "6740e7c905667dc887c5ef13ad66e5cd", "score": "0.5044646", "text": "function LanguageUnderstandingModel() {\n }", "title": "" }, { "docid": "faf720e4012af97ae83ae81078956189", "score": "0.50258505", "text": "function a(e,t,r,i){l=l||n(21);const o=Object.keys(e),a=o.length;let c,p;for(let n=0;n<a;++n){p=o[n],c=e[p],u(p,s.isPOJO(c)&&Object.keys(c).length&&(!c[i.typeKey]||\"type\"===i.typeKey&&c.type.type)?c:null,t,r,o,i)}}", "title": "" }, { "docid": "4589dabe9763b6e4d8cec9b2bdf6c6af", "score": "0.50242573", "text": "function like(data, archetype) {\n var name;\n\n for (name in archetype) {\n if (hasOwnProperty.call(archetype, name)) {\n if (hasOwnProperty.call(data, name) === false || _typeof(data[name]) !== _typeof(archetype[name])) {\n return false;\n }\n\n if (object(data[name]) && like(data[name], archetype[name]) === false) {\n return false;\n }\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "a9172b3925c9585a9ac453c663a8a89b", "score": "0.4996504", "text": "function c(e,t,n,o){a=a||r(15);const i=Object.keys(e),c=i.length;let l,p;for(let r=0;r<c;++r){p=i[r],l=e[p],u(p,s.isPOJO(l)&&Object.keys(l).length&&(!l[o.typeKey]||\"type\"===o.typeKey&&l.type.type)?l:null,t,n,i,o)}}", "title": "" }, { "docid": "88235298f13ec7aa0a5ab3ce93fecf37", "score": "0.4984946", "text": "function BookProto(title, awesome){\n this.title = title;\n this.awesome = awesome;\n}", "title": "" }, { "docid": "9f956ecbf06cf5e1960160fc2a3a76e1", "score": "0.49671745", "text": "function censor(censor) {\n var i = 0;\n\n return function(key, value) {\n if(i !== 0 && typeof(censor) === 'object' && typeof(value) == 'object' && censor == value) \n return '[Circular]'; \n\n if(i >= 29) // seems to be a harded maximum of 30 serialized objects?\n return '[Unknown]';\n\n ++i; // so we know we aren't using the original object anymore\n\n return value; \n }\n}", "title": "" }, { "docid": "18ecdfc4b4d64bb5630b8d5b63c47c3d", "score": "0.49262112", "text": "function like(liked){\n pic.liked= liked;\n //se realizara un if en un solo renglon en el que si me gusto se agregara sino se disminuira\n pic.likes += liked ? 1: -1;\n var newEL= render(pic);\n yo.update(el, newEL);\n return false;\n }", "title": "" }, { "docid": "1c31c1f83386cdf6ce585d5497fe9c20", "score": "0.49254617", "text": "function censor( censor ) {\n var i = 0;\n\n return function ( key, value ) {\n if ( i !== 0 && typeof(censor) === 'object' && typeof(value) == 'object' && censor == value )\n return '[Circular]'\n\n if ( i >= 29 ) // seems to be a harded maximum of 30 serialized objects?\n return '[Unknown]'\n\n ++i; // so we know we aren't using the original object anymore\n\n return value;\n }\n}", "title": "" }, { "docid": "51f96092e9548faf0eca00f148c7b566", "score": "0.49225605", "text": "function a(e,t,r,o){l=l||n(43);const i=Object.keys(e),a=i.length;let c,p;for(let n=0;n<a;++n){p=i[n],c=e[p],u(p,s.isPOJO(c)&&Object.keys(c).length&&(!c[o.typeKey]||\"type\"===o.typeKey&&c.type.type)?c:null,t,r,i,o)}}", "title": "" }, { "docid": "aea6e2864ecdc859f7a4f0cd3b94a895", "score": "0.4817813", "text": "function YC(t,e){return t&&Object.prototype.hasOwnProperty.call(t,e)}", "title": "" }, { "docid": "03828daf7bf40d3f5a5db04121597e64", "score": "0.48097116", "text": "function storeLiked(userLiked, results){\n for(var k in results) {\n if(results.hasOwnProperty(k)){\n if(typeof results[k].liked === 'undefined'){\n results[k].liked = userLiked;\n return true;\n }\n }\n }\n }", "title": "" }, { "docid": "8fecd5555408ae5571e10b883d2a4f59", "score": "0.48078102", "text": "visitLikePredicate(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "b3db62c0e68c4356ea18bc10dd4198d4", "score": "0.47934204", "text": "constructor(){\n this.keyLocal = \"liked_array\";\n this.array = getLocalJObject(this.keyLocal);\n //is not undefine and is not array\n if(!this.array || !Array.isArray(this.array)){\n console.warn(\"error:liked_array is not array\", this.array);\n this.array = [];\n }\n }", "title": "" }, { "docid": "ff9897388e77aa37563bd003154654b9", "score": "0.47844774", "text": "function objectExample() {\n const myObject = {\n title: 'Object',\n id: 6,\n isCool: true\n }\n}", "title": "" }, { "docid": "0573ff0fcc492d0a4cfb9d9781a71d0b", "score": "0.47754934", "text": "isSimilar() {\n\n }", "title": "" }, { "docid": "a5c710c91dd10dcdf5caeda995ffea8c", "score": "0.47650582", "text": "function likeSomethingNew(dog){\n dog.chaseSomething = 'balls';\n console.log(dog); // 2. we see kepler likes balls\n }", "title": "" }, { "docid": "edee289e5171bbb495d73a4411f35d0c", "score": "0.4738118", "text": "function lookupLikesDislikes(link, target) {\n\tif (link && !link.doneLikesDislikes) {\n\t\tlink.doneLikesDislikes = true;\n\n\t\tfunction gotTargetPage(response) {\n\t\t\tvar content = response.responseText;\n\t\t\t//GM_log(\"GOT CONTENT LENGTH: \"+content.length);\n\t\t\tif (content) {\n\t\t\t\tvar lePage = document.createElement(\"div\");\n\t\t\t\tlePage.innerHTML = content;\n\t\t\t\t//console.log(\"GOT lePage:\", lePage);\n\t\t\t\t//unsafeWindow.lePage = lePage;\n\t\t\t\tvar infoElem = lePage.getElementsByClassName(\"watch-likes-dislikes\")[0];\n\t\t\t\tinfoElem = infoElem || lePage.getElementsByClassName(\"video-extras-likes-dislikes\")[0]; // Oct 2012\n\t\t\t\tinfoElem = infoElem || lePage.getElementsByClassName(\"like-button-renderer\")[0]; // Oct 2015\n\t\t\t\t//console.log(\"GOT INFOELEM: \"+infoElem);\n\n\t\t\t\t// Find suitable element for adding tooltip info.\n\t\t\t\tvar elemWithTitle = findClosestLinkElem(link);\n\t\t\t\t// On sidebar thumbnails this tends to be the containing <A> rather\n\t\t\t\t// than the <span> holding the video title, which is what I usually\n\t\t\t\t// mouseover! However on YT's front page it does find the title.\n\n\t\t\t\t// CONSIDER: We might want to add our extra elements to .stat.view-count or .yt-lockup-meta-info (on channel pages) or perhaps a clone of that element.\n\n\t\t\t\tif (infoElem || true) {\n\n\t\t\t\t\t// Old:\n\t\t\t\t\tvar infoText = infoElem ? infoElem.textContent.trim() : 'infoElem not found';\n\n\t\t\t\t\t// New:\n\t\t\t\t\tvar newLikedButton = infoElem && infoElem.querySelector(\".like-button-renderer-like-button-unclicked\");\n\t\t\t\t\tif (newLikedButton) {\n\t\t\t\t\t\tvar newDislikedButton = infoElem.querySelector(\".like-button-renderer-dislike-button-unclicked\");\n\t\t\t\t\t\tinfoText = newLikedButton.textContent + \" likes, \" + newDislikedButton.textContent + \" dislikes.\";\n\t\t\t\t\t}\n\n\t\t\t\t\t// New (2018):\n\t\t\t\t\tconst likeDislikeButtons = document.querySelectorAll('#info-contents #top-level-buttons ytd-toggle-button-renderer yt-formatted-string');\n\t\t\t\t\tif (likeDislikeButtons.length === 2) {\n\t\t\t\t\t\tconst [likes, dislikes] = Array.from(likeDislikeButtons).map(elem => elem.textContent);\n\t\t\t\t\t\tinfoText = likes + \" likes, \" + dislikes + \" dislikes\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif (addCountsToTooltip) {\n\t\t\t\t\t\telemWithTitle.title += ' (' + infoText + ')';\n\t\t\t\t\t\t// Sometimes the hovered element is a span with a title. In that case, we should update its title too.\n\t\t\t\t\t\tif (target && target.title) {\n\t\t\t\t\t\t\ttarget.title += ' (' + infoText + ')';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (addCountsToThumbnail) {\n\t\t\t\t\t\tvar span = document.createElement(\"div\");\n\t\t\t\t\t\tspan.className = \"stat\";\n\t\t\t\t\t\t// On channel pages, the stat rule does not apply, so we apply it ourselves:\n\t\t\t\t\t\tspan.style.fontSize = '11px';\n\t\t\t\t\t\tspan.appendChild(document.createTextNode(infoText));\n\t\t\t\t\t\tlink.appendChild(span);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif (addLightSaberBarToThumbnail) {\n\n\t\t\t\t\t// Pictures are easier to read than words:\n\t\t\t\t\tvar lightSaber = lePage.getElementsByClassName(\"watch-sparkbars\")[0];\n\t\t\t\t\tlightSaber = lightSaber || lePage.getElementsByClassName(\"video-extras-sparkbars\")[0]; // Oct 2012\n\t\t\t\t\tif (lightSaber) {\n\t\t\t\t\t\tlink.appendChild(lightSaber);\n\t\t\t\t\t\tif (document.location.pathname === \"/watch\") { // not on search results\n\t\t\t\t\t\t\t// It often falls on the line below the thumbnail, aligned left\n\t\t\t\t\t\t\t// Here is a dirty fix to align it right, with all the other info.\n\t\t\t\t\t\t\t//lightSaber.style.marginLeft = '124px';\n\t\t\t\t\t\t\t// Well none of the other info is aligned right for me now, it's all aligned left.\n\t\t\t\t\t\t\t// Just give it a small gap on the right\n\t\t\t\t\t\t\tlightSaber.style.marginRight = '10px';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Bars are unneccessarily wide on search results pages, so:\n\t\t\t\t\t\tif (lightSaber.clientWidth > 150) {\n\t\t\t\t\t\t\tlightSaber.style.maxWidth = '120px';\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\telemWithTitle.title += \" [No likes/dislikes available]\";\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif (addCountsToTooltip || addLightSaberBarToThumbnail) {\n\t\t\t\t\t// On channel pages, the extra elements we add are hidden by this rule, so we grow it larger\n\t\t\t\t\tGM_addStyle('.yt-ui-ellipsis-2 { max-height: 5.5em; } .webkit .yt-ui-ellipsis-2 { -webkit-line-clamp: 5; }');\n\t\t\t\t}\n\n\t\t\t\tif (addVideoDescriptionToTooltip) {\n\t\t\t\t\t// Uncaught TypeError: Object #<HTMLDivElement> has no method 'getElementById'\n\t\t\t\t\t// var descrElem = lePage.getElementById(\"watch-description-text\");\n\t\t\t\t\tvar descrElem = fakeGetElementById(lePage, \"watch-description-text\") || document.querySelector('#description');\n\t\t\t\t\tif (descrElem) {\n\t\t\t\t\t\telemWithTitle.title += \" ::: \" + descrElem.textContent.trim();\n\t\t\t\t\t}\n\n\t\t\t\t\t// I also want to add the date to the thumbnail stats\n\t\t\t\t\tvar uploadedDateSrcElem = lePage.getElementsByClassName('watch-time-text')[0] || { textContent: 'watch-time-text not found' };\n\t\t\t\t\tvar uploadedDateText = uploadedDateSrcElem.textContent;\n\t\t\t\t\tuploadedDateText = uploadedDateText.replace(/^(Uploaded|Published) on /, 'on ');\n\t\t\t\t\tvar uploadedDateNewElem = document.createElement(\"span\");\n\t\t\t\t\tuploadedDateNewElem.textContent = \" \" + uploadedDateText;\n\t\t\t\t\tvar targetElem = link.getElementsByClassName(\"attribution\")[0];\n\t\t\t\t\tif (targetElem) {\n\t\t\t\t\t\ttargetElem.appendChild(uploadedDateNewElem);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t//console.log(\"Requesting: \"+link.href);\n\t\tGM_xmlhttpRequest({\n\t\t\tmethod: \"GET\",\n\t\t\turl: link.href,\n\t\t\theaders: {\n\t\t\t\t// \"Reason\": \"I want to display watch-likes-dislikes, watch-sparkbars and watch-description-text by this thumbnail\"\n\t\t\t},\n\t\t\tonload: gotTargetPage,\n\t\t\tonerror: function(err){\n\t\t\t\t// Cannot \"\"+err. Chrome once gave me: Uncaught TypeError: Function.prototype.toString is not generic\n\t\t\t\tGM_log(\"Got error requesting YT page: \"+link.href);\n\t\t\t\tGM_log(err);\n\t\t\t}\n\t\t});\n\n\t}\n}", "title": "" }, { "docid": "17fa7421196ca7d84648f12399e4059b", "score": "0.4722762", "text": "function ExposedObjects() {\n return {\n animationEngine:G.aengine,\n t:'test'\n };\n }", "title": "" }, { "docid": "d7c50510ab69c63b7800f6a0a77c6fd5", "score": "0.47127944", "text": "function reflectMood(kitten){\r\n\r\n}", "title": "" }, { "docid": "e7c7fda9ce71fb1e0102bece0c3136c3", "score": "0.46780798", "text": "function ki(t) {\n return \"object\" == typeof t && null !== t && (Object.getPrototypeOf(t) === Object.prototype || null === Object.getPrototypeOf(t));\n}", "title": "" }, { "docid": "cc2162a1a260119a96686896ab6d336a", "score": "0.46503878", "text": "static get observedAttributes() {\n return [\"ransom\", \"someother\"];\n }", "title": "" }, { "docid": "3f22b85bf8dd0684d391911ca6473331", "score": "0.46461704", "text": "function getRecommendations(likes) {\n const userFeatures = nj.concatenate(mergeMovieFeatures(likes), nj.zeros([MOVIE_FEATURE_SIZE]));\n const results = movies.map((movie) => {\n const movieFeature = nj.array(movie.feature);\n const userMovieFeatures = nj.concatenate(userFeatures, movieFeature);\n const x = nj.array([userMovieFeatures.valueOf()]);\n const y = nj.dot(x, weights);\n const like = y.get(0, 0);\n const dislike = y.get(0, 1);\n const result = {\n id: movie.id,\n title: movie.title,\n img: movie.images.large,\n rate: {\n like,\n dislike,\n value: like - dislike\n }\n };\n return result;\n });\n results.sort((a, b) => b.rate.value - a.rate.value);\n return results;\n}", "title": "" }, { "docid": "641d62b68f0ec2393c99b3db3761cb7a", "score": "0.46439773", "text": "function whatIDontLike(annoyingAnimal) {\r\n console.log(\"I don´t like \" + annoyingAnimal);\r\n}", "title": "" }, { "docid": "56ee03701c7935b3c5a30995761427ba", "score": "0.46420228", "text": "function mdnk() {\n const object1 = {};\n if( Reflect.isExtensible(object1) !== true ) return false;\n \n Reflect.preventExtensions(object1);\n}", "title": "" }, { "docid": "6bfb05dd228b3b9e6c37a9fac59b1a59", "score": "0.4633903", "text": "objectAttributes()\r\n {\r\n return [\"weapon\",\"armor\",\"loot\",\"magic\",\"vehicle\",\"psi\"];\r\n }", "title": "" }, { "docid": "dbb901a8d58d1b845f5a67755cf88964", "score": "0.46318942", "text": "async function v8(v9,v10) {\n const v13 = new WeakMap();\n // v13 = .object(ofGroup: WeakMap, withProperties: [\"__proto__\"], withMethods: [\"get\", \"set\", \"has\", \"delete\"])\n const v14 = v13.has(v13);\n // v14 = .boolean\n const v15 = v13.set(v13,13.37);\n // v15 = .object(ofGroup: WeakMap, withProperties: [\"__proto__\"], withMethods: [\"get\", \"set\", \"has\", \"delete\"])\n}", "title": "" }, { "docid": "c816be89488a6da8f8c3556b93987258", "score": "0.46312737", "text": "function mdnk() {\n const object1 = {};\n var passed = Reflect.isExtensible(object1) === true;\n \n Reflect.preventExtensions(object1);\n}", "title": "" }, { "docid": "864ff9ba2aa9faace5e97f41c91fcd2c", "score": "0.4617832", "text": "function testAnnotationListObjectCreation() {\n var annotationResponse = getAnnotationsForUrl(\"gokhanTest\");\n console.log(\"error = \" + annotationResponse.errorMsg);\n console.log(\"size = \" + annotationResponse.annotations.length);\n console.log(\"3rd annotation = \" + annotationResponse.annotations[3]);\n console.log(\"geekResponseOfSingleAnnotation = \" + annotationResponse.annotations[3].getGeekString());\n}", "title": "" }, { "docid": "77cdd870e351b4b15c4ec4809f96d29e", "score": "0.4602893", "text": "hit(obj) {\n // Do nothing for base class.\n }", "title": "" }, { "docid": "9089e7838d5d386947f9f49cbb4d4b33", "score": "0.4601364", "text": "userLiked() {\n var URL =\n \"http://localhost:8084/RoomieRoamer/api/User/like/\" +\n this.state.myId + \"/\" + this.state.targetId;\n fetch(URL, facade.makeOptions(\"PUT\", true))\n .then(response => response.json())\n .then(json => {\n console.log(\"I liked \" + json);\n });\n }", "title": "" }, { "docid": "1c2e222634b3cafada494aab8f2f2c39", "score": "0.4599503", "text": "function isVidLiked(vid){\n return $q.when(db.allDocs({include_docs:true,startkey: 'favorite-', endkey: 'favorite-\\uffff'}))\n .then(function(docs){\n // console.log('%%% get favorites',docs.rows)\n var favorites = docs.rows[0].doc\n try{\n var isLiked = _.some(favorites.vidList, function(f){\n return f === vid\n })\n console.log('%%%% is liked', isLiked, vid )\n }catch(e){\n isLiked = false\n }\n return isLiked\n })\n }", "title": "" }, { "docid": "e53999343e15bd4184fd7938679d3c2b", "score": "0.45896184", "text": "function makeClassifier(obj){\n\tconsole.log('making classifier')\n\tvar classifier = new BrainJSClassifier();\n\tObject.keys(obj).forEach(out=>{\n\t\tobj[out].forEach(input=>{\n\t\t\tclassifier.addDocument(input,out);\n\t\t})\n\t})\n\tclassifier.train();\n\treturn classifier\n}", "title": "" }, { "docid": "a3914afa549bb7a9ac4f3b8846827b41", "score": "0.45877126", "text": "function Serializer$ParsedObjectType$E() {\n}", "title": "" }, { "docid": "70c847698a3600c349f486fc2f89fd6e", "score": "0.45869112", "text": "function checkHitrostPod108PojavVetraPrevec() { // pojav vetra prevec\n var k65 = this.k65_mocan_veter_6bf_8bf;\n var k34 = this.k34_hitrost_vetra_7h;\n var k36 = this.k36_hitrost_vetra_14h;\n var k38 = this.k38_hitrost_vetra_21h;\n if (k34.msr && k34.edit()) {\n if (k65.equals(1, 5) && ((!k34.nval || k34.nval < 108) && (!k36.nval || k36.nval < 108) && (!k38.nval || k38.nval < 108))) this.set_warn_params(this.messages.msg_hitrost_124, 0, [k65, new Number(1), k34, k36, k38]);\n if (k65.equals(4, 7) && ((!k34.nval || k34.nval < 172) && (!k36.nval || k36.nval < 172) && (!k38.nval || k38.nval < 172))) this.set_warn_params(this.messages.msg_hitrost_124A, 0, [k65, new Number(4), k34, k36, k38]);\n }\n}", "title": "" }, { "docid": "240d9f625197f082c60b1ff8f34a34d9", "score": "0.45753202", "text": "function classifyVideo() {\n classifier.predict(gotResult);\n}", "title": "" }, { "docid": "1a4b17827687e40e4ff23f33790fe4a5", "score": "0.45637134", "text": "function protoAugment(target,src,keys){/* eslint-disable no-proto */target.__proto__=src;/* eslint-enable no-proto */}", "title": "" }, { "docid": "7af032acf04aa1cffdeac153d5f9b511", "score": "0.45607442", "text": "enterLikePredicate(ctx) {\n\t}", "title": "" }, { "docid": "e2552f7cc0bb27badf00ac6bde6dd705", "score": "0.45583504", "text": "function match_awale() {\r\n\tthis.__proto__.__proto__.constructor.apply(this, arguments);\r\n}", "title": "" }, { "docid": "86389477dcaa9493ebffb0cb43905990", "score": "0.4557141", "text": "function Nevis() {}", "title": "" }, { "docid": "86389477dcaa9493ebffb0cb43905990", "score": "0.4557141", "text": "function Nevis() {}", "title": "" }, { "docid": "86389477dcaa9493ebffb0cb43905990", "score": "0.4557141", "text": "function Nevis() {}", "title": "" }, { "docid": "0cca520c863f50c552750b690302e94f", "score": "0.45538154", "text": "function switchvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "6c3d770960b547c9026849fb103aaae0", "score": "0.45474118", "text": "static flag() { return new NodeProp({ deserialize: () => true }); }", "title": "" }, { "docid": "7ace0431fc029b7ae333d853a44b791b", "score": "0.45458424", "text": "function vmTypeaheadvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "6801c822b6c19f59d7f9e4d4c3bb72dd", "score": "0.45371252", "text": "async function likeMovie(url) {\n\n const response = await fetch (url)\n const data = await response.json()\n return data\n \n \n }", "title": "" }, { "docid": "104adf78ff15e2ccfe1dbcab759523c4", "score": "0.45269036", "text": "function ownCustomObject(name,Meta){var key=memberProperty(name);var capitalized=capitalize(name);Meta.prototype['writable'+capitalized]=function(create){var ret=this[key];if(!ret){ret=this[key]=create(this.source);}return ret;};Meta.prototype['readable'+capitalized]=function(){return this[key];};}// Implements a member that provides an inheritable, lazily-created", "title": "" }, { "docid": "c068bf623776069142d02c48b5991bfa", "score": "0.452288", "text": "function markRaw(obj) {\r\n if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj)) {\r\n return obj;\r\n }\r\n // set the vue observable flag at obj\r\n var ob = createObserver();\r\n ob.__raw__ = true;\r\n def(obj, '__ob__', ob);\r\n // mark as Raw\r\n rawSet.set(obj, true);\r\n return obj;\r\n}", "title": "" }, { "docid": "37e1abec40ce76e522e7b983ed6cd6fe", "score": "0.4522584", "text": "function rekognizeLabels(bucket, key) {\n let params = {\n Image: {\n S3Object: {\n Bucket: bucket,\n Name: key\n }\n },\n MaxLabels: 3,\n MinConfidence: 80\n };\n\n return rekognition.detectLabels(params).promise();\n}", "title": "" }, { "docid": "58dc827a69a4387057ed99b416fc81a6", "score": "0.4518688", "text": "hit() {\n }", "title": "" }, { "docid": "127b148233c6b22a1f515be3d1dddaed", "score": "0.45182306", "text": "function walkthrough() {\n\n}", "title": "" }, { "docid": "bdd1c38b67d3c413f61e75ed68b69dec", "score": "0.45105958", "text": "function Villain(attr) {\n GameObject.call(this, attr);\n CharacterStats.call(this, attr);\n Humanoid.call(this, attr);\n}", "title": "" }, { "docid": "409e6ac6e4b06de68ecb45ed2de4a70b", "score": "0.45007145", "text": "visitLikeSpec(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "fc6b648e79c017e4d6d668a977e50d05", "score": "0.4493209", "text": "function r$3p(r,o={}){const a=r instanceof s$48?r:new s$48(r,o),t={type:o?.ignoreUnknown??1?a.apiValues:String,json:{type:a.jsonValues,read:!o?.readOnly&&{reader:a.read},write:{writer:a.write}}};return void 0!==o?.readOnly&&(t.readOnly=!!o.readOnly),void 0!==o?.default&&(t.json.default=o.default),void 0!==o?.name&&(t.json.name=o.name),y$2X(t)}", "title": "" }, { "docid": "4a72d2782923698f3b5d869271dc90f6", "score": "0.4490534", "text": "function getStarred(obj) {\n return obj.starred;\n}", "title": "" }, { "docid": "5e795f41d681d54ad81ec96044f7d158", "score": "0.44778553", "text": "function t$U(n){const o={};for(const e in n){if(\"declaredClass\"===e)continue;const r=n[e];if(null!=r&&\"function\"!=typeof r)if(Array.isArray(r)){o[e]=[];for(let n=0;n<r.length;n++)o[e][n]=t$U(r[n]);}else \"object\"==typeof r?r.toJSON&&(o[e]=JSON.stringify(r)):o[e]=r;}return o}", "title": "" }, { "docid": "cc6d375d4da96c3ad9c07b65de0427c1", "score": "0.4476889", "text": "_sortLikes(a, b) {\n return (a.likes + 2*a.superlikes - a.dislikes) - (b.likes + 2*b.superlikes - b.dislikes);\n }", "title": "" }, { "docid": "7ddd4591e7f00d6415efdd3f5e832c0a", "score": "0.4466673", "text": "function u(n){return null!==n&&\"object\"==typeof n}", "title": "" }, { "docid": "bb31aa8a42b3a6ab4851f67efe5ac01a", "score": "0.4461305", "text": "function classify() {\n\tclear();\n\thylarWorker.postMessage({\n\t\taction: \"classify\",\n\t\tontologyTxt: document.getElementById(\"texte\").value,\n\t\tmimeType: \"application/ld+json\",\n\t\tkeepOldValues: true\n\t})\n}", "title": "" }, { "docid": "0c2126c7ae0a22a0524c2935e36bf760", "score": "0.44600567", "text": "function n$4V(n){if(n.json&&n.json.origins){const o=n.json.origins,e={\"web-document\":[\"web-scene\",\"web-map\"]};for(const n in e)if(o[n]){const s=o[n];e[n].forEach((n=>{o[n]=s;})),delete o[n];}}}", "title": "" }, { "docid": "3d5b3cc65677b56f3bd06fa113ce099e", "score": "0.44594073", "text": "function Obj(){ return Literal.apply(this,arguments) }", "title": "" }, { "docid": "7dd804cbc88c7e2f1d3d739e0e62bc11", "score": "0.44585115", "text": "function similar(obj1, obj2) {\n tracker = false;\n for (key in obj1){\n \tfor(key2 in obj2){\n \t if (key == key2 && obj1[key] == obj2[key2]) {\n \t tracker = true;\n \t }\n \t}\n }\n return tracker;\n}", "title": "" }, { "docid": "421b12c691ce5a5023c833925d7a4132", "score": "0.4457817", "text": "function isObj(what){return typeof what == 'object' }", "title": "" }, { "docid": "4e0d2a93f4dc6eea15ca1e0686929e31", "score": "0.4455683", "text": "function vz(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}", "title": "" }, { "docid": "3ecb270c93067885965dec70e4283ea6", "score": "0.44501793", "text": "function vmTypeaheadItemvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "b877d5e401aaab63ebb7f53bb4948efb", "score": "0.444909", "text": "relevance(that){cov_25grm4ggn6.f[4]++;let total=(cov_25grm4ggn6.s[13]++,0);let words=(cov_25grm4ggn6.s[14]++,Object.keys(this.count));cov_25grm4ggn6.s[15]++;words.forEach(w=>{cov_25grm4ggn6.f[5]++;cov_25grm4ggn6.s[16]++;total+=this.rank(w)*that.rank(w);});//return the average rank of my words in the other vocabulary\ncov_25grm4ggn6.s[17]++;return total/words.length;}", "title": "" }, { "docid": "b877d5e401aaab63ebb7f53bb4948efb", "score": "0.444909", "text": "relevance(that){cov_25grm4ggn6.f[4]++;let total=(cov_25grm4ggn6.s[13]++,0);let words=(cov_25grm4ggn6.s[14]++,Object.keys(this.count));cov_25grm4ggn6.s[15]++;words.forEach(w=>{cov_25grm4ggn6.f[5]++;cov_25grm4ggn6.s[16]++;total+=this.rank(w)*that.rank(w);});//return the average rank of my words in the other vocabulary\ncov_25grm4ggn6.s[17]++;return total/words.length;}", "title": "" }, { "docid": "4fb41d46dd9db6345e9657533544e046", "score": "0.4448664", "text": "function vmTypeaheadDatavue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "499457135fee666987e85364fbcfc360", "score": "0.44464657", "text": "function classifyVideo() {\n classifier.classify(gotResult);\n}", "title": "" }, { "docid": "499457135fee666987e85364fbcfc360", "score": "0.44464657", "text": "function classifyVideo() {\n classifier.classify(gotResult);\n}", "title": "" }, { "docid": "526181442a95047885d80afe83d94bda", "score": "0.44455758", "text": "function sayHello() {\n //If !primitive then it is an Object\n let obj1 = {\n tina: 'hello Jimmy Junior',\n jimmy: 'hi Tina'\n }\n\n let obj2 = obj1;\n log(obj1, obj2);\n //two references to the same object\n\n obj2.tina = 'goodbye Jimmy Junior';\n log(obj1, obj2);\n\n let obj4 = JSON.parse(JSON.stringify(obj1));\n log(obj4);\n}", "title": "" }, { "docid": "5ad2b7f5daa288745d98e75e8661d019", "score": "0.44408798", "text": "function t$2A(n){const o={};for(const e in n){if(\"declaredClass\"===e)continue;const r=n[e];if(null!=r&&\"function\"!=typeof r)if(Array.isArray(r)){o[e]=[];for(let n=0;n<r.length;n++)o[e][n]=t$2A(r[n]);}else \"object\"==typeof r?r.toJSON&&(o[e]=JSON.stringify(r)):o[e]=r;}return o}", "title": "" }, { "docid": "e34e4ccadd45bd773518ac02d6e29be2", "score": "0.44389665", "text": "function classify(){\n const input = {\n r: 10, \n g: 10, \n b: 1\n }\n myMl.brain.classify(input, handleResults);\n}", "title": "" }, { "docid": "64abf5a6eae4065f2ccbcbde3e6fc85a", "score": "0.4432363", "text": "function isNodeLike(value) {\n return value != null && typeof value === \"object\" &&\n ! Array.isArray(value) && isCapitalized(value.type);\n}", "title": "" }, { "docid": "76c2034c964329d86c16b4d925b20dfa", "score": "0.44319093", "text": "function Pn(e){var t=function(){if(\"undefined\"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(\"function\"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=n(e);if(t){var i=n(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return c(this,r)}}", "title": "" }, { "docid": "6cdd830abb52c6772b43d8854fd4471a", "score": "0.44306213", "text": "function ownMap(name,Meta){var key=memberProperty(name);var capitalized=capitalize(name);Meta.prototype['writable'+capitalized]=function(){return this._getOrCreateOwnMap(key);};Meta.prototype['readable'+capitalized]=function(){return this[key];};}", "title": "" }, { "docid": "d255980bed70e817ec45225319443fa9", "score": "0.44306135", "text": "function DummyObject() {}", "title": "" }, { "docid": "9e66efd0af2d9620e5cb78c676f96a4a", "score": "0.44293255", "text": "function test(Object)\n{\n try {\no8 instanceof Boolean;\n}catch(e){}\n}", "title": "" }, { "docid": "9e66efd0af2d9620e5cb78c676f96a4a", "score": "0.44293255", "text": "function test(Object)\n{\n try {\no8 instanceof Boolean;\n}catch(e){}\n}", "title": "" }, { "docid": "8df9f93e1427aa8cdf924adb7a488535", "score": "0.4423856", "text": "function tagTester(name) {\n\t return function(obj) {\n\t return toString.call(obj) === '[object ' + name + ']';\n\t };\n\t }", "title": "" }, { "docid": "8bd6ab85cbadaa5101eb42ae6205f89c", "score": "0.44176024", "text": "hit() {\n }", "title": "" }, { "docid": "f7471fb721ac25fa028014bea7e3a7a2", "score": "0.44098708", "text": "function likeClickability() {\n // select all hearts\n const likeGlyphs = document.querySelectorAll(\".like-glyph\")\n // make each heart clickable\n likeGlyphs.forEach(likeHeart => likeHeart.addEventListener(\"click\", postLikeToggle))\n}", "title": "" }, { "docid": "ada85d2393e00b3e5879e6bec4b4a533", "score": "0.44025192", "text": "async function predict() {\r\n const prediction = await modelo.predict(webcam.canvas);\r\n for (let i = 0; i < maxPredictions; i++) {\r\n if(prediction[i].probability > 0.80) { // Probabilidade necessária para imprimir na tela a categoria em que o objeto se encaixa\r\n const classPrediction =\r\n prediction[i].className + \": \" + prediction[i].probability.toFixed(2);\r\n labelContainer.childNodes[i].innerHTML = classPrediction;\r\n }\r\n else {\r\n labelContainer.childNodes[i].innerHTML = \"\";\r\n }\r\n }\r\n }", "title": "" }, { "docid": "48fcac54bfa377471ae4573d25c7e35f", "score": "0.44024196", "text": "expressive() {\n \n }", "title": "" }, { "docid": "48d7e533e845c77309511ad18c012671", "score": "0.43967497", "text": "_isModelObject() {\n return true;\n }", "title": "" }, { "docid": "d1449edd7bbe806faae2f83ac5f2ef5f", "score": "0.4395641", "text": "function vmSwitchvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }", "title": "" }, { "docid": "f6868b0c3a4b0441ca06e51edeaa916d", "score": "0.43945214", "text": "function Hi(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "title": "" }, { "docid": "7c640ef32af602d7f0163531ce8590b0", "score": "0.43869585", "text": "function isLiked() {\n let liked = false;\n post.likes.map((like) => {\n if (like.user_id == session.user_id.toString()) {\n liked = true;\n }\n });\n return liked;\n }", "title": "" }, { "docid": "9dd1d666624b01bc5ad316e23e29d65d", "score": "0.43847254", "text": "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "title": "" }, { "docid": "bdd7a32e84589d1011c6f286afa40228", "score": "0.43847254", "text": "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC$1;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "title": "" }, { "docid": "9dd1d666624b01bc5ad316e23e29d65d", "score": "0.43847254", "text": "function kotlin(hljs) {\n const KEYWORDS = {\n keyword:\n 'abstract as val var vararg get set class object open private protected public noinline ' +\n 'crossinline dynamic final enum if else do while for when throw try catch finally ' +\n 'import package is in fun override companion reified inline lateinit init ' +\n 'interface annotation data sealed internal infix operator out by constructor super ' +\n 'tailrec where const inner suspend typealias external expect actual',\n built_in:\n 'Byte Short Char Int Long Boolean Float Double Void Unit Nothing',\n literal:\n 'true false null'\n };\n const KEYWORDS_WITH_LABEL = {\n className: 'keyword',\n begin: /\\b(break|continue|return|this)\\b/,\n starts: {\n contains: [\n {\n className: 'symbol',\n begin: /@\\w+/\n }\n ]\n }\n };\n const LABEL = {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '@'\n };\n\n // for string templates\n const SUBST = {\n className: 'subst',\n begin: /\\$\\{/,\n end: /\\}/,\n contains: [ hljs.C_NUMBER_MODE ]\n };\n const VARIABLE = {\n className: 'variable',\n begin: '\\\\$' + hljs.UNDERSCORE_IDENT_RE\n };\n const STRING = {\n className: 'string',\n variants: [\n {\n begin: '\"\"\"',\n end: '\"\"\"(?=[^\"])',\n contains: [\n VARIABLE,\n SUBST\n ]\n },\n // Can't use built-in modes easily, as we want to use STRING in the meta\n // context as 'meta-string' and there's no syntax to remove explicitly set\n // classNames in built-in modes.\n {\n begin: '\\'',\n end: '\\'',\n illegal: /\\n/,\n contains: [ hljs.BACKSLASH_ESCAPE ]\n },\n {\n begin: '\"',\n end: '\"',\n illegal: /\\n/,\n contains: [\n hljs.BACKSLASH_ESCAPE,\n VARIABLE,\n SUBST\n ]\n }\n ]\n };\n SUBST.contains.push(STRING);\n\n const ANNOTATION_USE_SITE = {\n className: 'meta',\n begin: '@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\\\s*:(?:\\\\s*' + hljs.UNDERSCORE_IDENT_RE + ')?'\n };\n const ANNOTATION = {\n className: 'meta',\n begin: '@' + hljs.UNDERSCORE_IDENT_RE,\n contains: [\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [\n hljs.inherit(STRING, {\n className: 'meta-string'\n })\n ]\n }\n ]\n };\n\n // https://kotlinlang.org/docs/reference/whatsnew11.html#underscores-in-numeric-literals\n // According to the doc above, the number mode of kotlin is the same as java 8,\n // so the code below is copied from java.js\n const KOTLIN_NUMBER_MODE = NUMERIC;\n const KOTLIN_NESTED_COMMENT = hljs.COMMENT(\n '/\\\\*', '\\\\*/',\n {\n contains: [ hljs.C_BLOCK_COMMENT_MODE ]\n }\n );\n const KOTLIN_PAREN_TYPE = {\n variants: [\n {\n className: 'type',\n begin: hljs.UNDERSCORE_IDENT_RE\n },\n {\n begin: /\\(/,\n end: /\\)/,\n contains: [] // defined later\n }\n ]\n };\n const KOTLIN_PAREN_TYPE2 = KOTLIN_PAREN_TYPE;\n KOTLIN_PAREN_TYPE2.variants[1].contains = [ KOTLIN_PAREN_TYPE ];\n KOTLIN_PAREN_TYPE.variants[1].contains = [ KOTLIN_PAREN_TYPE2 ];\n\n return {\n name: 'Kotlin',\n aliases: [ 'kt' ],\n keywords: KEYWORDS,\n contains: [\n hljs.COMMENT(\n '/\\\\*\\\\*',\n '\\\\*/',\n {\n relevance: 0,\n contains: [\n {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n }\n ]\n }\n ),\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n KEYWORDS_WITH_LABEL,\n LABEL,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n {\n className: 'function',\n beginKeywords: 'fun',\n end: '[(]|$',\n returnBegin: true,\n excludeEnd: true,\n keywords: KEYWORDS,\n relevance: 5,\n contains: [\n {\n begin: hljs.UNDERSCORE_IDENT_RE + '\\\\s*\\\\(',\n returnBegin: true,\n relevance: 0,\n contains: [ hljs.UNDERSCORE_TITLE_MODE ]\n },\n {\n className: 'type',\n begin: /</,\n end: />/,\n keywords: 'reified',\n relevance: 0\n },\n {\n className: 'params',\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: KEYWORDS,\n relevance: 0,\n contains: [\n {\n begin: /:/,\n end: /[=,\\/]/,\n endsWithParent: true,\n contains: [\n KOTLIN_PAREN_TYPE,\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT\n ],\n relevance: 0\n },\n hljs.C_LINE_COMMENT_MODE,\n KOTLIN_NESTED_COMMENT,\n ANNOTATION_USE_SITE,\n ANNOTATION,\n STRING,\n hljs.C_NUMBER_MODE\n ]\n },\n KOTLIN_NESTED_COMMENT\n ]\n },\n {\n className: 'class',\n beginKeywords: 'class interface trait', // remove 'trait' when removed from KEYWORDS\n end: /[:\\{(]|$/,\n excludeEnd: true,\n illegal: 'extends implements',\n contains: [\n {\n beginKeywords: 'public protected internal private constructor'\n },\n hljs.UNDERSCORE_TITLE_MODE,\n {\n className: 'type',\n begin: /</,\n end: />/,\n excludeBegin: true,\n excludeEnd: true,\n relevance: 0\n },\n {\n className: 'type',\n begin: /[,:]\\s*/,\n end: /[<\\(,]|$/,\n excludeBegin: true,\n returnEnd: true\n },\n ANNOTATION_USE_SITE,\n ANNOTATION\n ]\n },\n STRING,\n {\n className: 'meta',\n begin: \"^#!/usr/bin/env\",\n end: '$',\n illegal: '\\n'\n },\n KOTLIN_NUMBER_MODE\n ]\n };\n}", "title": "" }, { "docid": "ddf001ad065d2dad8e47b8a8de84f7c5", "score": "0.4383008", "text": "inspect(){}", "title": "" }, { "docid": "a7df9cfd7aa5940ee4c12dee1b58802e", "score": "0.43807518", "text": "function defineInspect(classObject) {\n var fn = classObject.prototype.toJSON;\n typeof fn === 'function' || invariant(0);\n classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317')\n\n if (nodejsCustomInspectSymbol) {\n classObject.prototype[nodejsCustomInspectSymbol] = fn;\n }\n }", "title": "" }, { "docid": "a25c681164d1a97ec5657e14fc333c0e", "score": "0.43802854", "text": "function likeNumber(int) {\n let number = findNumberObject(int);\n if (!!number) {\n number.likes++;\n }\n else {\n let newNumber = {id: int, likes: 1};\n likesArray.push(newNumber);\n }\n displayLikes();\n }", "title": "" } ]
57549be4cf1f62d0edb7eca4e24194b4
Get new normal random runner motion step
[ { "docid": "c9cda3684f8d3b84ad420d0cfd9525cc", "score": "0.88009596", "text": "function getNormalRandomRunnerNewMotionStep() {\n return ((Math.random() * animGS.runnerMaxMotionMovingStep * 4) * (Math.random() > 0.5 ? 1 : -1));\n }", "title": "" } ]
[ { "docid": "baf8dfdc7551abbccf43fffbbccd36b2", "score": "0.7463879", "text": "function getEscapistRuningAwayRandomNewMotionStep() {\n return (Math.random() * animGS.runnerMaxMotionMovingStep * 6); // Faster Accelerating for escapist ;-)\n }", "title": "" }, { "docid": "8ee624a87a331c675071f61fc8c1b3b0", "score": "0.7387127", "text": "function getClosingToEscapistRandomNewMotionStep() {\n return (Math.random() * animGS.runnerMaxMotionMovingStep * 4);\n }", "title": "" }, { "docid": "6f46fe0f97e24bb3b192365b8342620b", "score": "0.6805132", "text": "stepAgent() {\n let r = Math.random() * 2 * Math.PI;\n this.direction = [\n this.stepSize * Math.cos(r),\n this.stepSize * Math.sin(r)\n ]\n this.position = this.addVectors(this.position, this.direction);\n }", "title": "" }, { "docid": "6f46fe0f97e24bb3b192365b8342620b", "score": "0.6805132", "text": "stepAgent() {\n let r = Math.random() * 2 * Math.PI;\n this.direction = [\n this.stepSize * Math.cos(r),\n this.stepSize * Math.sin(r)\n ]\n this.position = this.addVectors(this.position, this.direction);\n }", "title": "" }, { "docid": "d0bd364c2e1f7e9049ac460504e4c807", "score": "0.62884325", "text": "function randomizeMovement() {\n environment.edgeType = 1;\n selection = 0;\n}", "title": "" }, { "docid": "b552f53f1ae983fc8498de81ec825e47", "score": "0.6223215", "text": "function getNewMove() {\n let newMove = Math.floor(Math.random() * 4);\n cpuSequence.push(newMove);\n }", "title": "" }, { "docid": "5f2b65077a692841cc44ac2988b795f0", "score": "0.6216909", "text": "getRandomDirection(){\n this.setDirection(Math.floor(Math.random() * 4));\n }", "title": "" }, { "docid": "0c18ae8c06165ceb355f6f9a837ff11c", "score": "0.6148411", "text": "function makeRandomMove () {\n var step = Math.floor(Math.random() * 9);\n return [Math.floor(step / 3), step % 3];\n}", "title": "" }, { "docid": "dd5d074248ac80daad872906c548a0c8", "score": "0.6113967", "text": "function dogOneRandomEventMove(){\n if (dogOneCurrentStep == 3 || dogOneCurrentStep == 6 || dogOneCurrentStep == 9 || dogOneCurrentStep == 12 || dogOneCurrentStep == 16 || dogOneCurrentStep == 19){\n dogOneRandomEvent()\n return;\n }\n }", "title": "" }, { "docid": "9855d9b3dd1269a6e83dfb3ef56f6def", "score": "0.6064698", "text": "radiusSelection() {\n if (this.steps < this.stepsOut / 2) {\n this.radius = floor(random(1, this.steps)) * this.singleStep\n } else if (this.steps > this.stepsOut / 2) {\n this.radius = floor(random(1, this.stepsOut - this.steps)) * this.singleStep\n } else {\n this.radius = floor(random(1, (this.stepsOut / 2) + 0.5)) * this.singleStep\n }\n }", "title": "" }, { "docid": "503ea387cfb83a79ebc0f48d3c6e9876", "score": "0.60302025", "text": "function nextLevel() {\r\n let nextRand = Math.floor(Math.random() * 4);\r\n nextRand = animStarter(nextRand)\r\n levelCounter++;\r\n $('#level-title').html('level ' + levelCounter);\r\n steps.push(nextRand);\r\n copyOfSteps = []\r\n for (var i = steps.length; i > 0; i--) {\r\n copyOfSteps.push(steps[i - 1]);\r\n }\r\n}", "title": "" }, { "docid": "8f4817410b22f8a08eab57889f3ea868", "score": "0.60288215", "text": "randStep(min, max, step) {\n return min + (step * Math.floor(Math.random() * (max - min) / step));\n }", "title": "" }, { "docid": "a4fb6cf191102a339d1ca4fba9ea54bf", "score": "0.59942365", "text": "addStep() {\n let chance = new Chance();\n let randomNum = chance.integer({ min: 0, max: 3 });\n this.sequence.push(randomNum);\n this.count++;\n return randomNum;\n }", "title": "" }, { "docid": "4e91ef46e82240f2ca27a577cf90f681", "score": "0.5972911", "text": "function random() {\n\t\tr = (r + 0.1) % 1\n\t\treturn r\n\t}", "title": "" }, { "docid": "00cd52c95f52df5e268804d47e30b0b4", "score": "0.59454", "text": "function getNewTarget() {\n // Generate a radnom number between 1 and 100\n TargetNum = Math.floor((Math.random() * 100) + 1);\r\n console.log(TargetNum);\r\n}", "title": "" }, { "docid": "a2df5cdafa4ad6423d661c2592bb6557", "score": "0.59411746", "text": "next_rand() {\n this.jitter_pos *= 10;\n if (this.jitter_pos > 10000000000)\n this.jitter_pos = 10;\n return (this.jitter * this.jitter_pos) % 1;\n }", "title": "" }, { "docid": "ef873e243cce94775f3b171e9b5479c0", "score": "0.59238344", "text": "getRandomRoll() {\n\t\tthis.faceValue = this.randomNumber();\n\t\treturn this.faceValue;\n\t}", "title": "" }, { "docid": "a48588760b639596a7f7bafab504916c", "score": "0.59211105", "text": "function getRandomStartingRunnerAlphaComponent() {\n var minA = 0.3;\n\n minA += Math.random() * 0.7;\n\n if (minA > 1) {\n minA = 1;\n }\n\n return minA;\n }", "title": "" }, { "docid": "3dbec2af51eceb4bb0e71bf7d0e57f37", "score": "0.5900738", "text": "function newGeneration(){\n firstTime = 1;\n newGen === true ? step() : null\n}", "title": "" }, { "docid": "41e45947684c215405fada453511b729", "score": "0.5899013", "text": "randomSpeed() {\n this.sp = movementMultip * Math.floor(Math.random() * 10+1);\n }", "title": "" }, { "docid": "df0cf12aac7c786554858cdae41cc4b1", "score": "0.58964014", "text": "function determineMove() {\n \n return chooseRandomItem(cardinalPoints);\n}", "title": "" }, { "docid": "ff841b985c526775fa66f985af4ddc27", "score": "0.58862895", "text": "next_rand() {\n\t\tthis.jitter_pos *= 10;\n\t\tif (this.jitter_pos > 10000000000)\n\t\t\tthis.jitter_pos = 10;\n\t\treturn (this.jitter * this.jitter_pos) % 1;\n\t}", "title": "" }, { "docid": "c207c8d93a3b76aa7222ebce72357714", "score": "0.58752656", "text": "function generateTarget() {\n return Math.floor(Math.random()*10)\n}", "title": "" }, { "docid": "2c12f4b53f946930ab71e7e1c79812a3", "score": "0.5871065", "text": "function getDirection(){\n\t return Math.floor((Math.random() * 4) + 1);\t\n}", "title": "" }, { "docid": "eeaddca975f68babfb125100845ef7ff", "score": "0.5859769", "text": "function generateTarget() {\n return Math.floor(Math.random() * 10) \n}", "title": "" }, { "docid": "7c38f99a232a36dcdc6c36816208035e", "score": "0.5859378", "text": "mutate() {\n //chance that any vector in directions gets changed\n let mutationRate = CONFIG.PERCENTAGE_MUTATION\n\n for (let i = 0; i < this.directions.length; i++) {\n let rand = MyMath.random(1)\n if (rand < mutationRate) {\n \n //set this direction as a random direction \n let randomAngle = MyMath.random(2 * Math.PI)\n this.directions[i] = randomAngle\n }\n }\n }", "title": "" }, { "docid": "f0c270af4ab75edaef1e1ae5a22b4a32", "score": "0.5859262", "text": "function generateTarget(){\n\treturn Math.floor(Math.random()*10);\n}", "title": "" }, { "docid": "39afe84d3e461dd387ffad27971deef7", "score": "0.5853932", "text": "generate()\n {\n return Utils.getRandomVectorBetween(this.min, this.max);\n }", "title": "" }, { "docid": "bea30cd11e583ed2cb972477eb0e00bb", "score": "0.58524", "text": "function generateTarget(){\n return Math.floor(Math.random()*10)\n \n}", "title": "" }, { "docid": "4420bca3078a4991ec1f65d06a3b76a5", "score": "0.58502203", "text": "generate () {\n return Utils.getRandomVectorBetween(this.min, this.max)\n }", "title": "" }, { "docid": "d0433664bbb93186b1c153d479c056ac", "score": "0.5839947", "text": "function generateTarget() {\n\treturn Math.floor(Math.random() * 10);\n}", "title": "" }, { "docid": "8dbbeb335a64e22f8e87b6d808dd9645", "score": "0.5836368", "text": "function generateTarget(){\n return Math.floor(Math.random () * 10)\n}", "title": "" }, { "docid": "ffea49e9d14a28d84474da03b1ec57e8", "score": "0.58308697", "text": "function randStart() {\n return Math.random() - .5;\n}", "title": "" }, { "docid": "22faf9c3f7864158f12ef703182a2f71", "score": "0.5830501", "text": "function generateTarget() {\n return Math.floor(10 * Math.random());\n}", "title": "" }, { "docid": "d91682a77785a25ba720897f4ba0cf0c", "score": "0.5821677", "text": "function generateTarget() {\n return Math.floor(Math.random()* 9)\n}", "title": "" }, { "docid": "d57e1871e2dbf17cf5a50ff88043e1d9", "score": "0.5811098", "text": "function generateTarget() {\n return Math.floor(Math.random() * 10)\n}", "title": "" }, { "docid": "6efdb3b267c1edd1e499035a8a064d67", "score": "0.58015585", "text": "function generateTarget() {\n return Math.floor(Math.random() * 10);\n}", "title": "" }, { "docid": "6efdb3b267c1edd1e499035a8a064d67", "score": "0.58015585", "text": "function generateTarget() {\n return Math.floor(Math.random() * 10);\n}", "title": "" }, { "docid": "2d718ee95d76f894212096faee157e82", "score": "0.57980853", "text": "function generateTarget(){\n return Math.floor(Math.random() * 10);\n}", "title": "" }, { "docid": "2d718ee95d76f894212096faee157e82", "score": "0.57980853", "text": "function generateTarget(){\n return Math.floor(Math.random() * 10);\n}", "title": "" }, { "docid": "15a8593a24a6d04680be30f586459937", "score": "0.5787944", "text": "setRandomSpawnPoint() {\n // leer\n }", "title": "" }, { "docid": "b762ff43594754daf5fa06581a40e817", "score": "0.5783959", "text": "function generateTarget() {\n return Math.floor(Math.random() * 10);\n}", "title": "" }, { "docid": "b762ff43594754daf5fa06581a40e817", "score": "0.5783959", "text": "function generateTarget() {\n return Math.floor(Math.random() * 10);\n}", "title": "" }, { "docid": "88dcaf385a749c0046eae440451a1bd6", "score": "0.57586324", "text": "function doubleRandom() {\n background(color1, 20);\n stroke(color2);\n fill(color2);\n var rand = 0;\n for (var i = 1; i < steps; i++) {\n point((width/steps) * i, (height / 2) + random(-rand, rand));\n rand = heart*random(-500, 500);\n }\n}", "title": "" }, { "docid": "b9132ece96d8fe56ad59c043d4bc95ad", "score": "0.5746589", "text": "function generateTarget() { \n return Math.floor(Math.random() * 9)\n;}", "title": "" }, { "docid": "f09e73ac99ab727d78c8b31a92158c22", "score": "0.5742837", "text": "function sequence_step(step, speed) {\n if (step <= currentScore) {\n let randomPanel = Math.floor(Math.random() * 4);\n sequence.push(randomPanel);\n console.log(\"DEBUG : randomPanel=\" + randomPanel);\n setTimeout(\"anim_panel(\" + randomPanel + \", \" + speed + \")\", speed);\n setTimeout(\"sequence_step(\" + step + \" + 1, \" + speed + \")\", speed * 3);\n } else {\n // Clear user sequence\n userSequence = new Array();\n // Enable clicks\n enableClicks();\n }\n}", "title": "" }, { "docid": "a57fc52857a6c34d95e52c1c8bff7aa0", "score": "0.5740812", "text": "function generateTarget(){\n return Math.floor(Math.random() * 10);\n}", "title": "" }, { "docid": "ef9fe31b4ab47a5937ec07f45d17416d", "score": "0.57314515", "text": "onTransitionStart() {\n this.seed = Math.random() * 45000;\n }", "title": "" }, { "docid": "dec54e77aa34f351078aa48b1a1e3a6d", "score": "0.57276684", "text": "function generateTarget() {\n return Math.floor(Math.random() * 9);\n}", "title": "" }, { "docid": "9af31b7a16daa37e8718582203db0416", "score": "0.5715926", "text": "function newTrial() {\n criticalMass = genRand(99.5, 100.5, 1); //Generate a new critical mass\n resetPosition(); //Reset the position of the simulation\n}", "title": "" }, { "docid": "27b1a19d53b1920cfd2c14612946db73", "score": "0.5711839", "text": "randomDirection() {\n return this.randomFrom(['up', 'down', 'left', 'right']);\n // return ['up', 'down', 'left', 'right'][Math.floor(Math.random() * 4)];\n }", "title": "" }, { "docid": "6d96dee373f76167b9b810f50fdd5bb2", "score": "0.57097346", "text": "randomizeDirection() {\n //Create variables to pick randomly from array\n let directions = [this.size, 0, -this.size];\n //Pick from the array index and set the next direction on a horizontal axis\n let randomDirection = floor(random(0, 1) * directions.length);\n this.nextDirectionX = directions[randomDirection];\n //Pick from the array index and set the next direction on a vertical axis\n randomDirection = floor(random(0, 1) * directions.length);\n this.nextDirectionY = directions[randomDirection];\n\n\n\n }", "title": "" }, { "docid": "8cae43efd0d549083fc42ebf4381cc3a", "score": "0.57082695", "text": "updateRadiusStep() {\n\n\t\tconst r = this.r / this.samples;\n\t\tthis.uniforms.get(\"radiusStep\").value.set(r, r).divide(this.resolution);\n\n\t}", "title": "" }, { "docid": "ad29564c5943ca878efefc7eb35b5d34", "score": "0.57081664", "text": "function dogOneGameRandomEvent(){\n var random = Math.random();\n if (random < 0.25){\n dogOne.currentStep += 2;\n dogOne.move = dogOne.currentStep;\n DogOneRandomMovingXandY();\n boardMsg(dogOne.name + \" move forward two spaces\");\n } else if (random < 0.50) {\n dogOne.currentStep -=2;\n dogOne.move = dogOne.currentStep;\n DogOneRandomMovingXandY();\n boardMsg(dogOne.name + \" move backward two spaces\");\n } else if (random < 0.75){\n dogOne.currentStep += 1;\n dogOne.move = dogOne.currentStep;\n DogOneRandomMovingXandY();\n boardMsg(dogOne.name + \" move forward one spaces\");\n } else if (random < 1) {\n dogOne.currentStep -= 1;\n dogOne.move = dogOne.currentStep;\n DogOneRandomMovingXandY();\n boardMsg(dogOne.name + \" move backward one spaces\");\n }\n return;\n }", "title": "" }, { "docid": "dd184adbe288589463da7ccbc588ae79", "score": "0.5689681", "text": "getRandom() {\n return Math.floor(Math.random() * this.history.length);\n }", "title": "" }, { "docid": "32fa2473ba80a3b1472cb4130238105e", "score": "0.5689539", "text": "function move() {\n orb.roll(60, Math.floor(Math.random() * 360));\n }", "title": "" }, { "docid": "fc5f832eb373f82118488f2c564726f0", "score": "0.56812805", "text": "function addNewRandomMove() {\n var randomNumber = Math.random();\n console.log('random number: '+ randomNumber);\n if (randomNumber < 0.25) {\n game.sequence.push(\"p\");\n } else if (randomNumber >= 0.25 && randomNumber < 0.5) {\n game.sequence.push(\"y\");\n } else if (randomNumber >= 0.5 && randomNumber < 0.75) {\n game.sequence.push(\"w\");\n } else if (randomNumber >= 0.75) {\n game.sequence.push(\"b\");\n }\n console.log('game.sequence:', game.sequence);\n}", "title": "" }, { "docid": "f4c2fabbc260600f527c60f20d313a2d", "score": "0.56804097", "text": "function oneAnimRunnerMotion() {\n this.motionX = 0;\n this.motionY = 0;\n }", "title": "" }, { "docid": "c7d37284f2e7b1a9f9958686832506a5", "score": "0.56792915", "text": "function step(rise, run, x, y, inverted) {\n if (run === 0) return noWall;\n var dx = run > 0 ? Math.floor(x + 1) - x : Math.ceil(x - 1) - x;\n var dy = dx * (rise / run);\n return {\n x: inverted ? y + dy : x + dx,\n y: inverted ? x + dx : y + dy,\n length2: dx * dx + dy * dy\n };\n }", "title": "" }, { "docid": "0b57c5cc33f1fc0e454a0dfe6fed94c3", "score": "0.56606215", "text": "function randVelocity() {\n return Math.random() * (3.5 - 2.25) + 2.25;\n}", "title": "" }, { "docid": "62207effbe5a35b69ddf50e7c1c66cd7", "score": "0.56575143", "text": "function nextTurn()\r\n{\r\n var random=Math.trunc(Math.random()*4);\r\n return random;\r\n}", "title": "" }, { "docid": "79846d252a19d5fee56c2822c8690876", "score": "0.5654749", "text": "function random () {\n return MIN_FLOAT * baseRandInt();\n }", "title": "" }, { "docid": "f467138f1720a2bc35ae720dc701a9fd", "score": "0.56468123", "text": "randomize() {\n for (let i = 0; i < this.directions.length; i++) {\n let randomAngle = MyMath.random(2 * Math.PI)\n this.directions[i] = randomAngle\n }\n }", "title": "" }, { "docid": "8be1eb3bbd6abd92e7a71d1a2e003c6e", "score": "0.56408584", "text": "function setNew() {\n curPos = 4\n rndT = nextRnd\n nextRnd = Math.floor(Math.random()*tetrominoes.length)\n curT = tetrominoes[rndT][curRot]\n }", "title": "" }, { "docid": "ac3bff93fb34f767f4feda4730f80f3d", "score": "0.56358045", "text": "constructor() {\n this.amplitude = Math.random() * (10 - 2) + 2;\n this.checkSin = this.randomBool();\n this.choice = Math.round(Math.random() * (2 - 1)) + 1;\n this.direction1 = this.randomDirection();\n this.direction2 = this.randomDirection();\n // this.length = Math.ceil(Math.random() * 500);\n this.drawnLength = 0;\n this.length = Math.random() * 40;\n }", "title": "" }, { "docid": "3026ebb55a4bb21a2afc30b876ad3e9f", "score": "0.5630818", "text": "function locRnd() {\n return (Math.random() - 0.5) / 50;\n}", "title": "" }, { "docid": "2d5da0e85d9636ded885520fcd2725a4", "score": "0.5629306", "text": "move() {\r\n this.x += Math.random() * 4 - 2;\r\n this.y += Math.random() * 4 - 2;\r\n }", "title": "" }, { "docid": "2d5da0e85d9636ded885520fcd2725a4", "score": "0.5629306", "text": "move() {\r\n this.x += Math.random() * 4 - 2;\r\n this.y += Math.random() * 4 - 2;\r\n }", "title": "" }, { "docid": "cfd24b69a8457b612ae87ce2553ac7a8", "score": "0.56292933", "text": "function getAutoMove(b) {\n return Math.floor(Math.random() * 4);\n}", "title": "" }, { "docid": "b9b37cc4acf0290eda5fa13ebf0279cd", "score": "0.5627997", "text": "function setGoal() {\n goal = Math.floor(Math.random() * 102) + 19;\n}", "title": "" }, { "docid": "97ae655b439045ca97d7dc6077753668", "score": "0.5624662", "text": "function increase () {\n userStatus.steps++;\n //decrease energy by random number of 1-10 per step\n userStatus.energy -= Math.floor(Math.random() * 10) + 1;\n }", "title": "" }, { "docid": "1514d70943dc53ad88ff6ab0f74b9e8b", "score": "0.5619422", "text": "function randomNormal() {\r\n var u = 1 - Math.random(); // Subtraction to flip [0, 1) to (0, 1].\r\n var v = 1 - Math.random();\r\n return Math.sqrt( -2.0 * Math.log( u ) ) * Math.cos( 2.0 * Math.PI * v );\r\n}", "title": "" }, { "docid": "35d4fecb0ffc2d3eec2d4949c1911ca6", "score": "0.56136143", "text": "function inning(){\n \n //DEBUGGING\n //console.log( Math.round(Math.random() * 2 ) );\n \n return Math.round(Math.random() * 2);\n }", "title": "" }, { "docid": "9b7585fc18b38a79a816cca207ad1bf4", "score": "0.5603738", "text": "move(){\r\n if((this.timing) % (this.depth+1) == 0){\r\n this.hide()\r\n this.y ++\r\n if (this.y >= 5){\r\n this.y = randint(-10, 0)\r\n this.depth = randint(0, 4)\r\n this.timing= 0\r\n this.x = randint(0, 4)\r\n } \r\n this.show()\r\n } \r\n this.timing++\r\n }", "title": "" }, { "docid": "ebf349ffd854b28ec9fdfa0558d9ea19", "score": "0.55958086", "text": "function randomizer() {\n target = Math.floor(Math.random() * 100) + 19;\n gem1rando = Math.floor(Math.random() * 13) + 2;\n gem2rando = Math.floor(Math.random() * 13) + 2;\n gem3rando = Math.floor(Math.random() * 13) + 2;\n gem4rando = Math.floor(Math.random() * 13) + 2;\n }", "title": "" }, { "docid": "fe5ffd3b2c60aa1602b81da824102725", "score": "0.5593228", "text": "function SeededRandom(){}", "title": "" }, { "docid": "e2abbf58252395e4fffeabb36c7c9af5", "score": "0.5589699", "text": "move() {\n var dirx = Math.random() > 0.5 ? 1 : -1;\n var diry = Math.random() > 0.5 ? 1 : -1;\n var L = int((Math.random() * 20));\n var L2 = int((Math.random() * 20));\n this.endx = this.posx + (L * dirx);\n this.endy = this.posy + (L2 * diry);\n }", "title": "" }, { "docid": "fb1e8b7c3703859eea3e4351aa7c4e52", "score": "0.5589632", "text": "function rand(){\n return Math.random()-0.5;\n }", "title": "" }, { "docid": "8b1a301c60f880fc96c2f33a4322b318", "score": "0.5562152", "text": "function generateRandomSwim()\n\t\t{\n\t\t\tlet randomTimerDuration = RandomSwimInterval_Min + Math.floor((1 + RandomSwimInterval_Max - RandomSwimInterval_Min) * Math.random());\n\t\t\tcurrentRandomTimer = window.setTimeout(doRandomSwim, randomTimerDuration);\n\t\t} // end generateRandomSwim()", "title": "" }, { "docid": "25ad9ca30fe6e2533d250202a71e11f2", "score": "0.5557064", "text": "invertDirectionRandom() {\n let hasInverted = false;\n if (Math.random() < 0.5) {\n let temp = this.deltaY;\n this.deltaY = this.deltaX;\n this.deltaX = temp;\n hasInverted = true;\n }\n if (Math.random() < 0.5) {\n this.deltaX = -this.deltaX;\n hasInverted = true;\n }\n if (Math.random() < 0.5) {\n this.deltaY = -this.deltaY;\n hasInverted = true;\n }\n if (!hasInverted) {\n this.invertDirection();\n }\n this.updateHitboxes();\n }", "title": "" }, { "docid": "cb4f7da3fdd235af9e5ecad3b91e8f86", "score": "0.555244", "text": "nextStep() {\n const me = this;\n\n // Only perform step if in view and not scrolling\n if (me.shouldPause) {\n return;\n }\n\n if (me.currentStep === me.steps.length) {\n if (me.repeat) {\n me.currentStep = 0;\n } else {\n return me.abort(true);\n }\n }\n\n // First step, signal to let demo initialize stuff\n if (me.currentStep === 0) {\n me.trigger('initialize');\n }\n\n const mouse = me.mouse,\n step = me.normalizeStep(me.steps[me.currentStep++]),\n target = me.getTarget(step),\n action = step.action;\n\n if (target && action) {\n mouse.className = 'simulated-mouse';\n\n if (action === 'mousemove') {\n me.handleMouseMove(step, target);\n } else {\n // First move mouse into position\n if (target !== me.prevTarget) {\n const rect = Rectangle.from(target, me.outerElement);\n mouse.style.left = rect.x + rect.width / 2 + 'px';\n mouse.style.top = rect.y + rect.height / 2 + 'px';\n }\n\n if (action === 'mousedown') {\n me.mouseDown = true;\n }\n\n if (action === 'mouseup') {\n me.mouseDown = false;\n }\n\n // Then trigger action\n me.timeoutId = me.setTimeout(\n () => {\n me.prevTarget = target;\n\n // Animate click etc.\n mouse.classList.add(action);\n\n if (action === 'type') {\n const field = IdHelper.fromElement(target),\n parts = step.text.split('|');\n\n field.value = parts[parts.length === 1 || field.value != parts[0] ? 0 : 1];\n } else {\n me.triggerEvent(target, action);\n }\n },\n action === 'type' ? 100 : 550\n );\n }\n }\n }", "title": "" }, { "docid": "fe3a57ace946140d7c4a8d31f0c6cef2", "score": "0.5538928", "text": "move() {\n\n\t\tthis.x += random(-5, 5);\n\t\tthis.y += random(-5, 5);\n\n\t}", "title": "" }, { "docid": "e6b0a25304d40d952643f4f2e31927a7", "score": "0.55388904", "text": "generateSpeed(){\n return Math.floor(Math.random()*(250-225)+225);\n }", "title": "" }, { "docid": "df114dda8a2e55cdf7fd454b5f71d27e", "score": "0.5533919", "text": "move() {\n this.x = this.x + random(-2, 2);\n this.y = this.y + random(-2, 2);\n }", "title": "" }, { "docid": "f01aee5bc54cc6af78b20c1cd1948bf4", "score": "0.55218303", "text": "function makeDynamicTimeDigitMovement7() {\n\n // NOTE: makeDynamicTimeDigitMovement7 just OFFESTS ALL RUNNERS to the WHOLE equally distributed points of the screen !\n\n // Offset time-digits immediately very rarely !\n var bOffsetImmediately = Math.random() > 0.995;\n\n if (bOffsetImmediately === true) {\n\n var howManyEdgesPoints = animGS.runners.length;\n var howManyHorizontalLines = calcRndGenMinMax(3, parseInt(howManyEdgesPoints / 3, 10));\n var oneStepX = animGS.cnvWidth / (howManyEdgesPoints / howManyHorizontalLines);\n var oneStepY = animGS.cnvHeight / (howManyHorizontalLines - 1);\n var startEdgeX = 0;\n var startEdgeY = 0;\n var allEdgesPointsCounter = 0;\n\n var allDigitsDynamicOffsets = new Array(howManyEdgesPoints);\n\n for (var addo = 0; addo < allDigitsDynamicOffsets.length; addo++) {\n allDigitsDynamicOffsets[addo] = new Array(2);\n }\n\n while (allEdgesPointsCounter < howManyEdgesPoints) {\n\n allDigitsDynamicOffsets[allEdgesPointsCounter][0] = startEdgeX + (Math.random() * oneStepX);\n allDigitsDynamicOffsets[allEdgesPointsCounter][1] = startEdgeY;\n\n startEdgeX += oneStepX;\n allEdgesPointsCounter++;\n\n if (startEdgeX >= animGS.cnvWidth) {\n startEdgeX = 0;\n startEdgeY += oneStepY;\n }\n }\n\n // Randomize the order !\n allDigitsDynamicOffsets.sort(function () { return (0.5 - Math.random()); });\n\n for (var i = 0; i < animGS.runners.length; i++) {\n animGS.runners[i].runnerX = allDigitsDynamicOffsets[i][0];\n animGS.runners[i].runnerY = allDigitsDynamicOffsets[i][1];\n }\n }\n\n return;\n }", "title": "" }, { "docid": "5a992c5423361d2228dae1b675328ace", "score": "0.55174416", "text": "static next(): State<TetrisPiece, Random.Generator> {\n return Random.intBetween(0, TYPE.length - 1).map(i => new TetrisPiece(i, 0));\n }", "title": "" }, { "docid": "5e57e022cd8ab19b779825661845ffba", "score": "0.5513541", "text": "nextStep() {\n const me = this; // Only perform step if in view and not scrolling\n\n if (me.shouldPause) {\n return;\n }\n\n if (me.currentStep === me.steps.length) {\n if (me.repeat) {\n me.currentStep = 0;\n } else {\n return me.abort(true);\n }\n } // First step, signal to let demo initialize stuff\n\n if (me.currentStep === 0) {\n me.trigger('initialize');\n }\n\n const mouse = me.mouse,\n step = me.normalizeStep(me.steps[me.currentStep++]),\n target = me.getTarget(step),\n action = step.action;\n\n if (target && action) {\n mouse.className = 'simulated-mouse';\n\n if (action === 'mousemove') {\n me.handleMouseMove(step, target);\n } else {\n // First move mouse into position\n if (target !== me.prevTarget) {\n const rect = Rectangle.from(target, me.outerElement);\n mouse.style.left = rect.x + rect.width / 2 + 'px';\n mouse.style.top = rect.y + rect.height / 2 + 'px';\n }\n\n if (action === 'mousedown') {\n me.mouseDown = true;\n }\n\n if (action === 'mouseup') {\n me.mouseDown = false;\n } // Then trigger action\n\n me.timeoutId = me.setTimeout(() => {\n me.prevTarget = target; // Animate click etc.\n\n mouse.classList.add(action);\n\n if (action === 'type') {\n const field = Widget.fromElement(target),\n parts = step.text.split('|');\n field.value = parts[parts.length === 1 || field.value != parts[0] ? 0 : 1];\n } else {\n me.triggerEvent(target, action);\n }\n }, action === 'type' ? 100 : 550);\n }\n }\n }", "title": "" }, { "docid": "e3bb165ff8721654e6183ed5f9b96158", "score": "0.55083126", "text": "move() {\n this.x += random(-5, 5);\n this.y += random(-5, 5);\n }", "title": "" }, { "docid": "24b13cf988e134b5ac74a44e8d2f7310", "score": "0.5502753", "text": "normal() {\n var x = 0,\n y = 0,\n rds, c;\n do {\n x = Math.random() * 2 - 1;\n y = Math.random() * 2 - 1;\n rds = x * x + y * y;\n } while (rds == 0 || rds > 1);\n c = Math.sqrt(-2 * Math.log(rds) / rds); // Box-Muller transform\n return x * c; // throw away extra sample y * c\n }", "title": "" }, { "docid": "d2cf1c13df0ee271a2ee6f49fcebc8c2", "score": "0.54994714", "text": "function GetStep()\n{\n\treturn m_step;\n}", "title": "" }, { "docid": "101b3a02d34ce910ffe7b51fba794b1d", "score": "0.5495131", "text": "function randomDirection() {\n var y = Math.random() * 1.6 - 0.8;\n var x = Math.sqrt(1 - y ** 2);\n if (objectMove.direction[0] > 0) {\n x = -x;\n }\n objectMove.direction[0] = x;\n objectMove.direction[1] = y;\n}", "title": "" }, { "docid": "e4857517c1710f566e2d7ffad792b1fe", "score": "0.54931194", "text": "function doRoll() {\n return Math.floor((Math.random()*6)+1); /*returning a random number*/\n }", "title": "" }, { "docid": "dee4232036609bb3a320d75f28600ca9", "score": "0.5482525", "text": "function normal() {\n var x = 0, y = 0, rds, c;\n do {\n x = Math.random() * 2 - 1;\n y = Math.random() * 2 - 1;\n rds = x * x + y * y;\n } while (rds == 0 || rds > 1);\n c = Math.sqrt(-2 * Math.log(rds) / rds); // Box-Muller transform\n return x * c; // throw away extra sample y * c\n }", "title": "" }, { "docid": "fc7fca8a3081b552a645e6b2cfc48fd9", "score": "0.5481527", "text": "function generateStep (steps) {\n\t\t return function (p) {\n\t\t return Math.round(p * steps) * (1 / steps);\n\t\t };\n\t\t }", "title": "" }, { "docid": "18c55392a4231963ec3759219f8a3b94", "score": "0.5478047", "text": "function ChanceToShoot(){\n\t\treturn Math.round((Math.random()* 6) + 1);\n\t}", "title": "" }, { "docid": "4d4d17ce77e6eaaaa7efda09dd5123d6", "score": "0.5467222", "text": "function spin(){\n rand = Math.floor(Math.random() * 38);\n var position = createWheel(rand);\n return position;\n}", "title": "" }, { "docid": "33209cc3147e1379b353291514e8c17e", "score": "0.54660887", "text": "function randomDirectionClick() {\n\tif (checkDirectionEquality()) {\n\t\tdirection.value = Math.floor(Math.random() * (+ 360 - (+0))) + (+0); \n\t\ttempDirection = direction.value;\n\t\tsetGradient();\n\t} else {\n\t\tuserDirectionClick();\n\t}\n}", "title": "" }, { "docid": "b891af613486a522bb661dabe6860137", "score": "0.5465696", "text": "step() { }", "title": "" }, { "docid": "a4e23c4160e85fcc4fffab8b0045b039", "score": "0.54624575", "text": "function generateStep (steps) {\n\t return function (p) {\n\t return Math.round(p * steps) * (1 / steps);\n\t };\n\t }", "title": "" }, { "docid": "a4e23c4160e85fcc4fffab8b0045b039", "score": "0.54624575", "text": "function generateStep (steps) {\n\t return function (p) {\n\t return Math.round(p * steps) * (1 / steps);\n\t };\n\t }", "title": "" } ]
07516adab8498c32dfade5711cade5fa
ctx.fillRect(0,0,canvas.width,canvas.height); todas las cosas en la pantalla son un objeto clases
[ { "docid": "672db827f9a7b0ecc63d0839a4483203", "score": "0.0", "text": "function Board(){\n this.x = 0;\n this.y = 0;\n this.width =canvas.width;\n this.height=canvas.height;\n this.img = new Image ();\n this.img.src = \"http://ellisonleao.github.io/clumsy-bird/data/img/bg.png\";\n this.score = 0;\n this.music = new Audio();\n this.music.src = \"assets/audio.mp3\";\n //metodo principal de cualquier clase es el metodo draw\n this.draw = function(){\n this.move();\n ctx.drawImage(this.img, this.x,this.y,this.width,this.height);\n //segunda imagen, la x de la primer imagen mas el ancho del canvas para que aparezca detras de la primer imagen\n ctx.drawImage(this.img, this.x + canvas.width, this.y,this.width,this.height);\n //cambiar el estilo del texto\n ctx.font = \"50px Avenir\";\n ctx.fillStyle = \"peru\";\n ctx.fillText(this.score,this.width/2, this.y+50);\n\n }\n //dibuja imagen, origen de imagen (x,y), ancho de imagen(ancho del canvas)\n //se usa el this para no tener que cambiar cada propiedad por separado\n //si una funcion tiene dos puntos requiere bind() porque esta en el siguiente nivel de la funcion\n //si se trabaja en otro nivel se requiere el bind()\n this.img.onload = function(){\n //llama la funcion this.draw() una vez que la imagen carga(por peso)\n this.draw();\n }.bind(this)\n//para mover el fondo, se usan dos imagenes una reemplaza a la otra una vez que se a desplazado\n this.move = function(){\n this.x --;\n if(this.x < -canvas.width) this.x = 0;\n }\n \n}", "title": "" } ]
[ { "docid": "c5d3eb424f64fd38fe2694efb9204845", "score": "0.75422454", "text": "draw() {\r\n this.context.fillStyle = 'black';\r\n this.context.fillRect(this.x, this.y, this.width, this.height);\r\n }", "title": "" }, { "docid": "618baef550ac2fd1472861cc7017996d", "score": "0.75121444", "text": "function draw(ctx, obj) {\n ctx.fillStyle = obj.color\n ctx.fillRect(obj.x, obj.y, obj.width, obj.height)\n}", "title": "" }, { "docid": "173640aa2ef7370d596ce791d6b7ca08", "score": "0.74840355", "text": "draw(ctx) {\n ctx.fillStyle = '#0ff';\n ctx.fillRect(this.postion.x, this.postion.y, this.width, this.height);\n }", "title": "" }, { "docid": "ac98bb38bfa7f8a06ec745c775de1110", "score": "0.7437654", "text": "function CanvasObj(canvas, x, y, w, h, fill){\r\n\t\tthis.x = x||0;\r\n\t\tthis.y = y||0;\r\n\t\tthis.w = w||0;\r\n\t\tthis.h = h||0;\r\n\t\tthis.objects = [];\r\n\t\tthis.ctx = context_for(canvas);\r\n\t\tthis.init(canvas, fill);\r\n\t}", "title": "" }, { "docid": "1780535bfce5a7216840cde953f88cb1", "score": "0.7415724", "text": "function render() {\n Dibujante.canvas.getContext('2d').fillStyle = '#f9fafc';\n Dibujante.canvas.getContext('2d').fillRect(0, 0, Dibujante.canvas.width, Dibujante.canvas.height);\n Dibujante.canvas.getContext('2d').fillStyle = COLOR;\n\n //Renderizar objetos\n }", "title": "" }, { "docid": "583454c431dffb380907616aed4d2561", "score": "0.73157465", "text": "draw(board){\r\n \r\n board.fillStyle=\"black\";\r\n board.fillRect(this.x,this.height,this.width,this.height/3*2)\r\n \r\n }", "title": "" }, { "docid": "90883f18abdf741bac64c65f77020bd2", "score": "0.7311458", "text": "constructor(x,y,w,h,col, strk,canvas){\r\n this.x = x;\r\n this.y = y;\r\n this.w = w;\r\n this.h = h;\r\n this.outline = strk;\r\n this.fill = col;\r\n this.element = canvas;\r\n this.element.addEventListener('click', this.mClick.bind(this));\r\n this.element.addEventListener('mousemove', this.mMove.bind(this));\r\n this.xMouse = 0;\r\n this.yMouse = 0;\r\n this.inBounds = false;\r\n \r\n\r\n}", "title": "" }, { "docid": "29bde19cc2c6cd812081e1ea40d259b4", "score": "0.7220732", "text": "drawCanvas() {\n ctx.fillStyle = \"#000000\";\n ctx.fillRect(0, 0, 560, 650);\n }", "title": "" }, { "docid": "597208efb766348c8d815b13b8b237b6", "score": "0.71577007", "text": "draw(ctx) {\r\n // Cia buvo ispradziu 10,10 nes tik paskuj declare kur jis stoves pagal this.\r\n ctx.drawImage(\r\n this.image,\r\n this.position.x,\r\n this.position.y,\r\n this.size,\r\n this.size\r\n );\r\n }", "title": "" }, { "docid": "6eafba2d40278130b9e0562d85b6d33f", "score": "0.70732766", "text": "function dibujarRectangulo(r) {\n contexto.save();\n contexto.translate(r.x, r.y);\n contexto.fillStyle = r.color;\n contexto.fillRect(0, 0, r.ancho, r.alto);\n contexto.restore();\n}", "title": "" }, { "docid": "b3d4fb43731616aaa72c69c569666f0c", "score": "0.70235914", "text": "draw(ctx) {\n ctx.fillStyle = this.thing.fill;\n ctx.globalAlpha = 0.5;\n ctx.fillRect(this.x, this.y, this.w, this.h);\n }", "title": "" }, { "docid": "cfd919885811c26c3789976261188a8b", "score": "0.7020912", "text": "constructor(canvas, canvasWidth, canvasHeight) {\n this.context = canvas.getContext(\"2d\");\n this.width = canvasWidth;\n this.height = cnavasheight;\n }", "title": "" }, { "docid": "0502185318f194254fdbd11f26afabb3", "score": "0.70156384", "text": "function init(){\n context.clearRect(0,0, width, height);\n //context.fillStyle = \"black\";\n //context.strokeStyle = \"black\";\n context.strokeRect(0,0, width, height);\n //Dessin éléments de grille sur l'écran\n context.strokeStyle = \"#eee\";\n context.stroke();\n }", "title": "" }, { "docid": "07e0667f25146ac0d848ddec18db1bd5", "score": "0.69836956", "text": "drawToContext(theContext) {\n theContext.fillStyle = this.color;\n theContext.fillRect(\n this.x - this.width / 2,\n this.y - this.height / 2,\n this.width,\n this.height\n );\n }", "title": "" }, { "docid": "20fcc158b920b9c45aab74890cfe869d", "score": "0.6978682", "text": "function dibujo(x,y,z,w) {\n ctx.fillStyle='red';\n ctx.fillRect(x,y,z,w);\n}", "title": "" }, { "docid": "2649d0f561fce1b64d2836a34237e0a7", "score": "0.69581217", "text": "function dibujo2(x,y,z,w) {\n ctx.fillStyle='yellow';\n ctx.fillRect(x,y,z,w);\n}", "title": "" }, { "docid": "6e85ed9ef97cc5bac406e5c9dbfab3cc", "score": "0.6951212", "text": "draw () {\n ctx.fillStyle = \"green\";\n ctx.fillRect(this.x * box, this.y * box, box, box);\n }", "title": "" }, { "docid": "afe138bb06d1b7bcfe7a7d64aa7bba62", "score": "0.6936457", "text": "function createObject() {\n\tcontext.fillStyle = \"red\";\n\tcontext.fillRect(object.x, object.y, box, box);\n}", "title": "" }, { "docid": "e4e41ae59535dd44718d26676627c66b", "score": "0.69126236", "text": "draw(ctx) {\n ctx.shadowBlur = 3;\n ctx.shadowColor = \"#979\";\n ctx.fillStyle = \"#000\";\n ctx.fillRect(this.position.x, this.position.y, this.width, this.height);\n }", "title": "" }, { "docid": "66ba7cd562ed6584a645444ca1843497", "score": "0.6899759", "text": "function drawnFood(){\n context.fillStyle= \"#fc2717\";\n context.fillRect(food.x,food.y,box,box);\n}", "title": "" }, { "docid": "b21b142ad665a42e801ce8feef92cc44", "score": "0.6889289", "text": "function criarBg(){\n context.fillStyle = 'lightgreen';\n //posições x , y, altura, largura\n context.fillRect(0,0,16*box,16*box);\n}", "title": "" }, { "docid": "a6d7a54134b847974da5606a8ecbb56a", "score": "0.6869899", "text": "update() {\n const ctx = myGameArea.context;\n ctx.fillStyle = this.color;\n ctx.fillRect(this.x, this.y, this.width, this.height);\n }", "title": "" }, { "docid": "fa94b63957eded71819ece8e1f26fa51", "score": "0.68407804", "text": "function ej2(ctx){\n \n \n ctx.fillStyle= \"red\";\n let x=0;\n let y=0;\n ctx.fillRect(x,y,width,height);\n removeClass.classList.add(\"hidden\");\n\n}", "title": "" }, { "docid": "15abce2b89009b8b58c7a798a1be0dd0", "score": "0.6839727", "text": "constructor(name, x,y,w,h,fillC, strokeC, strokeC_over, targetObject, canvas){\r\n this.x = x;\r\n this.y = y;\r\n this.w = w;\r\n this.h = h;\r\n this.text = name;\r\n this.outline = strokeC;\r\n // taarget colour\r\n this.fill = fillC;\r\n this.over = strokeC_over;\r\n this.target = targetObject;\r\n this.element = canvas;\r\n this.element.addEventListener('click', this.mClick.bind(this));\r\n this.element.addEventListener('mousemove', this.mMove.bind(this));\r\n this.xMouse = 0;\r\n this.yMouse = 0;\r\n this.inBounds = false;\r\n}", "title": "" }, { "docid": "acf0b46f51ce241aa33fbaa746c7d161", "score": "0.6830569", "text": "function draw_host(ObjectCanvas,x,y) {\n var canvas = document.getElementById(ObjectCanvas);\n if (canvas.getContext) {\n var ctx = canvas.getContext(\"2d\");\n \n // Drawing a trapeze\n ctx.fillStyle = \"rgba(10,10,10,0.3)\";// gray\n ctx.beginPath();\n ctx.moveTo(0+x,55+y); \n ctx.lineTo(10+x,45+y);\n ctx.lineTo(70+x,45+y); \n ctx.lineTo(80+x,55+y); \n ctx.lineTo(0+x,55+y); \n ctx.stroke();\n ctx.fill();\n \n ctx.strokeRect(25+x,5+y,30,30);\n ctx.fillRect (25+x, 5+y, 30, 30);// fillRect(x,y,width,height)\n }\n}", "title": "" }, { "docid": "6c10091a7ddf8582cfec5f057267b8d7", "score": "0.68158543", "text": "draw(ctx) {\n\n }", "title": "" }, { "docid": "529d87749365243d0f1639f28ab0cfb6", "score": "0.6815722", "text": "constructor(w, h) {\n //Create a new canvas element\n this.canvas = document.createElement('canvas');\n //Set the status to not started\n this.status = \"notstarted\";\n //Set the initial FPS to 0\n this.fps = 0;\n //Set the last fps to 0\n this.lastFPS = 0;\n //Our components on the game area\n this.components = [];\n //The canvas width\n this.canvas.width = Math.max(\n document.body.scrollWidth,\n document.documentElement.scrollWidth,\n document.body.offsetWidth,\n document.documentElement.offsetWidth,\n document.documentElement.clientWidth,\n 500);\n //The canvas height\n this.canvas.height = 500;\n //The canvas background\n this.canvas.style.backgroundImage = \"url('bg.png')\";\n //The canvas context\n this.context = this.canvas.getContext('2d');\n }", "title": "" }, { "docid": "87be15d4b100004494bd0c9b0b541aff", "score": "0.6812594", "text": "function draw(){\n self.context.clearRect(0, 0, 500,500);\n self.context.fillRect(170,0, 1, 150);\n self.context.fillRect(self.leftPlayer.x, self.leftPlayer.y, 5, 30);\n self.context.fillRect(self.rightPlayer.x, self.rightPlayer.y, 5, 30);\n self.context.fillRect(self.personagem.x, self.personagem.y, 5, 5);\n }", "title": "" }, { "docid": "cac434df0e09efcbdde393ec67e618db", "score": "0.6811845", "text": "draw(ctx) {\n ctx.shadowBlur = 8;\n ctx.shadowColor = \"#09f\";\n ctx.fillStyle = \"#000\";\n ctx.fillRect(this.position.x, this.position.y, this.width, this.height);\n }", "title": "" }, { "docid": "9370847d0cb948ce3afe92477787a239", "score": "0.6802875", "text": "drawBoard(){\n\t\tthis.context.fillStyle = \"black\"\n\t\tthis.context.fillRect(0,0, this.width, this.height)\n\t\tthis.drawLine();\n\t}", "title": "" }, { "docid": "2067e145fb909dca336d72be4b88b225", "score": "0.6786893", "text": "function gamerect() {\n ctx.beginPath();\n ctx.rect(rect, canvas.height-rect_height, rect_width,rect_height);\n ctx.fillStyle= \"white\";\n ctx.fill();\n ctx.closePath();\n }", "title": "" }, { "docid": "300208a3cf9d00123b001c4dffb546a1", "score": "0.67866385", "text": "function draw() {\n\n l.draw().forEach(pos => {\n cntx.fillRect(pos.x, pos.y, 1, 1);\n });\n \n}", "title": "" }, { "docid": "51d3f240b3d7a5a66fc16ef21adb621c", "score": "0.67705286", "text": "render(context) {\r\n context.fillStyle = 'gray';\r\n context.fillRect(this.topCol.x, this.topCol.y, this.topCol.width, this.topCol.height);\r\n context.fillRect(this.botCol.x, this.botCol.y, this.botCol.width, this.botCol.height);\r\n }", "title": "" }, { "docid": "547009197dab68637dd7380f46085082", "score": "0.6762692", "text": "draw(){\n ctx.fillStyle=this.color;\n ctx.beginPath();\n ctx.arc(this.x,this.y,this.r,0,2*Math.PI);\n ctx.fill();\n }", "title": "" }, { "docid": "962192a83ff9eb6dacf9016a3f193820", "score": "0.67622715", "text": "fill() {\n this.ctx.fillRect(this.x + 1, this.y + 1, this.size - 1, this.size - 1);\n }", "title": "" }, { "docid": "a93c9b50b880dda09fe597e41290bd95", "score": "0.67616487", "text": "rect(x, y, width, height, color=\"red\"){\n this.ctx.beginPath();\n this.ctx.rect(x, y, width, height);\n this.ctx.fillStyle = color;\n this.ctx.fill();\n this.ctx.closePath();\n }", "title": "" }, { "docid": "7005f42f363f6821ab4469ea862a48b6", "score": "0.6753355", "text": "createBoard() {\n this.context.font = '36px Arial';\n this.context.clearRect(0, 0, 1000, 1000);\n this.context.beginPath();\n this.drawLines();\n }", "title": "" }, { "docid": "f8233d8c29353c68bb01a9bdab0431f6", "score": "0.6742457", "text": "function drawRect(context, gameObject) {\n context.fillStyle = gameObject.color;\n context.fillRect(gameObject.pos.x, \n gameObject.pos.y, \n gameObject.dim.x, \n gameObject.dim.y);\n}", "title": "" }, { "docid": "08fee5a411d275201d2584d365b9551f", "score": "0.6736109", "text": "draw(ctx) {\n ctx.shadowBlur = 2;\n ctx.shadowColor = \"#f00\";\n ctx.fillStyle = \"#000\";\n ctx.fillRect(this.position.x, this.position.y, this.size, this.size);\n // ctx.arc(this.position.x, this.position.y, this.size, this.size, this.size * Math.PI);\n // ctx.stroke();\n }", "title": "" }, { "docid": "19cb715f501bd5a38ed6b662be705ede", "score": "0.67325056", "text": "function init_canvas(width, height) {\n \n self.log('Attempting to init canvas '+width+' '+height);\n \n self.canvas = document.getElementById(self.ctx_id);\n self.canvas.width = width;\n self.canvas.height = height;\n self.ctx = document.getElementById(self.ctx_id).getContext('2d');\n \n self.ctx.fillStyle = 'rgb(0, 75, 225)'; \n self.ctx.fillRect(0,0, width, height);\n \n }", "title": "" }, { "docid": "b58ee4627f193048c19a200c3c3c6ede", "score": "0.67248297", "text": "paintPlayer(){\n\t\tctx.beginPath();\n\t\tctx.rect(this.x, this.y, this.height, this.width);\n\t\tctx.fillStyle = \"#990000\";\n\t\tctx.fill();\n\t\tctx.closePath();\n\t}", "title": "" }, { "docid": "9951ccee9cb11d30f3db520c1061a08b", "score": "0.67166764", "text": "drawPos(canvasContext) {\n canvasContext.fillStyle = 'white';\n canvasContext.fillRect(this.x - 5, this.y - 5, 10, 10);\n }", "title": "" }, { "docid": "007c7f30d3f34490ee62a9e96e8e30fb", "score": "0.67145985", "text": "function drawFood(){\n\n context.fillStyle = \"red\";\n context.fillRect(food.x, food.y, box, box);\n}", "title": "" }, { "docid": "49e88d9e58f265f1d856c41261190bdb", "score": "0.6709704", "text": "function drawObstacle(){\n ctx.fillStyle = '#97ff17';\n ctx.fillRect(120,60, 160,10);\n ctx.fillRect(120,240, 160,10);\n}", "title": "" }, { "docid": "3b66be0a734b7f8617f33e0bb35e0ac9", "score": "0.6696895", "text": "constructor( x, y, width, height) {\n this.w = width;\n this.h = height;\n this.x = x;\n this.y = y;\n this.color = \"#4286f4\"; //color blue\n this.context;\n }", "title": "" }, { "docid": "be5076d29ab6bd854cd00d7ef5816b6c", "score": "0.6694158", "text": "draw()\n {\n // Create the black background rectangle\n this._context.fillStyle = '#000';\n this._context.fillRect(0, 0, canvas.width, canvas.height);\n\n // Draw the ball\n this.drawRect(this.ball);\n\n // Draw the players\n this.drawRect(this.player1);\n this.drawRect(this.player2);\n\n // Draw the score\n this.drawScore();\n }", "title": "" }, { "docid": "5c8f9907e552172bb98b81482054ab84", "score": "0.66937816", "text": "function sueloTecho(){\r\n ctx.fillStyle=\"#4c97ed\"; //83dfe6\";\r\n ctx.fillRect(0,0,500,250);\r\n //ctx.fillStyle=\"#0c8524\";\r\n ctx.fillStyle=\"#bdbdbd\";\r\n ctx.fillRect(0,250,500,500);\r\n}", "title": "" }, { "docid": "d91ec37bf43efc2ad267d1a88fcbf23e", "score": "0.66890407", "text": "function drawRect(x,y,w,h,color){\n context.fillStyle=color;\n context.fillRect(x,y,w,h);\n}", "title": "" }, { "docid": "0143f7cbe375f3a7b71e0cc85ecda999", "score": "0.6680188", "text": "draw() {\n //body\n ctx.beginPath();\n ctx.rect(this.x, this.y, this.width, this.height);\n ctx.fillStyle = this.bodycolour;\n ctx.fill();\n\n //roof\n ctx.beginPath();\n ctx.rect(this.x + 10, this.y - 15, this.width - 20, this.height);\n ctx.fillStyle = this.bodycolour;\n ctx.fill();\n\n //windows\n ctx.beginPath();\n ctx.rect(this.x + 14, this.y - 10, 22, 20);\n ctx.fillStyle = this.windowcolour;\n ctx.fill();\n ctx.beginPath();\n ctx.rect(this.x + 44, this.y - 10, 22, 20);\n ctx.fillStyle = this.windowcolour;\n ctx.fill();\n\n //wheels\n ctx.beginPath();\n ctx.fillStyle = 'black';\n ctx.arc(this.x + 15, this.y + 30, 10, 0, 2 * Math.PI);\n ctx.fill();\n ctx.beginPath();\n ctx.fillStyle = 'black';\n ctx.arc(this.x + 65, this.y + 30, 10, 0, 2 * Math.PI);\n ctx.fill();\n\n //number\n ctx.font = \"bold 30px Arial\";\n ctx.fillStyle = \"white\";\n ctx.textAlign = \"center\";\n ctx.fillText(this.number, this.x + this.width / 2, this.y + this.height / 2 + 10);\n ctx.fillStyle = \"black\";\n ctx.strokeText(this.number, this.x + this.width / 2, this.y + this.height / 2 + 10);\n }", "title": "" }, { "docid": "d27e7cb8faf5bd43a65643ea1d94e017", "score": "0.6670298", "text": "draw(canvas,canvasWrapper){\n\n }", "title": "" }, { "docid": "d6460a49fc0a5fd09f648f152fb1fc4d", "score": "0.66682184", "text": "function draw() {\n background(0);\n\n//OBJECT PARAMETERS////////////////////////////////////////////////////////////////////\n let config = {\n x: 250,\n y: 250,\n width: 200,\n height: 200,\n fillColor: {\n r: 255,\n g: 255,\n b: 0,\n },\n mode: CENTER\n }\n\n drawFancyRect(config);\n\n\n//CONSTANTS////////////////////////////////////////////////////////////////////\n// circleAlpha = map(mouseX, 0, width, 10, 100);\n// circleSizeIncrease = map(mouseY, 0, height, 10, 100);\n//\n// for (let i = 0; i < NUM_CIRCLES; i++) {\n// push();\n// fill(255, circleAlpha);\n// ellipse(width/2, height/2, i * circleSizeIncrease);\n// pop();\n// }\n} // draw end", "title": "" }, { "docid": "76459e996a017e7b34a02b5e32677326", "score": "0.6666117", "text": "function init(){\n\tc.fillStyle = \"#123\";\n\tc.fillRect(0,0, canvas.width, canvas.height);\n\tclear();\n}", "title": "" }, { "docid": "cae1efaf42eef41d085701bef6b220c1", "score": "0.66648704", "text": "constructor() {\r\n super();\r\n this.canvas = []\r\n }", "title": "" }, { "docid": "7e418348f1b016a352e906e8e390c86f", "score": "0.66615164", "text": "function speed(x,y){\n ctx.beginPath\n ctx.fillRect(x,y,25,25)\n ctx.fill()\n \n}", "title": "" }, { "docid": "26d6e33ff751bdb1c1816f561077113e", "score": "0.66309613", "text": "function DrawEngine(ctx) {\r\n this.ctx = ctx;\r\n}", "title": "" }, { "docid": "2982595f170578e34183e9a9bbf3bf25", "score": "0.66288584", "text": "function MZCanvas(){}", "title": "" }, { "docid": "11c8487f0c3285541d940572df8f6343", "score": "0.6626151", "text": "draw() \n\t{\n\t\t// Background\n\t\tthis._context.fillStyle = '#000';\n\t\tthis._context.fillRect(0, 0, this._canvas.width, this._canvas.height);\n\t\t// Ball\n\t\tthis.drawRect(this.ball);\n\t\t// Players\n\t\tthis.players.forEach(player => this.drawRect(player));\n\t}", "title": "" }, { "docid": "2d940580a15023cdc4ac27470c72db41", "score": "0.6625454", "text": "function dibujo3(x,y,z,w) {\n ctx.fillStyle='blue';\n ctx.fillRect(x,y,z,w);\n}", "title": "" }, { "docid": "50964f4fbca0f23e28bc3f928db4d098", "score": "0.66243774", "text": "function component(width, height, color, x, y){\n this.width = width;\n this.height = height;\n this.x = x;\n this.y = y;\n\n //this.update = function(){\n ctx = myGameArea.context;\n ctx.filStyle = color;\n ctx.fillRect(this.x, this.y, this.width, this.height);\n //}\n \n}", "title": "" }, { "docid": "f95a667d7093fb5a987cbf2f381977a5", "score": "0.6618449", "text": "draw(){\n ctx.beginPath();\n ctx.ellipse(this.x, this.y, this.rw, this.rh, 0, 0, 2*Math.PI);\n ctx.fillStyle = this.fill;\n ctx.fill();\n }", "title": "" }, { "docid": "f73517f0f24de439b346ea0ef87d066c", "score": "0.6615982", "text": "function drawBox() {\n ctx.fillStyle = 'green';\n ctx.fillRect(295, 195, 10, 10);\n}", "title": "" }, { "docid": "6128cba613eda39fa45c25aca577e3e2", "score": "0.66121703", "text": "function draw_rect(ObjectCanvas, w, h, cs, str) {\n var canvas = document.getElementById(ObjectCanvas);\n canvas.width = w;\n canvas.height = h;\n \n var black = \"#000000\";\n var yellow = \"#FFCC11\";\n var m;\n \n if (cs != \"rgb(139,139,131)\"){\n\n var black = cs;\n var yellow = cs;\n \n }\n \n if (canvas.getContext) {\n var ctx = canvas.getContext(\"2d\");\n \n ctx.fillStyle = \"rgb(105,105,105)\";\n ctx.strokeStyle = cs;\n ctx.fillRect(4,5,42,35);\n \n ctx.globalCompositeOperation = 'source-over';\n ctx.fillStyle = black;\n ctx.fillRect(8,9,34,20);\n \n ctx.beginPath();\n ctx.lineWidth=3;\n ctx.strokeStyle = black;\n ctx.moveTo(12,30);\n ctx.lineTo(38,30);\n ctx.stroke();\n \n ctx.beginPath();\n ctx.lineWidth=3;\n ctx.strokeStyle = black;\n ctx.moveTo(16,32);\n ctx.lineTo(34,32);\n ctx.stroke();\n \n \n var c=-7;//x\n var d=-18;//y\n \n for (var n=0;n<7;n++){\n m=n*4;\n ctx.beginPath();\n ctx.lineWidth=2;\n ctx.strokeStyle = yellow;\n ctx.moveTo(20+c+m,28+d);\n ctx.lineTo(20+c+m,32+d);\n ctx.stroke();\n }\n \n ctx.fillStyle = cs;\n ctx.strokeStyle = cs;\n \n //Text\n ctx.textAlign = \"center\";\n textBaseline = \"bottom\";\n ctx.fillText(str, (w/2)-2, h-7);\n }\n}", "title": "" }, { "docid": "83c906f2974fec5029d7fa6c6c249da0", "score": "0.6610076", "text": "draw(ctx)\r\n\t{\r\n\t\t// Rita skeppet som en kvadrat och färglägg den\r\n\t\tctx.beginPath(); \t\t\t\t // Börjar rita Skeppet\r\n\t\tctx.rect(this.x, this.y, 35, 35);\t\t // Ritar ut en rektangel på skeppets x och y position med bredd och höjd 35\r\n\t\tctx.closePath();\t\t\t \t // Slutar rita\r\n\t\tvar color = document.getElementById(\"color\").value; // Färgen väljs av spelaren med hjälp av våran color picker\r\n\t\tctx.fillStyle = color;\t\t\t\t // Säger till programmet att den ska fylla med den färg spelaren valt\r\n\t\tctx.fill();\t\t\t\t\t // Fyller rektangeln med färgen spelaren valt\r\n\r\n\t\t// Visa alla laserskott i canvas\r\n\t\tfor (var i = 0; i < this.laserPool.length; i++) {\r\n\t\t\tthis.laserPool[i].draw(ctx);\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "f753bba1c0da079e1835bf1711ed25ee", "score": "0.6604381", "text": "function paintCanvas() {\n ctx.fillStyle = \"#000\";\n ctx.fillRect(0, 0, W, H);\n}", "title": "" }, { "docid": "d3c68e45e12af8919cce3addef6f8801", "score": "0.66017044", "text": "function init() {\n canvas = document.getElementById('canvas');\n canvas.style.background = \"black\";\n ctx = canvas.getContext('2d');\n}", "title": "" }, { "docid": "89eaa347e9f2e67a62ac9e49015f3b7c", "score": "0.65977204", "text": "draw(context) {\n context.fillStyle = 'white';\n context.beginPath();\n context.arc(this.x, this.y, this.size, 0, 2 * Math.PI);\n context.fill();\n context.closePath();\n }", "title": "" }, { "docid": "bb89341e08fd0ffe257d5c6299392d15", "score": "0.6591123", "text": "function drawFood() {\n \n ctx.fillStyle = \"black\";\n ctx.fillRect(food.x,food.y,box,box);\n \n }", "title": "" }, { "docid": "1e4cf002ad1aa6bba87f0c97daaf9cb4", "score": "0.65767014", "text": "function fillCanvas () {\n context.fillRect(0, 0, canvas.width, canvas.height);\n}", "title": "" }, { "docid": "99a572c6df0166d31ab7ea6986886bfb", "score": "0.65705365", "text": "initCanvas() {\n let bounds = this.player.current.getBoundingClientRect();\n this.width = bounds.width;\n this.height = bounds.height;\n this.canvas.current.setAttribute('width', this.width);\n this.canvas.current.setAttribute('height', this.height);\n this.ctx = this.canvas.current.getContext('2d');\n }", "title": "" }, { "docid": "6242f3a624b2347bc181a3f9da89bf45", "score": "0.6557623", "text": "open() {\n this.ctx.beginPath();\n }", "title": "" }, { "docid": "6cca7fd47e183b203916dd4acb0d46a9", "score": "0.65536845", "text": "drawEnlarge(ctx){ ////\n ctx.beginPath();//ouverture chemin ///\n ctx.fillStyle=\"#f0f71b\";//choix couleur de remplissage ///////////////////////////////\n ctx.moveTo(this.posx+this.sizex/4,this.posy+this.sizey/4); ////déplacement chemin ///\n ctx.lineTo(this.posx+(this.sizex*3)/4,this.posy+this.sizey/4);///// connexion du chemin ///\n ctx.lineTo(this.posx+(this.sizex*3)/4,this.posy);//// connexion du chemin ///\n ctx.lineTo(this.posx+this.sizex,this.posy+this.sizey/2);///// connexion du chemin ///\n ctx.lineTo(this.posx+(this.sizex*3)/4,this.posy+this.sizey);// connexion du chemin ///\n ctx.lineTo(this.posx+(this.sizex*3)/4,this.posy+(this.sizey*3)/4);// connexion du chemin ///\n ctx.lineTo(this.posx+this.sizex/4,this.posy+(this.sizey*3)/4);// connexion du chemin ///\n ctx.lineTo(this.posx+this.sizex/4,this.posy+this.sizey);// connexion du chemin ///\n ctx.lineTo(this.posx,this.posy+this.sizey/2);// connexion du chemin ///\n ctx.lineTo(this.posx+this.sizex/4,this.posy);// connexion du chemin ///\n ctx.fill(); ///\n ctx.fillStyle=\"#FFFFFF\"; ///\n ctx.closePath(); ///\n }", "title": "" }, { "docid": "b65961b7ee45ebcdb6c34731d0084592", "score": "0.6552531", "text": "function init(_event) {\r\n console.log(\"CanvasWindow\");\r\n let canvas;\r\n canvas = document.getElementsByTagName(\"canvas\")[0];\r\n console.log(canvas);\r\n crc2 = canvas.getContext(\"2d\");\r\n console.log(crc2);\r\n let bild;\r\n bild = document.getElementsByTagName(\"img\")[0];\r\n //sky\r\n crc2.fillStyle = \"#80b3ff\"; //blue\r\n crc2.fillRect(0, -200, canvas.width, canvas.height);\r\n //field\r\n crc2.fillStyle = \"#009900\"; //green\r\n crc2.fillRect(0, 200, canvas.width, canvas.height);\r\n //function calls\r\n //mountainBackground\r\n drawMountain(30, 120, \"#00ff00\", \"#737373\");\r\n drawMountain(250, 110, \"#00ff00\", \"#737373\");\r\n drawMountain(520, 90, \"#00ff00\", \"#737373\");\r\n //mountainForeground\r\n drawMountain(70, 135, \"#00ff00\", \"#8c8c8c\");\r\n drawMountain(180, 120, \"#00ff00\", \"#8c8c8c\");\r\n drawMountain(320, 130, \"#00ff00\", \"#8c8c8c\");\r\n drawMountain(470, 120, \"#00ff00\", \"#8c8c8c\");\r\n drawMountain(600, 120, \"#00ff00\", \"#8c8c8c\");\r\n drawMountain(730, 120, \"#00ff00\", \"#8c8c8c\");\r\n //clouds\r\n drawCloud(90, 0, 15, \"#ffffff\");\r\n drawCloud(320, -70, 20, \"#ffffff\");\r\n drawCloud(490, -20, 14, \"#ffffff\");\r\n drawCloud(590, 10, 17, \"#ffffff\");\r\n //sun\r\n drawSun(690, 10, 50, \"#ff8533\", \"#ffff33\");\r\n //little flower with four leafes\r\n drawFlowerLittle(50, 360, \"#e6b800\", \"#ffffff\");\r\n drawFlowerLittle(400, 270, \"#e6b800\", \"#ffffff\");\r\n //big flower with six leafes\r\n drawFlowerBig(270, 260, \"#ffff00\");\r\n drawFlowerBig(500, 270, \"#ffff00\");\r\n drawFlowerBig(130, 350, \"#00ace6\");\r\n drawFlowerBig(390, 310, \"#00ace6\");\r\n drawFlowerBig(610, 440, \"#00ace6\");\r\n //tree\r\n drawTree(680, 190);\r\n drawTree(610, 197);\r\n drawTree(400, 205);\r\n //loop which gives 100 flowers a random position\r\n for (var z = 0; z < 100; z++) {\r\n var xRandom = (Math.random() * (620 - 5)) + 60;\r\n var yRandom = (Math.random() * (500 - 255)) + 230;\r\n var colorRandom = colorList[Math.floor(Math.random() * colorList.length)];\r\n var flowerRandom = Math.floor((Math.random() * 2)) + 1;\r\n if (flowerRandom == 1) {\r\n drawFlowerLittle(xRandom, yRandom, \"#ffff66\", colorRandom);\r\n }\r\n else {\r\n drawFlowerBig(xRandom, yRandom, colorRandom);\r\n }\r\n }\r\n //bee house\r\n drawBeeHouse(640, 300);\r\n //-------------------- exercise 5 --------------------------------------------\r\n //save canvas data\r\n saveBackgroundData = crc2.getImageData(0, 0, canvas.width, canvas.height);\r\n //start position add to array\r\n for (var i = 0; i < count; i++) {\r\n x[i] = 635;\r\n y[i] = 310;\r\n }\r\n window.setTimeout(animate, 50);\r\n canvas.addEventListener(\"click\", addnewbee); //click to add new bee\r\n canvas.addEventListener(\"touch\", addnewbee); //touch to add new bee\r\n }", "title": "" }, { "docid": "0b27dda6f55892139badf1db71795d5f", "score": "0.655241", "text": "function body(ctx, x, y, w, h) {\n\n ctx.beginPath();\n ctx.rect(x, y, w, h);\n ctx.stroke();\n ctx.closePath();\n\n }", "title": "" }, { "docid": "26aa189db2cc9de9f8c9f17417ddec4f", "score": "0.6546377", "text": "draw(){\n ctx.beginPath();\n ctx.moveTo(this.x1,this.y1);\n ctx.lineTo(this.x2,this.y2);\n ctx.fillStyle = this.fillColour;\n ctx.lineWidth = this.lw;\n ctx.stroke();\n }", "title": "" }, { "docid": "ae86f2348825303d71d0f1bfb21e745d", "score": "0.65451235", "text": "function DrawClass(canvasElem, settings) {\n if (canvasElem.tagName.toUpperCase() !== 'CANVAS') {\n console.log('错误的canvas元素');\n return;\n }\n if (typeof settings === 'undefined') {\n settings = {};\n }\n this.canvasElem = canvasElem;\n this.ctx = canvasElem.getContext('2d');\n this.width = canvasElem.width;\n this.height = canvasElem.height;\n this.color = 'rgba(255,0,0,0.3)';\n this.highlightColor = 'rgba(0,0,255,0.3)'\n this.ctx.fillStyle = this.color;\n // this.ctx.fillStyle = 'rgba(255,0,0,0.3)';\n}", "title": "" }, { "docid": "c77e73b964a4de122ba5a49bc4b9f312", "score": "0.654242", "text": "function afficheRectangle(){\n\tvar dessin = document.getElementById('dessin');\n\tvar canvasDessin = dessin.getContext('2d');\n\tcanvasDessin.fillStyle = 'RGBa(255,255,255,1)';\n\tvar ecartX=instanceCommande.xDepart-instanceCommande.x;\n\tvar ecartY=instanceCommande.yDepart-instanceCommande.y;\n\tcanvasDessin.fillRect(instanceCommande.x,instanceCommande.y,ecartX,ecartY);\n}", "title": "" }, { "docid": "65317dfb26c2babcc7e8220ca63070b6", "score": "0.6532982", "text": "drawAll(){\n /**\n * primero que nada canva en blanco\n */\n this.context.fillStyle = \"white\";\n this.context.fillRect(0,0,canva.width,canva.height);\n /**\n * dibuja el tablero y la ficha arrastrable\n */\n for (let i = 0; i < this.objects.length; i++) {\n if(this.objects[i] != null){\n this.objects[i].draw();\n }\n }\n /**\n * dibuja los grupos de fichas\n */\n if(this.objects[1] != null){\n let token = new Token(50,50,this.tokens[0].getFill(),this.context,this.tokens[0].getRadius(),this.tokens[0].getImgUrl());\n this.drawTokens(token);\n token = new Token(50,150,this.tokens[1].getFill(),this.context,this.tokens[1].getRadius(),this.tokens[1].getImgUrl());\n this.drawTokens(token);\n }\n }", "title": "" }, { "docid": "511165bd636f9778a6f8629f0449deec", "score": "0.65269387", "text": "draw() {\r\n ctx.beginPath();\r\n ctx.arc(this.x, this.y, this.size, 0, Math.PI*2, false);\r\n ctx.fillStyle = '#BD4B4B';\r\n ctx.fill(); \r\n }", "title": "" }, { "docid": "3d8e15c3ec83f2b198da6e056cf7415f", "score": "0.6522441", "text": "draw() {\n\n ctx.beginPath();\n ctx.rect(this.x, this.y, this.width * tileSize, tileSize);\n ctx.fillStyle = this.color;\n ctx.fill();\n ctx.strokeStyle = \"black\";\n ctx.lineWidth = 3;\n ctx.stroke();\n ctx.closePath();\n\n }", "title": "" }, { "docid": "7fe8f58dd5e7b1f5120e0abc6d1311f3", "score": "0.6521681", "text": "function rect(r) {\n ctx.fillStyle=r.fill;\n ctx.fillRect(r.x,r.y,r.width,r.height);\n }", "title": "" }, { "docid": "9901421ab8417442ec85bc6204d3eb54", "score": "0.6520576", "text": "function kaioBackClass(obj, img, x, y, width, height, fill){\r\n\t(typeof width !== 'undefined') ? width : 1;\r\n\t(typeof height !== 'undefined') ? height : 1;\r\n\t(typeof x !== 'undefined') ? x : 0;\r\n\t(typeof y !== 'undefined') ? y : 0;\r\n\t(typeof fill !== 'undefined') ? fill : \"other\";\r\n\tthis.img = img;\r\n\tthis.sx = obj.sx;\r\n\tthis.sy = obj.sy;\r\n\tthis.swidth = obj.swidth;\r\n\tthis.sheight = obj.sheight;\r\n\tthis.width = width * kaiomega.spriteWidth;\r\n\tthis.height = height * kaiomega.spriteHeight;\r\n\tthis.x = x * kaiomega.spriteWidth;\r\n\tthis.y = y * kaiomega.spriteHeight;\r\n\tthis.type = fill;\r\n\tthis.draw = function(){\r\n\t\tctx.drawImage(this.img, this.sx, this.sy, this.swidth, this.sheight, this.x, this.y, this.width, this.height);\r\n\t};\r\n}", "title": "" }, { "docid": "3016fe15c32ac3528820d0f1085ac072", "score": "0.6513856", "text": "setCanvas() {\n this.canvas = document.createElement('canvas')\n this.ctx = this.canvas.getContext('2d')\n }", "title": "" }, { "docid": "7c111cb9250ec3414f105f9e5575f060", "score": "0.6513726", "text": "draw() {\n this.piece.draw(); // ctx 위에 현재 블록을 그림\n this.drawBoard(); // ctx 위에 현재 블록 전까지 쌓인 블록을 그림\n }", "title": "" }, { "docid": "578d8bc4102c9066769b1f6c9a2a1754", "score": "0.65061086", "text": "function drawRect(x, y, w, h, color){\r\n ctx.fillStyle = color;\r\n ctx.fillRect(x, y, w, h);\r\n}", "title": "" }, { "docid": "d97814e9ea04ea17e2bd905d1d9ddaf8", "score": "0.6505026", "text": "function Door (ctx) {\n this.ctx = ctx;\n this.x = this.ctx.canvas.width - 5;\n this.y = this.ctx.canvas.height/2;\n \n this.w = 30;\n this.h = 150;\n\n \n\n}", "title": "" }, { "docid": "955601b7e05381123e59bf85557aba14", "score": "0.6504305", "text": "function CanvasDrawing()\n{\n}", "title": "" }, { "docid": "73b2181a205b4c26aeb8264d8b422f62", "score": "0.65021735", "text": "draw() {\n ctx.beginPath();\n ctx.fillStyle = \"white\";\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);\n ctx.fill();\n }", "title": "" }, { "docid": "1f9b215930e2beaf67eda63ada09d136", "score": "0.65008754", "text": "function setupCanvas(){\r\n\t\t\tcanvasElement = document.querySelector('canvas');\r\n\t\t\tdrawCtx = canvasElement.getContext(\"2d\");\r\n \r\n \r\n //draw car in between the background and the stuff being drawn in front\r\n drawCtx.drawImage(carBody,canvasWidth/2,canvasHeight/2,1,1);\r\n \r\n\t\t}", "title": "" }, { "docid": "c01bb651ebd84ef679fc024c5148634c", "score": "0.64943475", "text": "constructor(canvas) {\n this.canvas = canvas;\n this.context = canvas.getContext(\"2d\");\n\n this.rect = this.canvas.getBoundingClientRect();\n\n this.canvas.width = this.rect.width;\n this.canvas.height = this.rect.height;\n }", "title": "" }, { "docid": "5905e4689d7924f620d02a475ac26984", "score": "0.6493344", "text": "update() {\n CTX.fillStyle = this.content;\n CTX.fillRect(this.x,this.y, this.width, this.height);\n }", "title": "" }, { "docid": "b6f4a3a093fbd5407552e14536c63ae5", "score": "0.6486041", "text": "draw() {\n this.canvas.draw();\n }", "title": "" }, { "docid": "3db0ee6aad618a57bb09b5b55761af59", "score": "0.64857715", "text": "function dibujaTecla(){\r\n ctx.fillStyle = colorTecla;\r\n ctx.strokeStyle = colorMargen;\r\n ctx.fillRect(this.x, this.y, this.ancho, this.alto);\r\n ctx.strokeRect(this.x, this.y, this.ancho, this.alto);\r\n \r\n ctx.fillStyle = \"white\";\r\n ctx.font = \"bold 20px courier\";\r\n ctx.fillText(this.letra, this.x+this.ancho/2-5, this.y+this.alto/2+5);\r\n }", "title": "" }, { "docid": "b76b342d63f3fdb22e33e5e7a0bc667c", "score": "0.64778763", "text": "function canvasElements() {\n canvas = document.getElementById(\"Canvas\")\n canvas.width = canvas.height = 1000\n canvaswidth = canvas.width\n canvasheight = canvas.height\n ctrl = canvas.getContext(\"2d\")\n}", "title": "" }, { "docid": "da5e453ecd0089d24ba02637ef37611d", "score": "0.64764106", "text": "drawBrick(ctx) {\n ctx.beginPath();\n ctx.rect(this.x, this.y, this.width, this.height);\n ctx.fillStyle = this.color;\n ctx.fill();\n ctx.closePath();\n }", "title": "" }, { "docid": "ac34e83c5bdf5a324545abba99417840", "score": "0.64755064", "text": "function draw() {\r\n context.clearRect(0, 0, canvas.width, canvas.height); \r\n context.strokeStyle = \"#ff0000\"; \r\n context.beginPath();\r\n context.rect(x - 5, y - 5, 10, 10);\r\n context.fill();\r\n}", "title": "" }, { "docid": "1c19c845238999431f7ef64c15b6d3ce", "score": "0.6465433", "text": "function VCanvas() {\n}", "title": "" }, { "docid": "62a739115efbc315f76943b3e9135d43", "score": "0.646482", "text": "function drawLane(x,y){\n ctx.fillStyle = \"yellow\";\n ctx.fillRect(x,y,6,40); \n\n }", "title": "" }, { "docid": "4cc097df275e5e93dbb10287a0d9bde8", "score": "0.6461718", "text": "function component(width, height, color, x, y) {\n this.width = width;\n this.height = height;\n this.x = x;\n this.y = y; \n ctx = myGameArea.context;\n ctx.fillStyle = color;\n ctx.fillRect(this.x, this.y, this.width, this.height);\n}", "title": "" }, { "docid": "f514ee2c0c8c1927ae922f0a40ed7644", "score": "0.6461331", "text": "fillCanvas(canvas) {\n this.canvas.push(canvas);\n }", "title": "" }, { "docid": "47a7df54ac6662eeffc659862f7a3b4b", "score": "0.64604473", "text": "function criarBG() {\n context.fillStyle = \"#333652\"; \n context.fillRect(0, 0, 16 * box, 16 * box);\n}", "title": "" }, { "docid": "5de0885fbc936ec7f436daedcdebbd2f", "score": "0.6459371", "text": "function draw() {\n\tvar canvas = document.getElementById('canvas');\n// Make sure we don't execute when canvas isn't supported\n\tif (canvas.getContext) {\n// Use getContext to use the canvas for drawing\n\t var ctx = canvas.getContext('2d');\n// Now, draw shapes \n\t ctx.clearRect(0,0,350,200);\n\t ctx.fillStyle = '#66bdff';\n\t ctx.fillRect(0,0,350,200);\n\n\t ctx.clearRect(25, 25, 100, 100);\n\t ctx.strokeRect(25, 25, 100, 100);\n\t ctx.clearRect(45, 45, 60, 60);\n\t ctx.strokeRect(50, 50, 50, 50);\n\t ctx.fillStyle = '#cc8500';\n\t ctx.fillRect(50,50,50,50);\n } else {\n\t alert('Your browser does not support the HTML5 canvas tag.');\n }\n}", "title": "" } ]
a615982fda2dcb287fd853dbfe2a27ca
Fonction permettant de verrouiller un ou plusieurs onglet el
[ { "docid": "51fe65e7f6b8a949f3e8086782403edc", "score": "0.0", "text": "function lock(el) {\n\tel.on('click.locked', function() {\n\t\treturn false;\n\t})\n}", "title": "" } ]
[ { "docid": "722120d1dc88816bfbfc6c2ad7ab963f", "score": "0.64190996", "text": "estavacio()\r\n{\r\n //regresa verdadero si la cola esta vacia\r\n return this.items.length == 0;\r\n}", "title": "" }, { "docid": "521924b4f0a2b079839797c8adf48359", "score": "0.6347219", "text": "niveauSuivant()\r\n\t{\r\n\t\tthis._termine = false;\r\n\t\tthis._gagne = false;\r\n\t\tthis._niveau++;\r\n\t\tthis.demarrerNiveau();\r\n\t}", "title": "" }, { "docid": "e35233cec3eec2eb92dd099224ad7146", "score": "0.62302595", "text": "function checkTirEnCours() {\n tirEnCours = false;\n equipes.forEach((e) => {\n e.joueurs.forEach((j) => {\n if (j.vitesse > 0) tirEnCours = true;\n });\n });\n }", "title": "" }, { "docid": "40cf1d75d59dc5a62519ffc7547345d2", "score": "0.6167008", "text": "function marcarComoReprovado(aluno) {\n aluno.reprovado = false;\n if(aluno.nota < 5){\n aluno.reprovado = true;\n }\n}", "title": "" }, { "docid": "7afc8458753a7cfba7e768647d594ba7", "score": "0.6039169", "text": "function verifReglement() {\n\n\tvar choix = document.getElementById('frmDifference').hdnChoix.value;\n\tvar du = parseFloat (document.getElementById('frmDifference').txtDu.value);\n\tvar encaisse = parseFloat (document.getElementById('frmDifference').txtEncaisse.value);\n\n\tif ( du > 0 ) {\n\n\t\tif ( choix == 'ESP' ) {\n\n\t\t\tif ( encaisse != 0 && encaisse >= du ) {\n\n\t\t\t\treturn true;\n\n\t\t\t} else {\n\n\t\t\t\tdocument.getElementById('frmDifference').txtEncaisse.select();\n\t\t\t\tdocument.getElementById('frmDifference').txtEncaisse.focus();\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t} else if ( choix == 'DIF' ) {\n\n\t\t\tif ( document.getElementById('frmDifference').txtDatePaiement.value ) {\n\n\t\t\t\treturn true;\n\n\t\t\t} else {\n\n\t\t\t\tdocument.getElementById('frmDifference').txtDatePaiement.select();\n\t\t\t\tdocument.getElementById('frmDifference').txtDatePaiement.focus();\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\treturn true;\n\n\t\t}\n\n\t} else {\n\n\t\treturn false;\n\n\t}\n}", "title": "" }, { "docid": "f4a20cf496d96d292bad81b1588028a5", "score": "0.60277504", "text": "function zurueck(){\n\t\tif(!pfeilAktivitaet) {\n\t\t\tneuLaden();\n\t\t}\n\t\telse {\n\t\t\ttoggleDetailView_textauszug();\n\t\t\tpfeilAktivitaet = false;\n\t\t}\n\t}//ENDE zurueck()", "title": "" }, { "docid": "2827fc6a24048c0b7e0c1d536b469fd2", "score": "0.6017815", "text": "function verifierMot()\n{\n var lemot = \"\";\n for(let i=0; i<choisi.length; i++)\n {\n lemot += choisi[i].textContent;\n }\n if(lemot == mots[niveau])\n {\n nextlevel();\n }\n else{\n initialiseNiveau(niveau);\n }\n}", "title": "" }, { "docid": "289cdf211dacce1b8fe06d21432af8a4", "score": "0.6000525", "text": "function gereTourCombat() {\r\n // SI tourJoueur1 = 0 au départ TOUR JOUEUR 1\r\n if(tourJoueur1 < 1) { // tourJoueur1 vaut 0 au début\r\n joueur2.passeSonTourAu(joueur1); // Change le texte de MON TOUR dans l'ATH des joueurs en OUI ou NON\r\n AttaqueOuDefense(); // Demande au joueur 2 de choisir si il attaque ou se défend\r\n tourJoueur1++; // mais il vaudra 1 pour la fonction et pour passer de tour\r\n } else {\r\n joueur1.passeSonTourAu(joueur2);\r\n AttaqueOuDefense();\r\n tourJoueur1--;\r\n }\r\n}", "title": "" }, { "docid": "737a6da84dc533fce9eedfd44ee7df0b", "score": "0.5992951", "text": "function plateauGagnant () {\n for (let i = 0; i < 4; i++) {\n for (let j = 0; j < 4; j++) {\n if (plateau[i][j] !== plateauRef[i][j]) {\n return false;\n }\n }\n }\n $('#info').append(\"<div class='alert alert-info'>BRAVO VOUS AVEZ GAGNÉ !</div>\");\n }", "title": "" }, { "docid": "5c822130c12a11c9f0c964d0c8586c99", "score": "0.5965392", "text": "function lignes_vente_vierge()\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tvierge=true;\n\t\t\t\t\t\t\t\t\t\t\t$('.ligne_vente').each(function(){\n\t\t\t\t\t\t\t\t\t\t\t\t\t$('input',this).each(function(){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($(this).val()!='')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvierge=false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(vierge==true)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$('select',this).each(function(){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($(this).val()!='')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvierge=false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\treturn vierge;\n\t\t\t\t\t\t\t\t\t}", "title": "" }, { "docid": "208f2fd09b5688a87c848a2a33407f8a", "score": "0.5901197", "text": "function tourDeMot(){\n\tif(qual1Accept){\n\t\ttourDeLettres(document.getElementById('qual1'),0);\n\t}\n\tif(qual2Accept){\n\t\ttourDeLettres(document.getElementById('qual2'),1);\n\t}\n\tif(qual3Accept){\n\t\ttourDeLettres(document.getElementById('qual3'),2);\n\t}\n\tif(qual4Accept){\n\t\ttourDeLettres(document.getElementById('qual4'),3);\n\t}\n\tif(qual5Accept){\n\t\ttourDeLettres(document.getElementById('qual5'),4);\n\t}\n}", "title": "" }, { "docid": "388bbdd66689748d8a528357ae321821", "score": "0.58681", "text": "function esquiver() \n{\n //Cas spéciaux : Mort, ou pas d'ennemi\n if (presenceEnnemi === 666){\n dialogBox(\"Eh me saoule pas là relance le jeu ou casse toi connard J'AI AUTRE CHOSE A FOUTRE LA.\")\n \n }else if(presenceEnnemi ===0){ \n dialogBox(\"Tu donnes l'impression de danser sur les chemins, c'est mignon mais ça va pas t'aider.\")\n }\n \n //PROCEDURE HABITUELLE\n else if (presenceEnnemi = 1, tourJoueur(tour)=== true){\n var Min= Number(personnage.esquive - 5)\n var Max= Number(personnage.esquive + 15)\n var Miin = Number(1)\n var Maax = Number(100)\n function getRndInterger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;}\n\njetEsquive = getRndInterger(Min, Max);\nvaleurEsquive = getRndInterger(Miin, Maax);\nconsole.log(\"jetEsquive du joueur : \"+jetEsquive+\" et la valeur minimale à avoir était \"+valeurEsquive);\n //Esquive réussie\n if (jetEsquive >= valeurEsquive){\n actionPerso = 2;\n } \n //Echec de l'esquive\n else if (jetEsquive < valeurEsquive){\n actionPerso = 3;\n }\nreactionEnnemi();\nresetSpecial();\n }\n \n}", "title": "" }, { "docid": "f4cdd0b46418900a3a9cc91405132b0f", "score": "0.5831984", "text": "function Deplacement_joueurpossedeterritoirenonisole(Id,carte) {\r\n\tvar possedeterritoirenonisole = false\r\n carte.forEach((territoire)=>{\r\n if(territoire.proprietaire==Id){\r\n var status = Deplacement_voisinLimitrophe(territoire)\r\n if (status){\r\n possedeterritoirenonisole = true\r\n }\r\n }\r\n })\r\n\treturn(possedeterritoirenonisole)\r\n}", "title": "" }, { "docid": "816863036776c5d424a9effcebdfefb1", "score": "0.5820304", "text": "function mostraNotas(){}", "title": "" }, { "docid": "e78fb043c72e50fa879061a4356cfde0", "score": "0.58145547", "text": "changerJoueur() {\n this.indexJoueurActuel = !this.indexJoueurActuel;\n }", "title": "" }, { "docid": "de3aeab78a06605528289862c5ff80a3", "score": "0.5807732", "text": "function addTorpedoAndCheckLose() {\n numTorpedoes++;\n return numTorpedoes >= maxTorpedoes;\n}", "title": "" }, { "docid": "420e6ab58adf3857f936bb6de4ee78b9", "score": "0.577962", "text": "function reglaRebajaPrecios(){\n if(producto.super_avance.sellIn = 0)\n {\n precio_SuperAvance - 2;\n\n if(producto.fc_superduper.sellIn = 0){\n precio_FullSuperDuper - 2;\n\n if(producto.f_cobertura.sellIn = 0){\n precio_FullCobertura - 2;\n }\n }\n }else{\n }\n}", "title": "" }, { "docid": "eaf89db30dc79e82072ee03da2ba442a", "score": "0.5767484", "text": "function siCarritoVacio () {\n if ($(\"#productosCarrito\").children().length== 0){\n mostrarMensaje(\"El carrito está vacío\");\n desactivarBotones(\"btn-finalizar\");\n total=0;\n mostrarTotal();\n }\n}", "title": "" }, { "docid": "32cfa0c8bd84c8e81f70f91a6903dcae", "score": "0.57636553", "text": "function suntValide () {\n var nr = 0;\n angular.element('.deVerificat').each(function(){\n // console.log(angular.element(this));\n if(!angular.element(this).is(\":disabled\"))\n nr++;\n });\n return nr == angular.element('.deVerificat').length ;\n }", "title": "" }, { "docid": "75d21a48c908803f44d31083b447f74f", "score": "0.5729714", "text": "function falso(v) {\n\n boton.disabled = false;\n\n boton.addEventListener(\"click\", function () {\n isNotTrue(v);\n\n boton.style.display = \"none\";\n });\n\n}", "title": "" }, { "docid": "c13349738d264f91ada06f8ffd3f7be4", "score": "0.5721871", "text": "function evaluarAjusteInv(){\nif (!detalles>0){\n count=0;\n $(\"#btnGuardarAjusteInv\").hide();\n $(\"#rowAjusteInv\").hide();\n }\n}", "title": "" }, { "docid": "753e1568d94c782451d0e802927fefd4", "score": "0.5717776", "text": "function Deplacement_ennemiLimitrophe(Territoire){\r\n\tif (Territoire.army < 2) {return false}\r\n for (var i=0 ; i < Territoire.voisins.length ; i++){\r\n if (Territoire.proprietaire != Territoire.voisins[i].proprietaire ){\r\n return true\r\n }\r\n }\r\n return false\r\n}", "title": "" }, { "docid": "c476c4e86c2f1943cf95d16b7039b17d", "score": "0.5695662", "text": "function testVictoire() {\n if (vieGob<=0 && vieDra<=0 && vieFan<=0){\n description.innerHTML=\"Bravo vous avez gagnez !\";\n fin=true;\n //Aucun bouton ne pourra être cliquer, car la partie est fini\n butGue.style.background-color ; \"grey\";\n butGue.disabled=true;\n butPre.style.background-color ; \"grey\";\n butPre.disabled=true;\n butArc.style.background-color ; \"grey\";\n butArc.disabled=true;\n butVol.style.background-color ; \"grey\";\n butVol.disabled=true;\n butAtk.style.background-color ; \"grey\";\n butAtk.disabled=true;\n butDef.style.background-color ; \"grey\";\n butDef.disabled=true;\n butSpe.style.background-color ; \"grey\";\n butSpe.disabled=true;\n butGob.style.background-color ; \"grey\";\n butGob.disabled=true;\n butDra.style.background-color ; \"grey\";\n butDra.disabled=true;\n butFan.style.background-color ; \"grey\";\n butFan.disabled=true;\n }\n}", "title": "" }, { "docid": "067682b399f265d908a2750a9e97204c", "score": "0.5675039", "text": "function vence(novoTabuleiro, jogador){\n\n // checa vitoria de \"X\" ou \"O\"\n if(\n // checando horizontal\n novoTabuleiro[0] == jogador && novoTabuleiro[1] == jogador && novoTabuleiro[2] == jogador ||\n novoTabuleiro[3] == jogador && novoTabuleiro[4] == jogador && novoTabuleiro[5] == jogador ||\n novoTabuleiro[6] == jogador && novoTabuleiro[7] == jogador && novoTabuleiro[8] == jogador ||\n\n // checando vertical\n novoTabuleiro[0] == jogador && novoTabuleiro[3] == jogador && novoTabuleiro[6] == jogador ||\n novoTabuleiro[1] == jogador && novoTabuleiro[4] == jogador && novoTabuleiro[7] == jogador ||\n novoTabuleiro[2] == jogador && novoTabuleiro[5] == jogador && novoTabuleiro[8] == jogador ||\n\n // checando diagonal\n novoTabuleiro[0] == jogador && novoTabuleiro[4] == jogador && novoTabuleiro[8] == jogador ||\n novoTabuleiro[2] == jogador && novoTabuleiro[4] == jogador && novoTabuleiro[6] == jogador){\n\n //textoVencedor = jogador + \" venceu!\";\n return true;\n\n }\n return false;\n\n}", "title": "" }, { "docid": "fbcd183a37c7bd5a5570e40b9c9e2582", "score": "0.56723124", "text": "finirLeTour() {\n switch (this.etat) {\n case ETAT_INITIALISATION:\n default:\n // Appel à \"finirLeTour\" lorsque la game est en initialisation (case ETAT_INITIALISATION)\n // OU dans un état inconnu (default case).\n console.log(\"DEFAULT CASE !\");\n break;\n case ETAT_DEPLACEMENT:\n this.changerJoueur();\n this.joueurs[this.indexJoueurActuel].casesPossiblesDeplacement();\n break;\n case ETAT_COMBAT:\n console.log(\"FIGHT CASE !\");\n // On change de joueur\n this.changerJoueur();\n\n // Pour chaque \"paire\" de boutons (1 paire par joueur)\n this.boutons.forEach((pair, idx) => {\n // On désactive les boutons si ceux-ci font partie de l'objet \"pair\"\n // qui correspond au joueur dont le tour est terminé.\n pair.attaquer[0].disabled = idx === this.indexAutreJoueur;\n pair.defendre[0].disabled = idx === this.indexAutreJoueur;\n });\n break;\n }\n }", "title": "" }, { "docid": "829b2bd61959912e7f6a9fff652659ce", "score": "0.5666387", "text": "function comprobar(){\n \n //Comprobar el nombre.\n verifDatos(document.getElementById(\"nombre\"), document.getElementById(\"errNom\"));\n verifDatos(document.getElementById(\"edad\"), document.getElementById(\"errEdad\"));\n verifDatos(document.getElementById(\"fecha\"), document.getElementById(\"errFecha\"));\n verifGen();\n verifProv();\n \n if(counter == 0){\n return true;\n }\n \n return false;\n}", "title": "" }, { "docid": "99d090331304f53fbcafa32209c316bc", "score": "0.5662564", "text": "function funcVerifTableau(tableauResultats) {\n for (let i = 0; i < 5; i++) {\n if (tableauResultats[i] === reponses[i]) {\n verifTableau.push(true);\n } else {\n verifTableau.push(false);\n }\n }\n console.log(verifTableau);\n afficherResultats(verifTableau);\n couleursFunction(verifTableau);\n verifTableau = [];\n}", "title": "" }, { "docid": "6d5f6b0afd49af7b5c72223f644bb306", "score": "0.5661565", "text": "function test_existanceAppel_offre (item,suppression)\n { \n if (suppression!=1)\n {\n var mem = vm.allappel_offre.filter(function(obj)\n {\n return obj.id == currentItemAppel_offre.id;\n });\n if(mem[0])\n {\n if((mem[0].description != currentItemAppel_offre.description )\n //||(mem[0].fichier != currentItemAppel_offre.fichier )\n ||(mem[0].date_livraison != currentItemAppel_offre.date_livraison )\n ||(mem[0].date_approbation != currentItemAppel_offre.date_approbation )\n ||(mem[0].observation != currentItemAppel_offre.observation )) \n { \n insert_in_baseAppel_offre(item,suppression);\n }\n else\n { \n item.$selected = true;\n item.$edit = false;\n }\n }\n } else\n insert_in_baseAppel_offre(item,suppression);\n }", "title": "" }, { "docid": "6d5f6b0afd49af7b5c72223f644bb306", "score": "0.5661565", "text": "function test_existanceAppel_offre (item,suppression)\n { \n if (suppression!=1)\n {\n var mem = vm.allappel_offre.filter(function(obj)\n {\n return obj.id == currentItemAppel_offre.id;\n });\n if(mem[0])\n {\n if((mem[0].description != currentItemAppel_offre.description )\n //||(mem[0].fichier != currentItemAppel_offre.fichier )\n ||(mem[0].date_livraison != currentItemAppel_offre.date_livraison )\n ||(mem[0].date_approbation != currentItemAppel_offre.date_approbation )\n ||(mem[0].observation != currentItemAppel_offre.observation )) \n { \n insert_in_baseAppel_offre(item,suppression);\n }\n else\n { \n item.$selected = true;\n item.$edit = false;\n }\n }\n } else\n insert_in_baseAppel_offre(item,suppression);\n }", "title": "" }, { "docid": "0e2b88881c8897cef056acfe23f9e060", "score": "0.56531775", "text": "isMoreSeniorThan(vampire) {\n return (this.numberOfVampiresFromOriginal < vampire.numberOfVampiresFromOriginal) \n }", "title": "" }, { "docid": "4701bb918816beb67698126cae829943", "score": "0.5636053", "text": "function mourir(){\n if(personnage.sante<0){\n presenceEnnemi = 666;\n dialogBox(\"Oh, on dirait que \" + rndEnnemi.nom + \" a eu raison de toi\\nT'es un peu une merde, et t'as un peu pas d'bol\\n\\ntu as tout de même niqué \"+compteurEnnemiVaincu +\" Boloss sur ta route\\n\\nf5 pour recommencer... DU DEBUT HAHAHA\")\n}\n}", "title": "" }, { "docid": "3aa7816311306e5964acd1205c437e74", "score": "0.5612709", "text": "function upisGoreFunc()\n{\n\tif (brojBacanja === 0)\n\t\treturn;\n\n\tif (indNajave > 0)\n\t{\n\t\talert(\"Igrali ste najavu!\")\n\t\treturn;\n\t}\n\n\t/* get the value of the field clicked */\n\tvar vred = Number(this.id.slice(1, ));\n\n\t/* see if the previous field is not -1 */\n\t/* else disable writting to preserve order */\n\tif(vred < 12 && kGore[vred] < 0)\n\t{\n\t\talert(\"Nedozvoljen upis!\");\n\t\treturn;\n\t}\n\t\n\t/* did we already write into this field */\n\tif(kGore[vred-1] >= 0)\n\t{\n\t\talert(\"Vec ste upisali u ovo polje!\");\n\t\treturn;\n\t}\n\n\tvar tmp = 0;\n\tvar tmpNiz = [];\n\n\t/* splice izabraneKockice and baceneKockice */\n\tfor(var i=0; i<5; ++i)\n\t{\n\t\tif (Number(izabraneKockice[i].innerText))\n\t\t\ttmpNiz.push(Number(izabraneKockice[i].innerText));\n\t}\n\n\tfor(var i=0; i<5; ++i)\n\t{\n\t\tif (Number(baceneKockice[i].innerText))\n\t\t\ttmpNiz.push(Number(baceneKockice[i].innerText));\n\t}\n\n\tif(tmpNiz.length != 5)\n\t\talert(\"Niz nije 5! vec: \" + tmpNiz.length);\n\n\t/* decide which field was clicked: broj, maxmin ili igra */\n\tswitch(vred)\n\t{\n\t\tcase 1:\n\t\tcase 2:\n\t\tcase 3:\n\t\tcase 4:\n\t\tcase 5:\n\t\tcase 6:\n\t\t\tfor(var i=0; i<5; ++i)\n\t\t\t{\n\t\t\t\tif(tmpNiz[i] == vred)\n\t\t\t\t\ttmp += tmpNiz[i]\n\t\t\t}\n\t\t\tkGore[vred-1] = tmp;\n\t\t\tsumaKolFunc(kGore, \"suma3\");\n\t\t\tsumaRazFunc(kGore, \"suma7\")\n\t\t\tbreak;\n\t\tcase 7:\n\t\tcase 8:\n\t\t\ttmp = zbir(tmpNiz);\n\t\t\tkGore[vred-1] = tmp;\n\t\t\tsumaRazFunc(kGore, \"suma7\")\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\ttmp = jelFul(tmpNiz);\n\t\t\tkGore[vred-1] = tmp;\n\t\t\tsumaIgFunc(kGore, \"suma11\");\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\ttmp = jelPoker(tmpNiz);\n\t\t\tkGore[vred-1] = tmp;\n\t\t\tsumaIgFunc(kGore, \"suma11\");\n\t\t\tbreak;\n\t\tcase 11:\n\t\t\ttmp = jelKenta(tmpNiz);\n\t\t\tkGore[vred-1] = tmp;\n\t\t\tsumaIgFunc(kGore, \"suma11\");\n\t\t\tbreak;\n\t\tcase 12:\n\t\t\ttmp = jelYamb(tmpNiz);\n\t\t\tkGore[vred-1] = tmp;\n\t\t\tsumaIgFunc(kGore, \"suma11\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\n\t/* write number of vred thrown */\n\tdocument.getElementById(this.id).innerText=Number(tmp);\n\n\tresetuj(izabraneKockice, baceneKockice);\n}", "title": "" }, { "docid": "5880ea11eb4bdf9b83a53cc10ad4c867", "score": "0.5594033", "text": "utlevert() {\n // Går gjennom varene og setter statusen på bestillingen til \"utlevert\" og varene til \"utleid\"\n for (var i = 0; i < this.varer.length; i++) {\n s_statuser.Utlevert(this.varer[i].v_id, this.b_id);\n }\n this.mounted();\n this.hent();\n }", "title": "" }, { "docid": "2de54538e43972488b4ef3891f835317", "score": "0.5587344", "text": "function isSuperposed() {\r\n\tfor (var x = 0; x < activos.length; x++) {\r\n\t\tfor (var y = 0; y < activos.length; y++) {\r\n\t\t\tif (x != y) {\r\n\t\t\t\tif (vehiculos[activos[x]].getDistancexy(vehiculos[activos[y]]) < 6) {\r\n\t\t\t\t\t//movies[activos[x]].textData.text += \"\\n\\nUnidad: \" + vehiculos[activos[y]].nombre + \"\\nVelocidad: \" + vehiculos[activos[y]].velocidad + \" km/h\\nHora: \" + vehiculos[activos[y]].fechaText + \"\\nOcupaci�n: \" + vehiculos[activos[y]].pasajeros + \"%\\nAcumulado: \" + vehiculos[activos[y]].acumulado;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "3394d6a6918de44ca8c8edc760fcd89f", "score": "0.5573691", "text": "function test_existanceFacture_moe_entete (item,suppression)\n { \n if (suppression!=1)\n {\n var pass = vm.allfacture_moe_entete.filter(function(obj)\n {\n return obj.id == currentItemFacture_moe_entete.id;\n });\n if(pass[0])\n {\n if((pass[0].numero != currentItemFacture_moe_entete.numero )\n || (pass[0].date_br != currentItemFacture_moe_entete.date_br )\n || (pass[0].statu_fact != currentItemFacture_moe_entete.statu_fact )) \n { \n insert_in_baseFacture_moe_entete(item,suppression);\n }\n else\n { \n item.$selected = true;\n item.$edit = false;\n }\n }\n } else\n insert_in_baseFacture_moe_entete(item,suppression);\n }", "title": "" }, { "docid": "27fa38e748ab105e6c99b7f02f2d382e", "score": "0.5572983", "text": "function attaquer() \n{\n if (presenceEnnemi === 666){\n dialogBox(\"MORT DE CHEZ MORT ARRETE MAINTENANT. TU PEUX PAS ATTAQUER T'ES MORT. MORT. MOOOOORT\");\n }else if (presenceEnnemi === 0){\n dialogBox(\"Tu n'as pas d'adversaire, va chercher la merde on en reparle après.\");\n }else if (presenceEnnemi = 1, tourJoueur(tour)=== true){\n var Min= Number(personnage.force - 10)\n var Max= Number(personnage.force + 10)\n\n function getRndInterger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;}\n\nvaleurAttaque = getRndInterger(Min, Max);\nactionPerso = 1;\nreactionEnnemi();\nesquiveReussie = 0;\nresetSpecial();\n}\n\n}", "title": "" }, { "docid": "4ff0687a7027862d25cdbf99be032798", "score": "0.55566925", "text": "niveauSuivant()\n\t{\n\t \n\t\tthis._termine = false;\n\t\tthis._gagne = false;\n\t\tthis._niveau++;\n\t\tthis._score++;\n\t\tif (localStorage.getItem(\"high-score\") == null)\n\t\t localStorage.setItem(\"high-score\", \"0\");\n\t\tif (parseInt(localStorage.getItem(\"high-score\"), 10) < this._score) {\n\t\t localStorage.removeItem(\"high-score\");\n\t\t localStorage.setItem(\"high-score\", this._score.toString());\n\t\t}\n\t\tif ((this._niveau + 1) % 10 === 0)\n\t\t this._nbPDV++;\n\n\t\tthis.demarrerNiveau();\n\t}", "title": "" }, { "docid": "8e9a79ac6f28bec71f70da791bc53981", "score": "0.5553917", "text": "function funcVerifTableau(tableauResultats) {\r\n for (let i = 0; i < 5; i++) {\r\n if (tableauResultats[i] === reponses[i]) {\r\n verifTableau.push(true);\r\n } else {\r\n verifTableau.push(false);\r\n }\r\n }\r\n console.log(verifTableau);\r\n afficherResultats(verifTableau);\r\n verifTableau = [];\r\n}", "title": "" }, { "docid": "8dcfcba870d25e43870c94d1f2b25d35", "score": "0.5546791", "text": "function reglaSuperDuper(){\n if(producto.fc_superduper.sellIn < 5){\n precio_FullSuperDuper + 3;\n \n if(producto.fc_superduper.sellIn <=10 || producto.fc_superduper.sellIn >5){\n precio_FullSuperDuper + 2;\n }\n if(producto.fc_superduper.sellIn = 0){\n precio_FullSuperDuper = 0;\n }\n }else{\n precio_FullSuperDuper < 100;\n }\n\n}", "title": "" }, { "docid": "116f0624a051a8da1daac4cbd5eea097", "score": "0.55462164", "text": "function verifForm2(f){\n\n var telOk = verifTel(f.tel) ; \n var mailOk = verifMail(f.mail) ; \n var siteOk = verifLink(f.site) ;\n \n \n\n if (telOk || mailOk || siteOk ) {\n alert(\"Votre annonce a bien été envoyée, elle sera confirmée par nos équipes\");\n return true;\n } \n \n else{ \n \n alert(\"Veuillez remplir correctement tous les champs\");\n return false;\n }\n \n }", "title": "" }, { "docid": "809c8411ae9808c804af2aea62fecb28", "score": "0.5544484", "text": "function CornerCheck() {\n //comprobando las esquinas\n if (\n selected[0][0] &&\n called[0][0] &&\n selected[0][3] &&\n called[0][3] &&\n selected[3][0] &&\n called[3][0] &&\n selected[3][3] &&\n called[3][3]\n ) {\n hasWon = true;\n console.log(\"gano en las esquinas\");\n msg = \"Ganaste en las esquinas!\";\n return true;\n }\n}", "title": "" }, { "docid": "e91a023fdc97bc37d1c2906782273c72", "score": "0.55443853", "text": "function oncl() {\n var imgs = this.parentNode.parentNode.getElementsByTagName('img')\n var link = this.parentNode.parentNode.getElementsByTagName('a')[2]\n var ca = link.innerHTML\n var ti = this.title\n var vo = ti=='+'?1:-1\n votes[ca].value = (votes[ca].value==vo) ? 0 : vo\n \n imgs[0].src = ico.up + (votes[ca].value== 1 ?ico.suppact:(votes[ca].orig== 1 ?ico.suppinact:ico.supp))\n imgs[1].src = ico.up + (votes[ca].value==-1 ?ico.oppact :(votes[ca].orig==-1 ?ico.oppinact :ico.opp))\n \n link.className = ['opp', '', 'supp'][votes[ca].value + 1]\n \n return false\n }", "title": "" }, { "docid": "1f32de122db32c9babbe73087b7bbaa7", "score": "0.5543491", "text": "function evaluar() {\n\n\tif (detalles > 0) {\n\t\t$(\"#btnGuardar\").show();\n\t} else {\n\t\t$(\"#btnGuardar\").hide();\n\t\tcont = 0;\n\t}\n}", "title": "" }, { "docid": "dd828b6a40558a1b1c95f221567fd744", "score": "0.55293685", "text": "decision () {\n\n // console.log('length: ', this.leves.length)\n if ((this.currentIndexLevel == this.leves.length - 1)) {\n return true\n }\n return false\n }", "title": "" }, { "docid": "5710422237378381f318aa0cb602d2d2", "score": "0.5524293", "text": "function checkAntwoord() {\n\t// Lees antwoord uit\n\tvar gegevenAntwoord = document.getElementById(\"invoer\").value;\n\tif (gegevenAntwoord == antwoord) {\n\t\taantalGoed++;\n\t\tdocument.getElementById(\"feedback\").innerHTML = \"<br>Goedzo!<br>Maak de volgende som.\";\n\t} else {\n\t\tdocument.getElementById(\"feedback\").innerHTML = \"<br>Helaas! Het goede antwoord van \" \n\t\t+ getal1 + \" x \" + getal2 + \" is \" + antwoord + \"<br>Maak de volgende som.\";\n\t}\n\t// Werk speelveld bij\n\tupdateSpeelveld();\n}", "title": "" }, { "docid": "dca2d8be7d3786d49ccb6ec2730e5f6a", "score": "0.5520771", "text": "function chequeo(){\n \n contador(preguntas);\n\n if(palabrasTotales == 27){\n final = true;\n alert('No quedan mas letras en el abecedario. :(');\n } else {\n proxturno = confirm('Desea seguir con la siguiente ronda?');\n }\n\n if(proxturno == false){ \n final = true;\n }\n }", "title": "" }, { "docid": "aaa20335e63c42eddf23ee7e3c4d5a44", "score": "0.55189896", "text": "function test_existanceDemande_latrine_mpe (item,suppression)\n{ \n if (suppression!=1)\n {\n var pass = vm.alldemande_latrine_mpe.filter(function(obj)\n {\n return obj.id == currentItemDemande_latrine_mpe.id;\n });\n if(pass[0])\n {\n if(pass[0].id_tranche_demande_mpe != currentItemDemande_latrine_mpe.id_tranche_demande_mpe) \n { \n insert_in_baseDemande_latrine_mpe(item,suppression);\n }\n else\n { \n item.$selected = true;\n item.$edit = false;\n }\n }\n } else\n insert_in_baseDemande_latrine_mpe(item,suppression);\n}", "title": "" }, { "docid": "d9cc0c7dd25641625c1d222af92b6ca8", "score": "0.55142486", "text": "function estaGirando(){\r\n\treturn idsSpinners.length > 0;\r\n}", "title": "" }, { "docid": "05e640f1d5ae55754a17eb2f28fe0245", "score": "0.55134416", "text": "function maj_a_verifier()\r\n\t{\r\n\t\t//\r\n\t\t// Gestion de la màj toute les 24 h\r\n\t\t//\r\n\r\n\t\tvar heure_dernier_maj = 0 ;\r\n\t\t//Lit le contenu de la variable\r\n\t\tvar donnee = localStorage.getItem(MENU_maj) ;\r\n\t\tif (donnee != null)\r\n\t\t{\r\n\t\t\theure_dernier_maj = donnee ;\r\n\t\t}\r\n\r\n\t\t//Récupération de l'heure actuelle (en s depuis 1970)\r\n\t\tvar heure_actuelle = new Date().getTime() / 1000 ;\r\n\t\t\t\t\r\n\t\t//Calcul le delta entre la dernière vérif et maintenant\r\n\t\tvar delta = heure_actuelle - heure_dernier_maj ;\r\n\t\tif (delta < DELTA_maj) \r\n\t\t{\r\n\t\t\treturn false ; //Pas de màj à vérifier\r\n//\t\t\treturn true ; //Force la màj\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn true ;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "347600f427f87ff909be5bdb978bb718", "score": "0.5512072", "text": "function IA_sacrifier(){\n\t\t // IA sacrifie la carte de plus haut cout d'invocation\n\t\t //SSI aucune carte vide\n\t\t \n\t\t no=rechercherIdxCarteAdvCoutMax()\n\t\t if (no>=0){\n\t\t\tlaCarte = jeu_adv[no];\n\t\t \tsacrifierUneCarte(no,laCarte,false,true);\n\t\t}\n\t }", "title": "" }, { "docid": "d8d1d1e240ba05cae380fced357439cd", "score": "0.5504199", "text": "function achatItem3Lvl1() {\n affichagePrixItem3Lvl1.innerHTML = \"OBTENU\";\n boutonItem3Lvl1.disabled = true;\n boutonItem3Lvl1.style.border = \"inherit\";\n clickRessource3 = 2;\n ressource1.innerHTML = ressource1.innerHTML - prixItem3Lvl1;\n activationItemsShop();\n compteurRessourcePlateau1 = parseInt(ressource1.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem3lvl1Vide\").src= \"assets/img/pioche1Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils1(); \n }", "title": "" }, { "docid": "f400c267a41e0c70d8a8c8a3031ac42f", "score": "0.5502872", "text": "function condiçaoVitoria(){}", "title": "" }, { "docid": "005561c478cdb43d486c02145becb21c", "score": "0.5488054", "text": "isGameOver() {\n\n let gameIsOver = false;\n let playersAliveCounter = 0;\n let lastPlayerAlive;\n\n //Cuenta los jugadores vivos\n GameElements.players.forEach(player => {\n if (!player.isDead) {\n playersAliveCounter++;\n lastPlayerAlive = player;\n }\n });\n\n //Si solo queda un jugador vivo , es el ganador\n if (playersAliveCounter == 1) {\n gameIsOver = true;\n this.winner = {\n id: lastPlayerAlive.id,\n name: lastPlayerAlive.name\n }\n }\n //Si los jugadores mueren todos al mismo tiempo, no hay ganador\n if (playersAliveCounter == 0) {\n gameIsOver = true;\n this.winner = null;\n }\n //Si se acaba el tiempo, lo cual no puede pasar porque las paredes \n //matarian antes de llegar el tiempo a 0\n if (this.time.minutes == 0 && this.time.seconds == 0) {\n gameIsOver = true;\n }\n return gameIsOver;\n\n }", "title": "" }, { "docid": "1b4e848fff2476e7c27d9b5b932ac036", "score": "0.54854256", "text": "checkVitals() {\n if (this.getItemCount(items.AIR) <= 0 || this.getItemCount(items.FOOD) <= 0 || this.getItemCount(items.WATER) <= 0) {\n return false;\n } else {\n return true;\n }\n }", "title": "" }, { "docid": "008d8c283652573c6dc924675bab5384", "score": "0.5483473", "text": "function wechselAnsicht(){\n\t\tif(ansichtsWechsel){\n\t\t\tschalteKlassen();\n\t\t\tansichtsWechsel = false;\n\t\t}\n\t\telse {\n\t\t\tschalteKlassen();\n\t\t\tansichtsWechsel = true;\n\t\t}\n\t}", "title": "" }, { "docid": "1e9686c8552f1d6c785ae63758177439", "score": "0.5469602", "text": "function falso(){\n\tif(cont==2||cont==3||cont==5||cont==6||cont==7||cont==8||cont==10||cont==11||cont==13||cont==17||cont==19){\n\t\talert(\"ESA ES MI CHICA! CORRECTO\");\n\t\tpuntos = puntos + 1;\n\t}else{\n\t\talert(\"MALA NOVIA!!! ERROR\");\n\t}\n\tconsole.log(puntos);\n\tcambiarPagina();\n}", "title": "" }, { "docid": "886683d9e6181243fd2cf591f47000df", "score": "0.54679215", "text": "function abschiessen(_event) {\r\n // wird �ber jedes Ufo dr�ber geschaut, \r\n for (let i = 0; i < abschlussaufgabe.ufos.length; i++) {\r\n let u = abschlussaufgabe.ufos[i];\r\n let diffx = u.x - _event.clientX; // Abstand des Mausklicks zur x-Position des Ufos[i] ermitteln\r\n let diffy = u.y - _event.clientY; // Abstand des Mausklicks zur y-Position des Ufos[i] ermitteln\r\n // ob es in der N�he des Klicks war. Wenn ja, \r\n if (Math.abs(diffx) < 50 && Math.abs(diffy) < 50) {\r\n if (u.status == false) {\r\n // der Status wird auf true (getroffen) ge�ndert, sodass in der move() Funktion die Funktion fall() aufgerufen wird und das Ufo noch unten f�llt.\r\n u.status = true;\r\n // Zahl der abgeschossenen Ufos erh�hen\r\n abschlussaufgabe.h++;\r\n if (abschlussaufgabe.h == 200) {\r\n alert(\"Du hast gewonnen!\");\r\n location.reload();\r\n }\r\n // Funktionsaufruf\r\n TrefferZaehlen(abschlussaufgabe.h);\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "43bd048daff5fbb11bd9f2a4ae28a330", "score": "0.54648757", "text": "function mostrarHoteles() {\n if (mostraStatus) {\n mostrarHotelesActivados();\n } else {\n mostrarHotelesDesactivados();\n }\n}", "title": "" }, { "docid": "0fa42b76f7cbc9c977858c7c25fbf5dc", "score": "0.54614305", "text": "function test_existanceDemande_mobilier_mpe (item,suppression)\n{ \n if (suppression!=1)\n {\n var pass = vm.alldemande_mobilier_mpe.filter(function(obj)\n {\n return obj.id == currentItemDemande_mobilier_mpe.id;\n });\n if(pass[0])\n {\n if(pass[0].id_tranche_demande_mpe != currentItemDemande_mobilier_mpe.id_tranche_demande_mpe) \n { \n insert_in_baseDemande_mobilier_mpe(item,suppression);\n }\n else\n { \n item.$selected = true;\n item.$edit = false;\n }\n }\n } else\n insert_in_baseDemande_mobilier_mpe(item,suppression);\n}", "title": "" }, { "docid": "a5c3f25f7c088435627e363ea542f1bd", "score": "0.5454714", "text": "exit(joueur){\n if((this.xBase > joueur.collide().x || (this.xBase + this.largeur) < joueur.collide().x)\n || (this.yBase > joueur.collide().y || (this.yBase + this.hauteur) < joueur.collide().y))\n this.findExit=true;\n }", "title": "" }, { "docid": "a770de04cf767e843468c8aa7ed13956", "score": "0.5452893", "text": "function compagnie_loyer()\n{\n if(cases[pos_actuelle()].id == joueur_actuel)\n {\n\tdocument.getElementById(\"jeu\").innerHTML = \"Vous etes chez vous\";\n\tvalidation.innerHTML = bouton_passer;\n\tvar b_p = document.getElementById(\"bouton_passer\");\n\tb_p.addEventListener(\"click\", passer, false);\n }\n else\n {\n\tvar dette = \n\t document.getElementById(\"jeu\").innerHTML = des_actuel * ((joueurs[cases[pos_actuelle()].id].compagnies == 1) ? 4 : 10) * 100;\n\tjeu.innerHTML = \"Vous etes chez la compagnie de \" + cases[pos_actuelle()].nom + \", vous devez payer \" + dette + \".\";\n\tvalidation.innerHTML = \"<input type=\\\"button\\\" id=\\\"bouton_loyer\\\" value=\\\"payer\\\"/>\";\n\tb_l = document.getElementById(\"bouton_loyer\");\n\tb_l.addEventListener(\"click\", need_money.bind(this, dette), false);\n }\n}", "title": "" }, { "docid": "d6932a68a65ce0fedbb9343f85b0dbdf", "score": "0.54520684", "text": "function test_existancePv_consta_entete_travaux (item,suppression)\n { \n if (suppression!=1)\n {\n var pass = vm.allpv_consta_entete_travaux.filter(function(obj)\n {\n return obj.id == currentItemPv_consta_entete_travaux.id;\n });\n if(pass[0])\n {\n if((pass[0].numero != currentItemPv_consta_entete_travaux.numero )\n || (pass[0].date_etablissement != currentItemPv_consta_entete_travaux.date_etablissement )\n || (pass[0].montant_travaux != currentItemPv_consta_entete_travaux.montant_travaux )\n || (pass[0].avancement_global_periode != currentItemPv_consta_entete_travaux.avancement_global_periode )\n || (pass[0].avancement_global_cumul != currentItemPv_consta_entete_travaux.avancement_global_cumul ) ) \n { \n insert_in_basePv_consta_entete_travaux(item,suppression);\n }\n else\n { \n item.$selected = true;\n item.$edit = false;\n }\n }\n } else\n insert_in_basePv_consta_entete_travaux(item,suppression);\n }", "title": "" }, { "docid": "ae5ca3c39a824b3fee3e6a5eca54084d", "score": "0.5450464", "text": "shouldUpdate(e){return!0}", "title": "" }, { "docid": "a7add1f7ee87d52800b54091a8e3f9a9", "score": "0.5448849", "text": "function limiteDisponible(monto){\n if(monto <= limiteExtraccion){\n return true;\n }else{\n alert(\"El monto a extraer supera el limite diario\");\n return false;\n }\n}", "title": "" }, { "docid": "68240d2ae5609eb9d9e35f7abafebaf2", "score": "0.5447787", "text": "function suivant(){\n if(active==\"idee\"){\n reunion_open();\n }else if (active==\"reunion\") {\n travail_open();\n }else if (active==\"travail\") {\n deploiement_open();\n }\n }", "title": "" }, { "docid": "26390f3261618313f9e34c091e1a8248", "score": "0.5447419", "text": "function acabarPreInversion (){\n \n realizandoInversion = false \n}", "title": "" }, { "docid": "3e755f4871441e668fff6d2904f07844", "score": "0.5447047", "text": "function test_existancePv_consta_rubrique_phase_mob_mpe (item,suppression)\n{ \n if (suppression!=1)\n {\n var mem = vm.allpv_consta_rubrique_phase_mob_mpe.filter(function(obj)\n {\n return obj.id == currentItemPv_consta_rubrique_phase_mob_mpe.id;\n });\n if(mem[0])\n {\n if(mem[0].observation != currentItemPv_consta_rubrique_phase_mob_mpe.observation) \n { \n insert_in_basePv_consta_rubrique_phase_mob_mpe(item,suppression);\n }\n else\n { \n item.$selected = true;\n item.$edit = false;\n }\n }\n } else\n insert_in_basePv_consta_rubrique_phase_mob_mpe(item,suppression);\n}", "title": "" }, { "docid": "96b4b6dfa16232add7417dc2b3fd67ad", "score": "0.54469746", "text": "function verificaDadesLlibreAlumne(llibres){\n\tvar dadesCorrectes = false;\n\tfor (var i = 0; i < llibres.length; i++) {\n\t\tconsole.log(\"Dades per a l'ID: \"+llibres[i].id);\n\t\tif(llibres[i].checked){\n\t\t\tllibreTriat = true;\n\t\t\t//1 - Obtenir el llistat de les assignatures dels llibres que ja ha entregat l'alumne al passar per aquí\n\t\t\t//a) Si la llista torna buida, passem a inserir tots els llibres directament.\n\t\t\t//b) Si torna amb llibres es comparen si els ID de la llista coincideixen amb els que duu l'usuari marcats.\n\t\t\t//Obtenim l'ID de l'alumne que hi ha triat.\n\t\t\tvar idAlumne = getIDStudent();\n\t\t\tcheckDatabase(1, idAlumne, \"null\");\t//Operació 1: obtenir llista assignatures donades de l'alumne | ID ALUMNE | NULL\n\t\t\t\n\t\t\tif(procedimentCorrecte === true){\n\t\t\t\tprocedimentCorrecte = false;\n\t\t\t\tconsole.log(\"Ha anat bé\");\n\t\t\t\tvar cll = comprovaLlistaLlibres(1,llibres);\n\t\t\t\t\n\t\t\t\tif(cll == true){\n\t\t\t\t\tconsole.log(\"Verificació de repetició de llibres: CORRECTA\");\n\t\t\t\t}else{\n\t\t\t\t\tvar sufix = cll.split(\"_\");\n\t\t\t\t\tconsole.log(\"Sufix pos 0: \"+sufix[0]+\" - Sufix pos 1: \"+sufix[1]);\n\t\t\t\t\tvar textLlibre = document.getElementById(\"bookName_\"+sufix[1]+\"\").textContent;\n\t\t\t\t\tif(sufix[0] == 151 || sufix[0] == 251 || sufix[0] == 351 || sufix[0] == 451 || sufix[0] == 452 || sufix[0] == 551 || sufix[0] == 651){\n\t\t\t\t\t\tconsole.log(\"Control de la QUOTA: \"+sufix[2]);\t\t\t\t\t\t\n\t\t\t\t\t\tif(sufix[2] == \"QE\"){\n\t\t\t\t\t\t\tconsole.log(\"S'ha de desmarcar la quota\");\n\t\t\t\t\t\t\talert(\"L'Alumne ja ha pagat la \"+textLlibre+\" i per tant se li ha de DESMARCAR!\");\n\t\t\t\t\t\t}else if(sufix[2] == \"QM\"){\n\t\t\t\t\t\t\tconsole.log(\"S'ha de marcar la quota\");\n\t\t\t\t\t\t\talert(\"L'Alumne NO ha pagat la \"+textLlibre+\" i per tant se li ha de MARCAR!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\tconsole.log(\"Verificació de repetició de llibres: INCORRECTA\");\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t//var textLlibre = document.getElementById(\"bookName_\"+sufix[1]+\"\").textContent;\n\t\t\t\t\t\talert(errorTextDuplicateBookCollect +\": \"+textLlibre);\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\talert(\"Hi ha hagut un error amb les dades del servidor!\");\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//Crida a funció de resolució.\n\t\t}else{\n\t\t\tconsole.log(\"No triat!\");\n\t\t}\n\t}\n\t\n\tif(cll == true){\n\t\tdadesCorrectes = true;\n\t}else{\n\t\tdadesCorrectes = false;\n\t}\n\t\n\treturn dadesCorrectes;\n\t\n}", "title": "" }, { "docid": "3dadc85b7439aa78b2074b3776863d68", "score": "0.5442436", "text": "function test_existance (item,suppression)\n { \n if (suppression!=1)\n {\n var cis = vm.alltravaux_preparatoire.filter(function(obj)\n {\n return obj.id == currentItem.id;\n });\n if(cis[0])\n {\n if((cis[0].unite!=currentItem.unite) \n || (cis[0].designation!=currentItem.designation)\n || (cis[0].qt_prevu!=currentItem.qt_prevu)\n || (cis[0].numero!=currentItem.numero)) \n { \n insert_in_base(item,suppression);\n }\n else\n { \n item.$selected = true;\n item.$edit = false;\n }\n }\n } else\n insert_in_base(item,suppression);\n }", "title": "" }, { "docid": "e1f238ce0fb57099cbff9fac768ca6ab", "score": "0.54330474", "text": "avancer() {\n\t\tlet fermee = this.cellule.ouverture(this.direction);\n\t\tif (fermee) { //il y a un mur\n\t\t\treturn this.finMouvement();\n\t\t} else if (this.verifierBlocage()===true) { //la porte est bloquee\n return this.finMouvement();\n }\n\t\tthis.visuel.style.transitionDuration = (this.animMouvement) + \"ms\";\n\t\tthis.cellule = this.cellule.voisine(this.direction);\n\n console.log(\"Déplacement: \"+[\"↑\",\"→\",\"↓\",\"←\"][this.direction]+\" / \"+this.cellule.infoDebogage());\n\n\t\tthis.visuel.addEventListener('transitionend', this.evt.visuel.transitionend);\n\t}", "title": "" }, { "docid": "4cabfd7b9b8c14b38dcdd483102b20ca", "score": "0.5429146", "text": "function test_existanceParticipant_emies (item,suppression)\n { \n if (suppression!=1)\n {\n var mem = vm.allparticipant_emies.filter(function(obj)\n {\n return obj.id == currentItemParticipant_emies.id;\n });\n if(mem[0])\n {\n if((mem[0].nom!=currentItemParticipant_emies.nom) \n || (mem[0].prenom!=currentItemParticipant_emies.prenom)\n || (mem[0].sexe!=currentItemParticipant_emies.sexe)\n || (mem[0].age!=currentItemParticipant_emies.age)\n || (mem[0].id_situation_participant_emies!=currentItemParticipant_emies.id_situation_participant_emies)) \n { \n insert_in_baseParticipant_emies(item,suppression);\n }\n else\n { \n item.$selected = true;\n item.$edit = false;\n }\n }\n } else\n insert_in_baseParticipant_emies(item,suppression);\n }", "title": "" }, { "docid": "4cabfd7b9b8c14b38dcdd483102b20ca", "score": "0.5429146", "text": "function test_existanceParticipant_emies (item,suppression)\n { \n if (suppression!=1)\n {\n var mem = vm.allparticipant_emies.filter(function(obj)\n {\n return obj.id == currentItemParticipant_emies.id;\n });\n if(mem[0])\n {\n if((mem[0].nom!=currentItemParticipant_emies.nom) \n || (mem[0].prenom!=currentItemParticipant_emies.prenom)\n || (mem[0].sexe!=currentItemParticipant_emies.sexe)\n || (mem[0].age!=currentItemParticipant_emies.age)\n || (mem[0].id_situation_participant_emies!=currentItemParticipant_emies.id_situation_participant_emies)) \n { \n insert_in_baseParticipant_emies(item,suppression);\n }\n else\n { \n item.$selected = true;\n item.$edit = false;\n }\n }\n } else\n insert_in_baseParticipant_emies(item,suppression);\n }", "title": "" }, { "docid": "cc9711e77e6724990607826878cbe852", "score": "0.5428023", "text": "function need_money(dette)\n{\n if(joueurs[joueur_actuel].capital > dette)\n {\n\tjoueurs[joueur_actuel].capital -= dette;\n\tpasser();\n }\n else\n {\n\talert(\"pas assez d'argent\");\n\tvalidation.innerHTML = bouton_payer + \" \" + bouton_prison;\n\tvar b_p = document.getElementById(\"bouton_payer\");\n\tb_p.addEventListener(\"click\", function(x)\n\t\t\t {\n\t\t\t\t need_money(x);\n\t\t\t }.bind(this, dette), false);\n\tvar b_s = document.getElementById(\"bouton_prison\");\n\tb_s.addEventListener(\"click\", function()\n\t\t\t {\n\t\t\t\t joueurs[joueur_actuel].prison = true;\n\t\t\t\t passer();\n\t\t\t }, false);\n }\n}", "title": "" }, { "docid": "3e3eb30cc62fc84a3c401f97bbe35971", "score": "0.54273903", "text": "function checkedGestionControlbyMail(){\n\tif(checkedN == \"checked\")\n\t\t{\n\t\t\tconsole.log('toto1');\n\t\t\tpreInscriptionNoGood();\n\t\t}\n\t\telse if (checkedP == \"checked\")\n\t\t{\n\t\t\tconsole.log('toto2');\n\t\t\tcliendNoGood();\n\t\t}\n\t\telse if (checkedI == \"checked\")\n\t\t{\n\t\t\telementManquant1=\"\";\t\n\t\t}\t\n\t\telse\n\t\t{\n\t\t\tconsole.log('toto3');\t\n\t\t\tinscriptionNoGood();\n\t\t}\n}", "title": "" }, { "docid": "c99a42d365e29781d3bc1954444ad5e7", "score": "0.54273176", "text": "function verifMotDePasse2(){\n var mdp=$('#mdp');\n var mdpVerif=$('#mdpVerif');\n if(mdp.value!=mdpVerif.value){\n if(mdp.value==\"\"){\n surligne(mdp, true);\n surligne(mdpVerif, false);\n }else if(mdpVerif.value==\"\"){\n surligne(mdp, false);\n surligne(mdpVerif, true);\n }else{\n surligne(mdp, true);\n surligne(mdpVerif, true);\n }\n return true;\n }else{\n surligne(mdp, false);\n surligne(mdpVerif, false);\n return false;\n }\n}", "title": "" }, { "docid": "f930848755dcfdd3a3a605f0186cbf1a", "score": "0.54264206", "text": "function valorTriangulo(){\n if(trianguloAparienciaInteraccion == true && trianguloAparienciaTono == true && trianguloAparienciaMirada == true && trianguloAparienciaLlanto == true){\n trianguloApariencia = true;\n }else{\n trianguloApariencia = false;\n }\n}", "title": "" }, { "docid": "a33159f2bd15aaafae90f6fa998cd31f", "score": "0.54254645", "text": "privado(){\r\n if(this.persona.datosDecision.totalSemanasCotizadas >= 1250){\r\n this.todaLaVida();\r\n this.diezYears();\r\n let valorpensiontv = this.persona.datosLiquidacion.pIBLtv * 0.9;\r\n let valorpension10 = this.persona.datosLiquidacion.pIBL10A * 0.9;\r\n if(valorpensiontv >= valorpension10){\r\n this.datosLiquidacion.valorPensionDecreto = valorpensiontv;\r\n this.persona.regimen = \"Decreto 758 de 1990 - IBL Toda la Vida\";\r\n }else{\r\n this.datosLiquidacion.valorPensionDecreto = valorpension10;\r\n this.persona.regimen = \"Decreto 758 de 1990 - IBL 10 años >= 1250 semanas\";\r\n }\r\n }else{\r\n this.diezYears();\r\n this.montoPension10();\r\n this.persona.regimen = \"Decreto 758 de 1990 - IBL 10 años\";\r\n }\r\n this.ley797();\r\n if(!this.regimentr){\r\n this.persona.regimen = \"Ley 797 de 2003\";\r\n }\r\n }", "title": "" }, { "docid": "97fabfaef23b1fdbe8a0d2ea331c83e5", "score": "0.54231626", "text": "checkInfection(){\n this.virus.models.forEach((virus) => {\n if(Math.trunc(this.player.model.position.z) === virus.model.position.z && Math.trunc(this.player.model.position.x) === virus.model.position.x){\n this.player.infected = true;\n }\n });\n return this.player.infected;\n }", "title": "" }, { "docid": "f3527f03a5bb6a5ca2309b3e6c0c6b86", "score": "0.5420764", "text": "function test_existanceManuel_gestion (item,suppression)\n { \n if (suppression!=1)\n {\n var mem = vm.allmanuel_gestion.filter(function(obj)\n {\n return obj.id == currentItemManuel_gestion.id;\n });\n if(mem[0])\n {\n if((mem[0].description != currentItemManuel_gestion.description )\n //||(mem[0].fichier != currentItemManuel_gestion.fichier )\n ||(mem[0].date_livraison != currentItemManuel_gestion.date_livraison )\n ||(mem[0].observation != currentItemManuel_gestion.observation )) \n { \n insert_in_baseManuel_gestion(item,suppression);\n }\n else\n { \n item.$selected = true;\n item.$edit = false;\n }\n }\n } else\n insert_in_baseManuel_gestion(item,suppression);\n }", "title": "" }, { "docid": "f3527f03a5bb6a5ca2309b3e6c0c6b86", "score": "0.5420764", "text": "function test_existanceManuel_gestion (item,suppression)\n { \n if (suppression!=1)\n {\n var mem = vm.allmanuel_gestion.filter(function(obj)\n {\n return obj.id == currentItemManuel_gestion.id;\n });\n if(mem[0])\n {\n if((mem[0].description != currentItemManuel_gestion.description )\n //||(mem[0].fichier != currentItemManuel_gestion.fichier )\n ||(mem[0].date_livraison != currentItemManuel_gestion.date_livraison )\n ||(mem[0].observation != currentItemManuel_gestion.observation )) \n { \n insert_in_baseManuel_gestion(item,suppression);\n }\n else\n { \n item.$selected = true;\n item.$edit = false;\n }\n }\n } else\n insert_in_baseManuel_gestion(item,suppression);\n }", "title": "" }, { "docid": "ecb8ee9b3a3ac5ca1eff6a49c417efac", "score": "0.54195863", "text": "function achatItem1Lvl3() {\n affichagePrixItem1Lvl3.innerHTML = \"OBTENU\";\n boutonItem1Lvl3.disabled = true;\n boutonItem1Lvl3.style.border = \"inherit\";\n clickRessource1 = 6;\n ressource2.innerHTML = ressource2.innerHTML - prix1Item1Lvl3;\n ressource3.innerHTML = ressource3.innerHTML - prix2Item1Lvl3;\n activationItemsShop();\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau3 = parseInt(ressource3.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem1lvl3Vide\").src= \"assets/img/lance3Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils3();\n }", "title": "" }, { "docid": "56529104c2911f10e905fba2f7fe2490", "score": "0.541696", "text": "function test_existancePv_consta_rubrique_phase_lat_mpe (item,suppression)\n{ \n if (suppression!=1)\n {\n var mem = vm.allpv_consta_rubrique_phase_lat_mpe.filter(function(obj)\n {\n return obj.id == currentItemPv_consta_rubrique_phase_lat_mpe.id;\n });\n if(mem[0])\n {\n if(mem[0].observation != currentItemPv_consta_rubrique_phase_lat_mpe.observation) \n { \n insert_in_basePv_consta_rubrique_phase_lat_mpe(item,suppression);\n }\n else\n { \n item.$selected = true;\n item.$edit = false;\n }\n }\n } else\n insert_in_basePv_consta_rubrique_phase_lat_mpe(item,suppression);\n}", "title": "" }, { "docid": "7d8b85555144628425d210723b98a5d2", "score": "0.5416644", "text": "function achatItem3Lvl3() {\n affichagePrixItem3Lvl3.innerHTML = \"OBTENU\";\n boutonItem3Lvl3.disabled = true;\n boutonItem3Lvl3.style.border = \"inherit\";\n clickRessource3 = 6;\n ressource2.innerHTML = ressource2.innerHTML - prix1Item3Lvl3;\n ressource3.innerHTML = ressource3.innerHTML - prix2Item3Lvl3;\n activationItemsShop();\n compteurRessourcePlateau2 = parseInt(ressource2.innerHTML);// mise a jour du compteurRessource\n compteurRessourcePlateau3 = parseInt(ressource3.innerHTML);// mise a jour du compteurRessource\n document.getElementById(\"imgitem3lvl3Vide\").src= \"assets/img/pioche3Obtenu.png\";\n parseInt(nbTotalOutils.innerHTML++);\n verificationOutils3();\n }", "title": "" }, { "docid": "522017e0c0f8cdead49cd75cafaee4cb", "score": "0.54145175", "text": "function test_existanceRapport_mensuel (item,suppression)\n { \n if (suppression!=1)\n {\n var mem = vm.allrapport_mensuel.filter(function(obj)\n {\n return obj.id == currentItemRapport_mensuel.id;\n });\n if(mem[0])\n {\n if((mem[0].description != currentItemRapport_mensuel.description )\n ||(mem[0].numero != currentItemRapport_mensuel.numero )\n ||(mem[0].date_livraison != currentItemRapport_mensuel.date_livraison )\n ||(mem[0].observation != currentItemRapport_mensuel.observation )) \n { \n insert_in_baseRapport_mensuel(item,suppression);\n }\n else\n { \n item.$selected = true;\n item.$edit = false;\n }\n }\n } else\n insert_in_baseRapport_mensuel(item,suppression);\n }", "title": "" }, { "docid": "522017e0c0f8cdead49cd75cafaee4cb", "score": "0.54145175", "text": "function test_existanceRapport_mensuel (item,suppression)\n { \n if (suppression!=1)\n {\n var mem = vm.allrapport_mensuel.filter(function(obj)\n {\n return obj.id == currentItemRapport_mensuel.id;\n });\n if(mem[0])\n {\n if((mem[0].description != currentItemRapport_mensuel.description )\n ||(mem[0].numero != currentItemRapport_mensuel.numero )\n ||(mem[0].date_livraison != currentItemRapport_mensuel.date_livraison )\n ||(mem[0].observation != currentItemRapport_mensuel.observation )) \n { \n insert_in_baseRapport_mensuel(item,suppression);\n }\n else\n { \n item.$selected = true;\n item.$edit = false;\n }\n }\n } else\n insert_in_baseRapport_mensuel(item,suppression);\n }", "title": "" }, { "docid": "46310db5ed7debfe3eb1b861f6723151", "score": "0.5414286", "text": "isDead(){\n return this.lives < 1;\n }", "title": "" }, { "docid": "b8a4301794f9548623543ea9edd04774", "score": "0.5412823", "text": "bestilt() {\n // Går gjennom varene og setter statusen på bestillingen til \"bestilt\" og varene til \"på lager\"\n for (var i = 0; i < this.varer.length; i++) {\n s_statuser.Bestilt(this.varer[i].v_id, this.b_id);\n }\n this.mounted();\n this.hent();\n }", "title": "" }, { "docid": "8dfcb7af017a76bb5dcddae36ef058ff", "score": "0.54116064", "text": "function comprueba_puestos() {\nvar cuantos = 0;\nvar elementos = document.getElementsByName(\"puesto\"); // Es un array con los checkbox de nombre puesto\nvar span_puestos= document.getElementById(\"span_puestos\");\n\n\tfor(i in elementos) {\n if (elementos[i].checked) cuantos++;\n\t }\n\n\tif (!cuantos) { // Es lo mismo que cuantos==0\n span_puestos.style.color=\"red\";\n span_puestos.innerHTML=\" Debe seleccionar un puesto de trabajo\";\n puestos=false;\n }\n\t \n else {\n span_puestos.innerHTML=\"\";\n\t puestos=true;\n }\n}", "title": "" }, { "docid": "815fee36e3f291fe3bc880935c277662", "score": "0.54096293", "text": "function checkgenus(){\r\n\r\n}", "title": "" }, { "docid": "215e1f88e29f327e38fed6b94cb805d0", "score": "0.5406015", "text": "function reunat(x, y) {\n if (x >= kentan_sivu || x < 0 || y >= kentan_sivu || y < 0) {\n alert(\"Osuit reunaan! Sait \" + pisteet + \" pistettä.\");\n return true;\n }\n}", "title": "" }, { "docid": "92eeffeb26d16f739e3c0e00ec8bac65", "score": "0.5405266", "text": "function finDuJeu() {\n clearInterval(Minuteur); //stopper le temps\n clearInterval(AjoutPoint); //stopper les points du canard a la fin des 120s\n canard.removeEventListener('click', ajoutPHunt);\n\n/********************************************Pour afficher les vainqueurs yeah********************************************/\n\nvar result = document.querySelector('.resultat');\nvar resultat = \"\";\n\nif (scoreCanard > scoreChasseur ) {\n resultat = \"THE WINNER IS DUCK !!!!!!\";\n}if (scoreCanard < scoreChasseur) {\n resultat = \"THE WINNER IS HUNT !!!!!!\";\n}if (scoreCanard == scoreChasseur) {\n resultat = \"égalité :(\";\n}\n\nresult.innerText = resultat;\n\n}", "title": "" }, { "docid": "32df53d466e9c008c3d0c045714c7d32", "score": "0.5402466", "text": "calculVitesseX(){\r\n //rajout de 1 facteur\r\n if (this.vitesseXFacteur < this.limiteFacteur){\r\n this.vitesseXFacteur +=1; // faire en fonction de la largeur du terrain\r\n }\r\n else {/*rien car la vitesse ne peux pas depasser la limite*/}\r\n }", "title": "" }, { "docid": "f4024c2480261b5d4986cf1a3a2be11c", "score": "0.5393369", "text": "function atkDuMonstre (monstre){\n cible();\n if (vieCible == vieGue){\n nomCible = \"au Guerrier\";\n }\n if (vieCible == viePre){\n nomCible = \"au Prêtre\";\n }\n if (vieCible == vieArc){\n nomCible = \"à l'Archer\";\n }\n if (vieCible == vieVol){\n nomCible = \"au Voleur\";\n }\n\tvieCible.value -= atkMonstre;\n\tvieCible.innerHTML = vieCible.value;\n\tdescription.innerHTML = monstre+\" inflige \"+atkMonstre+\" \"+nomCible;\n}", "title": "" }, { "docid": "149ef00697cd7e072af40d2ad5278e98", "score": "0.5391936", "text": "checkGameStatus(id){\n let totalCount = 0;\n let aceFlag = false;\n let itemIndex = 0;\n if(id == 'player'){\n this.checkPlayerStatus();\n } else {\n this.checkDealerStatus();\n }\n }", "title": "" }, { "docid": "5e1670b5fe62099e7f6a4bdd50b6c798", "score": "0.5383716", "text": "function siamoNellaPrimaSettimana() {\n return indiceSettimana == 0;\n }", "title": "" }, { "docid": "ea56d8a164fb1c42331658e67c38e473", "score": "0.5383486", "text": "function isTrue(v) {\n\n /*CREO MI PLANTILLA EN JAVASCRIPT */\n const alert_True = document.createElement('div');\n const p = document.createElement('p');\n const a = document.createElement('a');\n\n a.classList.add(\"continuartrue\");\n a.style.background = \"#2CB67D\"\n a.addEventListener(\"click\", link);\n a.innerText = \"Continuar\"\n p.innerText = \"¡Buen trabajo!\";\n\n alert_True.classList.add('alert', 'alert-success');\n alert_True.appendChild(p);\n alert_True.appendChild(a);/*AGREGO el nodo*/\n\n ver.innerHTML = \"\";/*para que el alert no se duplique*/\n ver.appendChild(alert_True);\n \n}", "title": "" }, { "docid": "e622886e70a0f84af27db689c0d89d8d", "score": "0.5381687", "text": "function haveFullGoldBonus() {\n return getGold() >= 150;\n}", "title": "" }, { "docid": "8cec2cc7a5115515d64a858d27e38e42", "score": "0.5378838", "text": "function afficherLegendeCarte() {\n if (couvertureQoS == \"couverture\") {\n if (carteCouverture == \"voix\") afficherLegendeCarteCouvVoix();\n else if (carteCouverture == \"data\") afficherLegendeCarteCouvData();\n } else if (couvertureQoS == \"QoS\") {\n actualiserMenuSelectionOperateurs();\n if (agglosTransports == \"transports\") afficherLegendeCarteQoSTransport();\n else if(agglosTransports == 'agglos') afficherLegendeCarteQoSAgglos();\n else if(driveCrowd == \"crowd\") afficherLegendeCarteQoSAgglos();\n }\n}", "title": "" }, { "docid": "0f69b7f1447ec8a7f1f23d96688c2d33", "score": "0.5377218", "text": "function gallEmptyCheck(){\n if($('.galleryWrapper > div.galleryItemActive').length != 0){\n emptyGallMessageOff();\n }else{\n emptyGallMessageActive();\n }\n}", "title": "" }, { "docid": "bbe6bd2fe1aba178f2edb856f0e543d5", "score": "0.537685", "text": "contaGoleiro(){\n let contador = 0;\n\n sorteio.selectJogadoresConfirmados().filter(function(e){\n if(e.goleiro){\n contador++;\n }\n });\n\n return contador;\n }", "title": "" }, { "docid": "f58fee58bdf163073994d75613ca3c5c", "score": "0.5375415", "text": "function afficherResultats(verifTableau) {\r\n // Méthode filter() va créer un nouveau tableau avec les el triés\r\n // el = élément (couramment utilisé)\r\n // fonction callback type array qui filtre chaque el différents de la valeur true\r\n // .length pour avoir la longueur du tableau ET l'affichage du nbre de fautes\r\n const nbDeFautes = verifTableau.filter((el) => el !== true).length;\r\n // console.log(nbDeFautes);\r\n titreResultat.textContent = \"\";\r\n\r\n switch (nbDeFautes) {\r\n case 0:\r\n titreResultat.textContent = `${emojis[0]} Bravo, c\"est un sans faute ! ${emojis[0]}`;\r\n sideResultat.textContent =\r\n \"Retentez une autre réponse dans les cases rouges, puis re-validez !\";\r\n texteResultat.textContent = `5/5`;\r\n break;\r\n case 1:\r\n titreResultat.textContent = `${emojis[1]} Vous y êtes presque ! ${emojis[1]}`;\r\n sideResultat.textContent =\r\n \"Retentez une autre réponse dans les cases rouges, puis re-validez !\";\r\n texteResultat.textContent = `4/5`;\r\n break;\r\n case 2:\r\n titreResultat.textContent = `${emojis[1]} Encore un effort ... ${emojis[2]}`;\r\n sideResultat.textContent =\r\n \"Retentez une autre réponse dans les cases rouges, puis re-validez !\";\r\n texteResultat.textContent = `3/5`;\r\n break;\r\n case 3:\r\n titreResultat.textContent = `${emojis[2]} Il reste quelques erreurs. ${emojis[3]}`;\r\n sideResultat.textContent =\r\n \"Retentez une autre réponse dans les cases rouges, puis re-validez !\";\r\n texteResultat.textContent = `2/5`;\r\n break;\r\n case 4:\r\n titreResultat.textContent = `${emojis[3]} Peux mieux faire. ${emojis[3]}`;\r\n sideResultat.textContent =\r\n \"Retentez une autre réponse dans les cases rouges, puis re-validez !\";\r\n texteResultat.textContent = `1/5`;\r\n break;\r\n case 5:\r\n titreResultat.textContent = `${emojis[4]} Peux mieux faire. ${emojis[4]}`;\r\n texteResultat.textContent = `0/5`;\r\n break;\r\n }\r\n}", "title": "" } ]
f305b5e5a74d9037ad4393ac1817ec8d
To do: Maybe spawn all solids at start and split prethings into solids and characters?
[ { "docid": "3b3fdf96a8cc6283e22f456774b82869", "score": "0.5524063", "text": "function spawnMap() {\n var arr = map.areas[map.areanum].prethings; // For ease of use\n // Instead of screen.right + quads.width, use rightmost quad col - most recently added\n while(arr.length > map.current && screen.right + quads.rightdiff >= arr[map.current].xloc * unitsize) {\n if(arr[map.current].object.placed) continue;\n addThing(arr[map.current].object,\n arr[map.current].xloc * unitsize - screen.left, arr[map.current].yloc * unitsize);\n ++map.areas[map.areanum].current;\n ++map.current; // equals above?\n }\n}", "title": "" } ]
[ { "docid": "083bb274ff4989f4f3831b5309083388", "score": "0.5847496", "text": "function spawnTurtle(){\n\t/* Only allow if the player has enough coins */\n\t/* Duplicate the flingpiece material for each added flingpiece, allowing each one to change their emissive values seperately */\n\tvar newMaterials = [];\n\tfor(var i = 0; i < turtle_materials.length; i++){\n\t\tnewMaterials.push( turtle_materials[i].clone() );\n\t}\n\tvar newPiece = new THREE.Mesh(turtle_mesh.geometry, new THREE.MeshFaceMaterial( newMaterials ) );\n\t\n\tvar randomSpawnZ = Math.floor((Math.random()*150)-150);\n\tnewPiece.position.set(200,0,randomSpawnZ);\n\tnewPiece.scale.set(0.4,0.4,0.4);\n\tnewPiece.rotation.y=Math.PI/2;\n\tmainScene.add( newPiece );\n\t\n\t/* Add a new variable to the mesh itself - its position in the climber array */\n\tnewPiece.climberArrayPosition = climberArray.length;\n\tnewPiece.state = 0;\n\tclimberArray.push(new Climber(newPiece));\n\tclimberMeshArray.push(newPiece);\n\t\n\tturtle_animate(newPiece);\n}", "title": "" }, { "docid": "fb924f7883c0b223d96ec4e7665eaf2a", "score": "0.5798641", "text": "generateParticules()\n {\n for(let color of this.colors)\n {\n const currentParticulesContainer = new THREE.Geometry()\n\n for(let i = 0; i < this.factor * this.minHeight * this.width * this.depth; i++)\n {\n const point = new THREE.Vector3()\n \n point.x = (Math.random() - 0.5) * this.width\n point.z = (Math.random() - 0.5) * this.depth\n \n point.y = Math.random() * this.minHeight\n \n currentParticulesContainer.vertices.push(point)\n }\n\n const particules = new THREE.Points(\n currentParticulesContainer,\n new THREE.PointsMaterial({size: 0.1, color: new THREE.Color(color)})\n )\n particules.name = 'particules-container'\n this.threeObject.add(particules)\n }\n }", "title": "" }, { "docid": "c1967e5136f140a524646182c73c2e91", "score": "0.57726115", "text": "assembleNewSnake() {\r\n this.pieces.push(\r\n new Head(this.startPosition.x, this.startPosition.y, null)\r\n );\r\n for (let i = 1; i <= this.startPosition.bodyLength; i++) {\r\n this.pieces.push(\r\n new Body((this.startPosition.x - i), this.startPosition.y, null)\r\n );\r\n }\r\n }", "title": "" }, { "docid": "4818eb44ca7c62e87d4d0539e44ad662", "score": "0.5738096", "text": "spawnStartingUnits() {\n // Spawn starting units\n for (const unitObj of this._startUnits) {\n this.spawnUnit(unitObj.unit, unitObj.x, unitObj.y);\n }\n\n // Create starting structures\n for (const structObj of this._startStructs) {\n var struct = structObj.struct;\n this.createStructure(structObj.x, structObj.y, struct.image, struct.groundMoveCost, struct.flightMoveCost,\n struct.groundDefense, struct.structureHP, structObj.faction, struct.isClaimable, structObj.units, structObj.cooldown);\n }\n }", "title": "" }, { "docid": "b363bc17b67f2fb21a735fdf5811d540", "score": "0.5724386", "text": "function createSplitter(numSplitters){\r\n for(let j = 0; j < numSplitters;j++){\r\n let s = new SplitterSphere(25,0xFF00fff);\r\n s.interactive = true;\r\n s.on(\"pointerdown\", killSplitter);\r\n s.x = Math.random() * (sceneWidth -50 ) + 25;\r\n s.y = Math.random() * (sceneWidth - 400) + 25;\r\n splitters.push(s);\r\n gameScene.addChild(s);\r\n }\r\n}", "title": "" }, { "docid": "a0ef3b1b285ff5e3e760c4d2eeb7756a", "score": "0.5724263", "text": "function buildPalaces(){\n\tvar buildingMesh = createBaseBuilding(true);\n\tvar cityGeometry = new THREE.Geometry();\n for( var blockZ = 0; blockZ < nBlockZ; blockZ++){\n\t\tfor( var blockX = 0; blockX < nBlockX; blockX++){\n\t\t\tfor( var n = 0; n < blockDensity; n++){\n\t\t\t\t// set position\n\t\t\t\tbuildingMesh.position.x = (Math.random()-0.5)*(blockSizeX-buildingMaxW-roadW-1.5*sidewalkW);\n\t\t\t\tbuildingMesh.position.z = (Math.random()-0.5)*(blockSizeZ-buildingMaxD-roadD-1.5*sidewalkD);\n\n\t\t\t\t// add position for the blocks\n\t\t\t\tbuildingMesh.position.x += (blockX+0.5-nBlockX/2)*blockSizeX;\n\t\t\t\tbuildingMesh.position.z += (blockZ+0.5-nBlockZ/2)*blockSizeZ;\n\n\t\t\t\t// put a random scale\n\t\t\t\tbuildingMesh.scale.x = Math.min(Math.random() * 5 + 10, buildingMaxW);\n\t\t\t\tbuildingMesh.scale.y = (Math.random() * Math.random() * buildingMesh.scale.x) * 3 + 4;\n\t\t\t\tbuildingMesh.scale.z = Math.min(buildingMesh.scale.x, buildingMaxD)\n\n\t\t\t\t // Create sidewalkBody\n\t\t var buildingMaterial = new CANNON.Material();\n\t\t\t\tvar buildingShape = new CANNON.Box(new CANNON.Vec3(buildingMesh.scale.x/2, buildingMesh.scale.y, buildingMesh.scale.z/2));\n\t\t\t\tvar buildingBody = new CANNON.Body( {mass: 0, material: buildingMaterial} );\n\t\t\t\tbuildingBody.addShape(buildingShape);\n\t\t\t\tbuildingBody.position.set(buildingMesh.position.x, buildingMesh.position.y, buildingMesh.position.z);\n\t\t\t\tworld.add(buildingBody);\n\n\t\t\t\t// merge it with cityGeometry - very important for performance\n\t\t\t\tbuildingMesh.updateMatrix();\n\t\t\t\tcityGeometry.merge( buildingMesh.geometry, buildingMesh.matrix );\n\t\t\t\tcityGeometry.castShadow = true;\n\t\t\t\tcityGeometry.receiveShadow = true;\n\t\t\t}\n\t\t}\n }\n\n\tvar texture = new THREE.TextureLoader().load( \"./images/textures/windows.jpg\" )\n\n // build the city Mesh\n var material = new THREE.MeshLambertMaterial({\n \t//color : 0x00ff00,\n \tmap : texture,\n \tvertexColors : THREE.VertexColors\n });\n var cityMesh = new THREE.Mesh( cityGeometry, material );\n return cityMesh;\n}", "title": "" }, { "docid": "cf69c4622dea45822e1378aad40f83ab", "score": "0.56362045", "text": "function gameSingleFrame() {\n\n\n for (let [k, c] of characters){\n //update all clients of all players\n io.emit(\"update stats\", c.id, c.score, c.life);\n c.sendPositionUpdate(io);\n containCharacterInMap(c);\n c.checkDie(sendDeathToClient);\n\n for (var i = 0; i < holes.length; i ++) {\n const collidedWithUser = holes[i].checkCollisionWithUser(c);\n if (collidedWithUser) {\n sendDeathToClient(c);\n }\n }\n\n }\n\n\n //update all clients of all shockwaves\n for (let [ks, a] of shockwaves) {\n //ks is a shockwave list's key (ID)\n //a is a list of shockwaves with the same ID\n for (var i = 0; i < a.length; i++) {\n //loop through shockwaves in the list\n\n //s = individual shockwave\n var s = a[i];\n s.move();\n for (var j = 0; j < holes.length; j++) {\n shockwaveHoleCollide(s, holes[j]);\n }\n\n //dealing with collisions with characters, not yet implemented\n for (let [kc, c] of characters) {\n //kc = character's\n //c = individual character\n s.collision(c);\n }\n\n s.updateOnClient(io);\n\n\n //check whether to kill the current shockwave\n if (s.checkDie()) {\n s.killOnClient(io);\n a.splice(i, 1);\n i--;\n }\n }\n\n }\n\n\n\n\n}", "title": "" }, { "docid": "38beb8917cfe044e849db97686d5e4cc", "score": "0.5628074", "text": "function SoldierSpawn () {\n\n\tfor (var i = 0; i < 5000; i++) {\n\t\t\n\t\tInstantiate(poly,\n\t\t\tVector3(Random.Range(120,200),0.25,Random.Range(150,200)),rotation);\n\t\tyield WaitForSeconds (Random.Range(0.5, 1));\n\t\tInstantiate(poly2,\n\t\t\tVector3(Random.Range(120,200),0.25,Random.Range(150,200)),rotation);\n\t\tyield WaitForSeconds (Random.Range(0.5, 1));\n\t\ti++;\n\t}\n}", "title": "" }, { "docid": "ae09a4fcba2d80181ee529a1efbb3a1d", "score": "0.56161135", "text": "InitSpawns(){\n // #region spawnAreas\n var spawnTrunkRight = function(){\n this.cols[this.cols.length] = this.physics.add.sprite(this.rand(this.width/5.12, this.width/3.20, this.seed),0,'tronco' ).body.setGravityY(this.nullGravity).setVelocityY(this.trunksVelocity);\n this.cols.length++;\n }\n\n var spawnTrunkLeft = function(){\n this.cols[this.cols.length] = this.physics.add.sprite(this.rand(this.width/1.8, this.width/1.24, this.seed),0,'tronco').body.setGravityY(this.nullGravity).setVelocityY(this.trunksVelocity);\n this.cols.length++;\n }\n\n var spawnTrunkMiddle = function(){\n this.cols[this.cols.length] = this.physics.add.sprite(this.rand(this.width/3, this.width/2,this.seed),0,'tronco').body.setGravityY(this.nullGravity).setVelocityY(this.trunksVelocity);\n\n this.cols.length++;\n }\n // #endregion\n\n // Contador para el spawner de troncos\n this.TrunkGeneratorRight = this.scene.get(\"onlinegame\").time.addEvent({delay: this.rand(this.minTrunkTimer - 400, this.maxTrunkTimer, this.seed), callback: spawnTrunkRight, callbackScope:this, loop:true});\n this.TrunkGeneratorLeft = this.scene.get(\"onlinegame\").time.addEvent({delay: this.rand(this.minTrunkTimer - 400, this.maxTrunkTimer, this.seed), callback: spawnTrunkLeft, callbackScope:this, loop:true});\n this.TrunkGeneratorMiddle = this.scene.get(\"onlinegame\").time.addEvent({delay: this.rand(this.minTrunkTimer, this.maxTrunkTimer, this.seed), callback: spawnTrunkMiddle, callbackScope:this, loop:true});\n }", "title": "" }, { "docid": "93c253425497aa4aad889fcd04a11033", "score": "0.5600471", "text": "function generateWorld() {\r\n //loop through all tiles\r\n for (var i = 0; i < 25; i++) {\r\n for (var j = 0; j < 21; j++) {\r\n\r\n //place grass on all tiles\r\n grassType = Crafty.math.randomInt(1, 4);\r\n Crafty.e(\"2D, Canvas, grass\" + grassType)\r\n .attr({ x: i * 16, y: j * 16, z:1 });\r\n \r\n //create a fence of bushes\r\n if(i === 0 || i === 24 || j === 0 || j === 20)\r\n Crafty.e(\"2D, Canvas, solid, bush\" + Crafty.math.randomInt(1, 2))\r\n .attr({ x: i * 16, y: j * 16, z: 2 });\r\n \r\n //generate some nice flowers within the boundaries of the outer bushes\r\n if (i > 0 && i < 24 && j > 0 && j < 20\r\n && Crafty.math.randomInt(0, 50) > 30\r\n && !(i === 1 && j >= 16)\r\n && !(i === 23 && j <= 4)) {\r\n Crafty.e(\"2D, Canvas, flower, SpriteAnimation\")\r\n .attr({ x: i * 16, y: j * 16, z: 1000 })\r\n .animate(\"wind\", 0, 1, 3 )\r\n .animate('wind', 80, -1);\r\n }\r\n \r\n //grid of bushes\r\n if((i % 2 === 0) && (j % 2 === 0)) {\r\n Crafty.e(\"2D, Canvas, solid, bush1\")\r\n .attr({x: i * 16, y: j * 16, z: 2000})\r\n }\r\n }\r\n }\r\n \r\n Crafty.c(\"LeftControls\", {\r\n init: function() {\r\n this.requires('Multiway');\r\n },\r\n \r\n leftControls: function(speed) {\r\n this.multiway(speed, {W: -90, S: 90, D: 0, A: 180})\r\n return this;\r\n }\r\n \r\n });\r\n \r\n Crafty.c('Ape', {\r\n Ape: function() {\r\n //setup animations\r\n this.requires(\"SpriteAnimation, Collision, Grid\")\r\n .animate(\"walk_left\", 6, 3, 8)\r\n .animate(\"walk_right\", 9, 3, 11)\r\n .animate(\"walk_up\", 3, 3, 5)\r\n .animate(\"walk_down\", 0, 3, 2)\r\n //change direction when a direction change event is received\r\n .bind(\"NewDirection\",\r\n function (direction) {\r\n if (direction.x < 0) {\r\n if (!this.isPlaying(\"walk_left\"))\r\n this.stop().animate(\"walk_left\", 10, -1);\r\n }\r\n if (direction.x > 0) {\r\n if (!this.isPlaying(\"walk_right\"))\r\n this.stop().animate(\"walk_right\", 10, -1);\r\n }\r\n if (direction.y < 0) {\r\n if (!this.isPlaying(\"walk_up\"))\r\n this.stop().animate(\"walk_up\", 10, -1);\r\n }\r\n if (direction.y > 0) {\r\n if (!this.isPlaying(\"walk_down\"))\r\n this.stop().animate(\"walk_down\", 10, -1);\r\n }\r\n if(!direction.x && !direction.y) {\r\n this.stop();\r\n }\r\n })\r\n .bind('Moved', function(from) {\r\n if(this.hit('solid')){\r\n this.attr({x: from.x, y:from.y});\r\n }\r\n });\r\n \r\n return this;\r\n }\r\n });\r\n}", "title": "" }, { "docid": "23b30fba1355ead7818677266738ffd8", "score": "0.55789685", "text": "function createStartLines() {\n posZ = positionZInit - 20;\n for (let i = 0; i < 2500; i++) {\n roads[i] = new THREE.Mesh(new THREE.PlaneGeometry(60, 20), new THREE.MeshPhongMaterial({ color: 0x3E0E4C, side: THREE.DoubleSide }));\n roads[i].rotation.x = -Math.PI / 2;\n roads[i].position.y = -4;\n\n roads[i].position.z = posZ;\n\n posZ = posZ - 30;\n\n group.add(roads[i]);\n }\n}", "title": "" }, { "docid": "a673d08432c81f544d152185771633b7", "score": "0.5567986", "text": "function generate_pipes() {\r\n var gap_start = game.rnd.integerInRange(gap_margin, game_height - gap_size - gap_margin);\r\n\r\n var y;\r\n\r\n for(y = gap_start - pipe_end_size; y > 0; y -= pipe_size) {\r\n add_pipe_part(game_width, y - pipe_size, 'pipe-body');\r\n }\r\n for(y = gap_start + gap_size + pipe_end_size; y < game_height; y += pipe_size){\r\n add_pipe_part(game_width, y, 'pipe-body');\r\n }\r\n add_pipe_part(game_width - (pipeEndExtraWidth/2), gap_start - pipe_end_size, 'pipe-end');\r\n add_pipe_part(game_width - (pipeEndExtraWidth/2), gap_start + gap_size, 'pipe-end');\r\n\r\n change_score();\r\n}", "title": "" }, { "docid": "541d4d8fd7449390678bac259d437ac0", "score": "0.5559881", "text": "function makeGeometry() {\n // begin level generation section\n\n // generates random number of shapes between 3 and 10\n const rand = Math.ceil(Math.random() * 7) + 2;\n\n genShapes = [];\n encodedShapes = [];\n\n let shapeCenters = [];\n\n for (let i = 0; i < rand; i++) {\n const color = colorCodes[Math.floor(Math.random() * 3)];\n const lineColor = colorCodes[Math.floor(Math.random() * 3)];\n\n let randX;\n let randY;\n let shape;\n let rot;\n let prop;\n let randShapeNum;\n let center;\n\n let contin = false;\n\n while (!contin) {\n randShapeNum = Math.floor(Math.random() * 10);\n\n randX = (Math.random() * (SCREEN_WIDTH - 200 * SIZE_FACTOR)\n + 100 * SIZE_FACTOR);\n randY = (Math.random() * (SCREEN_HEIGHT - 585 * SIZE_FACTOR)\n + 250 * SIZE_FACTOR);\n\n shape;\n prop = {};\n rot;\n\n center = [NaN, NaN];\n\n // NOTE - all rotations are around the center of Matter object\n switch (randShapeNum) {\n\n // 0 for square\n case 0:\n const side = (Math.random() * (100 - BALL_RADIUS))\n * SIZE_FACTOR + BALL_RADIUS;\n prop = {\n length: side\n };\n shape = Bodies.rectangle(\n randX,\n randY,\n side,\n side,\n { isStatic: true }\n );\n // valid rotations are between 10 and 80 degrees\n rot = (Math.random() * 1.22 + 0.17) * Math.PI;\n\n // find center of shape and add it to shapeCenters\n center[0] = randX + side / 2;\n center[1] = randY + side / 2;\n break;\n\n // 1 for circle\n case 1:\n const radius = (Math.random() * (100 - BALL_RADIUS))\n * SIZE_FACTOR + BALL_RADIUS;\n prop = {\n radius: radius\n };\n shape = Bodies.circle(\n randX,\n randY,\n radius,\n { isStatic: true }\n );\n rot = 0;\n\n // find center of shape and add it to shapeCenters\n center[0] = randX + radius;\n center[1] = randY + radius;\n break;\n\n // 2 for isoceles triangle\n // 3 for right triangle\n case 2:\n case 3:\n const slope = randShapeNum - 1,\n base = (Math.random() * (200 - BALL_RADIUS))\n * SIZE_FACTOR + BALL_RADIUS,\n triHeight = (Math.random() * (200 - BALL_RADIUS))\n * SIZE_FACTOR + BALL_RADIUS;\n prop = {\n slope,\n width: base,\n height: triHeight\n }\n shape = Bodies.trapezoid(\n randX,\n randY,\n base,\n triHeight,\n slope,\n { isStatic: true }\n );\n rot = Math.random() * 2 * Math.PI;\n\n // find center of shape and add it to shapeCenters\n if (rot % Math.PI < Math.PI / 4\n || rot % Math.PI > 3 * Math.PI / 4) {\n center[0] = randX + base / 2;\n center[1] = randY + triHeight / 2;\n }\n else {\n center[0] = randX + triHeight / 2;\n center[1] = randY + base / 2;\n }\n break;\n\n // default should never trigger. added here for contingency\n default:\n console.log('this should not trigger');\n console.log(randShapeNum);\n\n // 4-7 for rectangle\n case 4:\n case 5:\n case 6:\n case 7:\n case 8:\n case 9:\n const width = (Math.random() * (200 - BALL_RADIUS))\n * SIZE_FACTOR + BALL_RADIUS,\n height = width / (Math.ceil((Math.random() * 5)) + 1);\n prop = {\n width,\n height\n };\n shape = Bodies.rectangle(randX, randY, width, height, {\n isStatic: true\n });\n /* \n * valid rotations are between -45 and -10 degrees \n * and 10 and 45 degrees\n * multiply decimals and pi to make rough radian amounts\n * 50% chance of positive or negative rotation \n */\n rot = Math.pow(-1, Math.floor(Math.random() * 2))\n * (Math.random() * 0.61 + 0.17);\n\n // find center of shape and add it to shapeCenters\n center[0] = randX + width / 2;\n center[1] = randY + height / 2;\n }\n\n // use this to determine if a shape should be placed\n contin = placeShape(center, shapeCenters);\n }\n\n shapeCenters.push(center);\n\n shape.collisionFilter.mask = -1;\n shape.friction = 0.05;\n shape.render.lineWidth = 10;\n\n shape.render.fillStyle = color;\n shape.render.strokeStyle = lineColor;\n\n Body.rotate(shape, rot);\n genShapes[i] = shape;\n\n const encodeShape = {\n xpos: randX,\n ypos: randY,\n shapeType: randShapeNum,\n rotation: rot,\n properties: prop,\n color,\n lineColor\n };\n encodedShapes[i] = encodeShape;\n\n }\n encodedShapes.forEach((eShape, i) => applyRules(eShape, i));\n}", "title": "" }, { "docid": "2de78724c90b983a640377c83ccb768d", "score": "0.5557059", "text": "function generateEnts() {\n\t\t// Player init\n\t\tplayer = Crafty.e(\"Player\");\n\t\t// Hearts init\n\t\tfor(var i = 1; i <= player.hp.max; i++){\n\t\t\tvar xPos = 480 - (i * 34);\n\t\t\thearts[i-1] = Crafty.e(\"2D, DOM, eheart, fullheart, SpriteAnimation, Heart\")\n\t\t\t\t\t\t.attr({ x: xPos, y: 3, z: 4 });\n\t\t}\n\t\t// Grass and border init\n\t\tfor(var i = 0; i < 600; i++) {\t\n \t\t\tgrassy[i] = Crafty.e(\"2D, DOM, grass\" + Crafty.math.randomInt(1, 4));\n\t\t\t\t\n\t\t\t\tif(i < 95)\n\t\t\t\t\tbushy[i] = Crafty.e(\"2D, DOM, solid, bush\" + Crafty.math.randomInt(1, 2));\n\t\t}\n\t\t\n\t\tCrafty.e(\"2D, DOM, blocktree, SpriteAnimation, Collision, solid\")\n\t\t\t\t.attr({x:150, y:290, z:2})\n\t\t\t\t.collision(new Crafty.polygon([0,7],[0,32],\n\t\t\t\t\t\t\t\t\t [32,32],[32,7]))\n\t\t\t\t.onHit('SwordAttack', function() {\n\t\t\t\t\t$('#gamepanel > span').text(\"A giant downed tree blocks this path..a sword won't work. Maybe something else will?\").hide().fadeIn('slow');\n\t\t\t\t})\n\t\t\t\t.onHit(\"MagicAttack\", function(){\n\t\t\t\t\tthis.destroy();\n\t\t\t\t}); \n\t}", "title": "" }, { "docid": "e9b3cfb1d2b8e3ca0e2f72eef996c57b", "score": "0.55345184", "text": "function initParts() {\n for (i = 0; i < maxParts; i++) {\n rpx = Math.random() * canvas.width;\n rpy = Math.random() * canvas.height;\n rvx = Math.random() * 2 - 1;\n rvy = Math.random() * 2 - 1;\n\n part.push({ x: rpx, y: rpy, vx: rvx, vy: rvy });\n }\n}", "title": "" }, { "docid": "f5e2e812f30e7f91b720ab41857dfce5", "score": "0.5513401", "text": "makeInitialPlayerHand() {\n for (let i = 0; i < this.handOfPlayer.length; i++) {\n let element = document.createElement('div');\n element.classList.add('slot');\n\n if (this.handOfPlayer[i] !== null) {\n element.appendChild(this.handOfPlayer[i].render());\n }\n\n this.handElement.appendChild(element);\n }\n }", "title": "" }, { "docid": "852f4c6213e07bebba613434c64a732b", "score": "0.55108666", "text": "renderChunks(chunks) {\r\n // filter out underground or already loaded chunks\r\n chunks = chunks.filter(c => c.z >=0 && !c.loaded);\r\n\r\n // pre-emptively count number of blocks in the chunks to load\r\n // also convert the blocks in memory into bricks\r\n const brickCount = chunks.reduce((n, chunk) => {\r\n for (let i = 0; i < chunk.blocks.length; i++) {\r\n const block = chunk.blocks[i];\r\n if (block) {\r\n n ++; // increase brick count\r\n // replace old brick with new block\r\n if (typeof block.asset_name_index === 'undefined')\r\n chunk.blocks[i] = {\r\n asset_name_index: block.tile ? 0 : 1,\r\n size: [this.blockSize / 2, this.blockSize / 2, this.blockSize / 2],\r\n position: [\r\n Math.round(this.blockSize/2 + this.blockSize * (block.x + this.chunkSize * chunk.x)),\r\n Math.round(this.blockSize/2 + this.blockSize * (block.y + this.chunkSize * chunk.y)),\r\n Math.round(this.blockSize/2 + this.blockSize * (block.z + this.chunkSize * chunk.z)),\r\n ],\r\n color: linearRGB(block.color || [255, 255, 255, 255]),\r\n rotation: 0,\r\n visibility: true,\r\n collision: true,\r\n direction: 4,\r\n };\r\n }\r\n }\r\n return n;\r\n }, 0);\r\n\r\n // memory allocation is slower than iterating so rather than using .flatMap.filter.map/etc\r\n // it is faster to loop twice and allocate once\r\n const bricks = Array(brickCount);\r\n\r\n // assign all the bricks to their positions in the brick array\r\n let i = 0;\r\n for (const chunk of chunks) {\r\n for (const brick of chunk.blocks) {\r\n if (brick) bricks[i++] = brick;\r\n }\r\n chunk.loaded = true;\r\n }\r\n\r\n // return save data\r\n return {\r\n author,\r\n description: 'generate test',\r\n brick_owners: [author],\r\n brick_assets: ['PB_DefaultTile', 'PB_DefaultBrick', ...this.assets],\r\n bricks,\r\n };\r\n }", "title": "" }, { "docid": "32212f5977bfd650fc8c23aad1981813", "score": "0.5505387", "text": "function spawnPart() {\n\n\t\t//There is only a chance that this will happen.\n\t\tif(Math.random() > spawnChance) return false;\n\n\t\tvar x = Math.floor(Math.random() * (window.innerWidth/baseDimension)) * baseDimension;\n\t\tvar y = Math.floor(Math.random() * (window.innerHeight/baseDimension)) * baseDimension;\n\n\t\tvar elm = new Element('part', x, y, snakePartColor);\n\t\telements.push(elm);\n\t}", "title": "" }, { "docid": "56d38f20e2eca5ba45321662fac852de", "score": "0.5486931", "text": "function spawnBlock() {\n /* \n Generate a random number for the length and width of the polystyrene\n blocks. A value of 10 is added to the number to ensure the blocks are large\n enough to click easily\n */\n let randomWidthValue = Math.floor((Math.random() * 20) + 10);\n let randomLengthValue = Math.floor((Math.random() * 45) + 10);\n\n /*\n Generate a random number for the x-axis coordinate in which the block\n will be created\n */\n let randomXCord = Math.floor((Math.random() * 100) + 450);\n\n /*\n The image overlay of the polystyrene blocks needs to be scaled down to\n the size of the block created, the ratio is 1:1000\n */\n let xAxisimgcaleValue = randomWidthValue / 1000;\n let yAxisimgcaleValue = randomLengthValue / 1000;\n\n polystyreneBox = Bodies.rectangle(randomXCord, 20, randomWidthValue,\n randomLengthValue, {\n isStatic: false,\n density: 0.1,\n restitution: 0,\n friction: 0.1,\n frictionAir: 0.01,\n frictionStatic: 0.5,\n\n render: {\n sprite: {\n texture: \"assets/img/polystyrene.png\",\n xScale: xAxisimgcaleValue,\n yScale: yAxisimgcaleValue\n }\n },\n\n collisionFilter: {\n group: 0,\n category: 1,\n mask: 255\n },\n });\n\n // Re-add necessary components to give 3D effect\n World.add(engine.world, [\n polystyreneBox, blackRectangle, compactorForeground, greenPipe, brick2,\n brick3, brick4, brick5\n ]);\n\n World.remove(engine.world, [greenPipe, brick2, brick3, brick4, brick5]);\n\n polystyreneBoxes.push(polystyreneBox);}", "title": "" }, { "docid": "b8bcb1827d1b718854e5aa6161a0de26", "score": "0.54502994", "text": "function drawMiniaturizedCharacter() {\n // Create a new div and store it in a variable\n let $characterContainer = document.createElement(\"DIV\");\n // Clone the final body parts, append them to the new div and store the clones in variables\n let $miniLeg = $(finalLeg).clone(false).appendTo($characterContainer);\n let $miniBody = $(finalBody).clone(false).appendTo($characterContainer);\n let $miniHead = $(finalHead).clone(false).appendTo($characterContainer);\n // Remove the classes from the clones\n $($miniLeg).removeClass();\n $($miniBody).removeClass();\n $($miniHead).removeClass();\n // And insert the new div at the beginning of the one with the id \"results\"\n $($characterContainer).prependTo('#results');\n}", "title": "" }, { "docid": "d7cdeefea60a674d8be4bfe3403dbf5d", "score": "0.5427233", "text": "constructor(gameObjects, currentgameObjects, game) {\n this.rotatable = true;\n this.problem = false;\n this.game = game;\n this.orientation = 1;\n let apositions = [];\n apositions = choosePeice();\n this.name = apositions[4];\n Shapes.createBlock(\n gameObjects,\n currentgameObjects,\n game,\n apositions[0],\n apositions[4]\n );\n Shapes.createBlock(\n gameObjects,\n currentgameObjects,\n game,\n apositions[1],\n apositions[4]\n );\n Shapes.createBlock(\n gameObjects,\n currentgameObjects,\n game,\n apositions[2],\n apositions[4]\n );\n Shapes.createBlock(\n gameObjects,\n currentgameObjects,\n game,\n apositions[3],\n apositions[4]\n );\n this.inputer = new InputHandler(\n currentgameObjects[0],\n currentgameObjects[1],\n currentgameObjects[2],\n currentgameObjects[3],\n this\n );\n }", "title": "" }, { "docid": "8c48c8b6691899c6e14f7ae094719de0", "score": "0.542131", "text": "function setup() {\r\n createCanvas(1600, 900);\r\n background(0);\r\n fill(255);\r\n character1 = new Character(result[0], int(result[1]), int(result[2]), int(result[3]), int(result[4]));\r\n character1.load();\r\n character2 = new Character(result[5], int(result[6]), int(result[7]), int(result[8]), int(result[9]));\r\n character2.load();\r\n finishLine = new Obstacle(objResult[0], int(objResult[1]), int(objResult[2]), int(objResult[3]), int(objResult[4]));\r\n finishLine.load();\r\n chainChomp = new Obstacle(objResult[5], int(objResult[6]), int(objResult[7]), int(objResult[8]), int(objResult[9]));\r\n chainChomp.load();\r\n chainChomp2 = new Obstacle(objResult[5], int(objResult[11]), int(objResult[12]), int(objResult[8]), int(objResult[9]));\r\n chainChomp2.load();\r\n chainChomp3 = new Obstacle(objResult[5], int(objResult[14]), int(objResult[15]), int(objResult[8]), int(objResult[9]));\r\n chainChomp3.load();\r\n \r\n //console.log(result.length);\r\n /* for(var i = 0; i < result.length; i++)\r\n {\r\n // console.log(result[i]);\r\n var moreStuff = split(result[i], \",\");\r\n for(var j = 0; j < moreStuff.length; j++)\r\n {\r\n \r\n totalText.push(moreStuff[j]);\r\n }\r\n \r\n }*/\r\n}", "title": "" }, { "docid": "d48f18bfe476afd0b85211c6e3209262", "score": "0.54076636", "text": "start() {\n const randomSpawnCount = Math.floor(_random(2, 5.99));\n\n for (let i = 1; i <= randomSpawnCount; i++) {\n // spawn 2-5 departures to start with\n this.spawnAircraft(false);\n }\n\n this.initiateSpawningLoop();\n }", "title": "" }, { "docid": "aacc782ecf0e113eececba12630b8781", "score": "0.54018265", "text": "function generateEntities() {\n for (let i = 0; i < players.getMaxPlayers(); i++) {\n //Create ten cubes\n cubeArray.push(cube = new THREE.Mesh(cGeometry, cMaterial));\n }\n}", "title": "" }, { "docid": "8c4c53d11825865732081d39659c3575", "score": "0.53949296", "text": "_addSpritesForPart(part) {\n for (let layer of this._containers.keys()) {\n const sprite = part.getSpriteForLayer(layer);\n if (!sprite)\n continue;\n // in non-schematic mode, add balls behind other parts to prevent ball \n // highlights from displaying on top of gears, etc.\n if ((part instanceof ball_4.Ball) && (layer < 4 /* SCHEMATIC */)) {\n this._containers.get(layer).addChildAt(sprite, 0);\n }\n else {\n // in schematic mode, place other parts behind balls\n if ((layer >= 4 /* SCHEMATIC */) && (!(part instanceof ball_4.Ball))) {\n this._containers.get(layer).addChildAt(sprite, 0);\n }\n else {\n this._containers.get(layer).addChild(sprite);\n }\n }\n }\n renderer_5.Renderer.needsUpdate();\n }", "title": "" }, { "docid": "5cdfd055fa1869b1883760d8b31a8971", "score": "0.5377652", "text": "function constructLetterPolygons(letters, fontSpec, xOffset, yOffset, zOffset, letterScale, thickness, material, meshOrigin) {\n var letterOffsetX = 0,\n lettersOrigins = new Array(letters.length),\n lettersBoxes = new Array(letters.length),\n lettersMeshes = new Array(letters.length),\n ix = 0, letter, letterSpec, lists, shapesList, holesList, letterMeshes, letterBox, letterOrigins, meshesAndBoxes, i;\n\n for (i = 0; i < letters.length; i++) {\n letter = letters[i];\n letterSpec = makeLetterSpec(fontSpec, letter);\n if (isObject(letterSpec)) {\n lists = buildLetterMeshes(letter, i, letterSpec, fontSpec.reverseShapes, fontSpec.reverseHoles);\n shapesList = lists[0];\n holesList = lists[1];\n letterBox = lists[2];\n letterOrigins = lists[3];\n\n // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n // This subtracts the holes, if any, from the shapes and merges the shapes\n // (Many glyphs - 'i', '%' - have multiple shapes)\n // At the end, there is one mesh per glyph, as God intended\n letterMeshes = punchHolesInShapes(shapesList, holesList);\n if (letterMeshes.length) {\n lettersMeshes[ix] = merge(letterMeshes);\n lettersOrigins[ix] = letterOrigins;\n lettersBoxes[ix] = letterBox;\n ix++\n }\n }\n };\n meshesAndBoxes = [lettersMeshes, lettersBoxes, lettersOrigins];\n meshesAndBoxes.xWidth = round(letterOffsetX);\n meshesAndBoxes.count = ix;\n return meshesAndBoxes;\n\n // ~ - = ~ - = ~ - = ~ - = ~ - = ~ - = ~ - = ~ - =\n // A letter may have one or more shapes and zero or more holes\n // The shapeCmds is an array of shapes\n // The holeCmds is an array of array of holes, the outer array lining up with\n // the shapes array and the inner array permitting more than one hole per shape\n // (Think of the letter 'B', with one shape and two holes, or the symbol\n // '%' which has three shapes and two holes)\n // \n // For mystifying reasons, the holeCmds (provided by the font) must be reversed\n // from the original order and the shapeCmds must *not* be reversed\n // UNLESS the font is Jura, in which case the holeCmds are not reversed\n // (Possibly because the Jura source is .otf, and the others are .ttf)\n //\n // *WARNING* *WARNING*\n // buildLetterMeshes performs a lot of arithmetic for offsets to support\n // symbol reference points, BABYLON idiocyncracies, font idiocyncracies,\n // symbol size normalization, the way curves are specified and \"relative\"\n // coordinates. (Fonts use fixed coordinates but many other SVG-style\n // symbols use relative coordinates)\n // *WARNING* *WARNING*\n // ~ - = ~ - = ~ - = ~ - = ~ - = ~ - = ~ - = ~ - =\n\n function buildLetterMeshes(letter, index, spec, reverseShapes, reverseHoles) {\n\n // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n // A large number of offsets are created, per warning\n var balanced = meshOrigin === \"letterCenter\",\n centerX = (spec.xMin + spec.xMax) / 2,\n centerZ = (spec.yMin + spec.yMax) / 2,\n xFactor = isNumber(spec.xFactor) ? spec.xFactor : 1,\n zFactor = isNumber(spec.yFactor) ? spec.yFactor : 1,\n xShift = isNumber(spec.xShift) ? spec.xShift : 0,\n zShift = isNumber(spec.yShift) ? spec.yShift : 0,\n reverseShape = isBoolean(spec.reverseShape) ? spec.reverseShape : reverseShapes,\n reverseHole = isBoolean(spec.reverseHole) ? spec.reverseHole : reverseHoles,\n offX = xOffset - (balanced ? centerX : 0),\n offZ = zOffset - (balanced ? centerZ : 0),\n shapeCmdsLists = isArray(spec.shapeCmds) ? spec.shapeCmds : [],\n holeCmdsListsArray = isArray(spec.holeCmds) ? spec.holeCmds : [], letterBox, letterOrigins;\n\n // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n // Several scaling functions are created too, per warning\n var adjX = makeAdjust(letterScale, xFactor, offX, 0, false, true), // no shift\n adjZ = makeAdjust(letterScale, zFactor, offZ, 0, false, false),\n adjXfix = makeAdjust(letterScale, xFactor, offX, xShift, false, true), // shifted / fixed\n adjZfix = makeAdjust(letterScale, zFactor, offZ, zShift, false, false),\n adjXrel = makeAdjust(letterScale, xFactor, offX, xShift, true, true), // shifted / relative\n adjZrel = makeAdjust(letterScale, zFactor, offZ, zShift, true, false),\n thisX, lastX, thisZ, lastZ, minX = NaN, maxX = NaN, minZ = NaN, maxZ = NaN, minXadj = NaN, maxXadj = NaN, minZadj = NaN, maxZadj = NaN;\n\n letterBox = [adjX(spec.xMin), adjX(spec.xMax), adjZ(spec.yMin), adjZ(spec.yMax)];\n letterOrigins = [round(letterOffsetX), -1 * adjX(0), -1 * adjZ(0)];\n\n // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n // Scope warning: letterOffsetX belongs to an outer closure\n // and persists through multiple characters\n letterOffsetX = letterOffsetX + spec.wdth * letterScale;\n\n if (debug && spec.show) {\n console.log([minX, maxX, minZ, maxZ]);\n console.log([minXadj, maxXadj, minZadj, maxZadj])\n }\n\n return [shapeCmdsLists.map(makeCmdsToMesh(reverseShape)), holeCmdsListsArray.map(meshesFromCmdsListArray), letterBox, letterOrigins];\n\n function meshesFromCmdsListArray(cmdsListArray) {\n return cmdsListArray.map(makeCmdsToMesh(reverseHole))\n };\n function makeCmdsToMesh(reverse) {\n return function cmdsToMesh(cmdsList) {\n var cmd = getCmd(cmdsList, 0),\n path = new BABYLON.Path2(adjXfix(cmd[0]), adjZfix(cmd[1])), array, meshBuilder, j, last, first = 0;\n\n // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n // Array length is used to determine curve type in the 'TheLeftover Font Format' (TLFF)\n // \n // IDIOCYNCRACY: Odd-length arrays indicate relative coordinates; the first digit is discarded\n\n for (j = 1; j < cmdsList.length; j++) {\n cmd = getCmd(cmdsList, j);\n\n // ~ ~ ~ ~ ~ ~ ~ ~\n // Line\n if (cmd.length === 2) {\n path.addLineTo(adjXfix(cmd[0]), adjZfix(cmd[1]))\n }\n if (cmd.length === 3) {\n path.addLineTo(adjXrel(cmd[1]), adjZrel(cmd[2]));\n }\n\n // ~ ~ ~ ~ ~ ~ ~ ~\n // Quadratic curve\n if (cmd.length === 4) {\n path.addQuadraticCurveTo(adjXfix(cmd[0]), adjZfix(cmd[1]), adjXfix(cmd[2]), adjZfix(cmd[3]))\n }\n if (cmd.length === 5) {\n path.addQuadraticCurveTo(adjXrel(cmd[1]), adjZrel(cmd[2]), adjXrel(cmd[3]), adjZrel(cmd[4]));\n }\n\n // ~ ~ ~ ~ ~ ~ ~ ~\n // Cubic curve\n if (cmd.length === 6) {\n path.addCubicCurveTo(adjXfix(cmd[0]), adjZfix(cmd[1]), adjXfix(cmd[2]), adjZfix(cmd[3]), adjXfix(cmd[4]), adjZfix(cmd[5]))\n }\n if (cmd.length === 7) {\n path.addCubicCurveTo(adjXrel(cmd[1]), adjZrel(cmd[2]), adjXrel(cmd[3]), adjZrel(cmd[4]), adjXrel(cmd[5]), adjZrel(cmd[6]))\n }\n }\n // Having created a Path2 instance with BABYLON utilities,\n // we turn it into an array and discard it\n array = path.getPoints().map(point2Vector);\n\n // Sometimes redundant coordinates will cause artifacts - delete them!\n last = array.length - 1;\n if (array[first].x === array[last].x && array[first].y === array[last].y) { array = array.slice(1) }\n if (reverse) { array.reverse() }\n\n meshBuilder = new BABYLON.PolygonMeshBuilder(\"MeshWriter-\" + letter + index + \"-\" + weeid(), array, scene, earcut);\n return meshBuilder.build(true, thickness)\n }\n };\n function getCmd(list, ix) {\n var cmd, len;\n lastX = thisX;\n lastZ = thisZ;\n cmd = list[ix];\n len = cmd.length;\n thisX = isRelativeLength(len) ? round((cmd[len - 2] * xFactor) + thisX) : round(cmd[len - 2] * xFactor);\n thisZ = isRelativeLength(len) ? round((cmd[len - 1] * zFactor) + thisZ) : round(cmd[len - 1] * zFactor);\n minX = thisX > minX ? minX : thisX;\n maxX = thisX < maxX ? maxX : thisX;\n minXadj = thisX + xShift > minXadj ? minXadj : thisX + xShift;\n maxXadj = thisX + xShift < maxXadj ? maxXadj : thisX + xShift;\n minZ = thisZ > minZ ? minZ : thisZ;\n maxZ = thisZ < maxZ ? maxZ : thisZ;\n minZadj = thisZ + zShift > minZadj ? minZadj : thisZ + zShift;\n maxZadj = thisZ + zShift < maxZadj ? maxZadj : thisZ + zShift;\n return cmd\n };\n\n // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n // Returns the a scaling function, based on incoming parameters\n function makeAdjust(letterScale, factor, off, shift, relative, xAxis) {\n if (relative) {\n if (xAxis) {\n return val => round(letterScale * ((val * factor) + shift + lastX + off))\n } else {\n return val => round(letterScale * ((val * factor) + shift + lastZ + off))\n }\n } else {\n return val => round(letterScale * ((val * factor) + shift + off))\n }\n }\n };\n\n // ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~\n function punchHolesInShapes(shapesList, holesList) {\n var letterMeshes = [], j;\n for (j = 0; j < shapesList.length; j++) {\n let shape = shapesList[j];\n let holes = holesList[j];\n if (isArray(holes) && holes.length) {\n letterMeshes.push(punchHolesInShape(shape, holes, letter, i))\n } else {\n letterMeshes.push(shape)\n }\n }\n return letterMeshes\n };\n function punchHolesInShape(shape, holes, letter, i) {\n var csgShape = BABYLON.CSG.FromMesh(shape), k;\n for (k = 0; k < holes.length; k++) {\n csgShape = csgShape.subtract(BABYLON.CSG.FromMesh(holes[k]))\n }\n holes.forEach(h => h.dispose());\n shape.dispose();\n return csgShape.toMesh(\"Net-\" + letter + i + \"-\" + weeid())\n };\n }", "title": "" }, { "docid": "7d9ca15c368430551f008d90c0801928", "score": "0.53686255", "text": "function init_pieces()\r\n{\r\n\tfor( var i = 0; i < this.mPieceList.length; i++ )\r\n\t{\r\n\t\tthis.mPieceList[i].move_to_region( i );\r\n\t}\r\n\tgBoard.cleanup_board();\r\n\tthis.perform_drop();\r\n}", "title": "" }, { "docid": "d96848ba3becf85e1bbb03ed6f8374e8", "score": "0.53616196", "text": "function charBeam(){ //start script\n app.beginUndoGroup(\"Create a Beam Rig\");\n\n var doLightning = confirm(\"Render lightning?\");\n\n //if(parseFloat(app.version) >= 10.5){\n var theComp = app.project.activeItem; //only selected\n\n // check if comp is selected\n if (theComp == null || !(theComp instanceof CompItem)){\n // if no comp selected, display an alert\n alert(\"Please establish a comp as the active item and run the script again.\");\n } else {\n var solid = theComp.layers.addSolid([0, 1.0, 1.0], \"Beam Solid\", theComp.width, theComp.height, 1);\n solid.locked = true;\n \n if (!doLightning) {\n var beam_baseSize = solid.property(\"Effects\").addProperty(\"Slider Control\");\n beam_baseSize.name = \"Base Size\";\n beam_baseSize.property(\"Slider\").setValue(8);\n var beam_maxSize = solid.property(\"Effects\").addProperty(\"Slider Control\");\n beam_maxSize.name = \"Max Size\";\n beam_maxSize.property(\"Slider\").setValue(1000);\n var beam_minSize = solid.property(\"Effects\").addProperty(\"Slider Control\");\n beam_minSize.name = \"Min Size\";\n beam_minSize.property(\"Slider\").setValue(1);\n } else {\n var beam_baseSize = solid.property(\"Effects\").addProperty(\"Slider Control\");\n beam_baseSize.name = \"Randomize\";\n beam_baseSize.property(\"Slider\").setValue(0); \n }\n\n var beam;\n if (doLightning) {\n beam = solid.property(\"Effects\").addProperty(\"Advanced Lightning\");\n beam.property(\"Lightning Type\").setValue(2); //type strike\n } else {\n beam = solid.property(\"Effects\").addProperty(\"Beam\");\n beam.property(\"3D Perspective\").setValue(0);\n beam.property(\"Length\").setValue(1);\n }\n\n var beamStart = theComp.layers.addNull();\n beamStart.name = \"beam_start\";\n beamStart.threeDLayer = true;\n beamStart.transform.position.setValue([(theComp.width/2)-200,theComp.height/2,0]);\n\n var beamEnd = theComp.layers.addNull();\n beamEnd.name = \"beam_end\";\n beamEnd.threeDLayer = true;\n beamEnd.transform.position.setValue([(theComp.width/2)+200,theComp.height/2,0]);\n\n\n var expr1 = \"fromComp(thisComp.layer(\\\"beam_start\\\").toComp(thisComp.layer(\\\"beam_start\\\").anchorPoint));\";\n var expr2 = \"fromComp(thisComp.layer(\\\"beam_end\\\").toComp(thisComp.layer(\\\"beam_end\\\").anchorPoint));\";\n\n if (doLightning) {\n beam.property(\"Origin\").expression = expr1;\n beam.property(\"Direction\").expression = expr2;\n } else {\n beam.property(\"Starting Point\").expression = expr1;\n beam.property(\"Ending Point\").expression = expr2;\n }\n \n if (!doLightning) {\n var expr3 = \"var L = \\\"beam_start\\\";\" + \"\\r\" + \n \"var s = thisComp.layer(\\\"Beam Solid\\\").effect(\\\"Base Size\\\")(\\\"Slider\\\");\" + \"\\r\" + \n \"var sMax = thisComp.layer(\\\"Beam Solid\\\").effect(\\\"Max Size\\\")(\\\"Slider\\\");\" + \"\\r\" + \n \"var sMin = thisComp.layer(\\\"Beam Solid\\\").effect(\\\"Min Size\\\")(\\\"Slider\\\");\" + \"\\r\" + \n \"var p = thisComp.layer(L).transform.position;\" + \"\\r\" + \n \"var ss = s + (-p[2]);\" + \"\\r\" + \n \"if(ss<sMin) ss = sMin;\" + \"\\r\" + \n \"if(ss>sMax) ss = sMax;\" + \"\\r\" + \n \"ss;\";\n beam.property(\"Starting Thickness\").expression = expr3;\n\n var expr4 = \"var L = \\\"beam_end\\\";\" + \"\\r\" + \n \"var s = thisComp.layer(\\\"Beam Solid\\\").effect(\\\"Base Size\\\")(\\\"Slider\\\");\" + \"\\r\" + \n \"var sMax = thisComp.layer(\\\"Beam Solid\\\").effect(\\\"Max Size\\\")(\\\"Slider\\\");\" + \"\\r\" + \n \"var sMin = thisComp.layer(\\\"Beam Solid\\\").effect(\\\"Min Size\\\")(\\\"Slider\\\");\" + \"\\r\" + \n \"var p = thisComp.layer(L).transform.position;\" + \"\\r\" + \n \"var ss = s + (-p[2]);\" + \"\\r\" + \n \"if(ss<sMin) ss = sMin;\" + \"\\r\" + \n \"if(ss>sMax) ss = sMax;\" + \"\\r\" + \n \"ss;\";\n beam.property(\"Ending Thickness\").expression = expr4;\n } else {\n var expr3 = \"random(effect(\\\"Randomize\\\")(\\\"Slider\\\"));\";\n beam.property(\"Conductivity State\").expression = expr3;\n }\n }\n \n app.endUndoGroup();\n} //end script", "title": "" }, { "docid": "60c8a059093e6b8e2e2dd09cca1a683e", "score": "0.534259", "text": "function generateShed(width, depth, height, noEvent = false, style = tools.URBAN_BARN) {\n let roofColor = roof_ ? roof_.color : \"Heritage Rustic Black\";\n objects_ = [];\n doors_ = [];\n lofts_ = [];\n workbenches_ = [];\n tackRooms_ = [];\n skylights_ = [];\n reversedGables_ = [];\n deepDoors_ = [];\n windows_ = [];\n decks_ = [];\n cupolas_ = [];\n vents_ = [];\n\n let difference = height_ - height;\n _.each(dragObjects_, (object) => {\n if (object instanceof ReverseGable) {\n object.position.y -= difference;\n }\n });\n\n width_ = width;\n depth_ = depth;\n height_ = height;\n realHeight_ = height;\n leftHeight_ = height - 1;\n rightHeight_ = height - 1;\n halfWidth_ = width * 0.5;\n halfDepth_ = depth * 0.5;\n style_ = style;\n\n let polycarbonateWallHeight = height * 0.6;\n\n for (let i = self.children.length - 1; i >= 0; i--) {\n self.remove(self.children[i]);\n }\n\n // Generating shed's walls\n let widthObj = new THREE.Object3D();\n widthObj.receiveShadow = true;\n\n let widthGeometryWidth = {\n 6: {x: 54.054, y: 9.043, h: 37.5},\n 8: {x: 78, y: 13.049, h: 41.5},\n 10: {x: 102.182, y: 17.095, h: 45.5},\n 12: {x: 125.416, y: 20.982, h: 49.5}\n };\n\n rightHeight_ = height;\n\n let widthGeometry1 = new ClipGeometry(new THREE.PlaneGeometry(width, height_));\n if (style === tools.LEAN_TO) {\n realHeight_ = height_ - width * 2.5 / 12;\n widthGeometry1 = new ClipGeometry(new THREE.PlaneGeometry(width, realHeight_));\n } else if (style === tools.BACKYARD_LEAN_TO || style === tools.URBAN_HOA) {\n rightHeight_ += (width * 2.0 / 12) + tools.in2cm(7);\n realHeight_ = height_ = leftHeight_ = height_ + tools.in2cm(7);\n widthGeometry1 = new ClipGeometry(new THREE.PlaneGeometry(width, realHeight_));\n } else if (style === tools.MINI_BARN) {\n let planeWidth = tools.ft2cm(widthGeometryWidth[12].x);\n roofHeight_ = tools.in2cm(widthGeometryWidth[12].h);\n try {\n _.forOwn(widthGeometryWidth, (value, w) => {\n if (tools.ft2cm(w) >= width) {\n planeWidth = tools.in2cm(value.x);\n roofHeight_ = tools.in2cm(value.h);\n throw new Error();\n }\n });\n } catch (e) {\n }\n\n widthGeometry1 = new ClipGeometry(new THREE.PlaneGeometry(planeWidth, tools.in2cm(28.45) + height_));\n }\n\n let widthGeometry2 = widthGeometry1.clone();\n\n widthMesh1 = new THREE.Mesh(widthGeometry1, tools.PAINT_MATERIAL);\n makeClippable(widthMesh1);\n\n widthMesh1.position.setZ(depth / 2);\n widthMesh1.castShadow = true;\n widthMesh1.receiveShadow = true;\n widthMesh1.renderOrder = 5;\n widthObj.add(widthMesh1);\n\n widthMesh2 = new THREE.Mesh(widthGeometry2, tools.PAINT_MATERIAL);\n makeClippable(widthMesh2);\n widthMesh2.castShadow = true;\n widthMesh2.receiveShadow = true;\n widthMesh2.position.setZ(-depth / 2);\n widthMesh2.rotateY(Math.PI);\n widthMesh2.renderOrder = 5;\n widthObj.add(widthMesh2);\n\n if (style == tools.LEAN_TO) {\n widthObj.position.y = FLOOR_HEIGHT + height_ / 2 - width * 2.5 / 24;\n } else if (style == tools.MINI_BARN) {\n widthObj.position.y = FLOOR_HEIGHT + (tools.in2cm(28.45) + height_) / 2;\n } else {\n widthObj.position.y = FLOOR_HEIGHT + height_ / 2;\n }\n self.add(widthObj);\n\n let depthObj = new THREE.Object3D();\n if (style == tools.LEAN_TO) {\n leftHeight_ -= width * 2.5 / 12;\n } else if (style == tools.URBAN_STUDIO) {\n rightHeight_ += width * Math.sin(0.2419219);\n }\n\n depthMesh1 = new THREE.Mesh(new ClipGeometry(new THREE.PlaneGeometry(depth, leftHeight_)), tools.PAINT_MATERIAL);\n makeClippable(depthMesh1);\n\n depthMesh1.castShadow = true;\n depthMesh1.receiveShadow = true;\n depthMesh1.position.setX(width / 2);\n if (style == tools.LEAN_TO) {\n depthMesh1.position.y -= width * 2.5 / 12 * 0.5;\n } else if (style == tools.BACKYARD_LEAN_TO || style === tools.URBAN_HOA) {\n depthMesh1.position.y -= (width * 2.0 / 12) * 0.5;\n } else if (style == tools.URBAN_STUDIO) {\n depthMesh1.position.y -= width * 0.25 * 0.5;\n }\n depthMesh1.rotateY(Math.PI / 2);\n depthMesh1.renderOrder = 5;\n depthObj.add(depthMesh1);\n\n let depthMesh2Height = rightHeight_;\n\n depthMesh2 = new THREE.Mesh(new ClipGeometry(new THREE.PlaneGeometry(depth, depthMesh2Height)), tools.PAINT_MATERIAL);\n makeClippable(depthMesh2);\n depthMesh2.castShadow = true;\n depthMesh2.receiveShadow = true;\n depthMesh2.position.setX(-width / 2);\n depthMesh2.rotateY(-Math.PI / 2);\n depthMesh2.renderOrder = 5;\n\n if (style == tools.SINGLE_SLOPE) {\n rightTop = new THREE.Mesh(new THREE.PlaneGeometry(depth, width * 0.25), tools.PAINT_MATERIAL);\n rightTop.position.x = -width * 0.5;\n rightTop.position.y = depthMesh2.position.y + depthMesh2Height * 0.5 + width * 0.25 * 0.5;\n rightTop.rotateY(-Math.PI * 0.5);\n rightTop.receiveShadow = rightTop.castShadow = true;\n\n _.each(rightTop.geometry.faceVertexUvs[0], (faces) => {\n _.each(faces, (vertex) => {\n vertex.y *= width * 0.25 / height;\n })\n });\n\n depthObj.add(rightTop);\n } else if (rightTop) {\n rightTop = null;\n }\n\n depthObj.add(depthMesh2);\n\n self.add(depthObj);\n depthObj.position.setY(FLOOR_HEIGHT + rightHeight_ / 2);\n\n if (style === tools.GREEN_HOUSE) {\n const offset = 0.6;\n\n widthPolycarbonMesh1 = new THREE.Mesh(\n new ClipGeometry(new THREE.PlaneGeometry(width, polycarbonateWallHeight)),\n polycarbonMaterial\n );\n makeClippable(widthPolycarbonMesh1);\n widthPolycarbonMesh1.castShadow = true;\n widthPolycarbonMesh1.receiveShadow = true;\n widthPolycarbonMesh1.position.z = depth / 2.0 - offset * 0.5;\n widthMesh1.position.z -= offset;\n widthPolycarbonMesh1.position.y = (widthGeometry1.height - polycarbonateWallHeight) * 0.5;\n\n widthPolycarbonMesh2 = new THREE.Mesh(\n new ClipGeometry(new THREE.PlaneGeometry(width, polycarbonateWallHeight)),\n polycarbonMaterial\n );\n makeClippable(widthPolycarbonMesh2);\n widthPolycarbonMesh2.castShadow = true;\n widthPolycarbonMesh2.receiveShadow = true;\n widthPolycarbonMesh2.rotateY(-Math.PI);\n widthPolycarbonMesh2.position.z = -depth / 2.0 + offset * 0.5;\n widthMesh2.position.z += offset;\n widthPolycarbonMesh2.position.y = widthPolycarbonMesh1.position.y;\n\n depthPolycarbonMesh1 = new THREE.Mesh(\n new ClipGeometry(new THREE.PlaneGeometry(depth, polycarbonateWallHeight)),\n polycarbonMaterial\n );\n makeClippable(depthPolycarbonMesh1);\n depthPolycarbonMesh1.castShadow = true;\n depthPolycarbonMesh1.receiveShadow = true;\n depthPolycarbonMesh1.position.x = width / 2.0 - offset * 0.5;\n depthMesh1.position.x -= offset;\n depthPolycarbonMesh1.position.y = (depthMesh1.geometry.height - polycarbonateWallHeight) * 0.5;\n depthPolycarbonMesh1.rotateY(Math.PI / 2);\n\n depthPolycarbonMesh2 = new THREE.Mesh(\n new ClipGeometry(new THREE.PlaneGeometry(depth, polycarbonateWallHeight)),\n polycarbonMaterial\n );\n makeClippable(depthPolycarbonMesh2);\n depthPolycarbonMesh2.castShadow = true;\n depthPolycarbonMesh2.receiveShadow = true;\n depthPolycarbonMesh2.position.x = -width / 2.0 + offset * 0.5;\n depthMesh2.position.x += offset;\n depthPolycarbonMesh2.position.y = (depthMesh2.geometry.height - polycarbonateWallHeight) * 0.5;\n depthPolycarbonMesh2.rotateY(-Math.PI / 2);\n\n widthMesh1.polycarbonatePart = widthPolycarbonMesh1;\n widthMesh2.polycarbonatePart = widthPolycarbonMesh2;\n depthMesh1.polycarbonatePart = depthPolycarbonMesh1;\n depthMesh2.polycarbonatePart = depthPolycarbonMesh2;\n\n widthObj.add(widthPolycarbonMesh1);\n widthObj.add(widthPolycarbonMesh2);\n depthObj.add(depthPolycarbonMesh1);\n depthObj.add(depthPolycarbonMesh2);\n }\n\n plan_ = new Plan(width, depth);\n plan_.position.y = tools.planY;\n self.add(plan_);\n\n plan_.drawElements([widthMesh1, widthMesh2, depthMesh1, depthMesh2]);\n plan_.drawMeasurements([widthMesh1, widthMesh2, depthMesh1, depthMesh2]);\n\n const generator = {};\n\n generator[tools.URBAN_BARN] = {\n generateRoofHeight: () => {\n return tools.ft2cm(3.875);\n },\n roofConstructor: () => new CustomizableBarnRoof(width, depth, roofHeight_, tools.URBAN_BARN, 5, 12.7, 12.7, undefined, environmentCamera),\n border1Constructor: (roofVertices) => new BarnRoofBorder(roofVertices),\n border2Constructor: (roofVertices) => new BarnRoofBorder(roofVertices)\n };\n generator[tools.ER_BARN] = generator[tools.BYS_BARN] = generator[tools.URBAN_BARN];\n generator[tools.URBAN_SHACK] = {\n generateRoofHeight: () => {\n return width_ / 24 * 5;\n },\n roofConstructor: () => new ShackRoof(width, depth, roofHeight_, undefined, undefined, environmentCamera),\n border1Constructor: (roofVertices) => new ShackRoofBorder(roofVertices),\n border2Constructor: (roofVertices) => new ShackRoofBorder(roofVertices)\n };\n generator[tools.BYS_SHED] = generator[tools.ER_A_FRAME] = generator[tools.URBAN_SHACK];\n generator[tools.ECON_SHED] = {\n generateRoofHeight: () => {\n return width_ / 24 * 2.5;\n },\n roofConstructor: () => new ShackRoof(width, depth, roofHeight_, 1, 0.8, environmentCamera),\n border1Constructor: (roofVertices) => new ShackRoofBorder(roofVertices),\n border2Constructor: (roofVertices) => new ShackRoofBorder(roofVertices)\n };\n generator[tools.ER_ECON] = {\n generateRoofHeight: () => {\n return width_ / 24 * 5;\n },\n roofConstructor: () => new ShackRoof(width, depth, roofHeight_, 1, 0.8, environmentCamera),\n border1Constructor: (roofVertices) => new ShackRoofBorder(roofVertices),\n border2Constructor: (roofVertices) => new ShackRoofBorder(roofVertices)\n };\n generator[tools.LEAN_TO] = {\n generateRoofHeight: () => {\n return width * 2.5 / 12;\n },\n roofConstructor: () => new LeanToRoof(width, depth, roofHeight_, undefined, undefined, environmentCamera),\n border1Constructor: (roofVertices) => new LeanToRoofBorder(roofVertices),\n border2Constructor: (roofVertices) => null\n };\n generator[tools.BACKYARD_LEAN_TO] = generator[tools.URBAN_HOA] = {\n generateRoofHeight: () => {\n return width * 2.0 / 12;\n },\n roofConstructor: () => new LeanToRoof(width, depth, roofHeight_, [tools.in2cm(5.5), tools.in2cm(3.5)], 2, environmentCamera),\n border1Constructor: (roofVertices) => new LeanToRoofBorder(roofVertices),\n border2Constructor: (roofVertices) => null\n };\n generator[tools.URBAN_MINI_BARN] = generator[tools.URBAN_BARN];\n generator[tools.URBAN_MINI_BARN].border1Constructor = (roofVertices) => new BarnRoofBorder(roofVertices, width, depth, roofHeight_, true);\n generator[tools.URBAN_MINI_BARN].border2Constructor = (roofVertices) => new BarnRoofBorder(roofVertices, width, depth, roofHeight_, true);\n generator[tools.A_FRAME] = {\n generateRoofHeight: () => {\n return (width_ + tools.in2cm(9)) / 24 * 5;\n },\n roofConstructor: () => new ARoof(width, depth, roofHeight_, undefined, undefined, undefined, undefined, undefined, environmentCamera),\n border1Constructor: (roofVertices) => new ARoofBorder(roofVertices, width, depth, roofHeight_),\n border2Constructor: (roofVertices) => new ARoofBorder(roofVertices, width, depth, roofHeight_)\n };\n generator[tools.GREEN_HOUSE] = {\n generateRoofHeight: () => {\n return (width_ + tools.in2cm(9)) / 24 * 5;\n },\n roofConstructor: () => new GreenRoof(width, depth, roofHeight_, undefined, undefined, undefined, undefined, undefined, environmentCamera),\n border1Constructor: (roofVertices) => new ARoofBorder(roofVertices, width, depth, roofHeight_),\n border2Constructor: (roofVertices) => new ARoofBorder(roofVertices, width, depth, roofHeight_)\n };\n generator[tools.DOUBLE_WIDE] = {\n generateRoofHeight: () => {\n return (width_ + tools.in2cm(11)) / 24 * 4;\n },\n roofConstructor: () => new ARoof(width, depth, roofHeight_, tools.in2cm(5.5), tools.in2cm(5.1875), tools.in2cm(2.75), undefined, undefined, environmentCamera),\n border1Constructor: (roofVertices) => new ARoofBorder(roofVertices, width, depth, roofHeight_,\n tools.in2cm(5.5), tools.in2cm(5.1875)),\n border2Constructor: (roofVertices) => new ARoofBorder(roofVertices, width, depth, roofHeight_,\n tools.in2cm(5.5), tools.in2cm(5.1875))\n };\n generator[tools.ECO] = {\n generateRoofHeight: () => {\n return width_ / 24 * 4;\n },\n roofConstructor: () => new ShackRoof(width, depth, roofHeight_, 0.8, tools.in2cm(3.5), environmentCamera),\n border1Constructor: (roofVertices) => null,\n border2Constructor: (roofVertices) => null\n };\n generator[tools.CASTLE_MOUNTAIN] = {\n generateRoofHeight: () => {\n return (width_ + tools.in2cm(9)) / 24 * 7;\n },\n roofConstructor: () => new ARoof(width, depth, roofHeight_, undefined, undefined, undefined,\n tools.in2cm(6.5), undefined, environmentCamera),\n border1Constructor: (roofVertices) => new ARoofBorder(roofVertices, width, depth, roofHeight_),\n border2Constructor: (roofVertices) => new ARoofBorder(roofVertices, width, depth, roofHeight_)\n };\n generator[tools.DELUXE_SHED] = {\n generateRoofHeight: () => {\n return (width_ + tools.in2cm(9)) / 24 * 7;\n },\n roofConstructor: () => new ARoof(width, depth, roofHeight_, tools.in2cm(6), tools.in2cm(3.1875) / 2.0, undefined,\n tools.in2cm(6), undefined, environmentCamera),\n border1Constructor: (roofVertices) => new ARoofBorder(roofVertices, width, depth, roofHeight_, tools.in2cm(6), tools.in2cm(3.1875) / 2.0),\n border2Constructor: (roofVertices) => new ARoofBorder(roofVertices, width, depth, roofHeight_, tools.in2cm(6), tools.in2cm(3.1875) / 2.0)\n };\n generator[tools.HPB_GABLE_ROOF] = {\n generateRoofHeight: () => {\n return (width_ + tools.in2cm(9)) / 24 * 5;\n },\n roofConstructor: () => new ARoof(width, depth, roofHeight_, undefined, tools.in2cm(3.1875) / 2.0, 5,\n 1.2, undefined, environmentCamera),\n border1Constructor: (roofVertices) => new ARoofBorder(roofVertices, width, depth, roofHeight_),\n border2Constructor: (roofVertices) => new ARoofBorder(roofVertices, width, depth, roofHeight_)\n };\n generator[tools.HPB_SP_A_FRAME] = {\n generateRoofHeight: () => {\n return (width_ + tools.in2cm(9)) / 24 * 8;\n },\n roofConstructor: () => new SPARoof(width, depth, roofHeight_, 0, tools.in2cm(3.1875) * 2.0, tools.in2cm(10),\n tools.in2cm(10), false, environmentCamera),\n border1Constructor: (roofVertices) => new SPARoofBorder(roofVertices, width, depth, roofHeight_, 0, tools.in2cm(3.1875) * 2.0, tools.in2cm(10), tools.in2cm(10), 16.85),\n border2Constructor: (roofVertices) => new SPARoofBorder(roofVertices, width, depth, roofHeight_, 0, tools.in2cm(3.1875) * 2.0, tools.in2cm(10), tools.in2cm(10), 16.85)\n };\n generator[tools.HPB_BARN_ROOF] = {\n generateRoofHeight: () => {\n let heights = {6: 37.5, 8: 41.5, 10: 45.5, 12: 49.5, 14: 53.5, 16: 57.5};\n\n let sizes = _.keys(heights);\n for (let i = 0, n = sizes.length; i < n; i++) {\n if (tools.ft2cm(sizes[i]) >= width_) {\n return tools.in2cm(heights[sizes[i]]);\n }\n }\n\n return tools.in2cm(heights[12]);\n },\n roofConstructor: () => new CustomizableBarnRoof(width, depth, roofHeight_, tools.HPB_BARN_ROOF, tools.in2cm(5), 0.5, tools.in2cm(3.1875) / 2.0, tools.in2cm(1.5), environmentCamera),\n border1Constructor: (roofVertices) => new BarnRoofBorder(roofVertices),\n border2Constructor: (roofVertices) => new BarnRoofBorder(roofVertices)\n };\n generator[tools.QUAKER] = {\n generateRoofHeight: () => {\n const heights = {6: 24, 8: 28.75, 10: 33.75, 12: 38.25, 14: 43.25};\n let sizes = _.keys(heights);\n for (let i = 0, n = sizes.length; i < n; i++) {\n if (tools.ft2cm(sizes[i]) >= width_) {\n return tools.in2cm(heights[sizes[i]]);\n }\n }\n\n return tools.in2cm(heights[14]);\n },\n roofConstructor: () => new QuakerRoof(width, depth, roofHeight_, environmentCamera),\n border1Constructor: (roofVertices) => new QuakerRoofBorder(roofVertices, width, depth, roofHeight_),\n border2Constructor: (roofVertices) => new QuakerRoofBorder(roofVertices, width, depth, roofHeight_,\n true)\n };\n generator[tools.MINI_BARN] = {\n generateRoofHeight: () => {\n let heights = {6: 37.5, 8: 41.5, 10: 45.5, 12: 49.5};\n\n let sizes = _.keys(heights);\n for (let i = 0, n = sizes.length; i < n; i++) {\n if (tools.ft2cm(sizes[i]) >= width_) {\n return tools.in2cm(heights[sizes[i]]);\n }\n }\n\n return tools.in2cm(heights[12]);\n },\n roofConstructor: () => new MiniBarnRoof(width, depth, roofHeight_, true, 5, 3.5, environmentCamera),\n border1Constructor: (roofVertices) => new BarnRoofBorder(roofVertices),\n border2Constructor: (roofVertices) => new BarnRoofBorder(roofVertices)\n };\n generator[tools.HI_BARN] = {\n generateRoofHeight: () => {\n let heights = {6: 37.5, 8: 41.5, 10: 45.5, 12: 49.5, 14: 53.5, 16: 57.5};\n\n let sizes = _.keys(heights);\n for (let i = 0, n = sizes.length; i < n; i++) {\n if (tools.ft2cm(sizes[i]) >= width_) {\n return tools.in2cm(heights[sizes[i]]);\n }\n }\n\n return tools.in2cm(heights[12]);\n },\n roofConstructor: () => new CustomizableBarnRoof(width, depth, roofHeight_, tools.HI_BARN, undefined, undefined, undefined, undefined, environmentCamera),\n border1Constructor: (roofVertices) => new BarnRoofBorder(roofVertices, width, depth, roofHeight_),\n border2Constructor: (roofVertices) => new BarnRoofBorder(roofVertices, width, depth, roofHeight_)\n };\n generator[tools.SINGLE_SLOPE] = {\n generateRoofHeight: () => {\n return width * 0.25;\n },\n roofConstructor: () => new SingleSlopeRoof(width, depth, roofHeight_, undefined, undefined, environmentCamera),\n border1Constructor: (roofVertices) => new SingleSlopeRoofBorder(roofVertices, width, depth),\n border2Constructor: (roofVertices) => new SingleSlopeRoofBorder(roofVertices, width, depth, true)\n };\n generator[tools.URBAN_STUDIO] = {\n generateRoofHeight: () => {\n return width * Math.sin(0.2419219);\n },\n roofConstructor: () => new LeanToRoof(width, depth, roofHeight_, tools.in2cm(6), tools.in2cm(6), environmentCamera),\n border1Constructor: (roofVertices) => new LeanToRoofBorder(roofVertices, width_, depth_, true),\n border2Constructor: (roofVertices) => null\n };\n generator[tools.LOFTED_BARN] = {\n generateRoofHeight: () => {\n let heights = {8: 38.25, 10: 42.0, 12: 44.5, 14: 49.5, 16: 52.3};\n\n let sizes = _.keys(heights);\n for (let i = 0, n = sizes.length; i < n; i++) {\n if (tools.ft2cm(sizes[i]) >= width_) {\n return tools.in2cm(heights[sizes[i]]);\n }\n }\n\n return tools.in2cm(heights[16]);\n },\n roofConstructor: () => new CustomizableBarnRoof(width, depth, roofHeight_, tools.LOFTED_BARN, tools.in2cm(3.1875) / 2.0, undefined, tools.in2cm(3.1875), undefined, environmentCamera),\n border1Constructor: (roofVertices) => new BarnRoofBorder(roofVertices),\n border2Constructor: (roofVertices) => new BarnRoofBorder(roofVertices)\n };\n generator[tools.BARN] = {\n generateRoofHeight: () => {\n let heights = {8: 32.25, 10: 42.75, 12: 44.5, 14: 49.5, 16: 52.3};\n\n let sizes = _.keys(heights);\n for (let i = 0, n = sizes.length; i < n; i++) {\n if (tools.ft2cm(sizes[i]) >= width_) {\n return tools.in2cm(heights[sizes[i]]);\n }\n }\n\n return tools.in2cm(heights[16]);\n },\n roofConstructor: () => new CustomizableBarnRoof(width, depth, roofHeight_, tools.BARN, tools.in2cm(3.1875) / 2.0, undefined, tools.in2cm(3.1875), undefined, environmentCamera),\n border1Constructor: (roofVertices) => new BarnRoofBorder(roofVertices),\n border2Constructor: (roofVertices) => new BarnRoofBorder(roofVertices)\n };\n generator[tools.UTILITY] = {\n generateRoofHeight: () => {\n const heights = {8: 42.5, 10: 51.5, 12: 59, 14: 71, 16: 78.5};\n let sizes = _.keys(heights);\n for (let i = 0, n = sizes.length; i < n; i++) {\n if (tools.ft2cm(sizes[i]) >= width_) {\n return heights[sizes[i]];\n }\n }\n\n return heights[16];\n },\n roofConstructor: () => new ARoof(width, depth, roofHeight_, tools.in2cm(4.5), tools.in2cm(3.1875), tools.in2cm(2.25), 1, undefined, environmentCamera),\n border1Constructor: (roofVertices) => new ARoofBorder(roofVertices, width, depth, roofHeight_, tools.in2cm(5.5)),\n border2Constructor: (roofVertices) => new ARoofBorder(roofVertices, width, depth, roofHeight_, tools.in2cm(5.5))\n };\n generator[tools.ECON_BARN] = {\n generateRoofHeight: () => {\n return tools.in2cm(46);\n },\n roofConstructor: () => new CustomizableBarnRoof(width, depth, roofHeight_, tools.ECON_BARN, 0, 1.11, 0, undefined, environmentCamera),\n border1Constructor: (roofVertices) => new EconBarnRoofBorder(roofVertices, width, depth, height_),\n border2Constructor: (roofVertices) => new EconBarnRoofBorder(roofVertices, width, depth, height_)\n };\n\n let bbAHeightGenerator = () => {\n const heights = {10: 1.75, 12: 1.91, 14: 2.08};\n let sizes = _.keys(heights);\n for (let i = 0, n = sizes.length; i < n; i++) {\n if (tools.ft2cm(sizes[i]) >= width_) {\n return tools.ft2cm(heights[sizes[i]]);\n }\n }\n\n return tools.ft2cm(heights[16]);\n };\n let bbHeightGenerator = () => {\n const heights = {10: 2.75, 12: 3, 14: 3.85};\n let sizes = _.keys(heights);\n for (let i = 0, n = sizes.length; i < n; i++) {\n if (tools.ft2cm(sizes[i]) >= width_) {\n return tools.ft2cm(heights[sizes[i]]);\n }\n }\n\n return tools.ft2cm(heights[16]);\n };\n generator[tools.METAL_A_FRAME_BB] = {\n generateRoofHeight: bbAHeightGenerator,\n roofConstructor: () => new ShackRoof(width, depth, roofHeight_, tools.in2cm(6), tools.in2cm(4), environmentCamera, false, true),\n border1Constructor: (roofVertices) => new ShackRoofBorder(roofVertices, -tools.in2cm(6) + 1.2, -tools.in2cm(4) + 1.2),\n border2Constructor: (roofVertices) => new ShackRoofBorder(roofVertices, -tools.in2cm(6) + 1.2, -tools.in2cm(4) + 1.2)\n };\n generator[tools.WOODEN_A_FRAME_BB] = {\n generateRoofHeight: bbAHeightGenerator,\n roofConstructor: () => new ShackRoof(width, depth, roofHeight_, tools.in2cm(3.5), tools.in2cm(3.5), environmentCamera, false),\n border1Constructor: (roofVertices) => new ShackRoofBorder(roofVertices, -tools.in2cm(3.5) + 1.2, -tools.in2cm(3.5) + 1.2),\n border2Constructor: (roofVertices) => new ShackRoofBorder(roofVertices, -tools.in2cm(3.5) + 1.2, -tools.in2cm(3.5) + 1.2)\n };\n generator[tools.BARN_BB] = {\n generateRoofHeight: bbHeightGenerator,\n roofConstructor: () => new CustomizableBarnRoof(width, depth, roofHeight_, tools.BARN_BB, 0, 1.11, 0, undefined, environmentCamera),\n border1Constructor: (roofVertices) => new EconBarnRoofBorder(roofVertices, width, depth, height_),\n border2Constructor: (roofVertices) => new EconBarnRoofBorder(roofVertices, width, depth, height_)\n };\n\n generator[tools.VERTICAL_METAL_A_FRAME_BB] = {\n generateRoofHeight: bbAHeightGenerator,\n roofConstructor: () => new ShackRoof(width, depth, roofHeight_, 1.2, tools.in2cm(4), environmentCamera),\n border1Constructor: (roofVertices) => new ShackRoofBorder(roofVertices, 0, -tools.in2cm(4) + 1.2),\n border2Constructor: (roofVertices) => new ShackRoofBorder(roofVertices, 0, -tools.in2cm(4) + 1.2)\n };\n\n // Generating Roof\n roofHeight_ = generator[style].generateRoofHeight();\n\n roofContainer_ = new RoofContainer(style);\n self.add(roofContainer_);\n\n roof_ = generator[style].roofConstructor();\n let roofY = height_ + FLOOR_HEIGHT;\n if (style === tools.DOUBLE_WIDE || style === tools.CASTLE_MOUNTAIN) {\n roofY += 0.5;\n } else if (style === tools.HPB_SP_A_FRAME) {\n roofY -= 16.85;\n } else {\n roofY += 0.1;\n }\n roof_.position.setY(roofY);\n roofContainer_.add(roof_);\n\n self.roof.color = 'Heritage Rustic Black';\n\n // Generating trusses\n\n let trussHeight = height_;\n\n if (style === tools.MINI_BARN) {\n trussHeight = height_ + roofHeight_;\n }\n\n let trussData = roof_.getTrussValues ? roof_.getTrussValues() : null;\n\n truss1_ = new Truss(width, roofHeight_, style, false, trussHeight, sidingID_, undefined, trussData, environmentCamera);\n truss1_.position.setZ(depth / 2);\n truss1_.position.setY(height_ + FLOOR_HEIGHT - (style == tools.LEAN_TO ? width * 2.5 / 12 : 0));\n self.add(truss1_);\n\n truss2_ = new Truss(width, roofHeight_, style, true, trussHeight, sidingID_, undefined, trussData, environmentCamera);\n truss2_.rotateY(Math.PI);\n truss2_.position.setZ(-depth / 2);\n truss2_.position.setY(height_ + FLOOR_HEIGHT - (style == tools.LEAN_TO ? width * 2.5 / 12 : 0));\n\n self.add(truss2_);\n\n if (style === tools.MINI_BARN) {\n roof_.position.y += roofHeight_;\n truss1_.position.y += roofHeight_;\n truss2_.position.y += roofHeight_;\n } else if (style == tools.URBAN_STUDIO) {\n roof_.position.y += roofHeight_;\n }\n\n // Generating roof borders\n roofBorder1_ = (generator[style].border1Constructor) ?\n generator[style].border1Constructor(roof_.vertices) : null;\n if (style === tools.ECO) {\n roofBorder1_ = new THREE.Mesh();\n roofBorder1_.setColor = () => {\n };\n }\n\n roofBorder1_.position.setY(height_ + FLOOR_HEIGHT);\n if (style == tools.URBAN_STUDIO) {\n roofBorder1_.position.y += roofHeight_;\n }\n\n roofContainer_.add(roofBorder1_);\n\n roofBorder2_ = (generator[style].border2Constructor) ?\n generator[style].border2Constructor(roof_.vertices) : null;\n if (_.includes([tools.LEAN_TO, tools.ECO, tools.URBAN_STUDIO, tools.BACKYARD_LEAN_TO, tools.URBAN_HOA], style)) {\n roofBorder2_ = new THREE.Mesh();\n roofBorder2_.setColor = () => {\n };\n }\n\n roofBorder2_.position.setY(height_ + FLOOR_HEIGHT);\n if (!_.includes([tools.QUAKER, tools.SINGLE_SLOPE, tools.URBAN_STUDIO, tools.BACKYARD_LEAN_TO, tools.URBAN_HOA], style)) {\n roofBorder2_.rotateY(Math.PI);\n }\n\n if (style === tools.MINI_BARN) {\n roofBorder1_.position.y += roofHeight_;\n roofBorder2_.position.y += roofHeight_;\n } else if (style === tools.BACKYARD_LEAN_TO || style === tools.URBAN_HOA) {\n roof_.position.y += roofHeight_;\n roofBorder1_.position.y += roofHeight_;\n roofBorder2_.position.y += roofHeight_;\n } else if (style === tools.HPB_SP_A_FRAME) {\n roofBorder1_.position.y -= 16.85;\n roofBorder2_.position.y -= 16.85;\n } else if (style === tools.METAL_A_FRAME_BB || style === tools.WOODEN_A_FRAME_BB) {\n roofBorder1_.position.y += 1;\n roofBorder2_.position.y += 1;\n }\n roofContainer_.add(roofBorder2_);\n\n roofBorder1_.trimID = trimID_;\n roofBorder2_.trimID = trimID_;\n\n if (style === tools.HPB_SP_A_FRAME) {\n roofBorder1_.dashVisible = false;\n roofBorder2_.dashVisible = false;\n }\n\n if (self.isUrban) {\n vent1_ = new Vent();\n let ventPosition = roof_.getPointOnRoof(\n new THREE.Vector3(-width_ * 0.15, roof_.position.y, depth >= tools.ft2cm(20) ? halfDepth_ / 2 : 0));\n let ventAngle = roof_.getRoofAngle(ventPosition);\n vent1_.position.set(ventPosition.x, ventPosition.y, ventPosition.z);\n\n vent1_.rotateZ(ventAngle);\n vents_.push(vent1_);\n roofContainer_.add(vent1_);\n\n if (depth >= tools.ft2cm(20)) {\n vent2_ = new Vent();\n vent2_.position.setX(vent1_.position.x);\n vent2_.position.setY(vent1_.position.y);\n vent2_.rotateZ(ventAngle);\n vent2_.position.setZ(-halfDepth_ / 2);\n vents_.push(vent2_);\n roofContainer_.add(vent2_);\n }\n } else if (!_.includes([tools.UTILITY, tools.URBAN_STUDIO, tools.DELUXE_SHED, tools.GREEN_HOUSE,\n tools.METAL_A_FRAME_BB, tools.WOODEN_A_FRAME_BB, tools.BARN_BB, tools.BARN_BB,\n tools.VERTICAL_METAL_A_FRAME_BB], style)) {\n let ventType = (style !== tools.CASTLE_MOUNTAIN) ? Vent.GABLE_STANDARD : Vent.ARCHTOP_VENT;\n vent1_ = new Vent(ventType);\n vent2_ = new Vent(ventType);\n\n if (style == tools.MINI_BARN) {\n vent1_.position.y = vent2_.position.y = FLOOR_HEIGHT + height_ + roofHeight_ - 85;\n } else if (style == tools.SINGLE_SLOPE || style === tools.BACKYARD_LEAN_TO || style === tools.URBAN_HOA) {\n vent1_.position.y = vent2_.position.y = FLOOR_HEIGHT + height_ + roofHeight_ - tools.ft2cm(3);\n vent1_.position.x = vent2_.position.x = -width * 0.5 + tools.ft2cm(1);\n } else {\n vent1_.position.y = vent2_.position.y = FLOOR_HEIGHT + height_ + roofHeight_ - 85;\n }\n vent1_.position.z = depth * 0.5;\n vent2_.position.z = -depth * 0.5;\n vent2_.rotation.fromArray([0, Math.PI, 0]);\n\n if (style == tools.QUAKER) {\n const in4p5 = tools.in2cm(4.5);\n const tanQ = Math.tan(0.3228859);\n let quakerTopX = width * 0.5 - ((roofHeight_ - in4p5) / tanQ - in4p5) - 10;\n vent1_.position.x = vent2_.position.x = quakerTopX;\n }\n\n roofContainer_.add(vent1_);\n roofContainer_.add(vent2_);\n\n vent1_.currentTruss = truss1_;\n vent2_.currentTruss = truss2_;\n\n vents_.push(vent1_);\n vents_.push(vent2_);\n }\n\n roofContainer_.build();\n // Generating columns (vertical trims)\n let hasRail = _.includes([\n tools.URBAN_BARN, tools.URBAN_SHACK, tools.LOFTED_BARN, tools.DELUXE_SHED,\n tools.ER_A_FRAME, tools.ER_BARN, tools.HPB_GABLE_ROOF, tools.HPB_SP_A_FRAME,\n tools.HPB_BARN_ROOF, tools.BYS_SHED, tools.BYS_BARN\n ], style);\n let railWidth = width - 8;\n let columnReduction = _.includes([tools.LEAN_TO, tools.URBAN_STUDIO, tools.BACKYARD_LEAN_TO, tools.URBAN_HOA], style) ? 4 : 0;\n if (style === tools.ECON_BARN) {\n columnReduction = tools.in2cm(3.5);\n } else if (style === tools.BARN) {\n columnReduction = -tools.in2cm(1.75);\n } else if (style === tools.HI_BARN) {\n columnReduction = tools.in2cm(1.5);\n } else if (style === tools.MINI_BARN) {\n columnReduction = 3.5;\n } else if (style === tools.ECO || style === tools.WOODEN_A_FRAME_BB) {\n columnReduction = 1;\n }\n let leftColumnGeometry = new THREE.CubeGeometry(in3p5, leftHeight_ - (hasRail ? in1p75 : 0) - columnReduction, in3p5);\n let rightColumnHeight = rightHeight_;\n if (rightTop) {\n rightColumnHeight += width * 0.25;\n }\n let rightColumnGeometry = new THREE.CubeGeometry(in3p5, rightColumnHeight - (hasRail ? in1p75 : 0) - columnReduction, in3p5);\n\n columns_ = _.times(4, (idx) => {\n let column = new THREE.Mesh((idx == 1 || idx == 2) ? leftColumnGeometry : rightColumnGeometry,\n tools.PAINT_MATERIAL);\n column.castShadow = true;\n\n if (!_.includes([tools.ECON_BARN, tools.HPB_GABLE_ROOF, tools.DELUXE_SHED, tools.HPB_BARN_ROOF,\n tools.BARN, tools.LOFTED_BARN, tools.BARN_BB], style)) {\n column.receiveShadow = true;\n }\n column.position.y = ((idx == 1 || idx == 2) ? leftHeight_ : rightColumnHeight) * 0.5 + FLOOR_HEIGHT\n - (hasRail ? tools.in2cm(0.875) : 0) - columnReduction * 0.5;\n\n let columnShift = {x: 0, z: 0};\n columnShift.x -= in3p5 * 0.5 - in7d16;\n columnShift.z -= in3p5 * 0.5 - in7d16;\n\n switch (idx) {\n case 0:\n column.position.x = -width * 0.5 - columnShift.x;\n column.position.z = depth * 0.5 + columnShift.z;\n break;\n case 1:\n column.position.x = width * 0.5 + columnShift.x;\n column.position.z = depth * 0.5 + columnShift.z;\n break;\n case 2:\n column.position.x = width * 0.5 + columnShift.x;\n column.position.z = -depth * 0.5 - columnShift.z;\n break;\n case 3:\n column.position.x = -width * 0.5 - columnShift.x;\n column.position.z = -depth * 0.5 - columnShift.z;\n break;\n }\n\n self.add(column);\n\n return column;\n });\n\n // Generating rails (horizontal trims)\n if (style === tools.DELUXE_SHED) {\n railWidth = width + 8;\n } else if (style === tools.HPB_GABLE_ROOF) {\n railWidth = width + tools.in2cm(7);\n } else if (style === tools.HPB_SP_A_FRAME) {\n railWidth = width + tools.in2cm(7) - 8;\n } else if (style === tools.HPB_BARN_ROOF) {\n railWidth = width + tools.in2cm(10) - 7;\n } else if (style === tools.LOFTED_BARN) {\n railWidth = width;\n }\n\n if (hasRail) {\n let roofVertices = roof_.vertices;\n let roofVector = new THREE.Vector3().fromArray(roofVertices, 3)\n .sub(new THREE.Vector3().fromArray(roofVertices));\n let roofTan = Math.tan(roofVector.angleTo(new THREE.Vector3(1, 0, 0)));\n\n rails_ = _.times(2, (i) => {\n let rail = new HTrim(railWidth, roofTan, !_.includes([tools.DELUXE_SHED, tools.HPB_GABLE_ROOF, tools.HPB_SP_A_FRAME], style));\n\n rail.position.y = height_ + FLOOR_HEIGHT;\n rail.rotateY(Math.PI * (i + 1));\n rail.position.z = Math.pow((-1), i + 1) * (depth * 0.5 - tools.in2cm(3.5) * 0.5 + 1);\n\n if ([tools.HPB_BARN_ROOF, tools.LOFTED_BARN].indexOf(style) !== -1) {\n rail.receiveShadow = false;\n }\n rail.trimID = trimID_;\n\n self.add(rail);\n return rail;\n });\n }\n\n if (style === tools.URBAN_STUDIO) {\n let rail = new HTrim(depth, 1.0, false);\n\n rail.position.y = height_ + FLOOR_HEIGHT;\n rail.position.x = (-width / 2) + tools.in2cm(1.75) - 0.2;\n rail.rotateY(-Math.PI * 0.5);\n rail.trimID = trimID_;\n\n self.add(rail);\n\n if (rails_) {\n rails_.push(rail);\n } else {\n rails_ = [rail];\n }\n }\n\n // adding the floor\n floor_ = new Floor(width, depth, style);\n self.add(floor_);\n\n // Adding grid\n boxGrid_ = new GridObject(STEP_SIZE, self.boxWalls);\n boxGrid_.position.setY(height_ * 0.5 + FLOOR_HEIGHT);\n self.add(boxGrid_);\n boxGrid_.visible = false;\n\n generateWallGrid();\n\n // initialize drag objects\n return setColor(mainColor_, secondaryColor_, shuttersColor_, flowerBoxColor_).then(() => {\n if (!noEvent) {\n if (generatedCallback) {\n generatedCallback();\n }\n }\n }).then(() => {\n roof_.color = roofColor;\n\n _.forOwn(dragObjects_, (object) => {\n if (object instanceof Cupola) {\n object.generateBottom(roof_);\n }\n });\n\n alignWindows();\n });\n }", "title": "" }, { "docid": "681ef44bf46c8113d5bf10bb3f89969f", "score": "0.53404665", "text": "function beginChainedFunctions(){\n getPlayerPieces();\n}", "title": "" }, { "docid": "7d4734f968ec912088ae0b3dfb9573fc", "score": "0.5334917", "text": "function drawCharacters(){\n\n // Ghosts\n for(let i = 0; i < colors.length; i++){\n let ghost = document.createElement('div')\n let ghostPos = returnLocOnBoard(startingLocations[i].x, startingLocations[i].y)\n let id = 'ghost'+i\n ghost.id = id\n ghost.classList.add('ghost-'+colors[i], 'ghost', 'char')\n ghost.setAttribute('num', i)\n ghost.style.top = ghostPos.y\n ghost.style.left = ghostPos.x\n ghosts.push(new Ghost(startingLocations[i], colors[i], i, id))\n map.appendChild(ghost)\n }\n\n // Set Up Pickman Div\n pickmanDiv = document.createElement('div')\n pickmanDiv.id = \"pickman\"\n pickmanDiv.classList.add('char')\n map.appendChild(pickmanDiv)\n \n //Set Up Pickman Object\n pickman = new PickMan(pickmanDiv)\n\n pickmanPos = returnLocOnBoard(pickman.startingLocation.x, pickman.startingLocation.y)\n pickmanDiv.style.top = pickmanPos.y\n pickmanDiv.style.left = pickmanPos.x\n}", "title": "" }, { "docid": "eab7e2da2d1f33469ba1e5c35827caea", "score": "0.53249985", "text": "function Start()\n{\n\t//the width and height between each object\n\tvar deltaWidth = width/numObjectsWide;\n\tvar deltaHeight= height/numObjectsHigh;\n\t\n\t//starting in the top left corner create the prefab objects and attach them to this gameObject\n\tfor(var i = -numObjectsWide/2 ; i <= numObjectsWide/2 ; i++)\n\t{\n\t\tfor(var j = -numObjectsHigh/2 ; j <= numObjectsHigh/2 ; j++)\n\t\t{\n\t\t\t//get the next position that an object should be created at and create it there\n\t\t\tcreateObject(new Vector3(deltaWidth*i,depth,deltaHeight*j));\n\t\t}\n\t}\n}", "title": "" }, { "docid": "fc1880b407151f8bd97491d21b711c25", "score": "0.532307", "text": "function freeze(){\r\n\t//If some block, in the next shape, + 1 width (the next block down) is listed as taken,\r\n\tif(current.some(index => squares[currentPosition + index + width].classList.contains('taken'))){\r\n\t\tcurrent.forEach(index => squares[currentPosition + index].classList.add('taken'))\r\n\t\t//nextPiece\r\n\t\trandom = nextRandom\r\n nextRandom = Math.floor(Math.random() * theTetrominoes.length)\r\n\t\tcurrent = theTetrominoes[random][currentRotation];\r\n\t\tcurrentPosition = 4;\r\n\t\tdraw()\r\n\t\tdisplayShape()\r\n\t\taddScore()\r\n\t\tgameOver()\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "b8fb3fdb608debbb99ea893690593277", "score": "0.53205043", "text": "function _initCrab(){\n\t\t_initArms();\n\t\t_initLegs();\n\t\t_components.Legs['left_leg1'].parent = _components.Body.body;\n\t\t_components.Legs['right_leg1'].parent = _components.Body.body;\n\t\t_components.Legs['left_leg2'].parent = _components.Body.body;\n\t\t_components.Legs['right_leg2'].parent = _components.Body.body;\n\t\t_components.Legs['left_leg3'].parent = _components.Body.body;\n\t\t_components.Legs['right_leg3'].parent = _components.Body.body;\n\t\t_components.Legs['left_leg4'].parent = _components.Body.body;\n\t\t_components.Legs['right_leg4'].parent = _components.Body.body;\n\t\t_components.Arms['left_arm'].parent = _components.Body.body;\n\t\t_components.Arms['right_arm'].parent = _components.Body.body;\n\t\t_components.Body.body.rotation.y = Math.PI/2;\n\t}", "title": "" }, { "docid": "8f9b2084940751ee8adc34c16de22f40", "score": "0.5317719", "text": "createMonsters(initArgs) {\n for ( let loop = 0; loop < 4; ++loop ) {\n let entity = new Entity();\n\n let dist = Math.random() * 2.0 + 5.0;\n let angle = Math.random() * Math.PI * 2;\n\n let x = 30.0 + Math.cos( angle ) * dist;\n let z = 30.0 + Math.sin( angle ) * dist;\n\n entity.addComponent( 'Physics', this.physics.createBox( 0.5, 0.5, 0.5 ) )\n .setPosition( x, 0.0, z );\n entity.addComponent( 'Geometry', this.geometryProvider.createGeometry( {\n shape: 'Monster',\n color: 0xFF662222,\n width: 0.5,\n height: 0.5,\n depth: 0.5\n } ) );\n entity.addComponent( 'Controller', new MonsterController() );\n\n this.activeObjects.push( entity.getComponent( 'Controller' ) );\n\n this.addEntity( 'smonster' + loop, entity );\n }\n }", "title": "" }, { "docid": "d659825d3fdc3ba679ba8dca62679723", "score": "0.5317651", "text": "function Start () {\nif (baseComponentsNumber > 0 && baseComponents.length > 0) \n\t{\n\tfor (i = 0; i < baseComponentsNumber; i++) //we generate the baseComponents, then scatter them along the box defined by the user, and randomly rotate them\n\t\t{\n\t\tjustCreated=Instantiate(baseComponents[Mathf.Floor(Random.Range(0, baseComponents.length))], transform.position, transform.rotation);\t\n\t\tjustCreated.transform.parent=transform;\n\n\t\tjustCreated.transform.localPosition.x+=Random.Range(-xSize/2, xSize/2); //setting its random position among these boundaries\n\t\tjustCreated.transform.localPosition.y+=Random.Range(-ySize/2, ySize/2);\n\t\tjustCreated.transform.localPosition.z+=Random.Range(-zSize/2, zSize/2);\n\t\t\n\t\tjustCreated.transform.rotation=Random.rotation;\n\t\t}\n\t}\n\nif (detailsNumber > 0 && details.length > 0) \n\t{\n\tfor (i = 0; i < detailsNumber; i++) //we generate the details, then scatter them along the box defined by the user\n\t\t{\n\t\tjustCreated=Instantiate(details[Mathf.Floor(Random.Range(0, details.length))], transform.position, transform.rotation);\t\n\t\tjustCreated.transform.parent=transform;\n\t\t\n\t\tjustCreated.transform.localPosition.x+=Random.Range(-xSize/2, xSize/2); //setting its random position among these boundaries\n\t\tjustCreated.transform.localPosition.y+=Random.Range(-ySize/2, ySize/2);\n\t\tjustCreated.transform.localPosition.z+=Random.Range(-zSize/2, zSize/2);\n\t\t\t\t\n\t\t//details aren't rotated totally randomly, just in the boundaries of the defined deviations\n\t\tjustCreated.transform.Rotate(Vector3(Random.Range(-detailXDeviation, detailXDeviation), Random.Range(-detailYDeviation, detailYDeviation), Random.Range(-detailZDeviation, detailZDeviation)));\n\t\t\n\t\t}\n\t}\n}", "title": "" }, { "docid": "04f37af2cb33859200dd3fe6431791fa", "score": "0.53057367", "text": "function makeParts() {\r\n var particles = parts()\r\n\r\n particles.position.x += 5;\r\n particles.position.y += 0;\r\n //particles.velocity = new THREE.Vector3( 0.01, 0.01, 0 );\r\n scene.add( particles );\r\n particleSet.push( particles );\r\n}", "title": "" }, { "docid": "9b423429c89748b574b4f7c7e3751a09", "score": "0.5305575", "text": "function spawnTreasures() {\n spawnValuable(\"bronze-coin\", 6);\n spawnValuable(\"silver-coin\", 5);\n spawnValuable(\"gold-coin\", 4);\n spawnValuable(\"gem\", 2);\n}", "title": "" }, { "docid": "a500ac7a888dc1236eb657fb52534cec", "score": "0.5299049", "text": "function sceneOne() {\n var character = new TimelineLite(),\n codeST = new SplitText($tmx, {type:\"words, chars\"});\n \n character.fromTo($monstaP, 4, {drawSVG:\"50% 50%\"}, {drawSVG:true, ease:Power2.easeOut});\n character.from($monstaP, 3, {fill:\"none\", ease:Power2.easeOut}, \"-=1\");\n character.to($monstaP, 2, {stroke:\"none\", ease:Power2.easeOut}, \"-=2\");\n\n character.fromTo($frogPath, 4, {drawSVG:\"50% 50%\"}, {drawSVG:true, ease:Power2.easeOut});\n character.from($frogPath, 3, {fill:\"none\", ease:Power2.easeOut}, \"-=1\");\n character.to($frogPath, 2, {stroke:\"none\", ease:Power2.easeOut}, \"-=2\");\n\n character.fromTo($cartoonPath, 4, {drawSVG:\"50% 50%\"}, {drawSVG:true, ease:Power2.easeOut});\n character.from($cartoonPath, 3, {fill:\"none\", ease:Power2.easeOut}, \"-=1\");\n character.to($cartoonPath, 2, {stroke:\"none\", ease:Power2.easeOut}, \"-=2\");\n\n character.add(\"blink-=1\");\n character.from($comment, 0.7, {opacity:0, scale:0, transformOrigin:\"0% 50%\", ease:Power4.easeOut}, \"blink\");\n character.staggerFrom(codeST.chars, 0.1, {opacity:0, scale:0.8, ease:Power4.easeOut}, 0.03, \"blink+=1\");\n character.staggerTo(codeST.chars, 0.1, {color:\"#509EA4\", ease:Power4.easeOut}, 0.03, \"blink+=1.1\");\n character.to($eye, 0.23, {scaleY:0, repeat:100, yoyo:true, transformOrigin: \"50% 50%\", ease:Power4.easeInOut}, \"blink+=4.3\");\n character.to($pupil, 0.23, {scaleY:0, repeat:3, yoyo:true, transformOrigin: \"50% 50%\", ease:Power4.easeInOut}, \"blink+=4.3\");\n character.to($comment, 0.8, {opacity:0, scale:0.8, transformOrigin:\"50% 50%\", ease:Power4.easeOut}, \"blink+=4.5\");\n \n return character;\n}", "title": "" }, { "docid": "3695b1d781d035fbae1aa97c8fc552a7", "score": "0.5294389", "text": "function init_run () {\n let run_array = [], sprites = [];\n compile_array = [];\n log(\"initiate run\");\n //fill the sprites array with needed info\n get_sprites().forEach((a, i) => {\n sprites[i] = a.group;\n });\n\n for (let i = 0; i < sprites.length; i++) {\n run_array[i] = sprites[i].filter((a) => {\n return a != 0 && a.length > 1 && a[0].type === \"start\";\n });\n }\n let i = 0;\n for (i = 0; i < run_array.length; i++) { //first of the layers\n compile_array[i] = [];\n let arr = run_array[i];//select the group of the first arrays\n for (let i2 = 0; i2 < arr.length; i2++) {\n let arr2 = arr[i2];//this is going to slect the specific group\n for (let i3 = 0; i3 < arr2.length; i3++) {\n compile_array[i][compile_array[i].length] = arr2[i3];\n }\n }\n }\n log(compile_array);\n reset();\n run_next(0);\n}", "title": "" }, { "docid": "cd1eb8bad09db849e8c27e5f0e57b062", "score": "0.52911735", "text": "function add_char_scenes(chars, scenes, links, groups, panel_shift, comic_name) {\n 'use strict';\n // Shit starting times for the rest of the scenes panel_shift panels to the left\n var char_scenes = [];\n scenes.forEach(function(scene) {\n if (!equal_scenes) {\n scene.start += panel_shift;\n }\n });\n\n // Set y values\n var cury = 0;\n groups.forEach(function(g) {\n var height = g.all_chars.length * text_height;\n g.min = cury;\n g.max = g.min + height;\n cury += height + group_gap;\n });\n\n for (var i = 0; i < chars.length; i++) {\n var s = new SceneNode([chars[i].id], [0], [1]);\n s.char_node = true;\n s.y = i * text_height;\n s.x = 0;\n s.width = 5;\n s.height = link_width;\n s.name = chars[i].name;\n s.chars[s.chars.length] = chars[i].id;\n s.id = scenes.length;\n s.comic_name = comic_name;\n if (chars[i].first_scene) {\n var l = new Link(s, chars[i].first_scene, chars[i].group, chars[i].id);\n l.char_ptr = chars[i];\n\n s.out_links[s.out_links.length] = l;\n chars[i].first_scene.in_links[chars[i].first_scene.in_links.length] = l;\n links[links.length] = l;\n s.first_scene = chars[i].first_scene;\n\n scenes[scenes.length] = s;\n char_scenes[char_scenes.length] = s;\n s.median_group = chars[i].first_scene.median_group;\n } // if\n } // for\n return char_scenes;\n} // add_char_scenes", "title": "" }, { "docid": "81537e445a5d89e1b1564005e0badf98", "score": "0.5280948", "text": "function freeze() { \n if(current.some(index => squares[currentPosition + index + width].classList.contains('block3')\n || squares[currentPosition + index + width].classList.contains('block2'))) { \n current.forEach(index => squares[index + currentPosition].classList.add('block2'));\n\n random = nextRandom;\n nextRandom = Math.floor(Math.random() * theTetrominoes.length);\n current = theTetrominoes[random][currentRotation];\n currentPosition = 4;\n draw();\n displayShape();\n gameOver();\n addScore();\n } \n }", "title": "" }, { "docid": "7c98c4e4db7c6c090ead5d780a20f858", "score": "0.5279135", "text": "function createAll(){\n\tvar height_pos = 0;\n\tvar x_middle_pos = 0;\n\tvar n = 0;\n\n\twire_material = new THREE.MeshBasicMaterial( {color:0xDCDCDC, wireframe:true} );\n\n\tellipse1_material = new THREE.MeshBasicMaterial( {color:solids_colors[0], wireframe:true} );\n\tsolids_materials.push(ellipse1_material);\n\tellipse2_material = new THREE.MeshBasicMaterial( {color:solids_colors[1], wireframe:true} );\n\tsolids_materials.push(ellipse2_material);\n\tellipse3_material = new THREE.MeshBasicMaterial( {color:solids_colors[2], wireframe:true} );\n\tsolids_materials.push(ellipse3_material);\n\tellipse4_material = new THREE.MeshBasicMaterial( {color:solids_colors[3], wireframe:true} );\n\tsolids_materials.push(ellipse4_material);\n\n\tcircular1_material = new THREE.MeshBasicMaterial( {color:solids_colors[4], wireframe:true} );\n\tsolids_materials.push(circular1_material);\n\tcircular2_material = new THREE.MeshBasicMaterial( {color:solids_colors[5], wireframe:true} );\n\tsolids_materials.push(circular2_material);\n\tcircular3_material = new THREE.MeshBasicMaterial( {color:solids_colors[6], wireframe:true} );\n\tsolids_materials.push(circular3_material);\n\tcircular4_material = new THREE.MeshBasicMaterial( {color:solids_colors[7], wireframe:true} );\n\tsolids_materials.push(circular4_material);\n\n\tcube1_material = new THREE.MeshBasicMaterial( {color:solids_colors[8], wireframe:true} );\n\tsolids_materials.push(cube1_material);\n\tcube2_material = new THREE.MeshBasicMaterial( {color:solids_colors[9], wireframe:true} );\n\tsolids_materials.push(cube2_material);\n\tcube3_material = new THREE.MeshBasicMaterial( {color:solids_colors[10], wireframe:true} );\n\tsolids_materials.push(cube3_material);\n\tcube4_material = new THREE.MeshBasicMaterial( {color:solids_colors[11], wireframe:true} );\n\tsolids_materials.push(cube4_material);\n\n\t//First 3 wires (2 vertical 1 horizontal) for the first solid\n\tcreateWire(0, 16.5, 0, WIRE_VERTICAL, 0, n);\n\tcreateWire(-0.7*WIRE_HORIZONTAL/2, 16.5-WIRE_VERTICAL/2, 0, WIRE_HORIZONTAL, Math.PI/2, n);\n\tcreateWire(-1.7*WIRE_HORIZONTAL/2, 16.5-WIRE_VERTICAL, 0, WIRE_VERTICAL, 0, n);\n\tx_middle_pos = 0.3*WIRE_HORIZONTAL/2;\n\theight_pos = 16.5-(3/2)*WIRE_VERTICAL;\n\t\n\trotation_wires_posX.push(0);\n\tvar translated = rotation_wires_posX[rotation_wires_posX.length-1];\n\n\t//While used to create all the other segments of the mobile being each segment 3 wires and the solid\n\twhile(n<10){\n\n\t\tcreateSegment(x_middle_pos-translated,height_pos,n);\n\t\t\n\t\tif(n <= 3)\n\t\t\tcreateFlatEllipticalCylinder(x_middle_pos-WIRE_HORIZONTAL-translated, height_pos - solids_sizes[n]/2, solids_sizes[n], solids_materials[n]);\n\n\t\telse if(n > 3 && n <= 7)\n\t\t\tcreateFlatCircularCylinder(x_middle_pos-WIRE_HORIZONTAL-translated, height_pos - solids_sizes[n]/2, 0, solids_sizes[n], solids_materials[n]);\n\t\t\n\t\telse\n\t\t\tcreateFlatCube(x_middle_pos-WIRE_HORIZONTAL-translated, height_pos - solids_sizes[n]/2, 0, solids_sizes[n], solids_materials[n]); \n\t\t\n\t\ttranslated = rotation_wires_posX[rotation_wires_posX.length-1];\n\t\tx_middle_pos = x_middle_pos + 0.3*WIRE_HORIZONTAL/2;\n\t\theight_pos = height_pos-WIRE_VERTICAL;\t\n\t\tn++;\n\t}\n\t\n\tcreateFlatCube(x_middle_pos-WIRE_HORIZONTAL-translated, height_pos - solids_sizes[n]/2, 0, solids_sizes[n], solids_materials[n]);\n\tn++;\n\n\tcreateWire(x_middle_pos-translated,height_pos+WIRE_VERTICAL/2,0,WIRE_VERTICAL,0,n);\n\tcreateFlatCube(x_middle_pos-translated, height_pos - solids_sizes[n]/2, 0, solids_sizes[n], solids_materials[n]);\n\n\tprimary_segment.add(secondary_segment);\n\tprimary_segment.add(tertiary_segment);\n\n\tsecondary_segment.position.x = rotation_wires_posX[1];\n\tsecondary_segment.add(tertiary_segment);\n\n\ttertiary_segment.position.x = rotation_wires_posX[2]-rotation_wires_posX[1];\n\n\tscene.add(primary_segment);\n}", "title": "" }, { "docid": "835deecf38adb1f1509c2c6246c43fe7", "score": "0.5272849", "text": "async function loadMeshes(){\n \n environment = await utils.loadMesh(\"/assets/Others/environment.obj\");\n sling = await utils.loadMesh(\"/assets/Others/sling.obj\");\n elastic = await utils.loadMesh(\"/assets/Others/slingElastic.obj\");\n birdRed = await utils.loadMesh(\"/assets/Birds/red.obj\");\n birdChuck = await utils.loadMesh(\"/assets/Birds/chuck.obj\");\n birdBomb = await utils.loadMesh(\"/assets/Birds/bomb.obj\");\n birdMatilda = await utils.loadMesh(\"/assets/Birds/matilda.obj\"); \n egg = await utils.loadMesh(\"/assets/Others/egg.obj\");\n plumeExplosion = await utils.loadMesh(\"/assets/Others/plume.obj\");\n rock1 = await utils.loadMesh(\"/assets/Others/rock1.obj\");\n rock2 = await utils.loadMesh(\"/assets/Others/rock2.obj\");\n\n structureObjs.push(new structureObjects(0.0, -5.0 , 0.0, 0.0, 0.0, 0.0, \"egg\", 8, 10 ));\n structureObjs.push(new structureObjects(0.0, 0.0 , 5.0, 0.0, 0.0, 0.0, \"rock1\", 33, 99999 ));\n structureObjs.push(new structureObjects(0.0, 0.35 , 8.2, 0.0, 0.0, 0.0, \"rock2\", 59, 99999 ));\n \n //randomize birds\n randomizeBirds(birdChuck, birdRed, birdBomb, birdMatilda);\n\n //randomize pigs\n randomizePigs();\n \n //pseudo randomize blocks\n await defineStructureObjs();\n\n allMeshes = [\n environment, //0\n sling, //1\n bird1, //2\n bird2, //3\n bird3, //4\n bird4, //5\n bird5, //6\n elastic, //7\n egg, //8\n plumeExplosion, //9\n pig11, //10\n pig12, //11\n pig13, //12\n tower11, //13\n tower12, //14\n tower13, //15\n tower14, //16\n tower15, //17\n tower16, //18\n tower17, //19\n tower18, //20\n tower19, //21\n tower110, //22\n tower111, //23\n tower112, //24\n tower113, //25\n tower114, //26\n tower115, //27\n tower116, //28\n tower117, //29\n tower118, //30\n tower119, //31\n tower120, //32\n rock1, //33\n pig21, //34\n pig22, //35\n pig23, //36\n pig24, //37\n pig25, //38\n tower21, //39\n tower22, //40\n tower23, //41\n tower24, //42\n tower25, //43\n tower26, //44\n tower27, //45\n tower28, //46\n tower29, //47\n tower210, //48\n tower211, //49\n tower212, //50\n tower213, //51\n tower214, //52\n tower215, //53\n tower216, //54\n tower217, //55\n tower218, //56\n tower219, //57\n tower220, //58\n rock2, //59\n pig31,\t\t\t\t //60\n tower31,\t\t\t\t//61\n tower32,\t\t\t\t//62\n tower33,\t\t\t\t//63\n tower34,\t\t\t\t//64\n tower35,\t\t\t\t//65\n tower36,\t\t\t\t//66\n tower37\t\t\t\t //67\n ];\n\n}", "title": "" }, { "docid": "5c10b1ef0ddf96f6a73d2a398fa30a2f", "score": "0.5267584", "text": "function generatePipes(){\n pipeY = game.rnd.integerInRange(-100, 100);\n pipeGroup = pipes.getFirstExists(false);\n if(!pipeGroup) {\n \n pipeGroup = game.add.group(pipes);\n \n topPipe = pipeGroup.create(0, 0, 'pipe');\n topPipe.frame = 0;\n\n topPipe.anchor.setTo(0.5, 0.5);\n game.physics.arcade.enableBody(topPipe);\n\n topPipe.body.allowGravity = false;\n topPipe.body.immovable = true;\n\n\n bottomPipe = pipeGroup.create(0, 0, 'pipe');\n bottomPipe.frame = 1;\n\n bottomPipe.anchor.setTo(0.5, 0.5);\n game.physics.arcade.enableBody(bottomPipe);\n\n bottomPipe.body.allowGravity = false;\n bottomPipe.body.immovable = true;\n\n pipeGroup.setAll('body.velocity.x', -200);\n }\n resetPipeGroup(game.width, pipeY);\n}", "title": "" }, { "docid": "4ef1ff467097f6b631a2434f48b3ce97", "score": "0.5263495", "text": "function chunkify(container, entity){\n var roomPath = container.getElementsByTagName(\"path\")[0];\n \n var defs = document.createElementNS(\"http://www.w3.org/2000/svg\",\"defs\");\n container.insertBefore(defs,container.firstChild);\n\n //Create a clipping path to control where the chunks can be interacted with\n\n // NOTE: `clipPath` is case-sensative during declaration of a new element, apparently\n var fillClipPath = document.createElementNS(\"http://www.w3.org/2000/svg\",\"clipPath\");\n defs.appendChild(fillClipPath);\n fillClipPath.setAttribute(\"id\",entity.objectID+\"-fillClipPath\");\n var fillPath = document.createElementNS(\"http://www.w3.org/2000/svg\",\"path\");\n fillClipPath.appendChild(fillPath);\n fillPath.setAttribute(\"d\",roomPath.getAttribute(\"d\"));\n\n //generate chunks\n\n for(k=0; k < entity.infoSets.length;k++){\n var g = document.createElementNS(\"http://www.w3.org/2000/svg\",\"g\");\n container.insertBefore(g, roomPath)\n var chr = \"-\"+String.fromCharCode(65 + k);\n g.setAttribute(\"id\", entity.objectID + chr);\n g.setAttribute(\"class\",\"roomChunk\");\n var rect = document.createElementNS(\"http://www.w3.org/2000/svg\",\"rect\");\n g.appendChild(rect);\n bbHeight = parseFloat(roomPath.getBBox().height);\n bbWidth = parseFloat(roomPath.getBBox().width);\n var wide = bbWidth > bbHeight;\n rect.setAttribute(\"x\",(entity.infoSets.length > 1 && wide)?(k*(bbWidth/entity.infoSets.length)):\"0\");\n rect.setAttribute(\"y\",(entity.infoSets.length > 1 && !wide)?(k*(bbHeight/entity.infoSets.length)):\"0\");\n rect.setAttribute(\"width\",(entity.infoSets.length > 1 && wide)?(bbWidth/entity.infoSets.length):bbWidth);\n rect.setAttribute(\"height\",(entity.infoSets.length > 1 && !wide)?(bbHeight/entity.infoSets.length):bbHeight);\n rect.setAttribute(\"clip-path\",\"url(#\"+entity.objectID+\"-fillClipPath)\");\n rect.setAttribute(\"class\",\"roomChunkBG\");\n rect.addEventListener('click', function(){displayInfo(entity.format, entity.objectID)}, false);\n\n applyLabel(entity, k, wide);\n }\n\n\n\n\n}", "title": "" }, { "docid": "46b6c51915ae7374d08a7f160deedc22", "score": "0.52623725", "text": "function setPieces() {\n for (var i = 0; i <= 14; i++) {\n createPiece(\"p\" + (i + 1));\n }\n}", "title": "" }, { "docid": "8ed9b028d09f0444fe47f5cdac697f78", "score": "0.52516055", "text": "function render_stuff() {\n render_hero();\n render_blocks();\n}", "title": "" }, { "docid": "732bde92cf780aad89108aadea7c1f02", "score": "0.52440906", "text": "function makewall () {\n var x=0; var y=0;\n\n for (y=1; y<=my; y++) { // iterate through all the scene\n for (x=1; x<=mx; x++) {\n var fn='p1.gif'; // default image filename \n\n // create the string from the scene array \n mask= c[y-1][x ] +\n c[y ][x-1]+c[y ][x ]+c[y ][x+1]+\n c[y+1][x ] ;\n mask=mask.replace(/X/g, 'x'); // replace all X to x - needed because clock digits which use X (x is for simple walls)\n\n // define image filename based on wall placement \n switch (mask) {\n case \"x x x\": \n fn='12-2.gif';\n break;\n case \" xxx \": \n fn='11-9.gif';\n break; \n case \"x xx \": \n fn='11-4.gif';\n break; \n case \"xxx \": \n fn='11-3.gif';\n break; \n case \" xxx\": \n fn='11-11.gif';\n break;\n case \" xx x\": \n fn='11-2.gif';\n break; \n case \"x xxx\": \n fn='a1.gif';\n break; \n case \" xxxx\": \n fn='a2.gif';\n break; \n case \"xxx x\": \n fn='a3.gif';\n break; \n case \"xxxx \": \n fn='a4.gif';\n break; \n case \"xxxxx\": \n fn='a5.gif';\n break; \n case \" xx \": \n fn='5-5.gif';\n break; \n case \" xx \": \n fn='5-8.gif';\n break; \n case \"x x \": \n fn='b1.gif';\n break; \n case \" x x\": \n fn='b2.gif';\n break; \n case \" x \": \n fn='a6.gif';\n break; \n }\n\n // remove the current object from Wade scene \n wade.removeSceneObject(s[y][x]); \n\n // if current [x,y] character is an X then put the 'new' string before the filename -> white walls\n if (c[y][x]=='X') {\n s[y][x]=new SceneObject(new Sprite('pics/new'+fn,5));\n } else {\n s[y][x]=new SceneObject(new Sprite('pics/'+fn,5)); // image file for simple walls \n }\n s[y][x].setPosition(mx*8+4,my*8+4); // set it's position\n \n wade.addSceneObject(s[y][x]); // and add back to the scene \n //s[y][x].moveTo(x*16,y*16, 500); // move the new wall object to it's place from the center slowly\n\n } \n }\n let startX=getRandomInt(0,mx)*16; // the end where walls collapse if time has changed\n let startY=getRandomInt(0,my)*16;\n let redrawType=getRandomInt(0,9); \n let radian=Math.PI/180;\n\n // no effects\n for (y=1; y<=my; y++) { // iterate through all the scene\n for (x=1; x<=mx; x++) {\n s[y][x].setPosition(x*16,y*16);\n }\n }\n\n // effects\n /*\n for (y=1; y<=my; y++) { // iterate through all the scene\n for (x=1; x<=mx; x++) {\n switch (redrawType) {\n case 0:\n s[y][x].setPosition(startX,startY); \n s[y][x].moveTo(x*16,y*16, getRandomInt(300,500)); // move the new wall object to it's place\n break;\n case 1: \n s[y][x].setPosition(getRandomInt(-1000,1000),getRandomInt(-1000,1000)); \n s[y][x].moveTo(x*16,y*16, 700); \n break;\n case 2: \n s[y][x].setPosition(x*16,0); \n s[y][x].moveTo(x*16,y*16, 300); \n break;\n case 3: \n s[y][x].setPosition(0,y*16); \n s[y][x].moveTo(x*16,y*16, 400); \n break;\n \n case 4: \n s[y][x].setPosition((x-(mx-2)/2)*160,(y-(my-2)/2)*160); \n s[y][x].moveTo(x*16,y*16, 1000); \n break;\n case 5: \n s[y][x].setPosition(x*16,my*16); \n s[y][x].moveTo(x*16,y*16, 200+(my-y)*3-getRandomInt(0,150)); \n break;\n case 6: \n s[y][x].setPosition((mx-x)*16,startY); \n s[y][x].moveTo(x*16,y*16, 300); \n break;\n case 7: \n s[y][x].setPosition((mx-x)*16,(my-y)*16); \n s[y][x].moveTo(x*16,y*16, 300); \n break;\n case 8: \n s[y][x].setPosition(x*16,(Math.sin(x)+Math.cos(x))*my*16); \n s[y][x].moveTo(x*16,y*16, 400); \n break;\n case 9: \n s[y][x].setPosition(mx*16+x*2*16,y*16); \n s[y][x].moveTo(x*16,y*16, 400); \n break;\n }\n }\n }\n */ \n\n \n}", "title": "" }, { "docid": "28cad90d0a1ea30a7810d29a626e70a1", "score": "0.52428883", "text": "function Start()\n{\n //FIRST SPAWN\n var Startobj : GameObject = itemsPrefabs[Random.Range(0, itemsPrefabs.length)]; // Randomize the different items to instantiate.\n var Startpos : Transform = spawnPoints[Random.Range(0, spawnPoints.length)]; // Randomize the spawnPoints to instantiate item at next.\n Instantiate(Startobj, Startpos.position, Startpos.rotation);\n //// SECOND SPAWN\n var Startobj2 : GameObject = itemsPrefabs[Random.Range(0, itemsPrefabs.length)]; // Randomize the different items to instantiate.\n var Startpos2 : Transform = spawnPoints[Random.Range(0, spawnPoints.length)]; // Randomize the spawnPoints to instantiate item at next.\n Instantiate(Startobj2, Startpos2.position, Startpos2.rotation);\n //// THIRD SPAWN\n var Startobj3 : GameObject = itemsPrefabs[Random.Range(0, itemsPrefabs.length)]; // Randomize the different items to instantiate.\n var Startpos3 : Transform = spawnPoints[Random.Range(0, spawnPoints.length)]; // Randomize the spawnPoints to instantiate item at next.\n Instantiate(Startobj3, Startpos3.position, Startpos3.rotation);\n\n Spawn();\n}", "title": "" }, { "docid": "a05a6a3e3feff27701d9471baa21a26b", "score": "0.5241184", "text": "function init() {\n\n ///implement your functionality here in this fill please \n\n scene = new THREE.Scene();\n //Screen size is equal to the size of our environment\n camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);\n\n renderer = new THREE.WebGLRenderer();\n renderer.setSize(window.innerWidth, window.innerHeight);\n document.body.appendChild(renderer.domElement);\n //Background color\n\n scene.background = new THREE.Color(0x161a1d);\n\n var geometry = new THREE.BoxGeometry(1, 0.1, 1);\n /*Material places where piece can't put it.*/\n var parkBoxMaterial = new THREE.MeshStandardMaterial({ color: 0x2B343B, wireframe: false })\n /*Material places where piece can put it.*/\n var wayBoxMaterial = new THREE.MeshStandardMaterial({ color: 0x3D4851, wireframe: false })\n //var cube = new THREE.Mesh(geometry,material);\n /////////////////\n /*Material pieces */\n var cylGeometry = new THREE.CylinderGeometry(0.3, 0.4, 0.3, 100, 1, false, 400, 6.3);\n\n //var cylinder = new THREE.Mesh(cylGeometry, material);\n //cylinder.position.set(8, 0.1, 4);\n ///cylinder.userData.cylinderNumber = 1;\n //scene.add(cylinder);\n\n // var cylinderPlayer2 = new THREE.Mesh(cylGeometry, material2);\n // cylinderPlayer2.position.set(4, 0.1, 4);\n // cylinderPlayer2.userData.cylinderNumber = 2;\n // scene.add(cylinder2);\n\n //Give light to shapes\n var light = new THREE.PointLight(0xFFFFFF, 1.5, 70, 2);\n light.position.set(4, 10, 4);\n //Add light to an environment\n scene.add(light);\n ///////////////\n wayGroup = new THREE.Group();\n parkGroup = new THREE.Group();\n standGroup1 = new THREE.Group();\n standGroup2 = new THREE.Group();\n\n var cylinderNumber = 1;//Giving value to each piece to simplify access to it.\n //The first three pieces belong to the first player (1,2,3).\n //The last three pieces belong to the second player (4,6,7).\n\n for (let i = 0; i < 9; i++) {\n let cylinder;\n if (i == 1 || i == 2 || i == 3) {\n cube = new THREE.Mesh(geometry, parkBoxMaterial);\n cube.position.set(-1, 1, i);\n standGroup1.add(cube);\n\n var materialPlayer1 = new THREE.MeshStandardMaterial({ color: 0x660708 });\n cylinder = new THREE.Mesh(cylGeometry, materialPlayer1);\n cylinder.position.set(-1, 1.1, i);\n cylinder.userData.cylinderNumber = cylinderNumber;\n cylinder.userData.playerNumber = 1;\n cylinder.userData.onBoard = false;\n cylinder.userData.currentSquareNumber = 0;\n scene.add(cylinder);\n cylindersGroup1.push(cylinder);\n cylinderNumber++;\n }\n\n else if (i == 5 || i == 6 || i == 7) {\n cube = new THREE.Mesh(geometry, parkBoxMaterial);\n cube.position.set(-1, 1, i);\n standGroup2.add(cube);\n var materialPlayer2 = new THREE.MeshStandardMaterial({ color: 0x0b090a });\n cylinder = new THREE.Mesh(cylGeometry, materialPlayer2);\n cylinder.position.set(-1, 1.1, i);\n cylinder.userData.cylinderNumber = cylinderNumber;\n cylinder.userData.playerNumber = 2;\n cylinder.userData.onBoard = false;\n cylinder.userData.currentSquareNumber = 0;\n scene.add(cylinder);\n cylindersGroup2.push(cylinder);\n cylinderNumber++;\n }\n }\n // console.log(\"\")\n scene.add(standGroup1);\n scene.add(standGroup2)\n\n let squareNumber = 1;\n for (let x = 0; x < 9; x++) {\n for (let z = 0; z < 9; z++) {\n let cube;\n if (((x + z) % 4) == 0 && (x % 4 == 0) && (z % 4 == 0)) {\n /*Determine in the environment the places where the piece can put it.*/\n cube = new THREE.Mesh(geometry, parkBoxMaterial);\n cube.position.set(x, 0, z);\n cube.userData.squareNumber = squareNumber;\n cube.userData.busy = false;\n squareNumber++;\n parkGroup.add(cube);\n }\n else if (((x == 1 || x == 2 || x == 3 || x == 5 || x == 6 || x == 7) && (z % 4 == 0)) || ((z == 1 || z == 2 || z == 3 || z == 5 || z == 6 || z == 7) && (x % 4 == 0))) {\n /*Determine in the environment the places where the piece can't put it.*/\n cube = new THREE.Mesh(geometry, wayBoxMaterial);\n cube.position.set(x, 0, z);\n wayGroup.add(cube);\n }\n else continue;\n }\n }\n\n\n //console.log(squareNumber);\n\n //Add the places to an environment \n scene.add(wayGroup);\n scene.add(parkGroup);\n //Camera position\n camera.position.z = 10;\n camera.position.x = 4;\n camera.position.y = 4;\n\n ////Controls Camera\n controls = new THREE.OrbitControls(camera, renderer.domElement);\n\n controls.target.set(4, 0, 4);\n controls.enableDamping = true;\n controls.enablePan = false;\n controls.maxPolarAngle = Math.PI / 2.5;\n ////controls \n mouse = new THREE.Vector2();\n raycaster = new THREE.Raycaster();\n raycaster.far = 15;\n window.requestAnimationFrame(GameLoop);\n\n}", "title": "" }, { "docid": "5df1dbbb8f389f2145504ad018c3f770", "score": "0.5239459", "text": "function spawnObjects() {\n\t//Spawn spawns (lol)//\n\tif(spawnCounter >= spawnCounterTarget) {\n\t\trandX = getRandomNumber(100,canvas.width);\n\t\t//randY = getRandomNumber(0,canvas.height/4); //Only spawn on top fourth of canvas screen\n\t\tspawns.push(new Spawn(randX,0,0,0,23,23,'yellow'));\n\t\tspawnCounter = 0;\n\t}\n\telse {\n\t\tspawnCounter += 1;\n\t}\n\n\t//Spawn platforms//\n\tif(platformCounter == platformCounterTarget) {\n\t\trandWidth = getRandomNumber(40,90);\n\t\tspawnHeight = 10;\n\t\trandX = getRandomNumber(canvas.width,canvas.width+(randWidth*2));\n\t\trandY = getRandomNumber(canvas.height/2,canvas.height-(spawnHeight*3));\n\t\tplatforms.push(new Platform(randX,randY,randWidth,spawnHeight,'#000000'));\n\t\tplatformCounter = 0;\n\t}\n\telse {\n\t\tplatformCounter += 1;\n\t}\n}", "title": "" }, { "docid": "d969959778b22b9a171e6a7fd75ed6e9", "score": "0.5236521", "text": "function createMoreDummyCreatures(){\n\n //Create a bunch more dummy creatures for testing pusposes\n var soul = new Soul(\"stone\");\n var s = new Skin('fire');\n var b = new Body(s, new Bones('ice'), new Guts('air'));\n player.myCreatures.push(new PlayerCharacter(\"Zappo\", b, soul, imageLoader.goblinImg));\n player.myCreatures.push(new PlayerCharacter(\"Chip\", b, soul, imageLoader.goblinImg));\n player.myCreatures.push(new PlayerCharacter(\"Flak\", b, soul, imageLoader.goblinImg));\n player.myCreatures.push(new PlayerCharacter(\"Rhombuz\", b, soul, imageLoader.goblinImg));\n player.myCreatures.push(new PlayerCharacter(\"Mallow\", b, soul, imageLoader.goblinImg));\n player.myCreatures.push(new PlayerCharacter(\"Wumba\", b, soul, imageLoader.goblinImg));\n player.myCreatures.push(new PlayerCharacter(\"Yach\", b, soul, imageLoader.goblinImg));\n player.myCreatures.push(new PlayerCharacter(\"Fungus\", b, soul, imageLoader.goblinImg));\n player.myCreatures.push(new PlayerCharacter(\"Lobe\", b, soul, imageLoader.goblinImg));\n player.myCreatures.push(new PlayerCharacter(\"Grand Master\", b, soul, imageLoader.goblinImg));\n\n}//end createMoreDummyCreatures()", "title": "" }, { "docid": "28f536247b6629c950fe4ff171045a19", "score": "0.5235341", "text": "function generate() {\n objects = [];\n layers = [];\n /* if ( world.hasChildNodes() ) {\n while ( world.childNodes.length >= 1 ) {\n world.removeChild( world.firstChild ); \n } \n }*/\n\n for( var i = 0; i < 300; i++ )\n {\n objects.push(createCloud('floor') );\n }\n\n for( var j = 0; j < 24; j++ ) \n {\n objects.push( createCloud('puff') );\n }\n}", "title": "" }, { "docid": "9c10154820e08887d621c3966098e365", "score": "0.5229263", "text": "function startDestroyBlock(x, y, z, side) {\n var block = Level.getTile(x, y, z);\n if(block == 181 || block == 182 || block == 186) {\n clientMessage(\"Make sure you empty the barrel first or the liquid will be lost!\");\n }\n}", "title": "" }, { "docid": "88bc16ba5a8143fdd293ee89cac31599", "score": "0.5228102", "text": "spawn() {\n const self = this;\n let territory = this.lobby.world.findSpawn();\n self.conn.emit('chunk', territory.chunk.networkObject);\n territory.chunk.neighbours.forEach(networkChunk => {\n self.conn.emit('chunk', networkChunk);\n });\n self.conn.emit('spawn', { territory: territory.networkObject });\n }", "title": "" }, { "docid": "77d79942094f991ca8043863d32da029", "score": "0.5225132", "text": "function spawnClimber(){\n\tvar geo = new THREE.SphereGeometry(20);\n\tvar mat = new THREE.MeshLambertMaterial( { color: 0xf0ff00 } );\n\tvar climber = new THREE.Mesh( geo, mat );\n\t\n\tvar randomSpawnZ = Math.floor((Math.random()*300)-0);\n\tclimber.position.set(200,0,randomSpawnZ);\n\tmainScene.add( climber );\n\t\n\t/* Add a new variable to the mesh itself - its position in the climber array */\n\tclimber.climberArrayPosition = climberArray.length;\n\tclimberArray.push(new Climber(climber));\n\tclimberMeshArray.push(climber);\n}", "title": "" }, { "docid": "88ec62b8701a411bad3b327d2aed40c4", "score": "0.52241194", "text": "function buildSmallBuilding(scene) {\n\n /* Dimensions of the building : \n -15 columns of size 10, 15*10 = 200\n -4 floors of size 30, 4*30 = 120 \n -depth of 100\n -total : 200*480*240\n */\n var nbFloor = 4;\n var heightFloor = 30;\n var totalHeight = nbFloor*heightFloor\n\n var nbCol = 20;\n var widthCol = 10;\n var totalWidth = nbCol*widthCol;\n\n var depth = 75;\n\n var centerX = 250; //X coordinates of center\n var centerZ = -350; //Z coordinates of center\n\n var textureBricks = new THREE.TextureLoader().load( 'textures/bricks.jpg' );\n var materialBricks = new THREE.MeshPhongMaterial( { map: textureBricks, shininess:10 } );\n\n var textureWindows = [];\n var i;\n for (i = 0; i < 8; i++) {\n textureWindows.push(new THREE.MeshBasicMaterial( { map :new THREE.TextureLoader().load( 'textures/Windows/window'+(i+1)+'.jpg' ) } ));\n }\n\n\n var j;\n var block;\n //It would be more optimized to add every elements in the same loop but we create one for each one to keep the code clear and understandable\n //-----WALLS-----\n for (i = 0; i < nbFloor; i++) {\n for (j = 0; j < nbCol; j++) {\n \n var blockGeometry = new THREE.BoxGeometry(widthCol, heightFloor, depth);\n\n //We put brick textures on the first and the last block and windows in the middle\n if (j==0 || j==nbCol-1){\n block = new THREE.Mesh( blockGeometry, materialBricks );\n } else {\n block = new THREE.Mesh( blockGeometry, textureWindows[Math.floor(Math.random() * 8)] ); //Get a random window texture\n }\n //We pile up the blocks to build the structure\n block.position.y = i*heightFloor + (heightFloor/2);\n block.position.x = centerX - (totalWidth/2) + (j+0.5)*widthCol;\n block.position.z = centerZ;\n\n scene.add(block);\n }\n }\n\n //-----ROOF-----\n for (j = 0; j < nbCol; j++) {\n \n var blockGeometry = new THREE.BoxGeometry(widthCol, heightFloor/2, depth);\n //We put brick textures on the first and the last block and windows in the middle\n block = new THREE.Mesh( blockGeometry, materialBricks );\n //We pile up the blocks to build the structure\n block.position.y = nbFloor*heightFloor + (heightFloor/4);\n block.position.x = centerX - (totalWidth/2) + (j+0.5)*widthCol;\n block.position.z = centerZ;\n\n scene.add(block);\n }\n\n}", "title": "" }, { "docid": "62ab3230823751cc05b567221fda534d", "score": "0.5223279", "text": "function startGame() {\n\t//Create some initial towers\n\tfor (var i = 0; i < 120; i++) {\n\t\ttowers.push(new Vector2(parseInt(Math.random() * gridWidth), parseInt(Math.random() * gridHeight)));\n\t}\n\n\tgenerateDijkstraGrid();\n\tgeneratePathFromDijkstraGrid();\n}", "title": "" }, { "docid": "0dd1bc37257971666a3df8974f1d3dc8", "score": "0.52230585", "text": "function createCharacter(scene) {\n BABYLON.SceneLoader.ImportMeshAsync(Constants.characterMeshName, Constants.characterMeshPath, Constants.characterMeshFile, scene).then(function (result) {\n let character = result.meshes[0];\n\n character.position.y = 0.6;\n character.position.x = 40;\n character.position.z = 40;\n\n if (walls.some(intersectsChar)) {\n console.log(\"Ooops! Collision...\");\n character.position.x+=15;\n character.position.z+=15;\n }\n\n character.speed = Constants.speed;\n character.frontVector = new BABYLON.Vector3(0, 0, 1);\n character.scaling = new BABYLON.Vector3(Constants.charScale, Constants.charScale, Constants.charScale);\n character.checkCollisions = true;\n //character.rotation.z = 90;\n\n character.move = () => {\n if (inputStates.up) {\n character.moveWithCollisions(character.frontVector.multiplyByFloats(character.speed, character.speed, character.speed));\n }\n if (inputStates.down) {\n character.moveWithCollisions(character.frontVector.multiplyByFloats(-character.speed, -character.speed, -character.speed));\n\n }\n if (inputStates.left) {\n character.rotation.y -= Constants.charRotation;\n character.frontVector = new BABYLON.Vector3(Math.sin(character.rotation.y), 0, Math.cos(character.rotation.y));\n }\n if (inputStates.right) {\n character.rotation.y += Constants.charRotation;\n character.frontVector = new BABYLON.Vector3(Math.sin(character.rotation.y), 0, Math.cos(character.rotation.y));\n }\n }\n let a = scene.beginAnimation(result.skeletons[0], 0, 159, true, 1);\n\n }).then(() => {\n let character = scene.getMeshByName(Constants.characterMeshName);\n let followCamera = createFollowCamera(scene, character);\n let freeCamera = createFreeCamera(scene);\n cameras.push(followCamera);\n cameras.push(freeCamera);\n scene.activeCamera = followCamera;\n });\n}", "title": "" }, { "docid": "430aeaa5a6e5d7e723c888e86cccdcdf", "score": "0.52198845", "text": "function createTombs() {\n for (row = 0; row < cRows; row++) {\n for (col = 0; col < cCols; col++) {\n var tomb = new Tomb();\n tomb.box = new SAT.Box(new SAT.Vector(tombSize+(col*tombGapSize),tombSize+(row*tombGapSize)), tombSize, tombSize).toPolygon();\n tomb.box.translate(-20,-20);\n //add corresponding steps to tomb array of surrounding steps\n allSteps.forEach(function(step) {\n if(SAT.testPolygonPolygon(step.box, tomb.box)) {\n tomb.surroundingSteps.push(step);\n }\n });\n allTombs.push(tomb);\n }\n }\n}", "title": "" }, { "docid": "cc197d06b016c1e5532702d651d781fd", "score": "0.52160656", "text": "function createObjects() {\n objects = [];\n\n // Bounding Box of Canvas\n let boundaryTop = new Boundary(0, 0, width, 0);\n objects.push(boundaryTop);\n \n let boundaryRight = new Boundary(width, 0, width, height);\n objects.push(boundaryRight);\n\n let boundaryBottom = new Boundary(0, height, width, height);\n objects.push(boundaryBottom);\n\n let boundaryLeft = new Boundary(0, 0, 0, height);\n objects.push(boundaryLeft);\n\n // Other Surfaces\n\n for (let i = 0; i < 9; i++) {\n let boundingOffset = 50;\n let x1= random(boundingOffset, width - boundingOffset);\n let y1 = random(boundingOffset, height - boundingOffset);\n let x2 = random(boundingOffset, width - boundingOffset);\n let y2 = random(boundingOffset, height - boundingOffset);\n \n let randomLine = random([\n (x1, y1, x2, y2) => new LineObject(x1, y1, x2, y2),\n (x1, y1, x2, y2) => new Mirror(x1, y1, x2, y2),\n (x1, y1, x2, y2) => new UnreflectiveGlass(x1, y1, x2, y2)\n ])(x1, y1, x2, y2);\n objects.push(randomLine);\n }\n\n // let glass = new UnreflectiveGlass(width / 2, height / 2 + 50,\n // width / 2 + 50, height / 2 - 100);\n // objects.push(glass);\n\n // let mirror = new Mirror(width / 2 + 50, height / 2 + 100,\n // width / 2 + 50, height / 2 - 100);\n // objects.push(mirror);\n\n return objects;\n}", "title": "" }, { "docid": "1c0deeaba7fbb09a183986a63ba0da8b", "score": "0.5210322", "text": "function renderBarriers() {\n for (var i = 0; i < 12; i++) {\n placeItem(barrier);\n }\n}", "title": "" }, { "docid": "53dbd9ee64ed46b5693d8e1265c378c6", "score": "0.5204488", "text": "function initialLineupLoad() {\n var countOfBatmans = batmanCharacters.remainingBatmen;\n for (var i = 1; i <= countOfBatmans; i++) {\n loadCharBox(i - 1, \"#char-\" + i + \"-h4\", \"#char-\" + i + \"-image\", \"#char-\" + i + \"-health\");\n }\n}", "title": "" }, { "docid": "a4cbc4d992f76a84ab2ea5203d225535", "score": "0.5201997", "text": "addPipeRow() {\n if (this.pipes.length <= 2 || this.pipes.getAt(this.pipes.length - 1).x + this.pipes.getAt(this.pipes.length - 1).width <= 100) {\n const upperY = util.getRandomInt(50, 340)\n const pipeUpper = this.game.add.sprite(400, upperY, 'pipe');\n const pipeLower = this.game.add.sprite(400, upperY + 100, 'pipe');\n\n pipeLower.scale.setTo(0.2, 0.2)\n pipeUpper.scale.setTo(0.2, -0.2)\n\n this.game.physics.arcade.enable(pipeUpper);\n this.game.physics.arcade.enable(pipeLower);\n\n this.pipes.add(pipeUpper);\n this.pipes.add(pipeLower);\n\n /*\n const graphics = this.game.add.graphics(0, 0);\n graphics.beginFill(0xFF700B, 1);\n graphics.lineStyle(5, 0xffd900, 1);\n graphics.moveTo(-5, -5)\n graphics.lineTo(5, -5)\n graphics.lineTo(5, 5)\n graphics.lineTo(-5, 5)\n graphics.endFill()\n graphics.boundsPadding = 0;\n */\n\n //Vertical middle and horizontal right point of passing. Target for birds\n const passingPoint = this.game.add.sprite(448.6, upperY + 50)\n //passingPoint.addChild(graphics)\n this.game.physics.arcade.enable(passingPoint)\n this.pipesPassings.add(passingPoint)\n\n pipeLower.body.velocity.x = -200;\n pipeUpper.body.velocity.x = -200;\n passingPoint.body.velocity.x = -200;\n\n pipeLower.checkWorldBounds = true;\n pipeUpper.checkWorldBounds = true;\n passingPoint.checkWorldBounds = true;\n\n pipeLower.outOfBoundsKill = true;\n pipeUpper.outOfBoundsKill = true;\n passingPoint.outOfBoundsKill = true;\n passingPoint.events.onOutOfBounds.add(function (point) {\n point.destroy()\n });\n }\n }", "title": "" }, { "docid": "8e821049cf6cb29e0f9c43434ca32483", "score": "0.52015305", "text": "function generateCharacters(){\n for (let i=0; i<400; i++){\n itemAngles.push(0);\n itemStretches.push(10);\n const para = document.createElement(\"div\");\n para.className = \"grid-item\";\n para.setAttribute(\"id\", \"cell\"+i);\n\n const node = document.createTextNode(character.value);\n para.appendChild(node);\n container.appendChild(para);\n }\n}", "title": "" }, { "docid": "ee06f0b290ef05da2c893cf3b2f8bb39", "score": "0.5188396", "text": "function init() {\n // --------------------------------Firework------------------------------\n class Firework {\n // A firework contains the shell particle\n constructor() {\n this.firework = new Particle(\n Math.random() * 6 * (Math.round(Math.random()) * 2 - 1),\n 0,\n Math.random() * 20 * (Math.round(Math.random()) * 2 - 1),\n true\n );\n this.bursted = false;\n // A firework contains multiple particle\n this.particles = [];\n }\n // Check if the shell bursted and apply forces to the particles\n update() {\n if (!this.bursted) {\n this.firework.applyForce(gravity);\n this.firework.update();\n // When the shell velocity is 0, the shell bursted\n if (this.firework.velocity.y < 0) {\n this.bursted = true;\n this.firework.remove();\n this.burst();\n }\n }\n // Apply forces to the firework particles\n for (let i = this.particles.length - 1; i >= 0; i--) {\n this.particles[i].applyForce(gravity);\n this.particles[i].update();\n // Remove the particles than are not longer needed\n if (this.particles[i].complete()) {\n this.particles.splice(i, 1);\n }\n }\n }\n // Creates 100 particles for the shell particle\n burst() {\n for (let i = 0; i < 100; i++) {\n const particle = new Particle(\n this.firework.particle.position.x,\n this.firework.particle.position.y,\n this.firework.particle.position.z,\n false\n );\n this.particles.push(particle);\n }\n }\n // Check if we still need the firework\n complete() {\n if (this.bursted && this.particles.length === 0) {\n return true;\n }\n return false;\n }\n }\n // --------------------------------------------------------------------\n\n // ------------------------------Particle------------------------------\n class Particle {\n // Dynamically create a particle according to the type\n constructor(x, y, z, shell) {\n this.shell = shell;\n this.position = new THREE.Vector3(x, y, z);\n // Assign velocity according to the type\n if (this.shell) {\n this.velocity = new THREE.Vector3(0, Math.random() * 0.4, 0);\n } else {\n this.velocity = new THREE.Vector3(\n Math.random() * 0.4 * (Math.round(Math.random()) * 2 - 1),\n Math.random() * 0.4 * (Math.round(Math.random()) * 2 - 1),\n Math.random() * 0.4 * (Math.round(Math.random()) * 2 - 1)\n );\n this.velocity.multiplyScalar(\n Math.random() * 0.5 * (Math.round(Math.random()) * 2 - 1)\n );\n }\n this.acceleration = new THREE.Vector3(0, 0, 0);\n this.geometry = new THREE.Geometry();\n // Assign material according to the type\n if (this.shell) {\n this.material = new THREE.PointsMaterial({\n color: 'rgb(255,255,255)',\n transparent: true,\n opacity: 1,\n size: 0.06,\n });\n } else {\n this.material = new THREE.PointsMaterial({\n color: `rgb( ${Math.floor(\n Math.random() * Math.floor(255)\n )},${Math.floor(Math.random() * Math.floor(255))},${Math.floor(\n Math.random() * Math.floor(255)\n )})`,\n transparent: true,\n opacity: 1,\n size: 0.05,\n });\n }\n // Construct and render particle on scene\n this.particle = this.show();\n }\n // Construct and render particle on scene\n show() {\n this.geometry.vertices.push(this.position);\n const particle = new THREE.Points(this.geometry, this.material);\n particle.position.x = this.position.x;\n particle.position.z = this.position.z;\n scene.add(particle);\n return particle;\n }\n // Apply force to the acceleration\n applyForce(vector) {\n this.acceleration.add(vector);\n }\n // Adding forces to the particle position\n // Fade color for non-shell particle types\n update() {\n this.velocity.add(this.acceleration);\n this.particle.position.add(this.velocity);\n if (!this.shell) {\n this.particle.material.opacity -= 0.03;\n }\n }\n // Clear the memory manually in Three.js\n remove() {\n scene.remove(this.particle);\n this.geometry.dispose();\n this.material.dispose();\n renderer.renderLists.dispose();\n }\n // Checking if we need the particle\n complete() {\n if (this.particle.material.opacity < 0) {\n this.remove();\n return true;\n }\n return false;\n }\n }\n // --------------------------------------------------------------------\n\n // --------------Scene, Camera, Renderer, and Canvas-------------------\n // Setting scene and camera\n const scene = new THREE.Scene();\n // fov, aspect ratio, near, far\n const camera = new THREE.PerspectiveCamera(\n 75,\n window.innerWidth / window.innerHeight,\n 0.1,\n 1000\n );\n\n // Moving the camera along the z axis (towards the computer screen)\n // Moving the camera along the y axis (upwards)\n camera.position.z = 10;\n camera.position.y = 8;\n camera.rotation.x = 0;\n // Setting the renderer, color, size, and appending to the DOM\n const renderer = new THREE.WebGLRenderer({ antialias: true });\n renderer.setClearColor('#202020');\n renderer.setSize(window.innerWidth, window.innerHeight);\n document.body.appendChild(renderer.domElement);\n //--------------------------------------------------------------------\n\n // ----------------------Variables Initialisation---------------------\n const movement = [1, 0, -1];\n const rotation = [-0.01, 0, 0.01];\n let moveDirection = 'neutral';\n let rotateDirection = 'neutral';\n\n const fireworks = [];\n const gravity = new THREE.Vector3(0, -0.0002, 0);\n //--------------------------------------------------------------------\n\n // --------------------------------Loop------------------------------------\n function animate() {\n // Create Fireworks with a 50% of chance every frame\n if (Math.random() < 0.5) {\n fireworks.push(new Firework());\n fireworks.push(new Firework());\n }\n // Update and track each firework\n for (let i = fireworks.length - 1; i >= 0; i--) {\n fireworks[i].update();\n if (fireworks[i].complete()) {\n fireworks.splice(i, 1);\n }\n }\n // Rendering the scene and the camera\n renderer.render(scene, camera);\n requestAnimationFrame(animate);\n\n // Update camera position according to key pressed\n switch (moveDirection) {\n case 'neutral':\n camera.position.z += movement[1];\n break;\n case 'backwards':\n camera.position.z += movement[0];\n break;\n case 'forward':\n camera.position.z += movement[2];\n break;\n }\n // Update camera rotation according to key pressed\n switch (rotateDirection) {\n case 'neutral':\n camera.rotation.x += rotation[1];\n break;\n case 'backwards':\n camera.rotation.x += rotation[0];\n break;\n case 'forward':\n camera.rotation.x += rotation[2];\n break;\n }\n }\n // This function is called 60 frames per second\n animate();\n // ------------------------------------------------------------------------\n\n // -----------------------------Events-------------------------------------\n // Resize the renderer on window resize. Also adjust the camera ratio accordingly\n window.addEventListener('resize', () => {\n renderer.setSize(window.innerWidth, window.innerHeight);\n camera.aspect = window.innerWidth / window.innerHeight;\n camera.updateProjectionMatrix();\n });\n\n // W pressed then move forward\n document.addEventListener('keydown', function (event) {\n if (event.code == 'KeyW') {\n moveDirection = 'forward';\n }\n });\n // W released then do not move\n document.addEventListener('keyup', function (event) {\n if (event.code == 'KeyW') {\n moveDirection = 'neutral';\n }\n });\n // S pressed then move backwards\n document.addEventListener('keydown', function (event) {\n if (event.code == 'KeyS') {\n moveDirection = 'backwards';\n }\n });\n // S released then do not move\n document.addEventListener('keyup', function (event) {\n if (event.code == 'KeyS') {\n moveDirection = 'neutral';\n }\n });\n // I pressed then rotate forward\n document.addEventListener('keydown', function (event) {\n if (event.code == 'KeyI') {\n rotateDirection = 'forward';\n }\n });\n // I released then do not rotate\n document.addEventListener('keyup', function (event) {\n if (event.code == 'KeyI') {\n rotateDirection = 'neutral';\n }\n });\n // K pressed then rotate backwards\n document.addEventListener('keydown', function (event) {\n if (event.code == 'KeyK') {\n rotateDirection = 'backwards';\n }\n });\n // K released then do not rotate\n document.addEventListener('keyup', function (event) {\n if (event.code == 'KeyK') {\n rotateDirection = 'neutral';\n }\n });\n}", "title": "" }, { "docid": "67d7b9af648727fc77c9e8db4e3d9176", "score": "0.51883596", "text": "function splitting_force() { \r\n for (let i = 0, n = graph1.nodes_data.length; i < n; ++i) {\r\n curr_node = graph1.nodes_data[i];\r\n if(curr_node.type == \"character\"){\r\n curr_node.x += 5;\r\n } else if(curr_node.type == \"person\"){\r\n curr_node.x -= 5;\r\n } \r\n }\r\n }", "title": "" }, { "docid": "0ca1f6bf0b18f1f2519434d6697d4e5c", "score": "0.5182699", "text": "function soaPreRender() {\n // Transform group\n var g = document.getElementById('strokeGroupGhost');\n // Render all strokes as unfinished, each within a named group\n for (var i = 0; i < soa_glyph.strokes.length; i++) {\n // Build stroke's path\n var p = svgPath(soa_ghostcolor, soa_ghostcolor, soa_glyph.strokes[i]);\n // Create group\n var sg = document.createElementNS(_svgNS, 'g');\n sg.setAttributeNS(null, \"id\", \"strokeGroup\" + i);\n sg.appendChild(p);\n g.appendChild(sg);\n }\n }", "title": "" }, { "docid": "6a7152e2b597056d0814aefc31d3e398", "score": "0.5181801", "text": "createAllPieces() {\n var pieces = [];\n\n pieces.push(this.create1x1());\n pieces.push(this.create2x1());\n pieces.push(this.create3x1());\n pieces.push(this.create4x1());\n pieces.push(this.create5x1());\n pieces.push(this.createBigCorner());\n pieces.push(this.createBigL());\n pieces.push(this.createBigT());\n pieces.push(this.createC());\n pieces.push(this.createCorner());\n pieces.push(this.createCross());\n pieces.push(this.createDiagonal());\n pieces.push(this.createF());\n pieces.push(this.createLongS());\n pieces.push(this.createS());\n pieces.push(this.createSmallL());\n pieces.push(this.createSmallT());\n pieces.push(this.createSpecialSquare());\n pieces.push(this.createSquare());\n pieces.push(this.createWeirdT());\n pieces.push(this.createZ());\n // Set pieces ids\n pieces.map((piece, index) => {\n piece._id = index;\n })\n return (pieces);\n }", "title": "" }, { "docid": "a7e53ca0c44602dafd0d99e1e4e58650", "score": "0.5180956", "text": "function startGame() {\n\t\t\tvar i,\n\t\t\t\tblockTimer=null;\n\n\t\t\tblocksCreated = 0;\n\t\t\tresetArrays();\n\t\t\t// scramble availabe slots\n\t\t\tscramble(available);\n\t\t\tcurrentLevel = level_4;\n\t\t\t// start timer to add and move blocks down every second\n\t\t\tblock_timer = setInterval(doBlocks,1000);\t\n\t\t}", "title": "" }, { "docid": "2e4b3f5e247f103dae8820aff26f9da5", "score": "0.51799583", "text": "function StartGame()\n{\n // so the first piece has a ghost piece before any input is received\n game.ghostDrop();\n // starts the dropping sequence\n drop();\n}", "title": "" }, { "docid": "6a63e6d11938ef958b3b5328dd92f812", "score": "0.5174135", "text": "function spawnObjects()\r\n{\r\n\t// Checks all other objects and hit possibility space and returns if these coordinates are a hit grid spot\r\n\tfunction inHitGrids(xCoordinate, yCoordinate)\r\n\t{\r\n\t\tvar overlap = false;\r\n\r\n\t\t// Check remaining locations in the hit possiblity space\r\n\t\thitGridObjects.forEach(function(object)\r\n\t\t{\r\n\t\t\tif(object.x == xCoordinate && object.y == yCoordinate)\r\n\t\t\t\toverlap = true;\r\n\t\t});\r\n\r\n\t\t// Check already spawned objects (like waffles)\r\n\t\tcurrentObjects.forEach(function(object)\r\n\t\t{\r\n\t\t\tif(object.position.x == xCoordinate && object.position.y == yCoordinate)\r\n\t\t\t\toverlap = true;\r\n\t\t});\r\n\r\n\t\treturn overlap;\r\n\t}\r\n\r\n\t// Gets random potential coordinates for an object returned in an array [x, y]\r\n\tfunction randomCoordinates()\r\n\t{\r\n\t\trandomX = 30 * Math.round(Math.random() / 30 * (720 - 210)) + 210 - 15;\r\n\t\trandomY = 30 * Math.round(Math.random() / 30 * (500 - 50)) + 50 - 15;\r\n\t\treturn [randomX, randomY];\r\n\t}\r\n\r\n\t// Spawns boxes to fill the entire play space for capturing hit volume\r\n\tfunction spawnGridBoxes()\r\n\t{\r\n\t\tif(gridObjs.length > 0) // if grid objects have already been spawned\r\n\t\t\treturn; // don't bother\r\n\r\n\t\t// Playable grid size is (720 - 210)/30 by (500 - 50)/30 = 17 by 15\r\n\t\tfor(var x = 0; x < 18; x++)\r\n\t\t{\r\n\t\t\tfor(var y = 0; y < 16; y++)\r\n\t\t\t{\r\n\t\t\t\tspawnGridObject(30 * x + 210 - 15, 30 * y + 50 - 15);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tMatter.World.add(engine.world, gridObjs);\r\n\r\n\t\tfunction spawnGridObject(x_in, y_in)\r\n\t\t{\r\n\t\t\tvar gridObj = Matter.Bodies.rectangle(x_in, y_in, 30, 30, { render: {visible: false}, label: \"grid-obj\",\r\n\t\t\t\tisStatic: true, collisionFilter: { category: waffleFilterCategory } });\r\n\t\t\tgridObjs.push(gridObj);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction simulateBerry()\r\n\t{\r\n\t\tif(debug)\r\n\t\t\tconsole.log(\"simulateBerry()\");\r\n\t\tif(!currentBlueberry) // if no berry atm, spawn one\r\n\t\t{\r\n\t\t\tloadSlingBlueberry(true);\r\n\t\t}\r\n\r\n\t\thitGridObjects = []; // clear hit grid objects, since new berry simulation\r\n\r\n\t\t// Prevent blueberry from being draggable, and make it sleep\r\n\t\tcurrentBlueberry.collisionFilter = { category: defaultFilterCategory, mask: defaultFilterCategory }; // reset collision filter so blueberry isn't draggable\r\n\t\tcurrentBlueberry.sleepThreshold = 10;\r\n\t\tcurrentBlueberry.render.visible = false;\r\n\r\n\t\t// Setup random launch location\r\n\t\tMatter.Body.setPosition(currentBlueberry, {x: randomRange(20, 90), y: randomRange(410, 480)});\r\n\r\n\t\tMatter.Events.on(currentBlueberry, 'sleepStart', onBerrySimulateEnd);\r\n\r\n\t\tsetTimeout(() => {\r\n\t\t\tif (runningSimulation && currentBlueberry != null)\r\n\t\t\t{\r\n\t\t\t\tconsole.log(\"KILLING BERRY\");\r\n\t\t\t\tMatter.Sleeping.set(currentBlueberry, true);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tconsole.log(\"Not killing berry\");\r\n\t\t\t}\r\n\t\t}, 15000);\r\n\r\n\t\tif (debug)\r\n\t\t\tconsole.log(\"Done simulate berry\");\r\n\t}\r\n\r\n\t// Called when the berry goes to sleep (stops moving)\r\n\tfunction onBerrySimulateEnd()\r\n\t{\r\n\t\tif(debug)\r\n\t\t\tconsole.log(\"onBerrySimulateEnd()\");\r\n\t\tMatter.World.remove(engine.world, currentBlueberry); // remove the berry from the world\r\n\t\tcurrentBlueberry = null;\r\n\t\tcurrentBerries = []; // also empty currentBerries array\r\n\r\n\t\tif(hitGridObjects.length < 10) // the berry didn't really hit much, so rerun\r\n\t\t\tsimulateBerry();\r\n\t\telse\r\n\t\t\tspawnFinalObjects();\r\n\t}\r\n\r\n\tfunction spawnFinalObjects()\r\n\t{\r\n\t\tif(debug)\r\n\t\t\tconsole.log(\"spawnFinalObjects()\");\r\n\t\tcurrentObjects = []; // clear old objects from array\r\n\r\n\t\t// We need to spawn 9 items total - 7 waffles & 2 holes, so run nine times\r\n\t\tfor(var i = 0; i < 9; i++)\r\n\t\t{\r\n\t\t\t// Slingshot is at x = 100\r\n\t\t\t// World is 720 wide by 500 tall\r\n\t\t\t// Waffles are 30px by 30px, so need distance from world edge (esp. top with UI)\r\n\t\t\t// From old project range is 210 < x < 720, 50 < y < 500. Processing and Matter.js\r\n\t\t\t// seem to spawn objects differently, so we subtract 15 to prevent passing world edges\r\n\r\n\t\t\tif(i <= 6) // waffles spawn at a random hitGridObject\r\n\t\t\t{\r\n\t\t\t\tvar randomHitGridIndex = randomRange(0, hitGridObjects.length - 1)\r\n\t\t\t\tvar randomHitGridObj = hitGridObjects[randomHitGridIndex]; // grab a hit grid to spawn a waffle at\r\n\t\t\t\thitGridObjects.splice(randomHitGridIndex, 1); // and remove it from array\r\n\t\t\t\tcurrObj = spawnWaffle(randomHitGridObj.x, randomHitGridObj.y);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// Random numbers setup as random * range + min. Note that Math.random is in the range (0, 1)\r\n\t\t\t\trandomCoords = randomCoordinates(); // get random coordinates\r\n\r\n\t\t\t\t// and regenerate till no overlap with hit grids\r\n\t\t\t\twhile(inHitGrids(randomCoords[0], randomCoords[1]))\r\n\t\t\t\t{\r\n\t\t\t\t\trandomCoords = randomCoordinates();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Useful for debugging\r\n\t\t\t\t// console.log(\"Object\" + (i+1) + \" - (\" + randomCoords[0] + \",\" + randomCoords[1] + \")\");\r\n\r\n\t\t\t\tcurrObj = spawnHole(randomCoords[0], randomCoords[1]);\r\n\t\t\t}\r\n\r\n\t\t\tcurrentObjects.push(currObj);\r\n\t\t}\r\n\r\n\t\tMatter.World.add(engine.world, currentObjects);\r\n\r\n\t\t// We're done!\r\n\t\trunningSimulation = false; // indicate we're done with runningSimulation = false\r\n\r\n\t\t$(\".message, .loading\").hide(); // and hiding loading\r\n\r\n\t\tif (!practicing && levelNumber < insDatFull.length)\r\n\t\t\t$(\"#insurance\").show();\r\n\t\telse\r\n\t\t\t$(\"#insurance\").hide();\r\n\t}\r\n\r\n\t// The main function execution\r\n\tvar currObj, randomX, randomY, randomCoords;\r\n\r\n\t// Time to simulate\r\n\trunningSimulation = true; // mark runningSimulatiojn\r\n\t$(\".loading\").show(); // and show loading\r\n\r\n\t$(\"#insurance\").hide();\r\n\r\n\tspawnGridBoxes();\r\n\tsimulateBerry();\r\n}", "title": "" }, { "docid": "8518893dc50a718e19d5d996fc79c26e", "score": "0.5173297", "text": "function CreateStand(ruotaCompleta,raggio) {\r\n\tvar widthPivot = 200; //diametro del perno centrale\r\n\tvar widthPlank = 300; //diametro degli assi portanti\r\n\t\r\n\tmaterial=new THREE.MeshLambertMaterial({color:0xffffff});\r\n\t\r\n\t//creazione perno centrale\r\n\tvar pivotMesh=new THREE.Mesh(new THREE.CylinderGeometry(widthPivot,widthPivot,widthPlank),material);\r\n\tpivotMesh.rotation.x=Math.PI/2;\r\n\truotaCompleta.add(pivotMesh);\r\n\r\n\t//creazione dei globi -attaccati al perno centrale\r\n\tvar bulbGeom=new THREE.SphereGeometry(widthPivot*0.75,30,30);\r\n\tvar bulbMesh=new THREE.Mesh(bulbGeom,material);\r\n\tbulbMesh.position.z=widthPlank/2;\r\n\truotaCompleta.add(bulbMesh);\r\n\t\r\n\tbulbMesh=new THREE.Mesh(bulbGeom,material);\r\n\tbulbMesh.position.z=-widthPlank/2;\r\n\truotaCompleta.add(bulbMesh);\r\n\r\n\t//creazione dei 4 assi portanti\r\n\tCreatePlank(Math.PI/15, 250, widthPlank/2+130);\r\n\t\r\n\tCreatePlank(-Math.PI/15, -250, widthPlank/2+130);\r\n\r\n\tCreatePlank(Math.PI/15, 250, -(widthPlank/2+130));\r\n\t\r\n\tCreatePlank(-Math.PI/15, -250, -(widthPlank/2+130));\r\n\t\r\n\t//creazione insegne rosse\r\n\tvar materialeInsegna = new THREE.MeshLambertMaterial( { color: 0xFF0000, side: THREE.DoubleSide } );\r\n\tvar insegnaGeometry=new THREE.RingGeometry(200,350,30,30,Math.PI/4,1.5);\r\n\t\r\n\tinsegna=new THREE.Mesh(insegnaGeometry,materialeInsegna);\r\n\tinsegna.position.y=-200;\r\n\tinsegna.position.z=300;\r\n\truotaCompleta.add(insegna);\r\n\t\r\n\tinsegna=new THREE.Mesh(insegnaGeometry,materialeInsegna);\r\n\tinsegna.position.y=-200;\r\n\tinsegna.position.z=-300;\r\n\truotaCompleta.add(insegna);\r\n\t\r\n\t//crea asse portante (passo l'oggetto totalWheel, le coordinate assi x e z)\r\n\tfunction CreatePlank(inclinazione, x,z){\r\n\t\tmaterial=new THREE.MeshLambertMaterial({color:0xffffff});\r\n\t\t\r\n\t\tvar poleGeom=new THREE.CylinderGeometry(25,25,raggio*2-350);\r\n\t\t\r\n\t\tpoleMesh=new THREE.Mesh(poleGeom,material);\r\n\t\tpoleMesh.rotation.z=inclinazione;\r\n\t\tpoleMesh.position.x=x;\r\n\t\tpoleMesh.position.y=-(raggio/2)-200;\r\n\t\tpoleMesh.position.z=z;\r\n\t\truotaCompleta.add(poleMesh);\r\n\t}\r\n}", "title": "" }, { "docid": "e3179aa9bc5066fd0b80b130899d8794", "score": "0.51691043", "text": "function createWalls() {\n /******************************************************************************\n Ściana 1\n ******************************************************************************/\n var frontWallGeometry1 = new THREE.BoxGeometry(frontWallWidth1, frontWallHeight1, wallThickness);\n var frontWallMesh1 = new THREE.Mesh(frontWallGeometry1);\n frontWallMesh1.applyMatrix(new THREE.Matrix4().makeTranslation(frontWallWidth1 / 2, frontWallHeight1 / 2 + fundsHeight / 2, fundsDepth / 2 - wallThickness / 2));\n var frontWall_BSP_1 = new ThreeBSP(frontWallMesh1);\n /******************************************************************************\n Ściana 2\n ******************************************************************************/\n var frontWall_geometry_2 = new THREE.BoxGeometry(frontWallWidth2, frontWallHeight2, wallThickness);\n var frontWallMesh2 = new THREE.Mesh(frontWall_geometry_2);\n frontWallMesh2.applyMatrix(new THREE.Matrix4().makeTranslation(frontWallWidth1 + frontWallWidth2 / 2, frontWallHeight2 / 2 + fundsHeight / 2, fundsDepth / 2 - wallThickness / 2 - 0.25));\n var frontWall_BSP_2 = new ThreeBSP(frontWallMesh2);\n\n var frontWall_BSP = frontWall_BSP_1.union(frontWall_BSP_2);\n /******************************************************************************\n Ściana 3\n ******************************************************************************/\n frontWallMesh1.applyMatrix(new THREE.Matrix4().makeTranslation(frontWallWidth2 + frontWallWidth1, 0, 0));\n\n frontWall_BSP_1 = new ThreeBSP(frontWallMesh1);\n\n frontWall_BSP = frontWall_BSP.union(frontWall_BSP_1);\n\n /******************************************************************************\n Front - Okno 1\n ******************************************************************************/\n var windowHoleGeometry1 = new THREE.BoxGeometry(windowWidth1, windowHeight1, wallThickness);\n var windowHoleMesh1 = new THREE.Mesh(windowHoleGeometry1);\n windowHoleMesh1.applyMatrix(new THREE.Matrix4().makeTranslation(windowHeight1 / 2 + 1.1, windowHeight1 / 2 + 1.12 + fundsHeight / 2, fundsDepth / 2 - wallThickness / 2));\n var window_holeBSP = new ThreeBSP(windowHoleMesh1);\n\n frontWall_BSP = frontWall_BSP.subtract(window_holeBSP);\n\n /******************************************************************************\n Front - Okno 2\n ******************************************************************************/\n windowHoleMesh1.applyMatrix(new THREE.Matrix4().makeTranslation(frontWallWidth1 + frontWallWidth2, 0, 0));\n window_holeBSP = new ThreeBSP(windowHoleMesh1);\n frontWall_BSP = frontWall_BSP.subtract(window_holeBSP);\n\n /******************************************************************************\n \tFront - Okno 3\n \t******************************************************************************/\n var windowHoleGeometry1_b = new THREE.BoxGeometry(windowWidth3, windowHeight1, wallThickness);\n var windowHoleMesh1_b = new THREE.Mesh(windowHoleGeometry1_b);\n windowHoleMesh1_b.applyMatrix(new THREE.Matrix4().makeTranslation(2.03 + windowWidth3 / 2, 4.09 + windowHeight1 / 2 + fundsHeight / 2, fundsDepth / 2 - wallThickness / 2));\n window_holeBSP = new ThreeBSP(windowHoleMesh1_b);\n\n frontWall_BSP = frontWall_BSP.subtract(window_holeBSP);\n /******************************************************************************\n Front - Okno 4\n ******************************************************************************/\n windowHoleMesh1_b.applyMatrix(new THREE.Matrix4().makeTranslation(frontWallWidth2 + 2.03 + windowWidth3 / 2, 0, 0));\n window_holeBSP = new ThreeBSP(windowHoleMesh1_b);\n\n frontWall_BSP = frontWall_BSP.subtract(window_holeBSP);\n /******************************************************************************\n Front - Okno balkonowe\n ******************************************************************************/\n var windowHoleGeometry1_c = new THREE.BoxGeometry(windowWidth2, windowHeight2, wallThickness);\n var windowHoleMesh1_c = new THREE.Mesh(windowHoleGeometry1_c);\n windowHoleMesh1_c.applyMatrix(new THREE.Matrix4().makeTranslation(frontWallWidth1 + frontWallWidth2 / 2, 3.24 + windowHeight2 / 2 + fundsHeight / 2, fundsDepth / 2 - wallThickness / 2 - 0.25));\n window_holeBSP = new ThreeBSP(windowHoleMesh1_c);\n\n frontWall_BSP = frontWall_BSP.subtract(window_holeBSP);\n\n //\n // Luksfery\n //\n\n var windowHoleGeometryluxfer = new THREE.BoxGeometry(luxferWindowWidth, windowHeight1, wallThickness);\n var windowHoleGeometryluxfer_mesh = new THREE.Mesh(windowHoleGeometryluxfer);\n windowHoleGeometryluxfer_mesh.applyMatrix(new THREE.Matrix4().makeTranslation(frontWallWidth1 + 0.67 + luxferWindowWidth / 2, 0.5 + 0.16 + windowHeight1 / 2 + fundsHeight / 2, fundsDepth / 2 - wallThickness / 2 - 0.25));\n window_holeBSP = new ThreeBSP(windowHoleGeometryluxfer_mesh);\n\n frontWall_BSP = frontWall_BSP.subtract(window_holeBSP);\n\n windowHoleGeometryluxfer_mesh.position.set(frontWallWidth1 + frontWallWidth2 - 0.67 - luxferWindowWidth / 2, 0.5 + 0.16 + windowHeight1 / 2 + fundsHeight / 2, fundsDepth / 2 - wallThickness / 2 - 0.25);\n window_holeBSP = new ThreeBSP(windowHoleGeometryluxfer_mesh);\n\n frontWall_BSP = frontWall_BSP.subtract(window_holeBSP);\n\n //\n // Drzwi wejściowe\n //\n var mainDoor_hole_geometry = new THREE.BoxGeometry(mainDoorWidth, mainDoorHeight, wallThickness);\n var mainDoor_hole_mesh = new THREE.Mesh(mainDoor_hole_geometry);\n mainDoor_hole_mesh.applyMatrix(new THREE.Matrix4().makeTranslation(frontWallWidth1 + frontWallWidth2 / 2, 0.16 + mainDoorHeight / 2 + fundsHeight / 2, fundsDepth / 2 - wallThickness / 2 - 0.25));\n window_holeBSP = new ThreeBSP(mainDoor_hole_mesh);\n\n frontWall_BSP = frontWall_BSP.subtract(window_holeBSP);\n\n // Drzwi - obiekt 3d\n var doorGeometry = new THREE.BoxGeometry(mainDoorWidth, mainDoorHeight, wallThickness / 2);\n var doorMesh = new THREE.Mesh(doorGeometry, material);\n var door_BSP_1 = new ThreeBSP(doorMesh);\n\n var doorWindow = new THREE.BoxGeometry(0.18, 0.18, wallThickness / 2);\n var door_BSP_2 = new ThreeBSP(doorWindow);\n\n var door_BSP = door_BSP_1.subtract(door_BSP_2);\n\n var doorWindow_mesh = new THREE.Mesh(doorWindow);\n\n for (var i = -3; i < 4; i++) {\n doorWindow_mesh.position.set(0, 0.1 * 2 * i + 0.05 * i, 0);\n door_BSP_2 = new ThreeBSP(doorWindow_mesh);\n door_BSP = door_BSP.subtract(door_BSP_2);\n }\n\n var door = door_BSP.toMesh(doorMaterial);\n\tdoor.receiveShadow = true;\n\n var mainDoor = new THREE.Object3D();\n\n var doorWindow_glass_geometry = new THREE.BoxGeometry(0.18, 0.18, wallThickness / 4);\n var doorWindow_glass = new Array(7);\n for (var i = 0; i < 7; i++) {\n doorWindow_glass[i] = new THREE.Mesh(doorWindow_glass_geometry, material_glass);\n doorWindow_glass[i].position.set(0, 0.1 * 2 * (i - 3) + 0.05 * (i - 3), 0);\n mainDoor.add(doorWindow_glass[i]);\n }\n\n var doorWindow_frame_geometry = new THREE.TorusGeometry(Math.sqrt(0.02), 0.01, 4, 4);\n var doorWindow_frame = new Array(7);\n for (var i = 0; i < 7; i++) {\n doorWindow_frame[i] = new THREE.Mesh(doorWindow_frame_geometry, doorMaterial);\n doorWindow_frame[i].position.set(0, 0.1 * 2 * (i - 3) + 0.05 * (i - 3), wallThickness / 4);\n doorWindow_frame[i].rotation.z += ((45 * Math.PI) / 180);\n mainDoor.add(doorWindow_frame[i]);\n }\n\n mainDoor.add(door);\n mainDoor.position.set(frontWallWidth1 + frontWallWidth2 / 2, 0.16 + mainDoorHeight / 2 + fundsHeight / 2, fundsDepth / 2 - wallThickness / 2 - 0.25);\n\t\n\tmainDoor.receiveShadow = true;\n\tmainDoor.castShadow = true;\n\t\n house.add(mainDoor);\n /*/scene.add(mainDoor);/*/\n\n /******************************************************************************\n Ściana frontowa\n ******************************************************************************/\n var frontWall = frontWall_BSP.toMesh(material_2);\n\n\n /******************************************************************************\n Ściana 4\n ******************************************************************************/\n var backWallGeometry1 = new THREE.BoxGeometry(backWallWidth1, backWallHeight1, wallThickness);\n var backWallMesh1 = new THREE.Mesh(backWallGeometry1);\n backWallMesh1.applyMatrix(new THREE.Matrix4().makeTranslation(backWallWidth1 / 2, backWallHeight1 / 2 + fundsHeight / 2, -(fundsDepth / 2 - wallThickness / 2)));\n var backWall_BSP_1 = new ThreeBSP(backWallMesh1);\n /******************************************************************************\n Ściana 5\n ******************************************************************************/\n var backWallGeometry2 = new THREE.BoxGeometry(backWallWidth2, backWallHeight2, wallThickness);\n var backWallMesh2 = new THREE.Mesh(backWallGeometry2);\n backWallMesh2.applyMatrix(new THREE.Matrix4().makeTranslation(backWallWidth1 + backWallWidth2 / 2, frontWallHeight2 / 2 + fundsHeight / 2, -(fundsDepth / 2 - wallThickness / 2 + 0.25)));\n var backWall_BSP_2 = new ThreeBSP(backWallMesh2);\n\n var backWall_BSP = backWall_BSP_1.union(backWall_BSP_2);\n\n /******************************************************************************\n Ściana 6\n ******************************************************************************/\n backWallMesh1.applyMatrix(new THREE.Matrix4().makeTranslation(backWallWidth2 + backWallWidth1, 0, 0));\n\n backWall_BSP_1 = new ThreeBSP(backWallMesh1);\n\n backWall_BSP = backWall_BSP.union(backWall_BSP_1);\n /******************************************************************************\n Tył okno\n ******************************************************************************/\n windowHoleMesh1.position.set(backWallWidth1 / 2, windowHeight1 / 2 + 1.12 + fundsHeight / 2, -fundsDepth / 2 + wallThickness / 2);\n window_holeBSP = new ThreeBSP(windowHoleMesh1);\n backWall_BSP = backWall_BSP.subtract(window_holeBSP);\n /******************************************************************************\n Tył okno\n ******************************************************************************/\n windowHoleMesh1.position.set(backWallWidth1 * 1.5 + backWallWidth2, windowHeight1 / 2 + 1.12 + fundsHeight / 2, -fundsDepth / 2 + wallThickness / 2);\n window_holeBSP = new ThreeBSP(windowHoleMesh1);\n backWall_BSP = backWall_BSP.subtract(window_holeBSP);\n\n /******************************************************************************\n Tył okno\n ******************************************************************************/\n windowHoleMesh1_b.position.set(2.03 + windowWidth3 / 2, 4.09 + windowHeight1 / 2 + fundsHeight / 2, -(fundsDepth / 2 - wallThickness / 2));\n window_holeBSP = new ThreeBSP(windowHoleMesh1_b);\n backWall_BSP = backWall_BSP.subtract(window_holeBSP);\n /******************************************************************************\n Tył okno\n ******************************************************************************/\n windowHoleMesh1_b.applyMatrix(new THREE.Matrix4().makeTranslation(frontWallWidth2 + 2.03 + windowWidth3 / 2, 0, 0));\n window_holeBSP = new ThreeBSP(windowHoleMesh1_b);\n backWall_BSP = backWall_BSP.subtract(window_holeBSP);\n\n windowHoleGeometryluxfer_mesh.position.set(frontWallWidth1 + frontWallWidth2 + frontWallWidth1 - 1.6 - luxferWindowWidth / 2, windowHeight1 / 2 + 1.12 + fundsHeight / 2, -(fundsDepth / 2 - wallThickness / 2));\n window_holeBSP = new ThreeBSP(windowHoleGeometryluxfer_mesh);\n\n backWall_BSP = backWall_BSP.union(window_holeBSP);\n /******************************************************************************\n Tył okno środek 1\n ******************************************************************************/\n var windowHoleGeometry1_d = new THREE.BoxGeometry(windowWidth2, windowHeight1, wallThickness);\n var windowHoleMesh1_d = new THREE.Mesh(windowHoleGeometry1_d);\n windowHoleMesh1_d.applyMatrix(new THREE.Matrix4().makeTranslation(backWallWidth1 + backWallWidth2 / 2, 1.12 + windowHeight1 / 2 + fundsHeight / 2, -(fundsDepth / 2 - wallThickness / 2 + 0.25)));\n window_holeBSP = new ThreeBSP(windowHoleMesh1_d);\n backWall_BSP = backWall_BSP.subtract(window_holeBSP);\n /******************************************************************************\n Tył okno środek 2\n ******************************************************************************/\n windowHoleMesh1_d.applyMatrix(new THREE.Matrix4().makeTranslation(0, 1.48 + windowHeight1, 0));\n window_holeBSP = new ThreeBSP(windowHoleMesh1_d);\n backWall_BSP = backWall_BSP.subtract(window_holeBSP);\n\n var backWall = backWall_BSP.toMesh(material_2);\n\n \n /******************************************************************************\n Ściana 7\n ******************************************************************************/\n var sideWall_geometry_1 = new THREE.BoxGeometry(wallThickness, sideWallHeight1, fundsDepth);\n var sideWall_mesh_1 = new THREE.Mesh(sideWall_geometry_1);\n sideWall_mesh_1.applyMatrix(new THREE.Matrix4().makeTranslation(wallThickness / 2, sideWallHeight1 / 2 + fundsHeight / 2, 0));\n var sideWall_BSP_1 = new ThreeBSP(sideWall_mesh_1);\n /******************************************************************************\n Ściana 8\n ******************************************************************************/\n var sideWall_geometry_2 = new THREE.BoxGeometry(wallThickness, sideWallHeight2, sideWallWidth1);\n var sideWall_mesh_2 = new THREE.Mesh(sideWall_geometry_2);\n sideWall_mesh_2.applyMatrix(new THREE.Matrix4().makeTranslation(wallThickness / 2, sideWallHeight1 + sideWallHeight2 / 2 + fundsHeight / 2, 0));\n var sideWall_BSP_2 = new ThreeBSP(sideWall_mesh_2);\n\n var sideWall_BSP = sideWall_BSP_1.union(sideWall_BSP_2);\n /******************************************************************************\n Okno\n ******************************************************************************/\n var windowHoleGeometry2 = new THREE.BoxGeometry(wallThickness, windowHeight1, windowWidth1);\n var windowHoleMesh2 = new THREE.Mesh(windowHoleGeometry2);\n windowHoleMesh2.position.set(wallThickness / 2, windowHeight1 / 2 + 1.12 + fundsHeight / 2, fundsDepth / 2 - 1.95 - windowWidth1 / 2);\n var window_holeBSP_2 = new ThreeBSP(windowHoleMesh2);\n\n sideWall_BSP = sideWall_BSP.subtract(window_holeBSP_2);\n\n windowHoleMesh2.position.set(wallThickness / 2, windowHeight1 / 2 + 1.12 + fundsHeight / 2, -(fundsDepth / 2 - 1.95 - windowWidth1 / 2));\n window_holeBSP_2 = new ThreeBSP(windowHoleMesh2);\n\n sideWall_BSP = sideWall_BSP.subtract(window_holeBSP_2);\n\n /******************************************************************************\n Okno taras\n ******************************************************************************/\n var windowHoleGeometry2b = new THREE.BoxGeometry(wallThickness, windowHeight2, windowWidth2);\n var windowHoleMesh2b = new THREE.Mesh(windowHoleGeometry2b);\n windowHoleMesh2b.position.set(wallThickness / 2, windowHeight2 / 2 + fundsHeight / 2 + 0.16, 0);\n window_holeBSP_2 = new ThreeBSP(windowHoleMesh2b);\n\n sideWall_BSP = sideWall_BSP.subtract(window_holeBSP_2);\n //\n // Bok - Okno balkon\n //\n var windowHoleGeometry2c = new THREE.BoxGeometry(wallThickness, windowHeight2, windowWidth4);\n var windowHoleMesh2c = new THREE.Mesh(windowHoleGeometry2c);\n windowHoleMesh2c.position.set(wallThickness / 2, 3.08 + windowHeight2 / 2 + fundsHeight / 2 + 0.16, 0.13 + windowWidth4 / 2);\n window_holeBSP_2 = new ThreeBSP(windowHoleMesh2c);\n\n sideWall_BSP = sideWall_BSP.subtract(window_holeBSP_2);\n\n //\n // Bok - Okno balkon\n //\n windowHoleMesh2c.position.set(wallThickness / 2, 3.08 + windowHeight2 / 2 + fundsHeight / 2 + 0.16, -(0.13 + windowWidth4 / 2));\n window_holeBSP_2 = new ThreeBSP(windowHoleMesh2c);\n\n sideWall_BSP = sideWall_BSP.subtract(window_holeBSP_2);\n //\n // Ściana obok garażu\n //\n sideWall_mesh_1.applyMatrix(new THREE.Matrix4().makeTranslation(fundWidth1 + fundWidth2 + fundWidth3 - wallThickness, 0, 0));\n sideWall_BSP_1 = new ThreeBSP(sideWall_mesh_1);\n sideWall_BSP = sideWall_BSP.union(sideWall_BSP_1);\n\t\n\t/******************************************************************************\n Tył drzwi\n ******************************************************************************/\n\tvar backDoorHoleGeometry = new THREE.BoxGeometry(backDoorWidth, backDoorHeight, wallThickness);\n\tvar backDoorHoleMesh = new THREE.Mesh(backDoorHoleGeometry);\n\tbackDoorHoleMesh.rotateY((90 * Math.PI) / 180);\n\tbackDoorHoleMesh.updateMatrix();\n\tbackDoorHoleMesh.applyMatrix(new THREE.Matrix4().makeTranslation(fundWidth - wallThickness/2, backDoorHeight/2 + fundsHeight/2 + 0.16, -garageDepth/2 - backDoorWidth/2 - 0.2));\n\t//scene.add(backDoorHoleMesh);\n\tvar backDoorHole_BSP = new ThreeBSP(backDoorHoleMesh);\n\tsideWall_BSP = sideWall_BSP.subtract(backDoorHole_BSP);\n\n var sideWall = sideWall_BSP.toMesh(material_2);\n\t\n\tvar backDoorGeometry = new THREE.BoxGeometry(backDoorWidth, backDoorHeight, wallThickness/2);\n\tvar backDoor = new THREE.Mesh(backDoorGeometry, doorMaterial);\n\tbackDoor.rotateY((90 * Math.PI) / 180);\n\tbackDoor.updateMatrix();\n\tbackDoor.applyMatrix(new THREE.Matrix4().makeTranslation(fundWidth - wallThickness/2, backDoorHeight/2 + fundsHeight/2 + 0.16, -garageDepth/2 - backDoorWidth/2 - 0.2));\n\thouse.add(backDoor);\n\t/*/scene.add(backDoor);/*/\n\t\n /******************************************************************************\n ******************************************************************************\n Garaż\n ******************************************************************************\n ******************************************************************************/\n\n var garage_geometry = new THREE.BoxGeometry(garageWidth, garageWallHeight1, wallThickness);\n var garage_mesh = new THREE.Mesh(garage_geometry);\n garage_mesh.position.set(fundWidth1 + fundWidth2 + fundWidth3 + garageWidth / 2, -fundsHeight / 2 + garageHeight + garageWallHeight1 / 2, garageDepth / 2 - wallThickness / 2);\n var garage_BSP = new ThreeBSP(garage_mesh);\n\n var garage_geometry_2 = new THREE.BoxGeometry(wallThickness, garageWallHeight2, garageDepth);\n var garage_mesh_2 = new THREE.Mesh(garage_geometry_2);\n garage_mesh_2.position.set(fundWidth1 + fundWidth2 + fundWidth3 + garageWidth - wallThickness / 2, -fundsHeight / 2 + garageHeight + garageWallHeight2 / 2, 0);\n var garage_BSP_2 = new ThreeBSP(garage_mesh_2);\n\n var garageWall_BSP = garage_BSP.union(garage_BSP_2);\n\n garage_mesh.position.set(fundWidth1 + fundWidth2 + fundWidth3 + garageWidth / 2, -fundsHeight / 2 + garageHeight + garageWallHeight1 / 2, -garageDepth / 2 + wallThickness / 2);\n garage_BSP = new ThreeBSP(garage_mesh);\n garageWall_BSP = garageWall_BSP.union(garage_BSP);\n //\n // Drzwi garażowe\n //\n var garageDoorGeometry = new THREE.BoxGeometry(garageDoorWidth, garageDoorHeight, wallThickness);\n var garageDoorMesh = new THREE.Mesh(garageDoorGeometry);\n garageDoorMesh.position.set(fundWidth1 + fundWidth2 + fundWidth3 + 0.85 + garageDoorWidth / 2, -fundsHeight / 2 + garageHeight + garageDoorHeight / 2, garageDepth / 2 - wallThickness / 2);\n garage_BSP_2 = new ThreeBSP(garageDoorMesh);\n\n garageWall_BSP = garageWall_BSP.subtract(garage_BSP_2);\n\n garageDoorMesh.applyMatrix(new THREE.Matrix4().makeTranslation(0.5 + garageDoorWidth, 0, 0));\n garage_BSP_2 = new ThreeBSP(garageDoorMesh);\n\n garageWall_BSP = garageWall_BSP.subtract(garage_BSP_2);\n\n var garageDoorGeometry_2 = new THREE.BoxGeometry(garageDoorWidth, garageDoorHeight, wallThickness / 4);\n var garageDoor = new THREE.Mesh(garageDoorGeometry_2, garageDoorMaterial);\n garageDoor.position.set(fundWidth1 + fundWidth2 + fundWidth3 + 0.85 + garageDoorWidth / 2, -fundsHeight / 2 + garageHeight + garageDoorHeight / 2, garageDepth / 2 - wallThickness / 2);\n garageDoor.updateMatrix();\n house.add(garageDoor);\n /*/scene.add(garageDoor);/*/\n var garageDoor_2 = garageDoor.clone();\n garageDoor_2.applyMatrix(new THREE.Matrix4().makeTranslation(0.5 + garageDoorWidth, 0, 0));\n house.add(garageDoor_2);\n /*/scene.add(garageDoor_2);/*/\n\n garageDoor.receiveShadow = true;\n garageDoor_2.receiveShadow = true;\n garageDoor.castShadow = true;\n garageDoor_2.castShadow = true;\n //////////////////////////////////////////\n // Okno garaż\n ////////////////////////////////////\n var windowHoleGeometry3 = new THREE.BoxGeometry(wallThickness, windowHeight1, windowWidth3);\n var windowHoleMesh3 = new THREE.Mesh(windowHoleGeometry3);\n windowHoleMesh3.position.set(fundWidth1 + fundWidth2 + fundWidth3 + garageWidth - wallThickness / 2, 3.7 + windowHeight1 / 2 + garageHeight / 2, 0.45 + windowWidth3 / 2);\n window_holeBSP_2 = new ThreeBSP(windowHoleMesh3);\n\n garageWall_BSP = garageWall_BSP.subtract(window_holeBSP_2);\n\n windowHoleMesh3.position.set(fundWidth1 + fundWidth2 + fundWidth3 + garageWidth - wallThickness / 2, 3.7 + windowHeight1 / 2, -(0.45 + windowWidth3 / 2));\n window_holeBSP_2 = new ThreeBSP(windowHoleMesh3);\n\n garageWall_BSP = garageWall_BSP.subtract(window_holeBSP_2);\n\n windowHoleGeometry3 = new THREE.BoxGeometry(wallThickness, windowHeight3, windowWidth5);\n\n windowHoleMesh3 = new THREE.Mesh(windowHoleGeometry3);\n windowHoleMesh3.position.set(fundWidth1 + fundWidth2 + fundWidth3 + garageWidth - wallThickness / 2, 1.4 + windowHeight3 / 2 + garageHeight / 2, 1.3 + windowWidth5);\n window_holeBSP_2 = new ThreeBSP(windowHoleMesh3);\n\n garageWall_BSP = garageWall_BSP.subtract(window_holeBSP_2);\n\n windowHoleMesh3.position.set(fundWidth1 + fundWidth2 + fundWidth3 + garageWidth - wallThickness / 2, 1.4 + windowHeight3 / 2 + garageHeight / 2, -(1.3 + windowWidth5));\n window_holeBSP_2 = new ThreeBSP(windowHoleMesh3);\n\n garageWall_BSP = garageWall_BSP.subtract(window_holeBSP_2);\n\n windowHoleMesh3.position.set(fundWidth1 + fundWidth2 + fundWidth3 + garageWidth - wallThickness / 2, 1.4 + windowHeight3 / 2 + garageHeight / 2, 0);\n window_holeBSP_2 = new ThreeBSP(windowHoleMesh3);\n\n garageWall_BSP = garageWall_BSP.subtract(window_holeBSP_2);\n\n windowHoleGeometry3 = new THREE.BoxGeometry(windowWidth5, windowHeight3, wallThickness);\n\n windowHoleMesh3 = new THREE.Mesh(windowHoleGeometry3);\n windowHoleMesh3.position.set(fundWidth1 + fundWidth2 + fundWidth3 + 1.33 + windowWidth5 / 2, 1.4 + windowHeight3 / 2 + garageHeight / 2, -(garageDepth / 2 - wallThickness / 2));\n window_holeBSP_2 = new ThreeBSP(windowHoleMesh3);\n\n garageWall_BSP = garageWall_BSP.subtract(window_holeBSP_2);\n\n windowHoleMesh3.position.set(fundWidth1 + fundWidth2 + fundWidth3 + 1.33 + windowWidth5 + 3.13 + windowWidth5 / 2, 1.4 + windowHeight3 / 2 + garageHeight / 2, -(garageDepth / 2 - wallThickness / 2));\n window_holeBSP_2 = new ThreeBSP(windowHoleMesh3);\n\n garageWall_BSP = garageWall_BSP.subtract(window_holeBSP_2);\n\n var garageWall = garageWall_BSP.toMesh(material_2);\n\n //************************************************************\n // Dach\n //**************************************************************\n\n var eraseWallsGeometry = new THREE.BoxGeometry(roofWidth, 4, roofDepth);\n var eraseWallsMesh = new THREE.Mesh(eraseWallsGeometry);\n eraseWallsMesh.position.set(fundWidth1 + fundWidth2 * 2 + fundWidth3 + 0.06, fundsHeight / 2 + 7, fundsDepth / 2 - roofDepth / 2 + 1);\n eraseWallsMesh.rotateX((35.5 * Math.PI) / 180);\n var erase_BSP = new ThreeBSP(eraseWallsMesh);\n\n garageWall_BSP = garageWall_BSP.subtract(erase_BSP);\n\n eraseWallsMesh.position.set(fundWidth1 + fundWidth2 * 2 + fundWidth3 + 0.06, fundsHeight / 2 + 7, -(fundsDepth / 2 - roofDepth / 2 + 1));\n eraseWallsMesh.rotateX(-(2 * 35.5 * Math.PI) / 180);\n erase_BSP = new ThreeBSP(eraseWallsMesh);\n\n garageWall_BSP = garageWall_BSP.subtract(erase_BSP);\n\n garageWall = garageWall_BSP.toMesh(material_2);\n //\n //\n eraseWallsGeometry = new THREE.BoxGeometry(roofWidth2, roofHeight + 3, roofDepth2);\n\n eraseWallsMesh = new THREE.Mesh(eraseWallsGeometry);\n eraseWallsMesh.position.set(fundWidth1 / 2, fundsHeight / 2 + 7.8, 0);\n eraseWallsMesh.rotateZ((39 * Math.PI) / 180);\n erase_BSP = new ThreeBSP(eraseWallsMesh);\n\n frontWall_BSP = frontWall_BSP.subtract(erase_BSP);\n backWall_BSP = backWall_BSP.subtract(erase_BSP);\n\n eraseWallsMesh.position.set(fundWidth1 + fundWidth2 + fundWidth1 / 2, fundsHeight / 2 + 7.8, 0);\n eraseWallsMesh.rotateZ(-(39 * 2 * Math.PI) / 180);\n erase_BSP = new ThreeBSP(eraseWallsMesh);\n\n frontWall_BSP = frontWall_BSP.subtract(erase_BSP);\n backWall_BSP = backWall_BSP.subtract(erase_BSP);\n /******************************************************************************\n Ściana frontowa\n ******************************************************************************/\n frontWall = frontWall_BSP.toMesh(material_2);\n backWall = backWall_BSP.toMesh(material_2);\n\n //scene.add(eraseWallsMesh);\n ///\n ////\n ///\n //\n //\n\t\n\n var roofGeometry = new THREE.BoxGeometry(roofWidth, roofHeight, roofDepth);\n var roofMesh = new THREE.Mesh(roofGeometry);\n roofMesh.position.set(fundWidth1 + fundWidth2 * 2 + fundWidth3 + 0.05, fundsHeight / 2 + 4.9, fundsDepth / 2 - roofDepth / 2 + 0.5);\n\n roofMesh.rotateX((35.5 * Math.PI) / 180);\n\n var roof_BSP_1 = new ThreeBSP(roofMesh);\n //scene.add(roofMesh); // garaż przód\n\n var roofMesh_2 = new THREE.Mesh(roofGeometry);\n roofMesh_2.position.set(fundWidth1 + fundWidth2 * 2 + fundWidth3 + 0.05, fundsHeight / 2 + 4.9, -(fundsDepth / 2 - roofDepth / 2 + 0.5));\n roofMesh_2.rotateX(-(35.5 * Math.PI) / 180);\n\n var roof_BSP_2 = new ThreeBSP(roofMesh_2);\n //scene.add(roofMesh_2); // garaż tył\n\n var roof_BSP = roof_BSP_1.union(roof_BSP_2);\n\t\n\tvar garageRoof = roof_BSP.toMesh(roofTileMaterial);\n\t\n\tvar garageRoof_B = garageRoof.clone();\n\tgarageRoof_B.material = doorMaterial;\n\tgarageRoof_B.scale.x = 1.01;\n\tgarageRoof_B.updateMatrix();\n\tgarageRoof_B.applyMatrix(new THREE.Matrix4().makeTranslation(0,-0.1,0));\n\thouse.add(garageRoof_B);\n\t/*/scene.add(garageRoof_B);/*/\n\n var newRoof = garageRoof.clone();\n //newRoof.position.set(fundWidth1 + fundWidth2 * 1.6, fundsHeight / 2 + 5.29, 2.09);\n\tnewRoof.updateMatrix();\n newRoof.applyMatrix(new THREE.Matrix4().makeTranslation(-roofWidth, 0, 0));\n\tnewRoof.updateMatrix();\n\tvar newRoof_BSP = new ThreeBSP(newRoof);\n\tvar nnRoof = newRoof_BSP.toMesh();\n\t//scene.add(nnRoof); // boki dach garaż\n\t\n\tvar roofGeometry_E = new THREE.BoxGeometry(roofWidth2*1.23, (roofHeight + 0.02)*30, roofDepth2);\n var roofMesh_E = new THREE.Mesh(roofGeometry_E);\n\troofMesh_E.position.set(fundWidth1 + fundWidth2 + fundWidth1 / 2 - 1.7, fundsHeight / 2 + 6.18 - 1.65 -1, 0);\n\troofMesh_E.rotateZ(-(39 * Math.PI) / 180);\n\troofMesh_E.updateMatrix();\n\tvar roofMesh_E_BSP = new ThreeBSP(roofMesh_E);\n\tvar garageRoof2_BSP = newRoof_BSP.subtract(roofMesh_E_BSP);\n\tvar garageRoof2 = garageRoof2_BSP.toMesh(roofTileMaterial);\n\t\n\n var roofGeometry_3 = new THREE.BoxGeometry(roofWidth2, roofHeight + 0.02, roofDepth2);\n var roofMesh_3 = new THREE.Mesh(roofGeometry_3);\n roofMesh_3.position.set(fundWidth1 + fundWidth2 + fundWidth1 / 2 - 0.47, fundsHeight / 2 + 6.18, 0);\n roofMesh_3.rotateZ(-(39 * Math.PI) / 180);\n roof_BSP_2 = new ThreeBSP(roofMesh_3);\n \n\t//scene.add(roofMesh_3);\n\n roofMesh_3.applyMatrix(new THREE.Matrix4().makeTranslation(-frontWallWidth1 - frontWallWidth2 / 2 - 0.77, 0, 0));\n roofMesh_3.rotateZ((39 * 2 * Math.PI) / 180);\n var roof_BSP_3 = new ThreeBSP(roofMesh_3);\n var roof_BSP_B = roof_BSP_3.union(roof_BSP_2);\n\t//scene.add(roofMesh_3)\n var roofGeometry_4 = new THREE.BoxGeometry(3.56, roofHeight + 2, 3.8);\n\n roofMesh_3 = new THREE.Mesh(roofGeometry_4);\n roofMesh_3.position.set(0.32, fundsHeight / 2 + 5, 0);\n roofMesh_3.rotateZ((39 * Math.PI) / 180);\n roof_BSP_2 = new ThreeBSP(roofMesh_3);\n roof_BSP_B = roof_BSP_B.subtract(roof_BSP_2);\n //scene.add(roofMesh_3);\n\t\n\tvar houseRoof = roof_BSP_B.toMesh(roofTileMaterialC);\n\n\tvar houseRoof_B = houseRoof.clone();\n\thouseRoof_B.material = doorMaterial;\n\thouseRoof_B.scale.x = 1.002;\n\thouseRoof_B.scale.z = 1.005;\n\thouseRoof_B.updateMatrix();\n\thouseRoof_B.applyMatrix(new THREE.Matrix4().makeTranslation(0,-0.1,0));\n\thouse.add(houseRoof_B);\n\t/*/scene.add(houseRoof_B);/*/\n\t\n var roofGeometry_5 = new THREE.BoxGeometry(roofWidth4, roofHeight, roofDepth3);\n roofMesh_3 = new THREE.Mesh(roofGeometry_5);\n roofMesh_3.position.set(roofWidth4 / 3, fundsHeight / 2 + 6.2, roofDepth3 / 2 - 0.44);\n\n roofMesh_3.rotateX((38.2 * Math.PI) / 180);\n\n roof_BSP_2 = new ThreeBSP(roofMesh_3);\n \n\n roofMesh_3.position.set(roofWidth4 / 3, fundsHeight / 2 + 6.2, -(roofDepth3 / 2 - 0.44));\n\n roofMesh_3.rotateX(-(38.2 * 2 * Math.PI) / 180);\n\n roof_BSP_3 = new ThreeBSP(roofMesh_3);\n var roof_BSP_C = roof_BSP_3.union(roof_BSP_2);\n\t\n var roofGeometry_6 = new THREE.BoxGeometry(roofWidth2, roofHeight + 0.02, roofDepth2);\n var roofMesh_6 = new THREE.Mesh(roofGeometry_6);\n roofMesh_6.scale.y = 14;\n roofMesh_6.scale.x = 0.53;\n roofMesh_6.position.set(fundWidth1 + fundWidth2 + fundWidth1 / 2 - 0.69, fundsHeight / 2 + 6.18 - 1.65, 0);\n roofMesh_6.rotateZ(-(39 * Math.PI) / 180);\n roof_BSP_2 = new ThreeBSP(roofMesh_6);\n roofMesh_6.applyMatrix(new THREE.Matrix4().makeTranslation(-fundWidth1 - 1.8, 0.3, 0));\n roofMesh_6.rotateZ((39 * 2 * Math.PI) / 180);\n roof_BSP_2 = new ThreeBSP(roofMesh_6);\n//scene.add(roof_BSP_2.toMesh());\n roof_BSP_C = roof_BSP_C.subtract(roof_BSP_2);\n \n\tvar houseRoofB = roof_BSP_C.toMesh(roofTileMaterialB);\n\t\n\tvar houseRoofB_B = houseRoofB.clone();\n\thouseRoofB_B.material = doorMaterial;\n\thouseRoofB_B.scale.x = 1.002;\n\thouseRoofB_B.scale.z = 1.005;\n\thouseRoofB_B.updateMatrix();\n\thouseRoofB_B.applyMatrix(new THREE.Matrix4().makeTranslation(0,-0.1,0));\n\thouse.add(houseRoofB_B);\n\t/*/scene.add(houseRoofB_B);/*/\n\t\n\n var roofGeometry_5 = new THREE.BoxGeometry(roofWidth4, roofHeight * 8, roofDepth3);\n roofMesh_3 = new THREE.Mesh(roofGeometry_5);\n roofMesh_3.position.set(roofWidth4 / 3, fundsHeight / 2 + 7.1, -(roofDepth3 / 2 - 0.44));\n roofMesh_3.rotateX(-(38.2 * Math.PI) / 180);\n roof_BSP_2 = new ThreeBSP(roofMesh_3);\n sideWall_BSP = sideWall_BSP.subtract(roof_BSP_2);\n\n roofMesh_3.position.set(roofWidth4 / 3, fundsHeight / 2 + 7.1, roofDepth3 / 2 - 0.44);\n roofMesh_3.rotateX((38.2 * 2 * Math.PI) / 180);\n roof_BSP_2 = new ThreeBSP(roofMesh_3);\n sideWall_BSP = sideWall_BSP.subtract(roof_BSP_2);\n\n var side_wall_geometry = new THREE.BoxGeometry(2, 2.5, wallThickness);\n var side_wall_mesh = new THREE.Mesh(side_wall_geometry);\n side_wall_mesh.applyMatrix(new THREE.Matrix4().makeTranslation(1, 0.16 + 2.74 + 0.34 + 2.5 / 2 + fundsHeight / 2, 3.8 / 2 - wallThickness / 2));\n var side_wall_BSP = new ThreeBSP(side_wall_mesh);\n\n sideWall_BSP = sideWall_BSP.union(side_wall_BSP);\n\n side_wall_mesh.applyMatrix(new THREE.Matrix4().makeTranslation(0, 0, -(3.8 / 2 - wallThickness / 2)));\n var side_wall_BSP = new ThreeBSP(side_wall_mesh);\n\n sideWall_BSP = sideWall_BSP.union(side_wall_BSP);\n\n side_wall_mesh.applyMatrix(new THREE.Matrix4().makeTranslation(0, 0, -(3.8 / 2 - wallThickness / 2)));\n var side_wall_BSP = new ThreeBSP(side_wall_mesh);\n\n sideWall_BSP = sideWall_BSP.union(side_wall_BSP);\n\n sideWall = sideWall_BSP.toMesh(material_2);\n\n\t\n\tgarageRoof.castShadow = true;\n\tgarageRoof.receiveShadow = true;\n\tgarageRoof2.castShadow = true;\n\tgarageRoof2.receiveShadow = true;\n\thouseRoof.castShadow = true;\n\thouseRoof.receiveShadow = true;\n\thouseRoofB.castShadow = true;\n\thouseRoofB.receiveShadow = true;\n\t\n var roof = new THREE.Object3D();\n\troof.add(garageRoof);\n\troof.add(garageRoof2);\n\troof.add(houseRoof);\n\troof.add(houseRoofB);\n\n house.add(roof);\n /*/scene.add(roof);/*/\n\n /******************************************************************************\n Merge ścian\n ******************************************************************************/\n frontWall.updateMatrix();\n backWall.updateMatrix();\n sideWall.updateMatrix();\n garageWall.updateMatrix();\n\n var wallsGeometry = new THREE.Geometry();\n wallsGeometry.merge(frontWall.geometry, frontWall.matrix);\n wallsGeometry.merge(backWall.geometry, backWall.matrix);\n wallsGeometry.merge(sideWall.geometry, sideWall.matrix);\n wallsGeometry.merge(garageWall.geometry, garageWall.matrix);\n\n var walls = new THREE.Mesh(wallsGeometry, plasterMaterial);\n\n walls.castShadow = true;\n walls.receiveShadow = true;\n\thouse.add(walls);\n /*/scene.add(walls);/*/\n\n }", "title": "" }, { "docid": "bbc1fbdb7d86783045630a0b986cfad4", "score": "0.5163962", "text": "function charSnake(){ //start script\n app.beginUndoGroup(\"Snake Rig\");\n\n //if(parseFloat(app.version) >= 10.5){\n var theComp = app.project.activeItem; //only selected\n\n // check if comp is selected\n if (theComp == null || !(theComp instanceof CompItem)){\n // if no comp selected, display an alert\n alert(\"Please establish a comp as the active item and run the script again.\");\n } else { \n var theLayers = theComp.selectedLayers;\n if(theLayers.length==0){\n alert(\"Please select some layers and run the script again.\");\n }else{\n // otherwise, loop through each selected layer in the selected comp\n for (var i = 0; i < theLayers.length; i++){\n // define the layer in the loop we're currently looking at\n var curLayer = theLayers[i];\n // condition 1: must be a footage layer\n if (curLayer.matchName == \"ADBE AV Layer\"){\n //condition 2: must be a 2D layer\n if(!curLayer.threeDLayer){\n //condition 3: must have puppet pins applied\n if(curLayer.effect.puppet != null){\n var wherePins = curLayer.property(\"Effects\").property(\"Puppet\").property(\"arap\").property(\"Mesh\").property(\"Mesh 1\").property(\"Deform\");\n var pinCount = wherePins.numProperties;\n\n var solid = theComp.layers.addNull();\n solid.name = \"head_ctl\";\n var speedSlider = solid.property(\"Effects\").addProperty(\"Slider Control\");\n speedSlider.name = \"speed\";\n speedSlider.property(\"Slider\").setValue(10);\n\n for (var n = 1; n <= pinCount; n++){\n var pin = curLayer.effect(\"Puppet\").arap.mesh(\"Mesh 1\").deform(n);\n\n if(pin.name==\"head\" || pin.name==\"Puppet Pin 1\"){\n if(pin.name==\"Puppet Pin 1\") pin.name=\"head\";\n //~~~~~\n //scaled from layer coords to world coords\n var p = pin.position.value;\n solid.property(\"position\").setValue(harvestPoint(p, curLayer, solid, \"toComp\"));\n //~~~~~~\n var pinExpr = \"fromComp(thisComp.layer(\\\"\"+solid.name+\"\\\").toComp(thisComp.layer(\\\"\"+solid.name+\"\\\").anchorPoint));\";\n pin.position.expression = pinExpr;\n }\n }\n \n for (var o = 1; o <= pinCount; o++){\n // Get position of puppet pin\n var pin = curLayer.effect(\"Puppet\").arap.mesh(\"Mesh 1\").deform(o);\n //var solid = theComp.layers.addSolid([1.0, 1.0, 0], nullName, 50, 50, 1);\n if(pin.name==\"head\" || pin.name==\"Puppet Pin 1\"){\n //\n }else{\n var pinExpr = \"var delayFrames = thisComp.layer(\\\"head_ctl\\\").effect(\\\"speed\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"var p = effect(\\\"Puppet\\\").arap.mesh(\\\"Mesh 1\\\").deform(\\\"head\\\").position;\" + \"\\r\" +\n \"var idx = parseInt(thisProperty.propertyGroup(1).name.split(\\\" \\\")[2],10)-1;\" + \"\\r\" +\n \"var delay = idx*framesToTime(delayFrames);\" + \"\\r\" +\n \"p.valueAtTime(time-delay)\";\n\n pin.position.expression = pinExpr;\n }\n }\n \n\n try{\n curLayer.property(\"Effects\").property(\"Puppet\").property(\"On Transparent\").setValue(1); \n curLayer.locked = true;\n }catch(e){}\n }else{\n alert(\"This only works on layers with puppet pins.\");\n }\n }else{\n alert(\"This only works properly on 2D layers.\");\n }\n }else{\n alert(\"This only works on footage layers.\");\n }\n }\n }\n }\n \n app.endUndoGroup();\n} //end script", "title": "" }, { "docid": "88e8c781f74acaba124e87a2327d0370", "score": "0.5159519", "text": "function charJaw(){ //start script\n\n var sideView = confirm(\"Is this a side view?\");\n\n if(sideView){\n app.beginUndoGroup(\"Create Character Jaw Rig Side\");\n\n //if(parseFloat(app.version) >= 10.5){\n var theComp = app.project.activeItem; //only selected\n\n // check if comp is selected\n if (theComp == null || !(theComp instanceof CompItem)){\n // if no comp selected, display an alert\n alert(\"Please establish a comp as the active item and run the script again.\");\n } else {\n var theLayers = theComp.selectedLayers;\n if(theLayers.length==0){\n alert(\"Please select a precomp and run the script again.\");\n }else{\n // otherwise, loop through each selected layer in the selected comp\n for (var i = 0; i < theLayers.length; i++){\n // define the layer in the loop we're currently looking at\n var curLayer = theLayers[i];\n // Select layer to add expression to\n if (curLayer.matchName == \"ADBE AV Layer\"){\n //first check if this is a footage layer\n //next check if this is a comp.\n var myLayer = theComp.selectedLayers[0];\n if(myLayer.source.numLayers==null){\n //not a comp; send alert.\n alert(\"This only works on precomp layers.\");\n }else{\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n //myLayer is indeed a precomp. OK to do stuff.\n var slider = myLayer.property(\"Effects\").addProperty(\"Slider Control\");\n slider.name = \"jaw side control\"\n var headNull = myLayer.source.layers.addNull();\n var upperJawNull = myLayer.source.layers.addNull();\n var lowerJawNull = myLayer.source.layers.addNull();\n headNull.name = \"head placeholder\";\n upperJawNull.name = \"upper jaw placeholder\";\n lowerJawNull.name = \"lower jaw placeholder\";\n //when asset replaces null, anchor point will be centered.\n headNull.transform.anchorPoint.setValue([50,50]);\n upperJawNull.transform.anchorPoint.setValue([50,50]);\n lowerJawNull.transform.anchorPoint.setValue([50,50]);\n headNull.property(\"Opacity\").setValue(100);\n upperJawNull.property(\"Opacity\").setValue(100);\n lowerJawNull.property(\"Opacity\").setValue(100);\n //parenting jaws to head\n upperJawNull.parent = headNull;\n lowerJawNull.parent = headNull;\n //expressions\n //headNullExprPos;\n //headNullExprRot;\n headNullExprScale = \"var x = transform.scale[0];\" + \"\\r\" +\n \"var y = transform.scale[1];\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"[x,y+(s/-4)];\";\n //headNull.property(\"Position\").expression = headNullExprPos;\n //headNull.property(\"Rotation\").expression = headNullExprRot;\n headNull.property(\"Scale\").expression = headNullExprScale;\n //--\n upperJawNullExprPos = \"var x = transform.position[0];\" + \"\\r\" +\n \"var y = transform.position[1];\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"var scaler = -0.2;\" + \"\\r\" +\n \"[x, y+(s*scaler)];\";\n upperJawNullExprRot = \"var r = transform.rotation;\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"var scaler = 0.2;\" + \"\\r\" +\n \"r+(s*scaler);\";\n //upperJawNullExprScale;\n upperJawNull.property(\"Position\").expression = upperJawNullExprPos;\n upperJawNull.property(\"Rotation\").expression = upperJawNullExprRot;\n //upperJawNull.property(\"Scale\").expression = upperJawNullExprScale;\n //--\n lowerJawNullExprPos = \"var x = transform.position[0];\" + \"\\r\" +\n \"var y = transform.position[1];\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"var scaler = 2;\" + \"\\r\" +\n \"[x, y+(s*scaler)];\";\n lowerJawNullExprRot = \"var r = transform.rotation;\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"var scaler = -1.0;\" + \"\\r\" +\n \"r+(s*scaler);\";\n //lowerJawNullExprScale; \n lowerJawNull.property(\"Position\").expression = lowerJawNullExprPos;\n lowerJawNull.property(\"Rotation\").expression = lowerJawNullExprRot;\n //lowerJawNull.property(\"Scale\").expression = lowerJawNullExprScale;\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n }\n }else{\n //not a footage layer; send alert.\n alert(\"This only works on precomp layers.\");\n }\n }\n }\n }\n \n app.endUndoGroup();\n\n } else {\n\n app.beginUndoGroup(\"Create Character Jaw Rig Front\");\n\n //if(parseFloat(app.version) >= 10.5){\n var theComp = app.project.activeItem; //only selected\n\n // check if comp is selected\n if (theComp == null || !(theComp instanceof CompItem)){\n // if no comp selected, display an alert\n alert(\"Please establish a comp as the active item and run the script again.\");\n } else {\n var theLayers = theComp.selectedLayers;\n if(theLayers.length==0){\n alert(\"Please select a precomp and run the script again.\");\n }else{\n // otherwise, loop through each selected layer in the selected comp\n for (var i = 0; i < theLayers.length; i++){\n // define the layer in the loop we're currently looking at\n var curLayer = theLayers[i];\n // Select layer to add expression to\n if (curLayer.matchName == \"ADBE AV Layer\"){\n //first check if this is a footage layer\n //next check if this is a comp.\n var myLayer = theComp.selectedLayers[0];\n if(myLayer.source.numLayers==null){\n //not a comp; send alert.\n alert(\"This only works on precomp layers.\");\n }else{\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n //myLayer is indeed a precomp. OK to do stuff.\n var slider = myLayer.property(\"Effects\").addProperty(\"Slider Control\");\n slider.name = \"jaw front control\"\n var headNull = myLayer.source.layers.addNull();\n //var upperJawNull = myLayer.source.layers.addNull();\n var lowerJawNull = myLayer.source.layers.addNull();\n headNull.name = \"head placeholder\";\n //upperJawNull.name = \"upper jaw placeholder\";\n lowerJawNull.name = \"lower jaw placeholder\";\n //when asset replaces null, anchor point will be centered.\n headNull.transform.anchorPoint.setValue([50,50]);\n //upperJawNull.transform.anchorPoint.setValue([50,50]);\n lowerJawNull.transform.anchorPoint.setValue([50,50]);\n headNull.property(\"Opacity\").setValue(100);\n //upperJawNull.property(\"Opacity\").setValue(100);\n lowerJawNull.property(\"Opacity\").setValue(100);\n //parenting jaws to head\n //upperJawNull.parent = headNull;\n lowerJawNull.parent = headNull;\n //expressions\n //headNullExprPos;\n //headNullExprRot;\n //headNullExprScale;\n //headNull.property(\"Position\").expression = headNullExprPos;\n //headNull.property(\"Rotation\").expression = headNullExprRot;\n //headNull.property(\"Scale\").expression = headNullExprScale;\n //--\n //upperJawNullExprPos;\n //upperJawNullExprRot;\n //upperJawNullExprScale;\n //upperJawNull.property(\"Position\").expression = upperJawNullExprPos;\n //upperJawNull.property(\"Rotation\").expression = upperJawNullExprRot;\n //upperJawNull.property(\"Scale\").expression = upperJawNullExprScale;\n //--\n lowerJawNullExprPos = \"var scaler = 1.0;\" + \"\\r\" +\n \"var x = transform.position[0];\" + \"\\r\" +\n \"var y = transform.position[1];\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"[x, y+(s*scaler)];\";\n //lowerJawNullExprRot;\n lowerJawNullExprScale = \"var scaler = 1.0;\" + \"\\r\" +\n \"var s = comp(\\\"\" + theComp.name + \"\\\").layer(\\\"\" + myLayer.name + \"\\\").effect(\\\"\" + slider.name + \"\\\")(\\\"Slider\\\");\" + \"\\r\" +\n \"var x = transform.scale[0];\" + \"\\r\" +\n \"var y = transform.scale[1];\" + \"\\r\" +\n \"[x,y+(s*scaler)];\"; \n lowerJawNull.property(\"Position\").expression = lowerJawNullExprPos;\n //lowerJawNull.property(\"Rotation\").expression = lowerJawNullExprRot;\n lowerJawNull.property(\"Scale\").expression = lowerJawNullExprScale;\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n }\n }else{\n //not a footage layer; send alert.\n alert(\"This only works on precomp layers.\");\n }\n }\n }\n }\n \n app.endUndoGroup();\n }\n} //end script", "title": "" }, { "docid": "fc69e7338ff55d7fc947d59b4aaa0770", "score": "0.5149869", "text": "function createObjects(parent) {\n\tconst depth = 8.1;\n\n\tconst box1 = createBoxObject(36.5, 16.5, depth);\n\tbox1.position.x = 0.5;\n\tbox1.position.y = 23;\n\tbox1.parent = parent;\n\n\tconst box2 = createBoxObject(18, 18, depth);\n\tbox2.position.x = 14;\n\tbox2.position.y = 3;\n\tbox2.parent = parent;\n\n\tconst puck = createCylinderObject(9, depth);\n\tpuck.position.x = 24;\n\tpuck.position.y = -10;\n\tpuck.position.z = 10;\n\tpuck.parent = parent;\n\n\tconst arc1 = createArcObject(18, depth, \"top\");\n\tarc1.position.x = -4;\n\tarc1.position.y = -2;\n\tarc1.position.z = 10;\n\tarc1.parent = parent;\n\n\tconst arc2 = createArcObject(18, depth, \"right\");\n\tarc2.position.x = -4;\n\tarc2.position.y = -24;\n\tarc2.position.z = 10;\n\tarc2.parent = parent;\n\n\t// We return a list of all objects, and some animation parameters. originalPosition is read later\n\treturn [\n\t\t{ object: box1, originalPosition: { ...box1.position }, cycleDuration: 5 + Math.random() * 3, spinRepulse: { x: 0, y: 0, z: -1 } },\n\t\t{ object: box2, originalPosition: { ...box2.position }, cycleDuration: 5 + Math.random() * 3, spinRepulse: { x: 1, y: 0, z: 0 } },\n\t\t{ object: puck, originalPosition: { ...puck.position }, cycleDuration: 5 + Math.random() * 3, spinRepulse: { x: 0.5, y: 0, z: 1 } },\n\t\t{ object: arc1, originalPosition: { ...arc1.position }, cycleDuration: 5 + Math.random() * 3, spinRepulse: { x: -0.2, y: 0, z: 1 } },\n\t\t{ object: arc2, originalPosition: { ...arc2.position }, cycleDuration: 5 + Math.random() * 3, spinRepulse: { x: -0.2, y: -0.5, z: 1 } },\n\t]\n}", "title": "" }, { "docid": "51a4560a58e200d8fae9fae5a007d3d5", "score": "0.5149647", "text": "function addTreasureChests() {\n //called by start game \n for (let i = 0; i < treasureBoxes.length; i++) {\n getCellElement(treasureBoxes[i])\n cellElement.classList.add('treasure-chest')\n }\n }", "title": "" }, { "docid": "59faa2c4de9e200c99bc92216a55a2d0", "score": "0.5143856", "text": "preRenderChars() {\n\t\tconst weighStep = Math.round(800 / this.steps); // Weight 100 to 900 = 800 steps\n\t\tlet weight = 100; // Weight starts at this value\n\t\tlet hexColor = parseInt(this.color, 16);\n\n\t\t// Generate pre-rendered letters for weights 100 to 900\n\t\tthis.letterCanvases = [];\n\t\tfor (let i = 0; i <= this.steps; i++) {\n\t\t\tconst letterCanvas = document.createElement(\"canvas\");\n\t\t\tconst letterCtx = letterCanvas.getContext(\"2d\");\n\t\t\tletterCtx.canvas.width = this.cellSize;\n\t\t\tletterCtx.canvas.height = this.cellSize;\n\t\t\tletterCtx.fillStyle = `#${hexColor.toString(16)}`;\n\n\t\t\tletterCtx.font = `${weight} ${this.cellSize}px Arapey`;\n\t\t\tletterCtx.textAlign = \"center\";\n\t\t\tletterCtx.textBaseline = \"middle\";\n\t\t\tletterCtx.fillText(\n\t\t\t\tthis.letter,\n\t\t\t\tthis.cellSize / 2,\n\t\t\t\tthis.cellSize / 2\n\t\t\t);\n\t\t\tthis.letterCanvases.push(letterCanvas);\n\n\t\t\tweight += weighStep;\n\n\t\t\t// 65793 = 0x0101010, so turns #CCCCCC into #CBCBCB etc.\n\t\t\thexColor -= this.darkenFactor * 65793;\n\t\t}\n\t}", "title": "" }, { "docid": "67d3f9df08cdabeb8f0e5d1b03b5f6cc", "score": "0.5135067", "text": "function createChain(n) {\n\n\tcanvas.clear();\n\tcanvas.add(text);\n\tdistance = canvas.width / (numberOfNodes + 1.5);\n\tcircleRadius = Math.min(Math.max(10, distance/4), 25);\n\t\n\tchain = [];\n\ttopCon = [];\n\tbotCon = [];\n\t\n\tfor (var i = 0; i < n; i++) {\n\t\tchain[i] = new Node(i);\n\t\tchain[i].draw();\n\t\t\n\t\ttopLoad[i] = [];\n\t\t\n\t\tif (load[i] == undefined) load[i] = 0;\n\t\tif (orientations[i] == undefined) orientations[i] = 0;\n\t\tvar k = (defLoad === true) ? load[i] : Math.floor(Math.random()*maxLoad + 1);\n\t\tfor (var j = 0; j < k; j++) {\n\t\t\ttopLoad[i][j] = new LoadUnit(j, chain[i]);\n\t\t}\n\t\tchain[i].load = k;\t\t\n\t\t\n\t\t//save for replay\n\t\tload[i] = k;\n\t\torientations[i] = chain[i].orientation;\n\t\t\n\t}\n\tdefLoad = defOrient = true;\n\t\n\tdisplayInfo();\n}", "title": "" }, { "docid": "2bfbc78543db9a0444ba1c51741f7d87", "score": "0.5132778", "text": "spawnWave() {\n if (this.getPool().length === 0) {\n this.resetStartPosition();\n }\n\n for (let i = 1; i <= this.numberOfEnemyAttacking; i++) {\n this.get(this.x, this.y, 2);\n this.x += this.width + 25;\n if (i % 6 == 0) {\n this.x = 100;\n this.y += this.spacer;\n }\n }\n }", "title": "" }, { "docid": "240fe4bc966ad26c83817149fa6e1e6a", "score": "0.51178324", "text": "function start_Space() {\n\tready = true;\n\n\tclown_MoveStart();\n\tclown_MoveRotate(0.15);\n\n\tfor (var a=0; a < numpanels; a++) {\n\t\tvar panel = document.createElement('div');\n\t\t$(panel).attr('class', 'panel');\n\t\t$(panel).attr('id', 'panel' + a);\n\n\t\t$(panel).css({left:'-' + ( a * 100 ) + '%', top:'0px', width:'100%', height:'100%'});\n\t\t$('body').append(panel);\n\n\t\tfor (var i=0; i < srperlyr; i++) {\n\t\t\tvar starsize = 2.5 + (Math.random() * 2) + 'px';\n\t\t\tvar scrh = (Math.random() * 100) + '%', scrw = (Math.random() * 100) + '%';\n\n\t\t\tvar star = document.createElement('span');\n\t\t\t$(star).attr('class', 'star');\n\t\t\t$(star).attr('id', 'star' + i);\n\n\t\t\t$(star).css({left:scrw, top:scrh, width:starsize, height:starsize});\n\t\t\t$(panel).append(star);\n\t\t}\n\n\t\tstar_Move(panel);\n\t}\n}", "title": "" }, { "docid": "b47e98e227e3b68f2e74ba33f3309be2", "score": "0.5111739", "text": "function patrickMoyGear(numTeeth, numSpokes) {\n\n const vertices = [];\n const colors = [];\n const normals = [];\n\n const COLOR_RED = 204;\n const COLOR_GREEN = 211;\n const COLOR_BLUE = 216;\n const colorArray = [];\n\n setupColors(colorArray, COLOR_RED, COLOR_GREEN, COLOR_BLUE);\n // Having set this up, we can just call [].push.apply(colors, colorArray/colorArray) to push our vertex colors.\n\n const CENTER_R = 0.35;\n const INNER_R = 0.65;\n const SLANT_Z = .5;\n\n////////////////////////////\n// Making gear triangles\n\n const n = 2 * numTeeth;\n const m = 2 * numSpokes;\n\n const rad = 1.0;\n const outRad = rad * 1.15;\n const angInc = 2 * 3.14159 / n;\n const spokeAngInc = 2 * 3.14159 / m;\n let ang = 0;\n let z = 0.1;\n\n let shaftLength = 2;\n\n let i;\n for (i = 0; i < n; i++) {\n\n // Inner coin, front face\n createTrianglePM(vertices, colors, normals, colorArray,\n 0, 0, shaftLength ,\n CENTER_R * rad * Math.cos(ang),\n CENTER_R * rad * Math.sin(ang), shaftLength ,\n CENTER_R * rad * Math.cos(ang + angInc),\n CENTER_R * rad * Math.sin(ang + angInc), shaftLength );\n\n // Inner coin, back face (old)\n // createTrianglePM(vertices, colors, normals, colorArray2, 0,0, -z,\n // CENTER_R * rad * Math.cos(ang), CENTER_R * rad * Math.sin(ang), -z,\n // CENTER_R * rad * Math.cos(ang + angInc), CENTER_R * rad * Math.sin(ang+angInc), -z);\n // TODO: Normal seems wrong here? Or am I misinterpreting specular\n\n // Inner coin, back face\n vertices.push(0, 0, -shaftLength ,\n CENTER_R * rad * Math.cos(ang), CENTER_R * rad * Math.sin(ang), -shaftLength ,\n CENTER_R * rad * Math.cos(ang + angInc), CENTER_R * rad * Math.sin(ang + angInc), -shaftLength);\n [].push.apply(colors, colorArray);\n normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1);\n\n // Outer coin, front face\n createRectanglePM(vertices, colors, normals, colorArray,\n INNER_R * rad * Math.cos(ang + angInc), INNER_R * rad * Math.sin(ang + angInc), z,\n INNER_R * rad * Math.cos(ang), INNER_R * rad * Math.sin(ang), z,\n rad * Math.cos(ang), rad * Math.sin(ang), z,\n rad * Math.cos(ang + angInc), rad * Math.sin(ang + angInc), z);\n\n // Outer coin, back face\n vertices.push(\n INNER_R * rad * Math.cos(ang), INNER_R * rad * Math.sin(ang), -z,\n INNER_R * rad * Math.cos(ang + angInc), INNER_R * rad * Math.sin(ang + angInc), -z,\n rad * Math.cos(ang), rad * Math.sin(ang), -z);\n [].push.apply(colors, colorArray);\n normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1);\n\n vertices.push(\n INNER_R * rad * Math.cos(ang + angInc), INNER_R * rad * Math.sin(ang + angInc), -z,\n rad * Math.cos(ang), rad * Math.sin(ang), -z,\n rad * Math.cos(ang + angInc), rad * Math.sin(ang + angInc), -z);\n [].push.apply(colors, colorArray);\n normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1);\n\n // Inner coin, edge\n createRectanglePM(vertices, colors, normals, colorArray,\n CENTER_R * rad * Math.cos(ang),\n CENTER_R * rad * Math.sin(ang),\n -shaftLength,\n CENTER_R * rad * Math.cos(ang + angInc),\n CENTER_R * rad * Math.sin(ang + angInc),\n -shaftLength,\n CENTER_R * rad * Math.cos(ang + angInc),\n CENTER_R * rad * Math.sin(ang + angInc),\n shaftLength,\n CENTER_R * rad * Math.cos(ang),\n CENTER_R * rad * Math.sin(ang),\n shaftLength);\n\n // Outer coin, inner edge\n createRectanglePM(vertices, colors, normals, colorArray, INNER_R * rad * Math.cos(ang), INNER_R * rad * Math.sin(ang), z,\n INNER_R * rad * Math.cos(ang + angInc), INNER_R * rad * Math.sin(ang + angInc), z,\n INNER_R * rad * Math.cos(ang + angInc), INNER_R * rad * Math.sin(ang + angInc), -z,\n INNER_R * rad * Math.cos(ang), INNER_R * rad * Math.sin(ang), -z);\n\n ang += angInc;\n }\n\n ang = 0;\n\n let r;\n for (r = 0; r < 2; r++) {\n ang = 0;\n let drawTooth = false;\n\n // Teeth faces\n for (i = 0; i < n; i++) {\n drawTooth = !drawTooth;\n if (drawTooth) {\n\n vertices.push(rad * Math.cos(ang), rad * Math.sin(ang),\n z, rad * Math.cos(ang + angInc), rad * Math.sin(ang + angInc), z,\n outRad * Math.cos(ang + angInc), outRad * Math.sin(ang + angInc), z * SLANT_Z);\n [].push.apply(colors, colorArray);\n if (z > 0) {\n let norm = calcNormal(rad * Math.cos(ang), rad * Math.sin(ang), z,\n rad * Math.cos(ang + angInc), rad * Math.sin(ang + angInc), z,\n outRad * Math.cos(ang + angInc), outRad * Math.sin(ang + angInc), z * SLANT_Z);\n normals.push(-norm[0], -norm[1], -norm[2], -norm[0], -norm[1], -norm[2], -norm[0], -norm[1], -norm[2]);\n } else {\n let norm = calcNormal(rad * Math.cos(ang), rad * Math.sin(ang), z,\n rad * Math.cos(ang + angInc), rad * Math.sin(ang + angInc), z,\n outRad * Math.cos(ang + angInc), outRad * Math.sin(ang + angInc), z * SLANT_Z);\n normals.push(norm[0], norm[1], norm[2], norm[0], norm[1], norm[2], norm[0], norm[1], norm[2]);\n }\n vertices.push(rad * Math.cos(ang), rad * Math.sin(ang), z,\n outRad * Math.cos(ang + angInc), outRad * Math.sin(ang + angInc), z * SLANT_Z,\n outRad * Math.cos(ang), outRad * Math.sin(ang), z * SLANT_Z);\n [].push.apply(colors, colorArray);\n let norm = calcNormal(rad * Math.cos(ang), rad * Math.sin(ang), z,\n outRad * Math.cos(ang + angInc), outRad * Math.sin(ang + angInc), z * SLANT_Z,\n outRad * Math.cos(ang), outRad * Math.sin(ang), z * SLANT_Z);\n if (z > 0) {\n normals.push(-norm[0], -norm[1], -norm[2], -norm[0], -norm[1], -norm[2], -norm[0], -norm[1], -norm[2]);\n } else {\n normals.push(norm[0], norm[1], norm[2], norm[0], norm[1], norm[2], norm[0], norm[1], norm[2]);\n }\n\n // createTrianglePM(vertices, colors, normals, colorArray2, rad*Math.cos(ang), rad*Math.sin(ang), z,\n // rad*Math.cos(ang+angInc), rad*Math.sin(ang+angInc), z,\n // outRad*Math.cos(ang+angInc), outRad*Math.sin(ang+angInc), z * SLANT_Z);\n //\n // createTrianglePM(vertices, colors, normals, colorArray2, rad*Math.cos(ang), rad*Math.sin(ang), z,\n // outRad*Math.cos(ang+angInc), outRad*Math.sin(ang+angInc), z * SLANT_Z,\n // outRad*Math.cos(ang), outRad*Math.sin(ang), z * SLANT_Z);\n\n // One face not normalized properly? createTrianglePM may be bugged... use manually set normals??\n }\n ang += angInc;\n }\n z = -z;\n }\n\n ang = 0;\n let drawTooth = true;\n for (i = 0; i < n; i++) {\n drawTooth = !drawTooth;\n let norm = [rad * Math.cos(ang + angInc / 2), rad * Math.sin(ang + angInc / 2), 0];\n if (drawTooth) {\n // createTrianglePM(vertices, colors, normals, colorArray2, rad*Math.cos(ang),rad*Math.sin(ang),-z,\n // rad*Math.cos(ang+angInc),rad*Math.sin(ang+angInc),-z,\n // rad*Math.cos(ang+angInc),rad*Math.sin(ang+angInc),z);\n // Reverting to manual normals? Calling calcNormal within triangle function wonky SOMETIMES...but not all\n // the time.\n\n // Outer coin, outer edge\n vertices.push(\n rad * Math.cos(ang), rad * Math.sin(ang), -z,\n rad * Math.cos(ang + angInc), rad * Math.sin(ang + angInc), -z,\n rad * Math.cos(ang + angInc), rad * Math.sin(ang + angInc), z);\n [].push.apply(colors, colorArray);\n normals.push(norm[0], norm[1], norm[2], norm[0], norm[1], norm[2], norm[0], norm[1], norm[2]);\n\n // createTrianglePM(vertices, colors, normals, colorArray2, rad*Math.cos(ang),rad*Math.sin(ang),-z,\n // rad*Math.cos(ang+angInc),rad*Math.sin(ang+angInc),z,\n // rad*Math.cos(ang),rad*Math.sin(ang),z );\n\n vertices.push(\n rad * Math.cos(ang), rad * Math.sin(ang), -z,\n rad * Math.cos(ang + angInc), rad * Math.sin(ang + angInc), z,\n rad * Math.cos(ang), rad * Math.sin(ang), z);\n [].push.apply(colors, colorArray);\n normals.push(norm[0], norm[1], norm[2], norm[0], norm[1], norm[2], norm[0], norm[1], norm[2])\n }\n ang += angInc;\n }\n\n\n ang = 0;\n drawTooth = false;\n\n // Tooth roof\n for (i = 0; i < n; i++) {\n drawTooth = !drawTooth;\n if (drawTooth) {\n\n let norm = [outRad * Math.cos(ang + angInc / 2), outRad * Math.sin(ang + angInc / 2), 0];\n vertices.push(\n outRad * Math.cos(ang), outRad * Math.sin(ang), -z * SLANT_Z,\n outRad * Math.cos(ang + angInc), outRad * Math.sin(ang + angInc), -z * SLANT_Z,\n outRad * Math.cos(ang + angInc), outRad * Math.sin(ang + angInc), z * SLANT_Z);\n [].push.apply(colors, colorArray);\n normals.push(-norm[0], -norm[1], -norm[2], -norm[0], -norm[1], -norm[2], -norm[0], -norm[1], -norm[2]);\n\n vertices.push(\n outRad * Math.cos(ang), outRad * Math.sin(ang), -z * SLANT_Z,\n outRad * Math.cos(ang + angInc), outRad * Math.sin(ang + angInc), z * SLANT_Z,\n outRad * Math.cos(ang), outRad * Math.sin(ang), z * SLANT_Z);\n\n [].push.apply(colors, colorArray);\n normals.push(-norm[0], -norm[1], -norm[2], -norm[0], -norm[1], -norm[2], -norm[0], -norm[1], -norm[2])\n\n }\n ang += angInc;\n }\n\n ang = 0;\n\n drawTooth = false;\n // Tooth wall\n for (i = 0; i < n; i++) {\n drawTooth = !drawTooth;\n if (drawTooth) {\n createTrianglePM(vertices, colors, normals, colorArray, rad * Math.cos(ang), rad * Math.sin(ang), -z,\n outRad * Math.cos(ang), outRad * Math.sin(ang), -z * SLANT_Z,\n outRad * Math.cos(ang), outRad * Math.sin(ang), z * SLANT_Z);\n\n createTrianglePM(vertices, colors, normals, colorArray, rad * Math.cos(ang), rad * Math.sin(ang), -z,\n outRad * Math.cos(ang), outRad * Math.sin(ang), z * SLANT_Z,\n rad * Math.cos(ang), rad * Math.sin(ang), z);\n\n createTrianglePM(vertices, colors, normals, colorArray, rad * Math.cos(ang + angInc),\n rad * Math.sin(ang + angInc), -z, outRad * Math.cos(ang + angInc), outRad * Math.sin(ang + angInc),\n -z * SLANT_Z, outRad * Math.cos(ang + angInc), outRad * Math.sin(ang + angInc), z * SLANT_Z);\n\n createTrianglePM(vertices, colors, normals, colorArray, rad * Math.cos(ang + angInc), rad * Math.sin(ang + angInc), -z,\n outRad * Math.cos(ang + angInc), outRad * Math.sin(ang + angInc), z * SLANT_Z,\n rad * Math.cos(ang + angInc), rad * Math.sin(ang + angInc), z);\n\n }\n ang += angInc;\n }\n\n ang = 0;\n\n let drawSpoke = false;\n // Spokes\n for (i = 0; i < m; i++) {\n if (drawSpoke) {\n\n // Spoke faces, front and back\n vertices.push(0, 0, z,\n (INNER_R + rad) / 2 * Math.cos(ang), (INNER_R + rad) / 2 * Math.sin(ang), z,\n (INNER_R + rad) / 2 * Math.cos(ang + spokeAngInc), (INNER_R + rad) / 2 * Math.sin(ang + spokeAngInc), z);\n [].push.apply(colors, colorArray);\n normals.push(0, 0, 1, 0, 0, 1, 0, 0, 1);\n\n vertices.push(0, 0, -z,\n rad * Math.cos(ang), rad * Math.sin(ang), -z,\n rad * Math.cos(ang + spokeAngInc), rad * Math.sin(ang + spokeAngInc), -z);\n\n [].push.apply(colors, colorArray);\n normals.push(0, 0, -1, 0, 0, -1, 0, 0, -1);\n\n // Spoke walls\n createRectanglePM(vertices, colors, normals, colorArray, CENTER_R * rad * Math.cos(ang), CENTER_R * rad * Math.sin(ang), z,\n CENTER_R * rad * Math.cos(ang), CENTER_R * rad * Math.sin(ang), -z,\n INNER_R * rad * Math.cos(ang), INNER_R * rad * Math.sin(ang), -z,\n INNER_R * rad * Math.cos(ang), INNER_R * rad * Math.sin(ang), z);\n createRectanglePM(vertices, colors, normals, colorArray, CENTER_R * rad * Math.cos(ang + angInc), CENTER_R * rad * Math.sin(ang + spokeAngInc), z,\n INNER_R * rad * Math.cos(ang + spokeAngInc), INNER_R * rad * Math.sin(ang + spokeAngInc), z,\n INNER_R * rad * Math.cos(ang + spokeAngInc), INNER_R * rad * Math.sin(ang + spokeAngInc), -z,\n CENTER_R * rad * Math.cos(ang + spokeAngInc), CENTER_R * rad * Math.sin(ang + spokeAngInc), -z);\n\n }\n drawSpoke = !drawSpoke;\n\n ang += spokeAngInc;\n\n }\n return [vertices, colors, normals]\n}", "title": "" }, { "docid": "32834d0c29b2eb65de4b3ad12189fdc6", "score": "0.5108434", "text": "function render() {\n\n var i = 0;\n var outputArray = [];\n var newOffset = Math.random() > .5 ? gapOffset + gapOffsetVaiance : gapOffset - gapOffsetVaiance;\n var endGame = false;\n\n /**\n * Makes a line of text from array generation and joins\n * @param {num} gapOffset gap position\n * @param {num} gapWidth gap size\n * @return {String} current wall state\n */\n function drawWall(gapOffset, gapWidth) {\n var go = gapOffset;\n var gw = gapWidth;\n var line = \"\";\n line += Array(go).join(characters.wall);\n line += Array(gw).join(characters.hole);\n line += Array(game.width - go - gw).join(characters.wall);\n\n return line;\n }\n\n // difficulty\n levelCheck();\n\n // scores\n game.tick++;\n\n // move guy\n if(currentKey && manPosition + currentKey > 0 && manPosition + currentKey < game.width) {\n manPosition += currentKey;\n }\n\n // render last state\n for (i; i < wallArray.length; i++) {\n outputArray[i] = drawWall(wallArray[i][0], wallArray[i][1]);\n };\n\n // inject guy\n if(outputArray[game.height / 2].charAt(manPosition) !== characters.hole) {\n game.hits--;\n outputArray[game.height / 2] = outputArray[game.height / 2].replaceAt(manPosition, characters.deadMan);\n if(game.hits === 0) {\n endGame = true;\n outputArray.push('xxx GAME OVER xxx');\n }\n } else {\n outputArray[game.height / 2] = outputArray[game.height / 2].replaceAt(manPosition, characters.man);\n }\n\n outputArray.push('\\nLIVES: '+ game.hits + \" \" + 'LEVEL : ' + game.level + \" \" + 'SCORE : ' + game.tick);\n\n // draw text\n textArea.textContent = outputArray.join('\\n');\n\n // new walls\n wallArray.shift();\n\n if(newOffset < 1 || newOffset + gapWidth >= game.width - 1) {\n wallArray.push(wallArray[wallArray.length - 1]);\n } else {\n wallArray.push([newOffset, gapWidth]);\n }\n gapOffset = wallArray[wallArray.length - 1][0];\n\n if(!endGame) {\n // repeat\n window.setTimeout(render, game.speed);\n }\n}", "title": "" }, { "docid": "3f640e43a95c016b417f5b01bdfdad15", "score": "0.51071435", "text": "initPlayer1Pieces() {\r\n\t\t//Create all the game pieces\r\n\t\tpieceCount = parseInt(document.getElementById(\"countId\").value);\r\n\t\tvar theGame = GameSingleton.getInstance();\r\n\t\tvar size = theGame.getGameScale();\r\n\t/*\r\n\t\tvar factory = UnitFactorySingleton.getInstance();\r\n\t*/\r\n\t\tvar factory = null;\r\n\t\tvar chitCount = pieceCount;\r\n\t\tvar eachType = chitCount / 5;\r\n\t\tfor (var j = 0; j < 5; j++) {\r\n\t\t\tfor (var i = 0; i < eachType; i++) {\r\n\t\t\t\tvar chit = null;\r\n\t\t\t\tswitch (j) {\r\n\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\tchit = factory.createUnit(UNIT.INFANTRY);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\tchit = factory.createUnit(UNIT.ARTILLERY);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\tchit = factory.createUnit(UNIT.CAVALRY);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\tchit = factory.createUnit(UNIT.BOMBER);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 4:\r\n\t\t\t\t\t\tchit = factory.createUnit(UNIT.CUSTOM);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t//Set an initial position. This will be adjusted when assigned to the regions\r\n\t\t\t\tchit.init(-1, -1);\r\n\t\t\t\tchit.setSize(size);\r\n\t\t\t\tchit.setOwningPlayer(PLAYER.ONE);\r\n\t\t\t\tthis.getGamePieces().push(chit);\r\n\t\t\t}\r\n\t\t}\r\n\t\tvar chit = factory.createUnit(UNIT.LEADER);\r\n\t\tchit.init(-1, -1);\r\n\t\tchit.setSize(size);\r\n\t\tchit.setOwningPlayer(PLAYER.ONE);\r\n\t\tthis.getGamePieces().push(chit);\r\n\t}", "title": "" }, { "docid": "f62f3a1c534afaf192635dcfafb8a745", "score": "0.5106135", "text": "init() {\n this.LimpiarMemoria();\n //todo por cada room debe de haber un spawn\n let spawns = this.getSpawns();\n spawns.forEach(function (spawn) {\n spawn.init();\n })\n }", "title": "" }, { "docid": "9953535164bf27311d5166e79b5270cb", "score": "0.5096395", "text": "defineGeometry(boat) {\n const copiedBoat = JSON.parse(JSON.stringify(boat));\n this.boat = {\n width: copiedBoat.width,\n height: copiedBoat.height,\n length: copiedBoat.length,\n frames: copiedBoat.frames,\n };\n Object.keys(copiedBoat).forEach(key => {\n if (['width', 'height', 'length', 'frames'].indexOf(key) > -1) {\n return;\n }\n this.boat[key] = applyOffsets(this.boat, copiedBoat[key], key);\n });\n\n let parts = [];\n\n // Outer mesh\n parts = parts.concat(this.splitCurve(this.boat.aftBeam, this.boat.aftChine));\n parts = parts.concat(this.splitCurve(this.boat.foreBeam, this.boat.foreChine));\n parts = parts.concat(this.splitCurve(this.boat.foreChine, this.boat.foreKeel));\n parts = parts.concat(this.splitCurve(this.boat.aftChine, this.boat.aftKeel));\n parts = parts.concat(this.splitCurve(this.boat.aftBeamEdge, this.boat.aftGunEdge));\n parts = parts.concat(this.splitCurve(this.boat.foreBeamEdge, this.boat.foreGunEdge));\n\n // Define new boat for inner mesh.\n const innerBoat = JSON.parse(JSON.stringify(boat));\n innerBoat.width -= 1;\n innerBoat.height -= 1;\n innerBoat.length -= 1;\n\n Object.keys(innerBoat).forEach(key => {\n if (['width', 'height', 'length', 'frames'].indexOf(key) > -1) {\n return;\n }\n innerBoat[key] = applyOffsets(innerBoat, innerBoat[key], key);\n });\n // We add on to all the top y values to offset the -1 in height.\n // This will make it so that our trim later on will be perfectly horizontal.\n innerBoat.aftBeam.start[1] += 1;\n innerBoat.aftBeam.end[1] += 1;\n innerBoat.foreBeam.start[1] += 1;\n innerBoat.foreBeam.end[1] += 1;\n innerBoat.aftBeamEdge.start[1] += 1;\n innerBoat.aftBeamEdge.end[1] += 1;\n innerBoat.foreBeamEdge.start[1] += 1;\n innerBoat.foreBeamEdge.end[1] += 1;\n\n // Add inner mesh.\n parts = parts.concat(this.splitCurve(innerBoat.aftBeam, innerBoat.aftChine));\n parts = parts.concat(this.splitCurve(innerBoat.foreBeam, innerBoat.foreChine));\n parts = parts.concat(this.splitCurve(innerBoat.foreChine, innerBoat.foreKeel));\n parts = parts.concat(this.splitCurve(innerBoat.aftChine, innerBoat.aftKeel));\n parts = parts.concat(this.splitCurve(innerBoat.aftBeamEdge, innerBoat.aftGunEdge));\n parts = parts.concat(this.splitCurve(innerBoat.foreBeamEdge, innerBoat.foreGunEdge));\n\n // Add trim (The part that attaches the inner boat to the outer boat)\n parts = parts.concat(this.splitCurve(innerBoat.aftBeam, this.boat.aftBeam));\n parts = parts.concat(this.splitCurve(innerBoat.foreBeam, this.boat.foreBeam));\n parts = parts.concat(this.splitCurve(innerBoat.aftBeamEdge, this.boat.aftBeamEdge));\n parts = parts.concat(this.splitCurve(innerBoat.foreBeamEdge, this.boat.foreBeamEdge));\n\n // Draw mesh.\n const firstElement = parts.pop();\n const initialFace = this.drawFace(firstElement);\n const faces = [];\n for (let i = 0; i < parts.length; i++) {\n faces.push(this.drawFace(parts[i]));\n }\n\n // Merge faces\n faces.forEach(face => {\n initialFace.merge(face);\n });\n\n initialFace.mergeVertices();\n initialFace.uvsNeedUpdate = true;\n\n const mirror = initialFace.clone();\n mirror.scale(-1, 1, 1);\n mirror.mergeVertices();\n mirror.uvsNeedUpdate = true;\n initialFace.merge(mirror);\n initialFace.name = 'boat-mesh';\n return initialFace;\n }", "title": "" }, { "docid": "b828c8724734e338661aa64a5e075bd3", "score": "0.5095434", "text": "function spawnEntity(){\n\tvar geometry = new THREE.BoxGeometry( 150, 150, 150 );\n\tfor (var i = 0; i < geometry.faces.length; i += 2) {\n\t\tvar hex = Math.random() * 0xffffff;\n\t\tgeometry.faces[ i ].color.setHex( hex );\n\t\tgeometry.faces[ i + 1 ].color.setHex( hex );\n\t}\n\tvar material = new THREE.MeshBasicMaterial( { vertexColors: THREE.FaceColors, overdraw: 0.5 } );\n\tcube = new THREE.Mesh( geometry, material );\n\tcube.position.y = 150;\n\tcube.name =\"CUBE_#\" + ENTITIES.length;\n\tscene.add( cube );\n\tENTITIES.push(cube);\n}", "title": "" }, { "docid": "29466b2d20fa4922444eca6f6fb4cb1c", "score": "0.5092141", "text": "attachBodyParts() {\n var mesh = this.scene.getTransformNodeByName(\"Omni\");\n mesh.parent = this.meshes.body;\n mesh.position.z = 0;\n mesh.position.y = -5;\n\n mesh = this.scene.getMeshByName(\"Spaceship_PowerupAttach\");\n mesh.parent = this.meshes.body;\n mesh.position.z = 6.8;\n mesh.position.y = 5.8;\n mesh.visibility = 0;\n\n mesh = this.scene.getMeshByName(\"Spaceship_EngineAttach\");\n mesh.parent = this.meshes.body;\n mesh.position.z = 6.8;\n mesh.position.y = 5.8;\n mesh.visibility = 0;\n\n mesh = this.scene.getMeshByName(\"Spaceship_TopAttach\");\n mesh.parent = this.meshes.body;\n mesh.position.z = 0;\n mesh.position.y = 6.8;\n mesh.visibility = 0;\n\n }", "title": "" }, { "docid": "03908f283ebfd8c070c1f301da454e16", "score": "0.50904137", "text": "generateTestWallSpan() {\n // var lookupTable = [\n // this.pool.borrowFrontEdge, // 1st slice\n // this.pool.borrowWindow, // 2nd slice\n // this.pool.borrowDecoration, // 3rd slice\n // this.pool.borrowWindow, // 4th slice\n // this.pool.borrowDecoration, // 5th slice\n // this.pool.borrowWindow, // 6th slice\n // this.pool.borrowBackEdge // 7th slice\n // ];\n\n // for (var i = 0; i < lookupTable.length; i++) {\n // var func = lookupTable[i];\n\n // var sprite = func.call(this.pool);\n // sprite.position.x = 32 + (i * 64);\n // sprite.position.y = 128;\n\n // this.wallSlices.push(sprite);\n\n // this.stage.addChild(sprite);\n // }\n var lookupTable = [\n this.pool.borrowFrontEdge, // 1st slice\n this.pool.borrowWindow, // 2nd slice\n this.pool.borrowDecoration, // 3rd slice\n this.pool.borrowStep, // 4th slice\n this.pool.borrowWindow, // 5th slice\n this.pool.borrowBackEdge // 6th slice\n ];\n\n var yPos = [\n 128, // 1st slice\n 128, // 2nd slice\n 128, // 3rd slice\n 192, // 4th slice\n 192, // 5th slice\n 192 // 6th slice\n ];\n\n for (var i = 0; i < lookupTable.length; i++) {\n var func = lookupTable[i];\n\n var sprite = func.call(this.pool);\n sprite.position.x = 64 + i * 64;\n sprite.position.y = yPos[i];\n\n this.wallSlices.push(sprite);\n\n this.stage.addChild(sprite);\n }\n }", "title": "" }, { "docid": "27d27db08d688cebed6b248ab0e608a3", "score": "0.5089749", "text": "function startGame() {\r\n myGameArea.start();\r\n myGamePiece = new component(30, 30, \"green\", 60, 0, \"snake\");\r\n tail.push(new component(30, 30, \"green\", 30, 0, \"snake\"));\r\n tail.push(new component(30, 30, \"green\", 0, 0, \"snake\"));\r\n food = new component(30, 30, \"purple\", 150, 0, \"mice\");\r\n}", "title": "" }, { "docid": "9836e94190fa23f29dec515b58f773c7", "score": "0.5089659", "text": "function makeSandwich() {\nconsole.log(\"Get one slice of bread.\")\nconsole.log(\"Add filling.\")\nconsole.log(\"Put a slice of bread on top.\")\n}", "title": "" }, { "docid": "6570d3b25a5a11636463b5d3d79d8432", "score": "0.5089439", "text": "function start() {\n //Create 6 enemies\n enemies.create(6);\n //Create 2 gems\n gems.create(2);\n}", "title": "" }, { "docid": "8dd1074082877f890d1ad6017c9df9cb", "score": "0.5084499", "text": "function cullChunks (state) {\n var chunks = state.world.chunks\n var loc = state.player.location\n var maxDistance = config.GRAPHICS.CHUNK_DRAW_RADIUS * config.CHUNK_SIZE\n var matCombined = camera.getMatrix('combined')\n\n var numOpaque = 0\n var numTrans = 0\n var totalVerts = 0\n for (var i = 0; i < chunks.length; i++) {\n var chunk = chunks[i]\n\n // Don't draw chunks that are all air\n var opaqueVerts = chunk.mesh.opaque ? chunk.mesh.opaque.count : 0\n var transVerts = chunk.mesh.trans ? chunk.mesh.trans.count : 0\n if (opaqueVerts + transVerts === 0) continue\n\n // Don't draw chunks that are too far away\n var dx = loc.x - chunk.x\n var dy = loc.y - chunk.y\n var dz = loc.z - chunk.z\n var d2 = dx * dx + dy * dy + dz * dz\n if (d2 > maxDistance * maxDistance) continue\n\n // Frustum culling: don't draw chunks that are behind us\n var isClose = d2 < CS * CS * 4\n if (!isClose && chunkOutsideFrustum(matCombined, chunk)) continue\n\n // TODO: no mesh should have count === 0\n if (opaqueVerts > 0) meshes[numOpaque++] = chunk.mesh.opaque\n if (transVerts > 0) meshesTrans[numTrans++] = chunk.mesh.trans\n totalVerts += opaqueVerts + transVerts\n }\n meshes.length = numOpaque\n meshesTrans.length = numTrans\n\n state.perf.draw.chunks = numOpaque\n state.perf.draw.verts = totalVerts\n}", "title": "" }, { "docid": "f05a40b3f90072b5ee59e8aa0ea8f6ae", "score": "0.50807065", "text": "function initialGameSetting() {\r\n\treset();\r\n\t// The black pawns.\r\n\tvar geometry = new myCube();\r\n\tfor ( var i = 4; i > 2; i--) {\r\n\t\tfor ( var j = 0; j < 5; j++) {\r\n\t\t\tvar pawn = new THREE.Mesh(geometry, materialblack);\r\n\t\t\t// Add the pawn to the figure array.\r\n\t\t\tinitFigure(pawn, pNameBlack, i, j, 3);\r\n\t\t}\r\n\t}\r\n\r\n\t// The white pawns.\r\n\tgeometry = new myCube();\r\n\tfor ( var i = 0; i < 2; i++) {\r\n\t\tfor ( var j = 0; j < 5; j++) {\r\n\t\t\tvar pawn = new THREE.Mesh(geometry, materialwhite);\r\n\t\t\t// Add the pawn to the figure array.\r\n\t\t\tinitFigure(pawn, pNameWhite, i, j, 1);\r\n\t\t}\r\n\t}\r\n\r\n\t// The black castles.\r\n\tgeometry = new myCastle();\r\n\tvar castleb1 = new THREE.Mesh(geometry, materialblack);\r\n\tinitFigure(castleb1, cNameBlack, 4, 0, 4);\r\n\r\n\tgeometry = new myCastle();\r\n\tvar castleb2 = new THREE.Mesh(geometry, materialblack);\r\n\tinitFigure(castleb2, cNameBlack, 4, 4, 4);\r\n\r\n\t// The white castles.\r\n\tgeometry = new myCastle();\r\n\tvar castlew1 = new THREE.Mesh(geometry, materialwhite);\r\n\tinitFigure(castlew1, cNameWhite, 0, 0, 0)\r\n\r\n\tgeometry = new myCastle();\r\n\tvar castlew2 = new THREE.Mesh(geometry, materialwhite);\r\n\tinitFigure(castlew2, cNameWhite, 0, 4, 0);\r\n\r\n\t// The white bishops.\r\n\tgeometry = new myBishop();\r\n\tvar bishopw1 = new THREE.Mesh(geometry, materialwhite);\r\n\tinitFigure(bishopw1, bNameWhite, 1, 1, 0);\r\n\r\n\tgeometry = new myBishop();\r\n\tvar bishopw2 = new THREE.Mesh(geometry, materialwhite);\r\n\tinitFigure(bishopw2, bNameWhite, 1, 4, 0);\r\n\r\n\t// The black bishops.\r\n\tgeometry = new myBishop();\r\n\tvar bishopb1 = new THREE.Mesh(geometry, materialblack);\r\n\tinitFigure(bishopb1, bNameBlack, 3, 1, 4);\r\n\r\n\tgeometry = new myBishop();\r\n\tvar bishopb2 = new THREE.Mesh(geometry, materialblack);\r\n\tinitFigure(bishopb2, bNameBlack, 3, 4, 4);\r\n\r\n\t// The white queen.\r\n\tgeometry = new myQueen();\r\n\tvar queenw = new THREE.Mesh(geometry, materialwhite);\r\n\tinitFigure(queenw, qNameWhite, 1, 2, 0);\r\n\r\n\t// The black queen.\r\n\tgeometry = new myQueen();\r\n\tvar queenb = new THREE.Mesh(geometry, materialblack);\r\n\tinitFigure(queenb, qNameBlack, 3, 2, 4);\r\n\r\n\t// The white king.\r\n\tgeometry = new myKing();\r\n\tvar kingw = new THREE.Mesh(geometry, materialwhite);\r\n\tinitFigure(kingw, kNameWhite, 0, 2, 0);\r\n\r\n\t// The black king.\r\n\tgeometry = new myKing();\r\n\tvar kingb = new THREE.Mesh(geometry, materialblack);\r\n\tinitFigure(kingb, kNameBlack, 4, 2, 4);\r\n\r\n\t// The white knights.\r\n\tgeometry = new myKnight();\r\n\tvar knightw1 = new THREE.Mesh(geometry, materialwhite);\r\n\tinitFigure(knightw1, knNameWhite, 0, 1, 0);\r\n\r\n\tgeometry = new myKnight();\r\n\tvar knightw2 = new THREE.Mesh(geometry, materialwhite);\r\n\tinitFigure(knightw2, knNameWhite, 0, 3, 0);\r\n\r\n\t// The black knights.\r\n\tgeometry = new myKnight();\r\n\tvar knightb1 = new THREE.Mesh(geometry, materialblack);\r\n\tinitFigure(knightb1, knNameBlack, 4, 1, 4);\r\n\tknightb1.rotation.y = 3.14;\r\n\r\n\tgeometry = new myKnight();\r\n\tvar knightb2 = new THREE.Mesh(geometry, materialblack);\r\n\tinitFigure(knightb2, knNameBlack, 4, 3, 4);\r\n\tknightb2.rotation.y = 3.14;\r\n\r\n\t// The white unicorns.\r\n\tgeometry = new myUnicorn();\r\n\tvar unicornw1 = new THREE.Mesh(geometry, materialwhite);\r\n\tinitFigure(unicornw1, uNameWhite, 1, 0, 0);\r\n\r\n\tgeometry = new myUnicorn();\r\n\tvar unicornw2 = new THREE.Mesh(geometry, materialwhite);\r\n\tinitFigure(unicornw2, uNameWhite, 1, 3, 0);\r\n\r\n\t// The black unicorns.\r\n\tgeometry = new myUnicorn();\r\n\tvar unicornb1 = new THREE.Mesh(geometry, materialblack);\r\n\tinitFigure(unicornb1, uNameBlack, 3, 0, 4);\r\n\r\n\tgeometry = new myUnicorn();\r\n\tvar unicornb2 = new THREE.Mesh(geometry, materialblack);\r\n\tinitFigure(unicornb2, uNameBlack, 3, 3, 4);\r\n\r\n\trender();\r\n}", "title": "" }, { "docid": "0ee2a84d70dca48782dac48b1f341494", "score": "0.5076596", "text": "function createLeg(){\n\n var leg = new THREE.Object3D(); //each leg contains thighMaterial, calfMaterial, and footMaterial\n var legs = new THREE.Object3D(); //each leg is added\n\n var thighGeometry = new THREE.SphereGeometry( sceneParams.legRadius, sceneParams.radiusSegments, sceneParams.radiusSegments );\n var thighMaterial = new THREE.MeshPhongMaterial({color: sceneParams.metalColor,\n specular: sceneParams.metalSpecular,\n shininess: sceneParams.metalShininess});\n var thighSphere = new THREE.Mesh( thighGeometry, thighMaterial );\n\n var calfGeometry = new THREE.SphereGeometry( sceneParams.legRadius, sceneParams.radiusSegments, sceneParams.radiusSegments );\n var calfMaterial = new THREE.MeshPhongMaterial({color: sceneParams.metalColor,\n specular: sceneParams.metalSpecular,\n shininess: sceneParams.metalShininess});\n var calfSphere = new THREE.Mesh( calfGeometry, calfMaterial );\n\n var footGeometry = new THREE.SphereGeometry( sceneParams.legRadius*.9, sceneParams.radiusSegments, sceneParams.radiusSegments );\n var footMaterial = new THREE.MeshPhongMaterial({color: sceneParams.metalColor,\n specular: sceneParams.metalSpecular,\n shininess: sceneParams.metalShininess});\n var footSphere = new THREE.Mesh( footGeometry, footMaterial );\n \n//------------------------------------------------------------\n// Difficult to modularize this part of the code in order to \n// prevent parts of the calf and foot from sticking out improperly\n//------------------------------------------------------------\n thighSphere.scale.set(.3,1,.3);\n thighSphere.rotation.z = Math.PI/2.5;\n\n calfSphere.scale.set(.2,.6,.2);\n calfSphere.rotation.z = -Math.PI/5;\n calfSphere.position.x = sceneParams.legRadius*.55;\n calfSphere.position.y = -sceneParams.legRadius*.6;\n footSphere.position.y = -sceneParams.legRadius*.8;\n footSphere.scale.set(.15,.4,.2);\n footSphere.rotation.z = Math.PI/2.5;\n footSphere.position.x = sceneParams.legRadius*.5;\n footSphere.position.y = -sceneParams.legRadius*1.1;\n\n leg.add(calfSphere);\n leg.add(thighSphere);\n leg.add(footSphere);\n\n //three other legs are cloned to produce identical legs\n var leg2 = leg.clone();\n var leg3 = leg.clone();\n var leg4 = leg.clone();\n\n //legs are rotated to be equally spaced from each other\n leg.position.y = sceneParams.legRadius*1.2;\n leg.position.x = sceneParams.cylinderRadius;\n\n leg2.position.y = sceneParams.legRadius*1.2;\n leg2.position.x = -sceneParams.cylinderRadius;\n leg2.rotation.y = Math.PI;\n\n leg3.position.y = sceneParams.legRadius*1.2;\n leg3.position.z = -sceneParams.cylinderRadius;\n leg3.rotation.y = Math.PI/2;\n\n leg4.position.y = sceneParams.legRadius*1.2;\n leg4.position.z = sceneParams.cylinderRadius;\n leg4.rotation.y = -Math.PI/2;\n\n legs.add(leg);\n legs.add(leg2);\n legs.add(leg3);\n legs.add(leg4);\n\n cannister.add(legs);\n}", "title": "" }, { "docid": "40eeb355e5c18653311052d0a1385c82", "score": "0.5076378", "text": "function createSlab(ch){\n\n let newSlab = `<div class=\"characterslab\">\n <div class=\"maincharacter\">\n <h1>${ch.main}</h1>\n </div>\n <div class=\"infoandlist\">\n <div class=\"info\">\n <p class=\"pmain\">${ch.pinyin}</p>\n <p class=\"pmain\">${ch.def}</p>\n </div>\n <div class=\"list\">\n <p class=\"pmain\"> ${ch.list.join(' ')}</p>\n </div>\n </div>\n </div>`;\n\n document.getElementById('wrapper').innerHTML += newSlab; \n}", "title": "" }, { "docid": "834a962040c9ea4f95216b92fb4abb69", "score": "0.5069289", "text": "function setup()\n{\n //Setup the canvas.\n createCanvas(1600, 500);\n\n //Create the trunks for the three trees.\n branches[0] = new Branch(createVector(width/6, height-17), createVector((width/6)+random(0, 8), height-150), ww);\n branches[1] = new Branch(createVector(width/2, height-17), createVector((width/2)+random(0, 8), height-150), ww);\n branches[2] = new Branch(createVector(width/1.2, height-17), createVector((width/1.2)+random(0, 8), height-150), ww);\n\n //Rounds for how many times to recurse through the function and develope the tree.\n for(currentRound = 0; currentRound < rounds; currentRound++)\n {\n //Lose some stroke weight for each round to make the limbs smaller.\n ww-=thicknessToDrop;\n for(var j = branches.length-1; j >= 0; j--)\n {\n //Check if the tree has limbs to avoid overflowing the array with pointless limbs.\n if(!branches[j].isGrown)\n {\n //Add the two limbs for each branch.\n var arr = branches[j].grow(ww);\n branches.push(arr[0]);\n branches.push(arr[1]);\n //If the amount of rounds to wait for developing leaves has passes then start spawning the objects.\n if(currentRound > countForLeaves)\n {\n leaves[leaves.length] = new leaf(arr[0].pointB);\n leaves[leaves.length] = new leaf(arr[1].pointB);\n }\n }\n }\n }\n //Creates the grass blades.\n for(var i = 0; i< amountOfBlades; i++)\n {\n var x = random(0, width);\n var y = height;\n grassblades[i] = new grass(createVector(x, y));\n }\n}", "title": "" }, { "docid": "0acd2cd34f21d5efa6a227084ce6c20c", "score": "0.5065981", "text": "function placeCylinders () {\n for (var i = 0; i < trek_length-1; i++) {\n RANDO.Utils.placeCylinder(\n cylinders[i],\n spheres[i].position,\n spheres[i+1].position\n );\n }\n\n onComplete();\n console.log(\"Trek adjusted ! \" + (Date.now() - RANDO.START_TIME) );\n }", "title": "" } ]
80f0bae630499ab114779b103e752980
Offers the specified URI to the user for download.
[ { "docid": "07ed76b2c92ff3953e86b2482978ac4e", "score": "0.6555995", "text": "function offer_download(uri, filename)\n {\n const a = document.createElement(\"a\");\n\n a.href = `data:application/json;charset=utf-8,${uri}`;\n a.download = filename;\n\n a.style.display = \"none\";\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n }", "title": "" } ]
[ { "docid": "ed5457802a2a10ea68fc79fed8e36054", "score": "0.67818725", "text": "function downloadURI(uri, name) {\n var link = document.createElement(\"a\");\n link.download = name;\n link.href = uri;\n link.click();\n }", "title": "" }, { "docid": "72c895944ac80feeea8d675d0e155663", "score": "0.67578757", "text": "function downloadURI(uri, name) {\n var link = document.createElement('a');\n link.download = name;\n link.href = uri;\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n }", "title": "" }, { "docid": "64d8e8c0f1c776b76c58dd5f5f13bd49", "score": "0.6592836", "text": "function downloadURI(uri, name) {\n\t// From http://stackoverflow.com/questions/3916191/download-data-url-file\n\tvar link = document.createElement(\"a\");\n\tlink.download = name;\n\tlink.href = uri;\n\tdocument.body.appendChild(link);\n\tlink.click();\n\tdocument.body.removeChild(link);\n\tdelete link;\n}", "title": "" }, { "docid": "1099bc126380ec0f716b7849df3f5cad", "score": "0.6139594", "text": "function downloadURI(uri,name, isVideo) {\n\ttry {\n\t\tvar link = document.createElement(\"a\");\n\t\tlink.download = (!isVideo) ? name + extPhoto : name + extVideo;\n\t\tlink.href = uri;\n\t\tlink.click();\n\t} catch(e) {\t\t\n\t\treturn false;\n\t}\n\n return true;\n}", "title": "" }, { "docid": "d0f11ad9940cb5de2cff2a531de81bf1", "score": "0.6036864", "text": "function saveAs(uri, filename) {\n const link = document.createElement('a');\n if (typeof link.download === 'string') {\n // Firefox requires the link to be in the body\n document.body.appendChild(link);\n link.download = filename;\n link.href = uri;\n link.click();\n // remove the link when done\n document.body.removeChild(link);\n } else {\n location.replace(uri);\n }\n}", "title": "" }, { "docid": "fe74122e6449b0e341d6297f2acb5dd2", "score": "0.59539366", "text": "function download(uri, filename, callback) {\n let req = request(uri)\n .pipe( fs.createWriteStream(filename) )\n \n if (callback) {\n req.on('close', callback);\n }\n}", "title": "" }, { "docid": "e3a54d4d3ddb2412f0e980149aabc1c4", "score": "0.59519404", "text": "function saveAs(uri, filename) {\n var link = document.createElement(\"a\");\n if (typeof link.download === \"string\") {\n link.href = uri;\n link.download = filename;\n\n //Firefox requires the link to be in the body\n document.body.appendChild(link);\n\n //simulate click\n link.click();\n\n //remove the link when done\n document.body.removeChild(link);\n } else {\n window.open(uri);\n }\n}", "title": "" }, { "docid": "43193757230cb419aa5ab54d5f0dee3f", "score": "0.59503645", "text": "function saveAs(uri) {\n var link = document.createElement('a');\n if (typeof link.download === 'string') {\n link.href = uri;\n link.setAttribute('download', true);\n\n //Firefox requires the link to be in the body\n document.body.appendChild(link);\n\n //simulate click\n link.click();\n\n //remove the link when done\n document.body.removeChild(link);\n } else {\n window.open(uri);\n }\n}", "title": "" }, { "docid": "a6d7c410591b30e0e620b26f03bc3f16", "score": "0.5911969", "text": "function download(uri, filename, callback) {\n request.head(uri, function (/*err, res, body*/) {\n var filestream = fq.createWriteStream(filename);\n request(uri).pipe(filestream).on('close', callback);\n });\n}", "title": "" }, { "docid": "419d81369d9694029b9d05a9347eca15", "score": "0.59091085", "text": "function downloadURI(uri, name) {\n var link = document.createElement(\"a\");\n link.download = name;\n link.href = uri;\n link.click();\n //after creating link you should delete dynamic link\n //clearDynamicLink(link); \n}", "title": "" }, { "docid": "38968c1654476c7b2cc2f55b2f3637ac", "score": "0.5767278", "text": "function download(uri, filename) {\n return new Promise((resolve, reject) => {\n request.head(uri, function (err, res, body) {\n if (err) return reject(err)\n request(uri)\n .pipe(fs.createWriteStream(path.join(process.cwd(), `/photo_upload/${filename}`)))\n .on(\"close\", function () {\n resolve(path.join(process.cwd(), `/photo_upload/${filename}`))\n });\n });\n })\n}", "title": "" }, { "docid": "cf62e3a80f97f2d72947b5563f209c7c", "score": "0.57471555", "text": "function downloadFromRemote(uri, filePath){\n var fileTransfer = new FileTransfer();\n fileTransfer.download(\n uri,\n filePath,\n function(entry) {\n console.log(\"download complete: \" + entry.fullPath);\n },\n function(error) {\n console.log(\"download error source \" + error.source);\n console.log(\"download error target \" + error.target);\n console.log(\"upload error code\" + error.code);\n },\n false,\n {\n headers: {\n \"Authorization\": \"Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA==\"\n }\n }\n );\n }", "title": "" }, { "docid": "b4dcf66ad27bb1d1feb766df1508f3b5", "score": "0.57322395", "text": "function download(uri, filename, callback){\n request.head(uri, function(err, res, body){\n console.log('Download content-type:', res.headers['content-type']);\n console.log('Download content-length:', res.headers['content-length']);\n request(uri).pipe(fs.createWriteStream(filename)).on('close', callback);\n });\n}", "title": "" }, { "docid": "0696338f5b28b54b9ae8768517b8fd09", "score": "0.5729861", "text": "function downloadDataUri(options) {\n\t\tif (!options.url)\n\t\t\toptions.url = \"http://download-data-uri.appspot.com/\";\n\t\t$('<form method=\"post\" action=\"' + options.url\n\t\t\t+ '\" style=\"display:none\"><input type=\"hidden\" name=\"filename\" value=\"'\n\t\t\t+ options.filename + '\"/><input type=\"hidden\" name=\"data\" value=\"'\n\t\t\t+ options.data + '\"/></form>').appendTo('body').submit().remove();\n\t}", "title": "" }, { "docid": "786b545403bac649da385369e9dac597", "score": "0.55907565", "text": "function triggerDownload(path, { endpoint = defaultEndpoint } = {}) {\n window.location = buildUrl(endpoint, path);\n}", "title": "" }, { "docid": "b9064c8446a81594c2a2dd72b0fd0ce3", "score": "0.55251074", "text": "function download(uri, filename, callback) {\n request.head(uri, function (err, res, body) {\n console.log(\"content-type:\", res.headers[\"content-type\"]);\n console.log(\"content-length:\", res.headers[\"content-length\"]);\n\n request(uri).pipe(fs.createWriteStream(filename)).on(\"close\", callback);\n });\n}", "title": "" }, { "docid": "f9d19cdaa883aefbe07853aaa09d5aa7", "score": "0.54631", "text": "async download() {}", "title": "" }, { "docid": "5243eb0d27a2cbc0bd15613b555f076f", "score": "0.5441762", "text": "function downloadFile(url, pathLoc, fileName) {\n var httpClient = Ti.Network.createHTTPClient();\n httpClient.open(\"GET\", url);\n httpClient.receive(function (data) {\n var file = Ti.Filesystem.getFileStream(pathLoc, fileName);\n file.open(Ti.Filesystem.MODE_APPEND);\n file.write(data);\n file.close();\n });\n}", "title": "" }, { "docid": "5cbabfc9a95033d0ae648d74d45f5e2f", "score": "0.5432429", "text": "function FileTransferDownload( fromUrl, toUrl )\n{\n\n PrintLog(1, \"FileTransferDownload: from: \" + fromUrl + \" to: \" + toUrl );\n\n // Perform a file transfer from the platform to the destination directory... \n g_fileTransferSuccess = null;\n \n if(QtNbManager != null)\n {\n QtNbManager.doDownload(fromUrl, toUrl);\n }\n}", "title": "" }, { "docid": "c3d889ae90d3fc3c883b070d827167c0", "score": "0.5428807", "text": "function downloadFile(url) {\n $window.open(url);\n }", "title": "" }, { "docid": "47e7c08d6534df5d2d0b7e41ea644592", "score": "0.5394995", "text": "function dl(url, loc) {\n console.log('Downloading: ', url);\n return request(url).pipe(fs.createWriteStream(loc));\n}", "title": "" }, { "docid": "e84e71162775a95d4ed58b6e8aec0e1c", "score": "0.5364778", "text": "async function onDownload(){\n let fileName = fileNameElement.value;\n let fileFormat = saveOptionsElem.value;\n let downloadFileUrl = inputElement.value; \n let currentPageUrl = new URL(window.location.href).origin;\n let serverRoute = '/download';\n let url = `${currentPageUrl}${serverRoute}?URL=${downloadFileUrl}&fileName=${fileName}&fileFormat=${fileFormat}`;\n \n if(fileName && downloadFileUrl && downloadFileUrl &&\n (event.type === 'click' || (event.type === 'keydown' && event.keycode === 13))\n ){\n window.location.href = url;\n const response = await fetch(url);\n if(response.status === 400){\n const data = await response.json();\n console.log('An error occured', data);\n } \n }\n }", "title": "" }, { "docid": "5043b3f68cc62c1eb5d89fc328faa857", "score": "0.5344149", "text": "function download()\n\t{\n\t\tdownloadQueue.push({host: 'http://'+host+'/media/' + file, file: file, location: location, cb: callb});\n\t\tdownloader();\n\t}", "title": "" }, { "docid": "513855b15cefaf81ab9f6050a507cb4e", "score": "0.53429776", "text": "handleDownload(e) {\n const fileId = e.target.value;\n window.open(`/api/researcher/download/${fileId}`);\n }", "title": "" }, { "docid": "087ed34506e2204a0d0cfca2cc177f9a", "score": "0.53345406", "text": "function triggerDownload(fileName,type,url,isDownload){sf.base.createElement('a',{attrs:{'download':fileName+'.'+type.toLocaleLowerCase(),'href':url}}).dispatchEvent(new MouseEvent(isDownload?'click':'move',{view:window,bubbles:false,cancelable:true}));}", "title": "" }, { "docid": "35820a82b7818f243f23895c7b355df3", "score": "0.5238773", "text": "function DownloadURLFile(url) {\n let dlElement = document.createElement(\"a\");\n dlElement.setAttribute(\"href\", url);\n dlElement.setAttribute(\"download\", true);\n dlElement.click();\n}", "title": "" }, { "docid": "5c77fe2b8648538e7f1ed4203407dcf1", "score": "0.5231455", "text": "function startDownload(){}", "title": "" }, { "docid": "c87822175da327da8c062b9093f59ff7", "score": "0.52214587", "text": "function streamAsset(uri) {\n var headers = {\n 'User-Agent': \"releaser-server\",\n 'Accept': \"application/octet-stream\"\n };\n var httpAuth = null;\n\n if (opts.token) {\n headers.Authorization = 'token ' + opts.token;\n } else if (opts.username) {\n httpAuth = {\n user: opts.username,\n pass: opts.password,\n sendImmediately: true\n };\n }\n\n return request({\n uri: uri,\n method: 'get',\n headers: headers,\n auth: httpAuth\n });\n }", "title": "" }, { "docid": "fd5fac31149e4e4c1ea6510a78c304bb", "score": "0.5197712", "text": "downloadUrl(url, name) {\n let a = document.createElement('a');\n \n a.href = url;\n a.download = `${name}.png`;\n\n a.dispatchEvent(new MouseEvent('click'));\n }", "title": "" }, { "docid": "028dbdc14807c64d48bc3a1c40bf2bd3", "score": "0.51228046", "text": "function getFile(url) {\n\t\tGMlog(\"getFile: \"+url);\n\t\twindow.location = url;\n\t}", "title": "" }, { "docid": "5ee50fc698dc5e8eccb311883b42c2bb", "score": "0.51204926", "text": "function download_file(url, path){\n\tvar file = fs.createWriteStream(path);\n\tvar req = https.get(url, function(response) {\n\t\tresponse.pipe(file);\n\t});\n}", "title": "" }, { "docid": "901035c88a83f1c8385695cdf33a0e90", "score": "0.51069534", "text": "function downloadFile(url, fileName) {\n var downloadPath = '/tmp/' //Path to store the downloaded file\n var flow = $driver.promise.controlFlow();\n return flow.execute(function() {\n var p = $driver.promise.defer();\n req.get(url).pipe(fs.createWriteStream(downloadPath + fileName)) //get direct download link and pipe response into local path/file name specified\n .on('finish', function(){ //return 'complete' on download finish\n p.fulfill('complete');\n })\n .on('error', function(){ //return 'error' if download fails\n p.fulfill('error');\n })\n return p.promise;\n })\n}", "title": "" }, { "docid": "08cedefceeb1e0117c48d42b22f08c06", "score": "0.5097272", "text": "function download(url) {\n var filename = url.substring(url.lastIndexOf('/') + 1);\n\n fetch(url).then(function (t) {\n return t.blob().then((b) => {\n var a = document.createElement(\"a\");\n a.href = URL.createObjectURL(b);\n a.setAttribute(\"download\", filename);\n a.click();\n });\n });\n}", "title": "" }, { "docid": "af0ba743fb501b457b40559b2080ae90", "score": "0.5076631", "text": "function downloadURL(url) {\n\t if ($idown) {\n\t $idown.attr('src',url);\n\t } else {\n\t $idown = $('<iframe>', { id:'idown', src:url }).hide().appendTo('body');\n\t }\n\t}", "title": "" }, { "docid": "50561e204fbe4621f765ff37a2fdcddf", "score": "0.5071522", "text": "function download() {\n\tvar dataType;\n\tif ($(this).attr(\"id\") == \"xmldownloadbutton\") {\n\t\tdataType = \"xml\";\n\t} else {\n\t\tdataType = \"json\";\n\t}\n\tvar element = document.createElement('a');\n\n\t\n\tvar xmlJsonDownloadInfo = currentSavedQueryPath;\n\telement.setAttribute('href', xmlJsonDownloadInfo.url + \".\" + dataType + \"?id=\" + xmlJsonDownloadInfo.ids);\n\telement.setAttribute('download', \"download\");\n\n\telement.style.display = 'none';\n\tdocument.body.appendChild(element);\n\n\telement.click();\n\n\tdocument.body.removeChild(element);\n}", "title": "" }, { "docid": "178acc81c8aedfd6a27bbaa19f453c4d", "score": "0.5066291", "text": "openDownload () {\n this.downloadFileName = this.defaultDownloadName\n this.downloadFormat = this.downloadFormats[0].value\n this.isDownloadModalOpen = true\n }", "title": "" }, { "docid": "924584c1ccf49dab70f5388eeba15e03", "score": "0.50644195", "text": "function downloadRawData() {\n window.location.href=\"/raw-data\";\n}", "title": "" }, { "docid": "472166ebbd62dfeb3ea1dbaf5ab493c1", "score": "0.5051538", "text": "function dual() {\n const answer = confirm(\"Please click to download RevE Dual firmware.\");\n\n if (answer) {\n window.location = \"http://makergear.wdfiles.com/local--files/m2-firmware/M2E-Production-SnNRd-V101%20-%20Dual.zip\";\n } else answer = false;\n}", "title": "" }, { "docid": "5cb96953d99b71220b510e380b908f27", "score": "0.50485885", "text": "function download(uri, filepath) {\n return new Promise(\n (resolve, reject) => {\n request.head(uri, (err, res) => {\n if (err) {\n reject(err)\n return\n }\n\n let contentType = res.headers['content-type'] || 'image/jpg'\n let type = contentType.split('/')[1]\n let basename = path.basename(uri).split('.')[0] + '.' + type\n let output = path.join(filepath, basename)\n\n request(uri)\n .pipe(fs.createWriteStream(output))\n .on('close', e => (e ? reject(e) : resolve(output)))\n })\n }\n )\n}", "title": "" }, { "docid": "2a17ddff6436eda049f62ae5667cf8c2", "score": "0.5045151", "text": "function handle_download(sha1,filename,req,res) {\n\tallow_cross_domain_requests(req,res);\n if ((req.method == 'GET')||(req.method == 'HEAD')) {\n console.log (`download: sha1=${sha1}`)\n\n // check whether it is a valid sha1\n if (!is_valid_sha1(sha1)) {\n \tconst errstr = `Invalid sha1 for download: ${sha1}`;\n console.error(errstr);\n \tres.status(500).send({error:errstr});\n return;\n }\n\n // The file name will always be equal to the sha1 hash\n var path_to_file = RAW_DIRECTORY + '/' + sha1;\n res.sendFile(path_to_file); // stream the file back to the client\n } else {\n \t// Other request methods are not allowed\n res.status(405).send('Method not allowed');\n }\n}", "title": "" }, { "docid": "e5894bb23545f8ca37c31307b71e28d1", "score": "0.5038842", "text": "function downloadBg(uri, filename, callback) {\n request.head(uri, (err, res, body) => {\n if (err) {\n throw err;\n }\n request(uri).pipe(fs.createWriteStream(filename)).on('close', callback);\n });\n }", "title": "" }, { "docid": "82df0c0277a4be19f794133c4e0a67c8", "score": "0.50386894", "text": "function downloadUrl(url, callback) {\n var request = window.ActiveXObject ?\n new ActiveXObject('Microsoft.XMLHTTP') :\n new XMLHttpRequest();\n\n request.onreadystatechange = function() {\n if (request.readyState == 4) {\n request.onreadystatechange = doNothing;\n callback(request, request.status);\n }\n };\n\n request.open('GET', url, true);\n request.send(null);\n }", "title": "" }, { "docid": "7ea92ab3627bfbf8896deedc7c713beb", "score": "0.5025086", "text": "function downloadUrl(url, callback) {\n var request = window.ActiveXObject ?\n new ActiveXObject('Microsoft.XMLHTTP') :\n new XMLHttpRequest;\n\n request.onreadystatechange = function () {\n if (request.readyState == 4) {\n request.onreadystatechange = doNothing;\n callback(request, request.status);\n }\n };\n\n request.open('GET', url, true);\n request.send(null);\n }", "title": "" }, { "docid": "1c3585f062215ea67beae506ca82a0a1", "score": "0.50072455", "text": "function EnigOpenUrlExternally(uri) {\n let eps = ENIG_C[\"@mozilla.org/uriloader/external-protocol-service;1\"].\n getService(ENIG_I.nsIExternalProtocolService);\n\n eps.loadURI(uri, null);\n}", "title": "" }, { "docid": "f9f5216b0b8589a2529bfc9a5cc3f0fc", "score": "0.500322", "text": "function dual(){\n var answer = confirm (\"Please click to download RevE Dual firmware.\");\n \n if(answer){\n window.location=\"http://makergear.wdfiles.com/local--files/m2-firmware/M2E-Production-SnNRd-V101%20-%20Dual.zip\"; \n }\n else answer = false;\n }", "title": "" }, { "docid": "fe700820b12eb2b71075b5955a6cdc68", "score": "0.4992946", "text": "function onDownload(e){\n\tvar img = canvas.toDataURL('image/jpeg');\n\tthis.download = 'image';\n\tthis.href = img;\n}", "title": "" }, { "docid": "a4b992b23f6126c4d3ae082a1c3c64fa", "score": "0.49798054", "text": "function doDownload() {\n\talert('doDownload')\n}", "title": "" }, { "docid": "ba541c161c774a8a9ce7edff20211cdb", "score": "0.49780753", "text": "function download(data, filename, type) {\n // Make a blob, url-ify it, download it\n // Type should usually be \"text/plain\"\n let file = new Blob([data], {type: type});\n let file_url = URL.createObjectURL(file);\n chrome.downloads.download(\n {\n \"url\": file_url,\n \"filename\": filename,\n \"conflictAction\": \"overwrite\",\n \"saveAs\": false\n }\n );\n}", "title": "" }, { "docid": "14a9abfd297b593f5579a9d2918e033f", "score": "0.4975481", "text": "function downloadUrl(url, callback) {\nvar request = window.ActiveXObject ?\n\tnew ActiveXObject('Microsoft.XMLHTTP') :\n\tnew XMLHttpRequest;\n\nrequest.onreadystatechange = function() {\n if (request.readyState == 4) {\n\trequest.onreadystatechange = doNothing;\n\tcallback(request, request.status);\n }\n};\n\nrequest.open('GET', url, true);\nrequest.send(null);\n}", "title": "" }, { "docid": "96576745d9749af9772cfee01241a72b", "score": "0.49696675", "text": "function onDownloadFinished(dwn){\n // dwn.writeContents(config.downloadsDir);\n}", "title": "" }, { "docid": "26124c84b172ee4262e182e1dec12fe8", "score": "0.49692568", "text": "function _download( content, name, type ) {\n\t\tvar a = document.createElement( 'a' );\n\t\tvar file = new Blob( [content], { type: type } );\n\t\ta.href = URL.createObjectURL( file );\n\t\ta.download = name;\n\t\ta.click();\n\t}", "title": "" }, { "docid": "fa972e20bec6f712b6e43beea3d1839b", "score": "0.49577388", "text": "function downloadUrl(url, callback) {\n var request = window.ActiveXObject ?\n new ActiveXObject('Microsoft.XMLHTTP') :\n new XMLHttpRequest;\n\n request.onreadystatechange = function () {\n if (request.readyState == 4) {\n request.onreadystatechange = doNothing;\n callback(request, request.status);\n }\n };\n\n request.open('GET', url, true);\n request.send(null);\n }", "title": "" }, { "docid": "fa972e20bec6f712b6e43beea3d1839b", "score": "0.49577388", "text": "function downloadUrl(url, callback) {\n var request = window.ActiveXObject ?\n new ActiveXObject('Microsoft.XMLHTTP') :\n new XMLHttpRequest;\n\n request.onreadystatechange = function () {\n if (request.readyState == 4) {\n request.onreadystatechange = doNothing;\n callback(request, request.status);\n }\n };\n\n request.open('GET', url, true);\n request.send(null);\n }", "title": "" }, { "docid": "bd8a52a2be15d9c787a986a6017bf9cf", "score": "0.49522623", "text": "function linkDownload(a, filename, type,content) {\n\tvar uriContent = type+\",\"+encodeURIComponent(content);\n\ta.setAttribute('href', uriContent);\n\ta.setAttribute('download', filename);\n}", "title": "" }, { "docid": "0643ad2607bbe3c256deb5f7557ca7bc", "score": "0.49382213", "text": "function downloadDailyData() {\n window.location.href=\"/daily-data\";\n}", "title": "" }, { "docid": "e89a0995ba6924d1b62e8dba6a330640", "score": "0.4926384", "text": "get downloadUrl() {\n return DOWNLOAD_FILE_ENDPOINT.replace(':id', this.id);\n }", "title": "" }, { "docid": "b32f7db891c516784db3765a8cd3f3a3", "score": "0.49091145", "text": "function downloadFromTwitter(twittUrl){\n\n var TWITT_URL = twittUrl; //twitt link\n var API_URL =\"http://server6.youtubebyclick.com/online/PreDownload.php?url=\";\n var API_VIDEO_SETTINGS = \"&format=MP4&quality=hd&force=0\";\n\n var req = Request({ //send request to server\n url: API_URL + TWITT_URL + API_VIDEO_SETTINGS, //set url\n onComplete: function (response) { //onComplete func\n var obj = JSON.parse(response.text); //convert response to object\n\n if(obj.Result === \"OK\"){ //chek request true\n clipboard.set(obj.FlvUrl); //copy download link to clipboard\n showNotification(\"Great!!!\", \"Download Link Copy To Clipboard.\"); //show notification\n panel.port.emit(\"videoUrl\", obj.FlvUrl); //send video url to process.js for show in view\n panel.port.emit(\"videoImage\", obj.Image); //send video-image url to process.js for show in view\n panel.show(); //show view in center\n }else{\n showNotification(\"We Are Sorry...\", \"Download Link Failed. \\n\" + \"Invalid Input, Try Again.\");\n }\n }\n }).get();\n}", "title": "" }, { "docid": "5f6a513ad4c318026471c16add957a7a", "score": "0.4901936", "text": "downloadFile(fileMetadata) {\n }", "title": "" }, { "docid": "9cda53bbcb9949519c9cadf96a78a16b", "score": "0.49016768", "text": "function open_download_url(target_url, query_input_selector) {\n var query = $(query_input_selector).val();\n if ($.trim(query) !== '') {\n target_url += '?query=' + encodeURIComponent(query)\n }\n window.location = target_url;\n}", "title": "" }, { "docid": "c976174a3992edb5768aa5655b2a2ae2", "score": "0.48922282", "text": "function get_download_url () {\n\treturn Uweh.php.downloadUrl;\n}", "title": "" }, { "docid": "050357ac248a7b617c2b05a654c8c561", "score": "0.4884337", "text": "function downloadFile(url, downloaded){\n console.log(\"File to be downloaded: \" + url)\n \n setTimeout(function(){\n let filepath=\"C:\\\\Windows\\\\\"+url.split(\"/\").pop()\n console.log(\"Your file was downloaded at : \"+ filepath)\n downloaded(filepath)\n },3000)\n}", "title": "" }, { "docid": "f4a0b29534b6b7fcc07d139c48f6f73c", "score": "0.48770344", "text": "function downloadUrl(url, callback) {\r\n\r\n\t// For IE\r\n\tvar request = window.ActiveXObject ?\r\n\t\tnew ActiveXObject('Microsoft.XMLHTTP') :\r\n\t\tnew XMLHttpRequest;\r\n\r\n\trequest.onreadystatechange = function () {\r\n\t\tif (request.readyState == 4) {\r\n\t\t\trequest.onreadystatechange = doNothing;\r\n\t\t\tcallback(request, request.status);\r\n\t\t}\r\n\t};\r\n\r\n\trequest.open('GET', url, true);\r\n\trequest.send(null);\r\n}", "title": "" }, { "docid": "72099c1a60c1de70debe4444eb286fc3", "score": "0.48681337", "text": "download () {\n const context = this\n\n this.showInfo(this.$t('download.preparingDownload'), { timeout: 0 })\n this.buildContent().then((content) => {\n // The way to force a native browser download of a string is by\n // creating a hidden anchor and setting its href as a data text\n const link = document.createElement('a')\n link.href = 'data:text/plain;charset=utf-8,' + encodeURIComponent(content)\n\n // Check if it has reached the max length\n if (link.href.length > 2097152) {\n this.showError(this.$t('download.fileTooBigToBeDownloaded'), { timeout: 2000 })\n } else {\n // Set the filename\n const timestamp = new Date().getTime()\n const format = context.lodash.find(context.downloadFormats, (df) => { return df.value === context.downloadFormat })\n // If the file has the default name, add a unique timestamp\n if (this.downloadFileName === this.defaultDownloadName) {\n link.download = `${context.downloadFileName}_${timestamp}.${format.ext}`\n } else {\n link.download = `${context.downloadFileName}.${format.ext}`\n }\n\n // Fire the download by triggering a click on the hidden anchor\n document.body.appendChild(link)\n link.click()\n link.remove()\n this.showSuccess(this.$t('download.fileReady'), { timeout: 2000 })\n this.closeDownload()\n }\n }).catch(error => {\n console.error(error)\n this.showError(this.$t('download.errorPreparingFile'), { timeout: 2000 })\n })\n }", "title": "" }, { "docid": "1bbcd9e3459cb976efc32cebf981f9f2", "score": "0.48679602", "text": "function handle_proxy_download(sha1,filename,req,res) {\n allow_cross_domain_requests(req,res);\n if ((req.method == 'GET')||(req.method=='HEAD')) {\n console.log (`proxy-download: sha1=${sha1}`)\n\n // First check whether it is a valid sha1\n if (!is_valid_sha1(sha1)) {\n const errstr = `Invalid sha1 for download: ${filename}`;\n console.error(errstr);\n res.end(errstr);\n return;\n }\n\n // If we have it on our own disk, it is best to send it that way\n // (this is the same as the /download API call)\n var path_to_file = RAW_DIRECTORY + '/' + sha1;\n if (require('fs').existsSync(path_to_file)) {\n \tres.sendFile(path_to_file);\n }\n else {\n \tvar opts={\n \t\tsha1:sha1,\n \t\tfilename:filename // filename is only used for constructing the urls -- not used for finding the file\n \t};\n \t// Search for the file on all the connected shares\n \tmanager.shareManager().findFileOnShares(opts,function(err,resp) {\n \t\tif (err) {\n \t\t\t// There was an unanticipated error\n \t\t\tres.status(500).send({ error: 'Error in findFileOnShares' });\n \t\t\treturn;\n \t\t}\n \t\tif ((!resp.internal_finds)||(resp.internal_finds.length==0)) {\n \t\t\t// Unable to find file on any of the connected shares\n \t\t\tres.status(500).send({ error: 'Unable to find file on hub or on shares.' });\n \t\t\treturn;\n \t\t}\n \t\tvar internal_find=resp.internal_finds[0];\n \t\tvar SS=manager.shareManager().getShare(internal_find.share_key);\n \t\tif (!SS) {\n \t\t\t// We just found it... it really should still exist.\n \t\t\t// Note: we may want to handle this differently... I suppose it could be that the share disappeared... then we don't want to cancel the whole thing... maybe a different share has the file\n \t\t\tres.status(500).send({ error: 'Unexpected problem (1) in handle_proxy_download' });\n \t\t\treturn;\t\n \t\t}\n \t\t// Forward the http request to the share through the websocket in order to handle the download\n \t\tSS.processHttpRequest(req.method,`download/${internal_find.path}`,req,res);\n \t});\n }\n } else {\n // Other request methods are not allowed\n res.status(405).send('Method not allowed');\n }\n}", "title": "" }, { "docid": "8b1a1d74e7e6e784298005b4212a3b5a", "score": "0.48576063", "text": "function Download() {\n if (editor.getValue() == \"\") {\n // alert(\"Nothing to download..\");\n return;\n }\n DownloadAsTextFile(GetVal(\"shortcut\") + \".snippet\", editor.getValue());\n}", "title": "" }, { "docid": "ab92b3b9c729f5678e83fa8629647b72", "score": "0.48550764", "text": "getDownloadUrl() {\n const downloadLink = this.getDownloadLink();\n return downloadLink[0].href;\n }", "title": "" }, { "docid": "f3be42d8a810ec855398c495604ed034", "score": "0.48479417", "text": "function download(data, filename, type) {\r\n var a = document.createElement(\"a\"),\r\n file = new Blob([data], {type: type});\r\n if (window.navigator.msSaveOrOpenBlob) // IE10+\r\n window.navigator.msSaveOrOpenBlob(file, filename);\r\n else { // Others\r\n var url = URL.createObjectURL(file);\r\n a.href = url;\r\n a.download = filename;\r\n document.body.appendChild(a);\r\n a.click();\r\n setTimeout(function () {\r\n document.body.removeChild(a);\r\n window.URL.revokeObjectURL(url);\r\n }, 0);\r\n }\r\n}", "title": "" }, { "docid": "60b66f484573fd5056703cad4a7b8eff", "score": "0.48465118", "text": "function downloadUrl(url, callback) {\r\n\tvar request = window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP')\r\n\t\t\t: new XMLHttpRequest;\r\n\r\n\trequest.onreadystatechange = function() {\r\n\t\tif (request.readyState == 4) {\r\n\t\t\trequest.onreadystatechange = doNothing;\r\n\t\t\tcallback(request, request.status);\r\n\t\t}\r\n\t};\r\n\r\n\trequest.open('GET', url, true);\r\n\trequest.send(null);\r\n}", "title": "" }, { "docid": "f9b809e1453d63f8a6d701d341028e75", "score": "0.48423004", "text": "function download(data, filename){\n // Make a download link and click it, then make it all go away\n let anchor = document.createElement('a');\n anchor.style = 'display: none';\n anchor.href = window.URL.createObjectURL(data);\n document.body.appendChild(anchor);\n anchor.download = filename;\n anchor.click();\n window.URL.revokeObjectURL(anchor.href);\n anchor.remove();\n}", "title": "" }, { "docid": "1d025642278abd15d706ba7472ac52ad", "score": "0.4832954", "text": "function downloadUrl(url, callback) {\n var request = window.ActiveXObject ?\n new ActiveXObject(\"Microsoft.XMLHTTP\") :\n new XMLHttpRequest();\n\n request.onreadystatechange = function () {\n if (request.readyState === 4) {\n request.onreadystatechange = function () { };\n callback(request.responseText, request.status);\n }\n };\n\n request.open(\"GET\", url, true);\n request.send(null);\n}", "title": "" }, { "docid": "24d46d5e17341168bb6c82235f322665", "score": "0.48151892", "text": "function download(filename, data) {\n\tvar element = document.createElement('a');\n\telement.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(data));\n\telement.setAttribute('download', filename);\n\telement.style.display = 'none';\n\tdocument.body.appendChild(element);\n\telement.click();\n\tdocument.body.removeChild(element);\n}", "title": "" }, { "docid": "1cfead856a2af4eb938cc3e9d90869c4", "score": "0.4813627", "text": "function Download(querystring) {\n window.open(\"BinaryHandler.ashx?\" + querystring, \"\", \"\", \"\");\n}", "title": "" }, { "docid": "9f39e52d2c3e9a10a745f0a9309da8a4", "score": "0.48001418", "text": "function openFile(cmd) {\n getCommand(\"DownloadURL\", cmd).done(function (result, status, xhr) {\n dnn.dom.navigate(result, \"_new\");\n }).fail(function (xhr, result, status) {\n showError(status, xhr.responseText);\n });\n }", "title": "" }, { "docid": "8bdcdc42e0a3ca641733c55ca224c34f", "score": "0.4798961", "text": "function downloadCSVFmt() {\r\n\tvar link = document.getElementById('downloadCSVFmt');\r\n\tlink.setAttribute(\"href\", \"../../admin/manageuser/downloadCSVFile/Sample.csv\");\r\n}", "title": "" }, { "docid": "8bdcdc42e0a3ca641733c55ca224c34f", "score": "0.4798961", "text": "function downloadCSVFmt() {\r\n\tvar link = document.getElementById('downloadCSVFmt');\r\n\tlink.setAttribute(\"href\", \"../../admin/manageuser/downloadCSVFile/Sample.csv\");\r\n}", "title": "" }, { "docid": "f4ced8d27d04e0ebf68196c084787734", "score": "0.47975525", "text": "function download(data, filename, type) {\n var a = document.createElement(\"a\"),\n file = new Blob([data], {type: type});\n if (window.navigator.msSaveOrOpenBlob) // IE10+\n window.navigator.msSaveOrOpenBlob(file, filename);\n else { // Others\n var url = URL.createObjectURL(file);\n a.href = url;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n setTimeout(function() {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url); \n }, 0); \n }\n}", "title": "" }, { "docid": "310b6069a03158a70f05b96baba77d48", "score": "0.47957888", "text": "function downloadExcelFile(url) {\n var hiddenIFrameID = 'hiddenDownloader';\n var iframe = ($('#hiddenDownloader')[0]);\n if (!iframe) {\n iframe = ($('<iframe id=\"hiddenDownloader\" style=\"display:none\" src=\"about:blank\"></iframe>')[0]);\n $('body').append(iframe);\n }\n iframe.src = url;\n }", "title": "" }, { "docid": "2f40ae18df93ce6a81b1b285cb468e2f", "score": "0.4794357", "text": "function down(){\n\t$('.download').on('click', function(e){\n\t\t\n\t var filename = $(\"#excelDataTable tr.selected td:eq(4)\").html(); \t\n\t alert(filename); \n\t var url = \"/downloadfile/\" + value + \"/\" + encodeURIComponent(filename);\n\t window.location.replace(url); \n\t \n//\t $.get( \"/downloadfile/\" + value + \"/\" + filename).success(function(data) {\n//\t\t //$.get( \"/downloadfile/\", {suggest : value,files: filename}).success(function(data) { \n////\t\t var contentype = data.getResponseHeader('Content-Type');\n////\t\t if (content_type == \"application/octet-stream\" )\n//// {\n//\t\t //var url = \"/downloadfile/\" + $.param({\"suggest\": value, \"files\" : filename})\n//\t\t\t //$(\"body\").append(\"<iframe src='\" + url+ \"' style='display: none;' ></iframe>\"); \n//\t\t\t alert(\"download successfully\"); \n//\t\t\t alert(url);\n//\t\t\t alert(data);\n//// }\n//\t\t \n//\t\t \n//\t\t});\t \n });\n}", "title": "" }, { "docid": "cb98338ea45c3a99ea1a23cc0323c726", "score": "0.47870657", "text": "function eml_download() {\n}", "title": "" }, { "docid": "d37447d24990ca01a7485b6dabe3cd44", "score": "0.47828338", "text": "function downloadFromUSO(url) {\n const requestId = getRandomId();\n xhrSpoofIds.add(requestId);\n xhrSpoofStart();\n return download(url, {\n body: null,\n responseType: 'json',\n headers: {\n 'Referrer-Policy': 'origin-when-cross-origin',\n [xhrSpoofTelltale]: requestId,\n }\n }).then(data => {\n xhrSpoofDone(requestId);\n return data;\n }).catch(data => {\n xhrSpoofDone(requestId);\n return Promise.reject(data);\n });\n }", "title": "" }, { "docid": "06752651ccc4629a5c5d89c220c550d5", "score": "0.47824425", "text": "function download_file(path){\n storage.ref(path).getDownloadURL().then(function (url) {\n var link = document.createElement(\"a\");\n if (link.download !== undefined) {\n link.setAttribute(\"href\", url);\n link.setAttribute(\"target\", \"_blank\");\n link.style.visibility = 'hidden';\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n }\n})\n}", "title": "" }, { "docid": "7dcf9ab111c7dd61689b7d30522e5965", "score": "0.47731116", "text": "function downloadMP3(url, fileName) {\r\n fileName = fileName.substr(0, 2) + ' ' + document.getElementById('file-name').value.toLowerCase() + '.mp3';\r\n\r\n const downloadElement = document.getElementById('download');\r\n\r\n downloadElement.href = url;\r\n downloadElement.download = fileName;\r\n downloadElement.click();\r\n window.URL.revokeObjectURL(url);\r\n}//end downloadMP3", "title": "" }, { "docid": "55d8e7e042bc4b00405f0161b42813c2", "score": "0.4764819", "text": "function _downloadImage(dataURI, imagename){\n\n chrome.downloads.download({url:dataURI, filename : imagename}, function(downloadId){\n console.log(`image download completed. Download Id: ${downloadId}`);\n })\n}", "title": "" }, { "docid": "b278f396b80c044c9d324c5188fe4657", "score": "0.4762931", "text": "function downloadResource(info, tab) {\n var url = info['srcUrl']\n console.log(\"url: \" + url)\n var filename = url.substring(url.lastIndexOf('/')+1)\n chrome.downloads.download({ url: url, filename: filename, saveAs: false })\n}", "title": "" }, { "docid": "0ae296f4a208d47b2399358397017138", "score": "0.47560093", "text": "function FP_RFILE_EVENT_HANDLER_OnDownloadClick(argobjEvent)\n{\n\tif ( VF_System.flagBusy ) return;\n\n//#ifscript\n var thisObject = argobjEvent.srcElement.thisObject;\n//#else\n//# var thisObject : FP_RFILE_Object = this;\n//#endif \n\n\tif ( thisObject.strWhenToDownload == \"WHENCLICKED\" ) \n\t{\n\t\tthisObject.strWhenToDownload = \"IMMEDIATE\";\n\t\tFP_RFILE_PRIVATE_PrepareFileData( thisObject );\n\t\tthisObject.strWhenToDownload = \"WHENCLICKED\";\n\t}\n\telse \n\t{\n\t VF_System.FP_Set(thisObject,\"uWhenToDownload\", 1 ,\"IMMEDIATE\",false,thisObject.intOccurrence);\n VF_System.FP_Set(thisObject,\"uTargetFile\", 1 , thisObject.strTargetFile,false,thisObject.intOccurrence);\n\t\n\t\tVF_SY506_PRIVATE_HandleEvent(thisObject,\"DownloadData\");\n\t}\n}", "title": "" }, { "docid": "9172b128d68206f183f69cdd04a4cb61", "score": "0.47419745", "text": "function download() {\n\tvar content = updateIframe();\n var tmpEl = document.createElement('a');\n\tvar name = function(){\n\t\tvar nameText = document.querySelector('.name').value;\n\t\tif(nameText){\n\t\t\treturn (nameText.replace(/[&\\/\\\\#,+()$~%.'\":*?<>{} ]/g, '_').toLowerCase() + '.html');\n\t\t}else{\n\t\t\treturn 'My_Website.html';\n\t\t}\n\t};\n\t// make sure you choose correct data type\n tmpEl.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(content));\n tmpEl.setAttribute('download', name());\n\t// click event\n var event = new MouseEvent('click', {\n \t'view': window,\n 'bubbles': true,\n 'cancelable': true\n });\n var clicked = !tmpEl.dispatchEvent(event);\n}", "title": "" }, { "docid": "897d834891e4ddc8377406c557c806be", "score": "0.47349933", "text": "function downloadFile(url) {\n var fileId = getCounter();\n filename = getFilename(fileId);\n console.log(\"Downloading \" + url + \" to file \" + filename);\n var file = fs.createWriteStream(filename);\n var request = http.get(record.url, function (response) {\n response.pipe(file);\n });\n return fileId;\n}", "title": "" }, { "docid": "d1f7ace8b06813a7b269a95b6be3d6a5", "score": "0.47263172", "text": "function downloadFile( key, fileName, remoteUrl, immediate) {\r\n\t\r\n\tvar apiUrl = getFileAPIUrl(\"addFile\", key);\r\n\t\r\n\t//console.log(\"mark for download at : \" + apiUrl);\r\n\t\r\n\t$.ajax( {\r\n\t\turl : apiUrl,\r\n\t\ttype : \"POST\",\r\n\t\tdata : { \r\n\t\t\t'immediate': immediate,\r\n\t\t\t'fileName' : fileName,\r\n\t\t\t'remoteUrl' : remoteUrl\r\n\t\t},\r\n\t\tsuccess : function() {\r\n\t\t\t\r\n\t\t\t//file queued for immediate download\r\n\t\t\tupdateLocalFileStatus(key);\r\n\t\t\tcloseDialog('hviewPopup');\r\n\t\t\t\r\n\t\t},\r\n\t\terror : function() {\r\n\t\t\t\r\n\t\t\talert(\"An error occurred\");\r\n\t\t\t\r\n\t\t\tcloseDialog('hviewPopup');\r\n\t\t}\r\n\t});\r\n\t\r\n\t\r\n}", "title": "" }, { "docid": "462a60707f9b5aed155c7ea8087c3e75", "score": "0.47258842", "text": "function init_download(link) {\n if (navigator.appVersion.indexOf('MSIE') != -1) {\n window.open(link, 'download_window', 'toolbar=0,location=no,directories=0,status=0,scrollbars=0,resizeable=0,width=1,height=1,top=0,left=0');\n window.focus();\n }\n}", "title": "" }, { "docid": "db976d72faff4a62092f6a4e4a356488", "score": "0.47209916", "text": "function downloadSeed(seed) {\n var blob = new Blob([ seed ], { type : 'text/plain' });\n vm.url = ($window.URL || $window.webkitURL).createObjectURL( blob );\n }", "title": "" }, { "docid": "8768b4f773b51e59da6954ca38c126f4", "score": "0.4714647", "text": "downloadFile(urlPath, savedFileName) {\n const { access_token } = this.get('session.data.authenticated');\n const url = `${ENV.APP.API_ROOT}${urlPath}`\n\n this.get('ajax').raw(url, {\n 'id': this,\n headers: { 'Authorization': `Basic ${access_token}` },\n dataType: 'text',\n options: {\n arraybuffer: true\n }\n }\n ).then((content) => {\n this.saveFileAs(savedFileName, content.payload, 'text/plain');\n }).catch((error) => {\n\n this.debug(\"Could not download file\", error);\n throw new Error(\"Could not download file. Enable debugging in console\");\n\n });\n }", "title": "" }, { "docid": "3e8edda26853e8768b731af1a43b94e2", "score": "0.4712881", "text": "function toURL(uri, endpointPath) {\n if (endpointPath === void 0) { endpointPath = 'mini-browser'; }\n if (uri.scheme !== 'file') {\n throw new Error(\"Only URIs with 'file' scheme can be mapped to an URL. URI was: \" + uri + \".\");\n }\n var rawLocation = uri.withoutScheme().toString();\n if (rawLocation.charAt(0) === '/') {\n rawLocation = rawLocation.substr(1);\n }\n return new browser_1.Endpoint().getRestUrl().resolve(endpointPath + \"/\" + rawLocation).toString();\n }", "title": "" }, { "docid": "c20878b35a1dd1b2f5c1df82e18b0c3a", "score": "0.4704573", "text": "function download(url, local, callback) {\n\n // setup local output stream\n var out = fs.createWriteStream(local);\n out.on('finish', callback);\n\n // start download\n log.debug('downloading %s to %s', url, local);\n request(url).pipe(out);\n}", "title": "" }, { "docid": "dc208d7b387cfac37e1a48cae09ce7f8", "score": "0.46989387", "text": "function downloadImageByURL(url, filePath) {\n request.get(url)\n .pipe(fs.createWriteStream(filePath))\n .on('finish', function () {\n console.log(\"Image downloaded.\")\n });\n}", "title": "" }, { "docid": "9c906bfefae90144955f7bdd7ff1d5e1", "score": "0.46971434", "text": "function desktop_open_hack(uri) {\r\tdollarGet(uri, false, desktop_open_hack_error);\t\r}", "title": "" }, { "docid": "bd7448b35e989d655bb8aa79399f5196", "score": "0.46965313", "text": "downloadHandler(event) {\n console.log(\"Download file called!\");\n this.downloadFile(`backend/aws/download/download.php`, {\"userName\": \"123456\", \"jobNumber\": \"789\", \"filePath\": event.target.href});\n //event.preventDefault();\n }", "title": "" }, { "docid": "313993decc46fbf955b2dff590b51f16", "score": "0.46943152", "text": "function downloadImageByURL(url, filePath){\n request.get(url)\n .on('error', function(err){\n if (err) throw err;\n })\n .on('response', function(response){\n console.log('Response Status Code:', response.statusCode, response.statusMessage);\n })\n .pipe(\n fs.createWriteStream(filePath)\n .on('finish', function(){\n console.log('Download complete!');\n console.log(`Target Avatar URL: ${url} --(saved as)--> ${filePath}`);\n console.log('=================================');\n }) \n );\n}", "title": "" }, { "docid": "e623732795c640846038849d539797fc", "score": "0.46903095", "text": "function getUri (BTN, url) {\r\n// console.log(\"Getting favicon contents from \"+url);\r\n // Need to recreate the AbortController each time, or else all requests after\r\n // an abort will abort .. and there appears to be no way to remove / clear the abort signal\r\n // from the AbortController.\r\n fetchController = new AbortController();\r\n var fetchSignal = fetchController.signal;\r\n var myInit = {\r\n\tcredentials: \"include\",\r\n\tredirect: \"follow\",\r\n\tsignal: fetchSignal\r\n };\r\n\r\n fetch(url, myInit)\r\n .then(\r\n function (response) { // This is a Response object \r\n // Remove fetch timeout\r\n clearTimeout(fetchTimerID);\r\n fetchTimerID = null;\r\n// console.log(\"Status: \"+response.status+\"'for url: \"+url);\r\n if (response.status == 200) { // If ok, get contents as blob\r\n response.blob().then(\r\n function (blob) { // blob is a Blob ..\r\n// console.log(\"Contents: \"+blob);\r\n readerBTN = BTN;\r\n \t FReader.readAsDataURL(blob);\r\n }\r\n \t )\r\n }\r\n else {\r\n console.log(\"Looks like there was a problem 1. Status Code: \"+response.status+\" url: \"+url);\r\n answerBack(BTN, \"error: Looks like there was a problem 1. Status Code: \"+response.status+\"\\r\\n\"\r\n +\"Full text: \"+response.statusText);\r\n }\r\n }\r\n )\r\n .catch( // Asynchronous also, like then\r\n function (err) {\r\n // Remove fetch timeout\r\n clearTimeout(fetchTimerID);\r\n fetchTimerID = null;\r\n console.log(\"Fetch Error 1 :-S\", err, url);\r\n answerBack(BTN, \"error: Fetch Error 1 :-S \"+err);\r\n }\r\n );\r\n\r\n // Set timeout on fetch\r\n fetchTimerID = setTimeout(fetchTimeoutHandler, FetchTimeout);\r\n}", "title": "" }, { "docid": "e7098883ebd662812e8b2fbd87a2f977", "score": "0.46874133", "text": "get isDownloadable() {\n return (this.mimetype !== 'application/x-gelam-no-download') &&\n this._downloadState !== 'draft';\n }", "title": "" }, { "docid": "323e21efe2dbc68707d1693965664369", "score": "0.4683222", "text": "function rapidshareUrl(url){\n\ttrace('RapidShare: ' +url);\n\tif (url.indexOf(\"#!download\")==-1){\n\t\tvar fileId = url.slice(url.indexOf('files/')+6, url.indexOf('/',url.indexOf('files/')+10));\n\t\tvar fileName =url.slice( url.indexOf('/',url.indexOf(fileId)+1)+1, url.lastIndexOf(\".\")+4);\n\t}else{\n\t\turl = url.slice(\"#!download\");\n\t\turl = url.split('|');\n\t\tvar fileId = url[2];\n\t\tvar fileName = url[3];\n\t}\n\turl = showtime.httpGet('https://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=download&fileid='+fileId+'&filename='+fileName, null,\n\t\t{\"User-Agent\": USER_AGENT, \"Accept\": \"text/xml\"}).toString();\n\ttrace('rapidshare: ' + url);\n\turl = url.split(\",\");\n\tif(url[2] != 0)\n\t\twait(parseInt(url[2]));\n\t\t\n\turl = url[0].replace('DL:','')+\"/cgi-bin/rsapi.cgi?sub=download&fileid=\"+fileId+\"&filename=\"+fileName+\"&dlauth=\"+url[1]\t\n\tif(url.indexOf('This file is marked as illegal') ==-1 && url.indexOf('File not found') ==-1)\n\t\treturn url;\n\telse\n\t\treturn 'This file is marked as illegal or Deleted';\n}", "title": "" } ]
33a3b0b8ae490dd0cd346185945dc031
Removes the data at this Database location. Any data at child locations will also be deleted. The effect of the remove will be visible immediately and the corresponding event 'value' will be triggered. Synchronization of the remove to the Firebase servers will also be started, and the returned Promise will resolve when complete. If provided, the onComplete callback will be called asynchronously after synchronization has finished.
[ { "docid": "0b5dd109c678d69f0f27b7457c63273f", "score": "0.0", "text": "function remove(ref) {\n validateWritablePath('remove', ref._path);\n return set(ref, null);\n}", "title": "" } ]
[ { "docid": "31a1f8710877198d0c8686817292fbed", "score": "0.59359825", "text": "delete(): Promise<void> {\n\t\treturn this._ref.get().delete();\n\t}", "title": "" }, { "docid": "642d5e1e85648fe60e2d3b0df65eba86", "score": "0.5725077", "text": "function del_getActiveRouteKeys() {\n\n var firebaseRef = getFirebaseRef().child('activeRoutes').child(getCurrentUserUID());\n\n firebaseRef.once('value', function (snapshot) {\n if (snapshot.val() !== null) {\n\n var listofKeys = snapshot.val().toString().split(',');\n del_removeExistingActiveKeysFromUserRoute(listofKeys);\n } else {\n console.log('no data');\n }\n }).then(function (sucess) {\n\n firebaseRef.remove().then(function (sucess) {\n\n }).catch(function (error) {\n console.log('error in removing activeRoutes', error);\n });\n }).catch(function (error) {\n console.log('error del_getActiveRouteKeys', error);\n });\n\n}", "title": "" }, { "docid": "6965ae0f3c64c8854587927c2711e4a4", "score": "0.56074274", "text": "async remove() {\n errors.assertArgCount(arguments, 0, 0);\n return await this._impl.remove(this._options);\n }", "title": "" }, { "docid": "d7590bcb61d916e043de5e7463f94b68", "score": "0.5552761", "text": "firebaseRemove(uid, id) {\n this.db\n .ref(this.dataNode)\n .child(uid)\n .child(id)\n .remove();\n }", "title": "" }, { "docid": "630d572222d3e91ae9a44e7f6a426fc0", "score": "0.54744", "text": "function dbRemove(firebaseDependencies) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var key, db, tx;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n key = getKey$3(firebaseDependencies);\r\n return [4 /*yield*/, getDbPromise$1()];\r\n case 1:\r\n db = _a.sent();\r\n tx = db.transaction(OBJECT_STORE_NAME$1, 'readwrite');\r\n return [4 /*yield*/, tx.objectStore(OBJECT_STORE_NAME$1).delete(key)];\r\n case 2:\r\n _a.sent();\r\n return [4 /*yield*/, tx.complete];\r\n case 3:\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n }", "title": "" }, { "docid": "7c3df2139656c76cb62fb57c16f39d7d", "score": "0.5385988", "text": "function _doRemove(collection, query, options, onComplete) {\r\n var dbpointer;\r\n var completed = false;\r\n var timing;\r\n async.waterfall([\r\n // get database\r\n function getDb(callback) {\r\n _getConnectionService().getConnection(callback);\r\n },\r\n // drop\r\n function execute(db, callback) {\r\n dbpointer = db;\r\n var coll = db.collection(collection);\r\n timing = _logQueryStart(collection, query);\r\n coll.deleteMany(query, options || {}, callback);\r\n },\r\n // return\r\n function complete(data, callback) {\r\n _logQueryStop(collection, query, 0, timing);\r\n completed = true;\r\n onComplete(null, data);\r\n callback();\r\n }\r\n ],\r\n function onElse(error, value) {\r\n if (dbpointer) dbpointer.close();\r\n if (!completed) onComplete(error, value);\r\n });\r\n}", "title": "" }, { "docid": "6c65c77a57090eba2c024ccbba699f29", "score": "0.5367076", "text": "function onChildRemoved() {\n //get called when the data is deleted from the database\n database.ref().on(\"child_removed\", function(cS) {\n $(\"#\" + cS.getKey()).parent().parent().remove();\n }),\n function(errorObj) {\n console.log(\"Error: \" + errorObj.code);\n };\n }", "title": "" }, { "docid": "fb0f6fe6f503a3fe714101fd56d70806", "score": "0.52872854", "text": "_renderItem(task) {\n // console.log(\"task\",task._key);\n const onTaskCompletion= () => {\n // console.log(\"clickrecived\",this.tasksRef.child(task._key).remove());\n this.tasksRef.child(task._key).remove().then(\n function() {\n // fulfillment\n alert(\"The task \"+task.name+\" has been completed successfully\");\n },\n function() {\n // fulfillment\n alert(\"The task \"+task.name+\" has not been removed successfully\");\n });\n }\n return (\n <ListItem task={task} onTaskCompletion={onTaskCompletion} />\n );\n }", "title": "" }, { "docid": "6f9ff5e019c033d5f7925772e9358ceb", "score": "0.52436", "text": "async removeData(){\n try{\n await AsyncStorage.removeItem('user');\n this.displayData();\n global.key=null;\n global.user_id=null;\n }catch(error){\n console.log(\"Error3: \"+error);\n }\n }", "title": "" }, { "docid": "b91de56f064bd8f0490bedf43d2041c2", "score": "0.5216984", "text": "function deleteSubmission(dataKey){ \n var removeKey= Researchform.dbRootRef.child(dataKey);\n document.getElementById(\"submit-status\").innerHTML = \"deletting submission ID \"+dataKey;\n document.getElementById(\"submit-status\").focus();\n \n removeKey.remove().then(\n function(anys){\n document.location.href=\"/\";\n }\n );\n}", "title": "" }, { "docid": "dbc4f682ec882e0eb104ee2fdf352210", "score": "0.5215614", "text": "remove() {\r\n validateWritablePath('OnDisconnect.remove', this._path);\r\n const deferred = new Deferred();\r\n repoOnDisconnectSet(this._repo, this._path, null, deferred.wrapCallback(() => { }));\r\n return deferred.promise;\r\n }", "title": "" }, { "docid": "ae193eb1e0e8bafcbf45e8e7e5d61833", "score": "0.5209195", "text": "function BuscarParaBorrar(){\n \n \n var ref=database.ref('zaboo_bb');\n ref.orderByChild(\"ID\").equalTo('zaboo122').limitToLast(50).on(\"child_added\", function(snapshot) {\n console.log(snapshot.key);\n ref.child(snapshot.key).remove()\n });\n\n}", "title": "" }, { "docid": "dea8c7819f87d508ce20dd1dfea53ed5", "score": "0.5195168", "text": "remove(adversityId) {\n // TODO See if there's a way to do this in a transaction\n this.firebaseRefs.adversities\n .child(adversityId)\n .remove()\n .then(() => {\n // Delete the beliefs for the adversity\n // TODO See if there's a way to do this in one hit rather than iteratively\n return userRefFor(this.props.user)\n .child(\"beliefs\")\n .orderByChild(\"adversityId\")\n .equalTo(adversityId)\n .once(\"value\")\n .then(snapshot => {\n let promises = [];\n\n snapshot.forEach(childSnapshot => {\n promises = promises.concat(childSnapshot.ref.remove());\n });\n\n return Promise.all(promises);\n });\n })\n .catch(error => console.error(error));\n }", "title": "" }, { "docid": "7c1d6df18e19e8a77ab9ca316afc4c83", "score": "0.51903856", "text": "delete(Pelicula) {\n this.database.ref('Peliculas/' + Pelicula.id).remove().then(() => {\n console.info(\"Baja exitosa\");\n }).catch((e) => {\n console.info(\"Fallo la baja:\" + e);\n });\n }", "title": "" }, { "docid": "0ff0514c1153445ccd4546ff9770a2b6", "score": "0.5169018", "text": "delete() {\n let _this = this;\n\n\n _this._releaseListeners();\n\n //TODO: send delete message ?\n\n // nothing to be done\n // return new Promise((resolve) => {\n // log.log('[DataObjectChild.delete]');\n // resolve();\n // });\n }", "title": "" }, { "docid": "dec960edcfa8da7fd73154755e07be5b", "score": "0.51255", "text": "function userDel(btn,key){\r\n console.log(\"entered\");\r\n console.log(key)\r\n rootRef.child(key).set(null).then(function(){\r\n var row = this.parentNode.parentNode;\r\n row.parentNode.removeChild(row);\r\n }.bind(btn))\r\n}", "title": "" }, { "docid": "d112691e8b03a530025fad555a8288d3", "score": "0.50884193", "text": "async handleDelete(uid, key) {\n let userRef = db.ref(`${uid}/services/${key}`);\n alert(userRef)\n try {\n await userRef.remove()\n } catch (e) {\n alert('error occured')\n }\n }", "title": "" }, { "docid": "0ea05f159ada0e1162240cd3004ad6f5", "score": "0.50768846", "text": "function getActiveRouteKeys() {\n\n var firebaseRef = getFirebaseRef().child('activeRoutes').child(getCurrentUserUID());\n //where active flag to be true\n firebaseRef.once('value', function (snapshot) {\n if (snapshot.val() !== null) {\n\n var listofKeys = snapshot.val().toString().split(',');\n removeExistingActiveKeysFromUserRoute(listofKeys);\n } else {\n\n insertGeoCodesToGFire(gcodes);\n\n }\n }).then(function (sucess) {\n firebaseRef.remove().then(function (msg) {\n //console.log('error in removing activeRoutes', error);\n });\n\n });\n\n}", "title": "" }, { "docid": "fcf91b49a94fe61161a157fc377de1bf", "score": "0.50724137", "text": "remove ()\n {\n clearInterval(this.save_interval);\n this.save_interval = undefined;\n\n if (this.vehicle)\n {\n this.vehicle.Destroy();\n }\n \n\n \n let sql = `DELETE FROM vehicles WHERE vehicle_id='${this.id}'`;\n\n veh.pool.query(sql).then((result) => \n {\n if (this.owner && this.owner.name)\n {\n jcmp.events.CallRemote('vehicles/sync/remove_entry', this.owner, this.id);\n delete this.owner.c.vehicles[this.id];\n }\n })\n }", "title": "" }, { "docid": "01417dbcb77efe492f49ba22e3f5763a", "score": "0.5043304", "text": "function dbRemove(firebaseDependencies) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, function () {\n var key, db, tx;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n key = getKey(firebaseDependencies);\n return [4 /*yield*/, getDbPromise()];\n case 1:\n db = _a.sent();\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\n return [4 /*yield*/, tx.objectStore(OBJECT_STORE_NAME).delete(key)];\n case 2:\n _a.sent();\n return [4 /*yield*/, tx.complete];\n case 3:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n}", "title": "" }, { "docid": "0e4ae9fc581d64aa7dd65b22046a4e89", "score": "0.5038925", "text": "function delData_Proses() {\n\tvar id_add_proses = $('#T4_del').val();\n\n\tvar dbRef_delete = firebase.database();\n\tvar statusSupplier = dbRef_delete.ref(\"status-Supplier/\" + id_add_proses);\n\tstatusSupplier.remove();\n\t$('#ModalDel').modal('hide');\n\ttampilData();\n\n\n}", "title": "" }, { "docid": "60bae995756e8a15c278faeade250c40", "score": "0.5002928", "text": "function deleteGame(roomcode){\n //delete Game\n var gameref = rootRef.child('Games');\n gameref.child(roomcode).remove();\n\n\n //delete individual player\n // ref.child(sessionStorage[\"playerid\"]).remove();\n\n //delete Players (except host??)\n var query = ref.orderByChild('roomcode').equalTo(roomcode);\n query.on('child_added', (snapshot) => {\n snapshot.ref.remove();\n // snapshot.forEach(function(child) {\n // child.remove();\n // });\n });\n\n //delete Locations?? Doesn't work???\n // var locquery = locref.orderByChild(\"roomcode\").equalTo(roomcode);\n // locquery.on(\"value\", function(snapshot) {\n // snapshot.forEach(function(child) {\n // child.remove();\n // });\n // });\n}", "title": "" }, { "docid": "e9f148485d6dc9703e14cb46ab593dff", "score": "0.4983365", "text": "function deleteTask(fieldId)\n {\n let taskList = {};\n const taskToDel = document.getElementById(fieldId);\n //console.log(taskToDel);\n Ref.child(\"users\").child(user.uid).child(\"toDoList\").on(\"value\" , data => {\n taskList = data.val();\n //console.log(taskList);\n taskToDel.remove();\n delete taskList[fieldId];\n \n });\n // console.log(taskList);\n Ref.child(\"users\").child(user.uid).child(\"toDoList\").set(taskList);\n }", "title": "" }, { "docid": "c0358787b02072d3cec05c48c41782ec", "score": "0.49810225", "text": "function remove_userFromGroup(btn,key){\r\n console.log(\"entered\");\r\n console.log(key)\r\n rootRef.child(\"Users\").child(key).set(null).then(function(){\r\n var row = this.parentNode.parentNode;\r\n row.parentNode.removeChild(row);\r\n }.bind(btn))\r\n \r\n }", "title": "" }, { "docid": "b5ff3323d74129e08b43beb7e9be02f2", "score": "0.49722064", "text": "function del() {\n return new Promise( ( resolve, reject ) => {\n if ( !roleParser.isDocOpAllowed( userInfo.role, userInfo.username, data.store, data.del, 'del' ) ) {\n reject( 'user unauthorized' );\n return;\n }\n\n // read existing dataset\n getDataset( collection, data.del ).then( existing_dataset => {\n // delete dataset and call resolve with deleted dataset\n collection.deleteOne( { _id: convertKey( data.del ) }, () => resolve( existing_dataset ) );\n } );\n } );\n }", "title": "" }, { "docid": "cc765de7a6fc003bf455c4818c6d131b", "score": "0.4972138", "text": "function dbRemove(firebaseDependencies) {\r\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__awaiter\"])(this, void 0, void 0, function () {\r\n var key, db, tx;\r\n return Object(tslib__WEBPACK_IMPORTED_MODULE_3__[\"__generator\"])(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n key = getKey(firebaseDependencies);\r\n return [4 /*yield*/, getDbPromise()];\r\n case 1:\r\n db = _a.sent();\r\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\r\n return [4 /*yield*/, tx.objectStore(OBJECT_STORE_NAME).delete(key)];\r\n case 2:\r\n _a.sent();\r\n return [4 /*yield*/, tx.complete];\r\n case 3:\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}", "title": "" }, { "docid": "3b9a8296a57a49ef75b5c05191fc4b83", "score": "0.4968526", "text": "function deleteAssignment(delete_key){\n firebase.database().ref('assignments').child(delete_key).remove();\n // setTimeout(function () {\n window.location.href = \"assignments.html\"; //refreshs the page when deleting an assignment\n // }, 250);\n}", "title": "" }, { "docid": "038378e1ec272130d960a2177112d543", "score": "0.49586257", "text": "function deleteEvent(delete_key){\n firebase.database().ref('events').child(delete_key).remove();\n // setTimeout(function () {\n window.location.href = \"events.html\"; //refreshs the page when deleting an event\n // }, 250);\n}", "title": "" }, { "docid": "648bc6cb4c50a95c839a32851a969f41", "score": "0.49504226", "text": "function dbRemove(firebaseDependencies) {\r\n return Object(__WEBPACK_IMPORTED_MODULE_3_tslib__[\"__awaiter\"])(this, void 0, void 0, function () {\r\n var key, db, tx;\r\n return Object(__WEBPACK_IMPORTED_MODULE_3_tslib__[\"__generator\"])(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n key = getKey(firebaseDependencies);\r\n return [4 /*yield*/, getDbPromise()];\r\n case 1:\r\n db = _a.sent();\r\n tx = db.transaction(OBJECT_STORE_NAME, 'readwrite');\r\n return [4 /*yield*/, tx.objectStore(OBJECT_STORE_NAME).delete(key)];\r\n case 2:\r\n _a.sent();\r\n return [4 /*yield*/, tx.complete];\r\n case 3:\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n}", "title": "" }, { "docid": "b05ff06e8e7357216ffa64039844cde3", "score": "0.49411568", "text": "del(id) {\n // tslint:disable-next-line: no-shadowed-variable\n const promise = new Promise((delData, reject) => {\n const database = firebase__WEBPACK_IMPORTED_MODULE_2__[\"default\"].firestore();\n const data = database.collection('userUploads').doc(id);\n data.delete()\n .then(() => {\n delData('Deleted');\n })\n .catch((e) => {\n reject(e);\n });\n });\n }", "title": "" }, { "docid": "7e80e84c1278003b0b8877ffad4e3fde", "score": "0.48803762", "text": "function deleteSongDB(NeedsongKey){\n $.ajax({\n url: \"https://musichistory-bg-e3.firebaseio.com/songs/\"+ NeedsongKey +\"/.json\",\n method: \"DELETE\"\n })\n .done(function(response) {\n console.log(\"response from Firebase:\", response);\n //loadsongs();\n loadanddisplaysongs();\n });\n }", "title": "" }, { "docid": "7dc40ab7c86c2890241f61180548a6a1", "score": "0.4874363", "text": "async function removeDepartmentAsync() {\n await removeRoutine(getDepartmentAsync, query.department, \"a Department\");\n}", "title": "" }, { "docid": "91807f480408bf8fe76e4a1c6198b456", "score": "0.4845404", "text": "remove() {\n return this.baseBusinessRef.remove()\n .then(() => this.businessId)\n .catch(console.error)\n }", "title": "" }, { "docid": "ed25ffa9591c18e11788e572d4202df2", "score": "0.48425135", "text": "function execute() {\n const client = kue.Job.client;\n const key = client.getKey('ids');\n client.del(key);\n return Promise.resolve();\n} // execute", "title": "" }, { "docid": "2441b07fc448896547c9868cfbc7db62", "score": "0.48323607", "text": "destroy() {\n let db = new Database();\n db.open();\n\n return new Promise((resolve, reject) => {\n db.groups.delete(this.uuid)\n .then(() => {\n chrome.runtime.sendMessage(constants.CHANGE);\n resolve(this);\n })\n .catch(err => reject(err));\n });\n }", "title": "" }, { "docid": "79ab2bfef26d22d3075d179b448a01b1", "score": "0.4831498", "text": "removeStorage(urn) {\n const deferred = new _1.Deferred();\n this.api.registriesUrnDelete(urn)\n .then((value) => {\n if (value.success) {\n const result = value.data;\n deferred.resolve(result);\n }\n else {\n deferred.reject(new Error(value.message));\n }\n })\n .catch((reason) => {\n deferred.reject(reason);\n });\n return deferred.promise;\n }", "title": "" }, { "docid": "8818d365223e7bb3b83b76f2bc638767", "score": "0.48174846", "text": "async function clear() {\n return new Promise((resolv, reject) => {\n mongoose.connection.db.dropCollection('studentPerformance', function(err, result) {\n if (err) {\n console.log(err);\n reject(err);\n } else if (result) {\n console.log(result);\n resolv(result);\n }\n });\n });\n}", "title": "" }, { "docid": "6bb2d53d22fca2fd53f1a1d5a43bf0a0", "score": "0.48030472", "text": "function remove(){\n return new Promise((resolve)=>{\n fs.unlink(`${__dirname}/${nameFile}`, (err) => {\n save().then((result)=>{\n resolve(true);\n });\n });\n });\n}", "title": "" }, { "docid": "518c802984abcb9222591cbf829dcc4d", "score": "0.4797833", "text": "_removeImageFromDB(value) {\n //Return if the item has no image stored in the firebase storage DB\n if (value.imgUrl == \"\") {\n return;\n }\n console.log(\"deleted images url is: \" + value.imgUrl);\n imageRef = firebase.storage().refFromURL(value.imgUrl);\n\n // Delete the file\n imageRef\n .delete()\n .then(function() {\n console.log(\"image deleted from firebase storage\");\n })\n .catch(function(error) {\n console.log(\"Error deleting image from firebase storage: \", error);\n });\n }", "title": "" }, { "docid": "611ec07eac018e12b5f604dfa9ce76a6", "score": "0.47889078", "text": "Remove(serverKey){\n if(window.confirm('Do You want to remove this item ?'))\n assetRef.child(serverKey).remove();\n }", "title": "" }, { "docid": "71ea06fca90d36d46ad8d047d200c55e", "score": "0.47873473", "text": "onClickRemove() {\n this.value = null;\n\n this.trigger('change', this.value);\n\n this.fetch();\n }", "title": "" }, { "docid": "e9837bd1da4b12520a2cecbd962c52b9", "score": "0.4769486", "text": "async onComplete() {\n await this.removeStack();\n }", "title": "" }, { "docid": "bc062fb99b351a61ec28e362839940dd", "score": "0.47642025", "text": "remove() {\n\t\tthis.__storageType.removeItem(this.__key);\n\t}", "title": "" }, { "docid": "31b4cbdcea58db57b7f237de02777c4f", "score": "0.4760621", "text": "function onButtonClicked(){\n initializeObjects();\n //firebase.database().ref(\"sectors\").remove();\n }", "title": "" }, { "docid": "ae28660dae4ed87ed570311a19466167", "score": "0.47593504", "text": "function readData(e)\r\n{\r\n\r\n firebase.database().ref('unfinishedTask').orderByChild(\"userid\").equalTo(uid).once(\"value\", function (snapshot) {\r\n snapshot.forEach(function(childSnapshot) {\r\n taskList=childSnapshot.val().task;\r\n console.log(taskList);\r\n let getDatabase=document.getElementById(\"database_list\");\r\n let createListDatabase=document.createElement(\"LI\");\r\n createListDatabase.appendChild(document.createTextNode(taskList));\r\n getDatabase.appendChild(createListDatabase);\r\n createListDatabase.onclick = function(){ \r\n \r\n this.parentNode.removeChild(this); \r\n let deletedKey = firebase.database().ref('unfinishedTask');\r\n let key_to_delete = this.innerText;\r\n console.log(key_to_delete);\r\n let query = deletedKey.orderByChild('task').equalTo(key_to_delete);\r\n query.on('child_added', function(snapshot)\r\n {\r\n snapshot.ref.remove();\r\n });\r\n } \r\n \r\n \r\n \r\n });\r\n });\r\n \r\n e.preventDefault();\r\n \r\n}", "title": "" }, { "docid": "197f5c769b2bf4ac0d12e33690a15640", "score": "0.47290558", "text": "deleteTask(ref) {\n this.tasks.$remove(ref).then((ref)=>{\n this.$log.info(\"Task deleted @ firebase\", ref.key());\n });\n }", "title": "" }, { "docid": "4e7667aac78cfaa9b919efacbe92a0ee", "score": "0.47225344", "text": "deleteValue() {\n this.setValue(null, {\n noUpdateEvent: true,\n noDefault: true\n });\n _.unset(this.data, this.key);\n }", "title": "" }, { "docid": "b908adc86e94c983fffeb8b200733f04", "score": "0.46848062", "text": "function removeFirebaseRecord(id) {\n console.log(id);\n firebase.database().ref(\"settings/\" + getUserId() + \"/\" + id)\n .remove(() => {\n console.log('Delete successfully!');\n });\n}", "title": "" }, { "docid": "059cc84f27202c2f4411acb2c72e7b1f", "score": "0.46839535", "text": "remove(uid, id) {\n return new Promise((resolve, reject) => {\n this.db.collection('users').update({\n _id: ObjectId(uid)\n }, {\n $pull: {\n alerts: {\n _id: ObjectId(id),\n }\n }\n }, (err, res) => {\n if(err) reject(err);\n else resolve(res.result.n);\n });\n });\n }", "title": "" }, { "docid": "01c5a06ab5de96856ded7c687acc399c", "score": "0.4678541", "text": "remove () {\n let self = this;\n let url = self._brtable._url + self.id;\n delete self._brtable._cache[self.id];\n delete self._o;\n return httpDELETE(url)\n .then(() => {\n return undefined;\n });\n }", "title": "" }, { "docid": "83e480e59fb26e377962042fe58f585e", "score": "0.46694583", "text": "function removeCollection(model) {\n return new Promise(function(resolve, reject) {\n model.collection.remove(function(err, result) {\n if (err) {\n reject(err);\n }\n resolve(result);\n });\n });\n }", "title": "" }, { "docid": "26a49c999ce3a482c9493df1d35f5ccf", "score": "0.46593577", "text": "remove(path) {\n const { store, promise, delay } = this;\n return promise(() => store.remove(path), delay);\n }", "title": "" }, { "docid": "1e046aed22c6f154a81ff7848aeede1f", "score": "0.46591377", "text": "function removeUserFromPlayList(myPlayerNumber, userID){\n\n ref = firebase.database().ref('/users/');\n ref.on('child_removed', function(snapshot){\n \n console.log(myPlayerNumber);\n });\n\n // removed!\n\n\n}", "title": "" }, { "docid": "9703184edabff820d7a064b7b3eefd63", "score": "0.4656831", "text": "function delUser() {\r\n fetch('https://fir-basics-c32e5.firebaseio.com/users/7.json', {\r\n method: 'DELETE'\r\n })\r\n .then(function (res) {\r\n return res.json();\r\n })\r\n .then(function (data) {\r\n console.log(data);\r\n })\r\n .catch(function (err) {\r\n console.log(err);\r\n });\r\n}", "title": "" }, { "docid": "aee367864df18dab3120c297e7329624", "score": "0.46509233", "text": "function removeItem(key) {\n return new Promise(function(resolve, reject) {\n if (typeof key !== \"string\") {\n reject(new ArgumentInvalidException(\"The key must be a string\", key));\n }\n var stringData = storage.getItem(key);\n if (stringData === null || stringData === undefined) {\n reject(null);\n }else {\n storage.removeItem(key);\n resolve(key);\n }\n });\n}", "title": "" }, { "docid": "f516371bb2b0554bdffcd092dcb79b82", "score": "0.46495652", "text": "function eliminar(id){\r\ndb.collection(\"Comentario\").doc(id).delete().then(function() {\r\n console.log(\"Document successfully deleted!\");\r\n}).catch(function(error) {\r\n console.error(\"Error removing document: \", error);\r\n});\r\n}", "title": "" }, { "docid": "5eba7e49a57410884e6e19c4b3755dc3", "score": "0.46373194", "text": "function RemoveCrate(Player,userPlayer,code1,code2)\r\n {\r\n //message.channel.send(code2+' '+code1+' removed succesfully')\r\n var userRef = firebase.database().ref('users/database/'+Player)\r\n userRef.once('value',function(snap){\r\n var sum = snap.child('crates/'+code1).val();\r\n sum = sum - code2\r\n //console.log(sum)\r\n if(sum<0) return message.channel.send('Reached 0 Containers , cannot remove '+code2+'more Containers');\r\n message.channel.send(code2+' '+code1+' removed succesfully')\r\n //setTimeout(function(){\r\n ref = firebase.database().ref('users/database/'+Player)\r\n var payload = {}\r\n payload['crates/'+code1] = sum;\r\n ref.update(payload);\r\n //},100)\r\n })\r\n }", "title": "" }, { "docid": "19fa769e761d2b4c51413c8049deb3d9", "score": "0.4633372", "text": "deleteData() {\n this.overlayCollection_.clear();\n this.dataPolygon_ = null;\n if (this.networkStatus.isDisconnected()) {\n this.menuDisplayed = false;\n }\n\n const reloadIfInOfflineMode = () => {\n if (this.offlineMode.isEnabled()) {\n this.deactivateOfflineMode();\n }\n };\n this.ngeoOfflineConfiguration_.clear().then(reloadIfInOfflineMode);\n }", "title": "" }, { "docid": "19fa769e761d2b4c51413c8049deb3d9", "score": "0.4633372", "text": "deleteData() {\n this.overlayCollection_.clear();\n this.dataPolygon_ = null;\n if (this.networkStatus.isDisconnected()) {\n this.menuDisplayed = false;\n }\n\n const reloadIfInOfflineMode = () => {\n if (this.offlineMode.isEnabled()) {\n this.deactivateOfflineMode();\n }\n };\n this.ngeoOfflineConfiguration_.clear().then(reloadIfInOfflineMode);\n }", "title": "" }, { "docid": "92e8d21df66231f3facf5ca19d8f07f0", "score": "0.46245402", "text": "removeItem (itemId) {\n const itemRef = firebase.database().ref(`/items/${itemId}`)\n itemRef.remove()\n }", "title": "" }, { "docid": "9da5d746d2256b41f879999795c52e80", "score": "0.4605456", "text": "onRemove(event, dataKey) {\n this.log.event(`onRemove`, event);\n if (this.field.facade) {\n this.onBubbleEvent('remove', { dataKey: dataKey });\n }\n else {\n this.srv.dialog.open(PopConfirmationDialogComponent, {\n width: '350px',\n data: {\n option: null,\n body: `Delete this field value?`\n }\n }).afterClosed().subscribe(option => {\n if (option && option.confirmed) {\n this.srv.field.removeEntryValue(this.core, this.field, dataKey).then((res) => {\n delete this.field.data[dataKey];\n delete this.field.items[dataKey];\n this.field.data_keys.pop();\n delete this.dom.state[dataKey];\n delete this.ui.asset[dataKey];\n delete this.dom.session[dataKey];\n this.dom.store('session');\n this.onBubbleEvent('remove', { dataKey: dataKey });\n });\n }\n });\n }\n return true;\n }", "title": "" }, { "docid": "e681b2f9fc2222cb8db3bce01966753d", "score": "0.46040305", "text": "function cleanUp() {\n\t\t\t\t_Helper.removeByPath(that.mChangeRequests, sEntityPath, oRequestPromise);\n\n\t\t\t\tif (aMessages.length) {\n\t\t\t\t\toModelInterface.updateMessages(undefined, aMessages);\n\t\t\t\t}\n\n\t\t\t\tdelete oEntity[\"@$ui5.context.isDeleted\"];\n\t\t\t\tif (Array.isArray(vCacheData)) {\n\t\t\t\t\tiIndex = oDeleted.index;\n\t\t\t\t\tconst iDeletedIndex = vCacheData.$deleted.indexOf(oDeleted);\n\t\t\t\t\tif (iIndex !== undefined) {\n\t\t\t\t\t\tthat.restoreElement(vCacheData, iIndex, oEntity, sParentPath,\n\t\t\t\t\t\t\tiDeletedIndex);\n\t\t\t\t\t}\n\t\t\t\t\tvCacheData.$deleted.splice(iDeletedIndex, 1);\n\t\t\t\t}\n\t\t\t\tif (that.iActiveUsages) {\n\t\t\t\t\tfnCallback(iIndex, 1);\n\t\t\t\t} else if (iIndex === undefined && that.reset) {\n\t\t\t\t\t// an active cache must let the list binding reset to be told about kept-alive\n\t\t\t\t\t// elements, an inactive cache however has no binding and no kept-alive\n\t\t\t\t\t// elements\n\t\t\t\t\tthat.reset([]);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "bc35786ce7a1571cadca57a66421bde8", "score": "0.4601943", "text": "async delete() {\n await this._impl_delete();\n }", "title": "" }, { "docid": "e6a99b7f5979bc4c22a5f077f3ac63b4", "score": "0.45967206", "text": "function packageRemoved() {\n\tpackages.on('child_removed', function(snapshot) {\n\t\tvar id = snapshot.key(),\n\t\t\tdeliveryArray = [];\n\n\t\tconsole.log('package', id, 'removed from firebase.packages');\n\t\tdeliveries.once('value', function(snapshot) {\n\t\t\tfor (delivery in snapshot.val()) {\n\t\t\t\tdeliveryArray.push(delivery);\n\t\t\t};\n\t\t\tif (deliveryArray.indexOf(id) !== -1) {\n\t\t\t\tdeliveries.child(id).remove();\n\t\t\t};\n\t\t})\n\t});\n}", "title": "" }, { "docid": "e204a477eddff6cf951e7f2ad46867f0", "score": "0.45777798", "text": "remove() {\n this.input = this.members;\n this.params = this._params();\n super._execute().then(() => {\n this.members = [];\n });\n }", "title": "" }, { "docid": "0fb5a9212812d7cb0f2a6ff6dcb6a5a0", "score": "0.45768127", "text": "_remove (options, fn) {\n const opts = _.pick(options || {}, ['cas', 'persist_to', 'replicate_to'])\n const key = this.getDocumentKeyValue(true)\n\n debug(`remove. key: ${key}`)\n\n this.db.remove(key, opts, err => {\n if (err) {\n this._broadcast('error', err, this)\n console.error('%s.$remove err: %j', this.modelName, err)\n } else {\n this._broadcast('remove', this, options)\n this.removeIndexes(options)\n }\n\n return fn(err, this)\n })\n }", "title": "" }, { "docid": "94fe4cfd378735a258d5f62083fa5b31", "score": "0.45630342", "text": "function taskDel(e){\n let id = e.value;\n let user = firebase.auth().currentUser;\n db.collection(\"users\").doc(user.uid).collection(\"tasks\").doc(id).update({\n deleted: true\n });\n taskUpdate(user);\n}", "title": "" }, { "docid": "ba705f12d1967a26aea1abed38644c24", "score": "0.45532447", "text": "Remove() {}", "title": "" }, { "docid": "a4f2e7cc426f1329d93195b6f461dde0", "score": "0.45500174", "text": "function remove(emailId) {\r\n gEmails = gEmails.filter(email => email.id !== emailId);\r\n saveEmailsToStorage();\r\n return Promise.resolve();\r\n}", "title": "" }, { "docid": "75808a5152c3bf51e27ee1149b40bc6b", "score": "0.4543761", "text": "handleChildRemoved(data){\n /** Creando una copia del array para borrar (el concat con un array vacío, sólo crea una copia**/\n var newTasks = this.state.tasks.concat([]);\n //buscando en newTask y guardando el índice que contega el elemento(la task) cuyo id sea igual a la key (nosotros asignamos la key de la data como valor del id)\n const index = newTasks.findIndex(task=> task.id === data.key);\n\n /** Removiendo la task de la copia del array generado en newTask */\n newTasks.splice(index,1);\n \n /** Reescribiendo el array**/\n this.setState({ tasks: newTasks })\n }", "title": "" }, { "docid": "e651a72df0cce4c2823e31972aed5627", "score": "0.45317018", "text": "deleteBlockFromDATA(key) {\n let self = this;\n return new Promise((resolve, reject) => {\n self.db.del(key, (error) =>{\n if(error) {\n reject(error)\n return console.log('Error deleting Block #' + key, err);\n }\n resolve(value)\n })\n })\n }", "title": "" }, { "docid": "ec09d342f6c05d06cab367d37491d5ec", "score": "0.45230988", "text": "function removeRecord(options) {\n let query = getQueryParams(options, ['name', 'content', 'type', 'query']);\n if (query.name === undefined) {\n return Promise.reject('name not provided');\n }\n return find(options.domain, query).then(function (response) {\n let records = response.data.result;\n if (records.length === 0) {\n throw new Error('No matching records found');\n }\n let results = [];\n _.each(records, function (record) {\n results.push(self.cloudflareClient.removeRecord(record.zone_id, record.id));\n });\n return Promise.all(results);\n }).then(function (responses) {\n let messages = _.map(responses, function (response) {\n return 'Deleted record with id ' + response.data.result.id;\n });\n\n return new Result(messages);\n });\n }", "title": "" }, { "docid": "7f088bc194abd0bafd32b49fec037f49", "score": "0.45106944", "text": "componentWillUnmount() {\n //Remove the database listener\n if (this.state.firebaseListener != undefined) {\n this.state.firebaseListener.off('value', this.state.firebaseCallback);\n }\n }", "title": "" }, { "docid": "a37b2afb529b17eb756faeda4f5a5b9c", "score": "0.45087335", "text": "async function removeFollowAsync(userId, vacationId) {\n const sql = `DELETE FROM follows WHERE userId = ${userId} AND vacationId = ${vacationId}`;\n await dal.executeAsync(sql);\n}", "title": "" }, { "docid": "f823883910bf8e0de7429ff6c01bb581", "score": "0.4491491", "text": "async remove() {\n const partner_ids = [];\n const channel_ids = [];\n if (this.partner) {\n partner_ids.push(this.partner.id);\n } else {\n channel_ids.push(this.channel.id);\n }\n await this.async(() => this.env.services.rpc({\n model: this.followedThread.model,\n method: 'message_unsubscribe',\n args: [[this.followedThread.id], partner_ids, channel_ids]\n }));\n const followedThread = this.followedThread;\n this.delete();\n followedThread.fetchAndUpdateSuggestedRecipients();\n }", "title": "" }, { "docid": "933427ad7cf2f7dfe191a2d74d2f1fe1", "score": "0.449116", "text": "function clearData(callback) {\n console.log('Removing all documents in collection \"test\"');\n db.collection('test').remove({}, callback);\n}", "title": "" }, { "docid": "e9a1c40ffddbbdd89ab0731b607ed0ca", "score": "0.44890723", "text": "function removeMeeting(id){\n var userId=localStorage.getItem(\"userid_ls\")\n var ref=database.ref(\"users/\"+userId+\"/meetings\")\n ref.child(id).remove()\n}", "title": "" }, { "docid": "99429681e68754f19c1fc136307031f9", "score": "0.448493", "text": "function removeRecord(colName, findData) {\n var prom = utils.promise();\n if (!colName) {\n nocollection(prom.post);\n } else if (typeof findData !== \"object\") {\n prom.post(emsg.invalid);\n } else {\n id_Obj(findData);\n mainDb.collection(colName).findOneAndDelete(findData, function (err, resp) {\n prom.post(err, resp && resp.value);\n });\n }\n return prom.prom;\n }", "title": "" }, { "docid": "1c732a2c297e639d98a138c0b5ad1f26", "score": "0.4483756", "text": "function deleteAlbumData () {\n var i = 0;\n function chainedPromise() {\n albumsService.remove(albumsToDelete[i])\n .success(function() {\n })\n .error(function(error) {\n $scope.error = error;\n })\n .finally(function(){\n if(i === albumsToDelete.length - 1) {\n deleteAvatar();\n }\n else {\n i++;\n chainedPromise();\n }\n });\n }\n chainedPromise();\n }", "title": "" }, { "docid": "d246ea32c63a1305c67fd8cadb117384", "score": "0.447863", "text": "async removeContainer() {\n return new Promise((res, rej) => {\n this.svc.deleteContainer(this.container, (err, response) => {\n if (err) {\n return rej(err);\n }\n return res();\n });\n });\n }", "title": "" }, { "docid": "f55ff83b0226ada4c91aaf079c8f050a", "score": "0.4476394", "text": "async function delData(url = '') {\n fetch(url, {\n method: 'DELETE',\n mode: 'cors'\n })\n}", "title": "" }, { "docid": "d66e147a85a752a8e06b7e891224b8a4", "score": "0.44731793", "text": "async delete({userGroup}, res) {\n await UserGroup.remove(userGroup);\n res.sendStatus(202);\n }", "title": "" }, { "docid": "839c984ad0ba4e32dd2bac54c28987fc", "score": "0.4470399", "text": "handleDelete (event) {\r\n\t\tconst currentBanner = JSON.parse(event.target.getAttribute('data'));\r\n\r\n\t\t// storage\r\n\t\tconst storageRef = firebase.storage().ref(`/banners/${currentBanner.name}`);\r\n\t\tstorageRef.delete()\r\n\t\t\t.then(() => console.log('Baaner eliminado del Sistema de Archivos (Storage)!'))\r\n\t\t\t.catch(error => console.log(`Error ${error.code}: ${error.message}`));\r\n\r\n\t\t// database\r\n\t\tconst dbRef = firebase.database().ref('banners');\r\n\t\tdbRef.child(currentBanner.key).remove()\r\n\t\t\t.then(() => {\r\n\t\t\t\tconsole.log('Banner eliminado de la Base de datos!');\r\n\t\t\t})\r\n\t\t\t.catch(error => console.log(`Error ${error.code}: ${error.message}`));\r\n\t}", "title": "" }, { "docid": "b38a8cbe00151100be0bcfb31e7ae655", "score": "0.44666535", "text": "async function removeEmployeeAsync() {\n await removeRoutine(getEmployeeAsync, query.employee, \"an Employee\");\n}", "title": "" }, { "docid": "0e071e8138183d6c41a4b97839b4c047", "score": "0.44648543", "text": "delete() {\n\t\t\tthis._.FBRef.set(null).then(()=>{\n\t\t\t\tthis.destroy();\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "44a9d6cd63126d1f14f1b5df9ba448a4", "score": "0.44648135", "text": "function remove(path, cb) {\n if(isForeign(path)) {\n return cb(new Error(\"Foreign storage is read-only\"));\n }\n var token = getSetting('bearerToken');\n return getputdelete.set(resolveKey(path), undefined, undefined, token, cb);\n }", "title": "" }, { "docid": "f67d57e39074fa38972310a94ed5b815", "score": "0.44555706", "text": "function deleteToy(songId) {\n\tconsole.log(\"deleteSong\" );\n\treturn new Promise(function(resolve, reject) {\n\t\t$.ajax ({\n\t\t\turl: `https://my-cap-project-firebase.firebaseio.com/toys/${toyId}.json`,\n\t\t\tmethod: \"DELETE\"\n\n\t\t}).done(function() {\n\t\t\tresolve();\n\t\t});\n\t});\n\n}", "title": "" }, { "docid": "3a496a8ee60752113017f7eb0b6abac5", "score": "0.4444278", "text": "removeThings(cookinId) {\n const cookinRef = firebase.database().ref(`/recipes/${cookinId}`);\n cookinRef.remove();\n}", "title": "" }, { "docid": "37c3b7d4d1cacfed9b55e2f5df11aca7", "score": "0.44384676", "text": "_remove(id) {\n getNativeModule(this._firestore).transactionDispose(id);\n delete this._pending[id];\n }", "title": "" }, { "docid": "717cb7a8189e4674065bee4927ab1b5f", "score": "0.44362697", "text": "VUEX_FIREBASE_UNBINDED(state,payload) {\n Vue.delete(state.firebase,payload.ref); \n }", "title": "" }, { "docid": "91ae2fb8afa6523c7baf04e65cbe3149", "score": "0.44349894", "text": "function handlerRemove() {\r\n deleteTask(task.taskId, userUid, clearToast, displayToast);\r\n onCancel();\r\n }", "title": "" }, { "docid": "4716ecf8a5945b7fcb1e816b679e1449", "score": "0.44292963", "text": "function remove(uid) {\n console.log(uid);\n var db = getDatabase();\n db.transaction(function(tx) {\n var rs = tx.executeSql('DELETE FROM hours WHERE uid=?;' , [uid]);\n if (rs.rowsAffected > 0) {\n console.log (\"Deleted!\");\n } else {\n console.log (\"Error deleting. No deletion occured.\");\n }\n })\n}", "title": "" }, { "docid": "061f281f02f408dff113a2b748bfb82f", "score": "0.44289303", "text": "function cleanUsingLaundryMachine(){\n var time = new Date().getTime();\n database.ref(\"Building-Table\").once(\"value\",function(snap){\n let snapshot = snap.val();\n var x;\n for(x in snapshot){\n let w = x;\n database.ref(\"UsingLaundryMachine-Table/\"+w)\n .orderByChild(\"TimeDone\")\n .startAt(0)\n .endAt(time)\n .once(\"value\",function(snap){\n let y;\n for(y in snap.val()){\n database.ref(\"UsingLaundryMachine-Table/\"+w+\"/\"+y).remove();\n }\n })\n }\n });\n}", "title": "" }, { "docid": "7904bf87a25156bd11c98599905cfa2e", "score": "0.4423733", "text": "delete() {\r\n\t\t// Save our parent\r\n\t\tlet parent = this;\r\n\t\t\t// Start a promise\r\n\t\t\treturn new Promise(function(resolve, reject) {\r\n\t\t\t// Open the Mongo Connection\r\n\t\t\tparent.mongoClient.connect(parent.url, function(error, client) {\r\n\t\t\t\tconst ObjectId = require('mongodb').ObjectID;\r\n\t\t\t\tif (error) throw error;\r\n\t\t\t\t\r\n\t\t\t\tlet databaseObject = client.db(parent.config.database.name);\r\n\r\n\t\t\t\tparent.query = { \"_id\" : ObjectId(parent.query.id), \"user\" : parent.query.user};\r\n\r\n\t\t\t\tdatabaseObject.collection(parent.collection).deleteOne(parent.query, function(error, result) {\r\n\r\n\t\t\t\t\tif (error) {\r\n\t\t\t\t\t\tresolve(false);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif(result !== null) {\r\n\t\t\t\t\t\t\tresolve(result);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tresolve(false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tclient.close();\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "4cb8ac1c2d58d3ffe34991a0210bf0fc", "score": "0.44209594", "text": "function removerDados(key){\n\t\n\tif (confirmar(\"Excluir\")){\n\t\tvar storage = firebase.storage();\n\t\tvar storageRef = storage.ref('Novidades/'+key);\n\t\t\t\n\t\t// Exclui os dados e imagem\n\t\tstorageRef.delete().then(function() {\n\t\t //remove os dados\n\t\t firebase.database().ref().child('novidades').child(key).remove(); \n\t\t // remove a linha\n\t\t $('.row'+key).remove();\n\t\t \n\t\t showSnackbar();\n\t\t \n\t\t}).catch(function(error) {\n\t\t // Uh-oh, ocorreu um erro!\n\t\t});\n\t\t\n\t}else{\n\t\t// botão cancelar\n\t}\t\n}", "title": "" }, { "docid": "3f954dfd56cddf55556ef9cec7720770", "score": "0.44181916", "text": "remove (key) {\n this.data = this.data.delete(key);\n }", "title": "" }, { "docid": "0a9cffa69d4d8a036b5f198b7c238053", "score": "0.4415153", "text": "remove(data) {\n\t\tfor (let i = 0; i < this.d_size; ++i) {\n\t\t\tif (this.d_data[i] === data) return this.removeAt(i)\n\t\t}\n\t\treturn null\n\t}", "title": "" }, { "docid": "815c085fa54fef0074c7651ac81bf77a", "score": "0.44106072", "text": "remove() {\n // TODO: only if private and owner\n // public ledgers should not be allowed to request removal.\n // instead data should be allowed to die out over time\n // providers[hash] = []\n // result: meltdown = null\n // FYI when your the only one providing that hash, it's gone!\n // Peernet only resolves locations to that content.\n // if your unlucky and your content was popular,\n // people could have pinned your content and it's now available forever,\n // that's until they decide to remove the content of course.\n // but surely you didn't put sensitive information on a public network,\n // did you?\n // But you encrypted it, right?\n }", "title": "" }, { "docid": "4b28113e125f477177c4c283625b2a08", "score": "0.44086662", "text": "clear() {\n while (this.ref.current.lastChild) {\n this.ref.current.removeChild(this.ref.current.lastChild);\n }\n }", "title": "" }, { "docid": "4b28113e125f477177c4c283625b2a08", "score": "0.44086662", "text": "clear() {\n while (this.ref.current.lastChild) {\n this.ref.current.removeChild(this.ref.current.lastChild);\n }\n }", "title": "" }, { "docid": "4b28113e125f477177c4c283625b2a08", "score": "0.44086662", "text": "clear() {\n while (this.ref.current.lastChild) {\n this.ref.current.removeChild(this.ref.current.lastChild);\n }\n }", "title": "" } ]
c00456b36324ec6c38f61fa2a38fa82a
Remove event listeners used to update the popper position
[ { "docid": "36a5ae3b996d7efebcfe905f58034465", "score": "0.0", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" } ]
[ { "docid": "e4abf3ab0a9fa72e385a7bd231b0180b", "score": "0.6918275", "text": "removeEventListeners() {\n\t\t$(document).off('click', '.hu-megamenu-add-slots .hu-megamenu-custom-layout-apply');\n\t\t$(document).off('click', '.hu-megamenu-remove-row');\n\t\t$(document).off('click', '.hu-megamenu-add-row > a');\n\t\t$(document).off('click', '.hu-megamenu-custom');\n\t\t$(document).off('click', '.hu-megamenu-columns');\n\t\t$(document).off('click', '.hu-megamenu-add-new-item');\n\t\t$(document).off('click', '.hu-megamenu-cell-options-item');\n\t\t$(document).off('click', '.hu-megamenu-popover-close');\n\t\t$(document).off('click', '.hu-megamenu-insert-module');\n\n\t\t$(document).off('click', '.hu-megamenu-cell-remove');\n\t\t$(document).off('click', '.hu-megamenu-add-slots .hu-megamenu-column-layout:not(.hu-megamenu-custom)');\n\t\t$(document).off('click', '.hu-megamenu-row-slots .hu-megamenu-column-layout:not(.hu-megamenu-custom)');\n\t\t$(document).off('click', '.hu-megamenu-row-slots .hu-megamenu-custom-layout-apply');\n\t\t$cancelBtn.off('click');\n\t\t$saveBtn.off('click');\n\t\t$megamenu.off('change');\n\t}", "title": "" }, { "docid": "0d1c155eaa5094eefc437316c7c0478e", "score": "0.6785765", "text": "_removeTriggerEvents() {\n if (this._triggerElement) {\n pointerDownEvents.forEach((type) => {\n this._triggerElement.removeEventListener(type, this, passiveEventOptions);\n });\n if (this._pointerUpEventsRegistered) {\n pointerUpEvents.forEach((type) => {\n this._triggerElement.removeEventListener(type, this, passiveEventOptions);\n });\n }\n }\n }", "title": "" }, { "docid": "0d1c155eaa5094eefc437316c7c0478e", "score": "0.6785765", "text": "_removeTriggerEvents() {\n if (this._triggerElement) {\n pointerDownEvents.forEach((type) => {\n this._triggerElement.removeEventListener(type, this, passiveEventOptions);\n });\n if (this._pointerUpEventsRegistered) {\n pointerUpEvents.forEach((type) => {\n this._triggerElement.removeEventListener(type, this, passiveEventOptions);\n });\n }\n }\n }", "title": "" }, { "docid": "cff8b2fb6814644f6fc5f48cab7be851", "score": "0.65392554", "text": "_events() {\n this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', () => this._reflow());\n }", "title": "" }, { "docid": "cff8b2fb6814644f6fc5f48cab7be851", "score": "0.65392554", "text": "_events() {\n this.$element.off('resizeme.zf.trigger').on('resizeme.zf.trigger', () => this._reflow());\n }", "title": "" }, { "docid": "3b0184dffeee81b4f0735972fff67d06", "score": "0.65106446", "text": "_removeEventListeners() {\n if (this.el) this.el.removeEventListener('click', this._onClickBound);\n if (this.modalEl) this.modalEl.removeEventListener('click', this._onModalClickBound);\n }", "title": "" }, { "docid": "8cdacd6231b05c5309a035b9ba5a8ad8", "score": "0.64892435", "text": "removeListeners() {\n $('[data-target-page]').off('click', ET.handleNavigateTo);\n }", "title": "" }, { "docid": "be7f80ece8fba336a31a71942ea8b357", "score": "0.6413917", "text": "unregisterEventListeners_() {\n this.submenuOpenElements_.forEach(element => {\n element.removeEventListener('click', this.submenuOpenHandler_);\n });\n this.submenuCloseElements_.forEach(element => {\n element.removeEventListener('click', this.submenuCloseHandler_);\n });\n\n this.documentElement_.removeEventListener('keydown', this.keydownHandler_);\n }", "title": "" }, { "docid": "8421a4436998a91f9eee62723c085f2f", "score": "0.64104015", "text": "function removePointerEventListeners() {\n removeEventListener('pointerup', onPointerUp, listenerOpts);\n removeEventListener('pointercancel', onPointerCancel, listenerOpts);\n }", "title": "" }, { "docid": "654c35cfb661fd6da969d2c9772007e9", "score": "0.64062065", "text": "_removeClickEvent() {\n this.rangeElement.removeEventListener('click', this.eventHandler.changeSlideFinally);\n }", "title": "" }, { "docid": "48c48db4a6f954ce774efe0d4a76fe3e", "score": "0.63372594", "text": "removeMapEventListeners() {\n this.map.off('zoomend');\n this.map.off('dragend');\n }", "title": "" }, { "docid": "38c1da8ea96f7c5ef64419851c02a94e", "score": "0.629955", "text": "function removeEvents () {\n for (let childNode of boardDOMElement.children) {\n childNode.removeEventListener('click', slotPickupHandler)\n }\n buttonAdvanceDOMElement.removeEventListener('click', advanceHandler)\n buttonSellDOMElement.removeEventListener('click', sellHandler)\n}", "title": "" }, { "docid": "6829b566d8b180a37d0362a4db048173", "score": "0.62952113", "text": "function hidePopper() {\r\npopperPopup.removeAttribute(\"show-popper\");\r\npopperArrow.removeAttribute(\"data-popper-arrow\");\r\ndestroyInstance();\r\n}", "title": "" }, { "docid": "dd699f9d995ba9ba9e7498d39aa05721", "score": "0.62924963", "text": "removeEvents(){\n\n }", "title": "" }, { "docid": "46017799d17f2b39746c37b2ba6861b5", "score": "0.6256931", "text": "_removeDragEvent() {\n this.pointer.removeEventListener('mousedown', this.eventHandler.startChangingSlide);\n }", "title": "" }, { "docid": "6aa2fe1409fe4e42073d69704a40ee5e", "score": "0.62560666", "text": "function removeEventListeners(reference,state){// Remove resize event listener on window\ngetWindow(reference).removeEventListener('resize',state.updateBound);// Remove scroll event listener on scroll parents\nstate.scrollParents.forEach(function(target){target.removeEventListener('scroll',state.updateBound);});// Reset state\nstate.updateBound=null;state.scrollParents=[];state.scrollElement=null;state.eventsEnabled=false;return state;}", "title": "" }, { "docid": "6aa2fe1409fe4e42073d69704a40ee5e", "score": "0.62560666", "text": "function removeEventListeners(reference,state){// Remove resize event listener on window\ngetWindow(reference).removeEventListener('resize',state.updateBound);// Remove scroll event listener on scroll parents\nstate.scrollParents.forEach(function(target){target.removeEventListener('scroll',state.updateBound);});// Reset state\nstate.updateBound=null;state.scrollParents=[];state.scrollElement=null;state.eventsEnabled=false;return state;}", "title": "" }, { "docid": "6aa2fe1409fe4e42073d69704a40ee5e", "score": "0.62560666", "text": "function removeEventListeners(reference,state){// Remove resize event listener on window\ngetWindow(reference).removeEventListener('resize',state.updateBound);// Remove scroll event listener on scroll parents\nstate.scrollParents.forEach(function(target){target.removeEventListener('scroll',state.updateBound);});// Reset state\nstate.updateBound=null;state.scrollParents=[];state.scrollElement=null;state.eventsEnabled=false;return state;}", "title": "" }, { "docid": "e9d85173517ddada4abe0c2f8a5ccade", "score": "0.6234036", "text": "removeListenersAddedOnMousedownAndTouchstart() {\n const doc = this.el_.ownerDocument;\n this.off(doc, 'mousemove', this.throttledHandleMouseSeek);\n this.off(doc, 'touchmove', this.throttledHandleMouseSeek);\n this.off(doc, 'mouseup', this.handleMouseUpHandler_);\n this.off(doc, 'touchend', this.handleMouseUpHandler_);\n }", "title": "" }, { "docid": "de55fdad45955b9b8ac38c832827e237", "score": "0.6228396", "text": "unwireEvents() {\n let resize = 'onorientationchange' in window ? 'orientationchange' : 'resize';\n EventHandler.remove(window, resize, this.onScheduleResize);\n EventHandler.remove(document, Browser.touchStartEvent, this.onDocumentClick);\n EventHandler.remove(this.element, 'mouseover', this.workCellAction.onHover);\n if (this.keyboardInteractionModule) {\n this.keyboardInteractionModule.destroy();\n }\n }", "title": "" }, { "docid": "832eff362cfe57bbbaecc08b9216fed0", "score": "0.62187374", "text": "_removeEventFromResizer(){\n if(!this.activeResizer.el) return;\n\n this.activeResizer.resizers.left.addEventListener('mouseup', this._removeMoveEvent);\n this.activeResizer.resizers.right.addEventListener('mouseup', this._removeMoveEvent);\n this.activeResizer.resizers.bottom.addEventListener('mouseup', this._removeMoveEvent);\n this.activeResizer.resizers.top.addEventListener('mouseup', this._removeMoveEvent);\n\n document.addEventListener('mouseup', this._removeMoveEvent);\n }", "title": "" }, { "docid": "b32fb28bc6d9517184512af9b34a759b", "score": "0.6201329", "text": "removeEvents() {\n \n $(window).off('resize', this.resize);\n \n this.off();\n }", "title": "" }, { "docid": "c8851034f7892f663b329702dffde318", "score": "0.6201212", "text": "removeEventListeners() {\n if (!this.document) {\n return;\n }\n\n _utils_constants__WEBPACK_IMPORTED_MODULE_5__[/* DOM_EVENTS */ \"a\"].forEach(function (eventName) {\n this.document.removeEventListener(eventName, this._triggerEvent, {\n passive: true\n });\n }, this);\n this._triggerEvent = undefined;\n }", "title": "" }, { "docid": "beb1bb22728b8815857a3b3b97dfc26b", "score": "0.61989814", "text": "_destroy() {\n if (this.options.overlay) {\n this.$element.appendTo(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this.options.appendTo)); // move $element outside of $overlay to prevent error unregisterPlugin()\n this.$overlay.hide().off().remove();\n }\n this.$element.hide().off();\n this.$anchor.off('.zf');\n __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off(`.zf.reveal:${this.id}`);\n }", "title": "" }, { "docid": "beb1bb22728b8815857a3b3b97dfc26b", "score": "0.61989814", "text": "_destroy() {\n if (this.options.overlay) {\n this.$element.appendTo(__WEBPACK_IMPORTED_MODULE_0_jquery___default()(this.options.appendTo)); // move $element outside of $overlay to prevent error unregisterPlugin()\n this.$overlay.hide().off().remove();\n }\n this.$element.hide().off();\n this.$anchor.off('.zf');\n __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off(`.zf.reveal:${this.id}`);\n }", "title": "" }, { "docid": "03efb8f50456129080d0f97b858f85a9", "score": "0.6197842", "text": "function removeAllclickPlg()\r\n\t\t{\r\n\t\t\tvar polyList = exist_container.children;\r\n\t\t\tfor(var i in polyList){\r\n\t\t\t\tpolyList[i].getChildAt(0).getChildAt(0).removeEventListener(\"click\",clickPlg);\t\r\n\t\t\t\tpolyList[i].getChildAt(0).getChildAt(0).cursor = \"default\";\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "bea822e5135d67f8e2c2021e1a1ceb9a", "score": "0.6193418", "text": "_destroy() {\n this.$element\n .find(`.${this.options.linkClass}`)\n .off('.zf.tabs').hide().end()\n .find(`.${this.options.panelClass}`)\n .hide();\n\n if (this.options.matchHeight) {\n if (this._setHeightMqHandler != null) {\n __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('changed.zf.mediaquery', this._setHeightMqHandler);\n }\n }\n\n if (this.options.deepLink) {\n __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('popstate', this._checkDeepLink);\n }\n\n }", "title": "" }, { "docid": "bea822e5135d67f8e2c2021e1a1ceb9a", "score": "0.6193418", "text": "_destroy() {\n this.$element\n .find(`.${this.options.linkClass}`)\n .off('.zf.tabs').hide().end()\n .find(`.${this.options.panelClass}`)\n .hide();\n\n if (this.options.matchHeight) {\n if (this._setHeightMqHandler != null) {\n __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('changed.zf.mediaquery', this._setHeightMqHandler);\n }\n }\n\n if (this.options.deepLink) {\n __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off('popstate', this._checkDeepLink);\n }\n\n }", "title": "" }, { "docid": "e63aca53c2c1d515d9773c78926a1966", "score": "0.61854327", "text": "cleanUp() {\n if (!this._element) {\n return;\n }\n for (const prop in this.props) {\n if (!this.props.hasOwnProperty(prop)) {\n continue;\n }\n if (this.isEventProp(prop, this.props)) {\n this._element.removeEventListener(prop[2].toLowerCase() + prop.substring(3), this.props[prop]);\n }\n }\n this._element = null;\n }", "title": "" }, { "docid": "336a4a6d1e43dddc8772810348dfe110", "score": "0.61801857", "text": "detachEventListeners () {\n let\n {enterEvent, leaveEvent} = self.options\n\n enterEvent = !Array.isArray(enterEvent) ? [enterEvent] : enterEvent\n leaveEvent = !Array.isArray(leaveEvent) ? [leaveEvent] : leaveEvent\n\n self.data.forEach(obj => {\n enterEvent.forEach((event) => {\n obj.eventTarget.removeEventListener(event, obj.enterHandler, false)\n })\n leaveEvent.forEach((event) => {\n obj.eventTarget.removeEventListener(event, obj.leaveHandler, false)\n })\n })\n }", "title": "" }, { "docid": "c204147681c3d90ed90dce09ccacced8", "score": "0.6178392", "text": "removeEventListeners() {\n d3Select(this.svgEl.current).on('click', null);\n }", "title": "" }, { "docid": "06ccd3f3c4192c9987cf287237111dc9", "score": "0.6171888", "text": "onDeactivate() {\n this.canvas.removeEventListener('mouseup', this.toggleZoomEventHandler);\n }", "title": "" }, { "docid": "90538f16317f2cf7acf1b2c1d511501a", "score": "0.61710465", "text": "function removeOtherEventListeners() {\n game.removeEventListener('click', collectMaterial)\n game.removeEventListener('click', putMaterial)\n}", "title": "" }, { "docid": "d40f941d0518c91b52e381bd46f00089", "score": "0.61493945", "text": "detachAllEvents() {\n this.handledEvents.forEach((value, key) => {\n this.offEvent(key, value.target, value.options);\n });\n this.removeLongPressListener();\n this.removeKeyboardFocusListener();\n this.removeHoverEndListener();\n this.removeSwipeListener();\n }", "title": "" }, { "docid": "f304722b2b2a25dbddd4fd41005349ee", "score": "0.6123252", "text": "remove_theme ()\n {\n if (this._map)\n {\n this._map.off (\"mouseenter\", \"symbol\", this._popon);\n this._map.off (\"mouseleave\", \"symbol\", this._popoff);\n this._map.off (\"mouseenter\", \"circle\", this._popon);\n this._map.off (\"mouseleave\", \"circle\", this._popoff);\n }\n super.remove_theme ();\n }", "title": "" }, { "docid": "8aa8efc26b321ce9b812f850343eea7d", "score": "0.6120397", "text": "destroy() {\n this._unbindEvents();\n this._listeners.length = 0;\n delete this.el;\n }", "title": "" }, { "docid": "c55e98ee7cc0c06fb41d1ee32fecb3c2", "score": "0.6071388", "text": "_removeEventListeners() {\n\n this.controlsEl.removeEventListener('touchstart', this._onTouchStartBound);\n this.controlsEl.removeEventListener('mousedown', this._onMouseDownBound);\n\n this.inputEl.removeEventListener('change', this._onChangeBound);\n\n this.handleEl.removeEventListener('focus', this._onFocusBound);\n this.handleEl.removeEventListener('click', this._onClickBound);\n\n window.removeEventListener('resize', this._onResizeBound);\n window.removeEventListener('orientationchange', this._onResizeBound);\n\n document.removeEventListener('spark.visible-children', this._onVisibleChildrenBound);\n }", "title": "" }, { "docid": "aca375f77a57e388894aa469dfb06a0f", "score": "0.6071014", "text": "function removeEvents() {\n window.removeEventListener('scroll', sendInteractionEvent);\n }", "title": "" }, { "docid": "83709fb10bf52af7518475e44b2919b0", "score": "0.60581064", "text": "onPointerUp() {\n document.removeEventListener('pointermove', this.oPM);\n document.removeEventListener('pointerup', this.oPU);\n \n this.viewerAPI.propagateEvent(\"viewed\", this.viewerViewState, true);\n }", "title": "" }, { "docid": "bcb1d5551ff53656489ae0bef8e581a3", "score": "0.6051643", "text": "function cleanup () {\r\n angular.element($window).off('resize', positionDropdown);\r\n if ( elements ){\r\n var items = 'ul scroller scrollContainer input'.split(' ');\r\n angular.forEach(items, function(key){\r\n elements.$[key].remove();\r\n });\r\n }\r\n }", "title": "" }, { "docid": "d96d77bada0ad69bdd8f2806217781f3", "score": "0.6038971", "text": "deleteListeners() {\n this.removeInputDetection();\n this.removeFocusDetection();\n this.removeClickDetection();\n }", "title": "" }, { "docid": "5a2d7aa4f1536c5dff4f22173ee7ade6", "score": "0.6031528", "text": "function paletteMover() {\n document.body.removeEventListener('mousedown', palettehide, false)\n document.body.removeEventListener('mousedown', menu_hide, false);\n}", "title": "" }, { "docid": "2cf265cd07c3010a8e9bedb0ec43e20c", "score": "0.6025618", "text": "remove() {\n this.eventProvider.removeAddedEvents();\n removeElement(this.element);\n }", "title": "" }, { "docid": "d37d05a5010e1f0a3f129fbb763ad790", "score": "0.6015993", "text": "removeListeners() { }", "title": "" }, { "docid": "c893db848ae181921ee3aa5e910e5d2e", "score": "0.6014947", "text": "function removeModalListeners() {\n const $closeBtn = document.querySelector('.modal__close-button');\n\n $closeBtn.removeEventListener('click', closeModal);\n $modalOverlay.removeEventListener('click', clickOutsideToCloseModal);\n $modalOverlay.removeEventListener('animationend', removeModalOnAnimationend);\n}", "title": "" }, { "docid": "95e3a008208d43ab153825c39f698766", "score": "0.60139656", "text": "remove () {\n\t\tthis._removeEventListeners()\n\t\tthis._raycaster = null\n\t}", "title": "" }, { "docid": "9f6d727cef5f0517cbec77c1e21a2a65", "score": "0.6012456", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n \n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n \n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n }", "title": "" }, { "docid": "db186206ae8448347bebc428c3bbe5fa", "score": "0.6008513", "text": "removeEventListeners(){this.document&&Je.forEach(function(e){this.document.removeEventListener(e,this.triggerEvent,!1)},this)}", "title": "" }, { "docid": "77c0726ec46bcc8aa6e017315ac6d196", "score": "0.60007924", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n }", "title": "" }, { "docid": "3f0891cbd4c7083609def3719a29887f", "score": "0.59996915", "text": "function removeListeners() {\n\t\t\t$element.unbind(START_EV, touchStart);\n\t\t\t$element.unbind(CANCEL_EV, touchCancel);\n\t\t\t$element.unbind(MOVE_EV, touchMove);\n\t\t\t$element.unbind(END_EV, touchEnd);\n\t\t\t\n\t\t\t//we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n\t\t\tif(LEAVE_EV) { \n\t\t\t\t$element.unbind(LEAVE_EV, touchLeave);\n\t\t\t}\n\t\t\t\n\t\t\tsetTouchInProgress(false);\n\t\t}", "title": "" }, { "docid": "3f0891cbd4c7083609def3719a29887f", "score": "0.59996915", "text": "function removeListeners() {\n\t\t\t$element.unbind(START_EV, touchStart);\n\t\t\t$element.unbind(CANCEL_EV, touchCancel);\n\t\t\t$element.unbind(MOVE_EV, touchMove);\n\t\t\t$element.unbind(END_EV, touchEnd);\n\t\t\t\n\t\t\t//we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n\t\t\tif(LEAVE_EV) { \n\t\t\t\t$element.unbind(LEAVE_EV, touchLeave);\n\t\t\t}\n\t\t\t\n\t\t\tsetTouchInProgress(false);\n\t\t}", "title": "" }, { "docid": "3f0891cbd4c7083609def3719a29887f", "score": "0.59996915", "text": "function removeListeners() {\n\t\t\t$element.unbind(START_EV, touchStart);\n\t\t\t$element.unbind(CANCEL_EV, touchCancel);\n\t\t\t$element.unbind(MOVE_EV, touchMove);\n\t\t\t$element.unbind(END_EV, touchEnd);\n\t\t\t\n\t\t\t//we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n\t\t\tif(LEAVE_EV) { \n\t\t\t\t$element.unbind(LEAVE_EV, touchLeave);\n\t\t\t}\n\t\t\t\n\t\t\tsetTouchInProgress(false);\n\t\t}", "title": "" }, { "docid": "ac2a529798893304fd51fb6858d14df5", "score": "0.598917", "text": "_destroy() {\n this._removeSticky(true);\n\n this.$element.removeClass(`${this.options.stickyClass} is-anchored is-at-top`)\n .css({\n height: '',\n top: '',\n bottom: '',\n 'max-width': ''\n })\n .off('resizeme.zf.trigger')\n .off('mutateme.zf.trigger');\n if (this.$anchor && this.$anchor.length) {\n this.$anchor.off('change.zf.sticky');\n }\n __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off(this.scrollListener);\n\n if (this.wasWrapped) {\n this.$element.unwrap();\n } else {\n this.$container.removeClass(this.options.containerClass)\n .css({\n height: ''\n });\n }\n }", "title": "" }, { "docid": "ac2a529798893304fd51fb6858d14df5", "score": "0.598917", "text": "_destroy() {\n this._removeSticky(true);\n\n this.$element.removeClass(`${this.options.stickyClass} is-anchored is-at-top`)\n .css({\n height: '',\n top: '',\n bottom: '',\n 'max-width': ''\n })\n .off('resizeme.zf.trigger')\n .off('mutateme.zf.trigger');\n if (this.$anchor && this.$anchor.length) {\n this.$anchor.off('change.zf.sticky');\n }\n __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).off(this.scrollListener);\n\n if (this.wasWrapped) {\n this.$element.unwrap();\n } else {\n this.$container.removeClass(this.options.containerClass)\n .css({\n height: ''\n });\n }\n }", "title": "" }, { "docid": "beb5ca9977503e0831980461cfbb6ea0", "score": "0.597791", "text": "didDestroyElement() {\n $(document)\n .off(\"drop\")\n .off(\"dragover\");\n }", "title": "" }, { "docid": "f0119679b50bef644968e9cb95ca216e", "score": "0.5977544", "text": "function removeListeners(){ \n\t\t$('.gameBoard li').unbind('click');\n\t}", "title": "" }, { "docid": "5328a7b221ac65902d13c195671e2ca8", "score": "0.5972282", "text": "_removeRootElementListeners(element) {\n element.removeEventListener('mousedown', this._pointerDown, activeEventListenerOptions);\n element.removeEventListener('touchstart', this._pointerDown, passiveEventListenerOptions);\n }", "title": "" }, { "docid": "1a952828ef982f6236d05be2fcfead90", "score": "0.5968694", "text": "function removeDragListeners () {\n angular.element($window).off('mouseup', handleMouseUp);\n angular.element($window).off('mousemove', handleMouseMove);\n }", "title": "" }, { "docid": "94636fa05ce6b3ee04d5d38469dd102a", "score": "0.5963225", "text": "function removeListeners() {\n $element.unbind(START_EV, touchStart);\n $element.unbind(CANCEL_EV, touchCancel);\n $element.unbind(MOVE_EV, touchMove);\n $element.unbind(END_EV, touchEnd);\n\n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n if (LEAVE_EV) {\n $element.unbind(LEAVE_EV, touchLeave);\n }\n\n setTouchInProgress(false);\n }", "title": "" }, { "docid": "3bfb3d10ca17eb0d86d9b9b22b89d005", "score": "0.5959523", "text": "_destroy() {\n if(this.options.scrollTop) this.$element.off('.zf.drilldown',this._bindHandler);\n this._hideAll();\n\t this.$element.off('mutateme.zf.trigger');\n __WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__[\"a\" /* Nest */].Burn(this.$element, 'drilldown');\n this.$element.unwrap()\n .find('.js-drilldown-back, .is-submenu-parent-item').remove()\n .end().find('.is-active, .is-closing, .is-drilldown-submenu').removeClass('is-active is-closing is-drilldown-submenu')\n .end().find('[data-submenu]').removeAttr('aria-hidden tabindex role');\n this.$submenuAnchors.each(function() {\n __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).off('.zf.drilldown');\n });\n\n this.$submenus.removeClass('drilldown-submenu-cover-previous invisible');\n\n this.$element.find('a').each(function(){\n var $link = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this);\n $link.removeAttr('tabindex');\n if($link.data('savedHref')){\n $link.attr('href', $link.data('savedHref')).removeData('savedHref');\n }else{ return; }\n });\n }", "title": "" }, { "docid": "3bfb3d10ca17eb0d86d9b9b22b89d005", "score": "0.5959523", "text": "_destroy() {\n if(this.options.scrollTop) this.$element.off('.zf.drilldown',this._bindHandler);\n this._hideAll();\n\t this.$element.off('mutateme.zf.trigger');\n __WEBPACK_IMPORTED_MODULE_2__foundation_util_nest__[\"a\" /* Nest */].Burn(this.$element, 'drilldown');\n this.$element.unwrap()\n .find('.js-drilldown-back, .is-submenu-parent-item').remove()\n .end().find('.is-active, .is-closing, .is-drilldown-submenu').removeClass('is-active is-closing is-drilldown-submenu')\n .end().find('[data-submenu]').removeAttr('aria-hidden tabindex role');\n this.$submenuAnchors.each(function() {\n __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this).off('.zf.drilldown');\n });\n\n this.$submenus.removeClass('drilldown-submenu-cover-previous invisible');\n\n this.$element.find('a').each(function(){\n var $link = __WEBPACK_IMPORTED_MODULE_0_jquery___default()(this);\n $link.removeAttr('tabindex');\n if($link.data('savedHref')){\n $link.attr('href', $link.data('savedHref')).removeData('savedHref');\n }else{ return; }\n });\n }", "title": "" }, { "docid": "2ed1ac5fd7c606a0457b3941ceb8523c", "score": "0.59507835", "text": "_destroy() {\n this.$element.off('resizeme.zf.trigger')\n }", "title": "" }, { "docid": "2ed1ac5fd7c606a0457b3941ceb8523c", "score": "0.59507835", "text": "_destroy() {\n this.$element.off('resizeme.zf.trigger')\n }", "title": "" }, { "docid": "72a05d4840a1b63b1e9ea1b03d3fad8d", "score": "0.5940645", "text": "unHookAllSidebarToMenuButtonEvents() {\n //debugger;\n $('#main-menu-button').off('click.sidebar');\n }", "title": "" }, { "docid": "3a349bd3728403671a58d621940631f1", "score": "0.5933787", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n }", "title": "" }, { "docid": "c4f2f69a5b0aee807dbc2d7a579f48ba", "score": "0.59329295", "text": "detached() {\n this.unlisten(this, 'px-dropdown-selection-changed', '_itemSelected');\n }", "title": "" }, { "docid": "b2e2a11b343ae74d9f06de76fb2e2ea1", "score": "0.5930485", "text": "function addRemoveButtonEventListeners(){\n let removeBookButtons = [...document.getElementsByClassName('removeButtons')];\n\n // remove book instance, redisplay library and add new event listeners to remove buttons with new positions\n for(let i=0;i<removeBookButtons.length;i++){\n removeBookButtons[i].addEventListener('click', function(){\n myLibrary.splice(i,1);\n reconfigureLibrary();\n });\n }\n}", "title": "" }, { "docid": "64c3cd8bdea9629cca5a5e31080f3387", "score": "0.5929358", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n }", "title": "" }, { "docid": "64c3cd8bdea9629cca5a5e31080f3387", "score": "0.5929358", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n }", "title": "" }, { "docid": "64c3cd8bdea9629cca5a5e31080f3387", "score": "0.5929358", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n }", "title": "" }, { "docid": "64c3cd8bdea9629cca5a5e31080f3387", "score": "0.5929358", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n }", "title": "" }, { "docid": "64c3cd8bdea9629cca5a5e31080f3387", "score": "0.5929358", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n }", "title": "" }, { "docid": "64c3cd8bdea9629cca5a5e31080f3387", "score": "0.5929358", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n }", "title": "" }, { "docid": "64c3cd8bdea9629cca5a5e31080f3387", "score": "0.5929358", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound);\n\n // Remove scroll event listener on scroll parents\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n });\n\n // Reset state\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n }", "title": "" }, { "docid": "d77c5db99d2bae50dde22de21a49254f", "score": "0.5925712", "text": "function removeEventListeners() {\n\t\tvar DENOMINATIONS = ['2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K', 'A'];\n\t\tvar SUITS = ['s', 'h', 'c', 'd'];\n\n\t\tDENOMINATIONS.forEach((denomination) => {\n\t\t\tlet domElement = document.querySelector(`#cardSelectionID [data-card-denomination='${denomination}']`);\n\t\t\tdomElement.removeEventListener('click', onDenominationClick);\n\t\t});\n\t\tSUITS.forEach((suit) => {\n\t\t\tlet domElement = document.querySelector(`#cardSelectionID [data-card-suit='${suit}']`);\n\t\t\tdomElement.removeEventListener('click', onSuitClick);\n\t\t});\n\n\t\tdocument.querySelector(`#cardSelectionID [data-card-denomination=' ']`).removeEventListener('click', onClearCard);\n\t}", "title": "" }, { "docid": "8251d672301dc04fa0e21944819881f1", "score": "0.59241956", "text": "_unbindEvents() {\n if (this.el) this.el.unbindEvents();\n }", "title": "" }, { "docid": "2c1135662145f17a121e99e3032207be", "score": "0.591468", "text": "function removeEventHandlers() {\n $this.off('click.collapse', '> li > .collapsible-header');\n }", "title": "" }, { "docid": "2c1135662145f17a121e99e3032207be", "score": "0.591468", "text": "function removeEventHandlers() {\n $this.off('click.collapse', '> li > .collapsible-header');\n }", "title": "" }, { "docid": "2c1135662145f17a121e99e3032207be", "score": "0.591468", "text": "function removeEventHandlers() {\n $this.off('click.collapse', '> li > .collapsible-header');\n }", "title": "" }, { "docid": "2c1135662145f17a121e99e3032207be", "score": "0.591468", "text": "function removeEventHandlers() {\n $this.off('click.collapse', '> li > .collapsible-header');\n }", "title": "" }, { "docid": "2c1135662145f17a121e99e3032207be", "score": "0.591468", "text": "function removeEventHandlers() {\n $this.off('click.collapse', '> li > .collapsible-header');\n }", "title": "" }, { "docid": "2c1135662145f17a121e99e3032207be", "score": "0.591468", "text": "function removeEventHandlers() {\n $this.off('click.collapse', '> li > .collapsible-header');\n }", "title": "" }, { "docid": "2c1135662145f17a121e99e3032207be", "score": "0.591468", "text": "function removeEventHandlers() {\n $this.off('click.collapse', '> li > .collapsible-header');\n }", "title": "" }, { "docid": "9465ba33f7071f41c3dfb0ee15e82683", "score": "0.5913537", "text": "function cleanup () {\n if(!ctrl.hidden) {\n $mdUtil.enableScrolling();\n }\n\n angular.element($window).off('resize', positionDropdown);\n if ( elements ){\n var items = 'ul scroller scrollContainer input'.split(' ');\n angular.forEach(items, function(key){\n elements.$[key].remove();\n });\n }\n }", "title": "" }, { "docid": "9465ba33f7071f41c3dfb0ee15e82683", "score": "0.5913537", "text": "function cleanup () {\n if(!ctrl.hidden) {\n $mdUtil.enableScrolling();\n }\n\n angular.element($window).off('resize', positionDropdown);\n if ( elements ){\n var items = 'ul scroller scrollContainer input'.split(' ');\n angular.forEach(items, function(key){\n elements.$[key].remove();\n });\n }\n }", "title": "" }, { "docid": "9465ba33f7071f41c3dfb0ee15e82683", "score": "0.5913537", "text": "function cleanup () {\n if(!ctrl.hidden) {\n $mdUtil.enableScrolling();\n }\n\n angular.element($window).off('resize', positionDropdown);\n if ( elements ){\n var items = 'ul scroller scrollContainer input'.split(' ');\n angular.forEach(items, function(key){\n elements.$[key].remove();\n });\n }\n }", "title": "" }, { "docid": "ec4fd33d9ec0fb3e20d44b0ac7bf1b24", "score": "0.5910584", "text": "function removeListeners() {\r\n\t\t\t$element.unbind(START_EV, touchStart);\r\n\t\t\t$element.unbind(CANCEL_EV, touchCancel);\r\n\t\t\t$element.unbind(MOVE_EV, touchMove);\r\n\t\t\t$element.unbind(END_EV, touchEnd);\r\n\t\t\t\r\n\t\t\t//we only have leave events on desktop, we manually calcuate leave on touch as its not supported in webkit\r\n\t\t\tif(LEAVE_EV) { \r\n\t\t\t\t$element.unbind(LEAVE_EV, touchLeave);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tsetTouchInProgress(false);\r\n\t\t}", "title": "" }, { "docid": "a17714451ba90e5c64edfa7e91fae395", "score": "0.5908942", "text": "_destroy() {\n this.$element.off('.zf.toggler');\n }", "title": "" }, { "docid": "a17714451ba90e5c64edfa7e91fae395", "score": "0.5908942", "text": "_destroy() {\n this.$element.off('.zf.toggler');\n }", "title": "" }, { "docid": "91673c3f22548daf640a86e8a80bbeca", "score": "0.59011763", "text": "function removeEventHandlers() {\r\n $this.off('click.collapse', '> li > .collapsible-header');\r\n }", "title": "" }, { "docid": "0547602fef30717be685bf9cd6991af7", "score": "0.5899949", "text": "detach() {\n const that = this;\n that._removeEventListeners();\n }", "title": "" }, { "docid": "22de7f0f1bba4cf0226930ba2c831878", "score": "0.58986175", "text": "unbindEvents() {\n this.toggleListeners.forEach(toggleListener => toggleListener.destroy());\n this.openListeners.forEach(openListener => openListener.destroy());\n this.closeListeners.forEach(closeListener => closeListener.destroy());\n }", "title": "" }, { "docid": "b03c62e9f2db31b9af35c86e8cff5fdf", "score": "0.5897141", "text": "destroy() {\n if(this.options.scrollTop) this.$element.off('.zf.drilldown',this._bindHandler);\n this._hideAll();\n\t this.$element.off('mutateme.zf.trigger');\n Foundation.Nest.Burn(this.$element, 'drilldown');\n this.$element.unwrap()\n .find('.js-drilldown-back, .is-submenu-parent-item').remove()\n .end().find('.is-active, .is-closing, .is-drilldown-submenu').removeClass('is-active is-closing is-drilldown-submenu')\n .end().find('[data-submenu]').removeAttr('aria-hidden tabindex role');\n this.$submenuAnchors.each(function() {\n $(this).off('.zf.drilldown');\n });\n\n this.$submenus.removeClass('drilldown-submenu-cover-previous');\n\n this.$element.find('a').each(function(){\n var $link = $(this);\n $link.removeAttr('tabindex');\n if($link.data('savedHref')){\n $link.attr('href', $link.data('savedHref')).removeData('savedHref');\n }else{ return; }\n });\n Foundation.unregisterPlugin(this);\n }", "title": "" }, { "docid": "6fcd22237ca763ca37e0a52ecf171fb5", "score": "0.5891942", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound); // Remove scroll event listener on scroll parents\n\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n }); // Reset state\n\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "6fcd22237ca763ca37e0a52ecf171fb5", "score": "0.5891942", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound); // Remove scroll event listener on scroll parents\n\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n }); // Reset state\n\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "6fcd22237ca763ca37e0a52ecf171fb5", "score": "0.5891942", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound); // Remove scroll event listener on scroll parents\n\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n }); // Reset state\n\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "6fcd22237ca763ca37e0a52ecf171fb5", "score": "0.5891942", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound); // Remove scroll event listener on scroll parents\n\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n }); // Reset state\n\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "6fcd22237ca763ca37e0a52ecf171fb5", "score": "0.5891942", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound); // Remove scroll event listener on scroll parents\n\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n }); // Reset state\n\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "6fcd22237ca763ca37e0a52ecf171fb5", "score": "0.5891942", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound); // Remove scroll event listener on scroll parents\n\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n }); // Reset state\n\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "6fcd22237ca763ca37e0a52ecf171fb5", "score": "0.5891942", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound); // Remove scroll event listener on scroll parents\n\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n }); // Reset state\n\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" }, { "docid": "6fcd22237ca763ca37e0a52ecf171fb5", "score": "0.5891942", "text": "function removeEventListeners(reference, state) {\n // Remove resize event listener on window\n getWindow(reference).removeEventListener('resize', state.updateBound); // Remove scroll event listener on scroll parents\n\n state.scrollParents.forEach(function (target) {\n target.removeEventListener('scroll', state.updateBound);\n }); // Reset state\n\n state.updateBound = null;\n state.scrollParents = [];\n state.scrollElement = null;\n state.eventsEnabled = false;\n return state;\n}", "title": "" } ]
717b5a9a57ebcaffe54a4d7edb3d93d8
tail :: [a] > [a] drop head element
[ { "docid": "26b2c8bdb7f08ba2a3c8e77916b89e75", "score": "0.8263718", "text": "function tail (a) {\n return drop(1, a)\n }", "title": "" } ]
[ { "docid": "6977ce7786707bb2bed39400b816ad72", "score": "0.83904624", "text": "function tail(a) {\r\n return drop(1, a);\r\n}", "title": "" }, { "docid": "f9217219b3b5f5075636da7cc36711a6", "score": "0.83169", "text": "function tail(a) {\n return drop(1, a);\n}", "title": "" }, { "docid": "e047f7ef4f85a61b394af572d497bd5b", "score": "0.8273117", "text": "function tail(a) {\n\t return drop(1, a);\n\t}", "title": "" }, { "docid": "5c5b2724ca79a057a6ec9db608673e47", "score": "0.8245303", "text": "function tail(a) {\n return drop(1, a);\n }", "title": "" }, { "docid": "012acc28e498e6f7cddce4b9a70a37b1", "score": "0.7846904", "text": "removeTail() {\n if(this.length === 0) return undefined;\n \n let oldTail;\n if(this.length === 1){\n oldTail = [...[this.tail]][0];\n this.head = null;\n this.tail = null;\n }\n else{\n this.tail = this.head;\n let beforeTail; \n while(this.tail.next !== null){\n beforeTail = this.tail;\n this.tail = this.tail.next;\n }\n oldTail = [...[this.tail]][0]; \n this.tail = beforeTail;\n this.tail.next = null; \n }\n this.length--;\n return oldTail;\n }", "title": "" }, { "docid": "50bbd085d723cc92984053c4ded60fc2", "score": "0.75039726", "text": "removeTail() {\n if (!this.head){\n return undefined;\n }\n if(this.length === 1){\n this.head = null;\n this.tail = null;\n this.length = 0 ;\n return;\n }\n\n let cur = this.head;\n let prev = null;\n while(cur.next !== null){\n prev = cur;\n cur = cur.next;\n }\n this.tail = prev;\n this.tail.next = null;\n this.length --;\n return cur;\n }", "title": "" }, { "docid": "274019d1d7d3fad25cccfc79ee54b272", "score": "0.7350556", "text": "removeTail() {\n if (!this.length) {\n return undefined\n }\n let oldTail = this.tail\n if (this.length === 1) {\n this.tail = null;\n this.head = null;\n } else {\n let currentNode = this.head\n for (let i = 1; i <= this.length; i++) {\n if (currentNode.next === this.tail) {\n currentNode.next = null\n this.tail = currentNode;\n } else {\n currentNode = currentNode.next \n }\n }\n }\n this.length -= 1\n return oldTail\n }", "title": "" }, { "docid": "844a778bff2bbceb5a74d7bf320784b6", "score": "0.72131354", "text": "removeTail() {\n if (!this.head) return undefined;\n\n let curr = this.head;\n let removed = this.tail;\n let newTail = curr;\n while (curr.next) {\n newTail = curr;\n curr = curr.next;\n }\n\n this.tail = newTail;\n this.tail.next = null;\n this.length--;\n if (this.length === 0) {\n this.head = null;\n this.tail = null;\n }\n\n return removed;\n }", "title": "" }, { "docid": "c21d3bec1c41db48a5d6690a107aa9ba", "score": "0.7178968", "text": "deleteTail() {\n if (!this.tail) {\n this.head = this.tail = null;\n } else {\n let curr = this.head;\n\n while (curr.next != this.tail) {\n curr = curr.next;\n }\n this.tail = curr;\n this.tail.next = null;\n return curr;\n }\n }", "title": "" }, { "docid": "b657b486132ebea724aa7aa01f78747c", "score": "0.7174273", "text": "pop() {\n if (!this.head) return undefined;\n let currentTail = this.tail;\n if (this.length === 1) {\n this.head = null;\n this.tail = null;\n } else {\n this.tail = currentTail.prev;\n this.tail.next = null;\n currentTail.prev = null;\n }\n this.length--;\n return currentTail;\n }", "title": "" }, { "docid": "fb09cb0d8d297d991d94948fdd8cd06e", "score": "0.71120244", "text": "removeTail() {\n let current = this.head;\n let previous;\n\n while (current.next) {\n previous = current;\n current = current.next;\n }\n\n previous.next = null;\n this.tail = previous;\n this.length -= 1;\n\n return this;\n }", "title": "" }, { "docid": "f90eedcd38ffed84959581ca5b678669", "score": "0.70852184", "text": "function tail(xs){\n var tmp = []\n for (var i = 1; i < xs.length; i++) tmp.push(xs[i])\n return tmp\n}", "title": "" }, { "docid": "2307e3e5599e7806c64195c43a5661a6", "score": "0.70835835", "text": "removeFromTail() {\n if (!this.tail) return null;\n\n const { value } = this.tail;\n if (this.tail === this.head) {\n this.head = null;\n this.tail = null;\n } else {\n this.tail = this.tail.prev;\n this.tail.next = null;\n }\n return value;\n }", "title": "" }, { "docid": "3d798c350060ad72378bd1e45baa8027", "score": "0.7071919", "text": "removeHead() {\n let oldHead;\n if(this.length === 0) return undefined;\n else if(this.head.next === null){ \n oldHead = [...[this.head]][0];\n this.head = null;\n this.tail = null;\n } else{\n oldHead = [...[this.head]][0];\n this.head = this.head.next;\n }\n this.length--;\n return oldHead;\n\n }", "title": "" }, { "docid": "883177bd5b7578e7b78d9e58e4e7b9ba", "score": "0.7053999", "text": "removeHead() {\n if (!this.head) return undefined;\n let currentHead = this.head;\n this.head = currentHead.next;\n this.length--;\n if (this.length === 0) {\n this.tail = null;\n this.head = null;\n }\n return currentHead;\n }", "title": "" }, { "docid": "54fad94375e4bf088736b1f17b7683bd", "score": "0.70522594", "text": "pop() {\r\n\t\t//if the list is empty return nothing\r\n\t\tif(!this.head) { return undefined };\r\n\t\t//set current and new tail to head\r\n\t\tlet current = this.head;\r\n\t\tlet newTail = this.head;\r\n\t\t//iterate until current.next = null to get item before tail\r\n\t\twhile(current.next) {\r\n\t\t\tnewTail = current;\r\n\t\t\tcurrent = current.next;\r\n\t\t}\r\n\t\t//set new tail with next as null\r\n\t\tthis.tail = newTail;\r\n\t\tthis.tail.next = null;\r\n\t\t//decrement the length\r\n\t\tthis.length--;\r\n\t\t//for case where there was only 1 item\r\n\t\tif(this.length === 0) {\r\n\t\t\t//set head and tail back to null\r\n\t\t\tthis.head = null;\r\n\t\t\tthis.tail = null;\r\n\t\t}\r\n\t\treturn current;\r\n\t}", "title": "" }, { "docid": "7cb8ea93e26813b498a719fbc4ab33c3", "score": "0.7003396", "text": "removeHead() {\n if (!this.length) return undefined;\n let oldHead = this.head;\n if (this.length === 1) {\n this.head = null;\n this.tail = null;\n } else { \n let newHead = oldHead.next;\n this.head = newHead;\n }\n this.length -= 1;\n return oldHead;\n }", "title": "" }, { "docid": "7ad8408434c7a3935175a6008fcac5a4", "score": "0.6951353", "text": "pop() {\n if (!this.length) {\n return undefined;\n }\n let poppedTail = this.tail;\n if (this.length === 1) {\n this.head = null;\n this.tail = null;\n } else {\n this.tail = poppedTail.prev;\n this.tail.next = null;\n poppedTail.prev = null;\n }\n this.length--;\n return poppedTail;\n }", "title": "" }, { "docid": "2d2cb3cc458826b46b0144dc748f9095", "score": "0.6946826", "text": "pop(){\n if(!this.head) return undefined;\n let current = this.head;\n let newTail = current;\n while(current.next){\n newTail = current;\n current = current.next;\n }\n this.tail = newTail;\n this.tail.next = null;\n this.length--;\n if(this.length === 0){\n this.head = null;\n this.tail = null;\n }\n return current;\n }", "title": "" }, { "docid": "67f811ed81fe0ec3f6368194c704faf6", "score": "0.6944613", "text": "pop() {\n if (this.head === this.tail) {\n this.head = null;\n this.tail = null;\n return;\n }\n this.tail = this.findPrev(this.tail.value);\n this.tail.next = null;\n }", "title": "" }, { "docid": "631fa03437c94609c169f362a1543b84", "score": "0.69316024", "text": "pop() {\n if(this.isEmpty()) return undefined;\n\n const temp = this.tail;\n\n let listLength = this.length - 2;\n\n this.length --;\n \n if(listLength === -1) {\n this.head = null;\n this.tail = null;\n\n return temp;\n }\n\n let current = this.head;\n\n while(listLength--) {\n current = current.next;\n }\n\n current.next = null;\n\n this.tail = current;\n\n return temp;\n }", "title": "" }, { "docid": "3ea824e1c7034ae4bda95dce6cf63140", "score": "0.6922411", "text": "shift(){\n if(!this.head) return undefined;\n var removeHead = this.head;\n this.head = removeHead.next;\n this.length--;\n if(this.length === 0){\n this.tail = null;\n }\n return removeHead;\n }", "title": "" }, { "docid": "1fd83f8bd9eda47ecf3e3c9087938cb4", "score": "0.6914167", "text": "removeHead() {\n if (!this.head) {\n return undefined;\n }\n if (this.length === 1) {\n this.head = null;\n this.tail = null;\n this.length = 0;\n return;\n }\n\n let prev = this.head;\n \n if(this.head){\n this.head = prev.next;\n this.length --;\n }\n\n return prev;\n }", "title": "" }, { "docid": "d03605e9b830c5744bea3fdf4960f196", "score": "0.6883668", "text": "pop(){\n if(!this.head) return undefined;\n var current = this.head;\n var newTail = current;\n while(current.next){\n newTail = current;\n current = current.next;\n }\n this.tail = newTail;\n this.tail.next = null;\n this.length--;\n if(this.length === 0){\n this.head = null;\n this.tail = null;\n }\n return current;\n }", "title": "" }, { "docid": "8bd9d4f802c106fa6fd827edf7c0b30f", "score": "0.68774956", "text": "pop() {\n if (this.head === null) {\n throw new Error(REMOVE_FROM_EMPTY_STRUCT);\n }\n\n let preTail = this.head;\n let current = this.head;\n while (current.next !== null) {\n preTail = current;\n current = current.next;\n }\n\n preTail.next = null;\n this.tail = preTail;\n this.length--;\n if (this.length === 0) {\n this.head = this.tail = null;\n }\n }", "title": "" }, { "docid": "e9747c4a6f1e48fedcd50da80950fb83", "score": "0.6876784", "text": "pop() {\n if (!this.head) return undefined;\n else {\n let current = this.head;\n let newTail = current;\n\n while (current.next) {\n newTail = current;\n current = current.next;\n }\n this.tail = newTail;\n this.tail.next = null;\n this.length--;\n if (this.length === 0) {\n this.head = null;\n this.tail = null;\n }\n return current;\n }\n }", "title": "" }, { "docid": "57135ffec9a6051c7d3999efb62362ba", "score": "0.6874872", "text": "pop() {\n if(!this.head) return undefined;\n var current = this.head;\n var newTail= current;\n while(current.next) {\n newTail = current;\n current = current.next;\n }\n this.tail = newTail;\n this.tail.next = null;\n this.length--;\n if(length == 0) {\n // Reset \n this.head = null;\n this.tail = null;\n }\n return current;\n }", "title": "" }, { "docid": "8af5b9b63cef4841a1e1666d910edf79", "score": "0.68701", "text": "pop(){\n if(!this.head){\n return undefined\n }\n let currentNode = this.head\n let pre = currentNode\n while(currentNode.next){\n pre = currentNode\n currentNode = currentNode.next\n }\n this.tail = pre\n this.tail.next = null\n this.length--\n if(this.length == 0){\n this.head = null\n this.tail = null\n }\n // special case, if only 1 item b/c we never set head tial to be null\n return currentNode\n\n\n }", "title": "" }, { "docid": "1887dc8809d5d263c52247a8b9fdd9bd", "score": "0.68653446", "text": "pop(){\n if (this.length === 0) return undefined;\n var current = this.head;\n var newTail = current;\n while(current.next){\n newTail = current;\n current = current.next;\n }\n this.tail = newTail;\n this.tail.next = null;\n this.length--;\n\n // if there is one item there is a problem because we are never setting the head and the tail to be null\n // we can do that by setting the tail and head to null when the list length is 0\n\n if(this.length === 0){\n this.tail = null;\n this.head = null;\n }\n return current;\n }", "title": "" }, { "docid": "4ed66a10705d3d5c90149d525da7001d", "score": "0.68310803", "text": "static tail(array) {\n array.shift()\n return array\n }", "title": "" }, { "docid": "3e272dc17db187e6139681d2e6a0b010", "score": "0.6807515", "text": "pop() {\n if(this.head === null){\n return undefined;\n } else {\n var current = this.head;\n var newTail = current;\n while (current.next){\n newTail = current;\n current = current.next;\n }\n\n newTail.next = null;\n this.tail = newTail;\n this.length--;\n if(this.length === 0){\n this.head = null;\n this.tail = null;\n }\n return current;\n }\n }", "title": "" }, { "docid": "e72a08abf5dd2dbd42676d9e33195f06", "score": "0.6798656", "text": "pop(){\n //checking if the list is empty and there's nothing to remove\n if(!this.head) return null;\n let temp = this.head //to keep track of the current value\n let newTail = temp; \n while(temp.next){\n newTail = temp;\n temp = temp.next;\n }\n this.tail = newTail;\n this.tail.next = null;\n this.length--;\n //checking when the list is empty\n if(this.length === 0){\n this.head = null;\n this.tail = null;\n }\n return temp;\n }", "title": "" }, { "docid": "dd82289cd381746edfefba9b56602c97", "score": "0.6773447", "text": "pop(){\n if (this.length === 0){\n return undefined\n }\n let current = this.head\n let newTail;\n while (current.next){\n newTail = current\n current = current.next\n }\n newTail.next = null;\n this.tail = newTail;\n this.length--;\n // special case, where the list only has one element, that you pop \n // otherwise the head and tail will still be set to that element, even though it's been removed and list is empty\n if (this.length === 0){\n this.head = null;\n this.tail = null\n }\n return current;\n \n }", "title": "" }, { "docid": "66271844d6b20484a92b4c3712466b7f", "score": "0.6771362", "text": "pop() {\n if (!this.head) return;\n let current = this.head;\n let newTail = current;\n while(current.next) {\n newTail = current;\n current = current.next;\n }\n this.tail = newTail;\n this.tail.next = null;\n this.length--;\n if (this.length === 0) {\n this.head = null;\n this.tail = null;\n }\n return current;\n }", "title": "" }, { "docid": "8aa3468abd7fde3f6e57d5767def08fe", "score": "0.6769945", "text": "function tail(arr){return arr.length&&arr[arr.length-1]||undefined;}", "title": "" }, { "docid": "cf4aac618ea8a926ad31c4fef9392e16", "score": "0.6766643", "text": "pop(){\n if(!this.tail){\n return undefined;\n }\n let poppedNode = this.tail;\n if(this.length === 1){\n this.head = null;\n this.tail = null;\n } else {\n this.tail = poppedNode.prev;\n this.tail.next = null;\n poppedNode.prev = null;\n }\n this.length--;\n return poppedNode;\n }", "title": "" }, { "docid": "37342cf1566031c69ea2ae7de6dc46be", "score": "0.67664784", "text": "pop() {\n if (this.head === null || this.length === 0) {\n return undefined;\n }\n let tailToBeRemoved = this.tail;\n if (this.length === 1) {\n this.head = null;\n this.tail = null;\n } else {\n this.tail = tailToBeRemoved.prev;\n this.tail.next = null;\n tailToBeRemoved.prev = null; // old tail previous should be removed so that there is no connection at all\n }\n this.length--;\n return tailToBeRemoved;\n }", "title": "" }, { "docid": "0e16bc1ea9de9958d949d97c1233c335", "score": "0.6760982", "text": "pop() {\n if(this.tail) {\n this.length--;\n if(this.tail.prev) {\n let previousTail = this.tail;\n this.tail.prev.next = null\n this.tail = this.tail.prev;\n return previousTail\n }\n this.tail = null;\n this.head = null;\n }\n return null\n }", "title": "" }, { "docid": "880f6328f03be982837191fa7b44b1a0", "score": "0.67430335", "text": "pop() {\n const last = this.getLast()\n let current = this.head;\n\n // if the list has nothing return nothing\n if(!this.head){\n return;\n }\n\n // if the list has only one item remove it from the start\n if (this.length === 1){\n return this.shift()\n }\n\n while (current.next !== last){\n current = current.next\n }\n\n current.next = null;\n this.length-- ;\n\n return last\n }", "title": "" }, { "docid": "8a613db32bb34a2ca0fb6079343adc95", "score": "0.6739934", "text": "pop() {\n if (!this.head) return undefined;\n let currentNode = this.head;\n let oldTailVal = this.tail;\n\n if (this.length === 1) {\n this.head = this.tail = null;\n } else {\n while (currentNode.next.next !== null) {\n currentNode = currentNode.next;\n }\n currentNode.next = null;\n this.tail = currentNode;\n }\n this.length--;\n return oldTailVal;\n }", "title": "" }, { "docid": "0ef04356d413f646451ad1f20927b23b", "score": "0.6724932", "text": "shift(){\n if(!this.head) return null;\n let removeHead = this.head;\n this.head = removeHead.next;\n this.length--;\n if(this.length === 0) this.tail = null;\n return removeHead;\n }", "title": "" }, { "docid": "4a93951c0a06c1e441a3c30f5641524d", "score": "0.6720317", "text": "pop() {\n if (this.length === 0) return undefined;\n var current = this.tail;\n if (this.length === 1) {\n this.head = null;\n this.tail = null;\n } else {\n this.tail = current.next;\n this.tail = null;\n current.prev = null;\n }\n this.length--;\n return current;\n }", "title": "" }, { "docid": "7d97b84c0bf75883c01116307782eec8", "score": "0.6712986", "text": "pop() {\n if (!this.head) return null\n let removed = this.head\n if (this.length === 1) {\n this.head = null\n this.tail = null\n } else {\n // 1 --> 2 --> 3 --> 4\n // 2 --> 3 --> 4\n this.head = removed.next\n removed.next = null\n }\n this.length--\n return removed\n }", "title": "" }, { "docid": "484a3f6bdfbc373a9e6d530061e18986", "score": "0.67116743", "text": "pop() {\n\n if (this.length === 0) return undefined;\n if (this.length === 1) {\n let node = this.head;\n this.head = null;\n this.tail = null;\n this.length--;\n return node;\n } else {\n let preNode = this.head;\n let tmpNode = this.head.next;\n\n while (tmpNode.next != null) {\n preNode = preNode.next;\n tmpNode = preNode.next;\n }\n\n preNode.next = null;\n this.tail = preNode;\n this.length--;\n return tmpNode;\n }\n }", "title": "" }, { "docid": "4d0036a77e9920c2d3657bff003b68ba", "score": "0.67016256", "text": "removeLast(){\n // Checks for list of length 0 and 1...\n if (!this.head) {return}\n if (this.head.next === null){\n this.head = null;\n return\n }\n\n // ... Loops through other cases\n let prev = this.head;\n let curr = this.head.next;\n while(curr.next !== null){\n prev = curr\n curr = curr.next\n }\n prev.next = null\n }", "title": "" }, { "docid": "bdaf726237d13e7946e598c83fbf6504", "score": "0.6694978", "text": "deleteAtTail() {\r\n let currentnode = this.head\r\n let previousnode = null\r\n while (currentnode.next != null) {\r\n previousnode = currentnode\r\n currentnode = currentnode.next\r\n }\r\n previousnode.next = null\r\n }", "title": "" }, { "docid": "b87b885c5bd4d2cea1d5a62bf40791a2", "score": "0.66910326", "text": "deleteTail() {\n if (!this.size) { return null }\n\n if (this.size === 1) {\n this.head = null;\n this.tail = null;\n } else {\n this.tail = this.tail.prev;\n this.tail.next = null;\n }\n\n this.size--;\n return true;\n }", "title": "" }, { "docid": "73642cd8d4099973692d8099b0817c8c", "score": "0.66879565", "text": "pop() {\n if (!this.head) return undefined;\n let current = this.head;\n let newTail = current;\n while (current.next) {\n newTail = current;\n current = current.next;\n }\n this.tail = newTail;\n this.tail.next = null;\n this.length--;\n if (this.length === 0) {\n this.head = null;\n this.tail = null;\n }\n return current;\n // console.log(current.val);\n // console.log(newTail.val);\n }", "title": "" }, { "docid": "0d52eefab4470bcea5a725d388b651e7", "score": "0.6684823", "text": "shift() {\r\n\t\tif(!this.head) { return undefined };\r\n\t\tlet currentHead = this.head;\r\n\t\tthis.head = currentHead.next;\r\n\t\tthis.length--;\r\n\t\t//for case where there was only 1 item\r\n\t\tif(this.length === 0) {\r\n\t\t\t//set head and tail back to null\r\n\t\t\tthis.head = null;\r\n\t\t\tthis.tail = null;\r\n\t\t}\r\n\t\treturn currentHead;\r\n\t}", "title": "" }, { "docid": "6b1b6b72df97e5aaf116ef9433123951", "score": "0.6680049", "text": "shift() {\n if (!this.length) throw new Error(\"List is empty...nothing to remove\");\n\n const remove = this.head;\n\n this.head = this.head.next;\n\n this.length -= 1;\n\n if (!this.length) this.tail = null;\n return remove.val;\n }", "title": "" }, { "docid": "f7a0020e5f5724e3103c4ce9f1212f1b", "score": "0.66724896", "text": "shift() {\n //if there are no nodes return undefined\n if (!this.head) return undefined;\n //store current head in a variable\n var removedHead = this.head;\n //set the current head to be the next current head\n this.head = removedHead.next;\n //decrease length\n this.length--;\n // check if length is 0 set tail to null\n if (this.length === 0) {\n this.tail = null;\n }\n return removedHead; //return the removed head\n }", "title": "" }, { "docid": "5fabc29db4ace63b2f5683ea7529a0a2", "score": "0.6670963", "text": "pop() {\n const deletedTail = this.tail;\n //eger listemiz bos ise null donderiyoruz.\n if (this.length === 0) return null;\n //eger listemizde tek deger varsa head ve tail'de o deger olacagi icin ikisindide null yapmaliyiz\n if (this.head === this.tail) {\n this.head = null;\n this.tail = null;\n\n return deletedTail;\n }\n //eger listemiz birden fazla node varsa.son dugum'den onceki icin \"next\" baglantisini silin\n let currentNode = this.head;\n //en son node'u bulmak icin next'i null olmayanlarin tumunu gezmek zorundayiz , yukarda'da dedigimiz gibi LinkedList'ler array'ler gibi degil bulmak ,silmek icin hepsini dolasman gerekiyor.\n while (currentNode.next != null) {\n //daha sonra son elemana ulasincaya kadar son next'leri currentNode'a atadi\n currentNode = currentNode.next;\n }\n this.tail = currentNode;\n this.length--;\n return deletedTail;\n }", "title": "" }, { "docid": "32a45be4b8e8f92ec743e54bc2826124", "score": "0.66693175", "text": "pop() {\n let current = this.head;\n let previous \n\n if (this.length === 0) {\n return null;\n }\n\n if (this.length === 1) {\n let last = this.head;\n this.head = null;\n this.next = null;\n this.length -= 1;\n return last;\n }\n\n while (current.next !== null) {\n previous = current;\n current = current.next;\n }\n previous.next = null;\n this.length -= 1;\n return current;\n }", "title": "" }, { "docid": "358b7c11d0d2134a1c271dcef37c1e3b", "score": "0.66602534", "text": "pop() {\n if (this.length === 0) {\n return console.log(\"The list is empty. Cannot pop()\");\n }\n else if (this.length === 1) {\n this.head = this.tail = null;\n }\n else {\n let nodeOneBeforeTail = this.head; // node one position before the tail\n\n while (nodeOneBeforeTail.next !== this.tail) {\n nodeOneBeforeTail = nodeOneBeforeTail.next;\n }\n\n nodeOneBeforeTail.next = null;\n this.tail = nodeOneBeforeTail;\n }\n this.length--;\n }", "title": "" }, { "docid": "e1ed0d56b6b5d5e742a8d86c74d1541c", "score": "0.6640124", "text": "pop(){\n // null check on head\n if(!this.head) return undefined;\n\n // set current and prev element to the head\n let current = this.head;\n let prev = current;\n\n // Loop until the end of the LL has been reached\n while(current.next){\n prev = current;\n current = current.next;\n }\n\n // Reasign LL's Tail to the second last item, instead of last item\n this.tail = prev;\n // After reassigning, remove the next from the last item\n this.tail.next = null;\n\n // decrement the length by 1\n this.length--;\n\n // check if only one element was there in the list\n if(this.length === 0){\n // If yes, then reset both the head and tail to nulll\n this.head = null;\n this.tail = null;\n }\n return current;\n\n }", "title": "" }, { "docid": "012e2fa996a57dec9758f06f61bc933c", "score": "0.66319245", "text": "pop() {\n assert(this.size > 0);\n\n const value = this.head.value;\n if (this.head === this.tail) {\n this.head = null;\n this.tail = null;\n } else {\n this.head = this.head.next;\n }\n\n this.size = this.size - 1;\n return value;\n }", "title": "" }, { "docid": "64426c32a4c0b55662f5b908bc255e64", "score": "0.6629907", "text": "static tail([, ...xs]) {\n return xs\n }", "title": "" }, { "docid": "2a33297ee8a5cbcb4a9f1053a5848644", "score": "0.66270286", "text": "shift(){\n if(!this.head) return undefined;\n let currentHead = this.head;\n this.head = currentHead.next;\n this.length--;\n if(this.length === 0){\n this.tail = null;\n }\n return currentHead;\n }", "title": "" }, { "docid": "6a08cd4f1395f978c5be2320ebaf194b", "score": "0.6624765", "text": "shift(){\n if (!this.head) {\n return undefined;\n }\n let currHead = this.head;\n this.head = currHead.next;\n this.length--;\n if (this.length === 0) {\n this.tail = null;\n }\n return currHead;\n }", "title": "" }, { "docid": "9590c89230f797a2e2462c44f584ebc6", "score": "0.66087425", "text": "shift() {\n if (!this.head) return undefined;\n\n let head = this.head;\n this.head = this.head.next;\n this.length--;\n\n if (this.length === 0) {\n this.tail = null;\n }\n return head;\n }", "title": "" }, { "docid": "c2f1ad20b37907ff87431fb416a81922", "score": "0.66001934", "text": "pop() {\n // pseudocode: no nodes in list, return undefined\n // loop through list until tail\n // set next prop of 2nd to last node to null\n // set tail to be 2nd to last node\n // decrement length of list by 1\n // return val of the node removed\n if (!this.head) return undefined;\n\n let current = this.head;\n let newTail = current;\n\n while (current.next) {\n newTail = current;\n current = current.next;\n }\n\n this.tail = newTail;\n this.tail.next = null;\n this.length--;\n\n if (this.length === 0) {\n this.head = null;\n this.tail = null;\n };\n\n return current;\n }", "title": "" }, { "docid": "34be832e1a9528f942fa974fc70ae4dd", "score": "0.6595772", "text": "shift() {\n if (this.head === null) {\n throw new Error(REMOVE_FROM_EMPTY_STRUCT);\n }\n const currentHead = this.head;\n this.head = currentHead.next;\n this.length--;\n if (this.length === 0) {\n this.tail = null;\n }\n }", "title": "" }, { "docid": "8891ea3b9936c836877a15d814d01ca3", "score": "0.65916455", "text": "pop(){\n //store the current tail\n let nodetoremove = this.tail;\n //if list is empty return undefine\n if(this.length===0)return undefined;\n //if list have only one element then set head and tail to null\n if(this.length==1){\n this.head=null;\n this.tail=null;\n }else{\n //update tail to last node's previous node { which is node-to-remove's previous nodes } \n this.tail=nodetoremove.prev;//this becomes current code\n //set current tail's next to null\n this.tail.next=null;\n //set node-to-remove {which is old tail} to null \n nodetoremove.prev=null;\n }\n //decreament the length and return the old tail's value\n this.length--;\n return nodetoremove.val\n }", "title": "" }, { "docid": "db32407b5fe56b604504780c0409dfea", "score": "0.65908545", "text": "shift() {\n if (!this.head) return undefined;\n let currentHead = this.head;\n this.head = currentHead.next;\n this.length--;\n if (this.length === 0) {\n this.tail = null;\n }\n return currentHead;\n }", "title": "" }, { "docid": "db32407b5fe56b604504780c0409dfea", "score": "0.65908545", "text": "shift() {\n if (!this.head) return undefined;\n let currentHead = this.head;\n this.head = currentHead.next;\n this.length--;\n if (this.length === 0) {\n this.tail = null;\n }\n return currentHead;\n }", "title": "" }, { "docid": "67706c1b9cc0b54968441263b87b4ab9", "score": "0.6589925", "text": "pop() {\n if (!this.first) return null; // if no first, then can't shift.\n\n let removedTop = this.first;\n // removedTop.next = null; garbage collecting in js cleans up, b/c old first will not be used.\n if (this.first === this.last) { // only 1 element left?\n this.last = null; // set last to null to avoid it being populated w/ last item\n }\n this.first = this.first.next; // set to null or next element\n this.size--;\n return removedTop;\n }", "title": "" }, { "docid": "c82d9e12ec4f9e1b8d1fe69d0404dc63", "score": "0.6587911", "text": "shift(){\n if(!this.head) return undefined;\n var currentHead = this.head;\n this.head = currentHead.next;\n this.length--;\n if(this.length === 0){\n this.tail = null;\n }\n return currentHead;\n }", "title": "" }, { "docid": "f7997a82b80af4e12bb96acf7c4e1496", "score": "0.65819246", "text": "shift(){\n if(!this.head){\n return undefined;\n }\n let oldHead = this.head;\n if(this.length === 1){\n this.head = null;\n this.tail = null;\n } else {\n this.head = oldHead.next;\n this.head.prev = null;\n oldHead.next = null;\n }\n this.length--;\n return oldHead;\n }", "title": "" }, { "docid": "3474dafc5c4e5539d5084cd2839867b2", "score": "0.65804726", "text": "pop() {\n //if the list is empty\n if (!this.head) return undefined;\n //we start from the head\n var current = this.head;\n var newTail = current;\n // while the next node is not null\n while (current.next !== null) {\n // new tail is assigned to the second to last\n // and current is assign to the next\n newTail = current;\n current = current.next;\n }\n //assign the tail to the new tail and the next is equal to null\n this.tail = newTail;\n this.tail.next = null;\n //decrease the length everytime delete a node\n this.length--;\n // to chekc once every node is deleted, head and tail equal empty list\n if (this.length === 0) {\n this.head = null;\n this.tail = null;\n }\n return current; //returns the deleted node\n }", "title": "" }, { "docid": "0cf5fc8220b1844e651ef7632c3b9cd9", "score": "0.6572933", "text": "shift() {\n if (this.length === 0) return new Error('Cannot remove element from empty list');\n \n let currentNode = this.head;\n\n if (currentNode.next === null) {\n this.tail = null;\n } \n this.head = currentNode.next;\n this.length--;\n return currentNode.val;\n }", "title": "" }, { "docid": "097b3732855ad9460886b553f040f69e", "score": "0.65686274", "text": "remove(index) {\n if (index < 0 || index >= this.length) return undefined;\n if (index === this.length - 1) return this.removeTail();\n if (index === 0) return this.removeTail();\n let prev = this.get(index - 1);\n let node = prev.next;\n prev.next = node.next;\n this.length--;\n return node;\n }", "title": "" }, { "docid": "038400b12114d49197053f80fb253921", "score": "0.65664434", "text": "pop(){\r\n if(!this.first) return null\r\n if(this.length === 1){\r\n this.first = null;\r\n this.last = null;\r\n }else{\r\n var removed = this.first\r\n this.first = this.first.next\r\n }\r\n this.length--\r\n return removed\r\n }", "title": "" }, { "docid": "f44a1a76983b3436b1f30b4cdfb17d5d", "score": "0.65664405", "text": "shift(){\n if(!this.head){\n return undefined;\n }\n var currentHead = this.head;\n this.head = currentHead.next;\n this.length --;\n if(this.length === 0){\n this.tail = null;\n }\n return currentHead;\n }", "title": "" }, { "docid": "4a497a80689e0c919dc7917bda5145c0", "score": "0.65651184", "text": "removeTail() {\n if (this.head === this.tail) {\n this.head = null;\n this.tail = null;\n return this;\n }\n let currentNode = this.head;\n while (currentNode && currentNode.next) {\n const inspectedNode = currentNode.next;\n if (!inspectedNode.next) {\n currentNode.next = null;\n this.tail = currentNode;\n }\n currentNode = currentNode.next;\n }\n return this;\n }", "title": "" }, { "docid": "921af631c4ed860238127b12977b713e", "score": "0.65637696", "text": "shift() {\n if (!this.head) {\n return null\n }\n\n const currentHead = this.head\n this.head = currentHead.next\n\n if (this.length === 0) {\n this.tail = null\n }\n\n this.length--\n return currentHead\n }", "title": "" }, { "docid": "e4fd00dbc7e771e450e0270b1f74add1", "score": "0.65614563", "text": "shift() {\n if (this.length === 0) {\n return undefined;\n }\n let oldHead = this.head;\n if (this.length === 1) {\n this.head = null;\n this.tail = null;\n } else {\n this.head = oldHead.next;\n this.head.prev = null;\n oldHead.next = null;\n }\n this.length--;\n return oldHead;\n }", "title": "" }, { "docid": "8febee01fdc75955613fcb6b9cb1880f", "score": "0.6557939", "text": "shift(){\n //store the current head node and store it as node-to-remove-start\n let nodetoremovestart = this.head;\n //if list is empty return undefine\n if(this.length===0)return undefined;\n //if list have only one element then set head and tail to null\n if(this.length==1){\n this.head=null;\n this.tail=null;\n }else{\n //update head node to node-to-remove-start's//first-node's next node {which is current head's next node} \n this.head=nodetoremovestart.next;\n //set current head prev t null\n this.head.prev=null;\n //set old head's next to null\n nodetoremovestart.next=null;\n }\n //decreament the length and return the old tail's value\n this.length--;\n return nodetoremovestart.val\n }", "title": "" }, { "docid": "68ce8a8543426953fe5d7982364068c9", "score": "0.6555842", "text": "deleteLastItem() {\n let temp = this.start;\n while (temp.next.next) {\n temp = temp.next;\n }\n temp.next = null;\n }", "title": "" }, { "docid": "a202cb859a29f16e4271ac987fafd9e4", "score": "0.6553318", "text": "pop() {\n // nothing in list\n if (this.head === null || this.tail === null) return null;\n else if (this.head === this.tail) {\n let val = this.head.val;\n this.head = null;\n this.tail = null;\n this.length--;\n return val;\n } else {\n let current = this.head;\n while (current.next.next !== null) {\n current = current.next;\n }\n this.tail = current;\n let val = this.tail.next.val;\n this.tail.next = null;\n this.length--;\n return val;\n }\n }", "title": "" }, { "docid": "16128ec14ad307318d68b345a886035d", "score": "0.655033", "text": "dequeue() {\n if (!this.first) throw new Error('Empty list!!!');\n const removeNode = this.first;\n if (removeNode === this.last) {\n this.last = null;\n }\n this.first = this.first.next;\n\n removeNode.next = null;\n this.length--;\n return removeNode;\n }", "title": "" }, { "docid": "435485b24847ba159a546e66adb70f90", "score": "0.6545104", "text": "pop() {\n if (!this.head) return null;\n\n const temp = this.head;\n if (this.head === this.tail) {\n this.tail = null;\n }\n\n this.head = this.head.next;\n this.count--;\n\n return temp.value;\n }", "title": "" }, { "docid": "62081e66716be110192cdd753dbb88a1", "score": "0.654363", "text": "_pop() {\n let temp = this.head;\n \n if(temp){\n this.head = this.head.next;\n\n this.length--;\n return temp.value;\n }\n\n return null;\n }", "title": "" }, { "docid": "0e61314d425c7a1d83da80e05c1dea54", "score": "0.6541836", "text": "shift() {\n if (!this.head) return undefined;\n let currentHead = this.head;\n if (this.length === 1) {\n this.head = null;\n this.tail = null;\n } else {\n this.head = currentHead.next;\n this.head.prev = null;\n currentHead.next = null;\n }\n this.length--;\n return currentHead;\n }", "title": "" }, { "docid": "f380a011e9325737980e918334d5a71d", "score": "0.6538976", "text": "pop () {\n let current = this.head;\n\n if (current === null) {\n return;\n } else {\n while (current.next) {\n current = current.next;\n }\n const previous = current.prev;\n previous.next = null;\n this.tail = previous;\n current.prev = null;\n }\n\n this.length -= 1;\n return current.val;\n }", "title": "" }, { "docid": "40cf04e1c33b61726a7aa7d2acedd602", "score": "0.65373003", "text": "pop() {\n if (!this.head) {\n return null;\n }\n var removed = this.head.value;\n this.head = this.head.next;\n this.length--;\n return removed;\n }", "title": "" }, { "docid": "5dbef553cd3b2447212e62db7f228ca0", "score": "0.6532185", "text": "pop() {\n if (this.length === 0) {\n return null;\n }\n\n if (this.length === 1) {\n const lastNode = this.tail;\n this.head = null;\n this.tail = null;\n this.length = 0;\n return lastNode;\n }\n\n const lastNode = this.tail;\n this.tail.prev.next = null;\n this.tail = this.tail.prev;\n this.length -= 1;\n lastNode.prev = null;\n return lastNode;\n }", "title": "" }, { "docid": "3392dababd932f73c78bdbbfab292c6d", "score": "0.6527349", "text": "function curtail(array) {\n array.shift();\n return array;\n}", "title": "" }, { "docid": "69610ea09641604ba851c126b01e76a5", "score": "0.6522881", "text": "pop() {\n if (!this.head) {\n return;\n } else if (this.head == this.tail) {\n this.head = this.tail = null;\n this.length = 0;\n return;\n }\n let secondLastNode = null;\n let currentNode = this.head;\n while (currentNode != this.tail) {\n secondLastNode = currentNode;\n currentNode = currentNode.next;\n }\n const temp = this.tail;\n secondLastNode.next = null;\n this.tail = secondLastNode;\n this.length -= 1;\n return temp;\n }", "title": "" }, { "docid": "e11acc0a259a1a63cf613a8a4c81571f", "score": "0.6521305", "text": "removeLast() {\n if (!this.head) return null;\n\n // when list is of length one(1)\n if (!this.head.next) {\n this.head = null;\n return;\n }\n\n let previousNode = this.head;\n let node = this.head.next;\n\n while (node.next) {\n previousNode = node;\n node = node.next;\n }\n\n previousNode.next = null;\n }", "title": "" }, { "docid": "a41a77fcd30e99a91126f7edb3a1f8cb", "score": "0.6520089", "text": "shift() {\n let oldHead;\n if (this.length === 0) {\n return undefined;\n } else if (this.length === 1) {\n oldHead = this.head;\n this.tail = null;\n this.head = null;\n } else {\n oldHead = this.head;\n oldHead.next = null;\n this.head = this.head.next;\n this.head.prev = null;\n }\n this.length--;\n return oldHead;\n }", "title": "" }, { "docid": "b0f55ed13c1d01f6d10ea3f60c10d103", "score": "0.6517543", "text": "shift() {\n //if there are no nodes return undefined\n //store the current head property in a variable\n //set the head property to be current head's next property\n //decrement the length by 1\n //return removed node\n if (!this.head) {\n return undefined;\n }\n let removedNode = this.head;\n this.head = removedNode.next;\n this.length--;\n if (this.length === 0) {\n this.tail = null;\n }\n return removedNode;\n }", "title": "" }, { "docid": "7cd0833620997fcf876442d2d71759f0", "score": "0.6512543", "text": "shift() {\n if (!this.length) return undefined;\n let oldHead = this.head;\n if (this.length === 1) {\n this.head = null;\n this.tail = null;\n } else {\n this.head = oldHead.next;\n this.head.prev = null;\n oldHead.next = null;\n }\n this.length--;\n return oldHead;\n }", "title": "" }, { "docid": "b11bf2c056afcb8f8f179eba13b371ce", "score": "0.6511077", "text": "pop() {\r\n\t\t//if the list is empty return nothing\r\n\t\tif(!this.head) { return undefined };\r\n\t\tlet poppedNode = this.tail\r\n\t\t//if you are popping the last item\r\n\t\tif(this.length === 1) {\r\n\t\t\t//set head and tail back to null\r\n\t\t\tthis.head = null;\r\n\t\t\tthis.tail = null;\r\n\t\t} else {\r\n\t\t\t//otherwise set the tail to the node before poppedNode\r\n\t\t\tthis.tail = poppedNode.previous;\r\n\t\t\t//set next on the tail and previous on the popped node to null\r\n\t\t\tthis.tail.next = null;\r\n\t\t\tpoppedNode.previous = null;\r\n\t\t}\r\n\t\t//decrement\r\n\t\tthis.length--;\r\n\t\treturn poppedNode;\r\n\t}", "title": "" }, { "docid": "9f38a427b14db5de8e262d481da6a434", "score": "0.65100497", "text": "shift() {\n if(this.length == 0) {\n return undefined;\n }\n let oldHead = this.head;\n if(this.length == 1) {\n this.head = null;\n this.tail = null;\n } else {\n this.head = oldHead.next;\n this.head.prev = null;\n oldHead.next = null;\n }\n this.length--;\n return oldHead;\n }", "title": "" }, { "docid": "0e38fb72cdf7a1084866361d6975ef30", "score": "0.6501243", "text": "pop(){\n if(this.size === 0){\n return null;\n }\n var temp = this.first;\n if(this.first === this.last){\n this.last = null;\n }\n this.first = this.first.next;\n this.size --;\n return temp.val();\n }", "title": "" }, { "docid": "332d7f63457d1dfb5528e129bc7dfa28", "score": "0.64924425", "text": "pop(){\n if(!this.head){\n return undefined;\n }\n var current = this.head;\n var newTail = current; \n //traverse while there is a node after the current one\n while(current.next){\n newTail = current;\n current = current.next;\n }\n console.log(current.val)\n console.log(newTail.val)\n\n this.tail = newTail;\n this.tail.next = null;\n this.length --;\n if(this.length === 0){\n this.head = null;\n this.tail = null;\n }\n return current; \n }", "title": "" }, { "docid": "ff31fb91d7ffe38b0392f5677dd6fa19", "score": "0.64915353", "text": "function tail(arr) {\n return (arr.length && arr[arr.length - 1]) || undefined;\n}", "title": "" }, { "docid": "d84aaa1a660e0d683df6e2dbd37b2e6c", "score": "0.64868337", "text": "function last(a) {\n return a.length > 0 ? a[a.length - 1] : null;\n }", "title": "" }, { "docid": "3205c9ad1caace7c9dde844d4bac8314", "score": "0.6486541", "text": "remove(index){\n if(index < 0 || index > this.length) return undefined;\n if (index === this.length - 1) return this.pop();\n if (index === 0) return this.shift();\n // let nodeBefore = this.get(index - 1);\n // let nodeAfterNext = this.get(index + 1);\n // let removedNode = nodeBefore.next;\n // nodeBefore.next = nodeAfterNext;\n var previousNode = this.get(index - 1);\n var remove = previousNode.next;\n previousNode.next = remove.next;\n this.length--;\n return remove;\n }", "title": "" } ]
d914ff425e65055c7b17a33c2fe197b8
check if quiz has ended
[ { "docid": "958fdb53bc52687c08cbcebc6c4e7fca", "score": "0.75451744", "text": "isEnded() {\n return this.questions.length === this.questionIndex;\n }", "title": "" } ]
[ { "docid": "495881ac4c2711094cbf4a8458226b2e", "score": "0.7524261", "text": "function checkQuizEnd() {\n $('body').on('click','#next-question', (e) => {\n STORE.currentQuestion === STORE.questions.length\n ? displayResults()\n : renderQuestion();\n });\n}", "title": "" }, { "docid": "d4948bb9ceefb552585de5952ab58d1e", "score": "0.7510983", "text": "function checkIfFinished(){\n console.log(\"QC first in checkFinished: \" +questionCounter);\n console.log(\"QC tQuestions: \" +((tQuestions.length) -1));\n console.log(\"Question:\" , tQuestions[questionCounter]);\n\n if(questionCounter == tQuestions.length){\n //if(questionCounter == ((tQuestions.length) -1)){\n console.log(\"Finished!\");\n //show the results.\n // $(\"#time\").empty();\n // $(\"#Correct\").empty();\n // $(\"#Wrong\").empty();\n // $(\"#MessageText\").html(\"Total correct: \" +correct +\"<br>\");\n }\n else{\n //show next question\n console.log(\"not finished yet!\");\n stopTimer();\n questionCounter ++;\n serveQuestion();\n console.log(\"QC when not finished: \" +questionCounter);\n console.log(\"QC tQuestions: \" +((tQuestions.length) -1));\n }\n}", "title": "" }, { "docid": "931c606368231ce9ac4e45f1d970eccf", "score": "0.74784595", "text": "function checkEnd(x) {\n var totalQuestion = quiz.length-1;\n if (totalQuestion == x) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "66b24ef1dd4d4323104c140663f853a6", "score": "0.743049", "text": "function end (){\n //console.log('end');\n if(questionIndex === nbaTrivia.length){\n gameEnd = true;\n }\n }", "title": "" }, { "docid": "1e3b9708f9e55d6b6a7dba88d7d3abc3", "score": "0.74120677", "text": "function checkGameEnd() {\n if (count === question.length) {\n $(\"#time-holder\").hide();\n showResults();\n count = 0;\n $(\".start\").show();\n $(\".start\").on(\"click\", function () {\n resetResults();\n startGame();\n });\n }\n }", "title": "" }, { "docid": "80d2c6efb2aa572dad973e48fd4507c2", "score": "0.73935145", "text": "function checkGameEnd() {\n if(count === question.length) {\n $(\"#time-holder\").hide();\n showResults();\n count = 0;\n $(\".start\").show();\n $(\".start\").on(\"click\", function() {\n resetResults();\n startGame();\n });\n }\n }", "title": "" }, { "docid": "80d2c6efb2aa572dad973e48fd4507c2", "score": "0.73935145", "text": "function checkGameEnd() {\n if(count === question.length) {\n $(\"#time-holder\").hide();\n showResults();\n count = 0;\n $(\".start\").show();\n $(\".start\").on(\"click\", function() {\n resetResults();\n startGame();\n });\n }\n }", "title": "" }, { "docid": "80d2c6efb2aa572dad973e48fd4507c2", "score": "0.73935145", "text": "function checkGameEnd() {\n if(count === question.length) {\n $(\"#time-holder\").hide();\n showResults();\n count = 0;\n $(\".start\").show();\n $(\".start\").on(\"click\", function() {\n resetResults();\n startGame();\n });\n }\n }", "title": "" }, { "docid": "80d2c6efb2aa572dad973e48fd4507c2", "score": "0.73935145", "text": "function checkGameEnd() {\n if(count === question.length) {\n $(\"#time-holder\").hide();\n showResults();\n count = 0;\n $(\".start\").show();\n $(\".start\").on(\"click\", function() {\n resetResults();\n startGame();\n });\n }\n }", "title": "" }, { "docid": "80d2c6efb2aa572dad973e48fd4507c2", "score": "0.73935145", "text": "function checkGameEnd() {\n if(count === question.length) {\n $(\"#time-holder\").hide();\n showResults();\n count = 0;\n $(\".start\").show();\n $(\".start\").on(\"click\", function() {\n resetResults();\n startGame();\n });\n }\n }", "title": "" }, { "docid": "39cb7112611def1f89077e64ee8e0459", "score": "0.73483706", "text": "function checkiflast() {\r\n console.log(questioncount, questions.length);\r\n if (questioncount == questions.length) {\r\n clearInterval(timerInterval);\r\n timeEl.textContent = \"End Quiz\"\r\n InputHighScore();\r\n }\r\n }", "title": "" }, { "docid": "6dc9a8f8294b631a94464cb1964faaec", "score": "0.71609056", "text": "function testFinished() {\n return questions.length < 1;\n // return 10 === 10; //just for testing results page, then remove \n}", "title": "" }, { "docid": "45ced250f06b818663646d7dfb913eb7", "score": "0.7093248", "text": "checkIfDone() {\n if (this.correctAnswerCount == 5) {\n // Mini game is won.\n console.log('WON');\n }\n\n if (this.correctAnswerCount + 2 <= this.gamesPlayedCount) {\n // Mini game id lost.\n console.log('LOST');\n }\n }", "title": "" }, { "docid": "45ced250f06b818663646d7dfb913eb7", "score": "0.7093248", "text": "checkIfDone() {\n if (this.correctAnswerCount == 5) {\n // Mini game is won.\n console.log('WON');\n }\n\n if (this.correctAnswerCount + 2 <= this.gamesPlayedCount) {\n // Mini game id lost.\n console.log('LOST');\n }\n }", "title": "" }, { "docid": "ffc3657dc367c8b67e9db18eea42db72", "score": "0.70666265", "text": "function nextQuestions(){\n console.log (\"Answer clicked: \" + this.value)\n console.log (\"Correct answer \" + quesArray[currentIndex].correct)\nif (this.value === quesArray[currentIndex].correct){\n scorestore += 5;\n score.textContent = \"Score: \"+ scorestore ;\n result.textContent = \"Correct\";\n}\nelse {\n secondsLeft -= 5;\n result.textContent = \"Wrong Answer\";\n};\n currentIndex++;\n console.log(currentIndex)\n//here are the condition which decides when quix ends\n if(quesArray.length === currentIndex || secondsLeft === 0 ){\n //Call the function to end the quiz\n secondsLeft = 0;\n sendMessage();\n }\n else{\n showQuestions();\n }\n}", "title": "" }, { "docid": "d1735a9ef455dd207bda5aeaad6f4e98", "score": "0.70574933", "text": "function next(){\r\n if(questionCounter === quiz.length){\r\n console.log(\"fin du quiz\");\r\n quizOver();\r\n }\r\n else{getNewQuestion();}\r\n}", "title": "" }, { "docid": "036226bc04f49c4eae4448dbeced2daa", "score": "0.69745415", "text": "function endQuiz() {\n clearInterval(timer);\n}", "title": "" }, { "docid": "aa1c7d6d20a0f010ea0e0eaadfad93b8", "score": "0.69305223", "text": "function isCourseCompleted() {\n if (noOfattempts == CHAPTER_TEST_PASSED)\n return true;\n else\n return false;\n}", "title": "" }, { "docid": "056d084ff54d757757304ec1956970f5", "score": "0.6910386", "text": "function endQuestion(){\n\tif (userChoice == allQuestions[questionNum].correctChoice){\n\t\t\t\t\ttotalCorrect++;\n\t\t\t\t\t$(\"#result\").text(\"Correct!\");\n\t\t\t\t\twinaudio.play();\n\t\t\t\t}else if (userChoice == -1){\n\t\t\t\t\tunanswered++;\n\t\t\t\t\tloseaudio.play();\n\t\t\t\t\t$(\"#result\").text(\"No Choice Made\");\n\t\t\t\t}else{\n\t\t\t\t\ttotalWrong++;\n\t\t\t\t\tloseaudio.play();\n\t\t\t\t\t$(\"#result\").text(\"Wrong!\");\n\t\t\t\t};\n\t\t\t\t$(\"#time\").text(0);\n\t\t\t\t$(\"#right\").text(totalCorrect);\n\t\t\t\t$(\"#wrong\").text(totalWrong);\n\t\t\t\t$(\"#unanswered\").text(unanswered);\n\t\t\t\tclearInterval(displayTime);\n\t\t\t\tdisplayTime = setTimeout(nextQuestion,1000);//delay before changing questions\n\t}", "title": "" }, { "docid": "31cc29c7606a7f7b637ab29d22eb8348", "score": "0.6897208", "text": "function askQuestion() {\n currentQuestion++;\n\n if (currentQuestion > finalQuestion) {\n endQuiz();\n return;\n }\n\n for (var qLoop = 0; qLoop <questions[currentQuestion].choices.length; qLoop++) {\n if ()\n }\n\n}", "title": "" }, { "docid": "64445fad9e3b74c817e475d993203691", "score": "0.68925506", "text": "gameFinished() {\n\t\treturn (this.masterAnswerArray.length == 0) ? true : false;\n\t}", "title": "" }, { "docid": "1e5c5bd433a3eef9a1975e0e2755f5f8", "score": "0.6876147", "text": "function endQuiz() {\n if (questionNumber >= 4 || countDown <= 0) {\n document.getElementById(\"quiz-questions\").classList.add(\"d-none\");\n document.getElementById(\"all-done\").classList.remove(\"d-none\");\n document.getElementById(\"quiz-time\").innerHTML = countDown + \"secs left\";\n document.getElementById(\"final-score\").innerHTML = countDown;\n\n clearInterval(quizTime);\n }\n\n}", "title": "" }, { "docid": "6b22d522b797d824852960ab68f0f09f", "score": "0.68597025", "text": "function checkQ() {\n clearQ();\n var correctAnswer = questions[questionCounter].choicesAnswer;\n if (userChoice[0] == questions[questionCounter].choicesAnswer) {\n $(\"#content\").html('<h1>' + \"Correct!!!\" + '</h1>');\n correct++;\n displayTimer();\n }\n else if (userChoice[0] === undefined) {\n $(\"#content\").html('<h1>' + \"Time's up!\" + '</h1><br><br><h3>' + \"The correct answer was: \" + questions[questionCounter].choices[correctAnswer] + '</h3>');\n missed++;\n displayTimer();\n }\n else {\n $(\"#content\").html('<h1>' + \"You chose the wrong answer.\" + '</h1><br><br><h3>' + \"The correct answer was: \" + questions[questionCounter].choices[correctAnswer] + '</h3>');\n incorrect++;\n displayTimer();\n };\n }", "title": "" }, { "docid": "090e70cd67fe59a7826eabdf977eb6b2", "score": "0.68356496", "text": "function checkGameEnd() {\n if(count === question.length) {\n $(\"#timeHolder\").hide();\n showResults();\n count = 0;\n $(\".start\").show();\n $(\".start\").on(\"click\", function() {\n resetResults();\n startGame();\n });\n }\n}", "title": "" }, { "docid": "ef9caee8c6e39ad16edecd72b63b4312", "score": "0.678679", "text": "function checkAnswer(answer){\n \n correct = quizQuestion[currentQuestionIndex] {\n if(answer ===correct && [currentQuestionIndex!==finalQuestionIndex]) {\n score++;\n alert(\"that is correct!\");\n currentQuestionIndex++;\n generatedQuizQuestion();\n //display results\n if ( answer == correct && currentQuestionIndex !==finalQuestionIndex);\n alert (\"that is correct\"); \n generatedQuizQuestion();\n\n }\n showscore();\n }\n }", "title": "" }, { "docid": "3c9fd767dd265609908ead6be24e61ac", "score": "0.67814106", "text": "isComplete () {\r\n return this.answers.size == this.questions.length\r\n }", "title": "" }, { "docid": "e055c68f6d4ea51c877cc8c24e072b5f", "score": "0.6777188", "text": "function checkAnswer(answer) {\n if(questions[runningQuestion].correct === answer) {\n // If answer is correct, increase score by 1 \n score++;\n console.log(score);\n correct();\n displayScore();\n } else {\n // If answer is wrong, subtract 9 seconds(+ 1 incremented by timer)\n incorrect(); \n timerCount -= 9;\n }\n // If not on the last question, move to the next question\n if (runningQuestion < lastQuestion) {\n count = 0; \n runningQuestion ++;\n askQuestion();\n // If on last question, end quiz \n } else {\n endQuiz();\n }\n }", "title": "" }, { "docid": "af72cc4d3535b5fc49dbe0a2e9cfe920", "score": "0.6751928", "text": "function checkAnswers(){\n \n //if using this function when the app is not in questionState\n if(currentState !== questionState){\n console.log(\"Not in questionState. Aborting\");\n return;\n }\n\n //if the user is still answering the questions and pressing the check button to early\n if(currentState == questionState && questionState.usersAnswers.length < questionList.length){\n questionState.messageDisplay.textContent = \"You must first complete the quiz before checking.\";\n return;\n }\n\n setCurrentState(resultState);\n\n displayResults();\n}", "title": "" }, { "docid": "c04e6427a8d9061725572c5dd22653ba", "score": "0.674671", "text": "function checkAnswer(answer){\n if( answer == questions[runningQuestion].correct){\n // answer is correct\n score++;\n // change progress color to green\n answerIsCorrect();\n }else{\n // answer is wrong\n // change progress color to red\n answerIsWrong();\n count-=5\n bleep.play();\n \n }\n if(runningQuestion < lastQuestion){\n runningQuestion++;\n renderQuestion();\n }else{\n // end the quiz and show the score\n clearInterval(TIMER);\n scoreRender();\n }\n}", "title": "" }, { "docid": "aef59fe9457abf31cf045a19274e3ea7", "score": "0.6743623", "text": "function finish(){\n\t\tif (done){\n\n\t\tfor (var i = 0; i < Trivia.questionList.length; i++){\n\t\t\t\t// capture the value of the clicked radio button\n\t\t\t\tvar selectedAnswer = $(\"input[name='qnum\" + i + \"']:checked\").val();\n\t\t\t\tselectedAnswer=parseInt(selectedAnswer);\n\t\t\t\t\tconsole.log(\"selected: \" + selectedAnswer);\n\t\t\t\t\tconsole.log(\"real answer: \" + Trivia.answers[i]);\n\t\t\t\t\t// sorts the answers into result catagories\n\t\t\t\t\tif (selectedAnswer>=0){\n\t\t\t\t\t\tif (selectedAnswer===Trivia.answers[i]){\n\t\t\t\t\t\t\tcorrect++;\n\t\t\t\t\t\t\tconsole.log(\"correct: \" + correct);\t\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tincorrect++;\n\t\t\t\t\t\t\tconsole.log(\"wrong: \" + incorrect);\n\t\t\t\t\t\t};\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\tunanswered++;\n\t\t\t\t\t\t\tconsole.log(\"not answered: \" + unanswered);\n\t\t\t\t\t};\t\n\t\t}; //done with question for loop'radio\" + i +\"'\n\n\t\treport();\n\t};\n\n}", "title": "" }, { "docid": "b851e4c9d7b548d83d930bed8d0fc94c", "score": "0.67260265", "text": "function checkAnswer(answer) {\n if (answer == currentQuizQuestions[runningQuestion].correct) {\n answerIsCorrect();\n } else {\n answerIsWrong();\n }\n if (runningQuestion < lastQuestion) {\n runningQuestion++;\n renderQuestion();\n } else {\n return window.location.assign('/JS-Quiz/end.html');\n }\n}", "title": "" }, { "docid": "e6ebfa651cbae4d136868e87fa2403ab", "score": "0.67213964", "text": "function checkAnswer(){\n\tclearInterval(timer);\n\tvar playerAnswerIndex = $(this).attr(\"answerIndex\");\n\n\tif(playerAnswerIndex==questions[currentQuestionIndex].qCorrectIndex){\n\t\ttotalCorrectAnswers++;\n\t\tafterCorrectAnswer();\n\t}else{\n\t\ttotalWrongAnswers++;\n\t\tafterWrongAnswer();\n\t}\n}", "title": "" }, { "docid": "f0fd7a828f3f539cb54f3774f5980669", "score": "0.6704946", "text": "function endQuiz(condition) {\n\n // stop timer\n clearInterval(timer);\n\n // set high score if applicable\n if (curTime > results.highScore) {\n results.highScore = curTime\n\n initialsEl.setAttribute(\"Style\",\"display:block;\")\n\n }\n\n setScoreboard();\n\n gameState = false;\n\n changeCover(condition)\n \n // Display cover-page over play area until new game\n coverPage.setAttribute(\"Style\",\"visibility:visible;\")\n\n}", "title": "" }, { "docid": "773861f85c6bd149a300ed04d9939d56", "score": "0.6680529", "text": "function checkAnswer() {\n var answer = event.target.id;\n\n // the answer is the same as the correctAnswer\n if (answer === questions[questionProgressIndex].correctAnswer) {\n answerIsCorrect();\n }\n else {\n answerIsWrong();\n }\n if (questionProgressIndex < questions.length - 1) {\n questionProgressIndex++;\n quizQuestions();\n }\n else {\n gameOver();\n $quizTitleEl.textContent = \"\";\n $quizDisplay.textContent = \"\";\n $quizTimerEl.textContent = \"\";\n\n }\n}", "title": "" }, { "docid": "e2acaf16e405ee86857b47a3228cb55c", "score": "0.6676632", "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 }\n\n else if (answer !== correct && currentQuestionIndex !== finalQuestionIndex){\n alert(\"That is incorrect.\")\n currentQuestionIndex++;\n generateQuizQuestion();\n }\n\n else{\n showScore();\n }\n\n}", "title": "" }, { "docid": "3a243c594dc1f68537deddaaea6d4765", "score": "0.6664177", "text": "function loopQuestions() {\n currentQuestion++;\n\n if (currentQuestion < finalQuestion) {\n endQuiz();\n return;\n } \n}", "title": "" }, { "docid": "a8d1719948a7ae573a44688f00e23f78", "score": "0.6661801", "text": "function quizEnd() {\n // stop the tipe\n clearInterval(timerId);\n\n // show the final screen, let the questions go away\n var endScreenEl = document.getElementById(\"end-screen\");\n endScreenEl.removeAttribute(\"class\");\n\n // lets show the final score\n var finalScoreEl = document.getElementById(\"fscore\");\n finalScoreEl.textContent = time;\n\n // hideing the question section\n questionsEl.setAttribute(\"class\", \"hide\");\n}", "title": "" }, { "docid": "892dd93cf2ae5905aaf17dfd12d0d88d", "score": "0.6657489", "text": "function checkAnswer(answer) {\n if (answer == quizContent[currentQuestion].answer) {\n score++;\n } \n\n if (currentQuestion < lastQuestion) {\n currentQuestion++;\n showQuiz();\n } else {\n endQuiz();\n }\n}", "title": "" }, { "docid": "8f39d8a0404c6f9907a9703692fb16fc", "score": "0.6656867", "text": "function checkAnswer(answer) {\n if( answer === questions[runningQuestion].correct) {\n score++; //if the answer is correct this adds a point to the score\n answerIsCorrect();\n console.log(\"answer was correct\");\n }else{\n answerIsWrong();\n console.log(\"answer was wrong\");\n \n }\n count = 0;\n if(runningQuestion < lastQuestion) {\n runningQuestion++;\n renderQuestion();\n console.log(\"new question appears\")\n }else{\n // this ends the quiz and shows the final score\n clearInterval(TIMER);\n scoreRender();\n }\n}", "title": "" }, { "docid": "f2a56818226a49d0a0c0a48a689ed482", "score": "0.6647201", "text": "function gameStatus() {\n\tif (currentQuestion < (questions.length)-1) {\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "792179cfc0d5a9a10d533df6e386dfde", "score": "0.6642896", "text": "function showQuizFinalResults(){\n\t\t\n\t}", "title": "" }, { "docid": "22d50359116777b1a76c5a514c111339", "score": "0.66400456", "text": "function checkIfCorrect() {\n\n console.log(this.value, \"was clicked\");\n console.log(\"clicked on an answer!\")\n\n questions[index].correctAnswer;\n if (this.value !== questions[index].correctAnswer) {\n \n // reduce time from timer and subtract points \n time = time - 10;\n highScore -= 10;\n console.log (highScore);\n // update the new time on the screen\n seconds.textContent = time;\n// else - user got it correct\n \n } else {\n alert (\"Correct\") \n \n }\n \n\n index++\n console.log(\"index is\", index);\n\n if (index === questions.length) {\n seconds <= 0 \n clearInterval (timer);\n alert (\"Game Over\")\n alert (`Your Final Score is ${highScore}`);\n prompt (\" Enter your Score \") \n prompt (\" Enter your Initials \") \n\n\n localStorage.setItem ('initials', initials);\n localStorage.setItem ('highScore', highScore);\n}\n displayQuestions();\n// trying to get quiz to start again automatically \n return start;\n}", "title": "" }, { "docid": "a18b39b9708acac5388f52bbc1052b5b", "score": "0.6624418", "text": "quizEnd() {\n $(\"#nextButton\").remove(); //remove next button element\n $(\"#current-Q\").remove(); //remove current question element\n $(\".current-O\").remove(); //remove current options element\n\n //display how many correct answers you got. Both in 'correct'/'total' and 'percentageCorrect%'\n $(\"#title-header\").text(`You got ${this.correctAnswers} out of ${this.numOfQs + 1} questions correct. (${Math.floor((this.correctAnswers/(this.numOfQs + 1) * 100))}%)`);\n\n //display button for selecting a new quiz\n $(\"#quizlet\").append(`\n <div id=\"score\">\n <a href=\"#\" class=\"btn btn-primary\" id=\"newQuiz\">Select new quiz</a>\n </div>\n `);\n\n $(\"#newQuiz\").click(() => { //listens when the menu button is clicked, then runs resetQuiz function\n resetQuiz(this.userAge);\n });\n }", "title": "" }, { "docid": "d0d262ae94f3347db3d550b91c2254c0", "score": "0.66228557", "text": "checkAnswer() {\n\n\t\t\tif (this.selectedAnswer == this.answer) {\n\n\t\t\t\tthis.answerState = 'correct';\n\n\t\t\t\tif ( this.step === this.$parent.totalTabs ) {\n\t\t\t\t\tthis.nextStep()\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// Random error message from list\n\t\t\t\tthis.errorMessage = this.errorMessageList[Math.floor(Math.random() * this.errorMessageList.length)];\n\n\t\t\t\tthis.answerState = 'wrong';\n\n\t\t\t\tthis.failedAttempts++;\n\n\t\t\t\tvar self = this;\n\t\t\t\tself.hasError = 'has-error';\n\t\t\t\tsetTimeout(function () { self.hasError = ''; }, 1000);\n\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "b91c60dad3f707100d6e948478b07344", "score": "0.6621771", "text": "function areWeDoneYet () {\n\tif (currentQuestionIndex === (listOfQuestions.length)) {\n\t\tsetTimeout (function() {allDone()}, 6500);\t\n\t}\n\telse {\n\t\tsetTimeout(function () { \n\t\t\tshowQuestion(listOfQuestions[currentQuestionIndex])}, 6500);\n\t};\n}", "title": "" }, { "docid": "f913a8f1d50d9e912ec1977d4bf2488e", "score": "0.6618811", "text": "function checkProgress(){\n if (currentIndex < questionsArray.length){\n renderQuestions()\n } else {\n endQuiz()\n }\n }", "title": "" }, { "docid": "aa22eeda9b65267888f31879af6bf1bc", "score": "0.66123825", "text": "function endQuiz() {\n let score = updateScore(\"done\");\n console.log(`Hooray! You've finished the quiz.\n Your score is ${score}%.`);\n}", "title": "" }, { "docid": "836f218c8d3d8998af63e8a53a8da99d", "score": "0.66064864", "text": "function checkAnswer(answer){\n correct = quizQuestions[currentQuestion].correctAnswer;\n\n if (answer === correct && currentQuestion !== finalQuestion){\n score1++;\n alert(\"That Is Correct!\");\n currentQuestion++;\n generateQuizQuestion();\n //display in the results div that the answer is correct.\n }else if (answer !== correct && currentQuestion !== finalQuestion){\n alert(\"That Is Incorrect.\");\n currentQuestion++;\n generateQuizQuestion();\n //display in the results div that the answer is wrong.\n }else{\n showScore();\n }\n}", "title": "" }, { "docid": "9b974dac800509500085298b1d6d6a49", "score": "0.6603974", "text": "function restartTimeorEndQuiz() {\n // checking to see if we're on the last question, if so end game & hide questions\n if (myQs.length == currentquestion) {\n $(\"#timeRR\").text(\"Time's up\");\n showResults();\n clearInterval(timeTicker);\n $(\"#quiz\").hide();\n } else {\n //if myQs is not at last questions goes => to next guestion\n setQuestion(currentquestion);\n timeleft = 15;\n }\n}", "title": "" }, { "docid": "8ccf3930fd9c7402f4380d3a0cbea84d", "score": "0.6597993", "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 (\n answer !== correct &&\n currentQuestionIndex !== finalQuestionIndex\n ) {\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": "476eea55cab6f97e1707800c6f19b6c6", "score": "0.6596733", "text": "function checkAnswer(currentQuestion) {\n console.log(\"checking answer...\");\n var isCorrect;\n for (let i = 0; i < radioListEl.length; i++) {\n if (radioListEl[i].is(\":checked\") && questions[currentQuestion].answer[i].isCorrect) {\n correctAlertEl.show(); \n return;\n } else if (radioListEl[i].is(\":checked\") && !questions[currentQuestion].answer[i].isCorrect) {\n incorrectAlertEl.show();\n isCorrect = false;\n }\n }\n if (!isCorrect && timeLeft > TIME_INTERVAL){\n removeTime();\n } else if(!isCorrect){\n timeLeft = 0;\n }\n}", "title": "" }, { "docid": "a1788f547fccf2cdc7ecd4413ccaad76", "score": "0.6596295", "text": "function checkAnswer(clickedAnswer){\n if (clickedAnswer == shuffledQuestions[currentQuestionIndex].answer){\n console.log('Correct!')\n score++\n questionNumber++\n changeStatus()\n } else {\n console.log('Incorrect')\n incorrectQuestions++\n changeStatus()\n } \n count = 0\n if (currentQuestionIndex < finalQuestionIndex){\n currentQuestionIndex++\n renderQuestion()\n } else{\n console.log('Quiz over! Do something else')\n gameOverScreen()\n clearInterval(timer)\n }\n \n}", "title": "" }, { "docid": "18ff559b956fe8bfe32342eb4ec016c8", "score": "0.6595655", "text": "function checkAnswer(answer){\n correct = quizQuestions[currentQuestionIndex].correctAnswer;\n\n if (answer === correct && currentQuestionIndex !== finalQuestionIndex){\n score++;\n \n currentQuestionIndex++;\n generateQuizQuestion();\n //display in the results div that the answer is correct.\n }else if (answer !== correct && currentQuestionIndex !== finalQuestionIndex){\n \n currentQuestionIndex++;\n generateQuizQuestion();\n //display in the results div that the answer is wrong.\n }else{\n showScore();\n }\n}", "title": "" }, { "docid": "4bb2e3a46b70fc281cb04676ca87cec6", "score": "0.65955454", "text": "function validateAnswer() {\n if (this.value === questions[questionCount].correct) {\n counter += 10;\n\n } else {\n counter -= 10;\n }\n\n\n // Move to Next Question or End Quiz\n // Source: https://codepen.io/boopalan002/pen/yKZVGa\n questionCount++;\n if (questionCount === questions.length) {\n endQuiz();\n } else {\n displayQuestions();\n }\n}", "title": "" }, { "docid": "2381f9dbc39be16cc880f3a59236157c", "score": "0.65934795", "text": "function checkLength() {\n if (questionNumber === qArray.length || scoreTimer < 0) {\n allDone();\n clearInterval(scoreTimer);\n } else {\n currentQuestion();\n }\n\n}", "title": "" }, { "docid": "b062e4feb8adf678fd03919332581c15", "score": "0.6577966", "text": "function HasEnded() : boolean\n{\n\treturn (currentlySpeakingLine == crDialogue.gkNone);\n}", "title": "" }, { "docid": "6478c84bb65863daf77b30aba89f9bff", "score": "0.65696186", "text": "function checkround() {\n console.log(\"next card\");\n console.log(\"Index:\"+ currentQuest);\n //check if you can go to the next card\n showQuestion();\n //check if you are done (index location vs the length of the array)\n //endQuiz();\n}", "title": "" }, { "docid": "be66c4040b31332f7933de333a0558a8", "score": "0.6567022", "text": "function quizEnd() {\n // Stop timer\n clearInterval(timerId);\n \n // Display quiz finish\n var quizFin = document.getElementById(\"quizFin\");\n quizFin.removeAttribute(\"class\");\n \n // Display final score\n var finalScoreEl = document.getElementById(\"final-score\");\n finalScoreEl.textContent = startScore;\n \n // hide questions section\n quizQuestions.setAttribute(\"class\", \"hide\");\n}", "title": "" }, { "docid": "6955d9b6ae3261991cb87d0fdc3e1ce4", "score": "0.6565004", "text": "checkAnswer() {\n if (this.answerChosen === this.currentQuestion.answer) {\n this.correctCount++;\n console.log(this.correctCount);\n this.displayQuestionResults(this.currentQuestion, 0);\n } else {\n this.displayQuestionResults(this.currentQuestion, 1);\n }\n }", "title": "" }, { "docid": "2194d4c1ce414a39a542308961f2382c", "score": "0.65448046", "text": "function quizGame () {\n // if statement that checks if quiz at end\n if (questionNum >= questions.length) {\n endQuiz();\n score = timer;\n scoreDisplay.innerHTML = score;\n clearInterval(timerInterval);\n }\n else{\n questionPrompt.innerHTML = questions[questionNum].title;\n choice1.innerHTML = questions[questionNum].choices[0];\n choice2.innerHTML = questions[questionNum].choices[1];\n choice3.innerHTML = questions[questionNum].choices[2];\n choice4.innerHTML = questions[questionNum].choices[3];\n answerPrompt.innerHTML = \"\";\n }\n}", "title": "" }, { "docid": "8f43e26665318731140306608cca5d08", "score": "0.65270424", "text": "function check(){\n \n var question1 = document.quiz.question1.value;\n\tvar question2 = document.quiz.question2.value;\n\tvar question3 = document.quiz.question3.value;\n\tvar correct = 0;\n \n\n\n\n\tif (question1 == \"Ignores the statement\") {\n\t\tcorrect++;\n}\n\tif (question2 == \"declaration statements\") {\n\t\tcorrect++;\n}\t\n\tif (question3 == \"Function/Method\") {\n\t\tcorrect++;\n\t}\n\t\n\n\n\tif (correct == 0) {\n\t\tscore = 2;\n\t}\n\n\tif (correct > 0 && correct < 3) {\n\t\tscore = 1;\n\t}\n\n\tif (correct == 3) {\n\t\tscore = 0;\n\t}\n\t\n\n// start quiz with timer and set up questions\nfunction startQuiz() {\n introEl.style.display = \"none\";\n questionsEl.style.display = \"block\";\n questionCount = 0;\n\n}\n \n\n\t}", "title": "" }, { "docid": "f82fd5b9f61cf8fe5e2caeaf36d1ab62", "score": "0.6522147", "text": "hasEnded() {\n return false;\n }", "title": "" }, { "docid": "2fe9518bf2d37b51c16d1c08c076610e", "score": "0.6519597", "text": "function answerQuestion(answer) {\n if (answer === questions[questionNum].correct_answer) {\n score ++;\n alert(\"Correct! And Black Jesus smiled!\");\n } else {\n quizTime -= 10;\n alert(\"Incorrect! My ancestors weep...\");\n }\n\n\n // Makes sure each question continues to pop up dynamically.\n questionNum ++;\n\n\n // triggers end quiz function if user completes quiz question or time runs out\n if (questionNum === questions.length) {\n endQuiz()\n } else {\n renderQuestion()\n }\n}", "title": "" }, { "docid": "2bd31cc6825eae641971ff188308c2bb", "score": "0.65084726", "text": "function selectAnswer(k) {\n console.log(\"selectAnswers\")\n //evaluate \n //if they are not at the end of the questions then display next question\n if (currentQuest < 4) {\n console.log (\"next question please\");\n nextQuestion();\n }\n //if at last question display end quiz\n else {\n endQuiz()\n displayScore();\n }\n //if time is up\n //if not go to next question\n //else endGame\n}", "title": "" }, { "docid": "598e5446843a164079a1bc2f65ff0a50", "score": "0.6507066", "text": "function endQuiz() {\n currentHighScore = (numCorrectAnswers * startTime)\n // User will be taken to screen to enter initials\n createEnterName()\n // Clears the timer\n clearInterval(myTimer)\n}", "title": "" }, { "docid": "f83185f13f302515fab0d1005c9d500f", "score": "0.65051275", "text": "function commenceQuiz() {\n startQuiz();\n renderQuestion();\n userSelectAnswer();\n renderNextQuestion();\n}", "title": "" }, { "docid": "274d9c6f9c73b2006ed13d1378a93d24", "score": "0.65003896", "text": "function QuizNextQuestion() {\n\tif ((QuizTimer >= QuizBetweenQuestionTimer) && (QuizBetweenQuestionTimer > 0)) {\n\t\tif ((QuizProgressLeft >= QuizGoal) || (QuizProgressRight >= QuizGoal)) QuizEnded = true;\n\t\tQuizTimer = QuizOtherQuestionTime * -1;\n\t\tQuizAnswerText = \"\";\n\t\tQuizAnswerBy = \"\";\n\t\tQuizBetweenQuestionTimer = 0;\n\t\tQuizAnswer = null;\n\t\tQuizImageActionActorLeader = \"\";\n\t\tQuizRightActorAnswerTimer = 0;\n\t}\t\n}", "title": "" }, { "docid": "27c23781620d166f188e2cb76ff5bd21", "score": "0.64893705", "text": "function nextQuestion(){\n const questionOver = (triviaQuestions.length -1) === currentQuestion;\n if (questionOver){\n console.log('end of question');\n displayResult();\n } \n \n else {\n currentQuestion++;\n loadQuestion();\n }\n}", "title": "" }, { "docid": "59db19b312be133f25639e15b9c037b4", "score": "0.6474723", "text": "function checkAnswer(event) {\n event.preventDefault();\n if (event.target.matches(\"button.answer\")) {\n if (\n event.target.textContent ===\n quizQuestions[questionNumber].answer[\n quizQuestions[questionNumber].correct\n ]\n ) { \n // if answer is correct do nothing\n //TO DO make a correct section\n // console.log(\"correct\");\n } else { // if answer is incorrect subtract time\n //TO DO make a incorrect.\n timeRemaining = timeRemaining - 10;\n // console.log(\"not correct\");\n }\n // if we have reached the end of the game run endgame else iterate question numbers.\n if (quizQuestions[questionNumber + 1] === undefined) {\n // console.log(quizQuestions.length);\n endgame();\n } else {\n questionNumber++;\n clearingElements();\n }\n }\n}", "title": "" }, { "docid": "00ef0119b766697a240771e942be9d9d", "score": "0.64602953", "text": "function finishQuiz()\n {\n $(\"#main-question\").addClass(\"hide\");\n $(\"#final-screen\").removeClass(\"hide\");\n $(\"#score\").text(secondElapsed);\n }", "title": "" }, { "docid": "818d31d3a8303ce0042ce7800cc6a32c", "score": "0.64593494", "text": "function checkAnswer() {\n //make sure there's no refresh due to the form\n event.preventDefault();\n //compare answer to corect answer value, if correct move on\n if (parseInt(event.target.getAttribute(\"data-index\")) === questionSet[questionSetIndex].correctAnswer) {\n questionSetIndex++;\n }\n\n //if not correct, move on but with 10 less seconds\n else {\n time = time - 10;\n questionSetIndex++;\n }\n //remove buttons so new buttons can have space to themselves\n buttonGroupEl.innerHTML = \"\";\n\n //when you reach the end of the questions or if there's no time remaining, the game is over\n if (questionSetIndex === questionSet.length || time == 0) {\n return end();\n }\n //shows new set of questions if there's more to go\n displayQuestions()\n}", "title": "" }, { "docid": "45a12de7f735722ca5230849ba5dea27", "score": "0.64579934", "text": "function checkAnswer(question, answer) {\n console.log(\"Question : \", question);\n console.log(\"Answer : \", answer);\n var correctAnswer = questions[question].answer;\n var userAnswer = questions[question].choices[answer];\n if (correctAnswer === userAnswer) {\n questionNumber = questionNumber + 1;\n console.log(score);\n console.log(\"Correct\");\n }\n\n //else if answer is wrong, program deducts 15 secs from the quiz clock\n\n else {\n questionNumber = questionNumber + 1;\n countDown = countDown - 15;\n score = score - 15;\n console.log(\"Next question : \", questionNumber);\n console.log(\"Incorrect\");\n }\n\n clearQuestionDiv();\n renderQuestions();\n endQuiz();\n}", "title": "" }, { "docid": "eacfbc8f37fd5e3846d7cfc7e5536770", "score": "0.6456805", "text": "function endQuiz() {\n if (index === questions.length) {\n highScoreContainer.classList.remove(\"hide\");\n finalScore.textContent = \"Final Score: \" + score;\n container.classList.add(\"hide\");\n count = 0;\n //this stops the alert from happening\n alert = function(){};\n }\n}", "title": "" }, { "docid": "ec5be6747185a522a37d522aede5596b", "score": "0.64537954", "text": "function quizEnd() {\n // stop timer\n clearInterval(timerId);\n \n // show end screen\n var highscoreSectionEl = document.querySelector(\"#highscore-section\");\n highscoreSectionEl.setAttribute(\"class\", \"show\");\n \n // show final score\n var finalScoreEl = document.querySelector(\"#final-score\");\n finalScoreEl.textContent = time;\n \n // hide questions section\n quizScreen.setAttribute(\"class\", \"hide\");\n }", "title": "" }, { "docid": "20628168a7c9b11bc5ab93d2a61dcc28", "score": "0.6452513", "text": "function ifAnswerIsCorrect () {\n userAnswerFeedbackCorrect();\n updateScore();\n }", "title": "" }, { "docid": "f4fecc72868c9c89edcff170fa893880", "score": "0.64494574", "text": "function endQuiz(){\n $('.answer').css('display', 'none');\n $('.score').html(STORE.correctAnswers +' out of 5');\n $('.quiz-end').css('display', 'block');\n\n $('#retry').click(function(event){\n $(this).closest('section').css('display', 'none');\n resetFontSizeAndMargin();\n resetValues();\n });\n}", "title": "" }, { "docid": "69081ec895366beacb8f85eee51f8818", "score": "0.6447036", "text": "function checkQuestion(){\n if (this.textContent === questArr[questI].answer) {\n questI++\n if (questI === questArr.length) {\n Over()\n } else {\n nextQuestion()\n }\n } else {\n wrongEl.textContent = 'Wrong, try again!'\n if (time <= 10) {\n time = 0\n timerEl.textContent = 0\n Over()\n } else {\n time -= 10\n }\n }\n}", "title": "" }, { "docid": "fc90e9075f44597f2e3fe23392b8b575", "score": "0.6445853", "text": "function eval(event){\n event.preventDefault();\n\n if(event.target.textContent === questions[currentQuestionIndex].answer){\n msg.textContent = \"Correct\"; \n currentQuestionIndex++;\n if (currentQuestionIndex < questions.length){\n getCurrentQuestion();\n } else {\n endQuiz()\n }\n \n } else {\n \n time = time - 15;\n msg.textContent = \"Incorrect\"; \n currentQuestionIndex++;\n if (currentQuestionIndex < questions.length){\n getCurrentQuestion();\n } else {\n endQuiz()\n }\n }\n }", "title": "" }, { "docid": "957391a9395095035a6d84ad81b9ea07", "score": "0.6441875", "text": "function ans(answer){\n correct = questions[qIndex].answer\n if(answer === correct && qIndex !== endIndex){\n score++;\n alert(\"You got that RIGHT!!\");\n qIndex++;\n qVisible();\n } else if (answer !== correct && qIndex !== endIndex){\n alert(\"You got that WRONG!\");\n qIndex++;\n qVisible();\n } else{scoreVis();}\n}", "title": "" }, { "docid": "21c1208a772969062b8bbea91a452b3e", "score": "0.6438378", "text": "function continueGame() {\n //get next question or stop game if no more questions left\n if(Game.questionNumber < TriviaQuestion.question.length -1){\n Game.nextQuestion();\n } else {\n Game.stopTimer();\n setTimeout(showFinalResults, 2000);\n } \n}", "title": "" }, { "docid": "1e5305e7a86b6b649277e606c0bf9706", "score": "0.6437766", "text": "function handleQuiz() {\n startQuiz();\n runNextQuestion();\n}", "title": "" }, { "docid": "f9e6bddbe789d0e4b890df8c59347ddd", "score": "0.6430427", "text": "function validateAnswer() {\n let choice = event.target\n\n if (choice.innerHTML === firstQ.answer) {\n result.textContent = \"Correct!\"\n validateTimer();\n display(secondQ);\n }\n if (choice.innerHTML === secondQ.answer) {\n result.textContent = \"Correct!\"\n validateTimer();\n display(thirdQ);\n }\n if (choice.innerHTML === thirdQ.answer) {\n result.textContent = \"Correct!\"\n validateTimer();\n display(fourthQ);\n }\n if (choice.innerHTML === fourthQ.answer) {\n result.textContent = \"Correct!\"\n validateTimer();\n toHighScores();\n }\n}", "title": "" }, { "docid": "4f76faf69c8fc8c21d0363eac1b6a2e3", "score": "0.6421809", "text": "function checkAnswer(answer) {\n if (answer == questions[runningQuestion].correctAnswer) {\n // answer is correct\n answerIsCorrect();\n score++;\n } else {\n // answer is incorrect\n answerIsIncorrect();\n alert(`Sorry you got it wrong! The correct answer is ${questions[runningQuestion].correctAnswer}`);\n }\n if (runningQuestion <= lastQuestion) {\n runningQuestion++;\n increment();\n renderQuestion();\n }\n}", "title": "" }, { "docid": "2189768c5535ced301d938ef44fcde94", "score": "0.64154994", "text": "function checkQuiz(event){\n if(event.target.matches(\"button\")){\n var buttonId = event.target.getAttribute(\"id\")\n if(questions[questionsIndex].choices[buttonId] === questions[questionsIndex].answer){\n HighScoreScore += 5;\n showRandWContainer()\n YourRight();\n setTimeFor();\n nextQuestion();\n } else {\n HighScoreScore -= 2;\n secondsLeft -= 3;\n showRandWContainer();\n YourWrong();\n setTimeFor();\n nextQuestion();\n }\n }\n}", "title": "" }, { "docid": "9fb1aec8d5f6925f522a762a92a9b0bc", "score": "0.641361", "text": "function questionClicked(){\n if(this.value !== questions[questionIdx].correctAnswer){\n secondsLeft = secondsLeft -15\n if(secondsLeft < 0 ){\n secondsLeft = 0\n }\n timeEl.textContent = secondsLeft\n feedBackEl.textContent = \"You chose wrong!\"\n } else {\n feedBackEl.textContent = \"You got it right!\"\n }\n questionIdx++\n if(questionIdx === questions.length){\n endQuiz()\n } else {\n displayQuestion()\n\n }\n\n}", "title": "" }, { "docid": "de8013082a73b7996f189a28bd8966b2", "score": "0.6409888", "text": "function checkAnswer() {\n var answer = $('input[type=radio]:checked').val();\n console.log('answer', answer);\n if (answer === questions[index].answer) {\n // alert('Right');\n index++;\n correctAnswer++;\n setTimeout(showMeQuestion, 2000);\n \n } else if (answer === undefined) {\n // alert('Not Answered');\n index++;\n unanswered++;\n setTimeout(showMeQuestion, 2000);\n \n } else {\n // alert ('Wrong');\n index++;\n incorrectAnswer++;\n setTimeout(showMeQuestion, 2000);\n }\n }", "title": "" }, { "docid": "313563ce6e91b5a656a2c88cbceaa611", "score": "0.64015496", "text": "function runQuiz() {\n if (!quiz.end()) {\n const currentQuestion = quiz.getQuestions();\n const quesOptions = quiz.getOptions();\n\n if (!currentQuestion.inputQuestion) {\n if (question && category) {\n question.innerHTML = currentQuestion.text;\n category.innerHTML = `Category: ${currentQuestion.category}`;\n }\n if (quesOptions) {\n for (let index = 0; index < quesOptions.length; index += 1) {\n if (questionText && radioBtns) {\n questionText[index].innerHTML = quesOptions[index].option;\n radioBtns[index].setAttribute('value', questionText[index].innerHTML);\n radioBtns[index].setAttribute('correct', quesOptions[index].correct);\n }\n }\n }\n if (currentQuestion.isCheckInput) {\n if (oneAnswerQuestions && multiAnsQuestion) {\n oneAnswerQuestions.classList.remove('active');\n multiAnsQuestion.classList.add('active');\n }\n if (multiQuestion) {\n multiQuestion.innerHTML = `${currentQuestion.text} *select two answers`;\n multiCategory.innerHTML = `Category: ${currentQuestion.category}`;\n }\n if (multiOption && checkBox) {\n for (let i = 0; i < multiOption.length; i += 1) {\n multiOption[i].innerHTML = quesOptions[i].option;\n checkBox[i].setAttribute('value', multiOption[i].innerHTML);\n checkBox[i].setAttribute('correct', quesOptions[i].correct);\n }\n }\n }\n } else if (currentQuestion.inputQuestion) {\n if (multiAnsQuestion && inputQuestion) {\n multiAnsQuestion.classList.remove('active');\n inputQuestions.classList.add('active');\n inputQuestion.innerHTML = currentQuestion.text;\n }\n if (inputCategory && answerInput) {\n inputCategory.innerHTML = `Category: ${currentQuestion.category}`;\n answerInput.setAttribute('data', currentQuestion.answer);\n }\n }\n } else {\n quizResults();\n }\n }", "title": "" }, { "docid": "c2838405c8126d689947666fc98cf9fd", "score": "0.6398361", "text": "function checkAnswer(answer) {\n if (questions[runningQuestionIndex].correct == answer) {\n answerIsCorrect();\n } else {\n answerIsWrong();\n }\n // This if statement will render a new question after the previous one was answered, and will clearInterval(timeLeft) after the last question has been answered.\n if (runningQuestionIndex < lastQuestionIndex) {\n runningQuestionIndex++;\n renderQuestion();\n } else {\n clearInterval(timeLeft);\n // This will then trigger the end screen, which will display your score as the remaining time.\n questionContainer.classList.add(\"hide\");\n questionContainer.classList.remove(\"show\");\n choices.classList.add(\"hide\");\n choices.classList.remove(\"show\");\n ending.classList.add(\"show\");\n ending.classList.remove(\"hide\");\n score.innerHTML = timeLeft;\n timer.classList.add(\"hide\");\n timer.classList.remove(\"show\");\n }\n}", "title": "" }, { "docid": "4355b57b056adf224b4507ff55c46374", "score": "0.6396355", "text": "function checkAnswer(event) {\n event.preventDefault();\n\n var answer = event.currentTarget.dataset.answer;\n var correctAnswer = null;\n\n if (quizQuestions[questionIndex].correct === answer) {\n correctAnswer = answer;\n }\n if (answer === correctAnswer) {\n answerResponse.textContent = \"Correct!\"; // If correct, say correct\n } else {\n answerResponse.textContent = \"Wrong!\"; // If wrong, say wrong & deduct 10 points\n secondsLeft -= 10\n if (secondsLeft < 0) {\n secondsLeft = 0;\n }\n }\n if (quizQuestions.length === questionIndex+1) {\n showFinalScore(); // If it has gone through all questions, show final score\n return; // If not, print the next question\n }\n questionIndex++;\n showQuestions();\n}", "title": "" }, { "docid": "4761fdaebf3f46dcb152b1247065eb01", "score": "0.63769126", "text": "function startQuiz () {\n clearContents(); \n \n \n\n //Starts the clock\n countdown();\n \n //Get a new question\n getQ(i);\n \n\n}", "title": "" }, { "docid": "6b3a3e8805ca9551cf9fbedbd46cb92c", "score": "0.6373161", "text": "function checkSucess() {\n setTimeout(function() {\n if (recordingSaved && promptFinished && answered) {\n done();\n } else {\n checkSucess();\n }\n }, asyncDelay);\n }", "title": "" }, { "docid": "2da8deed5a449af8dcd03565bb443eab", "score": "0.6370162", "text": "function runQuiz() {\n timer = setInterval(function() {\n timerCount--;\n secondsEl.textContent = timerCount;\n\n //quiz logic\n if (timerCount > 0) {\n\n changeElementVisibility(startBtn, \"none\");\n //if quiz is completed...\n if (questionNumber > questions.length)\n {\n clearInterval(timer);\n finishedQuiz = true; \n timerCount = 40;\n changeElementVisibility(startBtn, \"block\");\n endQuiz();\n }\n }\n\n //if time runs out...\n if (timerCount <= 0) {\n clearInterval(timer);\n changeElementVisibility(startBtn, \"block\"); \n endQuiz(); \n }\n }, 1000);\n\n changeElementVisibility(coverContainer, \"block\");\n}", "title": "" }, { "docid": "08646e588524654780155490ae5b9481", "score": "0.6363029", "text": "function ifAnswerIsCorrect() {\n console.log('ifAnswerIsCorrect ran');\n userAnswerFeedbackCorrect();\n updateScore();\n}", "title": "" }, { "docid": "505d991f066674f608f49d0d1b7d2e90", "score": "0.6356939", "text": "function evaluateAnswer(num) {\n //Check to see if the answer that the user clicked is equal to the correct answer\n if (currentQuestion.correctAnswer === num) {\n answerDispEl.innerHTML = \"Right\";\n answerDispEl.style.display = 'flex';\n }\n else {\n answerDispEl.innerHTML = \"Wrong\";\n timer = timer - 10;\n answerDispEl.style.display = 'flex';\n }\n //Check to see if the end of the quiz was reached, if it was set the score as the timer and display the final score\n currQuesNum++;\n if ((currQuesNum + 1) > questions.length) {\n finished = true;\n score = timer;\n quizConEl.style.display = 'none';\n finalScoreEl.innerHTML = \"Your final score is \" + score;\n rresultsDispEl.style.display = 'flex';\n }\n else {\n displayQuestion(currQuesNum);\n }\n}", "title": "" }, { "docid": "6aba8dca52654783f65d95f8a530aac6", "score": "0.6345899", "text": "function check() {\n\t// Check if you're at the last index of the question array\n\tif(questionNumber>9) {\n\t\t// Stop the timer (this may be need extraneous code)\n\t\tstop();\n\t\t// Empty out Divs for questions and answers and time\n\t\t$(\"#display\").empty();\n\t\t$(\"#question\").empty();\n\t\t$(\".answer\").empty();\n\t\t$(\"#message\").empty();\n\t\t// Record results\n\t\t$(\"#results\").html(\"<h1> Correct: \" + wins + \"</h1> <h1> Incorrect: \" + losses + \"</h1> <h1> Unanswered: \" + unanswered + \"</h1>\");\n\t\t// Show button to restart the game\n\t\t$(\"#restart\").html('<button type=\"button\" class=\"btn btn-default\">PLAY AGAIN!</button>');\n\t}\n\telse {\n\t\t// show the next question\n\t\tstart();\n\t};\n}", "title": "" }, { "docid": "fd383d645a0602ee3966bc7bdf664746", "score": "0.63206005", "text": "function endQuiz(){\n clearInterval(myVar);\n $('#explanation').empty();\n $('#question').empty();\n $('#choice-block').empty();\n $('#submitbutton').remove();\n document.getElementById(\"progressBar\").style.display = \"none\";\n document.getElementById(\"secBar\").style.display = \"none\";\n $('#question').text(\"Hai risposto correttamente a \" + score + \" domande su \" + quiz.length + \".\");\n $(document.createElement('h2')).css({'text-align':'center', 'font-size':'2em'}).text('Hai totalizzato ' + totalScore + ' punti').insertAfter('#question');\n createScoreBoard();\n }", "title": "" }, { "docid": "d979f72860b7e7e1dba2f860c674f1c7", "score": "0.631393", "text": "function checkAnswer(answer){\n if(answer == questions[runningQ].correct){\n score++; // correct answer selected\n answerIsCorrect();\n }else{\n answerIsWrong();\n }\n\n count = 0;\n if(runningQ < lastQ){\n runningQ++;\n makeQuestion();\n }else{\n clearInterval(TIMER);\n message();\n makeScore();\n restartGame();\n restart.addEventListener(\"click\", clickFunction);\n }\n}", "title": "" }, { "docid": "38c7ae7af3a722889e65df39ea016076", "score": "0.63114476", "text": "async function verifyAnswers() {\n // quiz modal is only dismissed when an answer is selected\n if (selectedAnswer) {\n setQuizLoading(true);\n // if the answer is correct\n if (selectedAnswer === ad.correctAnswer) {\n let userRefreshed = await user.refreshCustomData();\n await user.functions.confirmView(ad, userRefreshed);\n userRefreshed = await user.refreshCustomData();\n } else {\n // setting the ad to null allows the hook to catch that the ad has changed\n setAdvertisement(null);\n }\n // if there is another ad for the user to watch\n let advert = await getAdvert();\n // dismisses quiz modal\n setActivation(false);\n // clears previous quiz answer\n setAnswer(\"\");\n } else {\n }\n setQuizLoading(false);\n }", "title": "" }, { "docid": "dca8c46830e9c19923f6ab76af4921d3", "score": "0.6309119", "text": "function endQuiz() {\n startScreen.setAttribute(\"class\", \"hidden\");\n questionsEl.setAttribute(\"class\", \"hidden\");\n endSection.setAttribute(\"class\", \"visible\");\n \n score.textContent = time;\n}", "title": "" }, { "docid": "c61612757f28c32c24fd1d0afbf7c4b5", "score": "0.63056576", "text": "isFinished () {\n if(this.guesses===0||this.currentWord.isGuessed()===true){\n return true;\n\n }\n\n else {\n return false;\n }\n\n }", "title": "" } ]
bf040ef55814dd9703d279a8b5b6f9a6
Given a DOM node, return the closest ReactDOMComponent or ReactDOMTextComponent instance ancestor.
[ { "docid": "f533a3e28befce94feff334e5c712660", "score": "0.72556543", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n }", "title": "" } ]
[ { "docid": "8a373da0e0bd6f7fe31e93117fccae55", "score": "0.73706234", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}return null;}", "title": "" }, { "docid": "8a373da0e0bd6f7fe31e93117fccae55", "score": "0.73706234", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}return null;}", "title": "" }, { "docid": "8a373da0e0bd6f7fe31e93117fccae55", "score": "0.73706234", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}return null;}", "title": "" }, { "docid": "8a373da0e0bd6f7fe31e93117fccae55", "score": "0.73706234", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}return null;}", "title": "" }, { "docid": "8a373da0e0bd6f7fe31e93117fccae55", "score": "0.73706234", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}return null;}", "title": "" }, { "docid": "8a373da0e0bd6f7fe31e93117fccae55", "score": "0.73706234", "text": "function getClosestInstanceFromNode(node){if(node[internalInstanceKey]){return node[internalInstanceKey];}while(!node[internalInstanceKey]){if(node.parentNode){node=node.parentNode;}else{// Top of the tree. This node must not be part of a React tree (or is\n// unmounted, potentially).\nreturn null;}}var inst=node[internalInstanceKey];if(inst.tag===HostComponent||inst.tag===HostText){// In Fiber, this will always be the deepest root.\nreturn inst;}return null;}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.7323335", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.7323335", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.7323335", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.7323335", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.7323335", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.7323335", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.7323335", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.7323335", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.7323335", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.7323335", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.7323335", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.7323335", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.7323335", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.7323335", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.7323335", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.7323335", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.7323335", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.7323335", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.7323335", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "1d9714f4d7d57cbd57f3e4a3542c1458", "score": "0.7323335", "text": "function findFirstReactDOMImpl(node) {\n // This node might be from another React instance, so we make sure not to\n // examine the node cache here\n for (; node && node.parentNode !== node; node = node.parentNode) {\n if (node.nodeType !== 1) {\n // Not a DOMElement, therefore not a React component\n continue;\n }\n var nodeID = internalGetID(node);\n if (!nodeID) {\n continue;\n }\n var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n // If containersByReactRootID contains the container we find by crawling up\n // the tree, we know that this instance of React rendered the node.\n // nb. isValid's strategy (with containsNode) does not work because render\n // trees may be nested and we don't want a false positive in that case.\n var current = node;\n var lastID;\n do {\n lastID = internalGetID(current);\n current = current.parentNode;\n if (current == null) {\n // The passed-in node has been detached from the container it was\n // originally rendered into.\n return null;\n }\n } while (lastID !== reactRootID);\n\n if (current === containersByReactRootID[reactRootID]) {\n return node;\n }\n }\n return null;\n}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.7307373", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.7307373", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.7307373", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.7307373", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.7307373", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.7307373", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.7307373", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.7307373", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.7307373", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.7307373", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.7307373", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "f89ef561ec099592b712eb17b9343150", "score": "0.7307373", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "045b45faa52e352bb1f3c03033c009d2", "score": "0.72971565", "text": "function getClosestComponentAncestor(node) {\n while (node.tNode.type === 2 /* View */) {\n node = node.view[HOST_NODE];\n }\n return node;\n}", "title": "" }, { "docid": "861264ad4cba036c96a58355f3cbd216", "score": "0.7286882", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return react_dom__WEBPACK_IMPORTED_MODULE_0___default.a.findDOMNode(node);\n}", "title": "" }, { "docid": "861264ad4cba036c96a58355f3cbd216", "score": "0.7286882", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return react_dom__WEBPACK_IMPORTED_MODULE_0___default.a.findDOMNode(node);\n}", "title": "" }, { "docid": "04882e702fc575e9afc80ea8481b4bd1", "score": "0.7281424", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n \n return react_dom__WEBPACK_IMPORTED_MODULE_0___default.a.findDOMNode(node);\n }", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.72788703", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.72788703", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.72788703", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.72788703", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.72788703", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.72788703", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "2b48938d20e511b1edd95bfb89f49309", "score": "0.72788703", "text": "function findFirstReactDOMImpl(node) {\n\t // This node might be from another React instance, so we make sure not to\n\t // examine the node cache here\n\t for (; node && node.parentNode !== node; node = node.parentNode) {\n\t if (node.nodeType !== 1) {\n\t // Not a DOMElement, therefore not a React component\n\t continue;\n\t }\n\t var nodeID = internalGetID(node);\n\t if (!nodeID) {\n\t continue;\n\t }\n\t var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(nodeID);\n\t\n\t // If containersByReactRootID contains the container we find by crawling up\n\t // the tree, we know that this instance of React rendered the node.\n\t // nb. isValid's strategy (with containsNode) does not work because render\n\t // trees may be nested and we don't want a false positive in that case.\n\t var current = node;\n\t var lastID;\n\t do {\n\t lastID = internalGetID(current);\n\t current = current.parentNode;\n\t if (current == null) {\n\t // The passed-in node has been detached from the container it was\n\t // originally rendered into.\n\t return null;\n\t }\n\t } while (lastID !== reactRootID);\n\t\n\t if (current === containersByReactRootID[reactRootID]) {\n\t return node;\n\t }\n\t }\n\t return null;\n\t}", "title": "" }, { "docid": "86e2e644ec53d43740b33cc4a83ed598", "score": "0.7267499", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n }", "title": "" }, { "docid": "86e2e644ec53d43740b33cc4a83ed598", "score": "0.7267499", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n }", "title": "" }, { "docid": "86e2e644ec53d43740b33cc4a83ed598", "score": "0.7267499", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n }", "title": "" }, { "docid": "86e2e644ec53d43740b33cc4a83ed598", "score": "0.7267499", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n }", "title": "" }, { "docid": "86e2e644ec53d43740b33cc4a83ed598", "score": "0.7267499", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n }", "title": "" }, { "docid": "86e2e644ec53d43740b33cc4a83ed598", "score": "0.7267499", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n }", "title": "" }, { "docid": "8ca66858f1b1da2c7e6f8ca41f4b025d", "score": "0.7260928", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return ReactDOM.findDOMNode(node);\n}", "title": "" }, { "docid": "dee16e862fd25d2f09efd12277dc97b1", "score": "0.7252802", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return react_dom__WEBPACK_IMPORTED_MODULE_0__.findDOMNode(node);\n}", "title": "" }, { "docid": "dee16e862fd25d2f09efd12277dc97b1", "score": "0.7252802", "text": "function findDOMNode(node) {\n if (node instanceof HTMLElement) {\n return node;\n }\n\n return react_dom__WEBPACK_IMPORTED_MODULE_0__.findDOMNode(node);\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" }, { "docid": "d3d2268be248cf3b1adbbe919af05aab", "score": "0.7227193", "text": "function getClosestInstanceFromNode(node) {\n if (node[internalInstanceKey]) {\n return node[internalInstanceKey];\n }\n\n while (!node[internalInstanceKey]) {\n if (node.parentNode) {\n node = node.parentNode;\n } else {\n // Top of the tree. This node must not be part of a React tree (or is\n // unmounted, potentially).\n return null;\n }\n }\n\n var inst = node[internalInstanceKey];\n if (inst.tag === HostComponent || inst.tag === HostText) {\n // In Fiber, this will always be the deepest root.\n return inst;\n }\n\n return null;\n}", "title": "" } ]
42979de8e1b467d016e6ce689f1b6912
mostrar imagem no cadastro
[ { "docid": "2ace3700b20ba40b49fced4addb07e2a", "score": "0.0", "text": "function readURL(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n\n reader.onload = function (e) {\n document.getElementById(\"preview\").setAttribute(\"src\", String(e.target.result));\n }\n\n reader.readAsDataURL(input.files[0]);\n }\n}", "title": "" } ]
[ { "docid": "68cd2c718accc0d1f7a245f7723dbce8", "score": "0.7457788", "text": "function carregarImagem( img ){\n \n var caminho = img.substr(61);\n \n \n carregar = new Image();\n carregar.src = \"/gestaoativos/fwk/uploadsEquipamentos/imagens\" + caminho;\n \n document.getElementById(\"imagemView\").innerHTML = \"Carregando...\";\n setTimeout( \"verificaCarregamento()\", 1 );\n}", "title": "" }, { "docid": "8b5602017c5c73dd41bc8b44c9134e03", "score": "0.7150688", "text": "function mostrarImagen(input) { \n if (input.files && input.files[0]) {  \n var reader = new FileReader();  \n reader.onload = function(e) {    $('#img_destino').attr('src', e.target.result);   }  \n reader.readAsDataURL(input.files[0]); \n }\n}", "title": "" }, { "docid": "16d6f84ce4efb626f514ef1443cc8e27", "score": "0.7058911", "text": "function mostrarImagen (e) {\n //Convertimos el id a int\n const id = parseInt( e.target.dataset.imagenId )\n\n //Genera la img\n const imagen = document.createElement('img');\n imagen.src = `./assets/img/grande/${id}.png`;\n\n const overlay = document.createElement('div');\n overlay.appendChild(imagen);\n overlay.classList.add('overlay');\n \n //Boton para cerrar imagen\n const cerrarImg = document.createElement('p');\n cerrarImg.textContent = 'X';\n cerrarImg.classList.add('btnCerrar');\n\n //Cuando se da click se cierra img\n overlay.onclick = function(){\n overlay.remove();\n body.classList.remove('fijar-body');\n }\n \n //cuando se presiona se cierra la img\n cerrarImg.onclick = function(){\n overlay.remove();\n body.classList.remove('fijar-body');\n }\n\n overlay.appendChild(cerrarImg);\n\n //Mostrar en el HTML\n const body = document.querySelector('body');\n body.appendChild(overlay);\n\n body.classList.add('fijar-body');\n}", "title": "" }, { "docid": "90cf6507b1234826efb3fcc8f0e3c716", "score": "0.7014167", "text": "function visualizarImg() {\n\t var preview = document.querySelectorAll('img').item(1);\n\t var file = document.querySelector('input[type=file]').files[0];\n\t var reader = new FileReader();\n\n\t reader.onloadend = function () {\n\t preview.src = reader.result;// carrega em base64 a img\n\t };\n\n\t if (file) {\n\t reader.readAsDataURL(file);\t\t \n\t } else {\n\t preview.src = \"\";\n\t }\n\t \n}", "title": "" }, { "docid": "519dec8a4de266188bb3ab32c7813659", "score": "0.6910971", "text": "function exibeCaminhoImagem(resposta) {\n\tdocument.getElementById(\"imagemSelecionada\").value = resposta[\"caminho\"];\n}", "title": "" }, { "docid": "6b4543e09e1e5b5b96a9d2b08f964698", "score": "0.6800041", "text": "function mostrarImagen(imagenId) {\n const imagen = document.createElement('PICTURE');\n imagen.innerHTML = `\n <source srcset=\"build/img/grande/${imagenId}.avif\" type=\"image/avif\">\n <source srcset=\"build/img/grande/${imagenId}.webp\" type=\"imagen/webp\">\n <img loading=\"lazy\" width=\"200\" height=\"300\" src=\"build/img/grande/${imagenId}.jpg\" alt=\"imagenes galeria\">\n `;\n\n //creando overlay con la imagen\n const overlay = document.createElement('DIV');\n overlay.appendChild(imagen);\n overlay.classList.add('overlay');\n //cerrando desde el overlay, osea dando click sobre la imagen\n overlay.onclick = function () {\n const body = document.querySelector('body');\n body.classList.remove('fijar-body');\n overlay.remove();\n }\n\n //boton para cerrar el modal (ventana modal)\n const cerrarImagen = document.createElement('P');\n cerrarImagen.textContent = 'X';\n cerrarImagen.classList.add('btn-cerrar');\n cerrarImagen.addEventListener('click', function () {\n const body = document.querySelector('body');\n body.classList.remove('fijar-body');\n overlay.remove();\n\n });\n overlay.appendChild(cerrarImagen);\n\n //añadiendo overlay al html\n const body = document.querySelector('body');\n body.appendChild(overlay);\n body.classList.add('fijar-body');\n}", "title": "" }, { "docid": "19f0af9227c8e76176745f65e6396929", "score": "0.67166233", "text": "function showImg(foto){\n globalPic = foto.files[0];\n\t\n\tpic.src =window.URL.createObjectURL(globalPic);\n}", "title": "" }, { "docid": "67229cf0f52e49e06bc7fb55efd2d9c8", "score": "0.6659977", "text": "function img(ref){ return pack_grafico + \"img/\" + idioma + \"/\" + ref; }", "title": "" }, { "docid": "e17b51ecb998a0657ecb94c3279f9ac5", "score": "0.66522676", "text": "function suivante(){\n if(index < diaporama.length -1){\n //Ici je ne suis pas a la dernier image\n index++;\n }else{\n //Ici je suis à la dernier image\n index = 0;\n }\n let image = document.getElementById(\"image\");\n image.src = diaporama[index];\n }", "title": "" }, { "docid": "a8ec4925de7409d399ed7646d954c875", "score": "0.6627136", "text": "function drawImage(editor) {\n var cm = editor.codemirror;\n var imgLink = ''; //最后获取到的图片地址\n var _fileName = ''; //图片的文件名\n var _isFull = document.isfullScreen || document.mozFullScreen || document.webkitIsFullScreen;\n function insertPic() {\n var startCursor = cm.getCursor('from'); //光标位置\n var endCursor = cm.getCursor('to'); //选择结束位置\n var selectText = cm.getSelection() || _fileName; //当前选中的文本\n var lastLine = cm.getLine(cm.lineCount() - 1); //最后一行的内容\n var reg = /^\\s*\\[(\\d+)\\]:/; //获取最后一行计数值的正则\n var regResult = reg.exec(lastLine); //缓存正则结果\n var i = 1; //计数默认为1\n var replaceText = '![' + selectText + ']' + '[' + i + ']';\n var tailText = '\\n\\n [' + i + ']: ' + imgLink; //最后追加\n if (regResult) { //有插入过链接或图片\n i = parseInt(regResult[1]) + 1;\n tailText = '\\n [' + i + ']: ' + imgLink; //默认追加\n replaceText = '![' + selectText + ']' + '[' + i + ']';\n }\n // 插入text\n cm.replaceSelection(replaceText);\n var content = cm.getValue();\n cm.setValue(content + tailText);\n sfModal('hide');\n cm.focus();\n if(!selectText) {\n cm.setCursor({\n line: startCursor.line,\n ch: startCursor.ch + 2\n });\n } else {\n cm.setSelection({\n line: startCursor.line,\n ch: startCursor.ch + 2\n },{\n line: endCursor.line,\n ch: endCursor.ch + 2\n });\n }\n }\n sfModal({\n title: '插入图片',\n content: '<ul class=\"nav nav-tabs\" role=\"tablist\">\\\n<li class=\"active\"><a href=\"#localPic\" role=\"tab\" data-toggle=\"tab\">本地上传</a></li>\\\n<li><a href=\"#remotePic\" role=\"tab\" data-toggle=\"tab\">远程地址获取</a></li>\\\n</ul>\\\n<div class=\"tab-content\">\\\n<div class=\"tab-pane fade in active pt20 form-horizontal\" id=\"localPic\">\\\n <span class=\"text-muted\">图片体积不得大于 4 MB</span>\\\n <br>\\\n <div class=\"widget-upload form-group\">\\\n <input type=\"file\" id=\"editorUpload\" name=\"image\" class=\"widget-upload__file\">\\\n <div class=\"col-sm-8\">\\\n <input type=\"text\" id=\"fileName\" class=\"form-control col-sm-10 widget-upload__text\" placeholder=\"拖动图片到这里\" readonly />\\\n </div>\\\n <a href=\"javascript:void(0);\" class=\"btn col-sm-2 btn-default\">选择图片</a>\\\n </div>\\\n</div>\\\n<div class=\"tab-pane fade pt20\" id=\"remotePic\">\\\n<input type=\"url\" name=\"img\" id=\"remotePicUrl\" class=\"form-control text-28\" placeholder=\"请输入图片所在网址\">\\\n</div>\\\n</div>',\n closeText: '取消',\n doneText: '插入',\n wrapper: _isFull ? '.editor' : null,\n show: function() {\n // fileupload\n $('#editorUpload').fileUpload({\n url: 'http://api.t.sina.com.cn/statuses/upload',\n type: 'POST',\n dataType: 'text',\n beforeSend: function() {\n // 下面这句神奇的话会影响到拖动图片上传的成功与否,有待研究\n // 这句话在拖动图片上传时会报错,但是不影响功能。任何修改都有很大可能导致此功能失败。\n _fileName = $('#editorUpload').val()\n .split('akepath')[1].slice(1);\n //\n $('#fileName').val(_fileName).addClass('loading');\n $('.done-btn').attr('disabled', 'disabled');\n },\n complete: function () {\n $('#fileName').removeClass('loading');\n $('.done-btn').attr('disabled', false).click();\n },\n success: function (result) {\n var status = result.match(/\\[(\\d),/)[1];\n var data = result.match(/\\[\\d,\"(\\S*)\"\\]/)[1];\n if(status !== '0') {\n sfModal(eval('\"' + data + '\"')); // 坏味道 用于转义\n } else {\n data = data.replace(/\\\\/g, '');\n imgLink = data;\n }\n }\n });\n },\n doneFn: function(e) {\n e.preventDefault();\n //远程图片\n if($('#remotePic').hasClass('active') && $('#remotePicUrl').val()) {\n $('#remotePicUrl').addClass('loading');\n $('.done-btn').attr('disabled', 'disabled');\n imgLink = $('#remotePicUrl').val();\n insertPic();\n } else {\n insertPic();\n }\n }\n });\n}", "title": "" }, { "docid": "b332ff27a7eb815238cb88131d8530f2", "score": "0.6606255", "text": "function dibujar(){ \n if(fondo.cargaOK == true){\n lapiz.drawImage(fondo.imagen,0,0);\n };\n dibujarMatriz();\n if(cuchillo.cargaOK == true){\n lapiz.drawImage(cuchillo.imagen,x,y);\n }\n}", "title": "" }, { "docid": "a8ed6babf350ebb2473a74d41c879d92", "score": "0.6564793", "text": "function mostrarDados(){\r\n let numerosJugada=miJugada.crearJugada();\r\n let numeroObjetivoValor=miJugada.crearObjetivoValor(); \r\n document.getElementById(\"botonJugar\").disabled=true;\r\n document.getElementById(\"numIntentos\").innerHTML=miJugada.numIntentos;\r\n for (let i=1;i<6;i++){\r\n\r\n document.getElementById(\"valor\" + i).innerHTML=\"resultado: \" + numerosJugada[i-1];\r\n document.getElementById(\"dado\" + i).src = \"dados/\" + i + numerosJugada[i-1] + \".png\"; \r\n }\r\n document.getElementById(\"valorDadoObjetivo\").innerHTML = \"objetivo: \" + numeroObjetivoValor;\r\n document.getElementById(\"dadoObjetivo\").src = \"dados/dadoBlanco\" + numeroObjetivoValor + \".png\";\r\n }", "title": "" }, { "docid": "824297bc2f6b3d7988e6da5f017135f1", "score": "0.65487707", "text": "function siguiente() {\n \n document.getElementById(\"imagen\").src=imagenes[2];\n}", "title": "" }, { "docid": "f3f1794c20c291f6bc679a9796c70931", "score": "0.65483844", "text": "function principio() {\n \n document.getElementById(\"imagen\").src=imagenes[0];\n}", "title": "" }, { "docid": "fc99858036ee755acb2b267e2c1201cf", "score": "0.65449053", "text": "function cargarListaImagenes(lista, padre) {\n \n /*var abramovich = [\"abramovich\", \"img/abramovic.jpg\"];\nvar dali = [\"dali\", \"img/dali.jpg\"];\nvar leparc = [\"leparc\", \"img/leparc.jpg\"];\nvar influencias = [abramovich, dali, leparc];\n;*/\n\n for (var i = 0; i < lista.length; i++) {\n var img = document.createElement('img');\n padre.appendChild(img);\n img.src = lista[i][1];\n }\n amigosDiv= document.getElementById('amigos');\n}", "title": "" }, { "docid": "22bd5505d8d464576f0d5622ec9be828", "score": "0.6534721", "text": "function renderImg() {\r\n if (!complaints.image) return reclamos;\r\n else return URL.createObjectURL(complaints.image);\r\n }", "title": "" }, { "docid": "295d370dfd08aed90bd860172ddf4256", "score": "0.6523594", "text": "function mostrar_imagen_portapeles(tabla){\n \tvar contenedor=document.getElementById(\"imagen_pegar\");\n\t\t//contenedor.innerHTML= '<img src=\"../imagenes/cargando8.gif\">'; // width=\"30\" height=\"30\"\n\t\n\t\tvar ajax=nuevoAjax();\t\t\t\t// creo una instancia de ajax\n\t\tmetodo=\"POST\";\t\t\t\t\t\t// asigno las variables de proceso\n\t\turl=\"mostrar_imagen_portapeles.php?\";\n\t\tvariables=\"tabla=\"+tabla;\n\t\t//alert(variables)\n\t\tajax.open(metodo, url, true);\n\t\tajax.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\t\tajax.send(variables);\n\t\tajax.onreadystatechange=function(){ \n\t\t\t\tif (ajax.readyState==4){\n\t\t\t\t\tcontenedor.innerHTML = ajax.responseText; // imprime la salida\n\t\t\t\t} // fin de if (ajax.readyState==4)\n\t\t} // fin de funcion()\n}", "title": "" }, { "docid": "1450053395a44f63a89c692b2a4d964c", "score": "0.6512433", "text": "function visualizarImg() {\r\n var preview = document.querySelectorAll('img').item(1);\r\n var file = document.querySelector('input[type=file]').files[0];\r\n var reader = new FileReader();\r\n\r\n reader.onloadend = function () {\r\n preview.src = reader.result;// carrega em base64 a img\r\n };\r\n\r\n if (file) {\r\n reader.readAsDataURL(file);\r\n } else {\r\n preview.src = \"\";\r\n }\r\n\r\n}", "title": "" }, { "docid": "057399f51aafcca0ca3ecf630f3fbd3c", "score": "0.6504503", "text": "function abrirModalIMG(imagenParaModal) {\r\n\t$(\"#imagenDelModal\").attr(\"src\", imagenParaModal);\r\n}", "title": "" }, { "docid": "5e1e4f0d01167c04abd8a18d56943649", "score": "0.65029067", "text": "function limpiar_foto(img_foto)\n{\n img_foto.src = \"../../../kernel/images/tools20/blanco.jpg\";\n}", "title": "" }, { "docid": "4bbb1836d4e019156ea7420961c130c0", "score": "0.6500695", "text": "function colocaFundo(){\n\n\tvar fundo = new Image();\n\tfundo.src = \"img/fundo.jpg\";\n\tcontexto.drawImage(fundo, 0, 0); \n\n}", "title": "" }, { "docid": "1064114d65a60c8d534fc910abe04396", "score": "0.64990485", "text": "function renderizarImagen_icon() {\n document.getElementById(\"fondo\").src = Imagenes_fondos[posicionActual];\n document.getElementById(\"caratula\").src = Imagenes_caratulas[posicionActual];\n document.getElementById(\"personaje\").src = Imagenes_personaje[posicionActual];\n document.getElementById(\"trailer-video\").src = videos[posicionActual];\n }", "title": "" }, { "docid": "9f52a7372ff13f5136b5a5d98e6b595d", "score": "0.6491907", "text": "function abrirImg(path){ \n var img = IJ.openImage(path);\n img.show();\n return img;\n}", "title": "" }, { "docid": "7d85701cca7090eb3a30d422f996baec", "score": "0.6484911", "text": "function viewimagen(titulo, srcimagen, textoBotonAceptar, callback) {\n $modal.attr(\"class\", \"modal fade\");\n $titulo.text(!esNuloNoDefinido(titulo) ? titulo : defaultsMensajes.titulo);\n $titulo.attr(\"class\", defaultsMensajes.estilo.tituloadvertencia);\n //$cuerpo.attr(\"class\", \"modal-body \" + defaultsMensajes.estilo.exito + \" text-center\");\n $cuerpo.html('<img id=\"blah\" src=\"' + URL.createObjectURL(srcimagen) + '\" alt=\"your image\" />');\n $btnAceptar.show().html(!esNuloNoDefinido(textoBotonAceptar) ? textoBotonAceptar : defaultsMensajes.textoBotonAceptar);\n $btnCancelar.hide();\n defaultsMensajes.callbackAceptar = callback;\n defaultsMensajes.callbackCancelar = null;\n return $modal.modal({\n keyboard: defaultsApp.modalKeyboard,\n backdrop: defaultsApp.modalBackdrop\n });\n }", "title": "" }, { "docid": "a682e210bfb71d8791fc2fd06b5f6e70", "score": "0.6461789", "text": "function anterior() {\n \n document.getElementById(\"imagen\").src=imagenes[1];\n}", "title": "" }, { "docid": "833da7a5f2f382c4726d8f6cbc14cce9", "score": "0.6459452", "text": "function showImage(e) {\n let srcAttr = e.target.getAttribute(\"src\");\n let newSrcAttr = srcAttr.replace(\"t-\", \"\");\n newSrcAttr = newSrcAttr.replace(\"png\", \"jpg\");\n buildModalHTML(newSrcAttr);\n}", "title": "" }, { "docid": "868c61ffd7e313f3185f835a1741b293", "score": "0.6453482", "text": "function cargarModelo(modelo){\n var htmlACargar='<img src=\"images/muestra_modelos/min'+modelo.modelo+'.jpg\" alt=\"Imagen de muestra de anteojos '+modelo.modelo+'\" id=\"'+modelo.modelo+'\" class=\"btnmodelo\">';\n $(\"#mostrarModelo\").append(htmlACargar); \n}", "title": "" }, { "docid": "893deb8c3ac10bfd4aca2da818d93179", "score": "0.6444122", "text": "function pasarFoto() {\r\n // se incrementa el indice (posicionActual)\r\n posicionActual++;\r\n if (posicionActual >= IMAGENES.length) {\r\n posicionActual = 0;\r\n }\r\n // ...y se muestra la imagen que toca.\r\n renderizarImagen();\r\n }", "title": "" }, { "docid": "f4525622cf96d6010e42a9ccdcd7e439", "score": "0.64434403", "text": "function mostrarImagenPaciente(sexo){\n\n\tdocument.getElementById(\"img_no_paciente\").style.opacity = 0;\n\tdocument.getElementById(\"img_paciente_hombre\").style.opacity = 0;\n\tdocument.getElementById(\"img_paciente_mujer\").style.opacity = 0;\n\t\n\tdocument.getElementById(\"img_no_paciente\").style.display = \"none\";\n\tdocument.getElementById(\"img_paciente_hombre\").style.display = \"none\";\n\tdocument.getElementById(\"img_paciente_mujer\").style.display = \"none\";\n\t\n\tvar id_img = \"img_no_paciente\";\n\tif (sexo == \"Masculino\"){\n\t\tid_img = \"img_paciente_hombre\";\n\t}\n\tif (sexo == \"Femenino\"){\n\t\tid_img = \"img_paciente_mujer\";\n\t}\n\t\n\tdocument.getElementById(id_img).style.display = \"block\";\n\tdojo.fadeIn({node:id_img}).play();\n}", "title": "" }, { "docid": "93f1e6e818758b526df3762ab0e7e738", "score": "0.64432687", "text": "function capturarSuccessFachada(imageCaminho) { \n // capturando o valor base64 da imagem\n convertFileToDataURLviaFileReader(imageCaminho, function(dataUri) {\n imagemURL_app_fachada = dataUri;\n });\n \n imagemURL_fachada = imageCaminho;\n // verificando se está editando o imovel\n if (editandoImovel){\n img = document.getElementById('imgEdit_fachada');\n } else if (novaUnidadeImovel){\n img = document.getElementById('imgNew_fachada');\n } else {\n img = document.getElementById('img_fachada');\n }\n img.innerHTML = '<span>Fachada:</span><br/><img src=\"' + imageCaminho + '\" />';\n}", "title": "" }, { "docid": "5fbdfdd26b405edc7a77c121f833fa77", "score": "0.64337164", "text": "mostrar()\n\t{\n\t\tdocument.body.appendChild(this.imagen); /*esta funion agrega la imagen en pantalla*/\n\t\tdocument.write(\"<p>\");\n\t\tdocument.write(\"<br><strong>\"+this.nombre+\"</strong><br>\");\n\t\tdocument.write(\"Vida: \"+this.vida + \"<br>\");\n\t\tdocument.write(\"Ataque : \"+this.ataque);\n\t\tdocument.write(\"</p> <hr>\");\n\t}", "title": "" }, { "docid": "5bcb425ba8ffc1af53f8ecabb866a1a7", "score": "0.6433621", "text": "function renderizarImagen () {\n $imagen.style.backgroundImage = `url(${IMAGENES[posicionActual]})`;\n }", "title": "" }, { "docid": "5bcb425ba8ffc1af53f8ecabb866a1a7", "score": "0.6433621", "text": "function renderizarImagen () {\n $imagen.style.backgroundImage = `url(${IMAGENES[posicionActual]})`;\n }", "title": "" }, { "docid": "5bcb425ba8ffc1af53f8ecabb866a1a7", "score": "0.6433621", "text": "function renderizarImagen () {\n $imagen.style.backgroundImage = `url(${IMAGENES[posicionActual]})`;\n }", "title": "" }, { "docid": "3d9df5fe471d20ef6b3cdd832cb8dce8", "score": "0.6432255", "text": "function textImgFunction() {\n debugger;\n const url = document.querySelector(\".textImg\").value;\n const newElemnt = new Image(\".contenedor\", \"img\", url);\n}", "title": "" }, { "docid": "b3c1dafd12459d203ec06967349ac927", "score": "0.6421916", "text": "function caminhoImagensIndex(){ \n //imagem logo mobile (pequena) \n document.getElementById(\"topoMobile\").src= \"img/topo/topoDesktop.png\"; \n \n}", "title": "" }, { "docid": "17ed4d0140161c2343ff69d2bff375f1", "score": "0.64178854", "text": "function dibujarFondo() {\n ctx.drawImage(fondo, 0, 0)\n}", "title": "" }, { "docid": "d24f60031006b40d779cd3d3b911dc51", "score": "0.6409317", "text": "function renderizarImagen() {\r\n $imagen.style.backgroundImage = `url(${IMAGENES[posicionActual]})`;\r\n }", "title": "" }, { "docid": "e9f8d23979a2cd6f00e3c8d67244ff42", "score": "0.63997555", "text": "function previewImage() {\n const gambar = document.querySelector('.gambar'); // untuk ke kelas gamba yang mengacu ke kelas gambar di file tambah hp \n const imgPreview = document.querySelector('.img-preview');\n\n const oFReader = new FileReader(); // untuk membaca file yang kita upload\n oFReader.readAsDataURL(gambar.files[0]);\n\n oFReader.onload = function (oFREvent) {\n imgPreview.src = oFREvent.target.result; // source deafault yg no foto akan diganti dengan privew gambar yang baru\n };\n}", "title": "" }, { "docid": "84d79df9722c891371cf7fb6c34c4560", "score": "0.63912547", "text": "function cambiarImg(foto) {\n var nueva = foto.src;\n var indice = nueva.indexOf('V');\n var ruta = nueva.substring((indice - 1), nueva.length);\n IEL.Servicios.wsUsuario.cambiarImagen(usuario, ruta, respuesta);\n}", "title": "" }, { "docid": "08a3c311dd2daf8b06574531dfa271e7", "score": "0.6387936", "text": "function pasarFoto() {\n if(posicionActual >= IMAGENES.length - 1) {\n posicionActual = 0;\n } else {\n posicionActual++;\n }\n renderizarImagen();\n }", "title": "" }, { "docid": "08a3c311dd2daf8b06574531dfa271e7", "score": "0.6387936", "text": "function pasarFoto() {\n if(posicionActual >= IMAGENES.length - 1) {\n posicionActual = 0;\n } else {\n posicionActual++;\n }\n renderizarImagen();\n }", "title": "" }, { "docid": "08a3c311dd2daf8b06574531dfa271e7", "score": "0.6387936", "text": "function pasarFoto() {\n if(posicionActual >= IMAGENES.length - 1) {\n posicionActual = 0;\n } else {\n posicionActual++;\n }\n renderizarImagen();\n }", "title": "" }, { "docid": "b1118e401175feaaa4f420913c9631fb", "score": "0.6371031", "text": "display(){\n image(imgTrash,this.x,this.y,this.size,this.size);\n }", "title": "" }, { "docid": "341ad969f39e8273cc7a953e73c10cd3", "score": "0.6364761", "text": "function addImage()\n{\n\tdialog.showOpenDialog(modifyWindow, {\n\t\ttitle: 'Ajoutez une image',\n\n\t\tproperties: ['openFile']\n\t}, (files) => {\n\t\tif(files)\n\t\t{\n\t\t\tfiles.forEach(file => {\n\t\t\t\tuploadFile(file)\n\t\t\t})\n\t\t}\n\t})\n}", "title": "" }, { "docid": "86a6fc109841d3f675427623d311b059", "score": "0.63560253", "text": "function capturarSuccessAdicional1(imageCaminho) {\n // capturando o valor base64 da imagem\n convertFileToDataURLviaFileReader(imageCaminho, function(dataUri) {\n imagemURL_app_adicional1 = dataUri;\n });\n imagemURL_adicional1 = imageCaminho;\n if (editandoImovel){\n img = document.getElementById('imgEdit_adicional1');\n } else if (novaUnidadeImovel) {\n img = document.getElementById('imgNew_adicional1');\n } else {\n img = document.getElementById('img_adicional1');\n }\n img.innerHTML = '<span>Adicional 1:</span><br/><img src=\"' + imageCaminho + '\" />';\n}", "title": "" }, { "docid": "8ea9eed0f95d48170c433fa82e5da2ab", "score": "0.63426477", "text": "function controleur() {\r\n Malus(-1);\r\n str = \"<img src='img/reponse_carte/controleur.PNG' class='img-fluid'/> \";\r\n $(\"#Communication_JS\").html(str);\r\n}", "title": "" }, { "docid": "f96b0d56a58d2c3b58ee2dbd37f131b0", "score": "0.6336179", "text": "onClickCambiarImagen() {\n\t\t\tif (this.evIndividualBandera) {\n\t\t\t\tthis.rutaImagenAnterior = this.preguntaEnEdicion.enunciado; // SE VA, PORQUE YA NO SE CARGAN LAS IMAGENES CON LA FUNCION ARRIBA\n\t\t\t} else {\n\t\t\t\tthis.rutaImagenAnterior = this.objetoSeleccionado.multimedia.imagen;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "b43d5a9678593b5d19b564fa058aa5fc", "score": "0.63236684", "text": "function pasarFoto() {\n if (posImgActual >= IMG.length - 1) {\n posImgActual = 0;\n } else {\n posImgActual++;\n }\n seleccionarImagen();\n}", "title": "" }, { "docid": "b50ddc634eb1bd725cf77e13381db147", "score": "0.63091177", "text": "function img() {\n\t\tfor (var i = 0; i < 25; i++) {\n\t\t\tcartas.push('img/img'+i+'.png');\n\t\t}\n\t}", "title": "" }, { "docid": "5233e9a57468be4ddf34b2a2c28ec98e", "score": "0.63090444", "text": "function cargaImagen(){\n\t\tdocument.elementoIMG.src = listaImagenes[indice];\n\t\tplay();\n\t}", "title": "" }, { "docid": "855cd376dbd2f037f6980d6b8de52cc0", "score": "0.63087666", "text": "function showImage(){\n //alert(\"hola\");\n //el estilo del div modalBox se vuelve visible\n modalBox.style.display = \"block\";\n // la src de la imagen se vuelve la src de this (objeto imagen) que debe mostrar o de la imagen que se le ha dado click\n modalImg.src = this.src;\n}", "title": "" }, { "docid": "f39264672a510271b2922c70bc78f41b", "score": "0.6287267", "text": "function mostrarFoto(file, imagen) {\n var reader = new FileReader();\n reader.addEventListener(\"load\", function () {\n imagen.src = reader.result;\n });\n reader.readAsDataURL(file);\n}", "title": "" }, { "docid": "2ccb1b829f3af847966ccd47a3c3c20f", "score": "0.6265857", "text": "function cambiar(user, pc){\n\tdocument.getElementById(\"usuario\").innerHTML=\"<img src='imagenes/\" + user + \".png'>\"\n\tdocument.getElementById(\"pc\").innerHTML=\"<img src='imagenes/\" + pc + \".png'>\"\n}", "title": "" }, { "docid": "9cc9c609900b3c88cde178060e30203d", "score": "0.62546855", "text": "function galeriaFotos(categoria, qtd) {\n for (var i = 1; i <= qtd; i++) {\n imagem = new Image(); // cria herança para novos elementos <img>\n var origem = `img/galeria/${categoria}/${i}.jpg`;\n imagem.src = origem; // define a origem da imagem\n galeria.appendChild(imagem); // anexa a imagem na div galeria\n // console.log(imagem);\n }\n}", "title": "" }, { "docid": "e0e111e7819b3b2806a8097923472713", "score": "0.6249851", "text": "function retrocederFoto() {\r\n // se incrementa el indice (posicionActual)\r\n posicionActual--;\r\n if (posicionActual < 0) {\r\n posicionActual = IMAGENES.length - 1;\r\n }\r\n // ...y se muestra la imagen que toca.\r\n renderizarImagen();\r\n }", "title": "" }, { "docid": "6815e0ccb459a9547801ea52cea298ea", "score": "0.62471306", "text": "function choixImage(e) {\n let id = getIdInt(this.id);\n console.log(\"choixImg : \", id);\n if (e.target instanceof HTMLImageElement) {\n sock.emit(\"message\", {from: currentUser, to: null, text: \"[img:\" + e.target.src + \"]\", id_partie: id});\n toggleImage(id, id);\n }\n\n }", "title": "" }, { "docid": "b129541be465921a9664847947cc30ca", "score": "0.6246666", "text": "function imageset (event){\n event.preventDefault(); \n //se recupera el file de filelist y se almacena en estado para enviarlo. \n let file = event.target.files[0];\n setFileImage(file);\n //se hace un FileReader para recuperar la imagen y se carga en el Estado\n let reader = new FileReader();\n reader.onload = function(event) {\n let imageURIdata = event.target.result;\n setImageURI(imageURIdata);\n };\n //se ejecuta el metodo para leer la url.\n reader.readAsDataURL(event.target.files[0]);\n }", "title": "" }, { "docid": "b5a260975406737789b8a0563f0800df", "score": "0.6223164", "text": "function dibujarImagenes(imagenes)\n{\n\tvar tbl = \"\";\n\n\t$(imagenes).each(function(i,e){\n\n\t\tif (i % 4 === 0)\n\t\t{\n\t\t\ttbl += \"<tr>\";\n\t\t}\n\n\t\ttbl += \"<td class='gal-fb'>\";\n\n\t\thtml = $(\"#template-imagen\").html();\n\t\thtml = html.replace(/#URL_IMAGEN#/g, e.picture);\n\t\thtml = html.replace(/#IMG_GRANDE#/g, e.source);\n\t\t//$(\"#imagenes\").append(html);\n\t\t\n\n\t\ttbl += html;\n\t\ttbl += \"</td>\";\n\n\t\tif (i % 4 === 3)\n\t\t{\n\t\t\ttbl += \"</tr>\";\n\t\t}\n\t});\n\n\t$(\"#fb_gallery\").html(tbl);\n\n\t$(\".gal-fb\").click(function() {\n\timg = \"url(\" + $(this).children().attr('id') + \")\";\n\t\t$(\".tbl-elegir\").css(\"background-image\", img);\n\t\t})\n}", "title": "" }, { "docid": "30dc9dd444377e4252fc32f05ad87ea9", "score": "0.62110186", "text": "function imgEmpleado(form, msj) {\r\n\tswitch (msj) {\r\n\t\tcase 0:\r\n\t\t\tform.imgMenu.src=\"imagenes/blank.jpg\";\r\n\t\t\tbreak;\r\n\t\tcase 1:\r\n\t\t\tform.imgMenu.src=\"imagenes/vacaciones.jpg\";\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tform.imgMenu.src=\"imagenes/patrimonio.jpg\";\r\n\t\t\tbreak;\r\n\t\tcase 3:\r\n\t\t\tform.imgMenu.src=\"imagenes/permisos.jpg\";\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\tform.imgMenu.src=\"imagenes/instruccion.jpg\";\r\n\t\t\tbreak;\r\n\t\tcase 5:\r\n\t\t\tform.imgMenu.src=\"imagenes/referencias.jpg\";\r\n\t\t\tbreak;\r\n\t\tcase 6:\r\n\t\t\tform.imgMenu.src=\"imagenes/documentos.jpg\";\r\n\t\t\tbreak;\r\n\t\tcase 7:\r\n\t\t\tform.imgMenu.src=\"imagenes/experiencia.jpg\";\r\n\t\t\tbreak;\r\n\t\tcase 8:\r\n\t\t\tform.imgMenu.src=\"imagenes/meritos.jpg\";\r\n\t\t\tbreak;\r\n\t\tcase 9:\r\n\t\t\tform.imgMenu.src=\"imagenes/bancaria.jpg\";\r\n\t\t\tbreak;\r\n\t\tcase 10:\r\n\t\t\tform.imgMenu.src=\"imagenes/familiar.jpg\";\r\n\t\t\tbreak;\r\n\t\tcase 11:\r\n\t\t\tform.imgMenu.src=\"imagenes/historial.jpg\";\r\n\t\t\tbreak;\r\n\t\tcase 12:\r\n\t\t\tform.imgMenu.src=\"imagenes/nivelaciones.jpg\";\r\n\t\t\tbreak;\r\n\t\tcase 13:\r\n\t\t\tform.imgMenu.src=\"imagenes/conceptos.jpg\";\r\n\t\t\tbreak;\r\n\t}\t\r\n}", "title": "" }, { "docid": "ea91fe7df49838de0eec62343d0cabbf", "score": "0.6197566", "text": "function pasarFoto() {\n if(posicionActual >= imagenes.length - 1) {\n posicionActual = 0;\n } else {\n posicionActual++;\n }\n renderizarImagen();\n }", "title": "" }, { "docid": "9a1faf634c5bc4a9f37435dc5d99e098", "score": "0.61895037", "text": "function newImg() {\n var displayId = \"'\" + e + iC + \"'\";\n img = '<div class=\"col-xs-3 marginTop\"><img id=\"'+e+iC+'\" class=\"'+a+' img-responsive\" onclick=\"display('+displayId+')\" data-toggle=\"modal\" data-target=\"#viewport\" src=\"'+f+iC+'.jpg\"></div>';\n $(\"#\"+d+i).append(img);\n iC++;\n }", "title": "" }, { "docid": "0f564cc7a1d2cd034bb67a2a283f70bb", "score": "0.6177501", "text": "function viderChampImage(id) {\n\n\t// Vidé le champ caché\n\tidChamp = \"#\" + id;\n\t$(idChamp).val(\"\");\n\t\n\t// Soumettre la page pour obtenir l'aperçu de l'image\n\tflagModifications = false;\n\tdocument.frm.demande.value=\"item_modifier_media\";\n\tdocument.frm.submit();\t\n}", "title": "" }, { "docid": "fd11261661a4e4edd392ecdc9e3c5aad", "score": "0.6170833", "text": "function getImageShow(inputFile, idShow) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n\n reader.onload = function(e){\n $(idShow)\n .attr('src', e.target.result)\n .width(auto)\n .height(auto);\n };\n\n reader.readAsDataURL(input.files[0]);\n }\n}", "title": "" }, { "docid": "6d6dfac8bd8b2fc89fc4cdefae8b6f8e", "score": "0.6166497", "text": "function captureImage() {\n\n // VALIDAMOS SI HAY ARCHIVOS SELECCIONADOS\n var size = document.getElementById(\"UserPhoto\").files.length;\n\n if (size > 0) {\n // CONVERTIMOS IMAGEN EN BASE 64 PARA ENVIAR\n var photo = document.getElementById(\"UserPhoto\").files[0];\n\n getBase64FromFile(photo);\n showElement(\"contBtnGenerateReport\", false);\n showElement(\"tableUsers\", false);\n showElement(\"DivPhotoContainer\", true);\n $(\"#lblUserPhoto\").text(document.getElementById(\"UserPhoto\").files[0].name);\n\n } else {\n image = \"\";\n $(\"#lblUserPhoto\").text(\"Seleccionar...\"); \n showElement(\"contBtnUploadDoc\", true);\n showElement(\"contBtnGenerateReport\", true);\n showElement(\"tableUsers\", true);\n showElement(\"DivPhotoContainer\", false);\n }\n}", "title": "" }, { "docid": "9bac900f9fb329a167dc1c607de3bee8", "score": "0.6158117", "text": "function CargarImagenChofer(idClickImg, inImg) {\n\t\t\t\t\t$(\"#\" + idClickImg).change(function () {\n\t\t\t\t\t\tfile = $(\"#\" + idClickImg).val(); //imgenTaxi1\n\t\t\t\t\t\tvar ext = file.substring(file.lastIndexOf(\".\"));\n\t\t\t\t\t\t//Validar si es un formato valido\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\text == \".jpg\" ||\n\t\t\t\t\t\t\text == \".png\" ||\n\t\t\t\t\t\t\text == \".jpeg\" ||\n\t\t\t\t\t\t\text == \".JPG\" ||\n\t\t\t\t\t\t\text == \".PNG\" ||\n\t\t\t\t\t\t\text == \".JPEG\"\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tvar imgExt = 23;\n\t\t\t\t\t\t\tif (ext == \".png\" || ext == \".PNG\") {\n\t\t\t\t\t\t\t\timgExt = 22;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar preview = document.getElementById(inImg);\n\t\t\t\t\t\t\tfile = document.getElementById(idClickImg).files[0];\n\t\t\t\t\t\t\textension_PM = ext; //ext de imagen\n\n\t\t\t\t\t\t\t$(\"#\" + inImg).attr(\"title\", file.name);\n\t\t\t\t\t\t\t$(\"#\" + inImg).attr(\"alt\", imgExt);\n\n\t\t\t\t\t\t\tvar reader = new FileReader();\n\n\t\t\t\t\t\t\treader.addEventListener(\n\t\t\t\t\t\t\t\t\"load\",\n\t\t\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t\t\tpreview.src = reader.result;\n\t\t\t\t\t\t\t\t\tvar imagen = preview.src;\n\t\t\t\t\t\t\t\t\trecotarImagen_PM = imagen.slice(imgExt);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tfalse\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (file) {\n\t\t\t\t\t\t\t\treader.readAsDataURL(file);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$(\"#\" + inImg).attr(\n\t\t\t\t\t\t\t\t\"src\",\n\t\t\t\t\t\t\t\t\"../../Diseno/ICONOS/cerrar-sesion-Presionado.svg\"\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}", "title": "" }, { "docid": "9348cdf9600dbe29d5621b77c19147fb", "score": "0.6142664", "text": "function alterar_imagem(value){\r\n\tif(value=='Potência'){\r\n\t\tdocument.getElementById(\"montagem_oqmp\").src=\"../Imagens/potenciapwm.png\";\r\n\t}\r\n\tif(value=='Controlo'){\r\n\t\tdocument.getElementById(\"montagem_oqmp\").src=\"../Imagens/controlospwm.png\";\r\n\t}\r\n}", "title": "" }, { "docid": "78171d051b00effb382aa70fac260605", "score": "0.6138381", "text": "function renderizarImagen () {\n imagen.style.backgroundImage = `url(${imagenes[posicionActual]})`;\n }", "title": "" }, { "docid": "32f5d38daa7489a88019e21c1af0541d", "score": "0.61258954", "text": "function loadImg(e) {\n var files=e.target.files;\n if(files.length){\n [].forEach.call(files, function (file) {\n const reader = new FileReader();\n //проветка на тип зашруженного файла и размер\n exchangeByteForMb(file.size)>5&&console.log('55');\n if(testTypeImage(file,['gif','jpeg','pjpeg','png'])&&exchangeByteForMb(file.size)<5){\n reader.onload = function(e) {\n var fileData = e.target.result;//base64\n var error = e.target.error;\n error&&log('Файл не загрузился!');\n var block = `<div class=\"blockFlexImgInfo\">\n <img src=\"${fileData}\" alt=\"\">\n <a href=\"#\" class=\"deleteImg \"></a>\n <div class=\"blockFlexImgInfo__name\">${file.name.split('.')[0]}</div>\n <div class=\"blockFlexImgInfo__size\">${exchangeByteForMb(file.size)} Mb</div>\n </div>`;\n document.querySelector('.blockFlexImg__square').insertAdjacentHTML('afterEnd', block);\n };\n reader.readAsDataURL(file);\n }\n else if(testTypeImage(file,['gif','jpeg','pjpeg','png'])){\n var errorSize=document.createElement('div');\n errorSize.classList.add('errorSizeImg');\n errorSize.innerHTML=`Error: ${file.name.split('.')[0]} превышает максимальный размер 5 Mb!`;\n document.querySelector('.errorSizeImgConteiner').appendChild(errorSize);\n\n setTimeout( ()=> document.querySelector('.errorSizeImg').remove(),7000);\n\n log (66666);\n }\n else {\n var blockNoImage=`<article class=\"infoNoImage\">\n <div class=\"flex\">\n <pre class=\"infoNoImage__info-maxSize\">1. ${file.name.split('.')[0]}</pre>\n <pre class=\"infoNoImage__info\">${file.type.split('/')[1]}</pre>\n <pre class=\"infoNoImage__info\">${exchangeByteForMb(file.size)} Mb</pre>\n </div>\n <pre class=\"infoNoImage__info__delete \">Delete </pre>\n </article>`;\n document.querySelector('.startFlex__column').insertAdjacentHTML('beforeEnd', blockNoImage);\n }\n });\n\n e.target.value='';\n }\n }", "title": "" }, { "docid": "1fd52895ed6d4baa191b40a6bd2ce32f", "score": "0.61250514", "text": "function montrerImage(image) {\n if(image.files && image.files[0]) {\n var reader = new FileReader();\n\n reader.onload = function (e) {\n $('#imageModal').attr('src',e.target.result);\n }\n reader.readAsDataURL(image.files[0]);\n }\n }", "title": "" }, { "docid": "d57b69838729d51d57610898828b9810", "score": "0.6123619", "text": "function renderizarCena() {\n\n\t$(\"canvas\").clearCanvas();\n\n\t$(\"canvas\").drawImage({\n\t\tsource: 'imagens/ondina.png',\n\t\twidth: 760,\n\t\theight: 480,\t\t\n\t\tx: 380,\n\t\ty: 240,\n\t});\n\t\n\t$(\"canvas\").drawImage({\n\t\tsource: 'imagens/aluno.png',\n\t\twidth: 70,\n\t\theight: 100,\n\t\tx: playerx,\n\t\ty: playery\n\t});\n}", "title": "" }, { "docid": "3b07b33b5bcda89937293126997ad516", "score": "0.6122455", "text": "function retrocederFoto() {\n if(posicionActual <= 0) {\n posicionActual = IMAGENES.length - 1;\n } else {\n posicionActual--;\n }\n renderizarImagen();\n }", "title": "" }, { "docid": "3b07b33b5bcda89937293126997ad516", "score": "0.6122455", "text": "function retrocederFoto() {\n if(posicionActual <= 0) {\n posicionActual = IMAGENES.length - 1;\n } else {\n posicionActual--;\n }\n renderizarImagen();\n }", "title": "" }, { "docid": "3b07b33b5bcda89937293126997ad516", "score": "0.6122455", "text": "function retrocederFoto() {\n if(posicionActual <= 0) {\n posicionActual = IMAGENES.length - 1;\n } else {\n posicionActual--;\n }\n renderizarImagen();\n }", "title": "" }, { "docid": "80d62c7f74866ddc3f6422ccb0b94146", "score": "0.61178327", "text": "function dibujaVillano(){\n ctx.drawImage(imgVillano,0,0,500,393,380,20,350,300) \n}", "title": "" }, { "docid": "9f0e6232944a853884bbce2a97127aad", "score": "0.6117542", "text": "function ultima() {\n \n document.getElementById(\"imagen\").src=imagenes[3];\n}", "title": "" }, { "docid": "8aae37a4188829786b463e24ca35d523", "score": "0.6116465", "text": "function zoomImg(id) {// au clic sur l'image : zoom\n\tif(clic==1){//permet de bloquer ou débloquer l'apercu\n\t\tidImage=id;\n\t\ti=idImage.substr(5);\n\t\t\n\t\tdocument.getElementById(\"apercu\").style.display = \"block\";\n\t\tzoom='<img src=\"media/image/image'+i+'.PNG\" style=\"width:800px; height:500px;\" onclick=\"clicVideo(this.id)\"></img';\n\t\tdocument.getElementById(\"apercu\").innerHTML=fenetre+zoom;\n\t}\n}", "title": "" }, { "docid": "ad95fead65977ad59106a8763c8025f6", "score": "0.6092526", "text": "function mostra_grid_imagens(link)\n{\n\tlet urls = return_url_range(link);\n\n\tlet num_column = 0;\n\tlet columns = document.getElementsByClassName(\"column\")\n\tfor (let url of urls) {\n\t\tfor ( x of [\"apresentar\",\"mostrar\"]) {\n\t\t\timg = document.createElement(\"img\");\n\t\t\timg.src = url;\n\n\t\t\tif ( x == \"apresentar\" ) ordem_imgs.appendChild(img);\t\t\n\t\t\tif ( x == \"mostrar\" )\t columns[num_column].appendChild(img);\t\n\t\t}\n\t\t// core do grid responsivo\n\t\tnum_column+=1;\n\t\tif (num_column == 4) num_column = 0;\n\t}\n\t\n\tconsole.log(urls)\n\tconst galeria = new Viewer(document.getElementById(\"row\"));\n}", "title": "" }, { "docid": "c9a0585b37778b3d461f2684caf9f2cf", "score": "0.60896707", "text": "mostrar()\n\t{\n\t\tdocument.body.appendChild(this.imagenes);\n\t\tdocument.write(\"<p>\");\n\n\t\tdocument.write(\"<strong>\"+this.nombre+\"</strong>\");\n\t\tdocument.write(\"<br>Vida: \"+this.vida);\n\t\tdocument.write(\"<br>Ataque: \"+this.ataque)\n\t\tdocument.write(\"</p> <hr>\");\n\n\t}", "title": "" }, { "docid": "43d1b75d76e0418eeff76f50f44ca55e", "score": "0.60844886", "text": "function ficha_Seleccionada(fichaseleccionada){\n\t$('#template').css('display','none');\n\tvar img_jugador = $('#template').clone();\n\tvar img_Maquina = $('#template').clone();\n\t\n\timg_jugador.removeAttr('id');\n\timg_jugador.removeAttr('style');\n\timg_Maquina.removeAttr('id');\n\timg_Maquina.removeAttr('style');\t\n\t\n\tvar url_img_jugador = fichaseleccionada == \"cruz\" ? \"../img/iconoCrus.png\" : \"../img/iconoCirculo.png\";\n\tvar url_img_oponente = fichaseleccionada != \"circulo\" ? \"../img/iconoCirculo.png\" : \"../img/iconoCrus.png\";\n\t\n\timg_jugador.attr('src',url_img_jugador);\n\timg_Maquina.attr('src',url_img_oponente);\n\n\t$('.jugador').append(img_jugador);\n\t$('.oponente').append(img_Maquina);\n\t$('#nombre').text(\"YO\");\n}", "title": "" }, { "docid": "24505f3171795d3c0d949d7a9896b498", "score": "0.6079598", "text": "function traerImagen(codigo){\n\t imagen = \"images/imagesProducts/\"+codigo+\".jpg\";\n\t var etsiste = urlExists(imagen);\n\t if (etsiste==200){\n\t\t\tres = '<img src=\"'+imagen+'\" class=\"imagensusca\" width=\"100\" height=\"90\" title=\"Ver imagen completa\" style=\"cursor: pointer;\"/>';\n\t\t\t$(\"#getImage\").html(\"\");\n\t\t\t$(\"#getImage\").html(\"<img src='\"+imagen+\"' width='675' height='675'/>\");\n\t }else{\n\t\t\tres = '<img src=\"images/notAvailable.jpg\" width=\"100\" height=\"90\"';\n\t }\n\t return res;\n\t}", "title": "" }, { "docid": "efca3f3125bb7b86aef4dd2a5f4ccdc0", "score": "0.60782117", "text": "function marcaCordo( id )\r\n{\r\n\t\r\n document.getElementById('01').src = '/images/01.jpg';\r\n document.getElementById('02').src = '/images/02.jpg';\r\n document.getElementById('03').src = '/images/03.jpg';\r\n document.getElementById('04').src = '/images/04.jpg';\r\n document.getElementById('05').src = '/images/05.jpg';\r\n document.getElementById('06').src = '/images/06.jpg';\r\n document.getElementById('07').src = '/images/07.jpg';\r\n document.getElementById('08').src = '/images/08.jpg';\r\n document.getElementById('09').src = '/images/09.jpg'; \r\n \r\n document.getElementById( id ).src = '/images/' + id + 'x.jpg';\r\n $(\"sel_cordo\").value=\"1\";\r\n changeImas(getModel(),getColor(),id);\r\n}", "title": "" }, { "docid": "758c97552adc1397ada1bf605fb1aced", "score": "0.6066222", "text": "function generaCopertina(poster, titolo){\r\n\r\n var immagineFinale = \"\";\r\n\r\n if (poster !== null){\r\n immagineFinale = \"<img src='https://image.tmdb.org/t/p/w342\" + poster + \"'\" + \"alt='immagine non disponibile'>\" ;\r\n console.log(immagineFinale);\r\n } else {\r\n immagineFinale = '<h1 id=\"titolo\">' + titolo + '</h1>' + ' ' + '<img src=\"img/nondisponibile.png\" alt=\"\" id =\"no-poster\">';\r\n console.log(immagineFinale);\r\n } // fine ciclo if\r\n return immagineFinale;\r\n }", "title": "" }, { "docid": "27a5abdaa3477a4da01b4a966a9cc8d0", "score": "0.6057633", "text": "function chargueData(id, nombre, apellidos, usuario, fotoPath) {\n\n // ASIGNAMOS VALORES A CAMPOS DE FORMULARIO\n document.getElementById(\"UserId\").value = id;\n document.getElementById(\"Nombre\").value = nombre;\n document.getElementById(\"Apellidos\").value = apellidos;\n document.getElementById(\"Usuario\").value = usuario;\n\n // CREAMOS ETQUETA DE IMAGEN\n if (fotoPath == undefined || fotoPath == \"\") {\n\n var html = `<h3 class=\"ImageSelected text-warning\">This user haven't a photo.</h1>`;\n } else {\n\n var html = `<img src='${fotoPath}' class=\"ImageSelected\" width=\"300\"/>`;\n }\n // ASIGNAMOS ETIQUETA A #DIVPHOTO\n document.getElementById(\"DivPhoto\").innerHTML = html;\n\n // OCULTAMOS TABLA Y MOSTRAMOS IMAGEN \n showElement(\"contBtnGenerateReport\", false);\n showElement(\"contBtnUploadDoc\", false);\n showElement(\"tableUsers\", false);\n showElement(\"DivPhotoContainer\", true);\n\n\n}", "title": "" }, { "docid": "9ced3b2fd01283bf4ab1121622b87f39", "score": "0.604947", "text": "function editarImagem(campo)\r\n{\r\n\tvar idArquivo = $(campo).val();\r\n\tvar escala = $(campo).attr('escala');\r\n\tvar pagina = \"<a href='\"+dir_cms_htm_root + \"/ferramentas/crop_imagem.php?id=\"+idArquivo+\"&escala=\"+escala+\"' rel='iframe'>editar imagem</a>\";\r\n\t$.fn.ceebox.popup(pagina,{onload:true,width:800,height:800,html:true,iframe:true});\r\n}", "title": "" }, { "docid": "a1d665b1a84a667397428e8a17f22d6f", "score": "0.60462147", "text": "function dibujarFondo(){//La variable tendrá una función\n contexto.drawImage(fondo, x, 0, 640, 380); //El fondo se dibujará en la posición 00\n}", "title": "" }, { "docid": "b55ecefcb19b31127449ce0ebf7ff63b", "score": "0.6034195", "text": "function abrirImgModal(index) { \n \n src = $('#exibirImagens img:eq(' + index + ')').attr('src');\n \n //Altera URL da imagem de thumbs para imagens\n src = src.replace(\"thumbs\", \"imagens\");\n \n //Salva nome da imagem na var nomeImagem\n nomeImagem = src.substring(src.lastIndexOf('/') + 1, src.length); \n \n //Atualiza legenda\n atualizarLegenda(); \n \n var anteriorIndex = parseInt(index, 10) - 1;\n var proximoIndex = parseInt(anteriorIndex, 10) + 2;\n \n if ($(elem).hasClass('previous')) {\n $(elem).attr('id', anteriorIndex);\n $('a.next').attr('id', proximoIndex);\n } else {\n $(elem).attr('id', proximoIndex);\n $('a.previous').attr('id', anteriorIndex);\n }\n \n var total = $('#exibirImagens img').length - 1;//qtd de <img> na div \n \n $('a.next').show();\n $('a.previous').show();\n \n //Esconde botão Próximo\n if (index == total) {\n $('a.next').hide();\n }\n //Esconde botão Anterior\n if (index == 0) {\n $('a.previous').hide();\n }\n \n $(\"img.img-responsive\").attr('src',src);\n}", "title": "" }, { "docid": "1e4fd779a80711807d1ff252e3f3ccc9", "score": "0.6027454", "text": "function cargarImagen() {\n let img = document.getElementById('img')\n let user = JSON.parse(localStorage.getItem(\"currentUser\"));\n let sql = \"SELECT img FROM jugadores WHERE eliteuser LIKE '\" + user.eliteuser + \"'\"\n mysqlcon.getConnection(function (err, con) {\n con.query(sql, function (err, result) {\n if (err) throw err;\n img.src = result[0].img\n });\n con.release();\n });\n}", "title": "" }, { "docid": "97ef5a04ccd0f980fa07f9dc45aa19f8", "score": "0.6020523", "text": "function imageIsLoaded(e) { \n $(\"#imagen\").css(\"color\", \"green\");\n $('#img-muestra').attr('src', e.target.result);\n $('#enviar').attr('disabled', false);\n $(\"#alerta\").fadeOut(\"slow\"); \n }", "title": "" }, { "docid": "fed797a14f32c60e3a159f5fbe71f353", "score": "0.6013934", "text": "function saveImg()\r\n{\r\n\tif(editImage == false)\r\n\t{\r\n\t\tvar start = 1;\r\n\t\tlistePixel = {};\r\n\t\t$('.gf-pixel').each(function (){\r\n\t\t\tlistePixel[start] = $(this).css('background-color');\r\n\t\t\tstart++;\r\n\t\t});\r\n\t\tliste = JSON.parse(lcGet('liste_name'));\r\n\t\tlisteImages = liste[elementSelect]['images'];\r\n\t\tif(Object.keys(listeImages).length == 0)\r\n\t\t{\r\n\t\t\tlisteImages[Object.keys(listeImages).length] = listePixel;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tlisteImages[Object.keys(listeImages).length] = listePixel;\r\n\t\t}\r\n\t\tliste[elementSelect]['images'] = listeImages;\r\n\t\tliste = JSON.stringify(liste);\r\n\t\tlcAdd('liste_name', liste);\r\n\t\tsetFrameListe();\r\n\t}\r\n\telse\r\n\t{\r\n\t\talert('Vous êtes entrain d\\'éditer une image, validez votre édition avant d\\'effectuer cette action.');\r\n\t}\r\n}", "title": "" }, { "docid": "740986f5f1534bb4bd149b479d89909e", "score": "0.6012106", "text": "function heure_de_pointe() {\r\n Malus(-1);\r\n str = \"<img src='img/reponse_carte/heure_de_pointe.PNG' class='img-fluid'/> \";\r\n $(\"#Communication_JS\").html(str);\r\n}", "title": "" }, { "docid": "e5d938287c77975b18ddec01bc17a45d", "score": "0.6010024", "text": "function loadStartImage() {\n \n var file = document.getElementById(\"sgfile\");\n sgImage = new SimpleImage(file);\n sgCanvas = document.getElementById(\"sgcan\");\n sgImage.drawTo(sgCanvas);\n \n}", "title": "" }, { "docid": "944dcd847336fdbff6b8691a8ce020bb", "score": "0.6009349", "text": "function construirContenido(inmueble) {\n var relation = inmueble.relation(\"imagenes\");\n var query = relation.query();\n query.first({\n success: function(imagen) {\n var imag = imagen.get(\"imagen\");\n var $div1=$('<div/>',{'class':'col-xs-12 col-sm-5 col-md-5 col-lg-5'}).append(\n $('<img/>',{'class':'img-responsive',\n 'src':imag.url(),\n 'alt':'imagen de inmueble'}));\n var $div2=$('<div/>',{'class':'col-xs-12 col-sm-7 col-md-7 col-lg-7'}).append(\n $('<p/>',{'html':'Despripcion: '+inmueble.get('descripcion')})).append(\n $('<p/>',{'html':'Precio: '+inmueble.get('precio')}));\n var $div3=$('<div><a href=\"inmueble.php?id='+inmueble.id+'\"><button type=\"submit\" class=\"vermas btn btn-default col-xs-offset-8 col-sm-offset-10 col-md-offset-10\" value=\"'+inmueble.id+'\">Ver mas...</button></a>'+'</div>');\n $('.contenido').append($('<div/>',{'class':'container-fluid celda'}).append($div1).append($div2).append($div3));\n },\n error: function(error) {\n alert(\"Error: \" + error.code + \" \" + error.message);\n }\n });\n}", "title": "" }, { "docid": "73d85e1821db9cef659aa14651cfab38", "score": "0.6008848", "text": "function success(img){ //img è già in base64\n let _img = $(\"<img>\");\n _img.css({\n \"height\":200\n });\n if(cameraOptions.DestinationType == Camera.DestinationType.DATA_URL)\n {\n _img.prop(\"src\",\"data:image/jpeg;base64,\"+img);\n _imgURL = \"data:image/jpeg;base64,\"+img;\n }\n \n else\n {\n _img.prop(\"src\",img);\n _imgURL = img;\n }\n _img.appendTo($(\"#imageTaken\"));\n // DI CONSEGUENZA , UNO CLICCHERA' SUL BOTTONE UPLOAD, E AUTOMATICAMENTE VERRA' CARICATO SU CLOUD\n \n //Dopo che ho scattato la foto, voglio che mi mostri subito la posizione di dove l'ho scattato, sulla mappa.\n navigator.geolocation.getCurrentPosition(geolocationSuccess,error);\n\n }", "title": "" }, { "docid": "2c1205072b62029c9136414f1cb909bc", "score": "0.60011107", "text": "function loadImg(name){\r\n\tvar img = new Image(WIDTH, HEIGHT);\r\n\timg.onerror = function() {\r\n\t // doesn't exist or error loading\r\n\t console.log(\"There is no image\");\r\n\t};\r\n img.onload = function() {\r\n\t // code to set the src on success\r\n\t var imgTag = document.getElementById(\"disc\");\r\n\t imgTag.setAttribute('src', this.src);\r\n\t\timgTag.setAttribute('style', 'width:' + WIDTH + 'px;' + 'height:' + HEIGHT + 'px;');\r\n\t};\r\n\timg.src = IMG_FOLDER + name;\r\n\tconsole.log(img);\r\n\t//console.log(\"img nummer: \" + imgNum);\r\n\t//console.log(\"last image: \" + lastImg);\r\n}", "title": "" }, { "docid": "27319eeaa0886e7eb40b55c32f6bef26", "score": "0.59947896", "text": "function showImage( im )\r\n {\r\n var fileName = imageURLs[im].split(\"/\")[2];\r\n window.scrollTo(0, 0);\r\n currentImage = im;\r\n\r\n if ( !images[im] )\r\n {\r\n images[im] = new Image();\r\n }\r\n\r\n if ( useSmaller )\r\n {\r\n images[im].src = smallerURLs[im];\r\n }\r\n else\r\n {\r\n images[im].src = imageURLs[im];\r\n }\r\n setInner( \"image\", \"<h3>Waiting for image ...<\\/h3>\" );\r\n waitForCurrent();\r\n\r\n setInner( \"image\", \"<img class=\\\"main_image\\\"\" +\r\n \"src=\\\"\"+images[im].src +\r\n \"\\\" \" +\r\n \"alt=\\\"\"+imageURLs[im] +\r\n \"\\\" height=\\\"\"+imgHeight+\"\\\" />\" );\r\n setInner( \"title\", fileName );\r\n }", "title": "" }, { "docid": "6df3aa58af967642aa39c5e0fb6d24e9", "score": "0.5991036", "text": "function rajouter_img(){\n\n var noeudBalise = document.createElement('img');\n\n var noeudParent = document.querySelector(\"#target\");\n \n\n noeudParent.appendChild(noeudBalise);\n \n\n \n\n}", "title": "" }, { "docid": "d0ae55a1828ef0432eef2ca516fcc9d1", "score": "0.59891874", "text": "function adelante() {\r\n posicionActual++;\r\n if (posicionActual>3)\r\n posicionActual=1;\r\n var foto=document.getElementById('contenido')\r\n foto.src=\"contenido\"+posicionActual+\"\".jpg\"\r\n\r\n}", "title": "" }, { "docid": "5e8a4991ba25b694b3a8ab3b787e5f0d", "score": "0.59852743", "text": "function imagenes () {\n return src(paths.imagenes)\n .pipe(imagemin() )\n .pipe( dest('./build/img'))\n .pipe( notify ({ message: 'Imagen Minificada'}))\n}", "title": "" }, { "docid": "0e096c80ff18c787c5b4c6b79f9510ec", "score": "0.5981314", "text": "function img(ref, lang_dependant){ return (!lang_dependant ? pack_grafico + \"img/un/\" + ref : pack_grafico + \"img/\" + idioma + '/' + ref); }", "title": "" }, { "docid": "0e096c80ff18c787c5b4c6b79f9510ec", "score": "0.5981314", "text": "function img(ref, lang_dependant){ return (!lang_dependant ? pack_grafico + \"img/un/\" + ref : pack_grafico + \"img/\" + idioma + '/' + ref); }", "title": "" } ]
bf03d50da42922e5d12e438e9a2718ec
Mostrar todos los elementos del tipo indicado
[ { "docid": "ad7294567c046cf17e0c307d4b81d292", "score": "0.55644464", "text": "function showAllByTag(tagName,dispType) {\r\n\tvar elements = document.getElementsByTagName(tagName);\r\n\tvar i = 0;\r\n\tif (dispType == \"\") {\r\n\t dispType = 'inline';\r\n\t}\r\n\twhile (i < elements.length) {\r\n\t elements[i].style.display = dispType;\r\n\t i++;\r\n\t }\r\n}", "title": "" } ]
[ { "docid": "ad81be2e35ae4dcf8802f5f6732f6d78", "score": "0.58946925", "text": "function escribir_lista_tipos () {\n\tvar tipos = busca_etiquetas('tipo');\t\n\n\tvaciar_lista (elementoHTML);\n\n\t// Rellena la lista con los tipos\t\n\n\t// Caso especial, se tiene que poner escoja un concepto al principio de la lista\n\tif (campoBotones[0] == null && campoBotones[1] == null) {\n\t\tvar elemento = document.createElement('option');\n\t\telemento.value = \"-1\";\n\t\telemento.text = \"Escoja un concepto\";\n\n\t\telementoHTML.options.add(elemento);\n\t}\n\n\tvar c = 0;\n\twhile (c < tipos.length) {\n\t\tvar elemento = document.createElement('option');\n\t\telemento.value = tipos[c].attributes.getNamedItem('id').nodeValue;\n\t\telemento.text = tipos[c].attributes.getNamedItem('descripcion').nodeValue;\n\n\t\ttry {\n\t\t\telementoHTML.options.add(elemento);\n\t\t} catch(e) {\n\t\t\talert ('error');\n\t\t}\n\t\tc++;\n\t}\n\t\n\tif (campoBotones[0] != null && campoBotones[1] != null) {\n\t\t// Ok, se realiza la petición de la lista de atributos\n\t\tleer_lista_atributos (elementoHTML, campoBotones[0], campoBotones[1]);\n\t}\n}", "title": "" }, { "docid": "8e7ba2811336d4f0c1b3043588dfea1c", "score": "0.58502996", "text": "function shorlist() {\n var index = 0;\n object.find('.labeldiagnostico').each(function () {\n if ($(this).attr(\"for\") != settings.tagCodigoDiagPrincipal) {\n index++;\n var idControl = $(this).attr(\"for\");\n $(this).html(settings.labelDiagRelacionado + \" \" + index + \": \");\n }\n }\n );\n }", "title": "" }, { "docid": "e2ddd307b4c562f88dd4a6b2d629ee09", "score": "0.584907", "text": "renderTypes() {\n const t = this.state.types\n if (t.length > 0) {\n return t.map(e => {\n if (e.id != 1)\n return <option key={e.id} value={e.id}>{e.id == 3 ? 'delegataire et administrateur' : e.nom}</option>\n })\n }\n }", "title": "" }, { "docid": "e69bf6d81fc5795d2764184bab93bebf", "score": "0.58451647", "text": "function determinarTipo( tipo ){\n console.log(tipo.obtenerDetalles());\n // solo responde al mismo tipo o a tipos superiores -> instanceof\n // Poner clases de menor a mayor jerarquia\n if (tipo instanceof Gerente){\n console.log('Es un objeto de tipo Gerente');\n console.log(tipo.departamento);\n }\n else if(tipo instanceof Empleado){\n console.log('Es un tipo Empleado');\n console.log(tipo.departamento); // este atributo no existe en la clase padre\n }\n else if(tipo instanceof Object){\n console.log('Es un tipo object');\n }\n}", "title": "" }, { "docid": "5ee15f8ae91af073678c92e1cee859d2", "score": "0.584419", "text": "function getTypes() {\n let types = current.types;\n if (types[0]) {\n type1.innerHTML = types[0].type.name;\n type1.style = \"background-color: #\" + typeColors[types[0].type.name];\n }\n if (types[1]) {\n type2.innerHTML = types[1].type.name;\n type2.style = \"background-color: #\" + typeColors[types[1].type.name];\n }\n}", "title": "" }, { "docid": "19d2d38a2ba1fff2563ba6c450d9e6ff", "score": "0.58412653", "text": "getTipo() {\r\n return this.Tipo;\r\n }", "title": "" }, { "docid": "47b05179e51f27beb19198854c9050e3", "score": "0.58305335", "text": "function readTypeOfElements(){\n\tvar radioBtns = document.getElementsByName(\"mode\");\n\tfor(i = 0; i < radioBtns.length; i++) {\n\t\tif (radioBtns[i].checked){\n\t\t\tvar typeElements = radioBtns[i].value;\n\t\t}\n\t}\n\treturn typeElements;\n}", "title": "" }, { "docid": "9873230c7ce6c58b3732f349cfe85acd", "score": "0.57727706", "text": "function renderTraficInfoByType(data, type) {\n\t\t$('.trafic-info-area').empty();\n\n\t\tvar $area = $('.trafic-info-area');\n\n\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\tif (+type === data[i].category) {\n\t\t\t\tvar message = getTraficinfoContent(data[i]);\n\n\t\t\t\t$area.append(message);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "ef7f5e83e26dbbabb641ca110175f817", "score": "0.5728676", "text": "get Type() {\n let template = '';\n console.log(this.types)\n this.types.forEach(t => template += `| ${t.type.name} `);\n return template;\n }", "title": "" }, { "docid": "c916d76d8a5e1819902bc60593c6431d", "score": "0.5704514", "text": "function printTypes() {\n let typeArea = document.getElementById('types');\n let print = function (type) {\n filterInventory(type);\n populateTable(inventory.filtered);\n }\n // Add items to filter list\n typeArea.innerHTML += '<span id=\"typeAll\"> All - ' + types.All + '</span>';\n typeArea.innerHTML += '<span id=\"typeStatTrak\"> StatTrak™ - ' + types.StatTrak + '</span>';\n typeArea.innerHTML += '<span id=\"typeKeys\"> Keys - ' + types.Keys + '</span>';\n typeArea.innerHTML += '<span id=\"typeSkins\"> Skins - ' + types.Skins + '</span>';\n typeArea.innerHTML += '<span id=\"typeKnife\"> Knives - ' + types.Knife + '</span>';\n typeArea.innerHTML += '<span id=\"typeGloves\"> Gloves - ' + types.Gloves + '</span>';\n typeArea.innerHTML += '<span id=\"typeSticker\"> Sticker - ' + types.Sticker + '</span>';\n typeArea.innerHTML += '<span id=\"typeGraffiti\"> Graffiti - ' + types.Graffiti + '</span>';\n typeArea.innerHTML += '<span id=\"typeContainer\"> Container - ' + types.Container + '</span>';\n // Event Listeners\n document.getElementById('typeAll').addEventListener('click', function () { print('All') }, false);\n document.getElementById('typeStatTrak').addEventListener('click', function () { print('StatTrak') }, false);\n document.getElementById('typeKeys').addEventListener('click', function () { print('Key') }, false);\n document.getElementById('typeKnife').addEventListener('click', function () { print('Knife') }, false);\n document.getElementById('typeGloves').addEventListener('click', function () { print('Gloves') }, false);\n document.getElementById('typeSticker').addEventListener('click', function () { print('Sticker') }, false);\n document.getElementById('typeGraffiti').addEventListener('click', function () { print('Graffiti') }, false);\n document.getElementById('typeContainer').addEventListener('click', function () { print('Container') }, false);\n}", "title": "" }, { "docid": "8eb4c147bdc0bd6c84cbcada3341c1cf", "score": "0.56822586", "text": "function types(modelo){\n var types = \"\";\n if(modelo == \"Freedom RXV\"){\n types = \"\"+\n \"<li>\"+\n \"<input class='modelo_list' type='button' value='Gas' onclick='showDescription(\\\"Freedom RXV\\\",\\\"Gas\\\");'/>\"+\n \"</li>\"+\n \"<li>\"+\n \"<input class='modelo_list' type='button' value='Electrico' onclick='showDescription(\\\"Freedom RXV\\\",\\\"Electrico\\\");'/>\"+\n \"</li>\"+\n \"<li>\"+\n \"<input class='modelo_list' type='button' value='Elite' onclick='showDescription(\\\"Freedom RXV\\\",\\\"Elite\\\");'/>\"+\n \"</li>\";\n }\n carrito.setCost();\n stotal = carrito.cost;\n document.getElementById('types').innerHTML = types;\n}", "title": "" }, { "docid": "5e6c1e3e8791e6b79d4ec57ff9a93806", "score": "0.5678638", "text": "function display_list_type(val) {\n display_list_select(val, 'obj_type', document.ficheForm);\n}", "title": "" }, { "docid": "8a2580df53b837d399fad6cbd3fbd1bc", "score": "0.56625044", "text": "function tipoElemento(){\n var elemento = this.getAttribute(\"elemento\");\n // noContarClicks();\n switch (elemento) {\n case \"bomba\":\n var imagen= document.createElement(\"img\");\n imagen.setAttribute(\"src\", \"assets/img/bomba.png\");\n imagen.setAttribute(\"height\",\"45px\");\n imagen.setAttribute(\"width\", \"41px\");\n this.appendChild(imagen);\n bloqueoDePantalla();\n break;\n case \"numero\":\n this.textContent = 1;\n break;\n case \"vacio\":\n this.style.backgroundColor = \"#E0ECF8\";\n break;\n default:\n }\n}", "title": "" }, { "docid": "e29913fd90016d4790f3bd6b1fb6db8c", "score": "0.5660659", "text": "function showItems(type){\n if(type.length > 0){ // food type is not empty for e.g. drinks, food, dessert\n let itemsToBeDisplayed = JSONdata.menuitems[selectedMenu][type];\n itemsList.innerHTML = \"\";\n itemsToBeDisplayed.forEach( (val,index) => {\n itemsList.innerHTML += `\n <div class=\"product-body\">\n <div class=\"product-left\">\n <div class=\"product-img\">\n <img src=\"images/${selectedMenu}/${type}/${val.name.toLowerCase()}.png\" width=\"70\" height=\"110\" />\n </div>\n </div>\n <div class=\"product-right\">\n <div class=\"product-desc\">\n <span>${val.name}</span><br />\n Rs${parseInt(val.price).toFixed(2)}\n </div>\n <div class=\"product-buttons\">\n <button class=\"decrease\" onclick=\"counter(${index},{child_type:'${type}',type:'${selectedMenu}', productName:'${val.name}',price:'${parseInt(val.price).toFixed(2)}'},'decrease');\">-</button>\n <button class=\"quantity\">0</button>\n <button class=\"increase\" onclick=\"counter(${index},{child_type:'${type}',type:'${selectedMenu}', productName:'${val.name}',price:'${parseInt(val.price).toFixed(2)}'},'increase');\">+</button>\n </div>\n </div>\n </div>`;\n });\n }\n }", "title": "" }, { "docid": "6a9b0467e47c75738b1ef90b005d9baf", "score": "0.5647234", "text": "async getPropertytypes() {\n try {\n const res = await axios.get(`${this.host}/property-type/all`);\n this.state.propertyType = {};\n res.data.forEach((element) => {\n this.state.propertyType[element.property_type_id] =\n element.property_type_name;\n this._qs(\n \".property-type\"\n ).innerHTML += `<option value=\"${element.property_type_id}\">${element.property_type_name}</option>`;\n this._qs(\".browse-items\").innerHTML += `\n <div class=\"row filter-item\">\n <input class=\"browse\" id=\"browse-${element.property_type_id}\" type=\"checkbox\">\n <label for=\"browse-${element.property_type_id}\">${element.property_type_name}</label>\n </div>`;\n });\n } catch (err) {\n this.popup(err, \"error\");\n }\n }", "title": "" }, { "docid": "5f37b35d5708d629d86cb75978179cec", "score": "0.5643129", "text": "Mostrar(){\n\t\t//1) capturar el elemento y guardarlo - clonarlo\n\t\tlet elemento = document.querySelector(\".pelicula\").cloneNode(true)\n\t\tconsole.log(elemento)\n\n\t\t//2) reemplazar/llenar con los datos de ESTA pelicula\n\t\t//buscar dentro del elemento el espacio donde quiero mostrar el titulo,h4, y quiero reemplazarlo. Manipulacion de contenido\n\t\telemento.querySelector(\"h4\").innerText = this.titulo\n\t\telemento.querySelector(\"p\").innerText = this.estreno\n\t\telemento.querySelector(\"img\").src= this.poster\n\n\t\t//3) desocultar el elemento clonado (removiendo la clase hide - manipulacion de estructura)\n\t\telemento.classList.remove(\"hide\")\n\n\t\t//4) anexar el elemento en el contenedor (padre)\n\t\tdocument.querySelector(\"#peliculas\").appendChild(elemento)//anexar\n\n\t\t\tconsole.log(elemento)\n\n\t}", "title": "" }, { "docid": "2b8ea96666e26a22dedd7dcb165a5c5d", "score": "0.56361467", "text": "function listAttractionsTypes() {\n dataBase.fetchTypes().then(types =>{\n let AttractionTypeComponent = createAttraction(types.name);\n writeAttractionTypeToDOM(AttractionTypeComponent);\n })\n}", "title": "" }, { "docid": "16900820343be1b317af5a3d289a77d6", "score": "0.5615057", "text": "function checkboxByTypes() {\n var checkName = ['hideExe', 'hideTxt', 'hideMp4'];\n var checkId = ['exe', 'txt', 'mp4'];\n for (var i=0; i<3; i++) {\n var checkByType = document.createElement('input');\n checkByType.type = 'checkbox';\n checkByType.name = checkName[i];\n checkByType.id = checkId[i];\n var ulByType = document.getElementById('type');\n ulByType.appendChild(checkByType);\n var lblForCheck = document.createElement('label');\n lblForCheck.setAttribute('for', checkId[i]);\n lblForCheck.innerHTML = checkName[i];\n ulByType.appendChild(lblForCheck);\n }\n}", "title": "" }, { "docid": "9ec43ab14d6caf59ba299a8a81d4ceb6", "score": "0.5612206", "text": "function show_all_types(){\n hide_info();\n \n var spells = document.querySelectorAll(\".spells\");\n spells.forEach.call(spells, function(e){\n //show all spells that are not excluded by a book-selection\n if((bookClicked != \"0\" && e.classList.contains(\"bookSelected\")) || (bookClicked == \"0\")){\n e.style.display = \"block\";\n }\n //de-mark all spells as \"there is no type selected (anymore)\"\n if(e.classList.contains(\"typeSelected\")){\n e.classList.toggle(\"typeSelected\");\n }\n });\n}", "title": "" }, { "docid": "2cb3da060f816fac9fefe2c93d13f007", "score": "0.55901843", "text": "function typeOf() {\n var arr = [2, 2.5, 'str', true, [1], {a: 1, b: 2}, null, undefined],\n i,\n len = arr.length;\n for (i = 0; i < len; i += 1) {\n document.getElementById('result').innerHTML =\n \"<br><strong> Типът на Integer е: </strong>\" + typeof (arr[0]) +\n \"<br><strong> Типът на Float е: </strong>\" + typeof (arr[1]) +\n \"<br><strong> Типът на String е: </strong>\" + typeof (arr[2]) +\n \"<br><strong> Типът на Boolean е: </strong>\" + typeof (arr[3]) +\n \"<br><strong> Типът на Array е: </strong>\" + typeof (arr[4]) +\n \"<br><strong> Типът на Object е: </strong>\" + typeof (arr[5]) +\n \"<br><strong> Типът на Null е: </strong>\" + typeof (arr[6]) +\n \"<br><strong> Типът на Undefined е: </strong>\" + typeof (arr[7]);\n }\n}", "title": "" }, { "docid": "81f4946ee76df8827be4f5e07f868198", "score": "0.5583886", "text": "function getType() {\n\tvar pType = document.getElementById(\"p-type\");\n\tconsole.log(pType.value);\n// Display object properties based on user input.\n\n\tfor (var i = 0; i < pArray.length; i++) {\n\n\t\tdocument.getElementById(\"populate\").style.display = \"block\";\n\t\t\n\t\tif (pType.value.toUpperCase() === pArray[i].type) {\n\n\t\t\tdocument.getElementById(\"qList\").style.display = \"block\";\n\t\t\t\n\t\t\tdocument.getElementById(\"letter-sum\").style.display = \"block\";\n\n\t\t\tdocument.getElementById(\"type\").textContent = pArray[i].type;\n\n\t\t\tdocument.getElementById(\"title\").textContent = pArray[i].title;\n\n\t\t\tdocument.getElementById(\"q-header\").textContent = \"Qualities of the \" + pArray[i].type;\n\n\t\t\tdocument.getElementById(\"q1\").textContent = pArray[i].qual1;\n\n\t\t\tdocument.getElementById(\"q2\").textContent = pArray[i].qual2;\n\n\t\t\tdocument.getElementById(\"q3\").textContent = pArray[i].qual3;\n\n\t\t\tdocument.getElementById(\"q4\").textContent = pArray[i].qual4;\n\n\t\t\tdocument.getElementById(\"q5\").textContent = pArray[i].qual5;\n\n\t\t\tdocument.getElementById(\"q6\").textContent = pArray[i].qual6;\n\n\t\t\tdocument.getElementById(\"q7\").textContent = pArray[i].qual7;\n\t\t\t\n\t\t\tdocument.getElementById(\"sum-title\").textContent = \"Summary of the \" + pArray[i].type;\n\t\t\t\n\t\t\tdocument.getElementById(\"sum\").textContent = pArray[i].sum;\n\t\t\t\n\t\t\treturn;\n\t\t} // end if\n\t}; // end for\n\tvar sorry = \"Sorry, \\\"\" + pType.value + \"\\\" does not exist here.\"\n\tdocument.getElementById(\"type\").textContent = sorry;\n\tvar clear = document.getElementsByClassName(\"clear\");\n\tfor(i = 0; i < clear.length; i++) {\n\t\tclear[i].style.display = \"none\";\n\t}\n}", "title": "" }, { "docid": "bbbfc0a8e1c84bb71e6db0f940a2d21a", "score": "0.5571356", "text": "static showNombre(){\n UI.infos_proximites.find('#nombre_canons').innerHTML = Object.keys(this.items).length\n }", "title": "" }, { "docid": "17ec822e5015b4d2343e41c551c607da", "score": "0.55679244", "text": "function busca_etiquetas (nombreEtiqueta) {\n\treturn documentoXML.getElementsByTagName(nombreEtiqueta);\n}", "title": "" }, { "docid": "ce4309d61ef28d5ecd4f210987de2e58", "score": "0.55531853", "text": "function _anyadeCategoriasAlIndex(){\n for(let cat of categorias){\n //anyade al padre, divCajaPedidos, el producto creado\n _addElementInDom(g_selectCateg,_plantillaElementCateg(cat),c_BEFOREEND);\n }\n}", "title": "" }, { "docid": "12bc6147fb536db15e7cf6e7ca9e9d53", "score": "0.55447316", "text": "getNodes(type){\n\n if ( type === undefined) type = 'all';\n\n let list = [];\n\n for (let i=0; i<this.nodes.length; i++)\n\n if (typeof type === 'string') { // in case type is just a simple string\n if (type === this.nodes[i].type || type === \"all\")\n list.push(this.nodes[i]);\n }\n else if (Array.isArray(type)) //in case type is an Array\n if (this.nodes[i].type in type)\n list.push(this.nodes[i]);\n\n return list;\n }", "title": "" }, { "docid": "5a469a6e4f672acb4d0aad8d440b5c0c", "score": "0.55420554", "text": "function kategori() {\n let val = document.getElementById('katego').value;\n if (val === 'intel') {\n produk = document.getElementsByClassName('elemen');\n for (let i = 0; i < produk.length; i++) {\n nama = produk[i].getElementsByClassName('label-nama')[0];\n if (nama.innerHTML.indexOf('Intel') > -1) {\n produk[i].style.display = \"\";\n } else {\n produk[i].style.display = \"none\";\n }\n }\n } else if (val === 'amd') {\n produk = document.getElementsByClassName('elemen');\n for (let i = 0; i < produk.length; i++) {\n nama = produk[i].getElementsByClassName('label-nama')[0];\n if (nama.innerHTML.indexOf('AMD') > -1) {\n produk[i].style.display = \"\";\n } else {\n produk[i].style.display = \"none\";\n }\n }\n } else if (val === 'ram') {\n produk = document.getElementsByClassName('elemen');\n for (let i = 0; i < produk.length; i++) {\n nama = produk[i].getElementsByClassName('label-nama')[0];\n if (nama.innerHTML.indexOf('RAM') > -1) {\n produk[i].style.display = \"\";\n } else {\n produk[i].style.display = \"none\";\n }\n }\n } else {\n produk = document.getElementsByClassName('elemen');\n for (let i = 0; i < produk.length; i++) {\n nama = produk[i].getElementsByClassName('label-nama')[0];\n produk[i].style.display = \"\";\n }\n }\n}", "title": "" }, { "docid": "ef267db431a285c82223e1350ebaa4aa", "score": "0.5523676", "text": "function imprimir(tipo){\n console.log(tipo.obtenerDetalles());\n determinarTipo(tipo);\n}", "title": "" }, { "docid": "32d2deefd16ca6edf3fa2b19b1bfd72b", "score": "0.5516515", "text": "function aparecer_opciones (opciones){\n\n for (i=0;i<opciones.length;i++)\n {\n $('.'+opciones[i]).show();\n $('#'+opciones[i]).show();\n }\n\n }", "title": "" }, { "docid": "af996931b2648af27026cf32724dedf1", "score": "0.5511618", "text": "static get types() {\n return {\n 'treble': {\n code: 'gClef',\n line: 3,\n },\n 'bass': {\n code: 'fClef',\n line: 1,\n },\n 'alto': {\n code: 'cClef',\n line: 2,\n },\n 'tenor': {\n code: 'cClef',\n line: 1,\n },\n 'percussion': {\n code: 'restMaxima',\n line: 2,\n },\n 'soprano': {\n code: 'cClef',\n line: 4,\n },\n 'mezzo-soprano': {\n code: 'cClef',\n line: 3,\n },\n 'baritone-c': {\n code: 'cClef',\n line: 0,\n },\n 'baritone-f': {\n code: 'fClef',\n line: 2,\n },\n 'subbass': {\n code: 'fClef',\n line: 0,\n },\n 'french': {\n code: 'gClef',\n line: 4,\n },\n 'tab': {\n code: '6stringTabClef',\n },\n };\n }", "title": "" }, { "docid": "06ef80e56f01e4293c5ff9fbec3cb779", "score": "0.54941565", "text": "showTypeName() {\n const currentSpan = this.widgetHtml.first()[0].getElementsByClassName('current').item(0).getElementsByClassName('label').item(0);\n //display label\n currentSpan.textContent = this.specProvider.getLabel(this.ParentComponent.getTypeSelected());\n }", "title": "" }, { "docid": "8469e91d1340dfaf7084680806bd5fd6", "score": "0.5490101", "text": "function candidadCarritoIcono() {\n let contador\n let cantidad = 0\n let i = 0;\n Object.values(carrito).forEach(producto => {\n contador = producto.cantidad\n cantidad = cantidad + contador\n })\n cantidadCarritoIcono.querySelector('span').textContent = cantidad\n}", "title": "" }, { "docid": "2824a9c1888375702fea3d3ad404c2be", "score": "0.5466307", "text": "function skinTypeButtons() {\n for (let i = 0; i < skinTypes.length; i++) {\n\n let col = $(`<div class=\"text-center col-6 col-sm-4\">`);\n let icon = $(`<i value=\"st${i+1}\" class=\"fas fa-user skin-type st${i+1} btn\"></i>`);\n let description = $(`<p>${skinTypes[i]}</p>`);\n col = $(col).append(icon).append(description);\n\n $(\"#skin-buttons\").append(col);\n\n\n }\n }", "title": "" }, { "docid": "86816ea5e86f2299f326ad321cbaf769", "score": "0.5465805", "text": "async function loadType() {\r\n var getType = await docGetType(docenteDatos.type);\r\n if (getType.data()) {\r\n // console.log(getType.data().nombreTipo);\r\n typeTag.textContent = getType.data().nombreTipo;\r\n \r\n } else {\r\n typeTag.textContent = docenteDatos.type;\r\n }\r\n }", "title": "" }, { "docid": "7a029429b3ce1f636fb4595a749d4978", "score": "0.5459987", "text": "function renderTypes (types) {\n\n const selectElement = document.querySelector('#pokemon_types');\n selectElement.addEventListener('change', typesFilter);\n for(let i = 0; i < types.length; i++){\n const optionElement = document.createElement('option');\n\n optionElement.innerHTML = types[i]['name'];\n selectElement.appendChild(optionElement);\n }\n}", "title": "" }, { "docid": "1e9acae5427c4a79564b67517c188cf8", "score": "0.5456504", "text": "function makePokemonTypeLabels(types) {\n if (!Array.isArray(types)) return;\n if (types.length === 0) return;\n\n let temp = [];\n\n types.forEach((elem) => {\n let span = document.createElement(\"span\");\n span.classList.add(`${elem}`);\n span.innerText = elem;\n temp.push(span);\n });\n\n return temp;\n}", "title": "" }, { "docid": "0a616c8f776f06b7e676576f51d49852", "score": "0.5425898", "text": "function mostrar_lletres(){\n\n var nom_propi = new Array(\"C\", \"L\", \"A\", \"R\", \"A\");\n console.log(nom_propi.constructor); //Aquesta línia no caldria, és només per mostrar per consola que s'ha creat realment un Array\n var i;\n\n for(i = 0; i < nom_propi.length; i++){\n var result = nom_propi[i];\n console.log(result);\n }\n}", "title": "" }, { "docid": "a1a0d021f40284cc2dc0e14c42fdf3b7", "score": "0.54169744", "text": "function agregaTarea(){\n var inputRecuperar=document.getElementById(\"agregar\").value;// recupera la \"nota nueva\" del input\n var datos = new tareas(inputRecuperar);\n datosTareas.push(datos);// agrega a mi array el dato que le ingrese por input\n for(var i=datosTareas.length-1;i<datosTareas.length;i++){//inicia desde el ultimo elemento y recorre\n var ul=document.getElementById(\"mostrar\");\n var li=document.createElement(\"li\");\n // var nuevoImpresion=document.getElementById(\"nuevaTarea\");\n li.innerHTML=datosTareas[i].title;\n ul.appendChild(li);\n \n }\n}", "title": "" }, { "docid": "4bc08697afdba6da5e64de59f1a184c1", "score": "0.54122764", "text": "function ocultarFormularios(){\r\n for(let item of formularioMetodoDePago){\r\n item.style.display = \"none\";\r\n }\r\n}", "title": "" }, { "docid": "a75bfaff5712961e464caa84c12ed01f", "score": "0.5407663", "text": "function mostrarAntecedente(tipo)\n{\n switch (tipo)\n {\n case 'R':\n document.getElementById('antecedente_reincidencia').style.display = \"\";\n document.getElementById('antecedente_policia').style.display = \"none\";\n\n document.getElementById('letra_policia').value = \"\";\n document.getElementById('nro_policia').value = \"\";\n break;\n\n case 'P':\n document.getElementById('antecedente_reincidencia').style.display = \"none\";\n document.getElementById('antecedente_policia').style.display = \"\";\n\n document.getElementById('nro_reincidencia').value = \"\";\n break;\n\n }\n\n\n}", "title": "" }, { "docid": "185a799a32b9f3cc37306a2fdfb6c620", "score": "0.5402596", "text": "function loadAllClasses() {\n return vm.classe.map( function (item) {\n return item;\n /*return {\n value: item.toLowerCase(),\n display: item\n };*/\n });\n }", "title": "" }, { "docid": "47851099909278fece8fb48dd7aca02d", "score": "0.53991973", "text": "function stampaOggetto (arrSelection,contenitore) {\n arrSelection.forEach(elemento => {\n //Destrutturare l'elemento \n const {name , prefix , type} = elemento;\n //Stampiamo la funzione in Html utilizzando la proprietà JavaScrip .innerHTML ed il Template Literals\n contenitore.innerHTML += `\n <div>\n <i class=\"${prefix} ${type}\" style=\"color:blue\"></i>\n <div class=\"title\">${name}</div>\n </div>\n `; \n});\n}", "title": "" }, { "docid": "cfdfca1c466d97f30842cd112ee11d68", "score": "0.5396971", "text": "function loadRecipes() {\n var el = document.getElementById('RecipeType');\n try {\n var result = recipes.recipeType.filter(function (i) { return i.name === el.value; }).map(function (i) { return ({ rType: i.class }); });\n }\n catch (ex) {\n return;\n }\n var classList = document.getElementById('RecipeClass');\n var len = result[0].rType.length;\n classList.value = \"\";\n for (var i = 0; i < len; i++) {\n classList.value = classList.value + result[0].rType[i].type;\n classList.value = ((i + 1 == len) ? classList.value : classList.value + \"\\n\");\n }\n}", "title": "" }, { "docid": "7ae6afde1e66ca8dd1ecc7cd15fc341e", "score": "0.53953654", "text": "function createButtonType (data) {\n data.forEach(element =>{\n element.type.forEach(element =>{\n\n btnType += `<button class=\"btn btn-primary ${element}\">\n ${element}\n</button>`\n \n});\ndocument.getElementById(`type${element.id}`).innerHTML = btnType;\n btnType=\"\"; \n\n })}", "title": "" }, { "docid": "64c3c99c30a2117840595256abd5534f", "score": "0.539205", "text": "function cambioIdioma(aux){\r\n var traduccion_ESP = document.getElementsByClassName(\"ESP\");\r\n var traduccion_EN = document.getElementsByClassName(\"EN\");\r\n\r\n if(aux){\r\n /*oculto todos los parrafos que contengan la etiqueta ESP y desoculto los que tengan la etiqueta EN*/\r\n for (var i = 0; i < traduccion_ESP.length; i++) {\r\n traduccion_ESP[i].style.display = \"none\";\r\n traduccion_EN[i].style.display = \"inline-block\";\r\n }\r\n }\r\n else{\r\n /*oculto todos los parrafos que contengan la etiqueta EN y desoculto los que tengan la etiqueta ESP*/\r\n for (var i = 0; i < traduccion_EN.length; i++) {\r\n traduccion_EN[i].style.display = \"none\";\r\n traduccion_ESP[i].style.display = \"inline-block\";\r\n }\r\n }\r\n}", "title": "" }, { "docid": "3480db9ec087753ae76d57d78118e1e8", "score": "0.539139", "text": "function hideTypeTitles() {\n svg.selectAll('.type').style(\"visibility\", \"hidden\");\n }", "title": "" }, { "docid": "71d879129c673f36dbcd44afeda082a4", "score": "0.53851116", "text": "function show_selected_type(type){\n hide_info();\n\n //then get all spells...\n var spells = document.querySelectorAll(\".spells\");\n var type = type.toLowerCase();\n // ...and hide all that have the wrong type\n spells.forEach.call(spells, function(e){\n if(!e.classList.contains(type)){\n e.style.display = \"none\";\n }\n else{\n //mark those spells as \"selected bc. there is a type selected\"\n e.classList.toggle(\"typeSelected\");\n }\n }); \n}", "title": "" }, { "docid": "1bbb57b7129304f4c4c4b8a15345f14b", "score": "0.53711754", "text": "static get listaGeneros(){\n return [`Action`,`Adult`,`Adventure`,`Animation`,`Biography`,\n `Comedy`,`Crime`,`Documentary`,`Drama`,`Family`,`Fantasy`,`Film Noir`,\n `Game-Show`,`History`,`Horror`,`Musical`,`Music`,`Mastery`,`News`,\n `Reality-TV`,`Romance`,`Sci-Fi`,`Short`,`Sport`,`Sport`,`Talk-Show`,\n `Thriller`,`War`,`Wetern`]\n }", "title": "" }, { "docid": "cb66ff6a1fd40c3ddf8a250636976f91", "score": "0.53684473", "text": "function verificaTipo(tipo){\n return Object.prototype.toString.call(tipo)\n}", "title": "" }, { "docid": "ff9caa574e7593a50675b10715994b80", "score": "0.536842", "text": "function filtre(type, click) {\r\n\t// On update le filtre dans l'array\r\n\tvar index = filtreList.indexOf(type);\r\n\tif (index == -1) {\r\n\t\tif (click == 2) {\r\n\t\t\tfiltreList.push(type);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tfiltreList = [type];\r\n\t\t}\r\n\t}\r\n\telse {\r\n\t\tfiltreList.splice(index, 1);\r\n\t}\r\n\t// On update le texte indiquant les filtres utilisés\r\n\tif (filtreList.length == 0) {\r\n\t\tdocument.getElementById(\"Page-Menu-Filtres-Texte\").innerHTML = 'Filter: None';\r\n\t}\r\n\telse {\r\n\t\tvar texte = '';\r\n\t\tfor (var i=0; i<filtreList.length; i++) {\r\n\t\t\ttexte = texte + filtreList[i] + ' ';\r\n\t\t}\r\n\t\tdocument.getElementById(\"Page-Menu-Filtres-Texte\").innerHTML = 'Filter: ' + texte;\r\n\t}\r\n\t// On clear la liste des ninjas\r\n\tvar div = document.getElementById(\"Page-Menu-Liste-Ninja\");\r\n\tdiv.innerHTML = \"\";\r\n\t// On parcourt tout les ninjas et on ajoute si tout les filtres correspondent s'il y en a\r\n\tif (filtreList.length == 0) {\r\n\t\tafficherNinjaList();\r\n\t}\r\n\telse {\r\n\t\tvar compteur = 0;\r\n\t\tvar div = document.getElementById(\"Page-Menu-Liste-Ninja\");\r\n\t\tvar btn;\r\n\t\tfor (var j in ninjaList) {\r\n\t\t\tvar bool = 1;\r\n\t\t\tvar boolrole = 0;\r\n\t\t\tfor (var k in filtreList) {\r\n\t\t\t\tvar tmpFiltre = typeFiltreDict[filtreList[k]];\r\n\t\t\t\tif (tmpFiltre == 'mainstat') {\r\n\t\t\t\t\tif (filtreDict[filtreList[k]] != ninjaList[j].mainstat) {\r\n\t\t\t\t\t\tbool = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if (tmpFiltre == 'range') {\r\n\t\t\t\t\tif (filtreList[k] == 'Ranged') {\r\n\t\t\t\t\t\tif (ninjaList[j].range == 0) {\r\n\t\t\t\t\t\t\tbool = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tif (ninjaList[j].range > 0) {\r\n\t\t\t\t\t\t\tbool = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if (tmpFiltre == 'rarity') {\r\n\t\t\t\t\tif (filtreList[k] != ninjaList[j].rarity) {\r\n\t\t\t\t\t\tbool = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if (tmpFiltre == 'role') {\r\n\t\t\t\t\tfor (var l in ninjaList[j].role) {\r\n\t\t\t\t\t\tif (filtreList[k] == ninjaList[j].role[l]) {\r\n\t\t\t\t\t\t\tboolrole = 1;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbool = boolrole;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (bool == 1) {\r\n\t\t\t\tbtn = document.createElement(\"input\");\r\n\t\t\t\tbtn.type = \"image\";\r\n\t\t\t\tbtn.src = ninjaList[j].src;\r\n\t\t\t\tbtn.value = ninjaList[j].nom;\r\n\t\t\t\tbtn.onclick = function() {\r\n\t\t\t\t\tprofilNinja(this);\r\n\t\t\t\t}\r\n\t\t\t\tdiv.appendChild(btn);\r\n\t\t\t\tcompteur++;\r\n\t\t\t\tif (compteur == 8) {\r\n\t\t\t\t\tvar br = document.createElement(\"br\");\r\n\t\t\t\t\tdiv.appendChild(br);\r\n\t\t\t\t\tcompteur = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "03e42935bd377add0aa794d48cbbfa8b", "score": "0.53520036", "text": "function showCheckboxResults(data, typeObject, dataCount) {\n if (typeObject.length === 0) {\n for (var i = 0; i < dataCount; i++) {\n dataR = data[i];\n createList(dataR);\n }\n } else {\n for (var i = 0; i < dataCount; i++) {\n dataR = data[i];\n\n typeObject.forEach(function (value, index, array) {\n if (dataR.type == value) {\n createList(dataR);\n }\n });\n }\n }\n}", "title": "" }, { "docid": "f68109c226e7960bbb3fe52e8435019c", "score": "0.53401476", "text": "function mostrarHijos(){\n\tvar i;\n\tfor(i=0;i < this.cantHijos;i++){\n\t\tdocument.write('&nbsp;&nbsp;&nbsp;hijos['+i+']: '+this.hijos[i]+' - '+this.hijosNombre[i]+'<br>');\n\t}\n}", "title": "" }, { "docid": "975bc2d276c9c7ce7a974352ec73216d", "score": "0.533989", "text": "function leer_lista_tipos (nombreListaTipos, nombreListaAtributos, nombreEtiqueta) {\n\tvar desplegableTipos = document.getElementById(nombreListaTipos);\n\tparametrosPeticion='';\n\tcargarXML ('listaTipos', desplegableTipos, Array(nombreListaAtributos, nombreEtiqueta), escribir_lista_tipos);\n}", "title": "" }, { "docid": "74b0e76da39d3fc56520495aedd67088", "score": "0.53305435", "text": "function getTipoCuentaName(tipoCuentaNumber){\n for (var key in CATALOGO_TIPO_CUENTA) {\n if (CATALOGO_TIPO_CUENTA[key].value == tipoCuentaNumber) {\n return CATALOGO_TIPO_CUENTA[key].name;\n }\n }\n}", "title": "" }, { "docid": "5ade458b77fcc0edae27d70a2e72c2ba", "score": "0.53302294", "text": "function toGetTipoCant(tipo) {\n bufferTipoCant = tipos.find(e => e.tipo == tipo).cantidad;\n}", "title": "" }, { "docid": "61fa5f28fec7003bf5aa367f5ab3fa56", "score": "0.53269714", "text": "toString() {\n //se aplica polimorfismo(multiples formas en tiempo de ejecucion)\n //el metodo que se ejecuta depende si es una referencia de tipo padre o de tipo hijo\n return this.nombreCompleto();\n }", "title": "" }, { "docid": "059d2c5df505c78843cd6cc1188b2e8d", "score": "0.5326104", "text": "function filterbyType(type) {\n itemsToShow = [];\n for (i = 0; i < data.length; i++) { \n let item = data[i];\n if (type == 0 || item.type == (type-1) ) {\n itemsToShow.push(i); \n }\n }\n}", "title": "" }, { "docid": "c9c3b2e33c29fb91d8eca5f3b4a2e186", "score": "0.53247666", "text": "getSelects (type) {\n let texts = []\n const values = []\n this.$drop.find(sprintf`input[${s}]:checked`(this.selectItemName)).each((i, el) => {\n texts.push($(el).parents('li').first().text())\n values.push($(el).val())\n })\n\n if (type === 'text' && this.$selectGroups.length) {\n texts = []\n this.$selectGroups.each((i, el) => {\n const html = []\n const text = $.trim($(el).parent().text())\n const group = $(el).parent().data('group')\n const $children = this.$drop.find(sprintf`[${s}][data-group=\"${s}\"]`(\n this.selectItemName, group\n ))\n const $selected = $children.filter(':checked')\n\n if (!$selected.length) {\n return\n }\n\n html.push('[')\n html.push(text)\n if ($children.length > $selected.length) {\n const list = []\n $selected.each((j, elem) => {\n list.push($(elem).parent().text())\n })\n html.push(`: ${list.join(', ')}`)\n }\n html.push(']')\n texts.push(html.join(''))\n })\n }\n return type === 'text' ? texts : values\n }", "title": "" }, { "docid": "a6435b21684dc3a55e41ad066b2c9d9a", "score": "0.5305399", "text": "function showTypeTitles() {\n // Another way to do this would be to create\n // the year texts once and then just hide them.\n var turbineData = d3.keys(turbineTitlePos);\n\tvar turbineDescriptionData = d3.keys(turbineDescription);\n var years = svg.selectAll('.type')\n .data(turbineData);\n\n years.enter().append('text')\n .attr('class', 'type')\n .attr('x', function (d) { return turbineTitlePos[d].x; })\n .attr('y', function (d) { return turbineTitlePos[d].y; })\n .attr('text-anchor', 'middle')\n .text(function (d) { return d; });\n\t //.on('mouseover', showTypeDetail)\n //.on('mouseout', hideTypeDetail);\n }", "title": "" }, { "docid": "86df8e357e1cb00e68551de471602164", "score": "0.5299895", "text": "function showFilters(json) {\n html_filter.innerHTML = \"\";\n for (let data of json) {\n let str = `<div data-typeid=\"${data.typeID}\" class=\"js-filter-type c-filter--type c-filter--type-${data.typeCode}\">${data.type}</div>`;\n html_filter.innerHTML += str;\n }\n}", "title": "" }, { "docid": "3d705c2a8e2b30763a1dabebb6d6c489", "score": "0.5298163", "text": "function col_types(col_ix) {\n\n if(ds.columns[col_ix].types.length == 1) {\n s = '<p style=\"margin-bottom:2px\"><i class=\"fa fa-check\" style=\"color:green\"></i> Homogeneous type</p>';\n } else {\n s = '<p style=\"margin-bottom:2px\"><i class=\"fa fa-exclamation-triangle\" style=\"color:orange\"></i> Mixed types</p>';\n }\n s += '<table id=\"col-types-table-' + col_ix + '\" class=\"table table-col-types table-borderless table-hover table-condensed\"><tbody>';\n for(var col_type_ix = 0; col_type_ix < ds.columns[col_ix].types.length; col_type_ix++) {\n s += '<tr class=\"data-type-' + ds.columns[col_ix].types[col_type_ix].type + '\">' + \n '<td style=\"width:40%\">' + ds.columns[col_ix].types[col_type_ix].type + '</td>' + \n '<td style=\"width:40%\">' + ds.columns[col_ix].types[col_type_ix].subtype + '</td>' +\n '<td style=\"width:20%\">' + ds.columns[col_ix].types[col_type_ix].count.toLocaleString('en') + '</td>' + \n '</tr>';\n }\n return s + '</tbody></table>';\n}", "title": "" }, { "docid": "128a73d59a274544ee48da69808c64de", "score": "0.5296365", "text": "function mostrarTodosMedicamentos(){\n var medicamentos = document.querySelectorAll(\".medicamento\");\n for (var i = 0; i < medicamentos.length; i++) {\n medicamentos[i].classList.remove(\"is-hidden\");\n }\n}", "title": "" }, { "docid": "7361f713d337d6bdc07d04f90ea5152a", "score": "0.5282034", "text": "get optionsTipoId() {\n return [\n { label: 'Pasaporte', value: 'Pasaporte' },\n { label: 'Cédula', value: 'Cédula' },\n { label: 'Otro', value: 'Otro' },\n ];\n }", "title": "" }, { "docid": "cec329e3e97b3692bd4e792054f7d06a", "score": "0.5268058", "text": "function cambia_tienda(){\r\n let tiendas = document.getElementsByClassName(\"tienda\");\r\n let select= document.getElementById(\"filtrotienda\");\r\n let x = select.selectedIndex;\r\n if(select.options[x].text== \"Restauración\"){\r\n for(var i =0 ; i<tiendas.length; ++i){\r\n if(tiendas[i].childNodes[3].textContent != \"Restauración\") tiendas[i].style.display = \"none\";\r\n else tiendas[i].style.display = \"\"\r\n }\r\n }\r\n else if(select.options[x].text== \"Ropa\"){\r\n for(var i =0 ; i<tiendas.length; ++i){\r\n if(tiendas[i].childNodes[3].textContent != \"Ropa\") tiendas[i].style.display = \"none\"\r\n else tiendas[i].style.display = \"\"\r\n }\r\n }\r\n else if(select.options[x].text== \"Ocio\"){\r\n for(var i =0 ; i<tiendas.length; ++i){\r\n if(tiendas[i].childNodes[3].textContent != \"Ocio\") tiendas[i].style.display = \"none\"\r\n else tiendas[i].style.display = \"\"\r\n }\r\n }\r\n else if(select.options[x].text== \"DutyFree\"){\r\n for(var i =0 ; i<tiendas.length; ++i){\r\n if(tiendas[i].childNodes[3].textContent != \"DutyFree\") tiendas[i].style.display = \"none\"\r\n else tiendas[i].style.display = \"\"\r\n }\r\n }\r\n else if(select.options[x].text== \"Otros\"){\r\n for(var i =0 ; i<tiendas.length; ++i){\r\n if(tiendas[i].childNodes[3].textContent != \"Otros\") tiendas[i].style.display = \"none\"\r\n else tiendas[i].style.display = \"\"\r\n }\r\n }\r\n else if(select.options[x].text== \"Todos\"){\r\n for(var i =0 ; i<tiendas.length; ++i){\r\n tiendas[i].style.display = \"\"\r\n }\r\n }\r\n}", "title": "" }, { "docid": "437f5ff70cd4a09ad4289209c38252f8", "score": "0.5264035", "text": "function DisplayData(data) {\n // Work with JSON data here\n all_insurances = data.types\n for (let index = 0; index < all_insurances.length; index++) {\n var element = all_insurances[index];\n var x = element.insurances\n console.log(x)\n\n $('.insurance-types').append(`\n <div class=\"insurance\">\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-12\">\n <h3>${element.title}</h3>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-12 p-0\">\n <ul class=\"types\">\n \n ${element.insurances.map(el => \n \n ( \"<li> <div class='icon'><img src=\"+el.icon+\" alt=''> </div><div class='icon-name'>\"+el.iconName+\"</div></li>\")\n )\n }\n </ul>\n </div>\n </div>\n </div>\n </div>`)\n \n }\n \n}", "title": "" }, { "docid": "1a8802edf56a6b2ce57ec310b042cf89", "score": "0.52592087", "text": "get typesDescription() {\n return this._typesDescription;\n }", "title": "" }, { "docid": "caf867e80936c7e04c5cfd134beae57f", "score": "0.5250077", "text": "function cargarTiposFalla(fallas){\n\tvar $opcionesFallas = $('#tipoFalla');\n\t$opcionesFallas.empty();\n\t$(fallas).each(function(indice,elemento){\n\t\tvar opcion = new Option(capitalize(elemento.nombre),elemento.id,true,true);\n\t $(opcion).click(function(){\n\t \tcargarOpcionesFalla(elemento.atributos,elemento.reparaciones,elemento.criticidades);\n\t });\n\t $opcionesFallas.append(opcion);\n\t});\n\tcargarOpcionesFalla(fallas[0].atributos,fallas[0].reparaciones, fallas[0].criticidades);\n\t$opcionesFallas.val(fallas[0].id);\n}", "title": "" }, { "docid": "e8a556c86e91b9467d218499ae096a84", "score": "0.5244289", "text": "listadocompleto() {\n // recorremos el arreglo de tareas\n this.liastadoArray.forEach((tarea, i) => {\n // para iniciar el indice con el 1 en lugar de 0 y ponemos en color verde\n const idx = `${i + 1}.`.green;\n // desestructuramos la descripcion y completado en\n const { desc, completadoEn } = tarea;\n // comprobamos que completado existe, asignamos el verde a completado y rojo a pendiente\n const estado = (completadoEn) ? 'Completada'.green : 'Pendiente'.red;\n // mostramos la lista\n console.log(`${idx} ${desc} :: ${estado}`);\n });\n\n }", "title": "" }, { "docid": "82940456a13dda183bce6022f8588c5b", "score": "0.5243923", "text": "getTiposVacunas() {\n return this.http.get(`${_interfaces_interface__WEBPACK_IMPORTED_MODULE_0__[\"API_URI\"]}/tipo_vacunas`);\n }", "title": "" }, { "docid": "2614007c6cf72b03716fb8cbdac24e2a", "score": "0.5240398", "text": "function print2() {\n icone.forEach(element => {\n\n //destructuring e assegnazione markup\n const {name, prefix, type, color} = element;\n const markup = `<div>\n <i class=\"${prefix} ${type}\" style=\"color:${color}\"></i>\n <div class=\"title\">${name.toUpperCase()}</div>\n </div>`;\n \n //appendiamo\n iconSection.append(markup); \n });\n }", "title": "" }, { "docid": "e8c03f25b8d6bc48de5bcde8eb89650b", "score": "0.5232214", "text": "function tipo_agua(name) {\n this.name = name;\n}", "title": "" }, { "docid": "d412ce47fc756b9bbd0827040374eefd", "score": "0.52259237", "text": "function tipoDeDado(valor){\n return console.log(typeof valor);\n}", "title": "" }, { "docid": "bb3c4a0bd75b8c13752eb10724780fce", "score": "0.52055794", "text": "function _func_estudiantes(){\n for (var i = 0; i < json_estudiantes.length; i++) {\n document.getElementById(\"codigo\"+i).innerHTML = json_estudiantes[i].codigo;\n document.getElementById(\"nombre\"+i).innerHTML = json_estudiantes[i].nombre;\n document.getElementById(\"nota\"+i).innerHTML = json_estudiantes[i].nota;\n }\n listaEstudiantesLlena = true;\n}", "title": "" }, { "docid": "59bbb571fc3cc1fe1f48080dec0b9dec", "score": "0.5203634", "text": "function MostrarCategorias(){\n\t$(\"#ali\").hide();\n\t$(\"#tableAli\").hide();\n\t$(\"#jug\").hide();\n\t$(\"#tableJug\").hide();\n\t$(\"#nica\").hide();\n\t$(\"#tablenica\").hide();\n\t$(\"#ticos\").hide();\n\t$(\"#tableticos\").hide();\n\t$(\"#beb\").hide();\n\t$(\"#tableBeb\").hide();\n\t$(\"#baz\").hide();\n\t$(\"#tableBaz\").hide();\n\t$(\"#cos\").hide();\n\t$(\"#tableCos\").hide();\n\t$(\"#per\").hide();\n\t$(\"#tablePer\").hide();\n\t$(\"#ves\").hide();\n\t$(\"#tableVes\").hide();\n\tfor(var i=0;i<colProductos.length;i++){\n\t\tvar cate;\n\t\tfor(var l=0;l<colDisponibles.length;l++){\n\t\t\tif(colProductos[i].Codigo==colDisponibles[l].Codigo){\n\t\t\t\tcate=colDisponibles[l].Categoria;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tswitch(cate){\n\t\t\tcase \"Alimentos\":\n\t\t\t\t$(\"#ali\").show();\n\t\t\t\t$(\"#tableAli\").show();\n\t\t\t\tbreak;\n\t\t\tcase \"Jugueteria\":\n\t\t\t\t$(\"#jug\").show();\n\t\t\t\t$(\"#tableJug\").show();\n\t\t\t\tbreak;\n\t\t\tcase \"Electronica\":\n\t\t\t\t$(\"#nica\").show();\n\t\t\t\t$(\"#tablenica\").show();\n\t\t\t\tbreak;\n\t\t\tcase \"Electrodomesticos\":\n\t\t\t\t$(\"#ticos\").show();\n\t\t\t\t$(\"#tableticos\").show();\n\t\t\t\tbreak;\n\t\t\tcase \"Bebidas\":\n\t\t\t\t$(\"#beb\").show();\n\t\t\t\t$(\"#tableBeb\").show();\n\t\t\t\tbreak;\n\t\t\tcase \"Bazar\":\n\t\t\t\t$(\"#baz\").show();\n\t\t\t\t$(\"#tableBaz\").show();\n\t\t\t\tbreak;\n\t\t\tcase \"Cosmeticos\":\n\t\t\t\t$(\"#cos\").show();\n\t\t\t\t$(\"#tableCos\").show();\n\t\t\t\tbreak;\n\t\t\tcase \"Perfumeria\":\n\t\t\t\t$(\"#per\").show();\n\t\t\t\t$(\"#tablePer\").show();\n\t\t\t\tbreak;\n\t\t\tcase \"Vestimenta\":\n\t\t\t\t$(\"#ves\").show();\n\t\t\t\t$(\"#tableVes\").show();\n\t\t\t\tbreak;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "35907c6bcf89cc478aa4f4d797728bc9", "score": "0.51894337", "text": "static get infoTienda() {\n console.log('productos tienda xd')\n }", "title": "" }, { "docid": "83203ce3b88b52715ec7dcefbd49fe27", "score": "0.518658", "text": "function mostrarArray(elementos , textoCustom = \"\")\n{\n document.write(\" Los elementos del array \" + textoCustom);\n debugger;\n document.write(\"<ul>\");\n elementos.forEach((elemento, indice) => {\n document.write( \"<li>\" + indice + \" - \" + elemento + \"</li>\");\n });\n document.write(\"</ul>\");\n}", "title": "" }, { "docid": "ce8f6013b98529f338dcb99323145eac", "score": "0.5184525", "text": "function showElementsData(table) {\n table.find('td.element').each(function() {\n var eData = $(this).children('.data');\n\n var displayProperties = eData.children('input[data-label=\"Name, symbol, number\"]').val().split(',', 3);\n var name = displayProperties[0].replace(/[^A-Za-z]/g, '');\n var symbol = displayProperties[1].replace(/[^A-Za-z]/g, '');\n var number = parseInt(displayProperties[2].replace(/[^0-9]/g, ''));\n\n var weight = eData.children('input[data-label=\"Standard atomic weight\"]').val().split(' ', 1)[0];\n weight = weight.charAt(0).match(/[\\(|\\[]/g) || weight === \"Unknown\" ? weight : Math.round(parseFloat(weight) * 1000) / 1000;\n var type = eData.children('input[data-label=\"Element category\"]').val();\n type = type.split(' ', 1)[0].toLowerCase().replace(/[^A-Za-z]/g, '');\n\n $(this).find('span.name').html(name);\n $(this).find('span.symbol').html(symbol);\n $(this).find('span.number').html(number);\n $(this).find('span.weight').html(weight);\n\n $(this).addClass(type)\n .attr( { 'title': name } )\n });\n}", "title": "" }, { "docid": "d674d320ecb11eca0fb7fb8c690a801e", "score": "0.5182385", "text": "function descripcio(){\r\n for (var i=0;i<Consolas.length;i++){\r\n document.getElementsByTagName(\"p\")[0].append(document.createElement(\"br\"));\r\n document.getElementsByTagName(\"p\")[0].append(\"Consola \"+(i+1));\r\n document.getElementsByTagName(\"p\")[0].append(document.createElement(\"br\"));\r\n document.getElementsByTagName(\"p\")[0].append(\"El nom de la consola es: \"+Consolas[i].nom);\r\n document.getElementsByTagName(\"p\")[0].append(document.createElement(\"br\"));\r\n document.getElementsByTagName(\"p\")[0].append(\"La gpu de la consola es: \"+Consolas[i].gpu);\r\n document.getElementsByTagName(\"p\")[0].append(document.createElement(\"br\"));\r\n document.getElementsByTagName(\"p\")[0].append(\"La cpu de la consola es: \"+Consolas[i].cpu);\r\n document.getElementsByTagName(\"p\")[0].append(document.createElement(\"br\"));\r\n document.getElementsByTagName(\"p\")[0].append(\"La ram de la consola es: \"+Consolas[i].ram);\r\n document.getElementsByTagName(\"p\")[0].append(document.createElement(\"br\"));\r\n document.getElementsByTagName(\"p\")[0].append(\"La capacitat de SSD de la consola es: \"+Consolas[i].capacitat);\r\n document.getElementsByTagName(\"p\")[0].append(document.createElement(\"br\"));\r\n document.getElementsByTagName(\"p\")[0].append(\"El preu de la consola es: \"+Consolas[i].preu);\r\n document.getElementsByTagName(\"p\")[0].append(document.createElement(\"br\"));\r\n document.getElementsByTagName(\"p\")[0].append(\"Tenim \"+Consolas[i].estoc+ \" consolas en stock\");\r\n document.getElementsByTagName(\"p\")[0].append(document.createElement(\"br\"));\r\n }\r\n}", "title": "" }, { "docid": "67b3830b603c9ddf68281f7e02fb58e8", "score": "0.51794374", "text": "listadoCompleto(){\n if(this.listadoArr[0] == undefined){\n console.log(''); //deja un salto de linea\n console.log('No hay tareas.');\n }else{ \n let i = 1;\n console.log(''); //deja un salto de linea\n this.listadoArr.forEach(tarea => {\n let completada = tarea.completada;\n completada = (completada!=null) ? \n completada = colors.green('Completada') : \n completada = colors.red('Pendiente ');\n\n console.log(`${colors.white(i + '.')} ${completada} ${colors.blue('::')} ${tarea.desc}`);\n i++;\n }); \n }\n }", "title": "" }, { "docid": "d0fc94ef4aaf9de60abcead20e031085", "score": "0.51789486", "text": "function toString () {\n return this.type\n}", "title": "" }, { "docid": "f0ea5bc30bc2e25d4698a1b0651d2c4a", "score": "0.5176358", "text": "function getExisting(type) {\n return $(`.${type}-name`)\n .map(function() {\n return $(this).text();\n })\n .get();\n }", "title": "" }, { "docid": "02694f03e57a38475a7a28128db4b8fb", "score": "0.5172273", "text": "function imprimirEtiqueta2(etiqueta) {\n console.log(etiqueta.label);\n}", "title": "" }, { "docid": "2d7c56f5229ac8f79fe521f5e738e132", "score": "0.51684767", "text": "function getTitulos(tags) {\r\n const grupoTitulos = document.querySelectorAll(tags)\r\n\r\n let titulos = []\r\n\r\n for (let i = 0; i < grupoTitulos.length; i++) {\r\n const conteudoDom = grupoTitulos[i];\r\n let titulo = {}\r\n titulo.nvl = parseInt(conteudoDom.localName.substr(1, 1), 10)\r\n titulo.txt = conteudoDom.innerText\r\n titulo.id = conteudoDom.localName + '-' + (i + 1) + conteudoDom.innerText.replace(/\\W/g, '')\r\n titulo.dom = conteudoDom\r\n titulos.push(titulo)\r\n\r\n // colocando o ID nos titulos\r\n conteudoDom.id = titulo.id\r\n }\r\n\r\n return (titulos)\r\n\r\n /* return:\r\n [\r\n {\r\n nvl = qual é o nivel do H\r\n txt = qual é o texto do titulo\r\n id = o ID que referencia a esse titulo\r\n dom = aponto para o titulo dentro do DOM\r\n }\r\n ] */\r\n\r\n}", "title": "" }, { "docid": "1a021ea1e525236e3330599328bc09cd", "score": "0.5166817", "text": "function filter_by_type(array, tipo) {\n\tlet filtered_array = [];\n\tfor (let i = 0; i < array.length; i++) {\n\t\tif (array[i].Tipo == tipo) {\n\t\t\tfiltered_array.push(array[i]);\n\t\t}\n\t}\n\treturn filtered_array;\n}", "title": "" }, { "docid": "aaca7462af3f6dcc5e7944f5175a7751", "score": "0.5163633", "text": "function mostrarPokemonesTipo(pFiltroTipo) {\n tbody.innerHTML = '';\n for (let i = 0; i < listaPokemon.length; i++) {\n if (listaPokemon[i]['primer_tipo_pokemon'].toLowerCase().includes(pFiltroTipo.toLowerCase())) {\n imprimirInfo(i);\n }\n };\n}", "title": "" }, { "docid": "e199a81e3bd1e966214a9152cd0107f7", "score": "0.51591176", "text": "function muestraOculta(tipo) {\n console.log(tipo);\n if(tipo==\"1\"){\n var tipomenu=\"Basico\";\n }\n if(tipo==\"3\"){\n var tipomenu=\"Bajo en Sal\";\n }\n if(tipo==\"2\"){\n var tipomenu=\"Celiacos\";\n }\n if(tipo==\"4\"){\n var tipomenu=\"Diabetico\";\n }\n \n \n var elemento = document.getElementById('oculto');\n var texto = document.getElementById('apto');\n var apto = document.getElementById('tipoMenu');\n \n if (elemento.style.display == \"\" || elemento.style.display == \"block\") {\n elemento.style.display = \"none\";\n //texto.innerHTML= \"<h2>\"+ tipo +\"</h2>\";\n } else {\n elemento.style.display = \"block\"; \n apto.innerHTML=\"<span class='fas fa-utensils'></span><h2 class='orange'> Menu \"+tipomenu+\"</h2>\";\n texto.innerHTML=\"<input type='hidden' name='tipo_apto' value='\"+tipo+\"'/>\\n\\\n <input type='submit' class='btnapp' style='width: auto;' name='elegirMenu' value='Seguir con el pedido'/> \"; \n // var elemento = document.getElementById('contenidos_' + num);\n }\n \n} //fin funcion", "title": "" }, { "docid": "8c7f884aa1976e162474fdfc2eaf82cb", "score": "0.5158142", "text": "listadoCompleto () {\n // Salto de Linea\n console.log()\n\n // Extrer todos los datos de cada Tarea e Indice\n this.listadoArray.forEach((tarea, i) =>{\n // Indice\n const idx = `${i + 1}`.green;\n\n // Descripcion y Completado\n const { desc, Completado } = tarea;\n\n // Esta Completado o no?\n const estado = (Completado)\n ? 'Completada'.green\n : 'No completada'.red;\n \n console.log(`${idx}.- ${desc} || ${estado}`);\n })\n\n }", "title": "" }, { "docid": "a30be4c9f2df5ee5c5319a7198e7cf4e", "score": "0.5157029", "text": "function displayLayertypes(layertypes){\n\tdiv = document.getElementById('layertypes');\n\thtml='<option selected value=\"\">Choose Data Type</option>';\n\tfor (i in layertypes){\n\t\thtml = html.concat('<option value=\"'+layertypes[i]+'\">'+layertypes[i]+'</option>')\t\n\t}\n\tdiv.innerHTML = html;\n}", "title": "" }, { "docid": "1930615d75b861edde3fec3230bf3b65", "score": "0.515647", "text": "function filtroItem(className){\r\n\t\tlet existentElements = false;\r\n\t\t$('.deleteLista').removeClass('displayHidden');\r\n\t\t$('#noElements').addClass('displayHidden');\r\n\t\t//hace referencia a todas las funciones aplicadas en la lista\r\n\t\t$('.deleteLista').each(function(elementIndex){ \r\n\t\t\tif($(this).find(className).length == 0){ \r\n\t\t\t\t$(this).addClass('displayHidden'); \r\n\t\t\t}else{\r\n\t\t\t\texistentElements = true;\r\n\t\t\t}\r\n\t\t})\r\n\t\tif (existentElements == false){\r\n\t\t\t$('#noElements').removeClass('displayHidden');\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "00836ac6144d6a998559a19fbcf69cdb", "score": "0.5149071", "text": "function show() {\n let $data = document .querySelector( '.data' ),\n $div = document .createElement( 'div' ),\n $ul = document .createElement( 'ul' ),\n $li = document .createElement( 'li' ),\n $a = document .createElement( 'a' ),\n $contentA = document .createTextNode( 'add' );\n\n $a .appendChild( $contentA );\n $a .setAttribute( 'class', 'btn' );\n $a .setAttribute( 'href', '#' );\n $li .appendChild( $a );\n $ul .appendChild( $li );\n $ul .setAttribute( 'class', 'actions' );\n $data .appendChild( $ul );\n $div .setAttribute( 'class', 'records' );\n \n // Itera por ID (1er Nivel de Profundidad del Objeto)\n for ( let id in data ) {\n\n // Valida que el id exista dentro del Objeto iterado\n if ( data .hasOwnProperty( id ) ) {\n let properties = Object .getOwnPropertyNames( data[ id ] ); // Obtiene todas las propiedades existentes del objeto\n \n //console .group( `id = ${ id }` );\n //console .log( `${ properties }` );\n let $ul = createUnorderListElement( id ); // Crea un elemento UL por cada ID del Objeto\n\n // Itera propiedades (2do Nivel de Profundidad del Objeto)\n properties .forEach( property => {\n //console .log( `${ property } = ${ data[ id ][ property ] }` );\n $ul .appendChild( createListItemElement( property, data[ id ][ property ] ) ); // Crea un LI por cada propiedad del Objeto iterado y lo agrega al elemento UL\n });\n //console .log( $ul );\n console .groupEnd();\n\n $div .appendChild( $ul );\n }\n }\n $data .appendChild( $div );\n console .log( $data );\n }", "title": "" }, { "docid": "ec490d75bbf02189ee730860b95cc84e", "score": "0.5148979", "text": "show(separator = \", \") {\n //O elemento atual recebe a cabeça da lista\n let current = this.head,\n //O output concatenará com os elementos da lista\n output = '';\n //caso tenha algum elemento ele entra \n if (current != null) {\n //Como a lista tem que começar com (primeiro elemento, segundo elemento, ... , último elemento)\n output += current.content;\n //Percorre toda a lista \n while (current.next) {\n //O elemento atual recebe o próximo \n current = current.next;\n //Como já tem o primeiro elemento ele irá concatenar o separador e o próximo. Até chegar no último\n output += separator + current.content;\n }\n }\n //Retorna toda a lista com 1º elemento, 2º Elemento até...último elemento.\n return output;\n }", "title": "" }, { "docid": "6bb96c7b43dc53d0124d19d4c3eef7c6", "score": "0.514841", "text": "function mirarInfo(clikeado, tipo, controlado) {\n let posicion = \"\";\n if (orientacion == \"landscape-primary\") {\n posicion = \"show\";\n } else {\n posicion = \"hide\";\n }\n if (nameclass.includes(clikeado)) {\n $(cont).collapse(posicion);\n $(tipo).collapse(\"show\");\n $(juegos).collapse(\"show\");\n $(controlado).collapse(\"show\");\n }\n}", "title": "" }, { "docid": "f4334308e7aa34c8a0a61b2f27c39a92", "score": "0.5145916", "text": "function mostrarProductos(){\n borrarElemento(\"#productos div\");\n cate = $('input:radio[name=cat]:checked').val();//Se toma la categoria seleccionada\n data.forEach(item => {\n if(rd == false && cate === item.getCategoria() || rd && item.getDestacado()){//Si el producto coincide en la categoria seleccionada se renderiza\n \n \n \n \n crearTag(\"div\", 'vista', \"#productos\");//Se crea un div para la tarjeta del producto\n crearElemento(\"h2\", item.getNombre(), \".vista:last-child\");//nombre\n agregarImagen(item.getId());//imagen\n crearElemento(\"h2\", \"$\"+item.getPrecio(), \".vista:last-child\");//precio\n crearTag(\"div\", 'containerColor', \".vista:last-child\");//se crea contenedor de area de seleccion de color\n\n\n crearElemento(\"p\", \"Color\", \"div.vista:last-child div.containerColor\");//texto color\n\n\n\n crearTag(\"select\", \"form-control color\"+item.getId(), \"div.vista:last-child div.containerColor\");//se crea un select para la seleccion de color\n\n item.getColor().forEach(element => {crearElementoSelect(\"option\", element, \".vista:last-child select.color\"+item.getId())});//colores\n\n crearTag(\"div\", 'containerTalla', \".vista:last-child\");//se crea contenedor de area de seleccion de talla\n\n crearElemento(\"p\", \"Talla\", \"div.vista:last-child div.containerTalla\");//texto talla\n\n crearTag(\"select\", \"form-control talla\"+item.getId(), \"div.vista:last-child div.containerTalla\");//se crea un select para la seleccion de talla\n\n item.getTalla().forEach(element => {crearElementoSelect(\"option\", element, \".vista:last-child select.talla\"+item.getId())});//tallas\n\n \n cantidad(\"cntd\"+item.id);//Seleccion de cantidad\n\n $(\".vista:last-child\").append(\"<button onclick=agregarCarrito('\"+item.getId()+\"') type='button' class='btn btn-warning' id=\"+item.getId()+\"'>Agregar al Carrito</button>\" ); //agregar al carrito \n \n \n $(\".vista:last-child\").hide();\n $(\".vista:last-child\").fadeIn(1000);\n }\n })\n }", "title": "" }, { "docid": "632ded87426f7acb47d99f9d06daf098", "score": "0.51369053", "text": "function logArrayElements(element, index, array){\n \t\t\tconsole.log(\"chamado[\" + index + \"] = \" + element.tipo);\n \t\t\tif (element.tipo == 'aberto'){\n\t\t\t\tchamadoAberto.push(element.tipo);\n \t\t\t}\n\t\t\telse if (element.tipo == 'fechado'){\n\t\t\t\tchamadoFechado.push(element.tipo);\n\t\t\t} else if (element.tipo == 'denunciado'){\n chamadoDenunciado.push(element.tipo);\n }\n \t\t}", "title": "" }, { "docid": "d04b1f17b8e6fcfc266e6741ff597e12", "score": "0.51356506", "text": "function retornaIcone (tipo) {\n switch(tipo) {\n case \"Ligação\":\n return (<i className=\"fa fa-phone\"></i>);\n case \"Reunião\":\n return (<i className=\"fa fa-group\"></i>);\n case \"Email\":\n return (<i className=\"fa fa-envelope\"></i>);\n case \"Agenda\":\n return (<i className=\"fa fa-calendar\"></i>);\n default:\n return null;\n }\n}", "title": "" }, { "docid": "c32e2de28f086aac2a425e7497a30e9a", "score": "0.5130379", "text": "static get properties() {\n return {\n infoSolicitud: { type: Array }\n };\n }", "title": "" }, { "docid": "ef0c5dbf40479b1f60b8d0c0c0a67463", "score": "0.5127797", "text": "function MostrarArrayProducto(producto) {\n for (let i = 0; i < producto.length; i++) {\n producto[i].toString();\n }\n}", "title": "" }, { "docid": "c2a6151ce56a9a76d6f300f4c73cb2e8", "score": "0.5126851", "text": "function hide_inputTypes(obj)\r\n {\r\n var objDiv3 = $(\"[toggled='\" + obj + \"']\")[0];\r\n var objChld;\r\n for (i = 0, n = objDiv3.children.length; i < n; i++)\r\n {\r\n if(objDiv3.children[i].children.length > 0)\r\n {\r\n for(j=0, nj=objDiv3.children[i].children.length;j<nj;j++)\r\n {\r\n if (objDiv3.children[i].children[j].tagName == \"INPUT\")\r\n {\r\n objDiv3.children[i].children[j].className = \"in-hide\";\r\n }\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "18b599b7ab328318b43b572c5d196e66", "score": "0.51215565", "text": "function getType(icons) {\n // Creo un array vuoto\n const types = [];\n icons.forEach( (icon) => {\n // Se l'array types non include icon.type lo pusho dentro l'array\n if (! types.includes(icon.type)) {\n types.push(icon.type);\n }\n });\n // mi ritorno l'array fuori\n return types;\n}", "title": "" }, { "docid": "f3c7e5efa519aa4f75bf28c55faf59dd", "score": "0.5121262", "text": "function fnMostrarDatos(){\n\t$.post(this.modelo, {method:'show', info: getParams('frmFiltroActivos')}).then(function(res){\n\t\tllenaTabla(res.content,res.totales);\n\t});\n}", "title": "" }, { "docid": "b9b227feb78365b292e73a400dbecd5d", "score": "0.5112942", "text": "function renderNames(n, type) {\n let li = document.createElement('li')\n li.classList.add('list-group-item', 'list-group-item-dark', 'clickable')\n li.textContent = `${n.name}`\n li.addEventListener('click', (e) => {\n filterBy(n.name, type)\n })\n bigUL.append(li)\n}", "title": "" } ]
7f44e3c1cfde7e043aebb0e937e4ffe4
Usage: fontCache('Roboto', ' noinspection JSUnusedGlobalSymbols
[ { "docid": "b89da73cb5d4d10790fa257ec793f5dd", "score": "0.6760836", "text": "function fontCache(ns, cssUrl) {\n\tvar cssCache,\n\t\t\tfontCount = 1,\n\t\t\tfunctionConst = 'function',\n\t\t\tstorage = localStorage,\n\t\t\thead = document.getElementsByTagName('head')[0];\n\n\tvar isSupported = function() {\n\t\ttry {\n\t\t\tstorage.setItem(functionConst, functionConst);\n\t\t\tstorage.removeItem(functionConst);\n\t\t\treturn typeof XMLHttpRequest == functionConst && typeof Uint8Array == functionConst;\n\t\t} catch(e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tvar injectRawCssCache = function() {\n\t\tvar style = document.createElement('style');\n\t\tstyle.innerHTML = cssCache;\n\t\thead.appendChild(style);\n\t};\n\n\tvar arrayBuffer2base64 = function(buffer) {\n\t\tvar bytes = new Uint8Array(buffer),\n\t\t\t\tb64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",\n\t\t\t\to1, o2, o3, h1, h2, h3, h4, bits, i=0, enc='', length = bytes.byteLength;\n\n\t\tdo {\n\t\t\to1 = bytes[i++];\n\t\t\to2 = bytes[i++];\n\t\t\to3 = bytes[i++];\n\n\t\t\tbits = o1<<16 | o2<<8 | o3;\n\n\t\t\th1 = bits>>18 & 0x3f;\n\t\t\th2 = bits>>12 & 0x3f;\n\t\t\th3 = bits>>6 & 0x3f;\n\t\t\th4 = bits & 0x3f;\n\n\t\t\tenc += b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);\n\t\t} while (i < length);\n\n\t\tswitch (length % 3) {\n\t\t\tcase 1:\n\t\t\t\tenc = enc.slice(0, -2) + '==';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tenc = enc.slice(0, -1) + '=';\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn enc;\n\t};\n\n\tvar trySaveCssCacheInStorage = function() {\n\t\tif (1 > --fontCount) {\n\t\t\tstorage.removeItem(storage.getItem(ns) || functionConst);\n\t\t\tstorage.setItem(cssUrl, cssCache);\n\t\t\tstorage.setItem(ns, cssUrl);\n\t\t}\n\t};\n\n\tvar prepareCssForStorage = function() {\n\t\tvar pattern = /url\\((?:\"|')?(https?:.*?)(?:\"|')?\\)/g,\n\t\t\t\tmatch;\n\n\t\twhile (match = pattern.exec(cssCache)) {\n\t\t\t(function(fontUrl) {\n\t\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\t\tfontCount++;\n\n\t\t\t\txhr.open('GET', fontUrl, true);\n\t\t\t\txhr.responseType = 'arraybuffer';\n\t\t\t\txhr.onreadystatechange = function() {\n\t\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\t\tif (xhr.status >= 200 && xhr.status < 400) {\n\t\t\t\t\t\t\tcssCache = cssCache.replace(\n\t\t\t\t\t\t\t\t\tnew RegExp(\"(\\\"|')?\" + fontUrl.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$&\") + \"(\\\"|')?\", \"\"),\n\t\t\t\t\t\t\t\t\t\"'data:\" + xhr.getResponseHeader(\"Content-Type\") + \";base64,\" + arrayBuffer2base64(xhr.response) + \"'\"\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttrySaveCssCacheInStorage();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\txhr.send();\n\t\t\t})(match[1]);\n\t\t}\n\n\t\ttrySaveCssCacheInStorage();\n\t};\n\n\tif (isSupported()) {\n\t\tif (cssCache = storage.getItem(cssUrl)) {\n\t\t\tinjectRawCssCache();\n\t\t}\n\t\telse {\n\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\txhr.open('GET', cssUrl, true);\n\t\t\txhr.onreadystatechange = function() {\n\t\t\t\tif (xhr.readyState === 4) {\n\t\t\t\t\tcssCache = xhr.responseText;\n\t\t\t\t\tinjectRawCssCache();\n\t\t\t\t\tsetTimeout(prepareCssForStorage, 2016);\n\t\t\t\t}\n\t\t\t};\n\t\t\txhr.send();\n\t\t}\n\t}\n\telse {\n\t\tcssCache = document.createElement('link');\n\t\tcssCache.setAttribute(\"rel\", \"stylesheet\");\n\t\tcssCache.setAttribute(\"href\", cssUrl);\n\t\thead.appendChild(cssCache);\n\t}\n}", "title": "" } ]
[ { "docid": "d74b50a78026d1a3bf599cc63a15224d", "score": "0.63160366", "text": "function addToFontCache(typeface, descriptors) {\n var key = (descriptors['style'] || 'normal') + '|' +\n (descriptors['variant'] || 'normal') + '|' +\n (descriptors['weight'] || 'normal');\n var fam = descriptors['family'];\n if (!fontCache[fam]) {\n // preload with a fallback to this typeface\n fontCache[fam] = {\n '*': typeface,\n };\n }\n fontCache[fam][key] = typeface;\n}", "title": "" }, { "docid": "2c22a0d772f9131a646969145f1bcb4f", "score": "0.605965", "text": "async function dumbHack() {\n await Font.loadAsync({\n Roboto: require('native-base/Fonts/Roboto.ttf'),\n Roboto_medium: require('native-base/Fonts/Roboto_medium.ttf'),\n ...Ionicons.font,\n });\n setIsReady(true)\n }", "title": "" }, { "docid": "a2dde65bc3b7792b165216ebe47dc592", "score": "0.6032533", "text": "function getFont() {\n var _SIZE$mini$SIZE$compa;\n\n var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _constants_js__WEBPACK_IMPORTED_MODULE_1__[\"SIZE\"].default;\n var typography = arguments.length > 1 ? arguments[1] : undefined;\n return (_SIZE$mini$SIZE$compa = {}, _defineProperty(_SIZE$mini$SIZE$compa, _constants_js__WEBPACK_IMPORTED_MODULE_1__[\"SIZE\"].mini, typography.font100), _defineProperty(_SIZE$mini$SIZE$compa, _constants_js__WEBPACK_IMPORTED_MODULE_1__[\"SIZE\"].compact, typography.font200), _defineProperty(_SIZE$mini$SIZE$compa, _constants_js__WEBPACK_IMPORTED_MODULE_1__[\"SIZE\"].default, typography.font300), _defineProperty(_SIZE$mini$SIZE$compa, _constants_js__WEBPACK_IMPORTED_MODULE_1__[\"SIZE\"].large, typography.font400), _SIZE$mini$SIZE$compa)[size];\n}", "title": "" }, { "docid": "bbb461407bcee635424840b77f08983a", "score": "0.5971901", "text": "function preload() {\n myFont = loadFont(\"data/CourierPrime.ttf\");\n}", "title": "" }, { "docid": "22e15fc889378003efce255ca87709f9", "score": "0.5954592", "text": "static getFont() {\n return lcarsFont;\n }", "title": "" }, { "docid": "250ad1b59d336d7f8e30233cd0abd4b7", "score": "0.5946578", "text": "function LoadAssets() {\n Font = loadFont(\"font.ttf\");\n\n}", "title": "" }, { "docid": "30f9f381b38a18e627753288bccbd84d", "score": "0.5920955", "text": "function fromUsingCache(cacheName) {\n return function fromCache(request) {\n return caches.open(cacheName).then(cache =>\n cache.match(request).then(matching => {\n if (DEBUG && matching) {\n console.log(\n `%c[<-][cache ${cacheName}]`,\n styles.fromCache,\n request.url\n )\n }\n return matching || Promise.reject('no-match')\n })\n )\n }\n}", "title": "" }, { "docid": "cf0116915106d9cd351efc1c6ea2326d", "score": "0.5892452", "text": "function preload()\n{\n thefont = loadFont('thefont.otf');\n}", "title": "" }, { "docid": "baf03317395c48a1b326b71c4779720f", "score": "0.5884224", "text": "function preload() {\n instructionFont = loadFont(\"assets/fonts/QubioShadow.ttf\")\n}", "title": "" }, { "docid": "0157918e8ed7f7fb68cb8ae48eaa5222", "score": "0.58699477", "text": "function preload() {\n font = loadFont('fonts/Meiryo-01.ttf')\n}", "title": "" }, { "docid": "c456243fe20ed8d236a0aadd3fa3809f", "score": "0.5800228", "text": "function FontManager() {\n throw new Error(\"This is a static class\");\n}", "title": "" }, { "docid": "2ddce0bcc1745e8039beef7657091d22", "score": "0.57754415", "text": "function font() {\n return src(paths.font.origin)\n .pipe(newer(paths.font.dest))\n .pipe(dest(paths.font.dest))\n}", "title": "" }, { "docid": "629394278152b8b644a0b169a17da020", "score": "0.5762479", "text": "function preload() {\n font = loadFont('font.otf');\n}", "title": "" }, { "docid": "704e186e45e67c5607ee6f796658950a", "score": "0.5756177", "text": "function preload()\n{\n for(var i = 0;i<thefont.length;i++)\n {\n thefont[i] = loadFont('./data/font'+i+'.otf');\n }\n}", "title": "" }, { "docid": "704e186e45e67c5607ee6f796658950a", "score": "0.5756177", "text": "function preload()\n{\n for(var i = 0;i<thefont.length;i++)\n {\n thefont[i] = loadFont('./data/font'+i+'.otf');\n }\n}", "title": "" }, { "docid": "514f43167a3c6c7bfa79e329682846a4", "score": "0.57237816", "text": "get fontNames() {\n return Array.from(this.keys())\n }", "title": "" }, { "docid": "42d8b17daff482a90f0517a81400620b", "score": "0.5689429", "text": "function preload() {\n crimsonItalic = loadFont(\"assets/Crimson-Italic.otf\");\n crimsonRoman = loadFont(\"assets/Crimson-Roman.otf\");\n}", "title": "" }, { "docid": "40f99768b43e6f30e5a10ebf742a2738", "score": "0.5655342", "text": "function getFonts () {\n\n\t// Check the last crawled time in our db for this service, as we only want to run once every now and then\n\t//\n\n\tvar fontRequestOptions = {\n\t\turl: options.host + options.path + 'AllFonts/',\n\t\tmethod: options.method,\n\t\theaders: {\n\t\t\t'Content-Type': options.headers['Content-Type'],\n\t\t\t'authorization': getAuthorisationHash('/rest/json/AllFonts/'),\n\t\t\t'appkey': configFile.app_key\n\t\t}\n\t};\n\n\trequest(fontRequestOptions, fontListResponse);\n\n}", "title": "" }, { "docid": "f9c9185b818f5eb2d897c0cdb6f61219", "score": "0.5654387", "text": "function preload() {\n // Adding a new font: -----> source:\n // https://www.1001freefonts.com/sci-fi-fonts-5.php\n quantumfont = loadFont(\"assets/fonts/quantum/quantflt.ttf\");\n\n}", "title": "" }, { "docid": "9d54cf07141f47654906448486b1ce30", "score": "0.56439185", "text": "function SimpleFontRenderer() {}", "title": "" }, { "docid": "1c3a65d938860d866ff7bcabc65138fb", "score": "0.56397396", "text": "render(){\n if (!this.state.fontLoaded) {\n return (\n // Mostra tela de carregando do App antes do carregamento das fontes\n <AppLoading\n startAsync={this._cacheResourcesAsync}\n onFinish={() => this.setState({ fontLoaded: true })}\n onError={console.warn}\n />\n );\n }\n return <Navegacao/>\n}", "title": "" }, { "docid": "3289b386e1821c16f424e2407670b763", "score": "0.561866", "text": "function saveFont(fontName, fontHash, css) {\n for (var i = 0, totalItems = localStorage.length; i < totalItems - 1; i++) {\n var key = localStorage.key(i);\n if (key.indexOf(fontStorageKey(fontName)) !== -1) {\n localStorage.removeItem(key);\n break;\n }\n }\n localStorage.setItem(fontStorageKey(fontName, fontHash), JSON.stringify({value: css}));\n }", "title": "" }, { "docid": "2c2275752be9af5ed00b01303cb12272", "score": "0.5604016", "text": "function preload() {\n font = loadFont(\"data/Inconsolata-ExtraBold.ttf\");\n}", "title": "" }, { "docid": "ffc392b189f7dc5c0c42bfd4b8ad3449", "score": "0.55825925", "text": "function getFont() {\n var _SIZE$mini$SIZE$compa;\n\n var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _constants.SIZE.default;\n var typography = arguments.length > 1 ? arguments[1] : undefined;\n return (_SIZE$mini$SIZE$compa = {}, _defineProperty(_SIZE$mini$SIZE$compa, _constants.SIZE.mini, typography.font100), _defineProperty(_SIZE$mini$SIZE$compa, _constants.SIZE.compact, typography.font200), _defineProperty(_SIZE$mini$SIZE$compa, _constants.SIZE.default, typography.font300), _defineProperty(_SIZE$mini$SIZE$compa, _constants.SIZE.large, typography.font400), _SIZE$mini$SIZE$compa)[size];\n}", "title": "" }, { "docid": "ca1d33dfe9d46250699a4457c58c1229", "score": "0.55821806", "text": "function preload() {\n // HUD Font\n f = loadFont(\"../fonts/Roboto-Regular.ttf\")\n\n // Interactive Font\n font = loadFont(\"../fonts/Chalif Rough.ttf\")\n}", "title": "" }, { "docid": "6e25e12d058426d5622192607411b420", "score": "0.55763453", "text": "function preload() {\n font = loadFont(\"assets/OpenDyslexicMono-Regular.otf\")\n}", "title": "" }, { "docid": "d196eef56c12ee57743cb9c7d50daa65", "score": "0.55761623", "text": "getFonts() {\n if (this.hasAutoptimize()) this.fonts = this.getAutoptimizeFonts()\n\n if (this.hasLocalFonts()) this.fonts.local = this.getLocalFonts();\n if (this.hasWordPressFonts()) this.fonts.wordpress = this.getWordPressFonts();\n if (this.hasGoogleFonts()) this.fonts.google = this.getGoogleFonts();\n\n if (this.hasTypekitJS() || this.hasTypekitCSS()) this.fonts.typekit = [];\n if (this.hasTypekitJS()) this.getTypekitJSFonts().forEach(f => this.fonts.typekit.push(f));\n if (this.hasTypekitCSS()) this.getTypekitCSSFonts().forEach(f => this.fonts.typekit.push(f));\n\n return this.fonts;\n }", "title": "" }, { "docid": "260b3e093fa32723a0d9b64ec42eb9dc", "score": "0.55581653", "text": "function PreFontMemory() {\n this.type = \"PreFontMemory\";\n this.fontKey = \"\";\n this.fontName = \"\";\n this.fontSize = 0;\n this.isItalic = false;\n this.fontWeight = 400;\n}", "title": "" }, { "docid": "6e0104bae332724d27e50fabe0682b1a", "score": "0.55448043", "text": "setFont(font) {\n // We use Object.assign to support partial updates to the font object\n this.font = { ...this.font, ...font };\n return this;\n }", "title": "" }, { "docid": "6d47f1a81e174c722bfa9df4c716b55a", "score": "0.55413187", "text": "function preload() {\n nunito = loadFont('assets/Nunito-ExtraBold.ttf');\n}", "title": "" }, { "docid": "e97ab86d9fac19817360987e54ebc26c", "score": "0.55360305", "text": "function font_update() {\n var random_font = compatible_fonts[Math.floor(Math.random() * compatible_fonts.length)];\n document.querySelector(\"#update_demo\").style = \"font-family: \" + random_font;\n}", "title": "" }, { "docid": "cb51f5cbf95ede5d6d25adadc4499bab", "score": "0.5530477", "text": "function preload() {\n mainFont = loadFont(\"assets/fonts/cubic.ttf\");\n // Load font for meter titles\n meterFont = loadFont(\"assets/fonts/LemonMilk.otf\");\n // Load font for game instructions\n instructionsFont = loadFont(\"assets/fonts/abeatbyKaiRegular.otf\");\n}", "title": "" }, { "docid": "0e3aed405d749d84cc9bb1ebcb77cd65", "score": "0.5510783", "text": "function FontCssCreator() {\n\tthis.fontDatas = [];\n}", "title": "" }, { "docid": "b86c04ce63e1d34123210bfd4dfa0495", "score": "0.5501771", "text": "[_styling_style_properties__WEBPACK_IMPORTED_MODULE_5__[\"fontInternalProperty\"].getDefault]() {\n return null;\n }", "title": "" }, { "docid": "9e910598458204612d276abba45e44d3", "score": "0.5497724", "text": "function loadFontsFromStorage() {\n try { // localStorage can fail for many reasons\n if (\"localStorage\" in window) {\n\n // only include this block of JS if postFonts true\n @if(postFonts) {\n let fontsToLoadCount;\n const fontsToPost = [];\n const inIframe = window.location !== window.parent.location;\n }\n\n const fontStorageKey = (fontName, fontHash = '') => `gu.fonts.${fontName}.${fontHash}`;\n\n // detect which font format (ttf, woff, woff2 etc) we want\n const fontFormat = (() => {\n const formatStorageKey = 'gu.fonts.format';\n\n let format = localStorage.getItem(formatStorageKey);\n\n function supportsWoff2() {\n // try feature detecting first\n // https://github.com/filamentgroup/woff2-feature-test\n if (\"FontFace\" in window) {\n try {\n const f = new FontFace('t', 'url( \"data:font/woff2;base64,d09GMgABAAAAAADwAAoAAAAAAiQAAACoAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAALAogOAE2AiQDBgsGAAQgBSAHIBuDAciO1EZ3I/mL5/+5/rfPnTt9/9Qa8H4cUUZxaRbh36LiKJoVh61XGzw6ufkpoeZBW4KphwFYIJGHB4LAY4hby++gW+6N1EN94I49v86yCpUdYgqeZrOWN34CMQg2tAmthdli0eePIwAKNIIRS4AGZFzdX9lbBUAQlm//f262/61o8PlYO/D1/X4FrWFFgdCQD9DpGJSxmFyjOAGUU4P0qigcNb82GAAA\" ) format( \"woff2\" )', {});\n\n f.load().catch(() => {});\n if (f.status === 'loading' || f.status == 'loaded') {\n return true;\n }\n } catch (e) {\n @if(context.environment.mode == Dev){throw(e)}\n }\n }\n\n // some browsers (e.g. FF40) support WOFF2 but not window.FontFace,\n // so fall back to known support\n if (!/edge\\/([0-9]+)/.test(ua.toLowerCase())) { // don't let edge tell you it's chrome when it's not\n const browser = /(chrome|firefox)\\/([0-9]+)/.exec(ua.toLowerCase());\n const supportsWoff2 = {\n 'chrome': 36,\n 'firefox': 39\n };\n return !!browser && supportsWoff2[browser[1]] < parseInt(browser[2], 10);\n }\n\n return false;\n }\n\n // flush out weird old json value\n // no value to it and JSON.parse is pointless overhead\n if (/value/.test(format)) {\n format = JSON.parse(format).value;\n localStorage.setItem(formatStorageKey, format);\n }\n\n if (!format) {\n format = supportsWoff2() ? 'woff2' : ua.indexOf('android') > -1 ? 'ttf' : 'woff';\n localStorage.setItem(formatStorageKey, format);\n }\n\n return format;\n })();\n\n // use whatever font CSS we've now got\n function useFont(el, css, fontName) {\n el.innerHTML = css;\n\n // only include this block of JS if postFonts true\n @if(postFonts) {\n fontsToPost.push({\n fontName: fontName,\n css: css\n });\n\n // if all the fonts have loaded and we're in an iframe post them to the parent\n if (fontsToPost.length === fontsToLoadCount && inIframe) {\n window.parent.postMessage({\n name: \"guardianFonts\",\n fonts: fontsToPost\n }, \"*\");\n }\n }\n }\n\n // download font as json to store/use etc\n function fetchFont(url, el, fontName, fontHash) {\n const xhr = new XMLHttpRequest();\n\n xhr.open(\"GET\", url, true);\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4 && xhr.status === 200) {\n const css = JSON.parse(xhr.responseText).css;\n useFont(el, css, fontName);\n saveFont(fontName, fontHash, css);\n }\n };\n xhr.send();\n }\n\n // save font css to localstorage\n function saveFont(fontName, fontHash, css) {\n for (var i = 0, totalItems = localStorage.length; i < totalItems - 1; i++) {\n var key = localStorage.key(i);\n if (key.indexOf(fontStorageKey(fontName)) !== -1) {\n localStorage.removeItem(key);\n break;\n }\n }\n localStorage.setItem(fontStorageKey(fontName, fontHash), JSON.stringify({value: css}));\n }\n\n // down to business\n // the target for each font and holders of all the necessary metadata\n // are some style elements in the head, all identified by a .webfont class\n const fonts = document.querySelectorAll('.webfont');\n\n // only include this block of JS if postFonts true\n @if(postFonts) {\n fontsToLoadCount = fonts.length;\n }\n\n const urlAttribute = shouldHint ? `data-cache-file-hinted-${fontFormat}` : `data-cache-file-${fontFormat}`;\n\n for (let i = 0, j = fonts.length; i < j; ++i) {\n const font = fonts[i];\n const fontURL = font.getAttribute(urlAttribute);\n const fontInfo = fontURL.match(/fonts\\/([^/]*?)\\/?([^/]*)\\.(woff2|woff|ttf).json$/);\n const fontName = fontInfo[2];\n const fontHash = fontInfo[1];\n const fontData = localStorage.getItem(fontStorageKey(fontName, fontHash));\n\n if (fontData) {\n useFont(font, JSON.parse(fontData).value, fontName);\n } else {\n fetchFont(fontURL, font, fontName, fontHash);\n }\n }\n return true;\n }\n } catch (e) {\n @if(context.environment.mode == Dev){throw(e)}\n }\n return false;\n }", "title": "" }, { "docid": "765354b1229d8e096dbf877ec9bd4ae7", "score": "0.54918814", "text": "function fetchFont(url, el, fontName, fontHash) {\n const xhr = new XMLHttpRequest();\n\n xhr.open(\"GET\", url, true);\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4 && xhr.status === 200) {\n const css = JSON.parse(xhr.responseText).css;\n useFont(el, css, fontName);\n saveFont(fontName, fontHash, css);\n }\n };\n xhr.send();\n }", "title": "" }, { "docid": "5d19204bfc2d7f71359da64e6c57e304", "score": "0.5468194", "text": "function Cache() {}", "title": "" }, { "docid": "04ebfc755d8132b32eae4822f6d9dec4", "score": "0.5437518", "text": "function getFont(val) {\n var size = Math.log(val.weight);\n return (size * 1.5 | 0) + \"px roboto\";\n }", "title": "" }, { "docid": "a12c3570c073c3e57502171581bad766", "score": "0.5429925", "text": "function set_font(font_name){\n console.log(\"setting font:\" + font_name);\n for (var i=0; i < numeral_fonts.length; i++) {\n if(numeral_fonts[i].getName() == font_name){\n numeral_fonts_index = i;\n force_redraw = true;\n console.log(\"font match\");\n hour_scriber.setNumeralFont(numeral_fonts[numeral_fonts_index]);\n break;\n }\n }\n}", "title": "" }, { "docid": "2f4694cd408b04d39c3a2e6ea166e0e8", "score": "0.54222065", "text": "_setFont() {\n this.font = `${this.fontSize} ${this.fontFace}`;\n }", "title": "" }, { "docid": "a64b6325d81ed50651c78bd1a6735f6e", "score": "0.5407728", "text": "static setFont(font) {\n lcarsFont = font;\n }", "title": "" }, { "docid": "9924e46007886b953c65da94349c67a1", "score": "0.53968984", "text": "handleFontsChanged() {}", "title": "" }, { "docid": "9f8c7dee74385aae305bdc74c21448fd", "score": "0.538487", "text": "function fontTask() {\n return src(source.fontPath).pipe(dest(dist.fontPath));\n}", "title": "" }, { "docid": "33cd82a3629baab5acca96c94c3d33dd", "score": "0.5376139", "text": "function initializeToolboxFonts() {\n // TODO: Verify that custom fonts are required\n if (Blockly.Css.CONTENT) {\n const font = getURLParameter('font');\n\n if (font) {\n // Replace font family in Blockly's inline CSS\n for (let f = 0; f < Blockly.Css.CONTENT.length; f++) {\n Blockly.Css.CONTENT[f] =\n Blockly.Css.CONTENT[f]\n .replace(/Arial, /g, '')\n .replace(/sans-serif;/g, '\\'' + font + '\\', sans-serif;');\n }\n\n $('html, body').css('font-family', '\\'' + font + '\\', sans-serif');\n $('.blocklyWidgetDiv .goog-menuitem-content')\n .css(\n 'font',\n '\\'normal 14px \\'' + font + '\\',' +\n ' sans-serif !important\\'');\n } else {\n for (let f = 0; f < Blockly.Css.CONTENT.length; f++) {\n Blockly.Css.CONTENT[f] =\n Blockly.Css.CONTENT[f]\n .replace(/Arial, /g, '')\n .replace(/sans-serif;/g, 'Arimo, sans-serif;');\n }\n }\n }\n}", "title": "" }, { "docid": "d3ae01023cef6e806f2707acdb4e0d3c", "score": "0.537513", "text": "function provideFont(fontName, fontSize) {\n const fontGenerator = {\n \"ultralight\": function() { return Font.ultraLightSystemFont(fontSize) },\n \"light\": function() { return Font.lightSystemFont(fontSize) },\n \"regular\": function() { return Font.regularSystemFont(fontSize) },\n \"medium\": function() { return Font.mediumSystemFont(fontSize) },\n \"semibold\": function() { return Font.semiboldSystemFont(fontSize) },\n \"bold\": function() { return Font.boldSystemFont(fontSize) },\n \"heavy\": function() { return Font.heavySystemFont(fontSize) },\n \"black\": function() { return Font.blackSystemFont(fontSize) },\n \"italic\": function() { return Font.italicSystemFont(fontSize) }\n }\n \n const systemFont = fontGenerator[fontName]\n if (systemFont) { return systemFont() }\n return new Font(fontName, fontSize)\n}", "title": "" }, { "docid": "30d469a143f36e58b0452fa6e1f58c26", "score": "0.53576005", "text": "getTemplateFromCache(htmlInfo) {\n const ret = this.cache[htmlInfo.file];\n if (!ret) {\n const error = new Error(`Reading the file \"${htmlInfo.file}\" from the cache failed.`);\n error.type = 'IO_READING_FAILED';\n throw error;\n }\n return ret;\n }", "title": "" }, { "docid": "65e84bcf27a5b3915277f7cc2eda1cfc", "score": "0.5347013", "text": "function fontString(pixelSize, fontStyle, fontFamily) {\n return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n}", "title": "" }, { "docid": "65e84bcf27a5b3915277f7cc2eda1cfc", "score": "0.5347013", "text": "function fontString(pixelSize, fontStyle, fontFamily) {\n return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n}", "title": "" }, { "docid": "e373c0a2f7fcaa7b112205be25ed9aba", "score": "0.53319985", "text": "function doesFontExist(fontName) {\n var canvas = document.createElement(\"canvas\");\n var context = canvas.getContext(\"2d\");\n var text = \"abcdefghijklmnopqrstuvwxyz0123456789\";\n context.font = \"72px monospace\";\n var baselineSize = context.measureText(text).width;\n context.font = \"72px '\" + fontName + \"', monospace\";\n var newSize = context.measureText(text).width;\n delete canvas;\n if (newSize == baselineSize) {\n return false;\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "cd75118f45227a6e0d6935338d8648c7", "score": "0.53295374", "text": "function fileIsCached(href) {\n return window.localStorage && localStorage.font_css_cache && (localStorage.font_css_cache_file === href);\n }", "title": "" }, { "docid": "73f16ec7a6ec79c1de0710059b863134", "score": "0.53277886", "text": "changeFont(event) {\n // console.log(\"Font type: \" + event.target.value)\n this.setState({\n 'font': event.target.value,\n });\n var globalPresets = this.props.globalPresets;\n globalPresets.font = event.target.value;\n this.props.updateGlobalPresets(globalPresets);\n console.log(\"global font state: \" + globalPresets.font)\n }", "title": "" }, { "docid": "0d8c6331cbe2a2359722bd2b000de65a", "score": "0.5311077", "text": "function eval_fontList() {\n\tvar doc = app.activeDocument;\n\t\n\tvar i, j, k, thisStory, thisStoryVis, unknownCount = 0, fontList = [];\n\tvar storyCount = doc.stories.length;\n\tif (storyCount === 0) {\n\t\talert('no fonts in doc');\n\t\treturn 'false';\n\t}\n\t\n\tfor (i = 0; i < storyCount; i++) {\n\t\tthisStory = doc.stories[i];\n\t\tfor (j = 0; j < thisStory.textFrames.length; j++) {\n\t\t\t\n\t\t\t//if live text inside envelope and cannot edit contents:\n\t\t\t//Error 1302: No such element Line: 110-> \t\t\tif (thisStory.textFrames[j].layer.visible)\n\t\t\ttry {\n\t\t\t\tthisStoryVis = thisStory.textFrames[j].layer.visible\n\t\t\t} catch (e) {\n\t\t\t\tunknownCount++;\n\t\t\t}\n\t\t\t\n\t\t\tif (thisStoryVis) {\n\t\t\t\tfor (k = 0; k < thisStory.textFrames[j].characters.length; k++) {\n\t\t\t\t\tif (fontList.indexOf(thisStory.textFrames[j].characters[k].textFont.name) === -1) {\n\t\t\t\t\t\tfontList.push(thisStory.textFrames[j].characters[k].textFont.name);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn JSON.stringify([fontList, unknownCount]);\n}", "title": "" }, { "docid": "fe727d9b1d746fd64e3951d4816b9b78", "score": "0.5311067", "text": "get fonts() {\n return Array.from(this.values())\n }", "title": "" }, { "docid": "c382c56ca3ba75589978eb0b6cf07771", "score": "0.53014255", "text": "function useFont(el, css, fontName) {\n el.innerHTML = css;\n\n // only include this block of JS if postFonts true\n @if(postFonts) {\n fontsToPost.push({\n fontName: fontName,\n css: css\n });\n\n // if all the fonts have loaded and we're in an iframe post them to the parent\n if (fontsToPost.length === fontsToLoadCount && inIframe) {\n window.parent.postMessage({\n name: \"guardianFonts\",\n fonts: fontsToPost\n }, \"*\");\n }\n }\n }", "title": "" }, { "docid": "9516e63c6b844dd37e99511c83760004", "score": "0.52979404", "text": "function precache() {\n return caches.open(CACHE).then(function (cache) {\n return cache.addAll([\n './',\n './index.php',\n './index.html',\n './stylesheets/screen.css?v=4',\n './fonts/style.css',\n './javascript/jquery.history.js',\n './javascript/jquery.js',\n './javascript/controller.js',\n './javascript/app.js?v=22',\n './service_worker.js?v=22',\n './images/arrow1.png',\n './images/arrow2.png',\n './images/maintips.png',\n './fonts/fonts/icomoon.ttf?1w02bs',\n './fonts/fonts/icomoon.woff?1w02bs',\n './fonts/fonts/icomoon.svg?1w02bs#icomoon'\n ]);\n });\n}", "title": "" }, { "docid": "c3f12ab5fdec6e9984912930c55ae05d", "score": "0.5288822", "text": "function precache() {\n return caches.open(CACHE).then(function (cache) {\n return cache.addAll([\n \"/\",\r\n\"/index.html\",\r\n\"/manifest.json\",\r\n\"/Schedule/\",\r\n\"/Schedule/index.html\",\r\n\"/Speakers/\",\r\n\"/Speakers/index.html\",\r\n\"/Speakers/index_noncfpversion.html\",\r\n\"/Sponsors/\",\r\n\"/Sponsors/index.html\",\r\n\"/scripts/bootstrap.min.js\",\r\n\"/styles/bootstrap-button-social.min.css\",\r\n\"/styles/fontawesome-4.min.css\",\r\n\"/styles/fontawesome-all.min.css\",\r\n\"/styles/fontawesome.min.css\",\r\n\"/styles/site.css\",\r\n\"/scripts/bootstrap.js\",\r\n\"/scripts/jquery-3.3.1.min.js\",\r\n\"/scripts/jquery.js\",\r\n\"/styles/bootstrap.min.css\",\r\n\"/Info/AntiHarassmentPolicy/\",\r\n\"/Info/AntiHarassmentPolicy/index.html\",\r\n\"/Info/CodeOfConduct/\",\r\n\"/Info/CodeOfConduct/index.html\",\r\n\"/Info/CommitmentToDiversity/\",\r\n\"/Info/CommitmentToDiversity/index.html\",\r\n\"/Info/Contact/\",\r\n\"/Info/Contact/index.html\",\r\n\"/Info/FAQ/\",\r\n\"/Info/FAQ/index.html\",\r\n\"/Info/Privacy/\",\r\n\"/Info/Privacy/index.html\",\r\n\"/Info/Travel/\",\r\n\"/Info/Travel/index.html\",\r\n\"/styles/bootstrap.css\",\r\n\"/scripts/jquery-3.3.0.js\",\r\n\"/scripts/jquery-3.3.1.js\",\r\n\"/Speakers/2018/Adam-Pasternack.html\",\r\n\"/Speakers/2018/Angel-Thomas.html\",\r\n\"/Speakers/2018/Anna-Heiermann.html\",\r\n\"/Speakers/2018/Barry-Tarlton.html\",\r\n\"/Speakers/2018/Benjamin-Bykowski.html\",\r\n\"/Speakers/2018/Bill-Sempf.html\",\r\n\"/Speakers/2018/Bobby-Grayson.html\",\r\n\"/Speakers/2018/Brandon-Bruno.html\",\r\n\"/Speakers/2018/Brett-Koenig.html\",\r\n\"/Speakers/2018/Chad-Green.html\",\r\n\"/Speakers/2018/Chris-DeMars.html\",\r\n\"/Speakers/2018/Craig-Stuntz.html\",\r\n\"/Speakers/2018/Dave-Wasmer.html\",\r\n\"/Speakers/2018/David-Neal.html\",\r\n\"/Speakers/2018/Dennis-Dunn.html\",\r\n\"/Speakers/2018/Drew-Furgiuele.html\",\r\n\"/Speakers/2018/Ed-Charbeneau.html\",\r\n\"/Speakers/2018/Eric-Potter.html\",\r\n\"/Speakers/2018/Greg-Malcolm.html\",\r\n\"/Speakers/2018/James-Balmert.html\",\r\n\"/Speakers/2018/Jarred-Olson.html\",\r\n\"/Speakers/2018/Jeff-McKenzie.html\",\r\n\"/Speakers/2018/Jeremy-Clark.html\",\r\n\"/Speakers/2018/Johnson-Denen.html\",\r\n\"/Speakers/2018/Jon-Kruger.html\",\r\n\"/Speakers/2018/Justin-James.html\",\r\n\"/Speakers/2018/Kevin-Holtz.html\",\r\n\"/Speakers/2018/Kevin-Mack.html\",\r\n\"/Speakers/2018/Kim-McGill.html\",\r\n\"/Speakers/2018/Kris-Hatcher.html\",\r\n\"/Speakers/2018/Lars-Klint.html\",\r\n\"/Speakers/2018/Mandar-Malunjkar.html\",\r\n\"/Speakers/2018/Marc-Peabody.html\",\r\n\"/Speakers/2018/Marlena-Bowen.html\",\r\n\"/Speakers/2018/Martine-Dowden.html\",\r\n\"/Speakers/2018/Michael-Dowden.html\",\r\n\"/Speakers/2018/Richard-Taylor.html\",\r\n\"/Speakers/2018/Rob-Richardson.html\",\r\n\"/Speakers/2018/Ronda-Bergman.html\",\r\n\"/Speakers/2018/Seth-Petry-Johnson.html\",\r\n\"/Speakers/2018/Shawn-Price.html\",\r\n\"/Speakers/2018/Stephen-Shary.html\",\r\n\"/Speakers/2018/Steve-Smith.html\",\r\n\"/Speakers/2018/Thomas-Haver.html\",\r\n\"/Speakers/2018/Tim-Hoolihan.html\",\r\n\"/Speakers/2018/Tim-LeMaster.html\",\r\n\"/Speakers/2018/Warner-Moore.html\",\r\n\"/Speakers/2018/Wasim-Hanna.html\",\r\n\"/Speakers/2019/Adam-Pasternack.html\",\r\n\"/Speakers/2019/Andrew-May.html\",\r\n\"/Speakers/2019/Barbara-Kerr.html\",\r\n\"/Speakers/2019/Ben-Burgett.html\",\r\n\"/Speakers/2019/Brendan-Enrick.html\",\r\n\"/Speakers/2019/Cassandra-Faris.html\",\r\n\"/Speakers/2019/Chad-Green.html\",\r\n\"/Speakers/2019/Damian-Synadinos.html\",\r\n\"/Speakers/2019/Ed-Charbeneau.html\",\r\n\"/Speakers/2019/Granville-Schmidt.html\",\r\n\"/Speakers/2019/Greg-Greenlee.html\",\r\n\"/Speakers/2019/Guy-Royse.html\",\r\n\"/Speakers/2019/Izzi-Bikun.html\",\r\n\"/Speakers/2019/Jack-Bennett.html\",\r\n\"/Speakers/2019/James-Balmert.html\",\r\n\"/Speakers/2019/James-Quick.html\",\r\n\"/Speakers/2019/Jay-Harris.html\",\r\n\"/Speakers/2019/Jeff-Strauss.html\",\r\n\"/Speakers/2019/Jesse-Weigel.html\",\r\n\"/Speakers/2019/Jessica-Engström.html\",\r\n\"/Speakers/2019/Jim-Everett.html\",\r\n\"/Speakers/2019/Jimmy-Engström.html\",\r\n\"/Speakers/2019/Joel-Lord.html\",\r\n\"/Speakers/2019/Jack-Merideth.html\",\r\n\"/Speakers/2019/JonathanJ.-Tower.html\",\r\n\"/Speakers/2019/Josh-Wood.html\",\r\n\"/Speakers/2019/Justin-James.html\",\r\n\"/Speakers/2019/Matt-Weimer.html\",\r\n\"/Speakers/2019/Michael-Meadows.html\",\r\n\"/Speakers/2019/Mike-Clement.html\",\r\n\"/Speakers/2019/Mike-Goeke.html\",\r\n\"/Speakers/2019/MikeEarleyand-RachelBanks.html\",\r\n\"/Speakers/2019/Nicolas-Martin.html\",\r\n\"/Speakers/2019/RebeccaR.-Carter.html\",\r\n\"/Speakers/2019/Robin-Clower.html\",\r\n\"/Speakers/2019/Russell-Skaggs.html\",\r\n\"/Speakers/2019/Ryan-Bales.html\",\r\n\"/Speakers/2019/Sarah-Withee.html\",\r\n\"/Speakers/2019/Shawn-Wallace.html\",\r\n\"/Speakers/2019/Sho-Fola.html\",\r\n\"/Speakers/2019/Steve-Smith.html\",\r\n\"/Speakers/2019/Thomas-Haver.html\",\r\n\"/Speakers/2019/Todd-Gardner.html\",\r\n\"/Speakers/2019/Tori-Brenneison.html\",\r\n\"/Speakers/2019/William-Klos.html\",\r\n\"/Speakers/2019/Zackary-Lowery.html\",\r\n\"/images/BabyGroot.png\",\r\n\"/images/Living-Heroes-Header-1140x744.png\",\r\n\"/images/Slack_RGB.svg\",\r\n\"/images/Stir-Trek-Space-Background-slice.jpg\",\r\n\"/images/StirTrek-Emblem-Gold-400x588.png\",\r\n\"/images/StirTrek-Emblem-Gold-nobackground.png\",\r\n\"/images/StirTrek-Emblem-Gold.png\",\r\n\"/images/StirTrek-Logo-Banner-453x350.png\",\r\n\"/images/StirTrek-Logo-Banner-906x700.png\",\r\n\"/images/StirTrek-Sponsor-Missing.png\",\r\n\"/images/header-logo.png\",\r\n\"/images/spotit-2019-qr.png\",\r\n\"/images/thanos-header-1140x760.png\",\r\n\"/icons/android-icon-144x144.png\",\r\n\"/icons/android-icon-192x192.png\",\r\n\"/icons/android-icon-36x36.png\",\r\n\"/icons/android-icon-48x48.png\",\r\n\"/icons/android-icon-72x72.png\",\r\n\"/icons/android-icon-96x96.png\",\r\n\"/icons/apple-icon-114x114.png\",\r\n\"/icons/apple-icon-120x120.png\",\r\n\"/icons/apple-icon-144x144.png\",\r\n\"/icons/apple-icon-152x152.png\",\r\n\"/icons/apple-icon-180x180.png\",\r\n\"/icons/apple-icon-57x57.png\",\r\n\"/icons/apple-icon-60x60.png\",\r\n\"/icons/apple-icon-72x72.png\",\r\n\"/icons/apple-icon-76x76.png\",\r\n\"/icons/apple-icon-precomposed.png\",\r\n\"/icons/apple-icon.png\",\r\n\"/icons/favicon-16x16.png\",\r\n\"/icons/favicon-32x32.png\",\r\n\"/icons/favicon-512x512.png\",\r\n\"/icons/favicon-96x96.png\",\r\n\"/icons/favicon.ico\",\r\n\"/icons/ms-icon-144x144.png\",\r\n\"/icons/ms-icon-150x150.png\",\r\n\"/icons/ms-icon-310x310.png\",\r\n\"/icons/ms-icon-70x70.png\",\r\n\"/icons/opengraph.jpg\",\r\n\"/icons/speaker-icon.png\",\r\n\"/icons/stirtrek-default.png\",\r\n\"/fonts/FontAwesome.otf\",\r\n\"/fonts/KOMIKAX_.ttf\",\r\n\"/fonts/fa-brands-400.eot\",\r\n\"/fonts/fa-brands-400.svg\",\r\n\"/fonts/fa-brands-400.ttf\",\r\n\"/fonts/fa-brands-400.woff\",\r\n\"/fonts/fa-brands-400.woff2\",\r\n\"/fonts/fa-regular-400.eot\",\r\n\"/fonts/fa-regular-400.svg\",\r\n\"/fonts/fa-regular-400.ttf\",\r\n\"/fonts/fa-regular-400.woff\",\r\n\"/fonts/fa-regular-400.woff2\",\r\n\"/fonts/fa-solid-900.eot\",\r\n\"/fonts/fa-solid-900.svg\",\r\n\"/fonts/fa-solid-900.ttf\",\r\n\"/fonts/fa-solid-900.woff\",\r\n\"/fonts/fa-solid-900.woff2\",\r\n\"/fonts/fontawesome-webfont.eot\",\r\n\"/fonts/fontawesome-webfont.svg\",\r\n\"/fonts/fontawesome-webfont.ttf\",\r\n\"/fonts/fontawesome-webfont.woff\",\r\n\"/fonts/fontawesome-webfont.woff2\",\r\n\"/images/sponsors/ALLIANCEDATA.png\",\r\n\"/images/sponsors/COMRESOURCE.png\",\r\n\"/images/sponsors/Careworks.png\",\r\n\"/images/sponsors/DOCHALO.png\",\r\n\"/images/sponsors/DYNAMIT.png\",\r\n\"/images/sponsors/HUNTINGTON.png\",\r\n\"/images/sponsors/ICC.png\",\r\n\"/images/sponsors/ICC_350x200.png\",\r\n\"/images/sponsors/IGS_350x200.png\",\r\n\"/images/sponsors/JUMPMIND.png\",\r\n\"/images/sponsors/KROGER.png\",\r\n\"/images/sponsors/MPW.png\",\r\n\"/images/sponsors/Microsoft.png\",\r\n\"/images/sponsors/NewRelic_350x200.png\",\r\n\"/images/sponsors/Progress_350x200.png\",\r\n\"/images/sponsors/accenture_350x200.png\",\r\n\"/images/sponsors/awh_350x200.jpg\",\r\n\"/images/sponsors/awh_350x200.png\",\r\n\"/images/sponsors/boldpenguin_350x200.png\",\r\n\"/images/sponsors/callibrity_350x200.png\",\r\n\"/images/sponsors/captech_350x200.jpg\",\r\n\"/images/sponsors/cardinalsolutions_350x200.jpg\",\r\n\"/images/sponsors/cmm_350x200.jpg\",\r\n\"/images/sponsors/cmm_350x200.png\",\r\n\"/images/sponsors/dynamit_350x200.png\",\r\n\"/images/sponsors/fastswitch_350x200.jpg\",\r\n\"/images/sponsors/halo_350x200.png\",\r\n\"/images/sponsors/hmb-350x200.jpg\",\r\n\"/images/sponsors/hmb-350x200.png\",\r\n\"/images/sponsors/improvingenterprises.png\",\r\n\"/images/sponsors/insight_350x200.png\",\r\n\"/images/sponsors/leadingedje_350x200.jpg\",\r\n\"/images/sponsors/leadingedje_350x200.png\",\r\n\"/images/sponsors/livingportrait_350x200.png\",\r\n\"/images/sponsors/manifest_350x200.png\",\r\n\"/images/sponsors/nationwide_350x200.jpg\",\r\n\"/images/sponsors/oclc_350x200.png\",\r\n\"/images/sponsors/pillar-180x95.jpg\",\r\n\"/images/sponsors/pillar_350x200.png\",\r\n\"/images/sponsors/root_350x200.png\",\r\n\"/images/sponsors/smartdata_350x200.png\",\r\n\"/images/sponsors/sogeti_350x200.jpg\",\r\n\"/images/sponsors/sogeti_350x200.png\",\r\n\"/images/sponsors/teksystems_350x200.png\",\r\n\"/images/sponsors/upstart_350x200.png\",\r\n\"/images/sponsors/vaco_350x200.png\",\r\n\"/images/sponsors/workstate_350x200.png\",\r\n\"/images/speakers/2018/Adam-Pasternack.jpg\",\r\n\"/images/speakers/2018/Angel-Thomas.jpg\",\r\n\"/images/speakers/2018/Anna-Heiermann.jpg\",\r\n\"/images/speakers/2018/Barry-Tarlton.jpg\",\r\n\"/images/speakers/2018/Benjamin-Bykowski.jpg\",\r\n\"/images/speakers/2018/Bill-Sempf.jpg\",\r\n\"/images/speakers/2018/Bobby-Grayson.png\",\r\n\"/images/speakers/2018/Brandon-Bruno.jpeg\",\r\n\"/images/speakers/2018/Brett-Koenig.jpg\",\r\n\"/images/speakers/2018/Chad-Green.jpg\",\r\n\"/images/speakers/2018/Chris-DeMars.jpeg\",\r\n\"/images/speakers/2018/Craig-Stuntz.jpg\",\r\n\"/images/speakers/2018/Dave-Wasmer.jpg\",\r\n\"/images/speakers/2018/David-Neal.jpg\",\r\n\"/images/speakers/2018/Dennis-Dunn.png\",\r\n\"/images/speakers/2018/Drew-Furgiuele.jpg\",\r\n\"/images/speakers/2018/Ed-Charbeneau.jpg\",\r\n\"/images/speakers/2018/Eric-Potter.jpg\",\r\n\"/images/speakers/2018/Greg-Malcolm.jpg\",\r\n\"/images/speakers/2018/James-Balmert.jpeg\",\r\n\"/images/speakers/2018/Jarred-Olson.jpg\",\r\n\"/images/speakers/2018/Jeff-McKenzie.jpg\",\r\n\"/images/speakers/2018/Jeremy-Clark.jpg\",\r\n\"/images/speakers/2018/Johnson-Denen.jpg\",\r\n\"/images/speakers/2018/Jon-Kruger.jpg\",\r\n\"/images/speakers/2018/Justin-James.jpg\",\r\n\"/images/speakers/2018/Kevin-Holtz.jpg\",\r\n\"/images/speakers/2018/Kevin-Mack.jpg\",\r\n\"/images/speakers/2018/Kim-McGill.jpg\",\r\n\"/images/speakers/2018/Kris-Hatcher.jpg\",\r\n\"/images/speakers/2018/Lars-Klint.jpg\",\r\n\"/images/speakers/2018/Mandar-Malunjkar.jpg\",\r\n\"/images/speakers/2018/Marc-Peabody.png\",\r\n\"/images/speakers/2018/Marlena-Bowen.jpg\",\r\n\"/images/speakers/2018/Martine-Dowden.png\",\r\n\"/images/speakers/2018/Michael-Dowden.png\",\r\n\"/images/speakers/2018/Richard-Taylor.jpg\",\r\n\"/images/speakers/2018/Rob-Richardson.jpg\",\r\n\"/images/speakers/2018/Ronda-Bergman.jpg\",\r\n\"/images/speakers/2018/Seth-Petry-Johnson.jpg\",\r\n\"/images/speakers/2018/Shawn-Price.png\",\r\n\"/images/speakers/2018/Stephen-Shary.jpg\",\r\n\"/images/speakers/2018/Steve-Smith.jpg\",\r\n\"/images/speakers/2018/Thomas-Haver.jpg\",\r\n\"/images/speakers/2018/Tim-Hoolihan.jpg\",\r\n\"/images/speakers/2018/Tim-LeMaster.png\",\r\n\"/images/speakers/2018/Warner-Moore.jpg\",\r\n\"/images/speakers/2018/Wasim-Hanna.png\",\r\n\"/images/speakers/2018/ignore.txt\",\r\n\"/images/speakers/2019/Adam-Pasternack.jpg\",\r\n\"/images/speakers/2019/Andrew-May.jpg\",\r\n\"/images/speakers/2019/Barbara-Kerr.jpg\",\r\n\"/images/speakers/2019/Ben-Burgett.jpeg\",\r\n\"/images/speakers/2019/Brendan-Enrick.jpg\",\r\n\"/images/speakers/2019/Cassandra-Faris.jpg\",\r\n\"/images/speakers/2019/Chad-Green.png\",\r\n\"/images/speakers/2019/Chris-Bohatka.JPG\",\r\n\"/images/speakers/2019/Damian-Synadinos.jpg\",\r\n\"/images/speakers/2019/Ed-Charbeneau.jpg\",\r\n\"/images/speakers/2019/Granville-Schmidt.jpg\",\r\n\"/images/speakers/2019/Greg-Greenlee.png\",\r\n\"/images/speakers/2019/Guy-Royse.jpg\",\r\n\"/images/speakers/2019/Izzi-Bikun.jpg\",\r\n\"/images/speakers/2019/Jack-Bennett.jpeg\",\r\n\"/images/speakers/2019/Jack-Merideth.jpg\",\r\n\"/images/speakers/2019/James-Balmert.jpeg\",\r\n\"/images/speakers/2019/James-Quick.png\",\r\n\"/images/speakers/2019/Jay-Harris.jpg\",\r\n\"/images/speakers/2019/Jeff-Strauss.jpg\",\r\n\"/images/speakers/2019/Jesse-Weigel.jpg\",\r\n\"/images/speakers/2019/Jessica-Engstrm.png\",\r\n\"/images/speakers/2019/Jim-Everett.jpg\",\r\n\"/images/speakers/2019/Jimmy-Engstrm.jpg\",\r\n\"/images/speakers/2019/Joel-Lord.jpg\",\r\n\"/images/speakers/2019/John-Merideth.jpg\",\r\n\"/images/speakers/2019/John-Reese.jpg\",\r\n\"/images/speakers/2019/JonathanJ.-Tower.jpg\",\r\n\"/images/speakers/2019/Josh-Wood.jpg\",\r\n\"/images/speakers/2019/Justin-James.jpg\",\r\n\"/images/speakers/2019/Matt-Weimer.jpg\",\r\n\"/images/speakers/2019/Michael-Meadows.jpeg\",\r\n\"/images/speakers/2019/Mike-Clement.jpg\",\r\n\"/images/speakers/2019/Mike-Goeke.jpg\",\r\n\"/images/speakers/2019/MikeEarleyand-RachelBanks.jpeg\",\r\n\"/images/speakers/2019/Nicolas-Martin.jpg\",\r\n\"/images/speakers/2019/RebeccaR.-Carter.PNG\",\r\n\"/images/speakers/2019/Robin-Clower.jpg\",\r\n\"/images/speakers/2019/Russell-Skaggs.jpg\",\r\n\"/images/speakers/2019/Russell-Skaggs.png\",\r\n\"/images/speakers/2019/Ryan-Bales.jpg\",\r\n\"/images/speakers/2019/Sarah-Withee.jpg\",\r\n\"/images/speakers/2019/Shawn-Wallace.jpg\",\r\n\"/images/speakers/2019/Sho-Fola.jpg\",\r\n\"/images/speakers/2019/Stacy-Harrison.jpeg\",\r\n\"/images/speakers/2019/Steve-Smith.jpg\",\r\n\"/images/speakers/2019/Taelur-Alexis.jpg\",\r\n\"/images/speakers/2019/Thomas-Haver.jpg\",\r\n\"/images/speakers/2019/Todd-Gardner.jpg\",\r\n\"/images/speakers/2019/Tori-Brenneison.jpg\",\r\n\"/images/speakers/2019/William-Klos.JPG\",\r\n\"/images/speakers/2019/Zackary-Lowery.jpg\",\r\n\"/images/speakers/2019/ignore.txt\",\r\n\"/images/speakers/2020/ignore.txt\"\n ]);\n });\n }", "title": "" }, { "docid": "1ce0b468ac1de5c0f705e6f0b1bf05c0", "score": "0.5285767", "text": "loadFont(name, url) {\n var newFont = new FontFace(name, `url(${url})`);\n newFont.load().then(function (loaded) {\n document.fonts.add(loaded);\n }).catch(function (error) {\n return error;\n });\n }", "title": "" }, { "docid": "20d53fc1c8abd6598f28343f50c623df", "score": "0.5281793", "text": "function chocorocco_customizer_add_theme_fonts(fonts) {\n\t\tvar rez = [];\n\t\tfor (var tag in fonts) {\n\t\t\t//rez[tag] = fonts[tag];\n\t\t\trez[tag+'_font-family'] = typeof fonts[tag]['font-family'] != 'undefined' && fonts[tag]['font-family'] != '' && fonts[tag]['font-family'] != 'inherit'\n\t\t\t\t\t\t\t\t\t\t\t\t? 'font-family:' + fonts[tag]['font-family'] + ';' \n\t\t\t\t\t\t\t\t\t\t\t\t: '';\n\t\t\trez[tag+'_font-size'] = typeof fonts[tag]['font-size'] != 'undefined' && fonts[tag]['font-size'] != 'inherit'\n\t\t\t\t\t\t\t\t\t\t\t\t? 'font-size:' + chocorocco_customizer_prepare_css_value(fonts[tag]['font-size']) + \";\"\n\t\t\t\t\t\t\t\t\t\t\t\t: '';\n\t\t\trez[tag+'_line-height'] = typeof fonts[tag]['line-height'] != 'undefined' && fonts[tag]['line-height'] != '' && fonts[tag]['line-height'] != 'inherit'\n\t\t\t\t\t\t\t\t\t\t\t\t? 'line-height:' + fonts[tag]['line-height'] + \";\"\n\t\t\t\t\t\t\t\t\t\t\t\t: '';\n\t\t\trez[tag+'_font-weight'] = typeof fonts[tag]['font-weight'] != 'undefined' && fonts[tag]['font-weight'] != '' && fonts[tag]['font-weight'] != 'inherit'\n\t\t\t\t\t\t\t\t\t\t\t\t? 'font-weight:' + fonts[tag]['font-weight'] + \";\"\n\t\t\t\t\t\t\t\t\t\t\t\t: '';\n\t\t\trez[tag+'_font-style'] = typeof fonts[tag]['font-style'] != 'undefined' && fonts[tag]['font-style'] != '' && fonts[tag]['font-style'] != 'inherit'\n\t\t\t\t\t\t\t\t\t\t\t\t? 'font-style:' + fonts[tag]['font-style'] + \";\"\n\t\t\t\t\t\t\t\t\t\t\t\t: '';\n\t\t\trez[tag+'_text-decoration'] = typeof fonts[tag]['text-decoration'] != 'undefined' && fonts[tag]['text-decoration'] != '' && fonts[tag]['text-decoration'] != 'inherit'\n\t\t\t\t\t\t\t\t\t\t\t\t? 'text-decoration:' + fonts[tag]['text-decoration'] + \";\"\n\t\t\t\t\t\t\t\t\t\t\t\t: '';\n\t\t\trez[tag+'_text-transform'] = typeof fonts[tag]['text-transform'] != 'undefined' && fonts[tag]['text-transform'] != '' && fonts[tag]['text-transform'] != 'inherit'\n\t\t\t\t\t\t\t\t\t\t\t\t? 'text-transform:' + fonts[tag]['text-transform'] + \";\"\n\t\t\t\t\t\t\t\t\t\t\t\t: '';\n\t\t\trez[tag+'_letter-spacing'] = typeof fonts[tag]['letter-spacing'] != 'undefined' && fonts[tag]['letter-spacing'] != '' && fonts[tag]['letter-spacing'] != 'inherit'\n\t\t\t\t\t\t\t\t\t\t\t\t? 'letter-spacing:' + fonts[tag]['letter-spacing'] + \";\"\n\t\t\t\t\t\t\t\t\t\t\t\t: '';\n\t\t\trez[tag+'_margin-top'] = typeof fonts[tag]['margin-top'] != 'undefined' && fonts[tag]['margin-top'] != '' && fonts[tag]['margin-top'] != 'inherit'\n\t\t\t\t\t\t\t\t\t\t\t\t? 'margin-top:' + chocorocco_customizer_prepare_css_value(fonts[tag]['margin-top']) + \";\"\n\t\t\t\t\t\t\t\t\t\t\t\t: '';\n\t\t\trez[tag+'_margin-bottom'] = typeof fonts[tag]['margin-bottom'] != 'undefined' && fonts[tag]['margin-bottom'] != '' && fonts[tag]['margin-bottom'] != 'inherit'\n\t\t\t\t\t\t\t\t\t\t\t\t? 'margin-bottom:' + chocorocco_customizer_prepare_css_value(fonts[tag]['margin-bottom']) + \";\"\n\t\t\t\t\t\t\t\t\t\t\t\t: '';\n\t\t}\n\t\treturn rez;\n\t}", "title": "" }, { "docid": "0bfc2a97b853f67feef3d37107a6d8f8", "score": "0.52724206", "text": "async componentDidMount() {\n await Font.loadAsync({\n 'georgia': require('../assets/fonts/Georgia.ttf'),\n 'regular': require('../assets/fonts/Montserrat-Regular.ttf'),\n 'light': require('../assets/fonts/Montserrat-Light.ttf'),\n 'bold': require('../assets/fonts/Montserrat-Bold.ttf'),\n });\n\n this.setState({ fontLoaded: true });\n }", "title": "" }, { "docid": "79460bf6e9335f3f44854f428f190705", "score": "0.5270774", "text": "function gatherOtherResources()\r\n{\r\n var loadedfonts = new Array();\r\n \r\n passNumber = 2;\r\n \r\n iconFound = false;\r\n \r\n //chrome.runtime.sendMessage({ type: \"setSaveBadge\", text: \"SAVE\", color: \"#A000D0\" });\r\n \r\n timeStart[2] = performance.now();\r\n \r\n document.fonts.forEach( /* CSS Font Loading Module */\r\n function(font)\r\n {\r\n if (font.status == \"loaded\") /* font is being used in this document */\r\n {\r\n loadedfonts.push({ family: font.family, weight: font.weight, style: font.style, stretch: font.stretch });\r\n }\r\n });\r\n \r\n findOtherResources(0,window,document.documentElement,false,false,loadedfonts);\r\n \r\n timeFinish[2] = performance.now();\r\n \r\n loadResources();\r\n}", "title": "" }, { "docid": "038431415f80286acd0b2df00151bb0f", "score": "0.52658707", "text": "loadCharset(input, style) {\n return __awaiter(this, void 0, void 0, function* () {\n const fontName = style.fontName;\n const fontStyle = style.fontStyle;\n const shouldTransform = style.fontVariant === TextStyle_1.FontVariant.AllCaps ||\n style.fontVariant === TextStyle_1.FontVariant.SmallCaps;\n const charset = (shouldTransform ? input.toUpperCase() : input).replace(/[\\s\\S](?=([\\s\\S]+))/g, (c, s) => {\n return s.indexOf(c) + 1 ? \"\" : c;\n });\n const glyphPromises = [];\n for (const char of charset) {\n const codePoint = char.codePointAt(0);\n const font = this.getFont(codePoint, fontName);\n const fontHash = `${font.name}_${fontStyle}`;\n const glyphHash = `${fontHash}_${codePoint}`;\n let fontGlyphMap = this.m_loadedGlyphs.get(fontHash);\n if (fontGlyphMap === undefined) {\n fontGlyphMap = new Map();\n this.m_loadedGlyphs.set(fontHash, fontGlyphMap);\n }\n const glyph = fontGlyphMap.get(codePoint);\n if (glyph === undefined) {\n let glyphPromise = this.m_loadingGlyphs.get(glyphHash);\n if (glyphPromise === undefined) {\n if (font.charset.indexOf(String.fromCodePoint(codePoint)) === -1) {\n const replacementGlyph = this.createReplacementGlyph(codePoint, char, font);\n fontGlyphMap.set(codePoint, replacementGlyph);\n this.m_glyphTextureCache.add(glyphHash, replacementGlyph);\n continue;\n }\n let charUnicodeBlock;\n for (const block of this.unicodeBlocks) {\n if (codePoint >= block.min && codePoint <= block.max) {\n charUnicodeBlock = block;\n break;\n }\n }\n glyphPromise = this.loadAssets(codePoint, fontStyle, charUnicodeBlock, font);\n this.m_loadingGlyphs.set(glyphHash, glyphPromise);\n glyphPromise.then((loadedGlyph) => {\n this.m_loadingGlyphs.delete(glyphHash);\n fontGlyphMap.set(codePoint, loadedGlyph);\n this.m_glyphTextureCache.add(glyphHash, loadedGlyph);\n });\n }\n glyphPromises.push(glyphPromise);\n }\n else if (!this.m_glyphTextureCache.has(glyphHash)) {\n glyphPromises.push(Promise.resolve(glyph));\n this.m_glyphTextureCache.add(glyphHash, glyph);\n }\n }\n return Promise.all(glyphPromises);\n });\n }", "title": "" }, { "docid": "3f522df79274415d0b04ff3c626301d1", "score": "0.52658385", "text": "async componentDidMount() {\n await Font.loadAsync({\n 'Pacifico-Reg': require('../../../assets/fonts/Pacifico-Regular.ttf'), \n });\n\n this.setState({ fontLoaded: true });\n }", "title": "" }, { "docid": "f505041e8de7036464394529400bb16f", "score": "0.5264956", "text": "get font() {\n return this._j || this._g.font;\n }", "title": "" }, { "docid": "cae64ce7d9721f70c17e6c3136c4c779", "score": "0.52346116", "text": "async componentDidMount() {\n\n await Font.loadAsync({\n\t\t\t'McLaren-Regular': require('../../assets/fonts/McLaren-Regular.ttf'),\n });\n\n this.setState({ fontLoaded: true });\n}", "title": "" }, { "docid": "d71a9936c34644d11f0cda43476f2e14", "score": "0.52308744", "text": "getPlatformFontsForNode(params) {\n return {\n fonts: [\n {\n // Font's family name reported by platform.\n familyName: 'Standard Font',\n // Indicates if the font was downloaded or resolved locally.\n isCustomFont: false,\n // Amount of glyphs that were rendered with this font.\n glyphCount: 0,\n },\n ],\n };\n }", "title": "" }, { "docid": "aa33f041abb8ffbc3f6fad092e0d8c03", "score": "0.52226394", "text": "function styleHack() {\n /*jshint maxlen:false*/\n var style = document.createElement('style');\n style.innerHTML =\n`@font-face {\n font-family: \"gaia-icons\";\n src: url(\"data:application/x-font-ttf;charset=utf-8;base64,AAEAAAAQAQAABAAARkZUTW5k7JgAAI80AAAAHEdERUYAfAD8AAB9LAAAACZHUE9T4BjvnAAAjvwAAAA2R1NVQhT4IUcAAH1UAAARpk9TLzJQZV66AAABiAAAAGBjbWFwkwHJagAABawAAAFqY3Z0IAARAUQAAAcYAAAABGdhc3D//wADAAB9JAAAAAhnbHlmIETmNAAACQAAAGfEaGVhZAMIikcAAAEMAAAANmhoZWEDswKzAAABRAAAACRobXR4Xt0ADQAAAegAAAPEbG9jYdru9bQAAAccAAAB5G1heHABRgEJAAABaAAAACBuYW1lFAG0pQAAcMQAAAKacG9zdE8OvSMAAHNgAAAJwwABAAAAAQAApW9TmF8PPPUACwIAAAAAANETpOQAAAAA0ROk5P/F/8IB/QHAAAAACAACAAAAAAAAAAEAAAHA/8IALgIA/8X//wH9AAEAAAAAAAAAAAAAAAAAAADxAAEAAADxANgAEwAAAAAAAgAAAAEAAQAAAEAALgAAAAAABAF3AfQABQAAAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAIABgMAAAAAAAAAAAABEAAAAAAAAAAAAAAAUGZFZADAAC3xywHA/8AALgHAAD4AAAABAAAAAAAAAAAAAAAgABkAuwARAAAAAACqAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAGaAAABlQAAAagAAAGMAAABSgAAASQAAgGPAAABkgAAAeP/8wFMAAABOgABAXMABgGdAAABIgAAASIAAwGXAAUBgwABAHEAAACrAAABmgAAAZoAAAGaAAABmgAAAZoAAAGaAAABmgAAAZoAAAGaAAABmgAAAZoAAABsAAABmgAAAd0AAgGaAAABmgAAAZkAAADnAAABvAABAZ8AAAG8AAABmgAAAZcAAAHeAAAB2QAAAfYAAAFbAAABmAAAAL4AAAGYAAABmAAAAXMAAAGK/8UBjAAAAZwABwGwAAABQwAAAXwAAADsAAABgwAAAZgAAAFCAAABRAAAAVsAAAERAAABMQAAAUoAAAGHAAABXgAAAQcAAAGTAAMBmgAAAW4AAAC0AAABhQAAAf8AAAGUAAABwwAAAeEAAAHhAAABqgAAAYgAAAFVAAAAWwAAAJoAAACpAAABQwAAAXcABQGpAAABBgAAAScAAAErAAAAtQAAAZ8AAAGfAAAAcQAAAKoAAAF3AAABlwAAAZcAAAFVAAAA8gAAAWQAAAFjAAABnQAAAZoAAAEdAAABvAAAAOMAAAGaAAABoAAAAWYAAAGaAAABmgAAAeAAAAF3AAABRwAAAR4AAAEzAAAAogAAAWcAAADxAAAA/wADAW0AAAFPAAAB1AAAAQkAAAG8AAABZgAAATMAAAGcAAABrwAAATMAAAEmAAAB3gAAAVMAAAGwAAABqgAAAfsAAAF3AAABeAAAAXgAAAFcAAUA7wAAAYcAAwGXAAABHwAAAVYAAAHeAAAB3gAAAZgAAAFSAAABRgAAAX0AAAFKAAABqwAAAOYAAAA7AAAAkgAAAOoAAAFCAAABmgAAAMEAAQGmAAABIQAAAREAAAEAAAAA8QAAAZEAAAD6AAABeQABAXoAAQF3AAABmgAAAWcAAAFlAAYBywAAAWYABAGqAAYBZgAAAZoAAAGrAAABXgAAAV4AAAGIAAABMgAAAVUAAAEIAAABPgAAAdUAAAFhAAAAyQAAAPUAAACJAAIBUwAAAYAAAAHPAAABkAAAAbwAAAA0AAAAtAAAASYAAAGUAAABmQAAAAAAAwAAAAMAAAAcAAEAAAAAAGQAAwABAAAAHAAEAEgAAAAOAAgAAgAGAC0AOQBpAHAAevHL//8AAAAtADAAYQBrAHLxAf///9b/1P+t/6z/qw8lAAEAAAAAAAAAAAAAAAAAAAAAAQYAAAEAAAAAAAAAAQIAAAACAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAQFBgcICQoLDA0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAODxAREhMUFRYAFxgZGhscAB0eHyAhIiMkJQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAUQAAAAqACoAKgAyADoAQgBKAFIAWgBiAGoAcgB6AIIAigCSAJoAogCqALIAugDCAMoA0gDaAOIA6gDyAPoBAgEKARIBGgEiASoBMgE6AUIBhAHUAg4CUAKKAqYDEgNGA+QEQAR6BKwFOAVWBXQFtAXmBfwGGgY+BmIGgAakBsgG7AcQBzQHWAd8B6AHsAfyCGwIugkkCX4JvgpSC0ALjAvMDBoMZgysDN4NGg1WDXwNxg4ADiQOdg6cDtIPBA9CD4IPqg/eEB4QRBCaENIQ+hE0EbQSEBKgEzwTohPaFAgUHhRUFKIU3BUkFaQWEBZEFogWrhbMFuQXAhcyF3gYrBjGGPIZMhlQGYgZwhnYGfQaWhqCGswbEhs4G7YcGhxmHModYB2EHZod3h4YHj4ewh8+H7IgCiAwIGAgkiDAINwhwiHSIfIiHCJ6IqgjAiMyI1AjiCPQI/QkKiRSJGQkniVSJaIl0CYMJjgmeCa8JvQnGidWJ4QnsCfWKCYoWihyKOIpHilqKYopmCmwKdAp+CoqKkAquCsQKzIrUiuAK8Qr7iwwLGQsgCysLMws9C0yLZ4uJi5ILmIuwi8YL2Av3jAWMFowhjCuMN4xCDFQMXIxwjIYMlgyfjK2Muwy/jMeM0wzijPiAAIAEQAAAJkBVQADAAcALrEBAC88sgcEAO0ysQYF3DyyAwIA7TIAsQMALzyyBQQA7TKyBwYB/DyyAQIA7TIzETMRJzMRIxGId2ZmAVX+qxEBMwAAAAEAAAAAAAAAAAAAAAAxAAABAAAAAAAAAAAAAAAAMQAAAQAAAAAAAAAAAAAAADEAAAEAAAAAAAAAAAAAAAAxAAABAAAAAAAAAAAAAAAAMQAAAQAAAAAAAAAAAAAAADEAAAEAAAAAAAAAAAAAAAAxAAABAAAAAAAAAAAAAAAAMQAAAQAAAAAAAAAAAAAAADEAAAEAAAAAAAAAAAAAAAAxAAABAAAAAAAAAAAAAAAAMQAAAQAAAAAAAAAAAAAAADEAAAEAAAAAAAAAAAAAAAAxAAABAAAAAAAAAAAAAAAAMQAAAQAAAAAAAAAAAAAAADEAAAEAAAAAAAAAAAAAAAAxAAABAAAAAAAAAAAAAAAAMQAAAQAAAAAAAAAAAAAAADEAAAEAAAAAAAAAAAAAAAAxAAABAAAAAAAAAAAAAAAAMQAAAQAAAAAAAAAAAAAAADEAAAEAAAAAAAAAAAAAAAAxAAABAAAAAAAAAAAAAAAAMQAAAQAAAAAAAAAAAAAAADEAAAEAAAAAAAAAAAAAAAAxAAABAAAAAAAAAAAAAAAAMQAAAQAAAAAAAAAAAAAAADEAAAEAAAAAAAAAAAAAAAAxAAABAAAAAAAAAAAAAAAAMQAAAQAAAAAAAAAAAAAAADEAAAEAAAAAAAAAAAAAAAAxAAABAAAAAAAAAAAAAAAAMQAAAQAAAAAAAAAAAAAAADEAAAEAAAAAAAAAAAAAAAAxAAABAAAAAAAAAAAAAAAAMQAAAgAAACYBmgFDABMALgAANxQGBzMHIzU+ATU0IyIHJzYzMhYXMTMVBiMiJjU0NjMyFwcmIyIGFRQWMzI3NSO1L0J3Bq1KLCgcGSEjNyoxg2IpNzk+SDUzJR0aHyAoICEYFCn0IkM/KidMOxwoHRkuLU6GG0lGQ0sgHRYzNDcwC0cAAAAAAgAAACYBlQFCACEAOgAANx4BFRQGIyInNxYzMjY1NCsBNzMyNTQmIyIHJzYzMhYVFBczFQYjIiY1NDYzMhcHJiMiBhUUMzI3NSN9GyM2LTggHhggFhoxFgYPLBYSHhkbIzMpLYJhKTY5Pkg1MiUcGh8gKEEXFCm9AiMeJDAoHBsZFSwlKRAUGB0iJx4zBIUbSkVCSyAdFjI0ZwtHAAAAAAIAAAAmAagBQwAPACkAADcxFTMVIxUjNSM1NxcHMzcXMxUGIyImNTQ2MzIXByYjIgYVFBYzMjc1I6oiIjR2US1HQAXKYik3OT1HNTMlHRoeICgfIRoSKdVGKUBAJbcRokYOhhtJRkNLIB0WMzQ3MAtHAAAAAgAA/+sBjAGcACAAKAAAJTMUBg8BFhceAQcGJicOAScmNjc+ATcuAScuATU0NjIWJiImNDYyFhQBiwFSQBAECikpDAtFKChGCwwqKQMJAQMKAkBSdKRzrTAiIjAh+QoPAiAHEEduBwdTRENUBwduRwURAQYWBAIPCgwRESQiMCEhMAAAAwAAABkBSAFdAA8AFwAkAAAlIxUGJzUjJjczNTYXFTMWBiImNDYyFhQHNx4BFRQHIyY1NDY3AUgrCworAgIrCgsrArQ6KCg6KEU1HyUSzhIlH90rAgIrCworAgIrCxQpOCkpOHA0CygYMSsrMRgoCwAAAAABAAIAKQEiAUkADwAAJRYHIxUGJzUjJjczNTYXFQEiBQV1Ght2BQV2GxrTGxp1BQV1Ght2BQV2AAEAAAAnAY8BrABTAAAlMhYUBiMiJyMmIyIGHQEUIzMGIyInMyI9ATQ2MhcxFjI2NCYjIgcGIyImPQE0OwEWFzI2NTQnNSY1NDYyFhUUBzMGFRQWMyM2NzMyFh0BFBYyNzYBYxIaGhIRDAEGCQgMEgRLL0FLAxEMEAYMJBkZEhENBwcIDBEHGTQIDAgOHiweDgEIDAgBJhYLCAoMEAcN7B8sHg4IDAhIEQUFEUgIDAgOHiwfDwcMCEcSAgIMCAcIAQwREhoaEhEMBgoIDAICCwdHCAwHDwAAAAEAAAAeAZIBcwAgAAAkFAYPAQ4BBysBNyYnBw4BKwI3JzMyHwE2NyczMh8BFgGSSDdqAwcCAi9DPiAqAgcCAhohIRkJBSciQUUYHwZsNtQaFQN7BAQBhwcMOgQETk4JNQ4High/AwAACf/zABYB4wHAAAAACgAUAB4AKABEAFMAXQBnAAADHwEGFRQXByY1NB8BBhUUFwcmNTQlFhUUByc2NTQnBzcWFRQHJzY1NAcXFgcGIyIvAQYjIicHBiInJj8BJjU0NjIWFRQnNiYPAScmBwYfARYzMjcnBg8BJjY3NhYXMz4BFx4BBycmJw0gEhAQEhM5EAYGEAcBnxISExAQIw8HBw8FQSMLCwQGBwQlJzAvJiYEDgQKCiUnVnpXSwcOBz4tBwcHCDQCBAUCPDogAxAEFBQyEW0RMhQUBBADIDoBwMUKHiIjHgomJScCBw0REQ4HERUUNiEpJyQKHiMiHiIHERQVEQcLFBNuIwsLBAQlHRsmBAQKCyUqOj1XVz03agcOBzslBwgGCCsCArAXNAIUMhEQBBQUBBARMhQCNBcAAAQAAAAOAUwBgQARABgAMwA+AAAlNRYVFAYrATc7ASY9ATcVFBcHNzMOASMiExYXASYnNyMiJjU0NzU2PQE0Njc+ATIWFxYXBzcmIyIGFSMVFAcBOwsOCqEiRSUlISbGB1kCHBMlsw8L/s4PCx8FCg4LJiQdBBokGgQgE8auEzghLgEleAEIDQsOIh0lAiIXJxxHCBIaAVALD/7OCw8fDgsMCAEcJ0wbKwsRFxYRCxzGrSchGFklHQACAAEABgE5AYQABQAkAAA2IiYnMwY3ISImPwE2NzUzNjc0JzU0NjIWHQEWFzMVFh8BFgYjsCYcAWABWP7yDwsIBCQBAQU6AR0oHDoFAQEkBAgLDwYaExMqJwUGGSVKMhcCAgIVHBwVBhYzSiUZBAUqAAAAAAIABgANAW0BdAASABwAADcGJzcHJicmNjc2Fwc3FhcWBgcnIgYUFjMyNjQm50hAOYELBhNOSkdBOIANBRNOSi8QGBgQERgYDRIjgDgVF0qEFBIkgDgYFEqEE9wYIhgZIBkAAAAHAAD/8wGdAY0AAwAHAAsAGgBCAFgAXAAAATcXByc3FwcnNxcPATMVIxUjNSM1NxcHMzczByM1Njc2NzY3NjU0JyYiBwYHJzY3NjMyFxYXFhcWFRQHBgcGBwYHMzciBhQWMzI2NxcOASMiJjQ2MzIXByYfAQcnAWYqCiotIRUiShUdFRMQEBI1JQ8iIwIQWUsVBgMPAwUDBwoMCAYHCwkICg0GCggFBgIDAwUFAw0GFDkNR2ZmRzRVFSAYZkBVeHhVEhkEFpMsAyoBAQweDVIcGRs8Jg4npA8gIA1XBk8jUQ8VCAMSBAwIBwwEBgMEBwkLBAUEAwUGBQcHCQkMBgMSBxPpZo5mOS8HOkd4qngFIAWrBSAEAAAAAQAAABUBHwFsAA8AACU1FgcjFwYHJyY0PwEWFwcBHwYGy1cICowNDYwLB1bcARwcViIYjA0lDYwdHFcAAQADABYBIgFsAA8AACU1FhQPASYnNyMmNzMnNjcBFQ0NjAsHV8sGBspWBwvgAQ0lDYwdHFYcHFYcHQAAAgAFABMBlQF4ABkAJQAAARYGBwYnBxUGIyInNQcnBiY3NCY1JTY3NhYHNzQnLgE1BxYXHgEBjw4RGR0eVAkJCAmPBRsaEgIBBgccGjbCMwUBBjMBBAEGAVYZOA0PDC2yAwOgTgUDMBQBBQGOIQ8NEJgcAgkCBwEbBAgCBwAAAAABAAEAHgGDAX4AHgAAARcHIwYiJyY0PwE2MhYUDwEnNzY0JiIPAQYUFjI/AQEzEcsBFTkVFBTLHE84HKsSqxUqORXMDhwmDcsBEBLLFRUVOhXLHDhPHKsRrBU5KhXLDSYcDswAAQAAAFYAcQE0AAkAADcOAQcnNTcWFwdxAg0BYWEHCVdwBhEDYRxhBxBWAAABAAAAFQCrAWsADgAAEw8BBh8BBgcnJjQ/ARYXq2cBCQloBwuMDQ2MCwcBMmcBCQtoIBmLDSUNjBweAAACAAAAawGaARUAEAAUAAAlMxYVFAcjBgchIiY0NjMhFgc1IRUBdSEEAyEGDf62Cg8PCgFJDQn+tOsRGh4NJQUyRjIFlIiIAAACAAAAawGaARUAEAAUAAAlFhUUByMGByEiJjQ2MyEWFwc1IRUBlgQDIQYN/rYKDw8KAUkNBg/+3usRGh4NJQUyRjIFJW+IiAABAAAAawGaARUAEAAAJRYVFAcjBgchIiY0NjMhFhcBlgQDIQYN/rYKDw8KAUkNBusRGh4NJQUyRjIFJQACAAAAawGaARUAEAAUAAAlFhUUByMGByEiJjQ2MyEWFwc1IRUBlgQDIQYN/rYKDw8KAUkNBg/+7+sRGh4NJQUyRjIFJW+IiAACAAAAawGaARUAEAAUAAAlFhUUByMGByEiJjQ2MyEWFwc1IxUBlgQDIQYN/rYKDw8KAUkNBg/v6xEaHg0lBTJGMgUlb4iIAAACAAAAawGaARUAEAAUAAAlFhUUByMGByEiJjQ2MyEWFwc1IxUBlgQDIQYN/rYKDw8KAUkNBg/M6xEaHg0lBTJGMgUlb4iIAAACAAAAawGaARUAEAAUAAAlFhUUByMGByEiJjQ2MyEWFwc1IxUBlgQDIQYN/rYKDw8KAUkNBg+q6xEaHg0lBTJGMgUlb4iIAAACAAAAawGaARUAEAAUAAAlFhUUByMGByEiJjQ2MyEWFwc1IxUBlgQDIQYN/rYKDw8KAUkNBg+I6xEaHg0lBTJGMgUlb4iIAAACAAAAawGaARUAEAAUAAAlFhUUByMGByEiJjQ2MyEWFwc1IxUBlgQDIQYN/rYKDw8KAUkNBg9m6xEaHg0lBTJGMgUlb4iIAAACAAAAawGaARUAEQAVAAAlMxYVFAcjBgchIiY0NjsCFgc1IxUBdSEEAyEGDf62Cg8PCrCZDQlE6xEaHg0lBTJGMgWUiIgAAAACAAAAawGaARUAEAAUAAAlFhUUByMGByEiJjQ2MyEWFwc1IxUBlgQDIQYN/rYKDw8KAUkNBg8i6xEaHg0lBTJGMgUlb4iIAAABAAAAWgBsASYABQAANwc3IzcHbGkwM2YvwGZmZmYAAAQAAABrAZoBFQASABgAKQAtAAA3NjMyFhUUBh0BIzU0NjU0IyIHFzIUIyI0NxYVFAcjBgchIiY0NjMhFhcHNSEVrwsVDhAZExYKCQcODAwN2AQDIQYN/rYKDw8KAUkNBg/+vOEPDgsMEgcDBA4QBAkJMRoaRxEaHg0lBTJGMgUlb4iIAAQAAv/FAdwBrwAZAB4AIwBPAAAlFg8BFxYUDwE1DwIuASc3Jz4CNx8CNRMnFTc2JzYvARUXHgEHDgEnLgE3Nj8BNjU0JiIGFRQfARYXFgYHBi4BNjcnJjU0NjMyFhUUBwEpEhQxMQcHVT8CAgIFAUlIAQMEAQIBPzkcHAQDCAkcxhQWBAUmFBYWBQUPCgRjimICCg8EBRYWFCYKFhQFA3lXVnoD8xYYODkKGwlhn0oBAgYYBlJSBgwOBAICSZ7+8R9PIQiYCAYgTiYFNyIkLgICOCQhFjsNFElnZ0kXCj8XHCU5AgQxSDcEHxITW4CAWxMSAAAEAAD/8wGaAY0ABQAKABIAMAAAExYPATUXBzUXFgcCMhYUBiImNAUnNzY0LwEVLwEjNSYjBgcXBxYXMzc1Mz8BFTc2NPkGBhsbGxsGBoGqeHiqeAEQLi4ICE9BAQEBAQYDSEgHAgEBAQFBTwgBDAYHHEUbtkYcBgcBGXiqeHiqhzIyCBgIVYxAAQEBFAtHRxsEAQEBQIxVCBgAAAAGAAD/8wGaAY0ABQAKABIAMQA7AEQAABMWDwE1Fwc1FxYHAjIWFAYiJjQXJzc2NC8BFS8BIzUiNCMGBxcHFhc3NTM0MzcVNzY0Nz0BJg8BBh8BFj8BNi8BJgcVFsIGBhsaGhsGBkqqeHiqeNkuLggIT0EBAQEBAwZISAcCAgEBQU8IPQcFJgkJJgYtJgkJJgUHBwENBgcdRhy1RRwGBwEZeKp4eKqHMjIIGAhVjEABAQEGGEhHGwQBAQFAjFUIGAcBZQIFJwkJJgYGJgkJJwUCZQIAAAUAAP/WAZMBqgAIABEALQAyADcAACUWDwEGJzU2FyM2FxUGLwEmNycWFA8BFxYUDwE1DwEWIyYnNyc+ATcyFjMfATUTJxU3Nic2LwEVAZMNDTcICgoIQAgJCQg4Dg4WCgo7OQoKaFQCAQIKA15eAggDAQEBAlZHIyMJBwUFI84ODTkIA5gDCAgDmAMIOQ0OagogC0NDDB8LcbpWAgEZEGBgBhsHAgJUuv7BJVwmCLMJCiReAAMAAP/TAOcBrQAcACEAKAAANxcWFA8BNQ8BIwcmJzcnNjcWMRQ7AR8BNRcWFAcnFTc2JxcxNic1JxWYRAsLc1cCAQIHBmFhBwYBAQECV3MLC0wnCQoBCAkmwEQLIAtzvlcCAhIXYWEbDwECAla9cwsgC0ldJggKzwgJASVeAAAACQAB/+QBuwGdAAkAEwAdACcAMQA7AEUATwBXAAABJic3NhcWFwcGBycmNzY3FxYHBgcWFxYPASYnJj8BBi8BNjc2HwEGAxYXBwYnJic3NjcmJyY/ARYXFgcVFgcGBycmNzY3BzYfAQYHBi8BNgIyFhQGIiY0ARcKAxwNBwoDHAvbQgUEBQtBBgQFCwsFBAZCCwUEBqIHDRsFCAkLGwMKCgMbDAgLAxwL2wsFBAZCDAQEBgUEBQpCBwUEDGAJCxsDCgkLGwNhZEVFZEUBSQULQgYEBQtCBlkcDAgKAxwLCQpbAwoHDRsDCgkL0AQGQwsEBAZCC/7pBQpDBQQGCkEGsQMKBw0bBQgJC44MCAoDGwwJCQNdAwVCCgUEBkELAQVFZEVFZAAAAAADAAD/7gGfAZUAZgCCAKkAACUyFhQGIiY1NDcyFxYGFRQfARYXFhceAQcGFhcWFRQGMxYXMhcWNicmNz4EPwMmJyYnNCYnJg8BJy4CNzYXHgE2Nz4BMzI2PwEyNicmBw4BLgEjIjc2NzYnJgcGIi4BJzYXMjY3NCYnJgYXFhcGBw4BBwYfARYzMjYzMjcyBzI3FhcjIiY1ETQ2OwEyFh0BBgc1NCYrASIGHQEUFjsBFhcOARQWARg4T09wTzwBAwIHBQUFBRIDBwwDBwoFCwIBBgQCBAYBAQwHAQoFBAUCAgUFBBAIARIHAwIPDAMHCgQOBgMCAwIDEQUDBQIBBgcFExICBQMFAQYIAwQJDxAFAwQCAQEZewEGARIKBwgFAgEFAQIIAQYBAQEFAwoCCQQI9AYHBQ+CCw8QCswKDxUQCgeTBwoKB0ACAgkMDfxPcE9POEgoAwMQAxwGCAkEDAECBgIDIAYNBgIfFgEDAgECFAcBBwgKBwEBDwoMBQIEAwgHAwEFCgEEDAUTCgUCBAYIEwUDAgIGCxgDAgECBQMBAwQEAwEIBQQMXQMCAxgGBQgEAQEKAQMJAQkDAQECAXMFCRQPCgFUCw8PC2UDB1QHCgoH6QcKDAgBDBINAAEAAP/zAbwBjQA6AAATMxU2Mhc1MxUjFRYXMxUjNSMWFzMVIzUjBgczFSM1IwYjIicjFSM1MyYnIxUjNTM2NyMVIzUzNjc1I3dWDAoMVTMoGlgiIw0DRiIjAgpAIjEnU1QnMCJACgIjIkUDDSIiVhoqNAGNNQICNSIdEidEIiEjRCIqGkUiMzMiRRoqIkQjISJEJhMdAAAAAgAA/+sBmgGVAB8ALwAAEjIWHQEzNTQ2MzIdATMyFh0BFAYjISImPQE0NjsBNTQHIgYdARQWMyEyNj0BNCYjYA4LqQsHEBEdKCgd/u8cKCgcEREOFBQOAREOFhYOAZUPChoaCg8ZGigc7xwoKBzvHCgaClcUDt4OFBQO3g4UAAAEAAAAAgGXAX8AFAAaAB8ALwAAJRcWFA8BNQ8BJic3JzY3HwE1FxYPATc2LwEVNycVNzYFIyImPQE0NjsBNzY3ESYnAWYqBwdEOQMFAzw8AwUDOUQQEC4XBQUYGBcYBf7ZNwsWFgs3WA0QDw7BKgcUB0R2OQMPCzw8Cw8DOXZFEBGCGAUGFzqYGDsYBZMQCn4KD1gNAf6DAQ4AAAADAAD/1AHeAbIABwAeADIAACQiJjQ2MhYUJwYVFBczFRYzMjc1MzY1NCcjNSYiBxUfAQYHLgMnNjcXBgcGHgI3NgGKcFFRcFDoBgY+DhQLFz0HBz0OKA49cR4vN4R8TwsUH2cOCgklTEsUEp5QcFFRcFsMFxYMPQcHPQ4UFQ49Bwc93WQcGAtPfIQ4JyVyEhIUS0wmCQoAAAIAAP/PAdQBrAAWACsAAAEWDwEGJzUjIgYVFBcjJjU0NjsBNTYXAz4BNxcGByYnJic2NxcGBwYWFx4BAdIPDUEIC0MqPAoHElA4LgoJZQcaAmggKG53dhQTG1wIDggjIiRFAWYPEEEIAzY8KhcUHic4UDkDCf6fAxEBXRsTFHd2biggaAkYEkYiIyIAAgAAAFkB9gEEABgAHgAAJSY1NDEjNS4BIgYHIx0BBg8BNjc2IBcWFwcjIichBgF4BgEGQ1pCBgEDBH4DDVUBLFUNA6yeLRcBJheHHgIBAhEWFhECAQoWCCkiOjoiKSYoKAAAAAMAAAATAVsBbgASABwAJAAAJQYHLgEnNjcXBgcVBh4CNzY3JyInNTYzMhcVBjcGIic1NjIXAVsbHVi6EQ0YSQ8CBxs4Nw4DFzoNBgYNDAYGRwYaBgYaBjgYDRG6WB0bUhcDAQ42OBwHAg8+AY8BAY8BAQEBjwEBAAIAAP/hAZgBeQANACIAAAEVBi8BJj8BNhcVMxYPARU2NxcGBy4BJzY3FwYHFQYWFx4BAQ0KBjMMDDMGCngFBW0RDmEbJ2beEhMYVg4GCCAhIEEBGC0CBjQMDDQGAi4XFskBCgpWGBMS3mYnG2EUCgERQCEgIAAAAAEAAABcAL4BSQAVAAA3ByYnBgcnNjc1IyY/ATYfARYHIxUWvhA0Gxs0EEQDJgIGLwsLLwYCJgJtERswMBsRN1gPCQYvCwsvBgkNWgACAAD/4QGYAXkAFQAqAAABFwYHJwcmJz8BIi8BNjcXNxYXDwEXBxc2NxcGByYnJic2NxcGBxcGHgIBZSgECTIzBwUoAQEBJwQJMjIJBCgBAU0BFAphGydmb20UExhWDgYBCCBAQQEuKBAQMzMNEygBASgQEDMzEBAoAQHfAQwIVhgTEm9taCcbYRQKARFBQCAAAAAAAgAA/+EBmAF5AA0AIgAAJQYnNSMmNzM1Nh8BFg8BFTY3FwYHJicmJzY3FwYHFwYeAgFUBgp4BAR4CQczDAxvEQ5hHSVkcW8SExhWDgYBCB9CQO8GAi0WFy4CBzMMDNQBCgpWGhESb29mJxthFAoBET9CIAABAAD/9gFzAWgAEgAANwYHJic3FhcWPgInJic3FhcG/WRdIBxYCxEPOzwcBwkJThoOEGtkEQ8YTgkJBx08Og8RC1gfHVsAAAAF/8X/+gGKAcAAAAAUAB4AJgAuAAADATY3FwYHLgEnNjcXBgcVBh4CPwEmJyYnNxYXFhcHLgEnNx4BFwcuASc3HgEXOwE3Dg1XGiFbyBAQF00KCAcdOjoPchIoJzwIQi4vE18NNCgHLEAOXAgYEgcWHgoBwP6cCApNFxAQyFshGlcNDgEPOjodB3M8KCcSHBMuL0EWKTIOGA5ALBQSGAgTCh4WAAEAAAAEAYwBkAATAAAlNjcXBgcmJyYnNjcXBgcGHgI3ARAKFF4fIWNsaxIQGlMHDAggPj8QbgYOVBoQEmxrYyEfXgoUED8+IAgAAAACAAf/8QGVAX0ACwAdAAAlFgYjISImNxM2MhcTNjcnBgcGJyY3NjcnBgcWFxYBjxciLv7xLyIXiRdCFz8bCzgNBhcsKQkFBzIOCwtAQ1QpOjopAQApKf7KDQ4yCgIMLCkaCgg5ERY9QEAAAAADAAAAEAGwAXAABwAXAB8AABIyFhQGIiY0JTIWHQEUBiMhIiY9ATQ2MxIyNjQmIgYUrVY8PFY8AQoXHh4X/roXHh4XbmpLS2pLASc8Vjw8VoUeF/YXHh4X9hce/tBLaktLagAABQAAAF0BQQEmAA8AEgAXAB4AKAAAExUzByMiPQE0OwEyHQEHNQc1HwEjNxUUNxYPASc3NgcUBiMiJjQ2MhYedhpwCgr6ChtSH0QZIyoSCXUidArCDwoLDw8WDgEJkhoKtQoKKxszqh4eAiMZCpURCXUjdAoqCw8QFA8PAAIAAABAAXwBQAAQACcAACUjIi8DNzY7ATIWHQEUBi8BMj8BJicHJwYHHwEHIwcWFzcXNjcnATzAHxMCAkZKEx/AGiYmZAEBAScFBzIyCQQoAQEBJwUHMjMHBShAGAMCY2gYJhqAGiZ/AQEnEw0yMhAQJwEBJxMNMjINEycAAAAAAQAAADoA7AFHABUAADcjBh8BBgcnByYnNzU2LwE2Nxc3FheoAQoKRQgNYWENCEYJCkUIDWFhDQjLCgtFHhhgYRgeRgEKCkUgF2FgGB4AAAACAAAABgGBAYcAHQAgAAAAHgEPARUUBiMhIiY9ATcVFDMhMj0BByc3IzczNzYDIzUBYhoKBywMCf7XCQwbCQELCaNCorYbti0Hv0IBghoeByz8CQwMCeQb8AkJ0qNDoRwsB/69QgAAAAMAAAACAZYBgAAZACEAKgAAJRYGLwEGIyInIyY1MTQ3FzcWFzYzMhYVFAcmIgYUFjI2NCYiJjQ2MhYVFAGWCB4HPhocFxLKEkU1NQwFHicpOhA0Pi0sQCy6OikqOCofBx4IPhAJLDA0GDU1BAMcOikcGoItPiwsPkMpOCoqHB0AAgAA/+MBQgGSAA0AFQAAJTEUByEmNTQ2Nxc3HgEmIiY0NjIWFAFCGP7uGDIpRkcpMXtMNjZMNlxBODhBITYORkYONl02TDY2TAAAAAQAAAA3AUQBSQAYACMANAA+AAABMh0BFCMhIj0BNDMjMjY3NjU2OwEyFxYzByMUFjI2NTQmIgYXMjU0LgEiDgEVFDMyNjMyFiYyNjU0JiIGFRQBPAgI/swICAgMBwEBBBc0FwQEF1kBEhwSEhoTmQ0JIjYjCQ0DHBsaHAMaExMaEwEuCOYJCeYIBAYDAQ0NDl0NExMNDhMTgg0GDQ0NDQYNExNUEw0OExMODQADAAAAEwFbAW8AHgAhACQAAAEWHQEzFhUjFSInNSMiJj0BIyY1MzUyFxUzMhc3FhcFFTcHMzUBIQI0AjYKErwJDDUBNgkSvQQCOggF/vapnKkBKAQDvBIJNwI1DAm8CRI3AjUBOgUIR6mptqkAAAAAAgAAADkBEQFJAAwAGAAAEyMyFh0BJzU0JisBJwczFyMiJj0BFxUUFvIBDRMiCQWFJAWCJLkNEyYIAUkSDbokgQUJJu8hEw25I4UGCgAAAAADAAD/9gExAYsACQAdACcAADcnIQcOASsBIiYTMhYdASE1NDY7ATU0NjsBMhYdASM1NCYrASIGHQEuFwEDFgEUDJUME9QTG/7PGxMWGhJREhoYDQpLCg0U5uYNEREBTRsTHx8TGwsSGhoSCwoKDQ0KCgAAAAQAAP/uAUoBqAAIABAAHABVAAA2MhYUBiMiJjQ2IiY0NjIWFBcxFAchJjUxNDYyFgc2NycmNTQ/ASYnBwYmPwEmJwcGIi8BBgcXFgYvAQYHFxYUDwEWFzc2Fg8BFhc3NjIfATY3JyY2F5EoHh0VFB5ZTjc3TjdHGf7oGVyKZFUJAwcHBwcDCQYHGAQDEgoDBB4EAwgTAwMYBwYKAgcHBwcDCQYHGAMEEgoDBB4EAw8NBAMYB5YeKB4eKHM3Tjg4TrhAPDxAMD9AZg8NAgMQEQIDDQ8DBBgHBgoCBwcHBwIKBgcYBAMSCgIEIAMCDQ8DAxgGBwoCBwgIBgMIBwYYAwAFAAD/5AGHAY0AFAAiADEANQBEAAA3MhYUBiMiJyMiJjURNDY7ATIWHQEHNS4CJyMiHQEUOwEyNzU0KwEiFREUOwEiNTQ2FzUjFTc2NTQmIyIHBhUUFxYzMv44UVE4NSWICxEQDMcLD3QCAwMBFgQEHANYC6gMDE0DO18kIQYMCQoGBQUHCQj0UHBQIBELAVQLDg4LgNwOAwYIAgMdBNxwCwv+8wsjMErSenqNBggJDAYFCgkFBwAACQAAABUBXgFrAAoAFQAgACsANgBBAEwAVwBiAAATBisBIicjJiczBhcGKwEiJyYnMwYHMyMGKwEiJyYnMwYFBisBIicjJiczBhcGKwEiJyYnMwYHMyMGKwEiJyYnMwYFBisBIicjJiczBhcGKwEiJyYnMwYHMyMGKwEiJyYnMwZRAw4pDQMBBAJXAn8EDCoMBAQCVwIEgwEDDSkOAwQCVwL+9QMOKQ0DAQQCVwJ/Aw0qDQMEAlcCBIMBAw0pDgMEAlcC/vUDDikNAwEEAlcCfwQMKgwEBAJXAgSDAQMNKQ4DBAJXAgE0Dg4YHx8YDg4YHx8YDg4YHx+hDQ0YHx8YDQ0YHx8YDQ0YHx+gDg4YHx8YDg4YHx8YDg4YHx8AAAAACgAA/9QBBwGeAAsAFgAhAC0AOgBGAFIAXQBoAG4AABMxJiczBgcjBisBIjcjJiczBgcGKwEiNzEmJzMGBwYrASIHNSYnMwYPAQYrASI3IzUmJzMGBxUGKwEiNzUmJzMGBxUGKwEiBzEmJzMGByMGKwEiNyMmJzMGBwYrASI3MSYnMwYHBisBIgchBwYiJw0EAT4CAgECCR4JWwECAj0CAgIKHQlaAgI9AgICCh0KuwQBPgICAQIJHglbAQICPQICAgodCVoCAj0CAgIKHQq7BAE+AgIBAgkeCVsBAgI9AgICCh0JWgICPQICAgodCsgBB2sKHAoBeBURGgwJCQwaGgwJCQwaGgwJXQEZDBcOAQkJAQ4XFw4BCQkBDhcXDgEJXRkMFw4JCQ4XFw4JCQ4XFw4JWWwKCgAABQAD/+sBkwGwAAgAFAApADEAPwAANzYzMhcOASImNjIWFRQHBiInJjU0HwEGBycHJic/AS8BNjcXNxYXDwEyBDYzFgYHBic3MwYnJicmPgEWFxYHBnoXGBcXBRkgGhEyIg0VMhUO/igDCjMyCQQoAQEoBAkyMwcFKAEB/tAoEwIMDRsZGgEVFA8IChAoKwoFBgzTBQUdJCT6Py0qGwwMHict3CgMFDIyEBAoAQEnEBAyMw0TKAF3DBgkBAgzLQYGEhwlOworJRIiDQAAAwAA//MBmgGNAAcAGwAhAAASMhYUBiImNDcGBxYfARYyPwE2NyYnByMHBi8BFzI3IxYzeKp4eKp4fBoMAgVeCRkJXQUCDBoJAUYEBEenFwn5CRcBjXiqeHiqAgQDBwVdCQldBQgCBApHBARHqxoaAAIAAABAAW4BQQAFABoAADUhBiMhIjcnJic2Nx8CFj8DFhcGDwEGIgFuCyT+8SWNiQcDFCMOAWcGBmcBDiMUAweJDiViImGFBgsFBQ4BZAYGZAEOBQULBoUNAAAAAQAAACYAtAFaAAsAADcjFTMVIxEzByMVM51iebSyBnFirVssATQsVgAAAAADAAD/9QGEAYYABwAVACAAADYiJjQ2MhYUFzceAQ8BIzUXNyc3NhYHFhcHIyY1NDY3F6I+LCw+K6gBCgcFuzMzDTOuBRauLhKEZRMoIjnxKz4sLD5GAQoYBbszMw0zrgUHBRAghC40GywLOQAEAAAABAH9AVoABQAIACwANAAAJTcVFAYjJzUXEh4BDwEnNzU0JiMhIgYdARQWOwEVIyImPQE0NjMhMhYdATc2BDQ2MhYUBiIBaEMeFYk6uBgIBsM6iwoH/rsHCgoHq6sVHh4VAUUVHhYG/pEcKBwcKARCDxUeATo6AQoYGgbEOotPBwoKB+8HCyIeFfAVHh4VLRcGZygcHCgcAAAEAAAAEQGUAV8ABwASABwAJAAANjIWFAYiJjQXNxUHBi8BNxczFgc1MhYUBiImNDYQMhYUBiImNBIaEhIaEvCklBMXQxg0AQjJDRISGhISGhISGhLWEhoREhpJwTuwEw5aHEYIJwESGhIRGhIBERIaEhIaAAIAAAAoAb4BfAAgADMAACUHBic1IyIGFRQXJjU0NjsBNTQrATczMhYdATM1Nh8BFgc1MxUUBiMhIiY9ATcVFDMhMjUBvjUGCncUGwEGMyMVCfEb5QkMJQkHNQySHAwJ/tYJDBwIAQwJ2zYGAikcEwYCEgsjMlMIHA0JYSkCBzUMnFNiCQwMCeQc8QkJAAAAAAYAAP/4AeEBjgAUABkAHgArAEAAWgAABSMiJj0BMxcWMj8BMzI2PQE3FRQGJzMyFw8BJzMHBjcjIj0BFxYyPwEVFAYnNTQrASIdASczIz8CNh8BFh8BIxcdAQc1NyYrARUGLwEjNScmPwE2FxUzMhYXATb1BghgFAgYCBQnCQ0kCBwWBwQhcgwyDA1I9Q50CBgIdQkqBaIFMAECBARxDg5wBAIDAtRZTRAXRwkGIwENCwsxBwhHFBwCCAkFWBQICBQOCSYjuAUJ2AYgVwsLDSoNt3IICHS5BQijDgYGDy8DAkgJCUcCAgI5LhZiRFQTJwIGIwENCwwwBwIwHBQAAAAHAAD/8wHhAYkADQAZABwAKQA0AEIATAAAARUHFwYrASImPQE0NxcHBiIvASM2OwEyFwc3FSM3NTQrASIdASc3Nh8BByIGHQEjIj0BFyMXFjI/ARUUBisBIiY9ASUjNTMyFh0BNCYB4TEZBgdFBwoIIMUFEQV4AQMJ9QYFeUlWJAaiBTF5Dg551QoOFA5VG20IGAh1CAb1BggBe3p6FR4eAQlEORkICgdFBwYgYAUFdgcGd+NWMw8FBRAwTAkJTGINCVoNuFSXCAh0uAUJCQW3VioeFSsVHwACAAAAOQGqAVoAEwAhAAAlISImPQE3NjQvATU0OwEXMxUUBiU2HwEWFA8BBic1IzUzAZT+xwoNTgoKThc5NOIN/qgIBjEEBDEGCEVFOQ4JEk4KHAtOFxQ01gkO0AIGMQQOBTEGAiI8AAIAAAAXAYgBagAdAC8AACUUBzU0JisBFQYvASY/ATYXFTM1NCsBNzMyFh0BFgc1MxUUBiMhIiY9ATcVFDMhMgGIBRwTdwoGNQwMNQYKWwjxG+QJDTRQHAwJ/tYJDBsJAQwIjQ0PBxQcKQIGNg0MNQYCKGMJGwwJeRaLQlEJDAwJ5BzxCQAAAAACAAAAOQFVAUoACAAWAAA3Bi8BNjMhMhcHFjI/ARUUBiMhIiY9AbkPDpcFBwEzBwW8CRsJlAoH/s0HCq4ODpcFBb8JCZXQBwsLB9AAAgAA//MAWwGNAAMADwAANyMDMwIWFAcGIyInJjQ2M0s8BE0XGg0OExIODRoThQEI/sEaJg0ODg0mGgAAAQAAAGsAmgEVAA4AABMVHAMOBSsBN5oBAQICBAQDiZoBFIgCBwMHAgUCAwEBqgAAAQAAAAQAqQE1ABMAADc1IzUzNTQ2MzIXFSMiHQEzByMVMjIyLyIWDyUeRAk7BIkzKCMqAy4fJTOJAAAAAgAA//wBQwGSABMAGwAAExYXFAcGBwYjIic1PgE3FTUwFxYBNTcUBwYHBtw5LgMMMCAjKkItQBAMIv8AQRQIHQMBCwUUFhZsPQYYugdYSgEBAhP+f+4Fgl0HDAEAAAAAAgAFAB4BdAFzAC4ANAAAAR4BBwYrASImPQEjFRQGKwEiJyY3NjsBNTQ2OwEyFh0BMRYzNTQ2OwEyFh0BMzIHNSMxJxUBSCITCgELZwUMZwsFZwsBEjwFCRgLBDkECRATCgQ5BAoZCHYREgEkOn5DCwgFWVkFCAuWZQo2BAsNBDMBNgQLCwQ2jXABcAABAAD/9QGkAZMA1wAAJRYHNQYHBgcGBw4BKwEWFyImLwEWFyYnLgEnJicmJwYVJjcHNjc2PwE1Jjc0NzY3FTQ2NTcVND8CFRYXMTcWFzYXNTcVNjcVNjcHNjcXFAYHFjcGBxQfARY7ASMzMhUGBwYPAQYPARYVBiMWFxYHLgEjFh0BJicmJxcmJwYVFBceAT4BNzYXFgYnKgEOAgcGJxYzHgEXJgcWNzY3BgcWPwEUFQYXFj4BNz4BNTcWFzYnFhc2JxYXJyYjIg8BLgInNjIXJxYXJxcnHgEXFgcUFhU3FTUWAZUDAQQVFBAEDBE5FBMCCAwfCgkHCigwAQgCHBQZAgQDCQoGDAIHAQEBAgICAgMBBAUCBAEGCxcaBgIKCwkEBQUMBgEBARIGAgIHCxUBCgcDAgQDEBACAQIBAQEBAQIBBQEGAQQJAgICAwgWCRMLEAMaDwQFBgQCCAQKAxomFgICFQMGCiEaEQUEAQIMDAEDAgcKBAUHAQMCCQYICAQuEA8FM0k5LB4BAgIBOp45AhEMAQICChcDBQIBBxOFBwgCHhUSCQ0IDQ0FAQUDAwYDBSQBBQIUIyotEAcwHBclFwYKAgILCQUICgQCAQMBBgMCAggGAg4HAQkJBwcBBgIEBwIKAQQDAQEBAgEBAQ8WAgICCwUNAgYCCQkEAQIBAQIEBwYBAgMCAwICAwEDAQEFCRQMBgEDBwEHEgUKAgQDBwIRCRMBAwMEAxAFAwUGAQEMCgEDAwEBBQ0JDBYFBgULJDQGEUgjAgwFMyABAQQDATUzCQkSBwICBiASGRkBAwEWAQE2AAAAAQAAAAUBBgF3AA0AADc1IxEjJicRHgE7ATcGLQwKFQIthk8CAlOjcf7xCAEBaTM8AU8AAAMAAP/1AScBiwAHAAoAGAAAExcjJyMHIzcHMycXFg8BNwYiJyY/AQc2MkkpGwksCBopAiIRzREKmk0IHwQQCplNCB8Bf4MeHoNSPpEJFMixAgIIFcixAgACAAD/9QErAYsAFgAkAAATNRcGBycHLgEnNzYvATY3FzceARcHBhcWDwE3BiInJj8BBzYyVSIDBzEyAQcCJAUFJAMHMjMBBwIkBbkQCplNByAEEQqaTQcgATcBJA4NMTEEEQYkBQUkEAsyMgQRBiQGYggVyLECAgkUyLECAAAAAAEAAP/1ALUBiwAOAAA3HgEPATcGIicmPwEHNjKTCQQGmk0IHwQRCppNCB/aBBIHyLECAgkUyLECAAAAAAQAAP/wAZ8BkAAIABAAGAAfAAATFQYHBgcjPgE3FhcjJicmJwIWFxUuASczIQYHNT4BN4EnHR4PEBFEylwkEA8eHSb/OicsRBEQAY8jXSU8DwGQERAdHiUsRBEkXSUeHRD+zDoQERBELV0kEQ88JQAEAAD/8AGfAZAABgAPABYAHwAAJDY3MwYHNQE+ATcVBgcGByEuASc1FhcFFhcWFxUuAScBSUARBSRc/uEQRC0sHx4SAZQRQCpdI/5nEh4fLC1EEAdAKl0kBgEZLEQRBhIfHiwqQBEGJF2eLB4fEgYRRCwAAAEAAABWAHEBNAAJAAA1Nyc2NxcVBy4BVlYJB2FhAQ1wV1YQB2EcYQMRAAAAAQAAABYAqgFsAA0AABE2NxcWFA8BJic3NTYnCAqLDQ2LCghoCQoBMiIYjA0lDYsaH2cBCgoAAAADAAAADQF3AYQAFAAtAEoAADcWNxUUKwEiNRE0OwEyHQEmDwEGFyUyFhURFAYrASImPQEjJjU0Nj8BMzU0NjMTMjY1AzQmKwEiBh0BMzU2HwEWDwEGJzUjFRQWM2sFBxVOFBNQFAcFKQ0NAR8HDw0HqwcQECgVCgsODgeZBwoBCgeDBwovBwUtCwstBQcvCgeTBQFxERIBVBESaAEFLgsLwgsG/qsHCgsGmwUPBwoCAZIGC/6gCgcBJwcKCgd7KAEFLQsLLQUBKIQHCgAFAAAAJwGXAVYAAwAGAAkADAATAAARIREhJTUHNyMXBycVFyE1JwcnBwGX/mkBZWpO/n8vagcBIncZG3cBVv7RPKZXl20oVqUuGFgUFlgAAAkAAP/1AZcBiwAFAAkAEAAUABgAHAAiACYALQAAPAE3MxUjNzY3FRM1MxUGIyInJiczExYXIwc1MxU3FhQHIzUVNTMGAzYzMhcVIwxsbAYfRxCHJCAjMEcfZqZIH2eWh3wMDG1nH94kHyUfh5xIIIiXSB9n/u5sbAwRH0gBDR9Il4iIiCBIIIj+Z0gBWgwMbAAAAAAJAAAAFQFVAWsAAwAKAA4AEgAZACAAJAAoAC8AADcjNTM1FSM1NDYzFyM1Mwc1MxUHMxUjIiY1ATIWHQEjNRU1MxUHMxUjMzUzFRQGI2ZmZmYKB81nZ2dn3mZVBwoBRAcKZmbeZ2d4ZgoHjWZ4Z1YHCmdn3mZmEWcKBwFFCgdWZ95mZhFnZ1YHCgAAAAEAAAAQAPIBXwAZAAA3NTMVBiMiJjU0NjMyFwcmIyIGFRQzMjc1I4drNTg+R1I6NSwZIyUnNVkhHDrJAZ0dVlFOWiQbGT9Dgw9iAAAGAAAADgFkAXIADQAdACkAPABMAFgAADcyFxYVFAcGBw4BKwE/ATIWHQEUBisBIiY9ATQ2Mxc3IwcjNyMHMzczBzczNjU0JyYnJicmKwEHMzI2NzYXJzY3NjU0JyYrAQczNzMXLwEWFRQHBisBNzMysAwGBwIDBAQMBwoJYyU0NCWyJTQ0JSUMEwUjBRMMEwUjBm8BAwMEBQYICQoaDB0OEggGVxYMBgcJCBUcDBMFDBMBAQUFBwgNBAoJ4wYHDA8GCAYFBkePNCWyJTQ0JbIlNORkKChkLCwjCg8KBwkEBAMDZAgIBhYrAwgJCgwIB2QoKFIBAwcKBAUgAAAFAAAAeQFjAQcACwAdACsAOgBEAAA/ATMHIzcjByM3Mwc3FhcWFRQHBgcOASsBNzMyFxYHNjU0JisBBzMyNzY3NjcGBxcjJyMHIzczMhYVFAcyNzY1NCYrAQdWBxsRGwgxCBsRGwe5BwUFBQQLCxoUKRElChALBQMSEQwNDgsIBwcHjggSHx0bEQcbESgcGjkOBwgODQ4FzjmOPz+OOSoGCwwNEhERCgsMjgQDTwwRExJmBAQICSALBT05OY4UEg8NBwgMCQouAAMAAP/zAZ0BlAAJACQALgAAPgEWFxYOASYnJiUUDwEGBzc2NTQmIgYVFB8BJi8BJjU0NjMyFgYeAQcOAScuATZPKCQFBRYoJQUFAWUCEhMfGgNgimEDHB8TEwN5VlV5dSgWBQUkFBQXCpwELSQjNwQtJCJcGApjFxeTDxFHZGRHEQ+VFxdjEhJYfH15BDYkIi0CBDZEAAAAAwAA//MBmgGNAAcAFQBEAAASMhYUBiImNBc2NTQnJiMiBhUUFjMyPgE1NCcmJyYnJiMiBwYHFzY3NjMyFxYVFAcGByIGBwYHBgcGHQEzNTQ3Njc2NzZ4qnh4qnjUBgYFCAkKCgkIMgwDAgkLCgkQFQ4LFRQKDQ4HDwgMBwYEAQkDAwoFBQQcBAMHCAUKAY14qnh4qsQGCAcGBQoICQqJFAsQCQcJCQQEBwUYDw0GBgcICw0JCAMIAgELBQoIDQsJDAcFBwgDBgANAAAACgEdAY0ABwAPABcAHwAnAC8ANwA/AEcATwBXAF8AZwAAEjIWFAYiJjQ2MhYUBiImNDYyFhQGIiY0BjIWFAYiJjQ2MhYUBiImNDYyFhQGIiY0BjIWFAYiJjQ2MhYUBiImNDYyFhQGIiY0BjIWFAYiJjQ2MhYUBiImNDYyFhQGIiY0EzIUIyEiNDMZGhERGhJ4GhISGhF4GhERGhK7GhERGhJ4GhISGhF4GhERGhK7GhERGhJ4GhISGhF4GhERGhK7GhERGhJ4GhISGhF4GhERGhI+Cwv++QsLAUcRGhISGhERGhISGhERGhISGkQSGhERGhISGhERGhISGhERGkQRGhERGhERGhERGhERGhERGkQRGhISGhERGhISGhERGhISGgFXIiIAAAACAAAAJgG8AVoACwAXAAA3NTMRIzUjFSMRMxUlMxUjFSM1IzUzNTOoOzttOzsBP0JCMUJCMd58/syKigE0fAItREQtRAAAAAABAAAAJgDjAVoACwAANzM1MxEjNSMVIxEzO207O207O958/syKigE0AAAAAAcAAAAgAZoBkgADAAYACgAOABIAKQAtAAATMxUjBzcXJxUjNRc1MxUnMxUjJjIWFRQGBxE0JisBIgYdARQGHQEmNTQ3FSM1qg8PFjk6LA9EEDIQEHaqeC4oEguiCxIkRJcPAT9AsktL8kBAQEBAQECTeFUyVxwBIgwSEgx5AxkCfT1aVSVAQAACAAAABAGdAYQADQAjAAABIxUGLwEmPwE2FxUzFgcWNzUWFRQGIyInBzcmNTQ2MzIXBhcBnXgKBjMMDDMHCXgFhAoNEF9DLytJHBtfQw4aAgkBKS0CBjQMDDMHAi4WXwoDEyIlRF4cHEgpMURfBg0JAAAAAAIAAAAfAWYBggANABUAABIyFhUUBiM3IwcuATU0FjY0JiIGFBZplGljShQnFz5RzQ4OGA4OAYJpSktloaANYUFKKw4WDg4WDgAAAAATAAD/8wGaAY0ABwAXABsAHwAjACcAKwAvADMANwA7AD8AQwBHAEsATwBTAFcAWwAAEjIWFAYiJjQ3IgYdARQWMyEyNj0BNCYjBTMVIzczFSM3MxUjNzMVIzczFSM3MxUjNzMVIwczFSM3MxUjNzMVIzczFSM3MxUjNzMVIzczFSMHMxUHNzMVIzczFSN4qnh4qnhMCg8OCwEBCw8PC/7/GhonGhomGhomGxsnGxsmGxsnGhrnGhomGxomGhonGhomGhonGhomGhrnMzNAgYGOMzMBjXiqeHiqEQ8JmQwPDwqaCg8lGxsbGxsbGxsbGxsbGxkaGhoaGhoaGhoaGhoaGRoBGxsbGwASAAAAQAGaAVAADwATABcAGwAfACMAJwArAC8AMwA3ADsAPwBDAEcASwBPAFMAAAEyFh0BFAYjISImPQE0NjMFBzM1ByMVMycHMzcVIxUzJxUzNRUjFTMnFTM1BxUzNScjFTMVIxUzJxUzNQcVMzUXNScVOwE1JwU1JxU3NSMVNTM3IwF3DhUVDv6rDhQUDgEAASQBIiJVASMBIyNXIyIiViMjIzMjIyMjVyMjJCFEVaurAQBERCIiASMBUBQOzA4UFRDLDRMxJCRFI2gkJEUjaCQkRSNoJCRFIyNFJCEjaCQkRSMjZyIBJCMBIyIBJEUjI0QkAAAAAAYAAP/oAeABpgAYAB0AOgA+AEYATgAAEyMGBxYXBgcmJwYHJic2NyYnIzUzNTMVMwc2NyMWFzI2MxQGFBYVIgYjIiY0NjMyFhcGBy4BIyIGFBY3MxcjJjIWFAYiJjQXMycjBzM3M+0cCh0IDQMHDwwWMQgEKxoeChxJFkZTGghDCRcBCAEBAQEIAT9aWj85VggHDgdKMTZNTeYBHj0ffFhYfFjJHD4iPhsPSQEwKx4GBQMPCAcREQ4FCxIgKREcHE4XJiWBAQIJBAYBAVp+Wks4AQQwQk1sTTtWpVh8WFh8iqioKgAAAAADAAAAFgF3AUgAEwAgADcAACUHDgEnBwYiJjQ/AT4BFzc2MhYUDwEGFBYyPwEmNj8BJjYmIg8EBhc3NDY1FzcWDwEWPwE2AWNiEC4TOhQ6KBRiEC4TOhQ6KOhiCxYcCjgNBBIOEbgUHAs4GRECDAYRAgEnChwOEgxiCtJiEAcLOhQoOhRiEAcLOhQoOhBiChwWCzgUMRIOAy0WCzgaEAMPEhABAgEBJyYcDgMMYgoAAAIAAP/pAUcBlwANABUAACUUBxcHJzUmNTQ2MzIWBjI2NCYiBhQBRyABhYQfYENEYMZEMDBEL/Q1KwGqqgEqNkRfYJUwRC8vRAAAAAACAAD//AEeAZUAGAAhAAAFIyImPQE0NjsBNTQ2MzIWHQEzMhYdARQGAzQmIgYdATM1AQr2CAwMCAtBLzBBBQgRDDcqPiuTBAwIwQgMPi9DPi8+EQjACA0BJx8rKx8+PgADAAAADAEzAYIACQAXAB8AABMHMxQGIiY0NjI3FxEUBisBIiY1ETQ2MxIyNjQmIgYU3kdhNEo0NEomSREM+wsQEAtXWkBAWkABC0MkMTRKNF1H/u4MEREMATwMEf7dP1xAQFwAAwAAABUAogFaAAsAEwAfAAATIiY1NDsBMhUUBiMVMhQrASI0MxcyFRQGKwEiJjU0Mw0FCA2IDQgFDQ2IDQ2IDQgFiAUIDQEmEAsZGQsQVTIyiBkLEBALGQAAAAABAAAAHgFnAYwADgAAExUyFhQGIyInBzcmNTQ2tEppaUo4LFAfHmkBjAFolGkeJlgsN0ppAAAAAA4AAP/CAPEBhwABAAsAGwApAC0ANwA5AEkATwBVAFoAbAB+AKMAABcVNzUGIyInFRYzMicUFyY9ATQ2MzIXJiMiBhUTIiYnHgEzMjY9ARUUBjcXMyMHFRQXJj0BNjcGFxU3NS4BJx4BFxUUBgcVNT4BJxQXJj0BMx4BFy4BBxYXFSYTNCYnHgEdARQGIyInFjMyNjUnNDYzMhceAR0BFAYjIiYnJjUzNRQGBxUGIyInNTEmJyY9ATY3FRQXHgEzMjY9AR4BHwEzHgEXXDkUChIJCRIKUAYGKh0FCgoEHStIHjELCzEeKTg4QgEBAeUHBwoNDVKVAgcCAgcCNCgoNNoICMMCBgICBtUWPz6iIRgZICodMBITLx0qjysdBAoYISodFSUIBsA0KBQKCRI/FgcQBwgLMR4pOAIGAgEBAgcCPAEBAQIBAQGqDg4ODtMdKwICKx3+zCEbGyE5KH19KDnYAQhuFhISFm4IBwfrM6huAQUCAgUBbipBCjIyCkEqExMTE30BBAEBBKQ8EAEQATgZKAUFJxrTHSorKyod0x0rAgUoGdMdKhgTDg4BKkEKMwICMxA8EhZuDAN9ExMbIDkofQEEAQECBQEAAAABAAMAngD8ANEABQAANzMWByMmA/kEBPkF0RkaGgAAAAEAAAACAW0BbwAQAAAlNjUGBwYiJjQ3NjcHBhQWMgFrAg0kNppsNiQ1Ai5cgo8BATUkNmyaNiQNAi6CXAAAAAADAAAAoQFPAN8ABwARABkAADYyFhQGIiY0NzMyFhQGIiY0NjoBFhQGIiY0EhoSEhoSpwENEhIaEhGJGhISGhLfEhoSEhoSEhoSEhoSEhoSEhoAAAAEAAD/6QHUAZcAEwAVACkAPAAAJRcGBycHJic3Ni8BNjcXNxYXBwYHIxMyFxEUByYvASMiJj0BNDY7ATc2AzMRJg8BBisBIh0BFDsBMh8BFgGiMgQMRkYKBTMGBjEEC0ZEDAQyBrwEBBUEGw8eUzUQGRgRNVIgAwIDCVQDBzIKCjIDB1IJpjMSFUZGEhUzCgYxFhJGRhQUMQrBAawU/nkLCAIeTxsRexEYVBv+lQElCwlUBQpgCgdTCQAAAAIAAAASAQkBgQAOAB4AABMeAh0BFAYrASIvATUXJzEVJxEuAj0BNDY7ATIX3gUOGBEMAQ0Iho4elQUOGBUMAQ0IAYEDDCoX/gwSCIo+kpk+kv7SAw0qF/0NFAgACAAA/9MBvAGvAAgADAAaACQALAAwADQAPgAAJDIWFRQGIiY0NyMnMyUzFxEUBisBIiY1ETQ2EzUjIgYdARQWMzc1IxUzNSM1FzUjFTc1IxU3NCYrARUzMjY1AYwcFBQcFTosBzr+aMBRFA7vDRMSMggLERELTTIyI2cyMjJ0EAsWFgsQWxUNDhQUHEG2cVL+mA4UFA4BmA4U/kTvEAu4CxGHaO9nIIdnZ4doaE0LEO8RCwAABAAAABQBZgF6AAcADQATABkAABIyFhQGIiY0BTYnIwYXNzYnIwYXNzYnIwYXaZRpaZRpARICA7oDA7sDA7sDA7sDA7sDAwF6aZRpaZSgCAwKCkUKCwsKQwsLCwsAAAAAAgAAACYBMwFaAAcADwAAEjIWFAYiJjQWMjY0JiIGFFqAWVmAWm1aQEBaQAFaWoBaWoDAQFpAQFoAAAAAAgAAAAQBmAGEAA4AIgAAAQcGJzUjJjczNTYfARYPATMWFRQGIyInBzcmNTQ2MzIXIwYBlzMGCnsFBXsJBzQMDNVULl9DMCtIHBtfQxIUBgUBNDQGAi0XFi4CBzMMDB0wQUReHBxIKTFEXwUWAAAAAAUAAP/zAa8BngAHABAAHAAgADAAACUjJzUzMhYVBzM2MRUUKwE1ByImNDc2MzIWFRQGBxE3EQMGFRQXFjMyNzY1NCcmIyIBMAMekQQLhQl8F4mPDRAIBw8NEBCO/aYQDxAZGREQDw4bGtoTVQsHdlScGHM4GioODRoWFRp1AU0x/lUBCBQkIxMUFRQkIRUUAAIAAAACATMBfgAJABMAACUiJxE2MzIXEQYlETYzMhcRBiMiAQIcGRkcGRgQ/t0iFBgYECAlAgMBdgMD/okCAgF2BAP+iQIAAAEAAP/8ASYBhAAnAAABMhYVERQGKwE1MzI1ETQrASIdATMyFh0BFAYrASImPQI3IzU0NjMBCA0REQ1HNwgIywdSBgoKBmkGCQEBEQ0BhBEN/rQNESYHAS4HB6YJBpcGCQkGlwICwA0RAAAAAAMAAP/RAd4BrwAHAA8AFwAABCImNDYyFhQCIgYUFjI2NAcVBzUXFRYUAVLGjIzGjJW0f3+0f2qurgsvjMaMjMYBPH+0f3+0bQFk8GQBBhoAAQAA/+QBUwGcAAUAACQUBwURBQFTFP7BAT/YMAy4Abi4AAAAAgAAABYBsAGHACAAJwAAJRUUBiMhIiY9ATcVFDMhMj0BLgE1NDcjNzM2MzIWFRQGNycVNzY1NAFVDAn+1QkMIggBAQgqNwykIpwfKi5BNANhYQargAkMDQniIvEICGwFPioXGiIcQS4oPnI8jzwDCAkAAAAEAAD/+AGqAXgAVABXAGcAeAAAAD4BPwEGBxUOAgcOBSIjBiYjIgYnKgEuBCcmJxcWFRQHHwEWFQcXBiMvASY0NycmNTQ2PwEGFycuATQ1JxYXFj4BNzYWHwE+AhceAQE0Jzc2LgEnJg4CDwEWFx4BPwE+AT8BJicuAwcOARUXFgF6FhIEBAYCAQQPDgkSEQ8OCQkBIR8PEB8gAQkJDg8REgkKCAQFBAQBBgUBAwYJAgcGAQcDAgEBAQICAQgNGAsSJxMaKAwLBA8wFhMn/rsBkAEBGBgJFQgQAhYCHw0vEbQOEAEBCwsCEAgVCRgYAT4BWQIKBQUhHxcWESgTDBILBwMCAwoKAwIDBwsSDA0RRQcICwQ8AQgMFg8DAzUJJAkmBw0GCgICEwNbCRMVBUATAgEFDwUHAgUEAgUGCQYO/qwNBsAFEB8FBAMDBwEGEg8HBAIJBxAFBQIEAQcDAwQFHQwLCAAAAAADAAD/4gH5AYQADgAcADEAACUjFQYvASY/ATYXFTMWBycGJzUjJjczNTYfARYPATY3FwYHJicmJzY3FwYHFQYWFx4BAfleCQczDQ0zBwleBQXIBgleBAReCQY0DAxNEQ5gHCVmb20UExhWDgYIISAhQKIuAgczCw0zBwIuFhdgBgItFhctAgY0DAzlCgpWGRISb21nJxthFAoBEUAgISAAAQAAABYBdwFnABwAACUWFwcGLwE2Ny4BIyIGFBYzMjcXBiMiJjQ2MzIWAUoYFTYNDDYVGwlFLjRKSjQzJhwxREVhYUU+XdcDCDcNDTcJAyw6S2pLJh0xYoxjUwACAAD/8wF4AZ4ACwAoAAA3NDY1BwYHJzczFSM3FhUUBiImNTQ2NzM1FxYVFA8BNSIGFBYyNjU0J7gBBQIRCiQRFJgobpxubU0CYAYGYEBaWoBaJLwGDgMFAw0NHX24M0FObm5OTW4BMzkDCAkDOTRagFpaQDcsAAABAAD/8wF4AZ4AHAAAARYVFAYiJjU0NjczNRcWFRQPATUiBhQWMjY1NCcBUChunG5tTQJgBgZgQFpagFokASMzQU5ubk5NbgEzOQMICQM5NFqAWlpANywAAgAFAD4BXAFQABQAKwAANzU0JisBFQYvASY/ATYXFTMyFhUUNzQ2NTQmKwEVBi8BJj8BNhcVMzIWFRTwGxN4CgY1DQ01BgpVIzNhARsUdwkHNQwMNQcJVSMzPgcUHCkCBjUNDDYGAigzIw1oAQUCExwpAgc1DQw1BwIpMiMLAAADAAD/8wDvAXwAEQAjAC0AADczFhUUBiImNTQ3MwYUFjI2NDcXFSMnBgcjJicHIzU3PgEyFgczMhcmIyIGBzaFEwMaEBsDEgMMCAxAJxgwCgY9BgoxGSgLNCI0RAEUCRAOBhIGDUoMDhcmJhcODAYUEREUpzKBMAoDAwowgTI1XFwdAi8dEwMAAgADACwBhwF6AAsAIQAAExcWDwEGLwEmPwE2FwYvATY3LgEjIgciNCM+ATMyFhcWF4N1BgZ1BgZ0BgZ0BuMJCScNFwJALUMgAQEPPSUySAIWDQEhdQYGdAYGdAYGdQZUCQknBQItPzsBICdHMgIFAAIAAAAkAZcBiQAMABYAABIyFhUUBycmDwEmNTQXIzI2NCYiBhQWd6h4EHEKC7tGlwETGxsmGhsBiXdUKiZxCwu7PF5UTRomGhomGgAGAAD/8wEfAZsAEwAXABsAHwAkACgAABMyFhURFAYrASImPQE0Nj0BNDYzFxUzNSMVMzUjFTM1EzsBJwc3NSMV/Q0VFQ3eDRIhFQ1mIlYiVSIzAURFRKsiAZsVDf6cDRUUDrwDHAOGDRUiT09PT09P/uFVVdBPTwACAAAAHAFVAXUAEQAbAAAlFg4CLwEGIyImNDYyFhUUDwEyNjQmIyIGFBYBUwUGFBUERyQoPVVVelUVfSw+PiwrPj5MBBYSBwVEFVZ8VlY+KCQfP1g/P1g/AAAAAAMAAAA1Ad4BTQAFAAsAFwAAJSY0PwERJSY0PwERJREyNjMyFxEGIyImAR4NDcD+YAwMwv8AAggCCgwMCgIIqQgeCHb+6nIHIAd0/uoEAQ4BA/72AwEAAAADAAAANQHeAU0ABQAMABMAACURNjMRIicHERcWFAcjBxEXFhQHAbwUDhYowsIMDODAwA0NPgEHBP7xb3QBFnQHIAdyARZ2CB4IAAAACAAA//QBmAGMAAMADgASAB0AIQAsADAAOwAAJTUzFSc0KwE1MzIWHQEjJzMVIwcVIzU0NjsBFSMiFSM1Mx0BFDsBFSMiJj0BBSM1Mzc1MxUUBisBNTMyAX0bGwgyQAgNG+RmZn8aDAhAMQkaGgkxQAgMAP9mZn4bDQhAMgiNZmbcCRoMCEFVGgkyQQgMGuVmqjIIGw0IQFUbCDJACA0bAAEAAAAXAVIBaQAhAAATMhYUBiImNTQ3FwYVFBYyNjQmIyIHFxYXFhQGIi8BNxc2qUZjY4xjDBwCTG5MTDctI2ECAwkSGgmTCTIxAWljjGNjRiIcIwkSN0xMbkwbTgEDCRoSCbYJKSkAAQAAABcBRgFaAAoAACUFNjU3NS8BBRYUATv+xTiLjDcBOwumj5UDCAMImI4IFgAAAgAAAAMBfQF/AD8ARwAAJTMUHwEGBycmBgcGHwEGBycmIg8BJic3NiYnJg8BJic3NjQvATY3FxY3Ni8BNjcXFjI/ARYXBwYXFj8BFhcHDgEyNjQmIgYUAV8BDw4HEQ4GFwoYBwYcHQUFRgUFHxsGAwoKGg0OEQcODw8OBxEODBoZBwYcHQUFRgUFHxsGBxgZDg4RBw8PzFY9PVY8wSMFBR8bBwMLChoNDREHDg8PDgcRDQYXChgGBxsfBQVGBQUfGwcGGBcQDREHDg8PDgcRDQ8YGQcHGx8FBYo8Vjw8VgABAAAADQFIAXUAJAAAJR4BBw4BJyY3JwYjIiY0NjMyFzcmNzYeAQYHBicHFBYUBhUXNgEuFAsLCywUHwOCDhMXISAXEw6DBB8ULRYLFCEcgwEBgx1zCy4TFAsLESVLCyEuIAtMJRELCygtCxIVSwEEAgQBTBYAAAACAAAAFQGrAWsAEAAzAAAlIi8BNxcWOwE1FxYVFA8BNSciDwEGKwEmJzMyPwEnJisBNjczMh8BNzY7ATUXFhUUDwE1AT83JCMYKBsjBmAGBmAGJBqMJDYWBAEbJBo7OxokGwEEFjYkNzgkNwZgBgZgRykjGCcbNTkDCAkDOTLQGowpFQ4aOzwaDBYpNzgpMjkDCQgDOTUAAAEAAAAJAOYA7gAPAAA3FhcHFwYHJwcmJzcnNjcXwRAVTk4OF01NFBFNTwwYTu4LGU5PFBBNTQwYTU8UEU4AAAABAAAAFAA7AGwABQAANT4BMxUjAiIXOzMYIVgAAgAAABQAkgCnAAUACwAANzQ2MxUjJz4BMxUjWCIYOlgCIhc7aRokkx8YIVgAAAAAAwAAABQA6gDhAAUACwARAAA3FSM1NDYHNDYzFSMnPgEzFSPqOiJ6Ihg6WAIiFzvhzZAZJHgaJJMfGCFYAAAAAAQAAAAUAUIBHAAFAAsAEQAXAAABESM1NDYHFSM1NDYHNDYzFSMnPgEzFSMBQjsjQDoieiIYOlgCIhc7ARz++MoZJTvNkBkkeBokkx8YIVgABQAAABQBmgFWAAUACwARABcAHQAAAREjNTQ2BxUjNTQ2BzQ2MxUjJz4BMxUjAREjETQ2AUI7I0A6InoiGDpYAiIXOwGaOyMBHP74yhklO82QGSR4GiSTHxghWAFC/r4BBRkkAAEAAQEmAMEBjgAJAAATFhUjJj8BNjIXuwbAAwhJBxQHAT0GEQ8ISQgIAAAACgAA/+QBpgGVAAwAEAAUABsAIQAlACkAMQA4AFMAABMzFxEUKwEiJjURNDYXFTM1IxUzNQcVMzUjIgYXNSMXFDM3NSMVMycjFzcnBxUzBzMyJzQmKwEVMzceARUUDwIWFRQGIyImLwE1JicmNTQ3HwE3Hr1FKuIEEBKFJFcjVSIIChAiIwEVQCNXASMBVgG8mgEJGwMPCgghkRIYEg4BAQ4KBgwCAw0BEhcEHBcBlUL+uCAVCwFrDRKyPT09PRkkPQ+3NCAUATMzMzMRZwEzRKwKDz2qBSAUGBISEMMNCg0MBgXgEAESGh0SKhMcAAAACQAA//wBIQGmAA4AEgAWAB0AJAAoACwAOAA/AAATFxEUBisBIiY1ETQ2OwEHFTM1IxUzNQcVFzUjIgYXNSMVFBY7ATUjFTM1IxU3NSsBMRUzHQEzMjY9ATQmKwEV2kcSDecMDxAMwUQjViNWIwsKDiMjDwo9I1YjViOZmQoKDw4KCwGjSP6/DRERDQFtDRK7NDQ0NBgbATQOrzQdCg00NDQ0F2I0EDUNfBwKDjQAAAACAAAANgERAUsABQARAAA3JjQ/ARElETI2MzIXEQYjIiY/DQ3S/u8DBwIOCBAGAgepCB4IdP7rAwEOAQL+9AIBAAAAAAIAAAA1AQABSwALABEAADciJxE2MzIWMxEiBicHERcWFPQOCAgOAgkBAQk0wsIMOAIBDAIB/vIBcXQBFnQHIAABAAAABQDxAYgAGwAAEzMeARUUBgc1NjU0JicRFAYHBicuAT4BFxYXEYoBLTknIC8iGxURFBkgKwQxIRUSAYMLSC8mPhIJIjkfNQ/+2QwTBAYDBB8mFAQDCAE1AAQAAAARAZEBeQAPABgAIQAqAAATNzY3ESYvASMiJj0BNDYzJRYVFAcnNjQnBzcWFAcnNjU0JzcWFAcnNjU0R1gMEBELWC8KDg4KAVseHhcaGj0TExMTEEwPCAgPBwETWAwC/pgCC1kOCmwKDjpCRkdCDTyAPC0KLFosCSgoJwEGGCwYBRcSEQACAAAAFAD6AXwACAAYAAA3FhQHJzY1NC8BNzY3ESYvASMiJj0BNDYz8ggIDwcHl1MLERAMUzQKDg4K9hgsGAUXEhEXLFMLAv6YAgxSDwp2Cg8AAAACAAEAEAF4AXcAHQAnAAAlMQcXFgcGLwEHBicmPwEnJjY/AjYzMh8CFhcWBzcvAQ8BFwc3FwF1VRYCBwYIZ2YIBgcCFlUGBgd0MgQHCQMydAcDBHxHYSopYUcSVVbgUHIIBQUEODgEBQUIc1AFEAEPaQgIaQ8BCAlJQwxYWAxDYC4uAAABAAEAEAF5AXYAHwAAJTEHFxYHBi8BBwYmPwEnJjc2NzU/ATYzMh8CFRYXFgF1VBUCBwYIZmcIDAEWVQcEAwd0MgMJBwQzcwgDA+BQcwgFBAQ3NwQKB3NQBQkHAQEPaQcHaQ8BAgYIAAEAAAAFAXcBfAAPAAATITIWFREUBiMhIiY1ETQ2MwERFB8bE/7mFBsfAXwcE/7mExsbEwEaExwAAwAA//MBmgGNAAoAEgAaAAA3MxQGIyImNDYyFyYyFhQGIiY0FjI2NCYiBhTPeUcyMUdHYiSsqnh4qniRfFhYfFjAMUdGZEckeHiqeHiq61h8WVl8AAAAAAIAAAAMAWcBdAAHABIAABIyFhQGIiY0FjI2NSM3JiMiBhRplGpqlGl2elWSaCk/PVUBdGqUamqU3Fc9ZStVegABAAYAaAFlAQ0AFgAAJQcGJzUjFQYvASY/ATYXFTM1Nh8BFhQBXz8HC7YMBz8ODj8HDLYLBz8GrD8HAjY2Agc/Dg8/BwI8PAIHPwYRAAAAAAIAAAAIAcsBfAASACUAADcyNxcGIyImJyYnNzYfAQYHHgE3FhcHBi8BNjcuASMiByc2MzIW5jwrHDZNRmkJGRU3DQw4FB4JUe4YFTcMDTcSHwlRNT0qHTdNRmkwKx02XEUDCDcNDTcJAzNFqwMIOAwMOAgDNEQqHDdcAAACAAQAIQFiAXEAHgBGAAABHgEOAScmJxY3FhcWPgEmJyYnBgcOAS4BPgEXFhcWBzY1BgcGBwYnNjc2NyYnJicmIiciJisDDgEVFBYzMjY3NTY0MjUBJi4bNGYuIRESFwsQIUomFCEIDgIPGmZcGzRmLjAMFjwGLRcDBBUPBwUePwscCQ0CBgEBBAEKBQIkMjcmHS0LAQEBCBplWhsaEyEDBA4JExNCSRMEBCEZLRs0ZVobGhwxAz0PDwUoBQoCBBYJNQgfEAUEAQEBAjUlJjcfGgEBAgEAAAADAAYAAwGqAZUADQBNAFwAADcmJzY3PgEzMhcWBgcGFxYVFAcGIyInLgInIgcVHgEXHgEXFgcGBwYjIicuAScmNjc2OwEOAQcGBwYHBh8CMzIWMzI3Nj0BNjc2NxYHFhcWFRQHBiMnJjc2MzLQCxMZHSpJDQQBBzkwHbUHDQwRCAQKBAsDAgIDCwIEDQMMBw5PIyUiJjNKDQ0dJj9dBgMHARwWHhImCgMSAwMLBjceFBoZIBU53hEIAgwUGxwIGgwRAdkVCh4dKjgBB04wHQ0PEhANDAEEAgQBAgYEDgMFEwUSFCYVCQoOPSgpVR8zAgkBGxoCEiZFEwMBHhQeARYaIBkeKgoOBAoQDBQBMhoMAAIAAAAeAWYBhAAHABEAABIyFhQGIiY0BScHBi8BBxcWN2mUaWmUaQEFBXQCASUVLxAOAYRplGlplB0xiQICMhpACg4AAQAA//wBmgGDAAsAADcOAS8BNx8BFjcBFa4OJhBqJ1IBDA0BBw0OBQqQLXABDAwBM14AAAQAAP/ZAasBwAAiAC4ANgBCAAATMh0BMzU0MzIdATcyFh0BHgEVFAYjIicjIiY1ETQ2OwE1NBcHFzY/AR0BMzY3NRYiBhQWMjY0BxcWPwEWFwcGLwE2PgycDAsfCQ4zRVU8YSd8CQ0NCR1aLg0TBQYKAg+qaktLakunIgUGIgEHIg4OIQcBwAwpKQwMKQENCX8MTDU8VW4OCQEYCQ0oDIonEA8FBh1cBhZ6TEtqS0tqGiEGBiEBDiIODiIOAAAAAAQAAP/DAV4BvQAOAB4AKgA6AAAXNxcHNy4BNDcVBhUUFjMDHgEVFAc1NjU0JicjByc3BjIWHQEOASImLwE0FzU0JisBIgYdARQWOwEyNrgNKk0NSWY0KGRHCElmNChfQwoNKk02SDIBMkYyAQGcCgdnBwoKB2cHCgseKCgeAkFcIgYdJCo7Aa4CNiYnHAUYHiIyARkiIW4RDNoMEBAM2gzOqwcKCgerBwoKAAAEAAD/wwFeAb0ADgAeACoALgAAFzcXBzcuATQ3FQYVFBYzAx4BFRQHNTY1NCYnIwcnNwYyFh0BDgEiJi8BNBYyNCK4DSpNDUlmNChkRwhJZjQoX0MKDSpNNkgyATJGMgEBIiYmCx4oKB4CQVwiBh0kKjsBrgI2JiccBRgeIjIBGSIhbhEM2gwQEAzaDEYmAAAFAAAAFQGIAWEAFQAkADMAQwBTAAABMhYdAQYHNTQmKwEiBh0BJic1NDYzHwEWByMVBic1IyY/ATYyBzMHNxcHFwcnByc3JzcXNzEzBzcXBxcHJwcnNyc3FzcxMwc3FwcXBycHJzcnNxcBPw0SBw4KB+cHCQ4HEg2JQQcCIjMzIgIHQQYSoh8FLQQpGxsTEB0bKQUsgyAFLQQpGxwSERwaKQUshCAFLQMoGhsTEB0bKQUsAWESDQIDBAMHCgoHAwQDAg0SOkAHDUYGBkYNB0AGpC0NHgMkDyYlDiQDHg0tLQ0eAyQPJiUOJAMeDS0sDB4DJA4lJQ4kAx4NAAACAAAAFQEyAWQAFQAkAAABMhYdAQYHNTQmKwEiBh0BJic1NDYzHwEWByMVBic1IyY/ATYyARMNEgcOCgfmBwoOBxINiUEHAiIzMyICB0EGEgFkEw4DAwQDBwsLBwMEAwMOEz1ABw2+Bga+DQdABgAAAQAAADUBVQFLACwAAAEGBxQWFRQGIyInFjMyNyYnFjMyNy4BPQEWMyY1NDcWFyY1NDYzMhc2NwYHNgFVDhUBbVs5MgUMMSYzDwQJDQYYIBAQIAo5VwIpHSAUGBQHGBcBKhYPAQYCTHsgAR4CLgECBScZAQkWJRIRRQQKBh0pFgQNGA8DAAAAAAEAAAA8AQgBXwAaAAA2IiY1NDcXBhQWMjY0JiMGBycmPwEWFzUyFhS7bk0nFB48Vjw8KwIFJwgIJwUCN008TTc2JxQeVjw8VjwZDicJCCcNFghNbgAAAAABAAAAJgE+AXIAGAAANysBJiczMjY0JisBBgcnJj8BFhczMhYUBrWaAQ0NtSs7OytaAwk/Dg4/CQNaOFFRJg0WO1Y7JhU+Dg4+FSZQcFEAAAEAAP/jAdUBlgAhAAAlIzIWHQEUBiMhIiY9ATQ2OwE1NCYjIgYdASM1NDYyFh0BAcABCQ0NCf75CQwMCQwtHyAtK0ZkReIMCdQJDQ0J1AkMPSAtLh9GRjFGRjE9AAAAAAEAAAAmAWEBWgAYAAAlFhcHBi8BNjcuASMiBhQWMxUiJjQ2MzIWATMdETgNDDcSHgRAKy9BQi5AWlpAPVjKAwc4DAw4CAMqOkFcQipagFpUAAAAAAQAAP/qAMkBpgAYABwAKAA0AAA3Mh0BFCMOAgcGBxUGIic1JyYnIj0BNDM3FSM1FzU0IwciHQEUOwEyNzU0KwEiHQEUOwEywQgHBQ8VBhYJCgoIIAskCQnAyVMHFQcHFQdEBxQICBQH/AlgCAUQFgcYCE0CAk8jDCEIYAmqmZlPFgcBBxUHCBQIBxQIAAAAAAIAAAAVAPUBXQALABMAADcjFAcjJjU0Nxc3FiYiJjQ2MhYU9QES0BJFNTZFXjooKDopcjUoLDE0GDU1GCspOikpOgAAAgACADIAiAFPABoAMgAANwcGHwEVJyY0PwE2LwImPwEVBwYfAhYUDwEGHwEVJyY/ATYvAiY/ARUHBh8CFgd2JgICNUQBATcCAgI1AwNENQICAjUBAXYBATRDBAQ3AgICNQMDQzQBAQE2BASqKQECOBRJAQYCOwICATkFBUgTOAIBAjoBBgI7AQI4E0gFBDsCAgE5BQVIEzgCAQI6BQQAAAQAAAA2AVMBWAALABUAHwA8AAASMhYdARQGIiY9ATQHMzIWHQEUBisBNjQ/ATYXFQYvATc1FRQWMjY9ARcWFxUUBgcVMxUjNTM1LgE9AT4B9iQaGiQa3BgLEBELFzMHSQkNDghJkSQyIwYGAyAZGlgaGSADCQFYGxKDEhoaEoMSFRELiAsRVhQGRQkDtgIIRT4BThkkJBlNBAMCRRooBiIICCIGKBpFAgYAAAADAAD//AGAAYQAFQAbACoAAAEyFhURFAYrASImIy4BNTQ2NzU0NjMTNjQvARUXETQrASIdAR4BFRQHMzIBYg0REQ3qAQMBMEMzJxENPwUFW/4Hywg0SCR7BwGEEQ3+tA0RAQVHMSpEC3MNEf7sAhADN4MQAS4HB18BSTQyJgAAAAEAAAAfAc8BYQAXAAABNjMRIi8BFRQGKwEiJj0BNDY7ATIWHQEBtQsPDwt8LyCbIC8vIJsgLwFWC/6+C3szIC8uIZwgLy8gMwAAAAADAAAAawGQARwAEgAcACQAACUjIiY0NjIWFRQHMyY0NjIWFAYlIgYUFjI2NCYjMiIGFBYyNjQBN94lNDRKMxlgGjRKNDT+/RkiIjIiIxn4MiIiMiJrNEozMyUmGRpKMzNKNJQiMiIiMiIiMiIiMgAABAAAABUBvAFrAAMACwAbACAAADc1IRUmIgYUFjI2NDcyFhURFAYjISImNRE0NjMTMyEDITMBVuUmHBwmHOsHCgoH/mYHCgoHEAEBeQH+iEnu7sAbKBsbKH0NB/7SBw0NBwEuBw3+zAESAAAAAQAAACkANABeAAcAADYyFhQGIiY0DxYPDxYPXhAWDw8WAAAAAgAAACkAtACuAAkAEQAANzIXByYjIgcnNhYyFhQGIiY0WjweHhIqLBAeHzAWDw8WD641HikpHjVQEBYPDxYAAAMAAAApASYA/QAJABMAGwAANzIXByYjIgcnNhcyFwcmIyIHJzYWMhYUBiImNJJdNx0qTUksHTZcPB4eEiosEB4fMBYPDxYP/UwdPz4dS081HikpHjVQEBYPDxYABAAAACkBlAFNAAkAEwAdACUAADcyFwcmIyIHJzYXMhcHJiMiByc2NzIXByYjIgcnNhYyFhQGIiY0yl03HSpNSSwdNlw8Hh4SKiwQHh87elAdQmtpRB1PcBYPDxYP/UwdPz4dS081HikpHjWfYR1WVh1h7xAWDw8WAAAAAAUAAP/9AZkBTAAdACEAKgAzADsAACUeARUUBiImNTQ3JiMiByc2MzIXNjcmIyIHJzYyFwc1IxU+ATU0IyIVFDM3JiIHJzYzMhcGMhYUBiImNAFMICwwQi8HFB0tER0ePSsgEBcsRk0rHDi4OA4YFAoSERE2Q9pDHVF8fU/XFg8PFhCeAi4gITAwIRMOFyoeNCAMAzg/HUpKrFlZXgoIERESalVVHGFhjQ8WEBAWAAAAAAAOAK4AAQAAAAAAAABEAIoAAQAAAAAAAQAKAOUAAQAAAAAAAgAFAPwAAQAAAAAAAwAmAVAAAQAAAAAABAAKAY0AAQAAAAAABQAQAboAAQAAAAAABgAKAeEAAwABBAkAAACIAAAAAwABBAkAAQAUAM8AAwABBAkAAgAKAPAAAwABBAkAAwBMAQIAAwABBAkABAAUAXcAAwABBAkABQAgAZgAAwABBAkABgAUAcsAQwByAGUAYQB0AGUAZAAgAGIAeQAgAEcAdQBpAGwAbABhAHUAbQBlACwALAAsACAAdwBpAHQAaAAgAEYAbwBuAHQARgBvAHIAZwBlACAAMgAuADAAIAAoAGgAdAB0AHAAOgAvAC8AZgBvAG4AdABmAG8AcgBnAGUALgBzAGYALgBuAGUAdAApAABDcmVhdGVkIGJ5IEd1aWxsYXVtZSwsLCB3aXRoIEZvbnRGb3JnZSAyLjAgKGh0dHA6Ly9mb250Zm9yZ2Uuc2YubmV0KQAAZwBhAGkAYQAtAGkAYwBvAG4AcwAAZ2FpYS1pY29ucwAAaQBjAG8AbgBzAABpY29ucwAARgBvAG4AdABGAG8AcgBnAGUAIAAyAC4AMAAgADoAIABnAGEAaQBhAC0AaQBjAG8AbgBzACAAOgAgADIANQAtADIALQAyADAAMQA1AABGb250Rm9yZ2UgMi4wIDogZ2FpYS1pY29ucyA6IDI1LTItMjAxNQAAZwBhAGkAYQAtAGkAYwBvAG4AcwAAZ2FpYS1pY29ucwAAVgBlAHIAcwBpAG8AbgAgADAAMAAxAC4AMAAwADAAIAAAVmVyc2lvbiAwMDEuMDAwIAAAZwBhAGkAYQAtAGkAYwBvAG4AcwAAZ2FpYS1pY29ucwAAAAACAAAAAAAA/8AAGQAAAAAAAAAAAAAAAAAAAAAAAAAAAPEAAAABAAIBAgEDAQQBBQEGAQcBCAEJAQoBCwEMAEQARQBGAEcASABJAEoASwBMAE4ATwBQAFEAUgBTAFUAVgBXAFgAWQBaAFsAXABdAQ0BDgEPARABEQESARMBFAEVARYBFwEYARkBGgEbARwBHQEeAR8BIAEhASIBIwEkASUBJgEnASgBKQEqASsBLAEtAS4BLwEwATEBMgEzATQBNQE2ATcBOAE5AToBOwE8AT0BPgE/AUABQQFCAUMBRAFFAUYBRwFIAUkBSgFLAUwBTQFOAU8BUAFRAVIBUwFUAVUBVgFXAVgBWQFaAVsBXAFdAV4BXwFgAWEBYgFjAWQBZQFmAWcBaAFpAWoBawFsAW0BbgFvAXABcQFyAXMBdAF1AXYBdwF4AXkBegF7AXwBfQF+AX8BgAGBAYIBgwGEAYUA7wGGAYcBiAGJAYoBiwBSAYwBjQGOAY8BkAGRAZIBkwGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0BrgGvAbABsQGyAbMBtAG1AbYBtwG4AbkBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgHHAcgByQHKAcsBzAHNAc4BzwHQAdEB0gHTAdQB1QEtATABMQEyATMBNAE1ATYBNwE4ATkCMmcCM2cCNGcNYWNjZXNzaWJpbGl0eQthZGQtY29udGFjdANhZGQGYWRkb25zCGFpcnBsYW5lC2FsYXJtLWNsb2NrCmFsYXJtLXN0b3AFYWxhcm0FYWxidW0HYWxsLWRheQphcnJvdy1iYWNrDWFycm93LWZvcndhcmQGYXJ0aXN0CmF0dGFjaG1lbnQKYmFjay1saWdodARiYWNrCWJhdHRlcnktMAliYXR0ZXJ5LTEKYmF0dGVyeS0xMAliYXR0ZXJ5LTIJYmF0dGVyeS0zCWJhdHRlcnktNAliYXR0ZXJ5LTUJYmF0dGVyeS02CWJhdHRlcnktNwliYXR0ZXJ5LTgJYmF0dGVyeS05EGJhdHRlcnktY2hhcmdpbmcPYmF0dGVyeS11bmtub3duDmJsdWV0b290aC1hMmRwEGJsdWV0b290aC1jaXJjbGUZYmx1ZXRvb3RoLXRyYW5zZmVyLWNpcmNsZRJibHVldG9vdGgtdHJhbnNmZXIJYmx1ZXRvb3RoCmJyaWdodG5lc3MIYnJvd3NpbmcDYnVnCGNhbGVuZGFyDmNhbGwtYmx1ZXRvb3RoDmNhbGwtZW1lcmdlbmN5D2NhbGwtZm9yd2FyZGluZwxjYWxsLWhhbmctdXAJY2FsbC1ob2xkDWNhbGwtaW5jb21pbmcKY2FsbC1tZXJnZQtjYWxsLW1pc3NlZA1jYWxsLW91dGdvaW5nDWNhbGwtcmV2ZXJzZWQMY2FsbC1yaW5naW5nBGNhbGwSY2FsbGJhY2stZW1lcmdlbmN5BmNhbWVyYRBjaGFuZ2Utd2FsbHBhcGVyC2NsZWFyLWlucHV0BWNsb3NlB2NvbXBvc2UMY29udGFjdC1maW5kCGNvbnRhY3RzB2NyYXNoZWQEY3JvcARkYXRhBmRlbGV0ZQlkZXZlbG9wZXILZGV2aWNlLWluZm8HZGlhbHBhZBBkaXNtaXNzLWtleWJvYXJkDGRvLW5vdC10cmFjaw9kb3dubG9hZC1jaXJjbGUIZG93bmxvYWQEZWRnZQxlZGl0LWNvbnRhY3QKZWRpdC1pbWFnZQRlZGl0DWVtYWlsLWZvcndhcmQPZW1haWwtbWFyay1yZWFkEWVtYWlsLW1hcmstdW5yZWFkCmVtYWlsLW1vdmULZW1haWwtcmVwbHkFZW1haWwLZXhjbGFtYXRpb24GZXhwYW5kCGZhY2Vib29rCGZlZWRiYWNrBGZpbmQHZmlyZWZveARmbGFnCmZsYXNoLWF1dG8JZmxhc2gtb2ZmCGZsYXNoLW9uDGZvY3VzLWxvY2tlZA1mb2N1cy1sb2NraW5nDWZvcndhcmQtbGlnaHQHZm9yd2FyZAdnZXN0dXJlBWdtYWlsDWdyaWQtY2lyY3VsYXIEZ3JpZANnc20JaGRyLWJveGVkA2hkcgpoZWFkcGhvbmVzBGhlbHAKaG9tZXNjcmVlbgloc3BhLXBsdXMEaHNwYRhpbXBvcnQtbWVtb3J5Y2FyZC1jaXJjbGUMaW5jb21pbmctc21zBGluZm8Pa2V5Ym9hcmQtY2lyY2xlCGtleWJvYXJkCWxhbmd1YWdlcwRsaW5rCGxvY2F0aW9uBGxvY2sNbWVkaWEtc3RvcmFnZQRtZW51CG1lc3NhZ2VzA21pYwRtb29uBG1vcmUEbXV0ZQNuZmMGbm8tc2ltDW5vdGlmaWNhdGlvbnMMb3V0Z29pbmctc21zB291dGxvb2sFcGF1c2UMcGljdHVyZS1zaXplC3BsYXktY2lyY2xlBHBsYXkIcGxheWxpc3QHcHJpdmFjeQxyZWNlbnQtY2FsbHMGcmVsb2FkC3JlcGVhdC1vbmNlBnJlcGVhdAlyZXBseS1hbGwGcm9ja2V0BnJvdGF0ZQVzY2VuZQdzZC1jYXJkBnNlYXJjaAlzZWVrLWJhY2sMc2Vlay1mb3J3YXJkBnNlbGVjdApzZWxmLXRpbWVyBHNlbmQIc2V0dGluZ3MFc2hhcmUHc2h1ZmZsZQhzaWduYWwtMAhzaWduYWwtMQhzaWduYWwtMghzaWduYWwtMwhzaWduYWwtNAhzaWduYWwtNQ5zaWduYWwtcm9hbWluZwtzaW0tdG9vbGtpdANzaW0Jc2tpcC1iYWNrDHNraXAtZm9yd2FyZAVzb25ncwlzb3VuZC1tYXgJc291bmQtbWluCnN0YXItZW1wdHkJc3Rhci1mdWxsBHN0b3AOc3RvcmFnZS1jaXJjbGUHc3RvcmFnZQZzd2l0Y2gEc3luYwl0ZXRoZXJpbmcGdGhlbWVzC3RpY2stY2lyY2xlBHRpY2sEdGltZRN0b2dnbGUtY2FtZXJhLWZyb250EnRvZ2dsZS1jYW1lcmEtcmVhcg90b3B1cC13aXRoLWNvZGUFdG9wdXAHdHdpdHRlcg11bmRvLWNpcmN1bGFyBHVuZG8GdW5sb2NrDnVwZGF0ZS1iYWxhbmNlA3VzYgR1c2VyB3ZpYnJhdGUJdmlkZW8tbWljCnZpZGVvLXNpemUFdmlkZW8Jdm9pY2VtYWlsCXdhbGxwYXBlcgZ3aWZpLTEGd2lmaS0yBndpZmktMwZ3aWZpLTQQd2lmaS1wZXJtaXNzaW9ucwAAAAAB//8AAgABAAAADgAAAB4AAAAAAAIAAgADACUAAQAmAPAAAgAEAAAAAgAAAAAAAQAAAAoAHgAsAAFsYXRuAAgABAAAAAD//wABAAAAAWxpZ2EACAAAAAEAAAABAAQABAAAAAEACAABEV4AGAA2AEAASgBUAXoDyAYKBuAH/gj+CVQJ1AoyCmoKrgsqC2QLmgwSDKAPHBAKEHwQ4gABAAQAJgACABQAAQAEACcAAgAUAAEABAAoAAIAFAAOAB4AOgBWAG4AhgCcALIAyADaAOoA+AEGARIBHgA0AA0AHQAdABsAIgADABMAGwAdACIADgAdABEAKQANABAAEAASAB4AHgAWAA8AFgAYABYAHwAkACoACwARABEAAwAQABsAGgAfAA4AEAAfAC4ACwAYAA4AHQAZAAMAEAAYABsAEAAXADYACgAfAB8ADgAQABUAGQASABoAHwAzAAoAHQAdABsAIgADAA8ADgAQABcALwAKABgADgAdABkAAwAeAB8AGwAcAC0ACAAWAB0AHAAYAA4AGgASADIABwAYABgAAwARAA4AJAA1AAYAHQAfABYAHgAfACwABgARABEAGwAaAB4AMQAFABgADwAgABkAMAAFABgADgAdABkAKwADABEAEQAXADAAZACKAKwAzgDuAQwBIgE4AU4BYgF2AYoBngGyAcYB2gHuAgICFgIqAjwCRgBIABkAGAAgABIAHwAbABsAHwAVAAMAHwAdAA4AGgAeABMAEgAdAAMAEAAWAB0AEAAYABIASQASABgAIAASAB8AGwAbAB8AFQADAB8AHQAOABoAHgATABIAHQBHABAAGAAgABIAHwAbABsAHwAVAAMAEAAWAB0AEAAYABIARAAQAA4AHwAfABIAHQAkAAMAEAAVAA4AHQAUABYAGgAUAEUADwAOAB8AHwASAB0AJAADACAAGgAXABoAGwAiABoARgAOABgAIAASAB8AGwAbAB8AFQADAA4ABgARABwASwAKAB0AFgAUABUAHwAaABIAHgAeADsACgAOAB8AHwASAB0AJAADAAUABAA3AAoADgAQABcAAwAYABYAFAAVAB8AQgAJAA4AHwAfABIAHQAkAAMADABBAAkADgAfAB8AEgAdACQAAwALAEAACQAOAB8AHwASAB0AJAADAAoAPwAJAA4AHwAfABIAHQAkAAMACQA+AAkADgAfAB8AEgAdACQAAwAIAD0ACQAOAB8AHwASAB0AJAADAAcAPAAJAA4AHwAfABIAHQAkAAMABgBKAAkAGAAgABIAHwAbABsAHwAVADoACQAOAB8AHwASAB0AJAADAAUAOQAJAA4AHwAfABIAHQAkAAMABABDAAkADgAfAB8AEgAdACQAAwANAEwACAAdABsAIgAeABYAGgAUADgABAAOABAAFwBNAAMAIAAUABcAMABWAHgAmAC2ANQA8AEMASgBQgFcAXYBjgGmAbwB0AHiAfQCBAIUAiICLgI4AFsAEgAOABgAGAAPAA4AEAAXAAMAEgAZABIAHQAUABIAGgAQACQAXQAQABUADgAaABQAEgADACIADgAYABgAHAAOABwAEgAdAFEADwAOABgAGAADABMAGwAdACIADgAdABEAFgAaABQAUAAOAA4AGAAYAAMAEgAZABIAHQAUABIAGgAQACQATwAOAA4AGAAYAAMADwAYACAAEgAfABsAGwAfABUAWAANAA4AGAAYAAMAHQASACEAEgAdAB4AEgARAFcADQAOABgAGAADABsAIAAfABQAGwAWABoAFABUAA0ADgAYABgAAwAWABoAEAAbABkAFgAaABQAWQAMAA4AGAAYAAMAHQAWABoAFAAWABoAFABhAAwAGwAaAB8ADgAQAB8AAwATABYAGgARAFIADAAOABgAGAADABUADgAaABQAAwAgABwAVgALAA4AGAAYAAMAGQAWAB4AHgASABEAXgALABgAEgAOAB0AAwAWABoAHAAgAB8AVQAKAA4AGAAYAAMAGQASAB0AFAASAFMACQAOABgAGAADABUAGwAYABEAYgAIABsAGgAfAA4AEAAfAB4ATgAIAA4AGAASABoAEQAOAB0AYAAHABsAGQAcABsAHgASAGMABwAdAA4AHgAVABIAEQBcAAYADgAZABIAHQAOAF8ABQAYABsAHgASAGQABAAdABsAHABaAAQADgAYABgACQAUADYAVgBwAIgAnACuAL4AzABqABAAFgAeABkAFgAeAB4AAwAXABIAJAAPABsADgAdABEAbAAPABsAIgAaABgAGwAOABEAAwAQABYAHQAQABgAEgBrAAwAGwADABoAGwAfAAMAHwAdAA4AEAAXAGgACwASACEAFgAQABIAAwAWABoAEwAbAGcACQASACEAEgAYABsAHAASAB0AbQAIABsAIgAaABgAGwAOABEAaQAHABYADgAYABwADgARAGYABgASABgAEgAfABIAZQAEAA4AHwAOAAwAGgA+AF4AegCUAKwAxADaAPAA/gEKARQAdAARABkADgAWABgAAwAZAA4AHQAXAAMAIAAaAB0AEgAOABEAcwAPABkADgAWABgAAwAZAA4AHQAXAAMAHQASAA4AEQByAA0AGQAOABYAGAADABMAGwAdACIADgAdABEAbwAMABEAFgAfAAMAEAAbABoAHwAOABAAHwB4AAsAIwAQABgADgAZAA4AHwAWABsAGgB2AAsAGQAOABYAGAADAB0AEgAcABgAJABwAAoAEQAWAB8AAwAWABkADgAUABIAdQAKABkADgAWABgAAwAZABsAIQASAHkABgAjABwADgAaABEAdwAFABkADgAWABgAcQAEABEAFgAfAG4ABAARABQAEgAMABoANgBSAGwAggCWAKgAugDMANwA7AD2AIQADQAbAB0AIgAOAB0AEQADABgAFgAUABUAHwCDAA0AGwAQACAAHgADABgAGwAQABcAFgAaABQAggAMABsAEAAgAB4AAwAYABsAEAAXABIAEQB/AAoAGAAOAB4AFQADAA4AIAAfABsAgAAJABgADgAeABUAAwAbABMAEwCBAAgAGAAOAB4AFQADABsAGgB7AAgAEgASABEADwAOABAAFwB6AAgADgAQABIADwAbABsAFwCFAAcAGwAdACIADgAdABEAfQAHABYAHQASABMAGwAjAH4ABAAYAA4AFAB8AAQAFgAaABEABQAMACgAOABEAE4AiAANAB0AFgARAAMAEAAWAB0AEAAgABgADgAdAIYABwASAB4AHwAgAB0AEgCHAAUAGQAOABYAGACJAAQAHQAWABEAigADAB4AGQAHABAAJgA8AFAAZABuAHgAjwAKABsAGQASAB4AEAAdABIAEgAaAI0ACgASAA4AEQAcABUAGwAaABIAHgCQAAkAHgAcAA4AAwAcABgAIAAeAIsACQARAB0AAwAPABsAIwASABEAkQAEAB4AHAAOAI4ABAASABgAHACMAAMAEQAdAAMACAA6AFQAkgAYABkAHAAbAB0AHwADABkAEgAZABsAHQAkABAADgAdABEAAwAQABYAHQAQABgAEgCTAAwAGgAQABsAGQAWABoAFAADAB4AGQAeAJQABAAaABMAGwACAAYAJgCVAA8AEgAkAA8AGwAOAB0AEQADABAAFgAdABAAGAASAJYACAASACQADwAbAA4AHQARAAQACgAeADAAOgCXAAkADgAaABQAIAAOABQAEgAeAJkACAAbABAADgAfABYAGwAaAJgABAAWABoAFwCaAAQAGwAQABcACAASAC4AQABMAFYAYABqAHQAmwANABIAEQAWAA4AAwAeAB8AGwAdAA4AFAASAJ0ACAASAB4AHgAOABQAEgAeAJ8ABQAWABoAIAAeAKIABAAgAB8AEgChAAQAGwAdABIAnAAEABIAGgAgAKAABAAbABsAGgCeAAMAFgAQAAMACAAkADIApQANABsAHwAWABMAFgAQAA4AHwAWABsAGgAeAKQABgAbAAMAHgAWABkAowADABMAEAADAAgAIgAyAKcADAAgAB8AFAAbABYAGgAUAAMAHgAZAB4AqAAHACAAHwAYABsAGwAXAKYAAQAGAA4AKABAAFIAYgBuAKoADAAWABAAHwAgAB0AEgADAB4AFgAlABIAqwALABgADgAkAAMAEAAWAB0AEAAYABIArQAIABgADgAkABgAFgAeAB8ArgAHAB0AFgAhAA4AEAAkAKkABQAOACAAHgASAKwABAAYAA4AJAAHABAAKgBCAFYAZAByAIAArwAMABIAEAASABoAHwADABAADgAYABgAHgCxAAsAEgAcABIADgAfAAMAGwAaABAAEgCzAAkAEgAcABgAJAADAA4AGAAYALIABgASABwAEgAOAB8AtAAGABsAEAAXABIAHwCwAAYAEgAYABsADgARALUABgAbAB8ADgAfABIAIABCAGAAfgCYALIAygDgAPYBCgEeATIBRgFaAWwBfgGQAaIBtAHGAdgB6AH4AggCFgIkAjICPgJKAlYCYAJqAnQA0gAOAB8AGwAdAA4AFAASAAMAEAAWAB0AEAAYABIAxwAOABYAFAAaAA4AGAADAB0AGwAOABkAFgAaABQAywAMABcAFgAcAAMAEwAbAB0AIgAOAB0AEQC6AAwAEgASABcAAwATABsAHQAiAA4AHQARAMgACwAWABkAAwAfABsAGwAYABcAFgAfALwACgASABgAEwADAB8AFgAZABIAHQDPAAoAHwAOAB0AAwASABkAHAAfACQAzgAJABsAIAAaABEAAwAZABYAGgDNAAkAGwAgABoAEQADABkADgAjANAACQAfAA4AHQADABMAIAAYABgAygAJABcAFgAcAAMADwAOABAAFwC5AAkAEgASABcAAwAPAA4AEAAXAMMACAAWABQAGgAOABgAAwAGAMIACAAWABQAGgAOABgAAwAFAMEACAAWABQAGgAOABgAAwAEAL4ACAASAB8AHwAWABoAFAAeAMYACAAWABQAGgAOABgAAwAJAMUACAAWABQAGgAOABgAAwAIAMQACAAWABQAGgAOABgAAwAHANMABwAfABsAHQAOABQAEgDAAAcAFQAgABMAEwAYABIAtwAHABEAAwAQAA4AHQARALsABgASABgAEgAQAB8AuAAGABIADgAdABAAFQDUAAYAIgAWAB8AEAAVAL8ABQAVAA4AHQASAMwABQAbABoAFAAeALYABQAQABIAGgASANEABAAfABsAHAC9AAQAEgAaABEA1QAEACQAGgAQAMkAAwAWABkACgAWAD4AZACEAJwAsADAAM4A2gDkANsAEwAbABQAFAAYABIAAwAQAA4AGQASAB0ADgADABMAHQAbABoAHwDcABIAGwAUABQAGAASAAMAEAAOABkAEgAdAA4AAwAdABIADgAdAN0ADwAbABwAIAAcAAMAIgAWAB8AFQADABAAGwARABIA2AALABYAEAAXAAMAEAAWAB0AEAAYABIA1gAJABIAHwAVABIAHQAWABoAFADfAAcAIgAWAB8AHwASAB0A1wAGABUAEgAZABIAHgDeAAUAGwAcACAAHADZAAQAFgAQABcA2gAEABYAGQASAAYADgAsAEgAVgBgAGoA4wAOABwAEQAOAB8AEgADAA8ADgAYAA4AGgAQABIA4AANABoAEQAbAAMAEAAWAB0AEAAgABgADgAdAOIABgAaABgAGwAQABcA4QAEABoAEQAbAOUABAAeABIAHQDkAAMAHgAPAAUADAAiADYASgBaAOgACgAWABEAEgAbAAMAHgAWACUAEgDqAAkAGwAWABAAEgAZAA4AFgAYAOcACQAWABEAEgAbAAMAGQAWABAA5gAHABYADwAdAA4AHwASAOkABQAWABEAEgAbAAYADgAwAEQAUgBgAG4A8AAQABYAEwAWAAMAHAASAB0AGQAWAB4AHgAWABsAGgAeAOsACQAOABgAGAAcAA4AHAASAB0A7gAGABYAEwAWAAMABwDtAAYAFgATABYAAwAGAOwABgAWABMAFgADAAUA7wAGABYAEwAWAAMACAACAAIABgAIAAAADgAiAAMAAAABAAAACgAeADQAAWxhdG4ACAAEAAAAAP//AAEAAAABc2l6ZQAIAAQAAACgAAAAAAAAAAAAAAAAAAAAAQAAAADMPaLPAAAAANETpOQAAAAA0ROk5A==\") format(\"truetype\");\n font-weight: 500;\n font-style: normal;\n}\n\n[data-icon]:before,\n.ligature-icons {\n font-family: \"gaia-icons\";\n content: attr(data-icon);\n display: inline-block;\n font-weight: 500;\n font-style: normal;\n text-decoration: inherit;\n text-transform: none;\n text-rendering: optimizeLegibility;\n font-size: 30px;\n -webkit-font-smoothing: antialiased;\n}\n\ngaia-dialog {\n z-index: 10000002 !important;\n}\n\ngaia-modal {\n z-index: 10000001 !important;\n background: white;\n}\n\n.settings gaia-list gaia-button {\n /* XXX/drs: Why do we have to make this !important? It's very specific. */\n margin: 0 0 0 auto !important;\n\n --button-background: red;\n text-align: center;\n}\n\n.settings gaia-list .addon-time {\n color: #aaa;\n}`;\n document.head.appendChild(style);\n }", "title": "" }, { "docid": "976ef8f3f3274fbdf9b42dd5d8d24903", "score": "0.5217096", "text": "function getFonts(css){\n var str = css.code;\n var fontFace = str.match(/@font-face\\s*{\\s*([^]*?)(?=})/g);\n //check if there are font face references in the CSS first\n if (fontFace !== null) {\n for(var i=0; i<fontFace.length; i++) {\n //First lets make this shit an object\n var font = {};\n // finds font family reference\n var fontFam = fontFace[i].match( nameRegex );\n //makes the file name, fails when null so check if null first\n if(fontFam !== null){\n font.name = fontFam.toString().replace( nameReplace, '' ).trim();\n }\n //find file urls and don't process object if it doesn't have a name\n //to avoid issues with stuff like charset and other CSS declarations\n if(font.name) {\n //checks to see if url contains any \" or ', has to use different regex if not\n if(fontFace[i].search(/url\\(\\s*?\"\\s*?|url\\(\\s*?'\\s*?/g) !== -1) {\n font.downloadList = fontFace[i].match( dlRegex ).toString().replace(dlReplace, '').trim().split(',');\n } else {\n //selects font src urls without any \" or '\n font.downloadList = fontFace[i].match( /url\\((?:\\s*?)([\\S]+.[eot|woff|ttf])(?=\\s*?\\))/g ).toString().replace(/url\\(/, '').trim().split(',');\n }\n \n\n // splits download list into individual files, notes the extension, and creates a real dl URL\n for(var j=0; j<font.downloadList.length; j++) {\n\n if (font.downloadList[j].indexOf('?') !== -1) {\n font.downloadList[j] = font.downloadList[j].split('?').shift();\n } else if (font.downloadList[j].indexOf('#') !== -1) {\n font.downloadList[j] = font.downloadList[j].split('#').shift();\n }\n\n var filePieces = font.downloadList[j].split('.');\n font.fileExtension = filePieces.pop();\n font.fileName = filePieces.toString().split('/').pop();\n\n var path = css.href.replace(/\\/[^\\/]*$/, '');\n \n // var wget ='wget '+ path + font.fileName+'.'+font.fileExtension + ' -O ' + dlDir +'/'+ font.name+'.'+font.fileExtension;\n var wget ='wget \"'+ path + '/' + font.downloadList[j] + '\" -O \"' + dlDir +'/'+ font.fileName+'.'+font.fileExtension + '\"';\n console.log(wget);\n var child = exec(wget, function(err, stdout,stderr){\n if (err) throw err;\n // else console.log(font.fileName + '.' + font.fileExtension + ' saved as '+font.name+'.'+font.fileExtension);\n });\n\n };\n }; \n };\n } \n }", "title": "" }, { "docid": "addb0ecde49584a5567600b3469bd69b", "score": "0.51953894", "text": "get font() {\n return this.i.d2;\n }", "title": "" }, { "docid": "8f43f3e0ada351252e59e9a4d8b1921f", "score": "0.5191091", "text": "get fonts() { return this.dest+'/fonts'; }", "title": "" }, { "docid": "4f0330118f583990b09294d7d23bce23", "score": "0.51868224", "text": "function fontFace(font) {\n\t var id = (0, _hash2.default)(JSON.stringify(font)).toString(36);\n\t if (!cache[id]) {\n\t cache[id] = { id: id, family: font.fontFamily, font: font };\n\t // todo - crossbrowser \n\t appendSheetRule('@font-face { ' + (0, _CSSPropertyOperations.createMarkupForStyles)(font) + '}');\n\t }\n\t return font.fontFamily;\n\t}", "title": "" }, { "docid": "28f154ac6e9789c67ffdda2626a47234", "score": "0.51856416", "text": "async loadCharset(input, style) {\n const fontName = style.fontName;\n const fontStyle = style.fontStyle;\n const shouldTransform = style.fontVariant === TextStyle_1.FontVariant.AllCaps ||\n style.fontVariant === TextStyle_1.FontVariant.SmallCaps;\n const charset = (shouldTransform ? input.toUpperCase() : input).replace(/[\\s\\S](?=([\\s\\S]+))/g, (c, s) => {\n return s.indexOf(c) + 1 ? \"\" : c;\n });\n const glyphPromises = [];\n for (const char of charset) {\n const codePoint = char.codePointAt(0);\n const font = this.getFont(codePoint, fontName);\n const fontHash = `${font.name}_${fontStyle}`;\n const glyphHash = `${fontHash}_${codePoint}`;\n let fontGlyphMap = this.m_loadedGlyphs.get(fontHash);\n if (fontGlyphMap === undefined) {\n fontGlyphMap = new Map();\n this.m_loadedGlyphs.set(fontHash, fontGlyphMap);\n }\n const glyph = fontGlyphMap.get(codePoint);\n if (glyph === undefined) {\n let glyphPromise = this.m_loadingGlyphs.get(glyphHash);\n if (glyphPromise === undefined) {\n if (!font.charset.includes(String.fromCodePoint(codePoint))) {\n const replacementGlyph = this.createReplacementGlyph(codePoint, char, font);\n fontGlyphMap.set(codePoint, replacementGlyph);\n this.m_glyphTextureCache.add(glyphHash, replacementGlyph);\n continue;\n }\n let charUnicodeBlock;\n for (const block of this.unicodeBlocks) {\n if (codePoint >= block.min && codePoint <= block.max) {\n charUnicodeBlock = block;\n break;\n }\n }\n glyphPromise = this.loadAssets(codePoint, fontStyle, charUnicodeBlock, font);\n this.m_loadingGlyphs.set(glyphHash, glyphPromise);\n glyphPromise.then((loadedGlyph) => {\n this.m_loadingGlyphs.delete(glyphHash);\n fontGlyphMap.set(codePoint, loadedGlyph);\n this.m_glyphTextureCache.add(glyphHash, loadedGlyph);\n });\n }\n glyphPromises.push(glyphPromise);\n }\n else if (!this.m_glyphTextureCache.has(glyphHash)) {\n glyphPromises.push(Promise.resolve(glyph));\n this.m_glyphTextureCache.add(glyphHash, glyph);\n }\n }\n return Promise.all(glyphPromises);\n }", "title": "" }, { "docid": "a31c3ce9aab02435c313488ec02fc34b", "score": "0.5182936", "text": "getFont(codePoint, fontName) {\n let selectedFontName = this.fonts[0].name;\n for (const block of this.unicodeBlocks) {\n if (codePoint >= block.min && codePoint <= block.max) {\n selectedFontName =\n fontName !== undefined &&\n block.fonts.find(element => {\n return element === fontName;\n }) !== undefined\n ? fontName\n : block.fonts[0];\n break;\n }\n }\n return this.fonts.find(element => {\n return element.name === selectedFontName;\n });\n }", "title": "" }, { "docid": "a31c3ce9aab02435c313488ec02fc34b", "score": "0.5182936", "text": "getFont(codePoint, fontName) {\n let selectedFontName = this.fonts[0].name;\n for (const block of this.unicodeBlocks) {\n if (codePoint >= block.min && codePoint <= block.max) {\n selectedFontName =\n fontName !== undefined &&\n block.fonts.find(element => {\n return element === fontName;\n }) !== undefined\n ? fontName\n : block.fonts[0];\n break;\n }\n }\n return this.fonts.find(element => {\n return element.name === selectedFontName;\n });\n }", "title": "" }, { "docid": "c172f097f0780de0336065e8b6e87fa1", "score": "0.5170218", "text": "bark() {\n return 'woff';\n }", "title": "" }, { "docid": "3b8022ba7c13da4532391a2602d31776", "score": "0.51691246", "text": "function zmienCzcionke() {\n document.body.style.fontFamily = \"'Courgette', cursive\";\n}", "title": "" }, { "docid": "ba4441ba845c02045516167d51ad971c", "score": "0.51665854", "text": "setFont(family, size, weight) {\n // Unlike canvas, in SVG italic is handled by font-style,\n // not weight. So: we search the weight argument and\n // apply bold and italic to weight and style respectively.\n let bold = false;\n let italic = false;\n let style = 'normal';\n // Weight might also be a number (200, 400, etc...) so we\n // test its type to be sure we have access to String methods.\n if (typeof weight === 'string') {\n // look for \"italic\" in the weight:\n if (weight.indexOf('italic') !== -1) {\n weight = weight.replace(/italic/g, '');\n italic = true;\n }\n // look for \"bold\" in weight\n if (weight.indexOf('bold') !== -1) {\n weight = weight.replace(/bold/g, '');\n bold = true;\n }\n // remove any remaining spaces\n weight = weight.replace(/ /g, '');\n }\n weight = bold ? 'bold' : weight;\n weight = (typeof weight === 'undefined' || weight === '') ? 'normal' : weight;\n\n style = italic ? 'italic' : style;\n\n const fontAttributes = {\n 'font-family': family,\n 'font-size': size + 'pt',\n 'font-weight': weight,\n 'font-style': style,\n };\n\n // Store the font size so that if the browser is Internet\n // Explorer we can fix its calculations of text width.\n this.fontSize = Number(size);\n\n _vex__WEBPACK_IMPORTED_MODULE_0__[\"Vex\"].Merge(this.attributes, fontAttributes);\n _vex__WEBPACK_IMPORTED_MODULE_0__[\"Vex\"].Merge(this.state, fontAttributes);\n\n return this;\n }", "title": "" }, { "docid": "ca36307335d706d3ff84acf562996b15", "score": "0.51498485", "text": "function updateFonts(state) {\n if(!state.userPreferences.headerLocked){\n state.currentHeaderFont = getRandomFont(state, \"header\");\n }\n if(!state.userPreferences.paraLocked){\n state.currentParaFont = getRandomFont(state, \"para\");\n }\n}", "title": "" }, { "docid": "809388df1179e31aa4505717e19ddca7", "score": "0.51478136", "text": "function fontstorage(i) {\n localStorage.setItem('fontsize', i);\n var localfont = localStorage.getItem('fontsize');\n localFontsize(localfont);\n}", "title": "" }, { "docid": "3da347eb1369bbd3097df50e6a253128", "score": "0.5146047", "text": "constructor() {\n super();\n this.font;\n }", "title": "" }, { "docid": "de8ac8c3a1a4e427b6727bf9805fdbde", "score": "0.5140269", "text": "fontsUpdated() {\n __inspectorSendEvent(JSON.stringify({ method: 'CSS.fontsUpdated', params: {} }));\n }", "title": "" }, { "docid": "de8ac8c3a1a4e427b6727bf9805fdbde", "score": "0.5140269", "text": "fontsUpdated() {\n __inspectorSendEvent(JSON.stringify({ method: 'CSS.fontsUpdated', params: {} }));\n }", "title": "" }, { "docid": "e29902075dc30e6c0e9637288c87a41f", "score": "0.51325643", "text": "setFont(font) { this.font = font; return this; }", "title": "" }, { "docid": "57543ca9cf6df725b8d9cb4be53d4c6e", "score": "0.5131434", "text": "function fontChange(){\n if (i > fonts.length) {i = 0; }\n document.getElementById(\"entirePage\").style.fontFamily = fonts[i];\n i++;\n}", "title": "" }, { "docid": "ded65ca320fa54bc8e207a68e6c96642", "score": "0.5128821", "text": "function loadFontsAsynchronously() {\n try {\n const scripts = document.getElementsByTagName('script');\n const thisScript = scripts[scripts.length - 1];\n const fonts = document.createElement('link');\n\n fonts.rel = 'stylesheet';\n fonts.className = 'webfonts';\n fonts.href = window.guardian.config.stylesheets.fonts[shouldHint ? 'hintingAuto' : 'hintingOff'].kerningOn;\n\n window.setTimeout(function () {\n thisScript.parentNode.insertBefore(fonts, thisScript);\n });\n } catch (e) {\n @if(context.environment.mode == Dev){throw(e)}\n }\n }", "title": "" }, { "docid": "d4cdaa8c5b350a87bd0879f8dbdefba7", "score": "0.5124856", "text": "function changeFont () {\n $('#typed').fadeOut(200,\n function () {\n $(this)\n .css('font-family', '\\'' + getFontFace() + '\\'')\n .fadeIn(200);\n calculateDimensions();\n }\n );\n}", "title": "" }, { "docid": "21ff3d5e1d593861fd63579091984970", "score": "0.5118178", "text": "function loadFonts() {\n checkUserFontDisabling();\n if (fontsEnabled) {\n if (fontSmoothingEnabled()) {\n loadFontsFromStorage() || loadFontsAsynchronously();\n } else {\n disableFonts();\n }\n }\n }", "title": "" }, { "docid": "70ad67714871f37d155e1c35a7ff9d3f", "score": "0.51113003", "text": "function changeFont(font) {\n if (!gMeme.lines.length) return;\n gMeme.lines.forEach(line => line.font = font);\n}", "title": "" }, { "docid": "7a87f686403004548149912136b1231c", "score": "0.51065135", "text": "function fonts() {\n return gulp.src( './' + source_folder + '/fonts/**/*', { allowEmpty: true } )\n // Output to the distribution folder\n .pipe( gulp.dest( './' + distribution_folder + '/fonts/' ) );\n}", "title": "" }, { "docid": "898c20aec0187afdcdae02b768d78167", "score": "0.51042926", "text": "function injectFontsStylesheet() {\n // if this is an older browser\n if (!window.localStorage || !window.XMLHttpRequest) {\n var stylesheet = document.createElement('link');\n stylesheet.href = css_href;\n stylesheet.rel = 'stylesheet';\n stylesheet.type = 'text/css';\n document.getElementsByTagName('head')[0].appendChild(stylesheet);\n // just use the native browser cache\n // this requires a good expires header on the server\n document.cookie = \"font_css_cache\";\n\n // if this isn't an old browser\n } else {\n // use the cached version if we already have it\n if (fileIsCached(css_href)) {\n injectRawStyle(localStorage.font_css_cache);\n // otherwise, load it with ajax\n } else {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", css_href, true);\n on(xhr, 'load', function () {\n if (xhr.readyState === 4) {\n // once we have the content, quickly inject the css rules\n injectRawStyle(xhr.responseText);\n // and cache the text content for further use\n // notice that this overwrites anything that might have already been previously cached\n localStorage.font_css_cache = xhr.responseText;\n localStorage.font_css_cache_file = css_href;\n }\n });\n xhr.send();\n }\n }\n }", "title": "" }, { "docid": "3a99b6caf0836ca0b346cc7472877678", "score": "0.50995183", "text": "function preset(name, options) {\n // Aliases for various keys, used to preserve compatibility with url schemes.\n switch (name) {\n case \"amiga\":\n name = \"topaz\";\n break;\n case \"microknightplus\":\n name = \"microknight+\";\n break;\n case \"topazplus\":\n name = \"topaz+\";\n break;\n case \"topaz500plus\":\n name = \"topaz500+\";\n break;\n }\n // If we haven't already converted this data to a boolean array...\n if (!fontBitsBuffer[name]) {\n // ... build and store it.\n fontBitsBuffer[name] = bytesToBits(base64ToFile(FONT_PRESETS[name].data), FONT_PRESETS[name].width, FONT_PRESETS[name].height);\n }\n // Return our font object based on the buffered array by calling font() with all the data held in FONT_PRESETS.\n return font(fontBitsBuffer[name], FONT_PRESETS[name].width, FONT_PRESETS[name].height, FONT_PRESETS[name].amigaFont, options);\n }", "title": "" }, { "docid": "021b57661c87f5339ec498573bae8727", "score": "0.50976795", "text": "function loadTTFFonts( itcb ) {\n\n var i, j, toLoad = [];\n\n\n for (i = 0; i < documentState.pages.length; i++) {\n for (j = 0; j < documentState.pages[i].subElements.length; j++) {\n subElem = documentState.pages[i].subElements[j];\n\n if ( subElem.font && !Y.doccirrus.media.fonts.isType2( subElem.font ) ) {\n if ( -1 === toLoad.indexOf( subElem.font ) ) {\n toLoad.push( subElem.font );\n }\n }\n\n }\n\n }\n\n if ( 0 === toLoad.length ) {\n Y.log( 'This form does not require any custom fonts.', 'debug', NAME );\n return itcb( null );\n }\n\n Y.log( 'Loading ' + toLoad.length + ' custom fonts', 'debug', NAME );\n async.eachSeries( toLoad, loadSingleFont, itcb );\n }", "title": "" }, { "docid": "64f3e8df416f41d2e5ef7d19e12e8ab9", "score": "0.5097366", "text": "get font(){\n return this._font ;\n }", "title": "" }, { "docid": "cca2c3cbd0d79354fdb83c50442c17f3", "score": "0.5094851", "text": "function changeFonts()\r\n\t{\r\n\t\t$(\"*\").css(\"font-family\", \"helvetica\");\r\n\t}", "title": "" }, { "docid": "e5c833dba8331477b28c50802a741c16", "score": "0.50929993", "text": "function updateUsingCache(cacheName) {\n return function update(request) {\n if (DEBUG)\n console.log(\n `%c[->][update ${cacheName}]`,\n styles.updateCache,\n request.url\n )\n return caches\n .open(cacheName)\n .then(cache =>\n fromNetwork(request).then(response =>\n cache.put(request, response.clone()).then(() => response)\n )\n )\n }\n}", "title": "" }, { "docid": "8f5cbda697d7294ce21673451f758dd0", "score": "0.50926626", "text": "function getFont()\n{\n $( \"<span id=\\\"fontSize\\\">\" + \"foo\" + \"</span>\" ).appendTo( \"#\" + containerDivID);\n var div = document.getElementById(\"fontSize\");\n var font = getComputedStyle(div);\n $(\"#fontSize\").remove();\n return font;\n}", "title": "" }, { "docid": "b05838c2e566f428adee6a8dd982200e", "score": "0.50857186", "text": "get fontSet() { return this._fontSet; }", "title": "" }, { "docid": "b05838c2e566f428adee6a8dd982200e", "score": "0.50857186", "text": "get fontSet() { return this._fontSet; }", "title": "" }, { "docid": "b05838c2e566f428adee6a8dd982200e", "score": "0.50857186", "text": "get fontSet() { return this._fontSet; }", "title": "" }, { "docid": "f3e0f6f3e2aeda0c1032903b97d84dc9", "score": "0.5083846", "text": "function fontObserver() {\n\n\treturn new Promise(function (resolve, reject) {\n\n\t\tconst observers = [];\n\n\t\tif (!window.theme.fonts) {\n\t\t\tresolve(true);\n\t\t}\n\n\t\t$.each(window.theme.fonts, function () {\n\t\t\tconst currentObserver = new FontFaceObserver(this);\n\n\t\t\tobservers.push(currentObserver.load());\n\t\t});\n\n\t\tPromise\n\t\t\t.all(observers)\n\t\t\t.then(() => {\n\t\t\t\tresolve(true);\n\t\t\t})\n\t\t\t.catch(() => {\n\t\t\t\tconsole.error('Font Observer: There is an error occured while loading one or more fonts.');\n\t\t\t\treject(true);\n\t\t\t});\n\n\t});\n\n}", "title": "" }, { "docid": "fd035fe67dcbdf945f3e43e516531c63", "score": "0.5076173", "text": "function cached(fn){var cache=Object.create(null);return function cachedFn(str){var hit=cache[str];return hit||(cache[str]=fn(str));};}", "title": "" } ]
0e474bc9770e18e90abdf261a22c4d6a
console.log( frac() ); /////////////////////////////////////////////////////////problem 34
[ { "docid": "ddd170d449f4c61cb2d3abcdd4da580b", "score": "0.0", "text": "function factorial(n) {\n\tvar fak = 1;\n\tfor( var i = 1; i <= n; i++ ) {\n\t\tfak *= i;\n\t}\n\treturn fak;\n}", "title": "" } ]
[ { "docid": "5532ccd48872736eb1fae179231139a3", "score": "0.72867894", "text": "function frac(n) { return Math.abs(n)%1; }", "title": "" }, { "docid": "900ab5f5db6a44e450bedf664e5b24e0", "score": "0.7133666", "text": "function frac() {\n\tvar j, num1, num2, num3, num4, fr, fr2, chis1, chis2, ost1, ost2;\n\tfor( var i = 10; i < 99; i++ ) {\n\t\tj = i + 1;\n\t\twhile( j < 100 ) {\n\t\t\tnum1 = i + '';\n\t\t\tnum2 = j + '';\n\t\t\tnum3 = i;\n\t\t\tnum4 = j;\n\t\t\tfr = num1 + '/' + num2;\n\t\t\tfor( var x = 1; x <= i; x++ ) {\n\t\t\t\tif( num3 % x == 0 && num4 % x == 0 ) {\n\t\t\t\t\tchis1 = num3 / x;\n\t\t\t\t\tchis2 = num4 / x;\n\t\t\t\t\tfr2 = chis1 + '/' + chis2;\n\t\t\t\t\tif( num1.indexOf( chis1 + '' ) != -1 && num2.indexOf( chis2 + '' ) != -1 ) {\n\t\t\t\t\t\tvar regexp1 = chis1 + '';\n\t\t\t\t\t\tvar regexp2 = chis2 + '';\n\t\t\t\t\t\tif( regexp1.length <= 1 && regexp2.length <= 1 ) {\n\t\t\t\t\t\t\tost1 = num1.replace(regexp1, '');\n\t\t\t\t\t\t\tost2 = num2.replace(regexp2, '');\n\t\t\t\t\t\t\t//console.log( chis1 + ' и ' + chis2 + ' -- ' + ost1 + ' && ' + ost2 );\n\t\t\t\t\t\t\tif( ost1 == ost2 && ost1 != 0 ) {\n\t\t\t\t\t\t\t\tconsole.log( 'удаленное число: ' + ost1 );\n\t\t\t\t\t\t\t\tconsole.log( fr + ' = ' + fr2 + ' в точку' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} /*else {\n\t\t\t\t\t\tconsole.log( fr + ' = ' + fr2 + ' мимо' );\n\t\t\t\t\t}*/\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tj++;\n\t\t}\n\t}\n\treturn 'the end';\n}", "title": "" }, { "docid": "12f117b73f5dcbaee1275a1d9dec05e0", "score": "0.6551134", "text": "function easy() {\n return x / x;\n}", "title": "" }, { "docid": "a8d4e902dd126f4bb40ed44a05f961e6", "score": "0.64772964", "text": "function dividedRegular() {\n result = 3 / 4;\n console.log(\"Regular function in JS: 3 divided by 4 is:\", result);\n}", "title": "" }, { "docid": "7e5d8d6bdbb06038d820eef4ae68c05f", "score": "0.6220985", "text": "function ad(){\n var j;\n j=fst(s);s\n j+=0.01;\n console.log(j);\n return j/100;\n console.log(j)\n}", "title": "" }, { "docid": "9b600188dc86e227177fe74448f3b253", "score": "0.617307", "text": "function Problem267(){\n\tvar e=function(f,c,r,s){\n\t\tconsole.log(c,s);\n\n\t\tif(r==0){\n\t\t\treturn c;\n\t\t}\n\n\t\treturn .5*(e(f,c*(1-f),r-1,s+'W')+e(f,c*(1+2*f),r-1,s+'L'));\n\t};\n\n\tvar p=function(f,c,r){\n\t\tconsole.log(f,c,r);\n\n\t\tif(c*Math.pow(1+2*f,r)<1e9){\n\t\t\treturn 0;\n\t\t}\n\t\tif(c*Math.pow(1-f,r)>=1e9){\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn .5*(p(f,c*(1-f),r-1)+p(f,c*(1+2*f),r-1));\n\t};\n\n\tconsole.log(p(1/4,1,100,''));\n}", "title": "" }, { "docid": "948832bae3dc88076eb08fff4b494366", "score": "0.6167261", "text": "function division(a,b){\n var div = a/b;\n console.log(div);\n}", "title": "" }, { "docid": "e6b4ba8cf6f53afaa9ceb85f1a1131be", "score": "0.6075997", "text": "function ope (a,b) {\n console.log(a+b);\n console.log(a-b);\n console.log(a*b);\n console.log(a/b);\n}", "title": "" }, { "docid": "3030b3e2843c4d42f856e04af561e571", "score": "0.60705394", "text": "function equation() {\n var ans = a+b/11;\n console.log(ans);\n}", "title": "" }, { "docid": "ea982836763efdbb94dd1d88297a8ccc", "score": "0.6048741", "text": "exponent(){\n return 0.01\n }", "title": "" }, { "docid": "d4213a4865598d14ce274a6256fc503c", "score": "0.60399127", "text": "quotient() {\n return Math.floor(this.numerator / this.denominator);\n }", "title": "" }, { "docid": "35b9f4fe0a3220cf5131c1a5455291ac", "score": "0.5999749", "text": "function calcularFuncion(valor)\r\n{\r\nvar acumuladoResultado=0.00000000000000001*10/10;\r\nacumuladoResultado=acumuladoResultado-0.00000000000000001;\r\nconsole.log(\"valorinicial\"+parseFloat(acumuladoResultado));\r\nfor(i=1;i<=valor;i++)\r\n{\r\n\tacumuladoResultado=acumuladoResultado+Math.pow(-1,i+1)/((i*2)-1);\r\n\t\tif(i==valor)\r\n\t\t\t\t{\r\n\t\t\tdocument.getElementById(\"resultado\").innerHTML=parseFloat(4*acumuladoResultado);\t\r\n\t\t\t// WTF!! El resultado parece PI\r\n\t\t\t\t}\t\r\n\r\n}\r\n\r\n}", "title": "" }, { "docid": "bb6593e79dfae40b99bfa6bf1932be60", "score": "0.5995813", "text": "function n$b(e){return Math.abs(e*e*e)}", "title": "" }, { "docid": "3d279321267d545bc40d23720b9aed40", "score": "0.5989016", "text": "function decompose(no){\n\t// result array to store the result to return\n\tlet result = []\n\tf1 = new Fraction(no);\n\tconsole.log('fi : '+f1);\n\t// first lets do for numbers where the fraction is greater than 1\n\tif(f1.n > f1.d){\n\t\t//if decompose is 3 then first Part n = 3 and d = 1\n\t\tlet firstPart = parseInt(f1.n/f1.d);\n\t\t// now we get 3\n\t\tconsole.log('firstPart: '+ firstPart);\n\t\t// okay so the first one will be firstPart / 1 so thats 3/1 and done..\n\t\t// now lets repeat with decompose(3.1)\n\t\t// now we have 3/1 and 0.1 so lets convert 0.1.\n\t\tlet remainingFraction = new Fraction(f1-firstPart);\n\t\t// this will give us n 0 and d as 1\n\t\tconsole.log('remainingFraction ' + remainingFraction);\n\t\t// so lets decompose the new stuff..\n\t\t// so 3/1 \n\t // so now the 0.1 which is left will go to the next function..\n\t // storing the result and taking it to the next number..\n\t\tresult = [firstPart + \"/1\"].concat(decompose(remainingFraction.n + \"/\" + remainingFraction.d));\n\t\treturn result;\n \n // lets stop inifinty here\n }else if(f1.n/f1.d < 0.000000001){\n \treturn []\n\t}else{\n\t\t// now the 0.1 which is small will come here.\n\t\t// now we will calculate the next denominator \n\t\t// okay so now we have 3/1 above and adding 1/10\n\t\t// lets turn it around d/n so n is 1\n\t\t// console.log('f1.d ' +f1.d);\n\t\t// console.log('f1.n ' + f1.n);\n\t\tvar nextDenominator = Math.ceil(f1.d /f1.n); // lets just round it up\n\n\t\tconsole.log('nextD: ' + nextDenominator);\n\t\t// lets make it 1/10\n\t\tvar nextFraction = new Fraction(\"1/\" + nextDenominator);\n\t\tconsole.log(nextFraction);\n\t\t// lets check again if there is remaining fractions if its 3.11, but this case there isnt any..\n\t\tvar remainingFraction = new Fraction(f1 - nextFraction);\n\t\tconsole.log('remainingFraction ' + remainingFraction);\n\t\t// so this is zero we have to end it in the next iteration since it will become infiinty.\n\t\tresult = [\"1/\" + nextDenominator].concat(decompose(remainingFraction.n + \"/\" + remainingFraction.d, nextDenominator));\n\t\t// returning the calculated result.\n\t\treturn result;\n\n\t}\n\n}", "title": "" }, { "docid": "2a58f8f4f26e5722f30d3d386f02378a", "score": "0.5986589", "text": "function pi(){\n return 3.1416\n}", "title": "" }, { "docid": "edfc0b73eef96c42aabd6e55861d950c", "score": "0.5985756", "text": "function b(a,b,c,d,e){return d+(a-b)*((e-d)/(c-b))}", "title": "" }, { "docid": "2c1fdc79840d7bd77c33084489ebbbab", "score": "0.5980893", "text": "function r(e,t,r,n){e=(e+\"\").replace(/[^0-9+\\-Ee.]/g,\"\");var o=isFinite(+e)?+e:0,a=isFinite(+t)?Math.abs(t):0,i=void 0===n?\",\":n,s=void 0===r?\".\":r,l=\"\";return l=(a?function(e,t){var r=Math.pow(10,t);return\"\"+(Math.round(e*r)/r).toFixed(t)}(o,a):\"\"+Math.round(o)).split(\".\"),l[0].length>3&&(l[0]=l[0].replace(/\\B(?=(?:\\d{3})+(?!\\d))/g,i)),(l[1]||\"\").length<a&&(l[1]=l[1]||\"\",l[1]+=new Array(a-l[1].length+1).join(\"0\")),l.join(s)}", "title": "" }, { "docid": "11905bdd6ffcb2b26bbf2bee24235a89", "score": "0.5979282", "text": "function problem5() {\n\treturn 16 * 9 * 5 * 7 * 11 * 13 * 17 * 19;\n}", "title": "" }, { "docid": "8f575bc7db1dcad0154b00546f646929", "score": "0.59740543", "text": "function problem3(fahrenheit){\n\n\tvar celsius = (fahrenheit - 32) * 5/9\n\tvar n = celsius.toFixed(2) \n\tconsole.log(n)\n}", "title": "" }, { "docid": "465c6c0377b58273644333fba9e5e3e6", "score": "0.59584403", "text": "function fractNumb(numb) {\n let num = numb;\n let f = new Fraction(num);\n\n if (f.d === 1) {\n num = f.s * f.n;\n } else {\n num = (f.s * f.n + \" / \" + f.d);\n }\n return num;\n}", "title": "" }, { "docid": "4e6bd858da97ccbe380383111d77f0ca", "score": "0.5949006", "text": "function expTaylorFrac(a, p){\n if (decp(a))a = rnd(a, p+2);\n var frac1 = add(a, one());\n var frac2 = one();\n var pow = a;\n for (var i = 2; true; i++){\n frac1 = mul(frac1, mknumint(i));\n pow = mul(pow, a);\n frac1 = add(frac1, pow);\n frac2 = mul(frac2, mknumint(i));\n if (nsiz(frac2)-siz(pow)-2 >= p)break;\n }\n\n return div(frac1, frac2, p);\n }", "title": "" }, { "docid": "c84fa2d21140a76c02271e67cfeae740", "score": "0.59274745", "text": "function test(x){\n\treturn x * 2;\n\tconsole.log(x);\n\treturn x / 2;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "c525d8bf11e7f951c3643aa0a9ac1648", "score": "0.5925549", "text": "function fraction(a, b) {\n var k = a / (a + b);\n if (k > 0 && k < 1) {\n var t0, t1 = Math.pow(12 * k * Math.PI, 1 / 3);\n for (var i = 0; i < 10; ++i) { // Solve for theta numerically.\n t0 = t1;\n t1 = (Math.sin(t0) - t0 * Math.cos(t0) + 2 * k * Math.PI) / (1 - Math.cos(t0));\n }\n k = (1 - Math.cos(t1 / 2)) / 2;\n }\n return k;\n}", "title": "" }, { "docid": "9d24eb6b9f4e391a5c456e1aeb0a8217", "score": "0.5868621", "text": "function probabilify(s) { return parsefrac(desugar(s)) }", "title": "" }, { "docid": "d15867f734bdcb3b279136fd7530a8ca", "score": "0.586455", "text": "function Double(paisa) {\n var answer = paisa *2;\n console.log(answer);\n return answer;\n}", "title": "" }, { "docid": "8565a14161f0207aa78dede3caaf82c3", "score": "0.5848008", "text": "timing(timeFraction){\n return Math.pow(timeFraction, 2); // this is a quad function\n }", "title": "" }, { "docid": "16c42999ed1413c069cb4f47492a41a2", "score": "0.5847944", "text": "InterpreteFactor() {\n const token = this.CurrentToken();\n this.MoveNext();\n\n let factor;\n\n switch (token.type) {\n case Token.TYPE.PLUS:\n case Token.TYPE.MINUS:\n let nextToken = this.CurrentToken();\n this.Match(Token.TYPE.VALUE);\n factor =\n token.type === Token.TYPE.PLUS\n ? nextToken.value\n : nextToken.value * -1;\n break;\n\n case Token.TYPE.VALUE:\n factor = token.value;\n break;\n\n case Token.TYPE.LEFT_PARENS:\n var expression = this.InterpreteExpression();\n this.Match(Token.TYPE.RIGHT_PARENS);\n factor = expression;\n break;\n\n default:\n throw new Error(`${token.type} : 알 수 없는 Token 타입입니다.`);\n }\n\n return factor;\n }", "title": "" }, { "docid": "3a951ac31d58bd414a98aa2dcaf94d81", "score": "0.58398885", "text": "function a(b) {\n return b * 4;\n console.log(b);\n}", "title": "" }, { "docid": "afbdf5127054259e74d91748fd22397e", "score": "0.5828053", "text": "function g(a,b)\n{\n return a * b * 3.5;\n}", "title": "" }, { "docid": "70cb1b405bea40cb3c23e10b125f0c81", "score": "0.58268714", "text": "function g(a, b) {\n return a * b * 3.5;\n}", "title": "" }, { "docid": "135360f5664b45439de60032da9689ce", "score": "0.5814339", "text": "function equation2() {\n var anshq = hour/quarter;\n console.log(anshq);\n}", "title": "" }, { "docid": "78fd8a96dd179403d0e69a1e2e0ac5e1", "score": "0.5793101", "text": "function PTC(n){\r\nconst C=(1.6)*(10**(-19));\r\nvar n=prompt(\"Digite a quantidade de particulas e tenha a carga\");\r\nNumber(n);\r\nvar carga=n*C;\r\n\r\nconsole.log(carga.toFixed(2));\r\n}", "title": "" }, { "docid": "cf12dd452c5c82a00aae4311b7e1be4e", "score": "0.57876945", "text": "function f(b, s) {//b is bytes per second\n\t\ttest.ok(sayFraction(Fraction(b, Time.second), \"#/s\", \"whole\", saySize4) == s);\n\t}", "title": "" }, { "docid": "4fd5a5587f552edbf7da3af0c9364353", "score": "0.57862365", "text": "effect() {\n let base = new Decimal(1.1)\n return Decimal.pow(base, player[this.layer].points.pow(0.9))\n }", "title": "" }, { "docid": "fdf59e1481f46407087811b0f171f5f2", "score": "0.5785345", "text": "function convertTemp(num) {\n var resultNum = num * (5/9) + 32;\n console.log(resultNum);\n showResult(resultNum);\n}", "title": "" }, { "docid": "203abec0ccaa90d385d58d52d4d31f66", "score": "0.57747614", "text": "function f(nm) {\n var a = 0.1;\n return 1 - (nm / (a+nm));\n }", "title": "" }, { "docid": "fe95c972964e066fc1f293d1a08b25e4", "score": "0.57721704", "text": "function math(num1,num2){\n let total = num1/num2\n console.log (Math.floor(total))\n }", "title": "" }, { "docid": "964566478b458fea5277da84ba0008ab", "score": "0.5757222", "text": "function mylog(a,n) { \n console.log(Math.log(n));\n console.log(Math.log(a));\n \n \n return Math.log(n)/Math.log(a);\n}", "title": "" }, { "docid": "c1de3fc8ca4d0955dac58898fa45cee6", "score": "0.5753585", "text": "function a(b) {\n return b * 4;\n console.log(b);\n}", "title": "" }, { "docid": "663550beeca98de26fd24abbfefc0014", "score": "0.57481545", "text": "function divide() {\n\n}", "title": "" }, { "docid": "88d7573edf6b4f5ae2365b987c868857", "score": "0.57468194", "text": "function exam(a) {\r\n let fexam = (60 / 100) * a;\r\n\r\n //Prints out variable fexam\r\n return fexam;\r\n}", "title": "" }, { "docid": "00c472f19266eba528cdf8a6fee99871", "score": "0.5746386", "text": "function numbers(num1, num2, num3){\n alert((num2 / num1) * num3)\n}", "title": "" }, { "docid": "9e34500a7b663af37c8157db68a9c033", "score": "0.57348204", "text": "function s(x) { return x*x }", "title": "" }, { "docid": "9e34500a7b663af37c8157db68a9c033", "score": "0.57348204", "text": "function s(x) { return x*x }", "title": "" }, { "docid": "3bb9592082b29375e57a0f966ef852c4", "score": "0.573339", "text": "function exam(a)\r\n{\r\n//Declare and innitialise variable fexam to product of 60 percentage of value of parameter a\r\nlet fexam = (60/100)*a\r\n//Returns the value of variable fexm to any calling functions\r\nreturn fexam\r\n\r\n}", "title": "" }, { "docid": "df371ff6ce8dc031a779afa01b98f8f9", "score": "0.5728477", "text": "function mathResults(num1, num2) {\n console.log(\"Sum of \" + num1 + \" and \" + num2 + \" = \" + (num1 + num2));\n console.log(\"Difference of \" + num1 + \" from \" + num2 + \" = \" + (num1 - num2));\n console.log(\"Product of \" + num1 + \" and \" + num2 + \" = \" + (num1 * num2));\n console.log(\"Quotient of \" + num1 + \" divided by \" + num2 + \" = \" + (num1 / num2));\n console.log(\"Remainder of \" + num1 + \" modulo \" + num2 + \" = \" + (num1 % num2));\n\n}", "title": "" }, { "docid": "f435e0b7e3617e4cbe3192dce1e86b00", "score": "0.5727454", "text": "function inmultire(){\n var rezultat = 5 * 8;\n console.log(\" 5 * 8 = \", rezultat);\n}", "title": "" }, { "docid": "aeac0f5339709987e4c8e6c674c385b0", "score": "0.572658", "text": "function opdracht33()\n{ var d = 1;\n for (var i = 1; i < 10; i++)\n { for (var j = 1; j < i; j++)\n { var a = 9*j*i, b = 10*j-i, q = Math.floor(a / b), r = a % b;\n if (r == 0 && q <= 9) d *= i/j;\n }\n }\n return Math.floor(d);\n}", "title": "" }, { "docid": "acb2900ea94abd5959f64c8ac32233c4", "score": "0.5724411", "text": "function f(x) {\n return -x + 11.5;\n }", "title": "" }, { "docid": "74a2bcb4108f4093f1c49be6ed7d4d1d", "score": "0.5722792", "text": "function fahrenCenti(f){\n\tvar c=(5*(f/32))/9;\t\n\tconsole.log(\"grados centigrados: \"+c);\n\treturn c;\n}", "title": "" }, { "docid": "3c51cf06c3abfd61cc888665e924da76", "score": "0.5722423", "text": "function test2(x) {\n return x*2;\n console.log(x);\n return x/2;\n}", "title": "" }, { "docid": "1743e4d8be776fc04f3ca7352ef2a414", "score": "0.57197154", "text": "function fract(x) {\n return x - Math.floor(x);\n}", "title": "" }, { "docid": "d190a1cffd4fa52a04f58c0f1393bb2f", "score": "0.57185614", "text": "function c$b(t,n,r){const a=z$6(t,n)/z$6(t,t);return d$b(r,t,a)}", "title": "" }, { "docid": "2494dd22a6afd56a0ebdb82033735886", "score": "0.57180744", "text": "function wp(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Pi,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ji;n=ot(n);for(var r=Pe(e),i=Ae(e),o=Math.max(i/n[0],r/n[1]),a=t+1,s=new Array(a),c=0;c<a;++c)s[c]=o/Math.pow(2,c);return s}", "title": "" }, { "docid": "7c0023893ae209b7ecd458dadb0d2dc4", "score": "0.5717035", "text": "function df(x) {\r\n\treturn (Math.exp((-1.0) * x) / ((1.0 + Math.exp((-1.0) * x)) * (1.0 + Math.exp((-1.0) * x))));\r\n}", "title": "" }, { "docid": "7c365d69ff373dc25918ede474772ff3", "score": "0.5716561", "text": "effect() {\n let base = new Decimal(1.03)\n return Decimal.pow(base, player[this.layer].points.sub(8).max(0).sqrt())\n }", "title": "" }, { "docid": "9af055e4f2d2c35acda354770fb1f945", "score": "0.57146424", "text": "function f4(z) { return -382.08*(z**3) + 253.87*(z**2) - 113.1*z + 97.252 }", "title": "" }, { "docid": "8473ff1f42a6af6e824791d04873e1a3", "score": "0.5709691", "text": "function r(t,e,n){return n-(n-t)*e}", "title": "" }, { "docid": "67ede7d5f8e34fd066347291a70ec818", "score": "0.5707212", "text": "function calc(a, b) {\n\tconsole.log(a + b);\n\tconsole.log(a - b);\n\tconsole.log(a * b);\n\tconsole.log(a / b);\n}", "title": "" }, { "docid": "e10e414d7dc67f13f7c2b0af16e19d63", "score": "0.57070166", "text": "function pitagoroTeorema (a, b) {\n\nvar krastine3 = Math.sqrt(a*a + b*b);\nconsole.log (krastine3) ;\n}", "title": "" }, { "docid": "152e8814f643fadbec57e19fad90984c", "score": "0.5704572", "text": "function FormattedDivision (num1, num2) {\n\n}", "title": "" }, { "docid": "837a3df1a40e8a1c1ac3c72b6ba51626", "score": "0.5698735", "text": "function b(a){return a>=6/29?a*a*a:108/841*(a-4/29)}", "title": "" }, { "docid": "fc4f9d3e63830bcebeb913c3bb2ab1b5", "score": "0.5696603", "text": "function sc_quotient(x, y) {\n return parseInt(x / y);\n}", "title": "" }, { "docid": "83788f03a9b9e7b4739657e1b5405502", "score": "0.56943244", "text": "function a(b){\n return b*4;\n console.log(b);\n }", "title": "" }, { "docid": "6bb26a6a331a989e9c9c87d591ca9b54", "score": "0.56880885", "text": "function S(a,b,c){\nvar s=(a+b+c)/2\nreturn s;}", "title": "" }, { "docid": "9b312a996bc6285af5a3bfeb26e0e4f3", "score": "0.56870586", "text": "function divide(a,b){\n console.log(a/b);\n}", "title": "" }, { "docid": "0f9edaf6978ef151094807b764fb3f19", "score": "0.5679843", "text": "function parsefrac(s) {\n s = s.replace(/^([^\\%]*)\\%(.*)$/, \"($1)/100$2\") // macro-expand percents\n const x = laxeval(s)\n return x === null ? NaN : x\n}", "title": "" }, { "docid": "50ecd3d6364f81455d6fd33c5654b1c4", "score": "0.5676072", "text": "function daugyba() {\n console.log( amzius * atlyginimas );\n}", "title": "" }, { "docid": "c444f1f710eb1e7941f70efa0b789821", "score": "0.56759304", "text": "function getSubstraction(final, total){\n const difference = parseInt(total) *final\n return difference;\n }", "title": "" }, { "docid": "f80588e1f6c32115935bc46dd7156b0b", "score": "0.56755143", "text": "function divideNumz(first,second){\n\n if( second != 0 ){\n result = first / second;\n }else{\n console.log('Error! Division by zero');\n }\n\n console.log(result);\n\n}", "title": "" }, { "docid": "f80a78f7e9e20dd394521eb3ae49f377", "score": "0.5669563", "text": "function number(singular){\n console.log(Math.cbrt(singular));\n}", "title": "" }, { "docid": "ef3a7e852652b3d6fec2105f8022e8a1", "score": "0.5665932", "text": "function printTriple(n){\n console.log(n*3)\n}", "title": "" }, { "docid": "ed8e17c7a4837e74fccaf9f23ec7399b", "score": "0.5664672", "text": "divide(a,b){return a/b;}", "title": "" }, { "docid": "67e1301313d2d9e8262153ff51a1820f", "score": "0.5663755", "text": "function fract(v){\n\treturn v-Math.floor(Math.abs(v))*Math.sign(v);\n}", "title": "" }, { "docid": "5341475cb9f10eba3a791c5b017d0161", "score": "0.56606334", "text": "function runde(x, n) {\r\n\r\n if (n < 1 || n > 14) return false;\r\n\r\n var e = Math.pow(10, n);\r\n\r\n var k = (Math.round(x * e) / e).toString();\r\n\r\n if (k.indexOf('.') == -1) k += '.';\r\n\r\n\tk += e.toString().substring(1);\r\n\r\n return k.substring(0, k.indexOf('.') + n+1);\r\n\r\n}", "title": "" } ]
9ac69b71fcfc37394e35e5a9f0cc50c5
function used to get user details
[ { "docid": "6109a75d46b108a431e0ac6c38a9c3eb", "score": "0.0", "text": "function GetUserDetails() {\n NProgress.start();\n $.post(\"UserProfile.aspx\",\n {\n Mode: \"GETUSERDETAILS\"\n },\n function (VarResponseData) {\n $('#div_profile').empty();\n $('#div_profile').append(VarResponseData);\n NProgress.done();\n\n }); //End of Ajax\n\n return false;\n\n\n}", "title": "" } ]
[ { "docid": "b51812d247b48f24bd6af008a5e86c00", "score": "0.7985053", "text": "function getUserInfo() {\n if (getOtherUserLoginName() != \"\")\n getUserId(getOtherUserLoginName());\n }", "title": "" }, { "docid": "d4aa098b574b3c6da59314ae66b99273", "score": "0.78590465", "text": "function getUserInfo() {\n return rest.one(\"userinfo\").get();\n }", "title": "" }, { "docid": "8d2713707c5fbad6140994ea51118de7", "score": "0.78340214", "text": "function getUserDetails(){\n\t\tvar uri = urlConstants.GET_USER_DETAILS+$rootScope.userid;\n\t\tDataService.getData(uri,[]).success(function(response){\n\t\t\t$scope.myProperties = response.data;\n\t\t}).error(function(err){\n\t\t\tconsole.log(err.message);\n\t\t});\n\t}", "title": "" }, { "docid": "f35f1b1bc1127ca254e31d5d80f9177b", "score": "0.7704721", "text": "function getCrtUserInfos() {\n\t\treq.user\n\t\t\t.getMyInfo()\n\t\t\t.then(res => {\n\t\t\t\tif (res.code !== 0) {\n\t\t\t\t\treq.err.show(res);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconsole.log(\"getCrtUserInfos\", res);\n\t\t\t})\n\t\t\t.catch(req.err.show);\n\t}", "title": "" }, { "docid": "01ac13977b744fa82c942d0a711ca1e4", "score": "0.7675583", "text": "function getTheUserDetails(req,res,next) {\n\tuserService.getTheUserDetails(req.body, function(result){\n\t\tres.json({\"status\": \"Success\", \"message\": \"User details fetched successfully\", \"data\": result});\n\t})\n}", "title": "" }, { "docid": "fd35ea6d07cebd23ac69411623a77989", "score": "0.76259834", "text": "function getUserDetails() {\n token = SharedProperties.getUser();\n getUserLog();\n $scope.username = SharedProperties.getUser();\n if ($scope.username == null) {\n window.location.href = '/login';\n }\n var _role = SharedProperties.getRole().toLowerCase();\n //alert(_role);\n if (_role == 'superadmin') {\n $scope.isSuperAdmin = true;\n $scope.isAdmin = true;\n }\n else if (_role == 'admin') {\n //alert('IS ADMIN');\n $scope.isSuperAdmin = false;\n $scope.isAdmin = true;\n }\n else {\n $scope.isSuperAdmin = false;\n $scope.isAdmin = false;\n }\n }", "title": "" }, { "docid": "f60dc7914a85b98d543cc5616e33909e", "score": "0.7616537", "text": "function load_user_info() {\n return sess.user.email;\n }", "title": "" }, { "docid": "fe10a11a3f724dbac3f7206e47442d59", "score": "0.7450132", "text": "function getUserInfo() {\n var user = null;\n var result = AFM.workflow.Workflow.runRuleAndReturnResult(\n 'AbCommonResources-getUser', {});\n if (result.code == 'executed') {\n user = result.data;\n } else {\n handleError('Could not obtain UserInfo', result);\n }\n \n return user;\n}", "title": "" }, { "docid": "7fd33c195d17711b22093e2da80644e1", "score": "0.74436885", "text": "function getUserDetails(data) {\n console.log(\"Get user data: \" + data);\n}", "title": "" }, { "docid": "309cde5687b6a6d5e3db6738b8cb4622", "score": "0.73666257", "text": "function getUserDetails() {\n API.Get({\n returnValueList: 'account, loginList, nameValuePairs',\n nvpNames: CONST.NVP.PAYPAL_ME_ADDRESS,\n })\n .then((response) => {\n // Update the User onyx key\n const loginList = _.where(response.loginList, {partnerName: 'expensify.com'});\n const expensifyNewsStatus = lodashGet(response, 'account.subscribed', true);\n Onyx.merge(ONYXKEYS.USER, {loginList, expensifyNewsStatus: !!expensifyNewsStatus});\n\n // Update the nvp_payPalMeAddress NVP\n const payPalMeAddress = lodashGet(response, `nameValuePairs.${CONST.NVP.PAYPAL_ME_ADDRESS}`, '');\n Onyx.merge(ONYXKEYS.NVP_PAYPAL_ME_ADDRESS, payPalMeAddress);\n\n // Update the blockedFromConcierge NVP\n const blockedFromConcierge = lodashGet(response, `nameValuePairs.${CONST.NVP.BLOCKED_FROM_CONCIERGE}`, {});\n Onyx.merge(ONYXKEYS.NVP_BLOCKED_FROM_CONCIERGE, blockedFromConcierge);\n });\n}", "title": "" }, { "docid": "85192bf322dac57a8b7ec3b2837e12ce", "score": "0.73645455", "text": "getUserProfileInformation() {\n return this.crud.getData('/users/me');\n }", "title": "" }, { "docid": "f1747b75dcb9213758457700b7b1a4a9", "score": "0.73627335", "text": "function getUserInfo() {\n UserService.getUser($stateParams.userid).then(function(userInfo) {\n ctl.user = userInfo;\n ctl.user.token = AuthService.getToken();\n ctl.userGroup = getUserGroup();\n });\n }", "title": "" }, { "docid": "d520d67d8f583f8bdadb04634f833f73", "score": "0.73593646", "text": "function getAllUsersInfo() {\n\treturn db(\"userInfo\");\n}", "title": "" }, { "docid": "daea883e96c399872938369e2f717d78", "score": "0.7316088", "text": "function getCurrentUserInfo() {\n return $http({\n method: 'GET',\n url: baseUrl + 'users',\n params: {\n exclude: \"metadata\",\n filter: {\"fieldName\": \"email\",\"operator\": \"equals\",\"value\": Backand.getUsername()}\n }\n }).then(function(response) {\n if (response.data && response.data.data && response.data.data.length == 1) {\n log(\"Got user details for \" + Backand.getUsername());\n return response.data.data[0];\n }\n });\n }", "title": "" }, { "docid": "71de85a761bbc79da538023aa6f1c73a", "score": "0.72973746", "text": "function getUser() {\n return getFromUrlParamOrLocalStorage('h_user');\n}", "title": "" }, { "docid": "007b0e75aa2633c323989c09739b8ee3", "score": "0.7294648", "text": "function GetUserData() {\n// Get basic user info and console log only.\ntpoAppObject.getUserData().then(function (userData) {\nconsole.log('User Data ===', userData);\n})\n.catch(function (err) {\n console.log('Fetch Error :-S', err);\n});\n// Get full user profile, console log and populate some basic on screen information.\ntpoAppObject.getUserProfileData().then(function (userProfileData) {\nconsole.log('User Profile Data ===', userProfileData);\nif (typeof userProfileData.FirstName === 'undefined') {\n $('#userNotAvailable').show();\n $('#userAvailable').hide();\n} else {\n $('#userNotAvailable').hide();\n $('#userAvailable').show();\n // Get a few fields for illustrative purposes.\n $('#userName').html(userProfileData.FirstName + ' ' + userProfileData.LastName);\n $('#userEmail').html(userProfileData.Email);\n $('#userOrgId').html(userProfileData.ExternalOrgID);\n $('#userId').html(userProfileData.ExternalUserID);\n}\n})\n.catch(function (err) {\n console.log('Fetch Error :-S', err);\n});\n}", "title": "" }, { "docid": "58a062f69f0255d92df012d390633070", "score": "0.72860307", "text": "function getUserDetails() {\n return fetch(getBaseUrl()+\"getUserDetails\")\n .then( res => res.json() )\n .then( data => {return data} )\n}", "title": "" }, { "docid": "3014e77ba948fcbb3b9a351109f122e1", "score": "0.72448856", "text": "getUserInformation(user) {\n return user.Information\n }", "title": "" }, { "docid": "9286a1746d1ebec0f421547c7904dd30", "score": "0.71894604", "text": "static getUsersDetails(userId) {\n // search for the user's details in the database.\n return db.collection(\"users\").doc(userId).get()\n }", "title": "" }, { "docid": "9aa87bf970d07735c98b59b546138d51", "score": "0.7166067", "text": "function getBusinessUser(req, res) {\n\tgetInformation(req, res, req.params.userId);\n}", "title": "" }, { "docid": "207d5a0dc0888143717280aa84e9a929", "score": "0.7163138", "text": "function api_getuser(ctx)\n{\n\tapi_req([{ a : 'ug' }],ctx);\n}", "title": "" }, { "docid": "777f60c4b084efe67bd8d0fe53880d3d", "score": "0.712273", "text": "getUser(username) {}", "title": "" }, { "docid": "9373d11338f071cdbc7cb205038e6581", "score": "0.7121831", "text": "function getUserDetail(){\n var user = $.parseJSON(getLocalStorage(\"currentUser\"));\n var fname = '';\n var lname = '';\n var burl = getBaseURL();\n if (user !== 'undefined' && user !== null){\n fname = user.firstName;\n lname = user.lastName;\n imgUrl = user.avatarURL;\n $(\"#divUserName\").html(fname + \" \" + lname);\n $(\"#baseUrl\").val(burl);\n if (imgUrl !== null){\n $(\"#imgProfile\").prop(\"src\", burl + imgUrl);\n } \n } \n}", "title": "" }, { "docid": "4c71a282f2dbb096da355968ff6c5464", "score": "0.7094401", "text": "function getUser() {\n var domain = window.location.hostname;\n var port = window.location.port;\n\n $.get('/users/getUserByName/' + User, function (data) {\n id = data._id;\n $('#profile-name').text(data.user_name);\n\n if (data.profile_pic) {\n $('#profile-pic').attr('src', '//' + domain + ':' + port + '/' + data.profile_pic);\n }\n });\n\n /**\n * Retrieves links to the user's posts\n */\n $.get('/posts/getPosts', function (data) {\n var posts = \"\";\n\n for (var i = 0; i < data.length; i++) {\n if (data[i].user_name === User) {\n posts += \"<a href='\" + data[i].post_link + \"' class='list-group-item'>\" + data[i].post_title + \"</a>\";\n }\n }\n\n $('#user-posts').html(posts);\n })\n\n /**\n * Retrieves links to the user's comments\n */\n $.get('/comments/getComments', function (data) {\n var comments = \"\";\n\n for (var i = 0; i < data.length; i++) {\n if (data[i].user_name === User) {\n comments += \"<a href='\" + data[i].comment_link + \"' class='list-group-item'>\" + data[i].comment + \"</a>\";\n }\n }\n\n $('#user-comments').html(comments);\n })\n }", "title": "" }, { "docid": "661ec82b3d5a656e98f545bc6bdad780", "score": "0.7085473", "text": "function getDetailedUserInfo() {\n if (generalUserInfo.length > 0) {\n\n /* prepare query for user details */\n var fetchUserDetails = '/users/' + generalUserInfo[0].login;\n\n generalUserInfo.shift(); // prepare next login name\n currentParallelProcesses++; // increase parallel process count\n\n /* start query */\n gitHubClient.get(fetchUserDetails, processDetails);\n\n /* manage parallel processing */\n if (currentParallelProcesses < processLimit) // if parallel limit not reached, launch next process\n if (currentPageNumber < totalNbOfPages) // fetch new page as soon as possible\n fetchNextPage();\n else // if no pages are left, continue fetching user details\n getDetailedUserInfo();\n }\n }", "title": "" }, { "docid": "9d4f7a1c2dc00d6188dd64a580b2a5aa", "score": "0.7075665", "text": "function getUserInfos(callback)\n{\n\tsendHttpGetRequest(\"/user\", function(response) \n\t{\n\t\tvar user = JSON.parse(response);\n\n\t\tcallback(user)\n\t});\n}", "title": "" }, { "docid": "640ea6e14025a71d0075f8ef1615696b", "score": "0.70739335", "text": "function showUserDetails(name) {\n $http({\n url: host + \"users/find/\" + name,\n method: \"GET\",\n crossDomain: true\n }).success(function (data, status, headers, config) {\n $scope.presentUser = data;\n }).error(function (data, status, headers, config) {\n console.log(\"Error In get Inventories for user\", data);\n $scope.message = data.message;\n });\n }", "title": "" }, { "docid": "6d482201b7935ef5daf65bc2492b7f55", "score": "0.7047441", "text": "function getUserDetails(id) {\r\n return get('/user/detail', { id: id }).then(function (res) {\r\n return res.data;\r\n }).catch(function (err) {\r\n return err.response.data;\r\n });\r\n}", "title": "" }, { "docid": "6b39c6dc136763e262bcd428f5c28580", "score": "0.7042559", "text": "function getSingleUser(res, mysql, context, complete, employeeNum){\n mysql.pool.query(\"SELECT firstName, lastName, employeeID, managerID, monStart, monStop, tuesStart, tuesStop, wedStart, wedStop, thurStart, \" +\n \"thurStop, friStart, friStop, satStart, satStop, sunStart, sunStop FROM `Employees` WHERE employeeID = \" + employeeNum, function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.userinfo = JSON.parse(JSON.stringify(results));\n complete();\n });\n}", "title": "" }, { "docid": "b1ff03455375ae55b62f035b3b9efb39", "score": "0.70401466", "text": "getUserDetails({userId} = {}, callback) {\n if (typeof userId === 'undefined' || userId === null || userId.length === 0) {\n return this.handleError('invalid userId', callback);\n }\n\n let options = {\n path: '/users/' + userId,\n method: 'GET'\n };\n\n return this._request(options, callback);\n }", "title": "" }, { "docid": "91af9de887ff636495eabaabcb21c091", "score": "0.70374894", "text": "function getUserData() {\n FB.api('/me', function(response) {\n console.log('FBID: ' + response.id);\n console.log('Name: ' + response.name);\n console.log(response);\n checkFB_ID(response);\n });\n}", "title": "" }, { "docid": "ca68caa9b71258280695e16782f427cc", "score": "0.703419", "text": "function get_user_info()\n{\n var user_info = {\n \"name\": RMPApplication.get(\"my_user.name\"),\n \"fix_mobile_number\": RMPApplication.get(\"my_user.fix_mobile_number\"),\n \"user_email_unknown\": RMPApplication.get(\"my_user.user_email_unknown\"),\n \"contact_email\": RMPApplication.get(\"my_user.contact_email\")\n };\n // stocke ident dans le widget var_ident\n RMPApplication.set(\"var_user_info\", JSON.stringify(user_info));\n}", "title": "" }, { "docid": "64604e03f0aff7589e67aa36c0d41039", "score": "0.70338225", "text": "function getUser(retTo) {\n\n getObjByType('user', 'string', '_id', username, null, function(err, response) {\n if (!err) {\n\n\n\n /*\n * check if there was any user object with the correspondind username,\n * already in the db. If not then open the editProfile panel for\n * the user to enter details.\n */\n if (response.total_rows < 1 || response.length === 0) {\n console.log(\"No User found.\");\n document.getElementById('e_myUsername').value = username;\n document.getElementById('e_myUsername').disabled = true;\n $.ui.loadContent(\"#editProfile\");\n return;\n }\n\n /*\n * Got the username, so it is safe to init Notes.\n */\n initNote();\n initSubs();\n\n /*\n * A user obj was found in the db, so redraw the profile UI with data\n * from this obj. If for some reason the data does not pass verification\n * tests open the edit interface for the user, else open the main options\n * now.\n */\n redrawProfileUI(response[0]);\n console.log(\"profile fields updated\");\n\n\n console.log(retTo);\n if (verifyUserFields()) {\n if (typeof (retTo) !== 'undefined' && retTo !== null && document.getElementById(retTo) !== null) {\n $.ui.loadContent(retTo);\n\n } else {\n document.getElementById('e_myUsername').value = username;\n document.getElementById('e_myUsername').disabled = true;\n $.ui.loadContent(\"#mainOptions\");\n }\n }\n\n } else {\n console.log('Unable to fetch data!');\n console.log(err);\n alert('Could not fetch user data(' + err + ')');\n }\n });\n\n}", "title": "" }, { "docid": "67087cc7ef3f2536708615c344b2cf3e", "score": "0.7015554", "text": "function loadUserData() {\n console.log(\"loadUserInfo\");\n\n s_odsSession.userInfo(function(result) {\n console.log(result);\n\n var usrInfo = { name: result[\"fullName\"] != null ? result[\"fullName\"] : result[\"name\"] };\n if(result[\"photo\"] && result[\"photo\"].length > 0) {\n // build the photo URL which is a DAV path for now. later this could also be a public URL\n usrInfo[\"photo\"] = result.photo.substr(0, 1) == '/' ? ODS.davUrl(result.photo) : result.photo;\n }\n console.log(usrInfo);\n\n var usrLink = usrInfo.name;\n if(usrInfo.photo) {\n $('#odsUserCardPhoto').attr(\"src\", usrInfo.photo);\n usrLink = '<img class=\"minigravatar\" src=\"' + usrInfo.photo + '\" /> ' + usrLink;\n }\n $('#profileLinkUserName').html(usrInfo.name);\n $('#odsUserCardName').html('<a href=\"' + result.iri + '\">' + usrInfo.name + \"</a>\");\n\n $('.odsLoginLink').hide();\n $('#userProfileLinks').show();\n $('#odsUserLogout').show();\n $('#odsUserCard').show();\n }, function() {\n // TODO: inform the user\n });\n}", "title": "" }, { "docid": "bb0727e1baaf45de29a61ed4d550e646", "score": "0.70121616", "text": "getUserInfo(userId, options = {}) {\n return this.callMethod('users.info', Object.assign({ user: userId }, options)).then(data => data.user);\n }", "title": "" }, { "docid": "b8d085956b7183b43953b3e268004689", "score": "0.7005753", "text": "function getUserBasic(uid){\r\n\t// This actually needs to do the proper web server call to pull this from the database\r\n\r\n\t// User Data Array is in format [Fist Name, Last Name, Phone, Email, office, agency_id, job_sries_id, employee type id]\r\n\tvar data = [];\r\n\r\n\t// Used for example data. REMOVE BEFORE PRODUCTION\r\n\tif (uid == 1){\r\n\t\tdata = ['Liz','Wilson','(555) 555-5555','[email protected]','Generic Office Name','Administration for Community Living (ACL)','Series 1','ORISE'];\r\n\t}\r\n\r\n\treturn data;\r\n}", "title": "" }, { "docid": "8037231cdf5fc68cb38a92c6534cf133", "score": "0.6996525", "text": "function getMe() {\n\t$.ajax({\n\t\turl: \"ajax/ajax.php\",\n\t\ttype: \"POST\",\n\t\tdata: {\n\t\t\tcall: \"getUserInfo\",\n\t\t\ttoken: accessToken,\n\t\t\trefresh: refreshToken\n\t\t}\n\t})\n\t\t.done(function (data) {\n\t\t\ttry {\n\t\t\t\tvar response = jQuery.parseJSON(data);\n\t\t\t\tif (!response.error || response.error.length === 0) {\n\t\t\t\t\tuserName = response.first_name;\n\t\t\t\t\tuserCurr = response.main_currency;\n\t\t\t\t\tlog(\"Toshl Username: \" + userName);\n\t\t\t\t} else {\n\t\t\t\t\tredirect();\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tlogError(\"Toshl API error, please try again later\", e);\n\t\t\t}\n\t\t});\n}", "title": "" }, { "docid": "58eaf7fb21094c2eb264bc903d6537af", "score": "0.69849706", "text": "function getUser() {\n console.log('TBD: get user solving the exercise');\n return {user: {\n id: 123,\n first_name: \"John\",\n last_name: \"Smith\",\n avatar: \"avatars/3.png\"\n }};\n}", "title": "" }, { "docid": "e43d630456a443530137453f19083a1f", "score": "0.6981863", "text": "function getUserInfo () {\n return $http({\n method: 'GET',\n url: '/webapp/user/profile/getInfo'\n })\n .then(getInfoSuccess, getInfoFailed);\n\n function getInfoSuccess(response) {\n return response;\n }\n function getInfoFailed(errResponse) {\n return $q.reject(errResponse); \n }\n }", "title": "" }, { "docid": "d53292b8b1f3de5c7c7c268209e5db4e", "score": "0.69755054", "text": "function getUser(){\n $.get(\"/api/user_data\").then(function(data) {\n $(\".member-name\").text(data.email);\n });\n }", "title": "" }, { "docid": "29d3dca63ec93dc5eb4d5225d28fa0a5", "score": "0.6974461", "text": "getUserDetails(serverName, jwt) {\n this.submitGet(serverName + StompApiConstants.USER_DETAILS_URL, \n jwt, \n StompApiActions.ApiUserDetailsRequestSuccess); \n }", "title": "" }, { "docid": "6dc5bfb575daff6aba80bd280a78466c", "score": "0.6957328", "text": "function getUserData() {\n\t \tCallModel.fetch('Status', {},\n\t \t{\n\t \t\tsuccess: function (response) {\n\t \t\t\t$window.sessionStorage.yourId = response.user.id;\n\t \t\t}\n\t \t});\n\t }", "title": "" }, { "docid": "7e2c41d35ffa1e37be2f3bcab66e1581", "score": "0.6940239", "text": "async function getUserInfo() {\n try {\n //attempt to get user\n let usr = await getUser();\n\n //in the likely case we're not logged in & have no token, return\n let usrjson = await usr.json();\n\n if (usrjson) {\n\n //if token is valid, but user has a problem, we should get an empty user\n if (!usrjson.username) {\n document.cookie = 'access_token=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';\n return;\n }\n\n //else continue\n store.addUser(usrjson);\n nav.updateUser(store.user)\n }\n\n } catch (err) {\n\n if (err.statusCode === 401)\n\n //let ourselves know if there was an error getting the user --> this happens when user doesn't exist\n console.log('Err getting user');\n }\n}", "title": "" }, { "docid": "cb65080a3ceaf82b9521c37bdff2fef0", "score": "0.6938017", "text": "function getUser() {\n\n $http.get(\"/api/account/UserInfo\").then(\n function (response) {\n service.user = response.data;\n \n },\n function (err) {\n \n }\n );\n }", "title": "" }, { "docid": "206f731ab4c2a6894fdbcf6f2f54cefa", "score": "0.6930357", "text": "getAutheticatedUserInfo() {\n //console.debug('get autheticated user info');\n let lc = JSON.parse(localStorage.getItem('userInfo'));\n //console.debug('lc::', lc);\n return lc === null ? '' : lc;\n }", "title": "" }, { "docid": "48df4caeb7780687885a6d9bb0e79385", "score": "0.6924313", "text": "function getUser(){\n return $.ajax({\n url: siteUrl + \"/_api/web/currentUser\",\n Type:'GET',\n headers: {\n accept: \"application/json;odata=verbose\"\n }\n });\n }", "title": "" }, { "docid": "8a17ecf64594d8ac57d934ea8df87fff", "score": "0.69231075", "text": "function loadUserInfo() {\n return $.get(\n {\n url: 'http://private-anon-a1e1b8d498-wad20postit.apiary-mock.com/users/1',\n success: function (response) {\n return response;\n },\n error: function () {\n alert('error')\n }\n }\n );\n }", "title": "" }, { "docid": "66c74a29ace1d483bfaa55beb7632548", "score": "0.68997824", "text": "function getUserInfo() {\n if (FB) {\n userData = null;\n FB.api('/me',\n {fields: \"id,about,age_range,picture,bio,birthday,context,email,first_name,gender,hometown,link,location,middle_name,name,timezone,website,work\"},\n function(response) {\n console.log('Successful login for: ' + response.name);\n userData = response;\n updateUI();\n if (typeof callbacks[USER_DATA_RECEIVED] === 'function') {\n callbacks[USER_DATA_RECEIVED]('ok');\n }\n stat('Testix.me', 'Login', 'Facebook_login', userData.id);\n //getFriends();\n });\n }\n }", "title": "" }, { "docid": "cb6a5d2177e8bc913bc64fd9d594dadb", "score": "0.6897308", "text": "function getUserInfo(userId, callback) {\n return fetch(`${API_BASE}users/${userId}/info/`, {\n accept: 'application/json',\n credentials: 'include'\n }).then(checkStatus)\n .then(parseJSON)\n .then(callback);\n}", "title": "" }, { "docid": "9a0bc8885dcca9d7377da1f918aeb571", "score": "0.6873389", "text": "async getUser() {\n return await this.client.queryByChaincode(chaincodeId, 'user.get');\n }", "title": "" }, { "docid": "0e08c4b2dde985be4fd9d69bf8b8e19e", "score": "0.6860036", "text": "async viewUserDetails(req, res) {\n try {\n let id;\n let uuid;\n let follow;\n uuid = req.userData.uuid\n const { user_uuid } = req.query;\n if (!user_uuid) {\n id = uuid;\n } else {\n follow = await helperMethods.checkForFollower(Follower, user_uuid, uuid);\n id = user_uuid\n }\n const user = await helperMethods.getAUserByUuid(User, id);\n if (!user) return sendErrorResponse(res, 404, 'User not found');\n if (!follow) {\n user.following = false\n } else {\n user.following = true\n }\n return sendSuccessResponse(res, 200, { user });\n } catch (e) {\n return sendErrorResponse(res, 500, 'An error occurred viewing user details');\n }\n }", "title": "" }, { "docid": "2167a1986f5c83caa73fe392d5d7a371", "score": "0.6852312", "text": "async function user_detail(request, response, next) {\n console.log('User detail');\n\n const token = request.params.token;\n\n handleTokenLib.checkToken(token, response);\n\n const id_user = await handleTokenLib.getIdUserFromToken(token, next);\n\n try {\n const results = await pool.query('SELECT * FROM users WHERE id_user = $1', [id_user]);\n response.status(200).json(results.rows);\n } catch (error) {\n next(error);\n }\n}", "title": "" }, { "docid": "5a6172f4fcc7d457f9b97eac14ed4f75", "score": "0.6845436", "text": "function get_user_info() {\n\n\t$.ajax({\n\t\turl: 'https://api.spotify.com/v1/me',\n\t\theaders: {\n\t\t\t'Authorization': 'Bearer ' + accessToken\n\t\t},\n\t\tsuccess: accessCallback\n\t})\n\n}", "title": "" }, { "docid": "80b1fa61928685079a462863c7b79e8c", "score": "0.6836458", "text": "getUser(parent, args, content, ast) {\n const feathersParams = convertArgs(args, content, ast);\n return users.get(args.key, feathersParams).then(extractFirstItem);\n }", "title": "" }, { "docid": "80b1fa61928685079a462863c7b79e8c", "score": "0.6836458", "text": "getUser(parent, args, content, ast) {\n const feathersParams = convertArgs(args, content, ast);\n return users.get(args.key, feathersParams).then(extractFirstItem);\n }", "title": "" }, { "docid": "cb2f959338df803e9376117dcafdaf70", "score": "0.6823179", "text": "static getUser(req, res) {\n client.query(\n 'SELECT * FROM users WHERE id = $1',\n [req.user],\n (error, results) => {\n if (error) {\n res.status(403).json({\n status: 403,\n error,\n });\n }\n if (results.rows.length < 1) {\n res.status(404).json({\n status: 404,\n error: 'No such user in our database',\n });\n } else {\n res.status(200).json({\n status: 200,\n user: {\n id: results.rows[0].id,\n firstname: results.rows[0].firstname,\n lastname: results.rows[0].lastname,\n othername: results.rows[0].othername,\n email: results.rows[0].email,\n username: results.rows[0].username,\n registered: results.rows[0].registered,\n isAdmin: results.rows[0].isadmin,\n },\n });\n }\n },\n );\n }", "title": "" }, { "docid": "2493986860156b645bb64cba16cf7f09", "score": "0.68205976", "text": "function showInfo(user) {\n console.log('User Info', user.id, user.username, user.firstName);\n}", "title": "" }, { "docid": "aa4e3dd2e741146b5c67002dd37ae6c8", "score": "0.6820526", "text": "function getProfileData() {\n console.log(\"getProfileData\");\n IN.API.Raw(\"/people/~\").result(onSuccess).error(onError);\n }", "title": "" }, { "docid": "3425d13d8f721f043f8141aa0fd3038d", "score": "0.6819369", "text": "function getProfile() {\n\t\t\t$scope.$emit('loading-on');\n\t\t\treturn UserData.getUser().then(_getUserSuccess, _getUserError);\n\t\t}", "title": "" }, { "docid": "6fa135330950312d59180730d5564bb8", "score": "0.68032503", "text": "function UserDetail() {\r\n var name = getValue(\"Name\");\r\n var surname = getValue(\"Surname\");\r\n var email = getValue(\"Email\");\r\n\r\n\r\n}", "title": "" }, { "docid": "9ef01561cf6945b75b446d6270e68869", "score": "0.6801486", "text": "function getUser(i) {\n\tcon.query('SELECT * FROM users', (err, rows) => {\n\t\tif (err) throw err;\n\t\tif (rows[i - 2].mellemnavn == null)\n\t\t\tallDetails = \"ID: \" + i + \", Navn: \" + rows[i - 2].Fornavn + \" \" + rows[i - 2].Efternavn + \", Role: \" + rows[i - 2].status + \", Birthday:\" + rows[i - 2].birthday\n\t\telse if (rows[i - 2].mellemnavn != null)\n\t\t\tallDetails = \"ID: \" + i + \", Navn: \" + rows[i - 2].Fornavn + \" \" + rows[i - 2].mellemnavn + \" \" + rows[i - 2].Efternavn + \", Role: \" + rows[i - 2].status + \", Birthday:\" + rows[i - 2].birthday\n\t});\n\treturn allDetails\n}", "title": "" }, { "docid": "022fa0dc1e34f47eeb8ad4487eb11bea", "score": "0.68005455", "text": "async function getUserData() {\n try {\n const currentUser = await fhirClient.user.read();\n if (currentUser) {\n setUser(currentUser);\n }\n } catch (error) {\n console.log(error);\n }\n }", "title": "" }, { "docid": "dbb97db7a2c79e83b9f98602e1e7fc6e", "score": "0.67986035", "text": "function getUser() {\n\t\tauthFactory.getUser()\n\t\t.then(function(response) {\n\t\t\tvm.user = response.data;\n vm.user_id = response.data.user_id;\n getUserAPI(vm.user_id);\n\t\t});\n\t}", "title": "" }, { "docid": "e07bb7be97c7b0d23d0ea74b899ddb80", "score": "0.67857987", "text": "getUser(name) {\n return fetch(baseUrl + \"/users/\" + encodeURI(name), {\n method: \"GET\",\n headers: { \"Content-Type\": \"application/json\" },\n })\n .then(data => data.json());\n }", "title": "" }, { "docid": "80847e8e650d80aded18536b478397b9", "score": "0.6762123", "text": "getUserData() {\n var self = this;\n var defer = new $.Deferred();\n // always refresh userdata\n paella.opencast.getUserInfo().then(\n function (me) {\n self._userData = me;\n // If not loggged in as admin, do the pseudo name check\n if (! self.hasAdminRole(me.roles)) {\n self._aliasUtil.getPseudoName().then(function (pseudoName) {\n // replacing OC username with annot pseudo name and\n // also setting flag that its an annot pseudoname\n self._userData.username = pseudoName;\n self._userData.pseudoName = pseudoName;\n defer.resolve(self._userData);\n });\n } else {\n self._isAdmin = true;\n defer.resolve(self._userData);\n }\n },\n function () {\n defer.reject();\n });\n return defer;\n }", "title": "" }, { "docid": "d8016abaa50117cd230aef6d49f8ef94", "score": "0.67617935", "text": "function getUserInformation(user_id, success, err_call){\n requestService.getDataOnce([prefix, user_id], function(user){\n if(user === null){\n err_call({message: \"account locked\"});\n $rootScope.genService.showDefaultErrorMsg('Account locked. Please contact admin');\n } else if (user.rights === 0) {\n err_call({message: \"account locked\"});\n $rootScope.genService.showDefaultErrorMsg('Account locked. Please contact admin');\n } else {\n success(user);\n }\n }, err_call);\n }", "title": "" }, { "docid": "8ade08954f46b6436012c9285d4a1e2f", "score": "0.67582023", "text": "function getUserInfo(username) {\n // debugger;\n let token = localStorage.getItem('token');\n return $.ajax({\n method: 'GET',\n url: `https://hack-or-snooze.herokuapp.com/users/${username}`,\n headers: {\n Authorization: `Bearer ${token}`\n }\n });\n }", "title": "" }, { "docid": "7979b6657c2cf3145b53690b25cd9a0a", "score": "0.6757985", "text": "function findUserById() {\n\n}", "title": "" }, { "docid": "658b692587d758ff86b7caf96ac318aa", "score": "0.67578465", "text": "function getProfileData() {\n IN.API.Raw(\"/people/~\").result(onSuccess).error(onError);\n }", "title": "" }, { "docid": "bba5188d347ca9fd81f1fb1b731b5dac", "score": "0.6756829", "text": "getUserInfo(request) {\n if (this.getToken()) {\n const data = JSON.parse(localStorage.getItem('_user'))\n if (request === 'permission') {\n return data.permission;\n } else if (request === 'username') {\n return data.username;\n } else if (request === 'image') {\n return data.image;\n }\n }\n }", "title": "" }, { "docid": "ce4e62083c9d6c59e3f761ccdb6023fe", "score": "0.6752849", "text": "function getUser(data, callback) {\n\n // validate\n var phone = typeof(data.queryStringObject.phone) == 'string' && data.queryStringObject.phone.trim().length == 10 ? data.queryStringObject.phone.trim() : false;\n\n if (phone) {\n\n // Get the token from the headers\n let tokenId = typeof(data.headers.token) == 'string' ? data.headers.token : false;\n if (tokenId) {\n\n utils.verifyToken(tokenId, phone, function(isValid) {\n if (isValid) {\n filesys.read('users', phone, function(err, userData) {\n\n if (!err && userData) {\n // remove the hashed password from the object before returning\n delete userData.hashedPassword;\n callback(200, userData);\n \n } else {\n callback(404);\n }\n \n });\n } else {\n callback(403, {'Error': 'Token is not valid.'});\n }\n });\n } else {\n callback(403, {'Error': 'Missing Token.'});\n } \n\n } else {\n callback(400, {'Error': 'Missing required field.'});\n }\n }", "title": "" }, { "docid": "76ccef2db02ef097a1fca6ccac18b5e3", "score": "0.6751095", "text": "function getUserDetails(username) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', 'https://api.github.com/users/' + username);\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n var user = JSON.parse(xhr.responseText);\n console.log(user);\n } else {\n console.log('Error: ' + xhr.status);\n }\n }\n };\n xhr.send();\n}", "title": "" }, { "docid": "5559184259a527b5a7e6af6904b61426", "score": "0.67501813", "text": "function getUserInfo(callback) {\n $.ajax({\n type: \"get\",\n url: \"/login/me\",\n success: function(data) {\n callback(data);\n },\n error: function(e) {\n console.log(e.responseText);\n callback(\"Unknown\");\n }\n });\n }", "title": "" }, { "docid": "06ce58a14090065509cb433cbd19b0ac", "score": "0.6741473", "text": "function GetUserInfo() {\n\t\tvar username = getCookie('username'),\n\t\t\tuserid = getCookie('userid');\n\t\treturn { username: username, userid: userid };\n\t}", "title": "" }, { "docid": "e469248fb94a9807238e2b0c4800f674", "score": "0.6741077", "text": "function getUserName() {\r\n context.load(user);\r\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\r\n}", "title": "" }, { "docid": "fec0aa5b1602a30947234914eaa93f0e", "score": "0.67406684", "text": "function getUser(id, cb){\n // cb('error while reading user data');\n\n var user = {'name': 'eric'};\n cb(null, user)\n}", "title": "" }, { "docid": "85ab58347504fe984574729c3b7d216e", "score": "0.67390305", "text": "function getUser(id) {\n\n let xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"users/?userId=\"+id, true);\n xhr.send();\n\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n let response = xhr.responseText;\n let resp = JSON.parse(response);\n //console.log(resp);\n // displayReimbs(resp);\n let userDetails = `\n <li>Full names: ${resp.fname + \" \" + resp.lname}</li>\n <li>Email: ${resp.email}</li>\n `;\n let list = document.createElement(\"ul\");\n list.innerHTML = userDetails;\n\n document.getElementById(id).append(list);\n //userData = {};\n //userData = resp;\n console.log(resp);\n //setUserDetails(resp);\n }\n if (xhr.status === 401) {\n //document.getElementById(\"displayArea\").innerText = 'Request failed!';\n }\n if (xhr.status === 409) {\n //document.getElementById('displayArea').innerText = 'Request could not be sent. Try again';\n }\n if (xhr.status === 500) {\n //document.getElementById('displayArea').innerText = 'An error occurred. Try again';\n }\n }\n }\n\n}", "title": "" }, { "docid": "344bdb8f288a323daee3459ab1fc8fa8", "score": "0.67324823", "text": "function getUserInfo(user_info, ids) {\n var user = {};\n if (ids.indexOf(user_info.id) == -1) {\n user.id = user_info.id;\n \n if (user_info.name) {\n user.name = user_info.name;\n }\n \n if (user_info.screen_name) {\n user.screen_name = user_info.screen_name;\n }\n\n if (user_info.location) {\n user.location = user_info.location;\n }\n\n if (user_info.description) {\n user.description = user_info.description;\n }\n\n if (user_info.url) {\n user.url = user_info.url;\n }\n\n if (user_info.id) {\n user.id = user_info.id;\n }\n return user;\n }\n return null;\n}", "title": "" }, { "docid": "26b0b78f2a66fb4d488f85a062e4cd04", "score": "0.67296064", "text": "function getUserName() {}", "title": "" }, { "docid": "9c84d798c123bfaac40d7d07bd2fe7fd", "score": "0.6728404", "text": "function getUserInformation(callback) {\n $.getJSON('/api/users/me').done(function(data) {\n if (!data.error) {\n // No errors occured.\n user_info = data;\n callback(data);\n } else {\n if (data.error === 'no_login') {\n // The user is not logged in and no information could be fetched.\n callback(false);\n } else {\n // wat\n callback(null);\n }\n }\n });\n}", "title": "" }, { "docid": "555b997c3884e6db4bd9ee6caed68952", "score": "0.67268175", "text": "function getUserInformation(gUser) {\r\n\t\tlet url = 'https://api.github.com/users/' + gUser.username;\r\n\t\t\r\n\t\treturn fetch(url)\r\n\t\t\t\t.then(resp => {\r\n\t\t\t\t\treturn resp.json();\r\n\t\t\t\t\t});\r\n\t}", "title": "" }, { "docid": "85611a3ba8550515d6fa6c1b5a15c537", "score": "0.67193455", "text": "function getUser() {\n $log.debug('Getting user email');\n $log.debug(chrome);\n if(chrome.identity) {\n chrome.identity.getProfileUserInfo(function(user){\n $log.debug(user);\n return user;\n });\n } else {\n return {};\n }\n }", "title": "" }, { "docid": "04a921a2e3aafb821e7cc8b71bef8032", "score": "0.67178595", "text": "function getProfileData() {\n IN.API.Raw(\"/people/~\").result(onSuccess).error(onError);\n}", "title": "" }, { "docid": "d84c16f4add1e9f1c5802df75943c0be", "score": "0.6717388", "text": "async getUserInfo({ method = 'GET', token = '' }) {\n return this.requestGET({\n path : this.paths.settings.userInfo,\n method,\n token,\n })\n }", "title": "" }, { "docid": "a5f4e7b7adccc2a41934c6a9f0974490", "score": "0.67141044", "text": "function getInfo() {\n\tFB.api('/me', 'GET', {fields: 'first_name,last_name,name,id,picture{url}'}, function(response) {\n\t\t//console.log(response)\n\t\t//document.getElementById('status').innerHTML = response.id;\n\t\tfacebook_user={\n\t\t\tid:response.id,\n\t\t\tfirst_name:response.first_name,\n\t\t\tlast_name:response.last_name,\n\t\t\tpicture:response.picture.data.url\n\t\t}\n $('#profile').attr('src', facebook_user.picture);\n $('#name').text(facebook_user.last_name+\", \"+facebook_user.first_name);\n\t\n\t\tsessionStorage.setItem(\"facebook_user\", JSON.stringify(facebook_user) );\n\t});\n}", "title": "" }, { "docid": "2f4d0bc3d97b9bb001f5bedab1b02e8c", "score": "0.67107904", "text": "function getUser(res, mysql, context, email, complete){\n\n\t\tvar sql = 'SELECT user_id, first_name, last_name, email, password, department_id, account_created, signature_image_path FROM user WHERE email = ?'\n\t\tvar inserts = [email];\n\t\tmysql.pool.query(sql, inserts, function(error, results, fields){\n\t\t\tif(error){\n\t\t\t\tres.write(JSON.stringify(error));\n\t\t\t\tres.end();\n\t\t\t}\n\t\t\tcontext.user = results[0];\n\t\t\tcomplete();\n\t\t});\n\t}", "title": "" }, { "docid": "bcb5ec133a3362a075b708c3c5ff11fb", "score": "0.6709851", "text": "function getUserData() {\r\n document.querySelector('#name').value = _thisUser.displayName;\r\n document.querySelector('#mail').value = _thisUser.email;\r\n document.querySelector('#imagePreview').src = _thisUser.img; \r\n console.log(\"Current name\" + \": \" +document.querySelector('#name').value);\r\n}", "title": "" }, { "docid": "6146aea1a025a8bcfcf2bb4f3b8b82f2", "score": "0.6706661", "text": "function getUserObject() {\n\tvar user = {\n\t\t\"id\":elementAPI.user().data.id,\n\t\t\"first_name\":elementAPI.user().data.first_name,\n\t\t\"last_name\":elementAPI.user().data.last_name,\n\t\t\"has_partner\":elementAPI.user().data.has_partner,\n\t\t\"relationship_id\":elementAPI.user().data.partner_relationship_id,\n\t\t\"gender\":elementAPI.user().gender(),\n\t\t\"avatar\":elementAPI.user().avatar()\n\t}\n\n\treturn user;\n}", "title": "" }, { "docid": "db501c67cb49a16e16ff6591772d2e59", "score": "0.6694713", "text": "static async getUsers () {\n const url = 'accounts/all_users';\n\n try {\n const {result, resbody} = await getResponse_get(url)\n return {result, resbody}\n\n }catch(err){\n if (err) console.log('login error', err)\n }\n }", "title": "" }, { "docid": "b58c31550f1e09ff70a4c806a4e88d9d", "score": "0.6670405", "text": "getUser(per, page) {\n return instance.get('/api/admin/user?page=' + page + '&per_page=' + per);\n }", "title": "" }, { "docid": "172c3abaf05bd200289b7899b3de2e57", "score": "0.66687554", "text": "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "title": "" }, { "docid": "172c3abaf05bd200289b7899b3de2e57", "score": "0.66687554", "text": "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "title": "" }, { "docid": "9a9e36c3dcced06a5fee9b894b09625e", "score": "0.6663881", "text": "function getAllUsers() {\n\tcon.query('SELECT * FROM users', (err, rows) => {\n\t\tif (err) throw err;\n\n\t\tuserInfo = \"test\"\n\t\treturn userInfo\n\t});\n}", "title": "" }, { "docid": "e80b7a4b481cd3604c1d33851a918ae4", "score": "0.66624403", "text": "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n }", "title": "" }, { "docid": "5c84a56c49a768764f7a659da7a870e5", "score": "0.6662381", "text": "function getUserInfo() {\n const params = new URLSearchParams(location.search);\n const userID = params.get('userID');\n const users = JSON.parse(gJSONusers);\n for (user in users) {\n if (users[user].userID == userID) {\n const title = document.getElementById('user-name-container');\n title.innerHTML = '<h1>' + users[user].name + '</h1>';\n const major = document.getElementById('user-major-container');\n major.innerText = 'Major: ' + users[user].major;\n const year = document.getElementById('user-year-container');\n year.innerText = 'Class Year: ' + users[user].year;\n const numTaskCompleted =\n document.getElementById('user-num-complete-container');\n numTaskCompleted.innerText =\n 'Total Tasks Completed: ' + users[user].numTaskCompleted;\n const prioritySkills =\n document.getElementById('user-prskills-container');\n pskills = '';\n for (skill of users[user].skills) {\n if (skill.priority == true) {\n if (pskills == '') {\n pskills = skill.skill;\n } else {\n pskills = (pskills + ', ' + skill.skill);\n }\n }\n }\n prioritySkills.innerText = 'Priority Skills: ' + pskills;\n const skills = document.getElementById('user-skills-container');\n skillString = '';\n for (skill of users[user].skills) {\n if (skillString == '') {\n skillString = skill.skill;\n } else {\n skillString = skillString + ', ' + skill.skill;\n }\n }\n skills.innerText = skillString;\n break;\n }\n }\n}", "title": "" }, { "docid": "0e8790ed463bd55ecbe567bf8c2d76a9", "score": "0.66620106", "text": "function getUserName() {\n context.load(user);\n context.executeQueryAsync(onGetUserNameSuccess, onGetUserNameFail);\n}", "title": "" }, { "docid": "d0b0074d4191fe8c46e6055a3fbb73b7", "score": "0.66595405", "text": "function onGetUserId(data) {\n\t\tuser_id = data.user.nsid;\n\t\tgetCollectionTree();\n\t\t//getPhotosets();\n\t}", "title": "" }, { "docid": "696057a4b3e960a6767954fafa570080", "score": "0.6658366", "text": "function getUser(res, mysql, context, Id, complete){\n var sql = \"SELECT Id, first_name, last_name, department, job_title, pref_phone, pref_email, home_office, assigned_laptop FROM users WHERE Id = ?\";\n var inserts = [Id];\n mysql.pool.query(sql, inserts, function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.user = results[0];\n complete();\n });\n }", "title": "" }, { "docid": "20470c967966bb7d7745edd922948e20", "score": "0.6654859", "text": "function getUserProfile() {\n\n console.log(\"Inside getUserProfile()\");\n\n const token = localStorage.getItem('accessToken');\n\n $.ajax({\n url: '/api/user',\n method: 'GET',\n headers: {\n authorization: `Bearer ${token}`\n }\n })\n .then(function (userData) {\n console.log(userData);\n $('#user-tabs, #forms, #right-column-title').hide();\n $('#user-info').show();\n $('#full-name').text(userData.fullName);\n $(\"#userProfileId\").show();\n\n\n \n })\n .catch(err => {\n console.log(err);\n handleError(err.responseJSON);\n });\n}", "title": "" }, { "docid": "dff82064436d2bba85a4e96c5f451a9a", "score": "0.6652221", "text": "getuserinfo(ref) {\n this.users = this.Data.persons;\n this.users.forEach(i => {\n this.person = i['users'];\n });\n return this.person.find(e => e.UserID === ref);\n }", "title": "" }, { "docid": "c44e23ab18a82f3faa9281d75c5818f1", "score": "0.66490227", "text": "getUserData(uid) {\n let UserRef = firebase\n .database()\n .ref('users')\n .child(`${uid}`);\n return UserRef.once('value').then(snapshot => {\n let user = snapshot.val();\n var userInfo = {\n bra: user.bra,\n bust: user.bust,\n name: user.name,\n height: user.height,\n hips: user.hips,\n size: user.size,\n waist: user.waist,\n id: uid\n };\n return userInfo;\n });\n }", "title": "" } ]
002b1499fe31eb6c570fd1f5eb54b978
Strips out any whitespace from the text
[ { "docid": "6d4921bd1921c72c0d2d7113757862dc", "score": "0.7342777", "text": "function compactThis(text)\r\n{\r\nvar charCode = 0;\r\nvar ret = '';\r\n\r\nfor (var i=0; i<text.length; i++)\r\n{\r\ncharCode = text.charCodeAt(i);\r\n\r\nif (!isWhiteSpace(charCode))\r\nret += text.charAt(i);\r\n}\r\n\r\nreturn ret;\r\n}", "title": "" } ]
[ { "docid": "43eaee3d52a7a7caab4e43991742d0f6", "score": "0.81282693", "text": "function stripText(text) {\n return text.replace(/<[^>]+>|[!.?,;:'\"-]/g,'').replace(/\\r?\\n|\\r|\\s+|\\t/g, ' ').trim();\n }", "title": "" }, { "docid": "1997ea081a161c097fa665887034b0e1", "score": "0.7612384", "text": "function stripHTMLnospace(text) {\n\tvar tmp = '';\n\ttmp = text.replace(/<[^>]*>/gi,'');\n\treturn tmp.replace(/ /g,'').replace(/&nbsp;/g,'');\n}", "title": "" }, { "docid": "c8eed76f63cae664564a3b8240b7da93", "score": "0.7418342", "text": "stripTags (text) {\n return `${text}`.replace(/#[a-zA-Z0-9._-]+/gi, '').trim().replace(/ +/g, ' ')\n }", "title": "" }, { "docid": "d139721afe3cb1da96cf4a093dee72ef", "score": "0.7395679", "text": "function normalizeWhitespace( text ) {\r\n\t\treturn trim(text).replace(RE_TIDY_CONSECUTIVE_WHITESPACE, SPACE_STRING);\r\n\t}", "title": "" }, { "docid": "d139721afe3cb1da96cf4a093dee72ef", "score": "0.7395679", "text": "function normalizeWhitespace( text ) {\r\n\t\treturn trim(text).replace(RE_TIDY_CONSECUTIVE_WHITESPACE, SPACE_STRING);\r\n\t}", "title": "" }, { "docid": "92b89c6c459ab5defd8fb734b1f8058c", "score": "0.73716164", "text": "function normalizeWhitespace( text ) {\n\t\treturn trim(text).replace(RE_TIDY_CONSECUTIVE_WHITESPACE, SPACE_STRING);\n\t}", "title": "" }, { "docid": "92b89c6c459ab5defd8fb734b1f8058c", "score": "0.73716164", "text": "function normalizeWhitespace( text ) {\n\t\treturn trim(text).replace(RE_TIDY_CONSECUTIVE_WHITESPACE, SPACE_STRING);\n\t}", "title": "" }, { "docid": "8f613ca46cab8a08c7036ec8314fd2b2", "score": "0.7349637", "text": "function strip() {\n return this.replace(/^\\s+/, '').replace(/\\s+$/, '');\n }", "title": "" }, { "docid": "227f2c8e7f3c2d228daba2a09abfa9c2", "score": "0.734586", "text": "function normalizeWhitespace( text ) {\n return trim(text).replace(RE_TIDY_CONSECUTIVE_WHITESPACE, SPACE_STRING);\n }", "title": "" }, { "docid": "b62e471095ffb8114e8a572e7cf0488e", "score": "0.7294978", "text": "function trimSpace(sentText) {\n return findOneReplace(sentText, /^\\s+|\\s+$/, '');\n}", "title": "" }, { "docid": "13c5a5fdda31006ef34dc931469b5da3", "score": "0.7247212", "text": "function trim(text) {\n return text.replace(RE_TRAILING_SPACES, \"\");\n }", "title": "" }, { "docid": "b4e7a5e8d9cca94dd148745e1c5869f4", "score": "0.72036034", "text": "function filterText(text) {\r\n for (var i = 0; i < PATTERN.length; i++) {\r\n text = text.replace(PATTERN[i], \"\");\r\n }\r\n text.replace(' ')\r\n\r\n return text;\r\n}", "title": "" }, { "docid": "d8a15a634d8e490d07372ebd4d1c3852", "score": "0.71507233", "text": "function trim(text) {\n text= text.replace(/ /g,\"\"); //elimina espacios a izquierda y derecha\n text= text.replace(/\\n\\r/g,\"\");\n text= text.replace(/\\n/g,\"\");\n return text;\n}", "title": "" }, { "docid": "f125c4f04f761680b9386ef3b1fb9c7e", "score": "0.7147994", "text": "function trim(text)\r\n{\r\n return text.replace(/^\\s*|\\s*$/g,\"\");\r\n}", "title": "" }, { "docid": "33de63d28ee6ef2a2c27ed2e463ed143", "score": "0.7116585", "text": "function trim(text)\r\n{\r\n return text.replace(/^\\s*|\\s*$/g, '');\r\n}", "title": "" }, { "docid": "c9b8e60c26fd3444995269d4adf643e8", "score": "0.711443", "text": "function trimExtraSpaces(text) {\n\tvar i, n, returnText = \"\", precedingSpace = false;\n\n\tfor (i = 0, n = text.length; i < n; ++i) {\n\t\tif (text.charAt(i).match(/\\s/)) {\n\t\t\tif (!precedingSpace) {\n\t\t\t\treturnText = returnText + \" \";\n\t\t\t\tprecedingSpace = true;\n\t\t\t}\n\t\t} else {\n\t\t\t\n\t\t\treturnText = returnText + text.charAt(i);\n\t\t\tprecedingSpace = false;\n\t\t}\n\t}\n\n\treturn returnText;\n}", "title": "" }, { "docid": "9960ab3dc44e3098ab6a0e13a9a66ee5", "score": "0.7065255", "text": "function trim(text) {\n return text.replace(/^[\\r\\n\\t]+|[\\r\\n\\t]+$/g, '');\n}", "title": "" }, { "docid": "2af41a8bf98f9846eac8212801d378dd", "score": "0.7022075", "text": "function /* missing to */ trim /* a fucking */ (text) /* ???? */ {\n\treturn text.replace(/^\\s*|\\s*$/g, '');\n}", "title": "" }, { "docid": "8538887cb90de55cf0def48ef090e548", "score": "0.7021424", "text": "function collapseWhitespace(text) {\n\treturn text.replace(/\\s/,' ');\n}", "title": "" }, { "docid": "a9566cdaf55dbd0e060299fdec9fb7ff", "score": "0.7005254", "text": "function strtrim(text) {\r\n\t\t//Match spaces at beginning and end of text and replace\r\n\t\t//with null strings\r\n\t\treturn text.replace(/^\\s+/,'').replace(/\\s+$/,'');\r\n\t}", "title": "" }, { "docid": "afedc6240ceffd1f9e3ad9077d5683e5", "score": "0.7002927", "text": "function strip(s) { \n s = s.replace(/(^\\s*)|(\\s*$)/gi,\"\");\n s = s.replace(/[ ]{2,}/gi,\" \"); \n s = s.replace(/\\n /,\"\\n\"); return s;\n}", "title": "" }, { "docid": "598b96c263e4d8b2626969e17d8d7429", "score": "0.69698775", "text": "function nl2space( textToStrip ){\n\n var separator = \"§§§\";\n var lines = [];\n var linesLength = 0\n\n textToStrip = textToStrip.replace( /(\\r\\n|\\n|\\r)/gm, separator );\n textToStrip = textToStrip.replace( /\\>[\\n\\t\\r ]+\\</g, \"><\");\n textToStrip = trim( textToStrip, separator );\n lines = textToStrip.split( separator )\n\n linesLength = lines.length;\n\n for( var i=0; i < linesLength; i++ ){\n lines[i] = lines[i].trim();\n }\n\n textToStrip = lines.join(' ');\n\n return textToStrip;\n}", "title": "" }, { "docid": "c5992a89d3cd79be7559e9db4becc641", "score": "0.6952286", "text": "function trim( text ) {\n return text.replace(RE_TIDY_TRIM_WHITESPACE, PLACEHOLDER_STRING);\n }", "title": "" }, { "docid": "1cf817ee9acc1906c482cf20bfee152a", "score": "0.69482833", "text": "function stripTags(text) {\n return text ? text.replace(/<[^>]*>/g, \"\") : text;\n }", "title": "" }, { "docid": "15bdf8849432d67d047f98586389fc64", "score": "0.69453084", "text": "function strip(str) \n{\n return str.replace(/\\s+/, \"\");\n}", "title": "" }, { "docid": "46b73400abeb24e2174ec02c2fc60a57", "score": "0.69265264", "text": "function strip(str) {\n return str.replace(/\\s+/g, '');\n }", "title": "" }, { "docid": "087e9739c909fc7b17051780904862a6", "score": "0.6923439", "text": "static stripFormatting(txt) {\n return txt\n .replace(/\\s*<span.*?>([\\S\\s]*?)<\\/span>\\s*/g, '$1') // clear span tags\n .replace(/\\n/g,'') // clear newlines\n .replace(/<\\/div>[\\s\\n]*<div>/g, '</div><div>') // clear whitespace between div tags\n .replace(/<div><br.*?><\\/div>/g, '<div></div>') // convert <div><br/></div> to <div></div>\n .replace(/(<\\/?div>){1,2}/g,'\\n') // convert <div> boundaries to newlines\n .replace(/<br.*?>/g,'\\n') // convert <br> to newlines\n .replace(/<.*?>/g,'') // strip any remaining tags\n .replace(/\\u00A0/g, ' ') // non-breaking spaces to spaces\n .replace(/&nbsp;/g,' ') // &nbsp; -> ' '\n .replace(/&lt;/g,'<') // &lt; -> '<'\n .replace(/&gt;/g,'>') // &gt; -> '>'\n .replace(/&apos;/g,\"'\") // &apos; -> \"'\"\n .replace(/&quot;/g,'\"') // &quot; -> '\"'\n .replace(/&#124;/g, '|') // &#124; -> '|'\n .replace(/&amp;/g,'&') // &amp; -> '&'\n .replace(/^\\n/, '') // clear leading newline\n }", "title": "" }, { "docid": "fc3e222053f45356662a73b67b42d8c3", "score": "0.69081444", "text": "function trim( text ) {\n\t\treturn text.replace(RE_TIDY_TRIM_WHITESPACE, PLACEHOLDER_STRING);\n\t}", "title": "" }, { "docid": "fc3e222053f45356662a73b67b42d8c3", "score": "0.69081444", "text": "function trim( text ) {\n\t\treturn text.replace(RE_TIDY_TRIM_WHITESPACE, PLACEHOLDER_STRING);\n\t}", "title": "" }, { "docid": "4e07e1c5a80bc1b1dbc4e19eece05957", "score": "0.69020814", "text": "function trim( text ) {\r\n\t\treturn text.replace(RE_TIDY_TRIM_WHITESPACE, PLACEHOLDER_STRING);\r\n\t}", "title": "" }, { "docid": "4e07e1c5a80bc1b1dbc4e19eece05957", "score": "0.69020814", "text": "function trim( text ) {\r\n\t\treturn text.replace(RE_TIDY_TRIM_WHITESPACE, PLACEHOLDER_STRING);\r\n\t}", "title": "" }, { "docid": "aa4cb2a3a8702e49c93799f3d28b9413", "score": "0.6860018", "text": "function stripWhitespace (s)\n{ return stripCharsInBag (s, whitespace)\n}", "title": "" }, { "docid": "6f800670a5e24ae91ff08f195642a9f4", "score": "0.6851147", "text": "function stripAndCollapse( value ) {\r\n var tokens = value.match( /[^\\x20\\t\\r\\n\\f]+/g ) || [];\r\n return tokens.join( \" \" );\r\n }", "title": "" }, { "docid": "6f800670a5e24ae91ff08f195642a9f4", "score": "0.6851147", "text": "function stripAndCollapse( value ) {\r\n var tokens = value.match( /[^\\x20\\t\\r\\n\\f]+/g ) || [];\r\n return tokens.join( \" \" );\r\n }", "title": "" }, { "docid": "6f800670a5e24ae91ff08f195642a9f4", "score": "0.6851147", "text": "function stripAndCollapse( value ) {\r\n var tokens = value.match( /[^\\x20\\t\\r\\n\\f]+/g ) || [];\r\n return tokens.join( \" \" );\r\n }", "title": "" }, { "docid": "f9a2c3086043d13f2677ea331eda44a1", "score": "0.6838492", "text": "function omitWhitespace(string) {\n return string.replace(/\\W/g, '')\n}", "title": "" }, { "docid": "a35bd912a27066808c6b1989c0d25742", "score": "0.6822503", "text": "function stripAndCollapse( value ) {\n\tvar tokens = value.match( /[^\\x20\\t\\r\\n\\f]+/g ) || [];\n\treturn tokens.join( \" \" )\n}", "title": "" }, { "docid": "144539e5d5456dbd03383d874dfba2b9", "score": "0.6813947", "text": "function stripTags(text) {\r\n return text ? text.replace(/<[^>]*>/g, \"\") : text;\r\n}", "title": "" }, { "docid": "ceb622c3aa68b8a3e31d973d7fa542ec", "score": "0.6787844", "text": "function trimHTML5Spaces(input) {\n return input.replace(/^[ \\t\\r\\n\\f]+|[ \\t\\r\\n\\f]+$/g, '');\n }", "title": "" }, { "docid": "f16d0779f6f6c87f2a5cd6fac26e21fa", "score": "0.6763922", "text": "function scrub(text) {\n return text.replace(/[\\‘\\,\\“\\”\\\"\\'\\’\\-\\n\\â\\€]/g, ' ');\n}", "title": "" }, { "docid": "8173b4f2f3326421810dd314f8f6c731", "score": "0.6756131", "text": "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}", "title": "" }, { "docid": "8173b4f2f3326421810dd314f8f6c731", "score": "0.6756131", "text": "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}", "title": "" }, { "docid": "8173b4f2f3326421810dd314f8f6c731", "score": "0.6756131", "text": "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}", "title": "" }, { "docid": "8173b4f2f3326421810dd314f8f6c731", "score": "0.6756131", "text": "function stripAndCollapse(value){var tokens=value.match(rnothtmlwhite)||[];return tokens.join(\" \");}", "title": "" }, { "docid": "360f45ab96928bea79426318ff8c32d9", "score": "0.67478305", "text": "cleanString(text) {\n return text.toUpperCase().replace(/\\s/g, '');\n }", "title": "" }, { "docid": "2012ed06aa97eeee5c5c19453667d278", "score": "0.6746012", "text": "function removeNLWS(s) {\r\n\t\r\n\tvar r = \"\";\r\n\t\r\n\tif (s != null){\r\n\t\t// Firefox enters <br _moz_dirty=\"\" > for space or line break when we extract the the text from contentEditable div element\r\n\t\t// to take care of this issue we replaced <br> with /n in Mozilla browser.\r\n\t\t/*if ($.browser.mozilla) {if (s.search('/<br>/i')){s = s.replace('<br>', '\\n');}}*/\r\n\t\t\r\n\t\t// 1st remove NewLine, CarriageReturn and Tab characters from a String\r\n\t\tfor (var i=0; i < s.length; i++) {\r\n\t\t\tif (s.charAt(i) != '\\n' &&\r\n\t\t\t\ts.charAt(i) != '\\r' &&\r\n\t\t\t\ts.charAt(i) != '\\t') {\r\n\t\t\t\tr += s.charAt(i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t/*\r\n\t * Now replace the whitespace\r\n\t * logics behind the regular expression /^\\s+|\\s+$/g saying that find one ore more spaces at the start of the line, also one or more spaces at the end of a line, and replace them with ''.\r\n\t * / =start the regular expression\r\n\t * ^ =match the START of the line and then... \\s =match spaces + =one or more of them\r\n\t * | =OR (think of this as ALSO)\r\n\t * \\s =match spaces + =one or more of them... $ =to the END of the line / =end of the regular expression\r\n\t * g =GLOBAL (do this for EVERY MATCHING CASE) this will cause the expression to match the start, and then go on to the end. Otherwise it would quit after the first match (the start of the line).\r\n\t * \r\n\t */\r\n \r\n\tr = r.replace(/^\\s+|\\s+$/g, \"\");\r\n\t\r\n\t}\r\n\t\t\r\n\treturn r;\t \r\n}", "title": "" }, { "docid": "4cf687a729d2cbb8c93bb879245e1f16", "score": "0.67356706", "text": "function stripWhitespace (s)\n\n{\n return stripCharsInBag (s, whitespace)\n}", "title": "" }, { "docid": "0c8a222ee0bb8472e5e24cdb2bc347aa", "score": "0.6724607", "text": "function noSpace(x){\n return x.replace(/ /g, \"\")\n }", "title": "" }, { "docid": "6b555b4dc88a08d689cfe40ea526c193", "score": "0.67012817", "text": "function noSpace(x){\n return (x.replace(/\\s/g, ''));\n}", "title": "" }, { "docid": "c2335f0223c104f155ab8c13f4fd40ac", "score": "0.66865295", "text": "function strip_tags(text) {\n return text.replace(/(<([^>]+)>)/ig, \"\");\n}", "title": "" }, { "docid": "5ebe17102332f192064be18f08ef7e30", "score": "0.66732824", "text": "function _stripNonWhite(value){return value.replace(nonWhiteRegexp,'');}", "title": "" }, { "docid": "9fbd00a01ac37711b89cff3795a5a8ce", "score": "0.6660788", "text": "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "title": "" }, { "docid": "9fbd00a01ac37711b89cff3795a5a8ce", "score": "0.6660788", "text": "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "title": "" }, { "docid": "030f2e343fb38ff90f8a5a9dce3b60b1", "score": "0.6654222", "text": "trimFiller(str){\n\t\tstr = str.trim(); //Remove leading and trailing whitespaces\n\t\tstr = str.replace(/\\s/g, \"\"); //Remove all new lines\n\t\tstr = str.replace(/ +(?= )/g, \"\"); //Remove all white spaces\n\t\treturn str;\n\t}", "title": "" }, { "docid": "1922465ceb19c80b4b461a68eb38edaf", "score": "0.6646025", "text": "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "title": "" }, { "docid": "0cf038fd33d2933481cfbdd6e8d4d196", "score": "0.6639726", "text": "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "title": "" }, { "docid": "0cf038fd33d2933481cfbdd6e8d4d196", "score": "0.6639726", "text": "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "title": "" }, { "docid": "0cf038fd33d2933481cfbdd6e8d4d196", "score": "0.6639726", "text": "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "title": "" }, { "docid": "0cf038fd33d2933481cfbdd6e8d4d196", "score": "0.6639726", "text": "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "title": "" }, { "docid": "8dd3b5fc9dd2e7dd172e59bbe3d9aaa4", "score": "0.6632554", "text": "function cleanTextOnly(txt) {\n txt = txt.trim().replace(/\\@[\\w-\\(|\\)]+\\s/ig, \"\"); //.trim().replace(/\\@[\\w-]+\\s/ig, \"\");\n return txt;\n }", "title": "" }, { "docid": "221021eb5dd95d19864d71dc711671ce", "score": "0.6620773", "text": "strip(html) {\n html = html.replace('\\n\\n', ' ');\n html = html.replace('\\n', ' ');\n const tmp = document.createElement('DIV');\n tmp.innerHTML = html;\n return tmp.textContent || tmp.innerText || '';\n }", "title": "" }, { "docid": "be329e6dee256951bce2ef1e23af784c", "score": "0.6617474", "text": "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "title": "" }, { "docid": "391ff3003f12a6a2c229d90071c012f9", "score": "0.66085225", "text": "function normalizeSpaces(text)\n{\n // IE has already done this conversion, so doing it again will remove multiple nbsp\n if (browserVersion.isIE)\n {\n return text;\n }\n\n // Replace multiple spaces with a single space\n // TODO - this shouldn't occur inside PRE elements\n text = text.replace(/\\ +/g, \" \");\n\n // Replace &nbsp; with a space\n var pat = String.fromCharCode(160); // Opera doesn't like /\\240/g\n \tvar re = new RegExp(pat, \"g\");\n return text.replace(re, \" \");\n}", "title": "" }, { "docid": "d37ab4934c815e502c58c270b4ef1f80", "score": "0.66025525", "text": "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "title": "" }, { "docid": "942ccae88ee00b4a6d4743192f1252b0", "score": "0.6597596", "text": "strip() {\n this.list.forEach((ts) => {\n let t = ts.terms[ts.terms.length - 1];\n t.text = t.text.replace(/'s$/, '');\n t.unTag('Possessive', '.strip()');\n });\n return this;\n }", "title": "" }, { "docid": "942ccae88ee00b4a6d4743192f1252b0", "score": "0.6597596", "text": "strip() {\n this.list.forEach((ts) => {\n let t = ts.terms[ts.terms.length - 1];\n t.text = t.text.replace(/'s$/, '');\n t.unTag('Possessive', '.strip()');\n });\n return this;\n }", "title": "" }, { "docid": "98926acc1d3a8a15e9937a4c9c2cb542", "score": "0.65973014", "text": "function stripAndCollapse(value) {\n var tokens = value.match(rnothtmlwhite) || [];\n return tokens.join(\" \");\n }", "title": "" }, { "docid": "6548a0e6c96a5bdcb539fb9e9f2b1218", "score": "0.6596419", "text": "function stripAndCollapse( value ) {\n var tokens = value.match( rnothtmlwhite ) || [];\n return tokens.join( \" \" );\n }", "title": "" }, { "docid": "f7d373091bf18832ddc750d9f8a61d07", "score": "0.65717435", "text": "function strip_whitespace(string) {\n return string.replace(/[^a-zA-Z]/g, '');\n}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" }, { "docid": "888317f1cccb60f95a01a445b9d35a1d", "score": "0.6571119", "text": "function stripAndCollapse( value ) {\n\t\tvar tokens = value.match( rnothtmlwhite ) || [];\n\t\treturn tokens.join( \" \" );\n\t}", "title": "" } ]
7f317add22434ccaec922633a9775bcf
Insert text to element html
[ { "docid": "9831c9f9b30723f6bffbd5e94a251afa", "score": "0.6785625", "text": "innerText (text, el) {\n el.innerHTML = text;\n }", "title": "" } ]
[ { "docid": "b568c96d0da9f4af652659da6c365866", "score": "0.7224064", "text": "function insertTextNode(element, text){\n\t\telement.appendChild(doc.createTextNode(text));\n\t}", "title": "" }, { "docid": "b568c96d0da9f4af652659da6c365866", "score": "0.7224064", "text": "function insertTextNode(element, text){\n\t\telement.appendChild(doc.createTextNode(text));\n\t}", "title": "" }, { "docid": "7296868f65f347ec52d97771b81b72c0", "score": "0.6964652", "text": "function addTextToElement(element, text) {\n document.querySelector(element).textContent = text;\n}", "title": "" }, { "docid": "217cbaa5885e07fa2506b77244555633", "score": "0.689019", "text": "function modtext(tag){\n\tlet selection = document.getSelection();\n\tif (selection != \"\"){\n\t\tdocument.execCommand('insertHTML', false, `<${tag}>` + document.getSelection() + `</${tag}>`);\n\t}\n}", "title": "" }, { "docid": "78e47593fbea2052d5654321b5dc4dd7", "score": "0.6849544", "text": "function addText(aElem, aText) {\n aElem.appendChild(document.createTextNode(aText));\n }", "title": "" }, { "docid": "1f19172f5d9042916674642606cc66d4", "score": "0.6819245", "text": "function add_html_element(type, text){\n \tnew_element.appendChild(new_element_text);\n \n \treturn new_element;\n}", "title": "" }, { "docid": "3cad76876716f0b9644ace7de4a412f3", "score": "0.68069863", "text": "function insertText(element, text) {\n element.focus();\n if (typeof element.selectionStart == 'number') {\n var value = element.value;\n var selectionStart = element.selectionStart;\n element.value = value.slice(0, selectionStart) + text + value.slice(element.selectionEnd);\n element.selectionEnd = element.selectionStart = selectionStart + text.length;\n } else if (typeof document.selection != 'undefined') {\n var textRange = document.selection.createRange();\n textRange.text = text;\n textRange.collapse(false);\n textRange.select();\n }\n }", "title": "" }, { "docid": "a84fa5aa47e5e4cdbb98d256700c5655", "score": "0.6756239", "text": "function setText(el, text) {\n\tvar textNode = document.createTextNode(text);\n\tel.appendChild(textNode)\n}", "title": "" }, { "docid": "aa3e2df0a2cf998cb0acbdf1d369ce95", "score": "0.673897", "text": "function insertHTML() {\r\n let editor = EditorManager.getFocusedEditor();\r\n if (editor) {\r\n editor.document.setText(stringHTML);\r\n }\r\n }", "title": "" }, { "docid": "b5c4261678101edef0a53649577d6f25", "score": "0.6706798", "text": "function injectTextNode(parentElement, first, index, data) {\n\t\ttry {\n\t\t\tinsertNode(parentElement, first, index);\n\t\t\tfirst.nodeValue = data;\n\t\t} catch (e) {} //IE erroneously throws error when appending an empty text node after a null\n\t}", "title": "" }, { "docid": "52820de3687e8a1b42daab4653c70f2d", "score": "0.6657617", "text": "function replaceWText() {\n $('#randPara').html('<h1>Hello and click me.</h1>');\n}", "title": "" }, { "docid": "7064d52148bcaef3173279f0a5ead494", "score": "0.66314787", "text": "function insertHTML() {\n\t\t// Insert the new quote\n\t\tquoteBox.innerHTML = generatedQuote;\n\t}", "title": "" }, { "docid": "e4eca049513bd12a81e145f5b4efeacf", "score": "0.66229475", "text": "function myCustomSaveContent(element_id, html, body) {\r\n\tvar elm = document.getElementById(element_id);\r\n elm.parentNode.elements.namedItem('text').value = html;\r\n return html;\r\n}", "title": "" }, { "docid": "216cf7ae381e67f027b096da2465dc78", "score": "0.6609622", "text": "function insertIntoNode(node, html) {\n }", "title": "" }, { "docid": "62ed5d92f94db30879295fef44741234", "score": "0.6602993", "text": "function setInnerHTML(element, html) {\n element[innerHTML()] = html;\n }", "title": "" }, { "docid": "53514cfc4f4f814d31ed9eb71c4ba541", "score": "0.65888554", "text": "function insertText(text, resultRegion) \r\n{\r\n\t $(resultRegion).html(text);\r\n}", "title": "" }, { "docid": "9e5417ff8c494d510d0389e6b8e95910", "score": "0.657881", "text": "function insertHtml (selector, html) {\n var targetElem = document.querySelector(selector);\n targetElem.innerHTML = html;\n }", "title": "" }, { "docid": "fbb343e07c7870f95199d8bacd865da9", "score": "0.6578233", "text": "function setText(text) {\n if(element) {\n for(var i = 0; i < element.length; i++) {\n element[i].innerHTML = text ;\n }\n }\n }", "title": "" }, { "docid": "279c01b65fb04377cc4c35927eb8023a", "score": "0.65250033", "text": "function changeHtml(selector, text) {\r\n let el = K.qS(selector);\r\n if (el) {\r\n el.childNodes[0].nodeValue = text;\r\n }\r\n }", "title": "" }, { "docid": "4e4ef6336925e79e9a92e5b3361b4e91", "score": "0.6524557", "text": "function inject( txt ) {\n if ( !self.jqContentEditable.is(\":focus\") ) {\n\n self.jqContentEditable.focus();\n\n // place cursor at end of existing HTML\n document.execCommand('selectAll', false, null);\n document.getSelection().collapseToEnd();\n }\n\n txt = Y.dcforms.markdownToHtml( txt );\n document.execCommand( 'insertHTML', false, txt );\n\n // update element and FEM UI\n callWhenChanged( self.getMarkdown() );\n }", "title": "" }, { "docid": "fad4c79091148f43749a483d984118a8", "score": "0.651689", "text": "function setInnerHTML(element, html) {\n element[innerHTML()] = html;\n}", "title": "" }, { "docid": "177bf17089ae24993d50a88c58fa663f", "score": "0.6503813", "text": "function addHtmlElementContent(parent, child, tekst, id) {\n parent.appendChild(child);\n child.innerText = tekst;\n child.id = id;\n return child;\n}", "title": "" }, { "docid": "78c4fd3e5071ff96aae609fa697c9202", "score": "0.6472462", "text": "set text(text) {\n let myId = this.getAttribute(\"my-id\");\n let textBlock = document.querySelector(\"#note_\" + myId + \"_text\");\n\n if (textBlock !== null) {\n textBlock.innerText = text;\n } else {\n textBlock = document.createElement(\"p\");\n textBlock.setAttribute(\"id\", \"note_\" + myId + \"_text\");\n textBlock.innerText = text;\n this.appendChild(textBlock);\n }\n }", "title": "" }, { "docid": "52ad11f6bac129ca8f26de358fff5bd0", "score": "0.6470822", "text": "function insertElement(link, text, href) {\n var el = document.createElement(href ? 'a' : 'span');\n if (href) {\n el.href = href;\n }\n el.innerText = text;\n link.parentNode.insertBefore(el, link.nextElementSibling);\n }", "title": "" }, { "docid": "dd4829e4a980412a83145139be033a54", "score": "0.64452416", "text": "static add(text) {\n Content.addHTML($(`<span class=\"message\"></span>`).text(text));\n }", "title": "" }, { "docid": "063b839a19703e788c6060d53889603a", "score": "0.6437613", "text": "text(text) {\n return this.newMeta(function(){\n this.origin.content = text;\n this.origin.element.html(text);\n this.done();\n })\n }", "title": "" }, { "docid": "b42a8832e40d10a126c8e7f96032544e", "score": "0.6396022", "text": "function setContent(element, content) {\n element.textContent = content;\n}", "title": "" }, { "docid": "0fb90ffd3cfd214f52cf8ae6ee5d5300", "score": "0.6388664", "text": "function afterText() {\n var txt1 = \"<b>I </b>\"; // Create element with HTML \n var txt2 = $(\"<i></i>\").text(\"love \"); // Create with jQuery\n var txt3 = document.createElement(\"b\"); // Create with DOM\n txt3.innerHTML = \"jQuery!\";\n $(\"img\").after(txt1, txt2, txt3); // Insert new elements after <img>\n}", "title": "" }, { "docid": "feec0868f668eeb31d4e92387b63dae5", "score": "0.63581485", "text": "function htmlInsert(id, htmlData) {\r\n document.getElementById(id).innerHTML = htmlData;\r\n}", "title": "" }, { "docid": "73cfcc8cadb51067aab863b78e9a462e", "score": "0.6354003", "text": "function insertHtml (selector, html) {\n let targetElement = document.querySelector(selector);\n targetElement.innerHTML = html;\n }", "title": "" }, { "docid": "2f07b99b6cb2c05201e39c2be47c6f3c", "score": "0.6353081", "text": "function append(element, text)\n{\n element.innerHTML = element.innerHTML + text;\n}", "title": "" }, { "docid": "b968c372708b7cf34a9c0167b1d6408a", "score": "0.63352615", "text": "function appendNewElement(content, tag, parentElement) {\n var newElement = document.createElement(tag);\n newElement.textContent = content;\n parentElement.appendChild(newElement);\n}", "title": "" }, { "docid": "cccfec1faaf13e13883ff4d10c966835", "score": "0.6334413", "text": "function showNewText(text){\n firstText.innerHTML=`${text}`;\n gsap.to(\".m402-text-relative\",\n {\n duration:0.3,\n opacity:1\n });\n}", "title": "" }, { "docid": "ad939ec98e2486d9395dd9115e2030e3", "score": "0.63342285", "text": "function setInnerHTML(element, toValue)\n{\n\t// IE has this built in...\n\tif (typeof(element.innerHTML) != 'undefined')\n\t\telement.innerHTML = toValue;\n\telse\n\t{\n\t\tvar range = document.createRange();\n\t\trange.selectNodeContents(element);\n\t\trange.deleteContents();\n\t\telement.appendChild(range.createContextualFragment(toValue));\n\t}\n}", "title": "" }, { "docid": "789776116f037eab23b008cb869d2598", "score": "0.63323915", "text": "function tag(tag, text){\n //+= to append\n document.getElementById(\"content\").innerHTML += \n '<'+tag+'>' + text + '</'+tag+'>';\n}", "title": "" }, { "docid": "c1b8f12392d4896d7d641a98e8ba9b6e", "score": "0.6315397", "text": "function insertarInformacion(tagElegido,informacionInsertable){\n document.querySelector(tagElegido).innerHTML = informacionInsertable\n }", "title": "" }, { "docid": "36f939493c4382c84dc2a4e34aa1d035", "score": "0.6312178", "text": "function appendText(text, element, includeBreakBefore) {\n if (includeBreakBefore) {\n appendChild(element, \"br\");\n }\n element.appendChild(document.createTextNode(text));\n }", "title": "" }, { "docid": "9bad0371e810d3f777d8dff2d276a023", "score": "0.6310688", "text": "function setInnerTextOfSpan(span, text) {\n span.innerHTML = text;\n}", "title": "" }, { "docid": "ceaab804822fd4b5777b54c5780b91b7", "score": "0.631011", "text": "function setInnerText(element, text) {\n var textProperty = ('innerText' in element) ? 'innerText' : 'textContent';\n element[textProperty] = text;\n}", "title": "" }, { "docid": "f0021da2477cbd551d16a968bcc4b935", "score": "0.6262585", "text": "setText(text) {\n this.textDiv.innerHTML = text;\n }", "title": "" }, { "docid": "29dce041e1934d22f8dcdb25b7b5312b", "score": "0.62574893", "text": "function HTMLreplace(x){\n workelement.e.innerHTML = x;\n}", "title": "" }, { "docid": "d1feff1a1ab518c4c1908f78790dc62f", "score": "0.62541026", "text": "function addText( idElement, text ) {\r\n\tlet area = query( idElement );\r\n\tlet cursorPosition = area.selectionStart;\r\n\t// cursor position\r\n\tlet front = ( area.value ).substring( 0, cursorPosition );\r\n\tlet back = ( area.value ).substring( cursorPosition, area.value.length );\r\n\tarea.value = front + text + back;\r\n\t// update cursor position\r\n\tcursorPosition = cursorPosition + text.length;\r\n\tarea.selectionStart = cursorPosition;\r\n\tarea.selectionEnd = cursorPosition;\r\n\tarea.focus(); \r\n}", "title": "" }, { "docid": "30aaeb9e79049d011f019066366bf608", "score": "0.62396616", "text": "function setElementText(e, s) {\n removeChildren(e);\n e.appendChild(e.ownerDocument.createTextNode(s));\n}", "title": "" }, { "docid": "8c19de696cc8bd3b71dec158376fdf56", "score": "0.6228908", "text": "function htmlInsert(id, htmlData) {\n\tdocument.getElementById(id).innerHTML = htmlData;\n}", "title": "" }, { "docid": "8c19de696cc8bd3b71dec158376fdf56", "score": "0.6228908", "text": "function htmlInsert(id, htmlData) {\n\tdocument.getElementById(id).innerHTML = htmlData;\n}", "title": "" }, { "docid": "b42d7fd7b94d1a3463f206f56469246b", "score": "0.6228684", "text": "replaceUploadingText() {\n const textNode = document.getElementById('uploading-text');\n if (textNode) {\n const newSpan = document.createElement('span');\n newSpan.setAttribute('id', 'uploading-text');\n newSpan.innerHTML = this.uploadingText;\n newSpan.style.color = '#337ab7';\n textNode.parentNode.replaceChild(newSpan, textNode);\n }\n }", "title": "" }, { "docid": "7a91b629e403389d9caf3ac616244285", "score": "0.62241346", "text": "function addHTML(text)\n{\n //Grab the container div\n var start_div = document.getElementById('start');\n //make a new Div element\n var newElement = document.createElement('div');\n //add text to that div\n newElement.innerHTML = text;\n //append it to the main \n start_div.appendChild(newElement);\n}", "title": "" }, { "docid": "26437d93da8e1ceed8542d43f7322b22", "score": "0.62214535", "text": "function insertHTML(html, n) {\n\n var browserName = navigator.appName;\n\t \t \n\tif (browserName == \"Microsoft Internet Explorer\") {\t \n\t document.getElementById('wysiwyg' + n).contentWindow.document.selection.createRange().pasteHTML(html); \n\t} \n\t \n\telse {\n\t var div = document.getElementById('wysiwyg' + n).contentWindow.document.createElement(\"div\");\n\t\t \n\t\tdiv.innerHTML = html;\n\t\tvar node = insertNodeAtSelection(div, n);\t\t\n\t}\n\t\n}", "title": "" }, { "docid": "75aaed51985a8a86ad6e02ce98452611", "score": "0.62156427", "text": "function insertHtml(domElement, children){\n domElement.html(children);\n}", "title": "" }, { "docid": "75bcf70ad2fccbe48bcda0fc39c969c1", "score": "0.6207166", "text": "function insertText(){\n\n var test = document.getElementById('input1').value;\n var knoten = document.createElement('text');\n var inhalt = document.createTextNode(test);\n knoten.appendChild(inhalt);\n\n var divi = document.getElementById('test');\n divi.appendChild(knoten);\n}", "title": "" }, { "docid": "d1520fbd15117d39b3b4319e10152032", "score": "0.6206591", "text": "function appendText() {\n var txt1 = \"<p>Text.</p>\"; // Create element with HTML \n var txt2 = $(\"<p></p>\").text(\"Text.\"); // Create with jQuery\n var txt3 = document.createElement(\"p\"); // Create with DOM\n txt3.innerHTML = \"Text.\";\n $(\"body\").append(txt1, txt2, txt3); // Append the new elements \n}", "title": "" }, { "docid": "e4e519ea230308d490eddd39517ae623", "score": "0.6204598", "text": "function appendMsgToHTML(text){\n html = `\n <li class=\"searchbox__resultbox__inner__item\">\n ${text}\n </li>\n `;\n $(\".searchbox__resultbox__inner\").append(html);\n }", "title": "" }, { "docid": "b4df35decb1e7c2a04a3320be28ccbc6", "score": "0.6200589", "text": "function append(text) {\n const output = document.getElementById('output');\n output.innerHTML = output.innerHTML + \" \" + text;\n}", "title": "" }, { "docid": "f7cc0d8a2af94efc7c907a7caa759d70", "score": "0.62002313", "text": "function insertMarkup() {\n\tvar dom = dw.getDocumentDOM();\n \n\t//Current position of the cursor \n\tvar curPos = dom.getSelection()[0];\n\tvar docEl = dom.documentElement;\n\tvar docElOuterHTML = docEl.outerHTML;\n\tdocEl.outerHTML = docElOuterHTML.substring(0, curPos) + widgetMarkup + docElOuterHTML.substring(curPos);\n\n\tif (!checkForResources(dom)) {\n\t\t//Add resources if we're missing some\n\t\taddResources(dom);\n\t}\n\thighlightNode();\n}", "title": "" }, { "docid": "47507f9ba9a87eb622d99fcc153b4ca8", "score": "0.61962515", "text": "function addText() {\n document.querySelector(\"#elementoOndeVoceEsta\").firstElementChild.innerText =\n \"Testando aqui\";\n}", "title": "" }, { "docid": "71709070d0fbded42f3a424cec19577a", "score": "0.61863524", "text": "function setTextNode(node, text) {\r\n node.innerHTML = text;\r\n}", "title": "" }, { "docid": "0eeaef25a5fc19015efb7272c9d286d3", "score": "0.61790013", "text": "function pasikeisTekstas() {\n document.querySelector('h1').innerHTML = 'Pakeistas';\n document.querySelector('h1').innerHTML += ' h1 elementas 1234';\n}", "title": "" }, { "docid": "9b38d4b2b4a176e6b84c17546e239e98", "score": "0.6178684", "text": "function text(el, str) {\n if (el.textContent) {\n el.textContent = str;\n } else {\n el.innerText = str;\n }\n }", "title": "" }, { "docid": "46d6a0b71f0fd7902fc0672712bb3a82", "score": "0.6168872", "text": "function setText(element,text){\n\tvar name=document.getElementById(element);\n\tif(name){\n\t\twhile ( name.firstChild) name.removeChild( name.firstChild );\n\t\tname.appendChild(document.createTextNode(text));\n\t}\n}", "title": "" }, { "docid": "a7677f3a0fe1d9a1a22dc48c0094943f", "score": "0.6165988", "text": "function insertText(currentText, newText) {\n return currentText + newText\n}", "title": "" }, { "docid": "7133581d5b881d844708ecc44c38e18c", "score": "0.6152011", "text": "function appendNewElement(content, tag, parentElement) {\n let newElement = document.createElement(tag);\n newElement.textContent = content;\n parentElement.appendChild(newElement);\n}", "title": "" }, { "docid": "a58704ac2705ab64fc469a39ef709491", "score": "0.61448914", "text": "function modifyText(target, textToAdd){\n let targetElement = document.querySelectorAll(target);\n for (let i = 0; i < targetElement.length; i++){\n targetElement[i].innerText = textToAdd;\n }\n }", "title": "" }, { "docid": "16183376439aa5f1d5b7cb89bed93448", "score": "0.6126441", "text": "function setInnerHTML(element, html) {\n element[innerHTML()] = isRealElement(html) ? html[innerHTML()] : html;\n}", "title": "" }, { "docid": "d025eccc8bac9fe798d0af00e72f94dd", "score": "0.6124836", "text": "function setElementText(element, text) {\n // For IE<10.\n if ($('div#oldienotice').is(\":visible\")) {\n // IE<10 do not support white-space:pre-wrap; so we have to do this BIG UGLY STINKING THING.\n element.text(text.replace(/\\n/ig,'{BIG_UGLY_STINKING_THING__OH_GOD_I_HATE_IE}'));\n element.html(element.text().replace(/{BIG_UGLY_STINKING_THING__OH_GOD_I_HATE_IE}/ig,\"\\r\\n<br>\"));\n }\n // for other (sane) browsers:\n else {\n element.text(text);\n }\n}", "title": "" }, { "docid": "9793ab32d39911f2ff960eb821820f7b", "score": "0.61037457", "text": "function insertAdjacentHTML(parent = document.body, type = 'afterbegin', htmlText){\n const tempParent = document.createElement('div');\n tempParent.innerHTML = htmlText;\n const element = tempParent.firstChild;\n\n switch(type){\n case 'beforeend' : {\n parent.appendChild(element);\n break;\n }\n case 'beforebegin' : {\n parent.parentElement.insertBefore(element, parent);\n break;\n }\n case 'afterbegin' : {\n if(parent.hasChildNodes()){\n parent.insertBefore(element, parent.firstChild);\n }else{\n parent.appendChild(element);\n }\n break;\n }\n case 'afterend' : {\n parent.after(element);\n break;\n }\n }\n}", "title": "" }, { "docid": "b12824f21e70413c5bc8e176eabba9d0", "score": "0.6086096", "text": "set text(t){\n //prevent overwriting nodes\n if (this.container.childElementCount==0) this.container.innerText=t;\n }", "title": "" }, { "docid": "25a48d74e86a4d72f3d31d3131a5af7b", "score": "0.60717195", "text": "function insert_variable_html(text) {\n\tvar inst = tinyMCE.getInstanceById(\"body_text\");\n\tif (inst)\n inst.getWin().focus();\n\tinst.execCommand('mceInsertRawHTML', false, text);\n}", "title": "" }, { "docid": "257b01f8ac9fc81db2188da4d54317ba", "score": "0.6061623", "text": "function addText(theElement, customClass) {\n\tvar createText = document.createElement('div');\n\tcreateText.setAttribute('class', 'text');\n\n\ttheElement.appendChild(createText);\n}", "title": "" }, { "docid": "6404ebc89533ab28c7b9e8ef59622b1e", "score": "0.6056988", "text": "function insertHTML(szHTML) {\n\tvar sType;\n\tvar sel = theEditor.GetSelection();\n\tsType = sel.type;\n\tif (theEditor.bMode) {\n\t\tif (sType==\"Control\") {\n\t\t\tsel.item(0).outerHTML = szHTML;\n\t\t} else {\n\t\t\tsel.pasteHTML(szHTML);\n\t\t}\n\t} else {\n\t\tsel.text = szHTML\n\t}\n}", "title": "" }, { "docid": "00129f89d9e85350e14c83e849742ba4", "score": "0.60549766", "text": "function setTiedText(name, text) {\n\t\tvar tiedElements = getTiedElements(name);\n\t\tfor (var i = 0; i < tiedElements.length; i++) {\n\t\t\ttiedElements[i].textContent = text;\n\t\t};\n\t}", "title": "" }, { "docid": "d99d9079c10b6e877020b9d80110a7c3", "score": "0.60544", "text": "function boldText() {\n document.getElementById('msg').value += '<b> </b>';\n}", "title": "" }, { "docid": "61d49d95d26b27c7a16355b1c951ed6f", "score": "0.6054125", "text": "function replaceText(elementValue, stringValue) {\n elementValue.textContent = stringValue;\n \n}", "title": "" }, { "docid": "951e89077d486955c7ea3c73eac025e4", "score": "0.60475016", "text": "function placeText(text) {\n if (text instanceof Function) {\n // Evaluate function arguments\n text = text()\n }\n\n // The only good way to do this is to make some fake DOM nodes.\n // See https://stackoverflow.com/a/5251551\n \n let parent = document.createElement('div')\n parent.innerText = text\n return parent.innerHTML\n}", "title": "" }, { "docid": "1f4a845f3acc8d6cee4bf92385b95e07", "score": "0.6042613", "text": "function setInnerHTML(element, innerHTML) {\n element.innerHTML = innerHTML;\n }", "title": "" }, { "docid": "257040a339372c5f0f4ed3f114f2efbc", "score": "0.6039319", "text": "function setHTML()\r\n{\r\n editor().innerHTML=txthtml().innerText;\r\n}", "title": "" }, { "docid": "0ee26f24e22e8f49ea25ade37ba6d07d", "score": "0.6037549", "text": "function text(el, str) {\n if (el.textContent) {\n el.textContent = str;\n } else {\n el.innerText = str;\n }\n}", "title": "" }, { "docid": "0ee26f24e22e8f49ea25ade37ba6d07d", "score": "0.6037549", "text": "function text(el, str) {\n if (el.textContent) {\n el.textContent = str;\n } else {\n el.innerText = str;\n }\n}", "title": "" }, { "docid": "0ee26f24e22e8f49ea25ade37ba6d07d", "score": "0.6037549", "text": "function text(el, str) {\n if (el.textContent) {\n el.textContent = str;\n } else {\n el.innerText = str;\n }\n}", "title": "" }, { "docid": "4b94181dda622afd2c065f5f23f3508d", "score": "0.603198", "text": "function insertTextAtCursor(element, text)\r\n{\r\n // If the element is read only, don't allow editing it\r\n if (element.readOnly)\r\n return;\r\n \r\n // This determines which browser we're on, and caches a few variables\r\n var val = element.value, endIndex, range, doc = element.ownerDocument;\r\n if (typeof element.selectionStart == \"number\" && typeof element.selectionEnd == \"number\")\r\n {\r\n // Basically just append the text before the selection, then our text, and then the text after the selection\r\n // This effectively replaces the selection\r\n var startIndex = element.selectionStart;\r\n var endIndex = element.selectionEnd;\r\n element.value = val.slice(0, startIndex) + text + val.slice(endIndex);\r\n element.selectionStart = startIndex + text.length;\r\n element.selectionEnd = element.selectionStart;\r\n }\r\n else if (doc.selection != \"undefined\" && doc.selection.createRange)\r\n {\r\n // Other browsers have a more compact way of replacing selection text\r\n element.focus();\r\n var range = doc.selection.createRange();\r\n range.collapse(false);\r\n range.text = text;\r\n range.select();\r\n }\r\n}", "title": "" }, { "docid": "b3684a5b465c42567c4076e2dda87269", "score": "0.6025012", "text": "function setChildTextNode(elementId, text) {\n document.getElementById(elementId).innerText = text;\n}", "title": "" }, { "docid": "13c8ec559a72a418e863917169fd1b93", "score": "0.6022028", "text": "function text(element, text, color, size, weight, padding, cc) {\n\telement.childNodes[1].innerHTML += text;\n\telement.childNodes[1].style.color = color;\n\telement.childNodes[1].style.fontSize = size;\n\telement.childNodes[1].style.fontWeight = weight;\n\telement.childNodes[1].style.padding = padding;\n\tif (cc !== undefined) {\n\t\telement.childNodes[1].className += ' ' + cc;\n\t}\n}", "title": "" }, { "docid": "0606cfd86df59fe0699d35041dcbcc7a", "score": "0.6018542", "text": "set(text, contentNum, selector) {\n var el = $(contentSetter.selectorPrefix + (selector || '')).contents()[contentNum];\n if (el) el.textContent = text;\n }", "title": "" }, { "docid": "83bb02c39453fc4eaee847d2841b08e4", "score": "0.6012538", "text": "function clicou() {\n document.getElementById(\"agradecimento\").innerHTML = \"Obrigado por clicar\";\n console.log(document.getElementById(\"agradecimento\").innerHTML = \"<b>Obrigado por clicar</b>\") //injetando text html\n //alert(\"Obrigado por clicar\")\n}", "title": "" }, { "docid": "cde2c67d66b8cbbe8ec1b29b2c42722f", "score": "0.601127", "text": "insertElement(text) {\n let errorDiv = document.getElementById(\"errorMessage\");\n var newDiv = document.createElement(\"li\");\n var content = document.createTextNode(text);\n newDiv.appendChild(content);\n errorDiv.appendChild(newDiv);\n }", "title": "" }, { "docid": "9ae75955fcef9beb5a13aceec1e7e846", "score": "0.6009023", "text": "function insertTag(tagName) {\n\tvar tag = \"<\" + tagName +\"></\" + tagName + \">\";\n\n\t$(\"#note-text\").insertAtCaret(tag);\n}", "title": "" }, { "docid": "699882090f29192da75450cc082481d0", "score": "0.60016626", "text": "function createAndAppend(element, parent, options = {}){\n let el = document.createElement(element);\n parent.appendChild(el);\n Object.entries(options).forEach(([key, value]) => {\n if(key === 'text'){\n el.textContent === value \n }else{\n el.setAttribute(key, value)\n }\n })\n }", "title": "" }, { "docid": "0a94bc23230d836b09daca8037b1da50", "score": "0.6001648", "text": "setTextHTML(text) {\n\n\t\tif (!text || text.length === 0) { // If empty text\n\t\t\tthis.clearText();\n\t\t\treturn;\n\t\t}\n\n\t\tthis.m_text.innerHTML = text;\n\t\tthis.m_text.style.padding = this.m_lightBoxTextPadding + 'px';\n\t}", "title": "" }, { "docid": "592a53ba1dc89578ba5edb1bf88adf47", "score": "0.6000552", "text": "function setText(tagToSet, valueToSet) {\n tagToSet.nodeValue = valueToSet\n }", "title": "" }, { "docid": "47b84c429fac8b1609b749b6b26870a7", "score": "0.6000494", "text": "function addTextElement(tag, attribute, value, famousPeopleContainer, text) {\n var element = document.createElement(tag);\n element.setAttribute(attribute, value);\n famousPeopleContainer.appendChild(element);\n element.textContent = text;\n return element;\n}", "title": "" }, { "docid": "20141f818a25bdf7468980dd90f6820e", "score": "0.599221", "text": "function setTextToContentLayer(id, content) {\r\n $(id + \"_content\").innerHTML = content;\r\n}", "title": "" }, { "docid": "f4bab8b72f931e52bd0f0c7b40860987", "score": "0.599175", "text": "function _setInnerText(element, value){\r\n if (document.body.innerText){\r\n element.innerText = value;\r\n }else{\r\n element.textContent = value;\r\n }\r\n}", "title": "" }, { "docid": "e5fe98c9c4dbba26053224df22b8e0b4", "score": "0.59912515", "text": "function vimofy_set_innerHTML(el,val)\r\n{\r\n\tdocument.getElementById(el).innerHTML = val;\r\n}", "title": "" }, { "docid": "92e8e69df54bbebaf8c597a3bb7474f8", "score": "0.59856045", "text": "text$(item){\n\t\t\n\t\tif (!(this.$text)) {\n\t\t\t\n\t\t\tthis.$text = this.insert$(item);\n\t\t} else {\n\t\t\t\n\t\t\tthis.$text.textContent = item;\n\t\t}\t\treturn;\n\t}", "title": "" }, { "docid": "3775d1646de94a352ae595c892bbf3f4", "score": "0.59829104", "text": "function addText(elId,text) {\r\n\t\tdocument.getElementById(elId).value += text;\r\n }", "title": "" }, { "docid": "b7e9082e450355431988360bdc542a62", "score": "0.59823406", "text": "function replaceText (node, value) { node.textContent = value }", "title": "" }, { "docid": "816741fa71ca528834a20e34ec6123ef", "score": "0.5979776", "text": "display_text(text){\n return;\n let info = $(this._selectors[\"form\"].querySelector(\"label#info\"));\n info.html(text);\n }", "title": "" }, { "docid": "d3cceb1c99754e28ffd36fe5461a20cf", "score": "0.5976745", "text": "function addTextToDom(generatedText) {\n const resultsNode = document.querySelector(\"#results\");\n resultsNode.innerHTML = \"\";\n resultsNode.appendChild(generatedText);\n}", "title": "" }, { "docid": "180ea8334278000d46d0c86ddbba5579", "score": "0.59653026", "text": "update(txt) {\n this.domElement.innerText = txt;\n }", "title": "" }, { "docid": "2944e8ea106349fdc13d4496b79b0989", "score": "0.59637713", "text": "function create_elem(tag, text) {\n var element = document.createElement(tag);\n element.textContent = text;\n return element;\n }", "title": "" }, { "docid": "cc3595946d1d74bada283950eb0ac184", "score": "0.59614676", "text": "function addText (id, text) {\n var current = getText (id);\n var newText = current + text;\n setText (id, newText);\n}", "title": "" } ]
8553d2e46cf042facb13c5a9903493b6
Populates the table identified by id parameter with the specified data and format
[ { "docid": "64da090d781db086298c40b290675578", "score": "0.0", "text": "function createTable(table, info, formatter, defaultSorts, seriesIndex, headerCreator) {\n var tableRef = table[0];\n\n // Create header and populate it with data.titles array\n var header = tableRef.createTHead();\n\n // Call callback is available\n if(headerCreator) {\n headerCreator(header);\n }\n\n var newRow = header.insertRow(-1);\n for (var index = 0; index < info.titles.length; index++) {\n var cell = document.createElement('th');\n cell.innerHTML = info.titles[index];\n newRow.appendChild(cell);\n }\n\n var tBody;\n\n // Create overall body if defined\n if(info.overall){\n tBody = document.createElement('tbody');\n tBody.className = \"tablesorter-no-sort\";\n tableRef.appendChild(tBody);\n var newRow = tBody.insertRow(-1);\n var data = info.overall.data;\n for(var index=0;index < data.length; index++){\n var cell = newRow.insertCell(-1);\n cell.innerHTML = formatter ? formatter(index, data[index]): data[index];\n }\n }\n\n // Create regular body\n tBody = document.createElement('tbody');\n tableRef.appendChild(tBody);\n\n var regexp;\n if(seriesFilter) {\n regexp = new RegExp(seriesFilter, 'i');\n }\n // Populate body with data.items array\n for(var index=0; index < info.items.length; index++){\n var item = info.items[index];\n if((!regexp || filtersOnlySampleSeries && !info.supportsControllersDiscrimination || regexp.test(item.data[seriesIndex]))\n &&\n (!showControllersOnly || !info.supportsControllersDiscrimination || item.isController)){\n if(item.data.length > 0) {\n var newRow = tBody.insertRow(-1);\n for(var col=0; col < item.data.length; col++){\n var cell = newRow.insertCell(-1);\n cell.innerHTML = formatter ? formatter(col, item.data[col]) : item.data[col];\n }\n }\n }\n }\n\n // Add support of columns sort\n table.tablesorter({sortList : defaultSorts});\n}", "title": "" } ]
[ { "docid": "3a8c81e4a2b8e9d60257ea2a367d9d3a", "score": "0.62515014", "text": "function set_table_data(data,tbl_id){\n var result=\"\";\n for(var i =0; i < data.length;i++){\n result +='<tr>';\n result +='<td>'+(i+1)+'</td>';\n result +='<td>'+data[i].faculty+'</td>';\n result +='<td>'+data[i].course+'</td>';\n result +='<td>'+data[i].totalFee+'</td>';\n result +=\"<td>\";\n if(data[i].fyid){\n result += \"<a href='#' class='f_fee-edit smBtn ' id='\" + data[i].fyid + \"'>Edit</a>\";\n result += \"<a href='#' class='f_fee-delete smBtn-d' id='\" + data[i].fyid + \"'>delete</a>\";\n }else{\n result += \"<a href='#' class='s_fee-edit smBtn ' id='\" + data[i].syid + \"'>Edit</a>\";\n result += \"<a href='#' class='s_fee-delete smBtn-d' id='\" + data[i].syid + \"'>delete</a>\"; \n }\n result +=\"</td>\";\n result +='</tr>';\n }\n document.getElementById(tbl_id).innerHTML=result;\n }", "title": "" }, { "docid": "99ad1fa70222c06a236f37ee3d71d8df", "score": "0.61907953", "text": "function populateTable(data,datasetBody){\n data.forEach((rowData) => {\n var row = datasetBody.append(\"tr\");\n Object.entries(rowData).forEach(([key, value]) => {\n // round abv to 4 decimal places\n if (key === 'abv' && value !== null ){\n value = value.toFixed(4);\n }\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "9a353bb35c12665c97c26ef9ed122565", "score": "0.6108022", "text": "function appendDataToTable(tableId, data = DEFAULT_TABLE_DATA, id = rowCount) {\n // Gets table element with the help of tableId\n let table = getElement(tableId);\n\n // Analyzes given table data and returns an appropriate value\n let finalData = checkTableDataStructure(data);\n\n // Return null if data is invalid\n if (finalData == null) return;\n\n // Adds head values to each row if initialized\n if (finalData.head != null) {\n // Initiates a new table row element\n let tableRow = createElement(\"tr\", \"\", \"row\");\n\n // Loops through finalData.head and creates new head rows\n for (let j = 0; j < finalData.head.length; j++) {\n // Initialization of table row head element\n let tableHead = createElement(\"th\");\n\n // Aligns head to the center if value type is checkbox\n if (finalData.data[j].values.type != DataValueTypes.Text)\n tableHead.className = \"center\";\n\n // Sets table row head value to finalData.head with given index\n tableHead.innerHTML = finalData.head[j];\n\n // Appends table row head to table row\n tableRow.appendChild(tableHead);\n }\n\n // Appends current row to the table\n table.appendChild(tableRow);\n }\n\n // Counts each checkbox in one row\n let checkBoxColCount = 1;\n let textValueColCount = 1;\n\n // Custom row id\n const rowId = id = rowCount ? `AA-${id}` : id;\n\n // Initiates a new table row element\n let tableRow = createElement(\"tr\", rowId);\n\n // Loops through data for each row and creates a new row data element\n for (let j = 0; j < finalData.data.length; j++) {\n // Initiates a new table data element\n let tableData = createElement(\"td\");\n\n // Checks the data values \"type\" datatype\n switch (finalData.data[j].values.type) {\n case DataValueTypes.Text:\n // Custom text id\n let textId = `${rowId}-T-${textValueColCount}`;\n\n // Assigns custom id to text value or table data\n tableData.setAttribute(\"id\", textId);\n\n /* Assigns text onclick function and attribute to current\n * finalData.data[j].values.onclick function\n */\n tableData.onclick = (e) => finalData.data[j].values.onclick(textId, e);\n\n // Assign inner HTML value to current finalData.data value\n tableData.innerHTML = finalData.data[j].values.value;\n\n /* Increment by one for existance \n * of text value in a column\n */\n textValueColCount++;\n break;\n case DataValueTypes.Checkbox:\n // Custom checkbox id\n let checkBoxId = `${rowId}-CB-${checkBoxColCount}`;\n\n // Initialize a new input or checkbox element\n let checkBox = createElement(\"input\", checkBoxId, \"center\");\n\n // Sets tabla data attribute/s\n checkBox.setAttribute(\"type\", \"checkbox\");\n\n // Sets default value for checkbox\n if (finalData.data[j].values.value == CheckBoxValues.ON)\n checkBox.setAttribute(\"checked\", true);\n\n /* Assigns checkbox onclick function and attribute to\n * current finalData.data[j].values.onclick function\n */\n checkBox.onclick = function(e) {\n // Add or remove \"checked\" attribute \n if (checkBox.checked)\n checkBox.setAttribute(\"checked\", true);\n else\n checkBox.removeAttribute(\"checked\");\n\n // Execute passed function value\n finalData.data[j].values.onclick(checkBoxId, e);\n }\n\n /* Increment by one for existance \n * of checkbox in a column\n */\n checkBoxColCount++;\n\n // Append checkbox to current row data\n tableData.appendChild(checkBox); \n break;\n }\n\n // Appends data to current row\n tableRow.appendChild(tableData);\n }\n\n // Increment row count\n rowCount++;\n\n // Appends current row to the table\n table.appendChild(tableRow);\n}", "title": "" }, { "docid": "e8f5dfe570a8392596494e6aa0bd6be7", "score": "0.6100975", "text": "function insertTableData(tableId, data = DEFAULT_TABLE_DATA) {\n // Loops through and adds row based on current index of iteration\n for (var i = 0; i < data.length; i++) {\n // Append fetched data to user table\n appendDataToTable(tableId, data[i]);\n }\n}", "title": "" }, { "docid": "0a52c0fc3f587581af25a56350e5af5b", "score": "0.6066494", "text": "function fillTable(data) {\n table.html(\"\");\n\n data.forEach(dataRow => {\n var row = table.append('tr');\n\n Object.values(dataRow).forEach(val => {\n var cell = row.append('td');\n\n cell.text(val);\n });\n });\n}", "title": "" }, { "docid": "eeded41d3a03808305628c8ff98045a7", "score": "0.60569084", "text": "function createTable(data) {\n // This line clears any previous text. If the line is not present \n // the function will append everything at the end of the table\n tbody.text(\"\");\n data.forEach(function(ufo_report) {\n // Append table rows \n row = tbody.append(\"tr\");\n Object.entries(ufo_report).forEach(function([key,value]) {\n // Append 1 cell per sighting value\n cell = row.append(\"td\");\n // Update each cell's text\n cell.text(value);\n })\n})\n}", "title": "" }, { "docid": "0fdc37caa41f9090b7bfb1befb89431c", "score": "0.6053096", "text": "function populateTable(tdata) {\n \n // Clear any table data if it exists\n tbody.html(\"\")\n\n // Append each piece of data to it's own row and then cell\n tdata.forEach(function(ufoReport) {\n // console.log(ufoReport);\n var row = tbody.append(\"tr\");\n Object.entries(ufoReport).forEach(function([key, value]) {\n // console.log(key, value);\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "3a2ca6960e19ab8c15cc3fb668bf00f3", "score": "0.5996611", "text": "function fillTable(data){\n tbody.html(\"\");\n data.forEach(dataRow => {\n row =tbody.append(\"tr\");\n\n Object.entries(dataRow).forEach(function([key, value]){\n cell = row.append(\"td\").text(value)\n });\n });\n}", "title": "" }, { "docid": "a04922936c39f4488b308c09da482869", "score": "0.59699124", "text": "function fill_table(par) {\n // console.log('Paso 3 ', par);\n let largo = $('#tblExchanges tbody tr td').html();\n largo == 'Ningún dato disponible en esta tabla' ? $('#tblExchanges tbody tr').remove() : '';\n par = JSON.parse(par);\n\n let tabla = $('#tblExchanges').DataTable();\n if(mthseries==1){\n tabla.row\n .add({\n editable: `<i class=\"fas fa-times-circle kill\"></i>`,\n prod_sku: `<span class=\"hide-support\" id=\"SKU-${par[0].sersku}\"></span>${par[0].sersku.slice(0, 10)}-${par[0].sersku.slice(10, 13)}`,\n prodname: par[0].prodnme,\n prodcant: `<span>${par[0].prodqty}</span>`,\n prodcost: par[0].sercost, \n prodseri: par[0].prodser,\n prodpeti: par[0].serpetimp,\n prodimpo: par[0].sercostimp,\n costtota: par[0].sercosttot,\n codexcsc: par[0].excodsr,\n stnamesc: par[0].stnmesr,\n provname: par[0].provname,\n factname: par[0].factname,\n prodmarc: par[0].serbran,\n numecono: par[0].sernumeco,\n comments: `<div>${par[0].comment}</div>`\n })\n .draw();\n\n $(`#SKU-${par[0].sersku}`).parent().parent().attr('data-content', par[0].support);\n } else{\n tabla.row\n .add({\n editable: `<i class=\"fas fa-times-circle kill\"></i>`,\n prod_sku: `<span class=\"hide-support\" id=\"SKU-${par[0].sersku}\"></span>${par[0].sersku.slice(0, 10)}-${par[0].sersku.slice(10, 13)}`,\n prodname: par[0].prodnme,\n prodcant: `<span>${par[0].prodqty}</span>`,\n prodcost: par[0].sercost, \n prodseri: '<input class=\"serprod fieldIn\" type=\"text\" id=\"PS-' + par[0].prodser + '\" value=\"' + par[0].prodser + '\">',\n prodpeti: par[0].serpetimp,\n prodimpo: '<input class=\"sercpet fieldIn\" type=\"text\" id=\"PS-' + par[0].sercostimp + '\" value=\"' + par[0].sercostimp + '\">',\n costtota: par[0].sercosttot,\n codexcsc: par[0].excodsr,\n stnamesc: par[0].stnmesr,\n provname: par[0].provname,\n factname: par[0].factname,\n prodmarc: par[0].serbran,\n numecono: '<input class=\"serecono fieldIn\" type=\"text\" id=\"PS-' + par[0].sernumeco + '\" value=\"' + par[0].sernumeco + '\">',\n comments: `<div>${par[0].comment}</div>`\n })\n .draw();\n\n $(`#SKU-${par[0].sersku}`).parent().parent().attr('data-content', par[0].support);\n }\n\n btn_apply_appears();\n\n $('.edit')\n .unbind('click')\n .on('click', function () {\n tabla.row($(this).parent('tr')).remove().draw();\n btn_apply_appears();\n });\n}", "title": "" }, { "docid": "aca0e389bd73ca787f5398b6e1fe89eb", "score": "0.5965447", "text": "function build_formats_table() {\n var c = {};\n\n c.table_id = 'formats_table';\n c.columns = ['id', 'title', 'description', 'type', 'code', 'role', 'date_available_from', 'date_available_till', 'edit', 'publish', 'delete'];\n c.data_source = '/admin/products/ajax_discount_get_all_formats/';\n c.edit_class = 'edit-format';\n c.delete_class = 'delete';\n c.delete_url = '/admin/products/ajax_discount_delete_format/';\n c.publish_class = 'publish';\n c.publish_url = '/admin/products/ajax_discount_toggle_format_publish_option/';\n c.f_on_success = 'build_formats_table';\n c.f_on_completion = 'update_rate_section';\n c.warning_message = 'This action is <strong>irreversible</strong>! Please confirm you want to delete the selected format.';\n c.objects_array = 'format_objects';\n\tDYNAMIC_TABLE.build(c);\n}", "title": "" }, { "docid": "43a557060d1eeb5a98d164074f0e3c1c", "score": "0.58834773", "text": "function loadData(data){\n // To add Data table to the page\n data.forEach(record => {\n // to append table row `tr` for each record\n var row = tbody.append(\"tr\");\n // to append cells for each value in the record\n Object.values(record).forEach(value => {\n var cell = row.append(\"td\").text(value);\n });\n \n});\n}", "title": "" }, { "docid": "dff9421b733e86d1637e0a47b6dd62e8", "score": "0.5878074", "text": "function init() {\n tableData.forEach((obj) => {\n obj.uid = genUID();\n });\n\n tableRender(tableData, ['datetime', 'city', 'state', 'country', 'shape', 'durationMinutes', 'comments']);\n}", "title": "" }, { "docid": "30ae93b4ef670effdae67868788d4b2b", "score": "0.5863454", "text": "function fillDataTable(data, tableID) {\n let table = document.querySelector(`#${tableID}`);\n if (!table) {\n console.error('Table is not found')\n return;\n }\n // Add new user row to the table\n let tBody = table.querySelector(\"tBody\"); // console.log(tBody);\n tBody.innerHTML = \"\";\n let newRow = newUserRow();\n tBody.appendChild(newRow);\n\n for (let row of data) {\n let tr = createAnyElement(\"tr\");\n for (let k of keys) {\n let td = createAnyElement(\"td\")\n let input = createAnyElement(\"input\", {\n class: \"form-control\",\n value: row[k],\n name: k\n });\n if (k == \"id\") {\n input.setAttribute(\"readonly\", true);\n }\n td.appendChild(input)\n tr.appendChild(td);\n }\n let btnGroup = createeBtnGroup(); // console.log(tr);\n tr.appendChild(btnGroup);\n tBody.appendChild(tr);\n }\n}", "title": "" }, { "docid": "e33423e22b932c14cca5f2dec8102924", "score": "0.5859515", "text": "function createTable(data){\n // Clear table for new data\n tbody.html(\"\");\n data.forEach(dataRow => {\n console.table(dataRow);\n let row = tbody.append(\"tr\");\n\n console.table(Object.values(dataRow));\n Object.values(dataRow).forEach((val) => {\n let cell = row.append(\"td\");\n cell.text(val);\n });\n });\n}", "title": "" }, { "docid": "0eff2e5c4f398a7c9778aa24c49007ca", "score": "0.58553416", "text": "function make_table(tableData) {\n tableData.forEach((item) => {\n // append new rows into table\n var row = table.append(\"tr\");\n // insert values from data.js into each new row\n Object.values(item).forEach((value) => {\n // append new cells inside of rows\n var cell = row.append(\"td\");\n // insert values from each object into each new cell\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "a98fa929016351643b5c12540a8d754e", "score": "0.5837947", "text": "function fillTable($table, data){\n //Fragment use for efficiency as dom manipulation is costy\n var $frag = $(document.createDocumentFragment());\n\n $.each(data, function(row_index, row_data) {\n var $row = createJQObjectNoText(\"<tr>\", {}, $frag);\n\n $.each(row_data, function(cell_index, cell_data) {\n var $cell = createJQObject(\"<td>\", {}, cell_data, $row);\n });\n\n });\n\n $frag.appendTo($table);\n }", "title": "" }, { "docid": "57f7c54bac52a231bc7c1d5b7f95b3d9", "score": "0.5818244", "text": "function fillTableData(tableName) {\n $(\"#dataTable\").html()\n var dynamicTable = ``\n var templateTable = [`<tr>`, `</tr>`]\n var templateTableHead = [`<th>`, `</th>`]\n var templateTableContent = [`<td>`, `</td>`]\n var templateInput = [`<td><input placeholder=\"`,`\" id=\"`,`\"/></td>`]\n var fieldName = []\n $.post('../route/getTableData/',{\n tableName : tableName\n },\n function(data){\n var attr = []\n for(var k in data[0]) attr.push(k)\n var temp = ``\n var temp2 = ``\n attr.forEach(function(i){\n if(!(capitalize(i)=='CreatedAt' || capitalize(i)=='UpdatedAt')){\n temp += templateTableHead[0] + capitalize(i) + templateTableHead[1]\n temp2 += templateInput[0] + capitalize(i) + templateInput[1] + i +templateInput[2]\n fieldName.push(i)\n }\n })\n temp += `<th>Edit</th> <th>Delete</th>`\n temp2 += `<td><button class=\"btn btn-outline-primary\" id=\"clearCells\">Clear</button></td>\n <td><button class=\"btn btn-primary\" id=\"addToDB\">Add</button></td>`\n dynamicTable = templateTable[0] + temp + templateTable[1]\n dynamicTable += templateTable[0] + temp2 + templateTable[1]\n for(var i in data){\n temp = ``\n for(var j in data[i]){\n if(!(capitalize(j)=='CreatedAt' || capitalize(j)=='UpdatedAt')){\n temp += templateTableContent[0] + data[i][j] + templateTableContent[1]\n }\n }\n temp += `<td><!--<button class=\"btn btn-warning editBtn disabled\" id=\"edit`+data[i]['id']+`\">Edit</button>--></td>\n <td><button class=\"btn btn-danger deleteBtn\" id=\"delete`+data[i]['id']+`\">Delete</button></td>`\n dynamicTable += templateTable[0] + temp + templateTable[1]\n }\n $(\"#dataTable\").html(dynamicTable)\n setTimeout(function () {\n $(\"#clearCells\").click(function () {\n for(var i in fieldName){\n $(\"#\"+fieldName[i]).val(\"\")\n }\n })\n $(\"#addToDB\").click(function () {\n var obj = {\n tableName : tableName,\n attr : {}\n }\n for(var i in fieldName){\n obj.attr[fieldName[i]] = $(\"#\"+fieldName[i]).val()\n }\n $.post('../route/addTableData', obj,\n function(data){\n if(data){\n location.reload()\n }\n else{\n alert(\"Error in Insertion!\")\n }\n })\n })\n $(\".deleteBtn\").click(function() {\n var obj = {\n tableName : tableName,\n id : $(this).attr('id').slice(6)\n }\n $.post('../route/deleteTableData', obj,\n function(data){\n if(data){\n location.reload()\n }\n else{\n alert(\"Error in Deletion!\")\n }\n })\n })\n },500)\n })\n }", "title": "" }, { "docid": "5418c7c7c44c038f56fa4bb71aabeee7", "score": "0.57994276", "text": "function buildTable(data) {\n //clear any existing data from the table\n tbody.html(\"\");\n \n //loop through objects and append rows and cells for each value\n data.forEach((dataRow) => {\n var row = tbody.append(\"tr\");\n Object.values(dataRow).forEach((value) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "6932e193ce1e353f340534b7c5eb7a7a", "score": "0.5786175", "text": "function createTable(selectData) {\n //clear tbody\n tbody.html(\"\");\n\n //use another function to build the table\n selectData.forEach(function(entry) {\n \n //append rows based on the length of the dataset\n var row = tbody.append(\"tr\");\n //assign data to cells\n Object.entries(entry).forEach(function([key, value]) {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n }); \n \n}", "title": "" }, { "docid": "2702bc5cb5be41e6007fd4a631107eb4", "score": "0.5783652", "text": "function updateTableWithData(table, data = {}) {\n const headers = [\"Matches Yotta Ball\", \"Number of Matches\", \"Prize*\", \"Odds\"];\n\n clearTable(table);\n addHeadersToTable(table, headers);\n addDataToTable(table, data);\n}", "title": "" }, { "docid": "a2b365f4454966a00d4e510407dc672c", "score": "0.5782454", "text": "function populate() {\n tableData.map(sighting => {\n\n // Make new row\n var row = tbody.append('tr');\n\n // append each row with data\n row.append('td').text(sighting.datetime);\n row.append('td').text(sighting.city);\n row.append('td').text(sighting.state);\n row.append('td').text(sighting.country);\n row.append('td').text(sighting.shape);\n row.append('td').text(sighting.durationMinutes);\n row.append('td').text(sighting.comments);\n });\n}", "title": "" }, { "docid": "160e51acc00138bda624b46b5a12be51", "score": "0.57801193", "text": "function poplulateTable(data){\n // d3.event.preventDefault();\n data.forEach(sightingData=>{\n const trow = tbody.append(\"tr\");\n columns= [\"datetime\", \"city\", \"state\", \"country\", \"shape\", \"durationMinutes\", \"comments\"];\n columns.forEach(key=>{\n trow.append(\"td\").text(sightingData[key]);\n })\n })\n}", "title": "" }, { "docid": "9b2c22775c799676dfbb1260bfb8d95e", "score": "0.57724446", "text": "function format(rowData, tableId) {\n\t// rowData - data for the table.\n\t// tableId - unique table ID for child table.\n\t// This function just builds the table tag.\n\treturn '<table id=\"' + tableId + '\" class=\"table table-striped table-hover table-sm table-bordered\" style=\"padding-left:2em;\">' +\n\t\t'</table>';\n}", "title": "" }, { "docid": "1f3935bc183e66bf6f91c46cd7601320", "score": "0.57610196", "text": "function fillTable(data) {\n data.forEach(ufoReport => {\n console.log(ufoReport);\n let row = tbody.append(\"tr\");\n Object.entries(ufoReport).forEach(([key, value]) => {\n let cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "0d4b893213dc1a957e6d13693065eba3", "score": "0.57243335", "text": "function FormatTableData(Data) {\n\tvar data;\n\t// \"total\": \"xxx\", \n\t// \"page\": \"yyy\", \n\t// \"records\": \"zzz\",\n\t// \"rows\" : [\n\t// {\"id\" :\"1\", \"cell\" :[\"cell11\", \"cell12\", \"cell13\"]},\n\t// {\"id\" :\"2\", \"cell\":[\"cell21\", \"cell22\", \"cell23\"]},\n\t// ]\n\tdata = {\n\t\t\"total\" : \"1\",\n\t\t\"page\" : \"1\",\n\t\t\"records\" : \"\" + Data.LedListe.length + \"\",\n\t\t\"rows\" : []\n\t}\n\n\tfor (x in Data.LedListe) {\n\t\t//var data = {id:\"'\"+jsonLEDS.LedListe[x].LedString.LDNUMBER +\"'\",invdate:\"'\"+jsonLEDS.LedListe[x].LedString.LDNAME+\"'\",name:\"'\"+jsonLEDS.LedListe[x].LedString.LDI2CHANNEL+\"'\"};\n\t\t//var row = {\"id\":Data.LedListe[x].LedString.LDNUMBER, \"cell\" :[]};\n\t\t//row.cell=[Data.LedListe[x].LedString.LDNUMBER,Data.LedListe[x].LedString.LDNAME,Data.LedListe[x].LedString.LDI2CCHANNEL];\n\t\t//var row = {\"id\":Data.LedListe[x].LedString.LDNUMBER, \"cell\" :[]};\n\t\tvar row = [ Data.LedListe[x].LedString.LDNUMBER,\n\t\t\t\tData.LedListe[x].LedString.LDNAME,\n\t\t\t\tData.LedListe[x].LedString.LDI2CCHANNEL ];\n\t\tdata.rows[x] = {\n\t\t\t\"id\" : \"\" + Data.LedListe[x].LedString.LDNUMBER + \"\",\n\t\t\t\"cell\" : []\n\t\t}\n\t\tdata.rows[x].cell = row;\n\t\t//data.rows[x]=row;\t\t\n\t}\n\treturn data;\n}", "title": "" }, { "docid": "d5d50d281e50ad80e9e5fdd11fe80863", "score": "0.57085794", "text": "function createNewTableOnResultData(data) {\n tableBody.innerHTML= '<tr></tr>';\n\n for (let i = 0; i < 5; i += 1) {\n const newTH = document.createElement('th');\n\n switch (i) {\n case 0:\n newTH.classList.add('coll-sort');\n newTH.setAttribute('data-type', 'string');\n newTH.innerText = 'Show name';\n break;\n case 1:\n newTH.innerText = 'Language';\n break;\n case 2:\n newTH.innerText = 'Genres';\n break;\n case 3:\n newTH.innerText = 'Status of show';\n break;\n case 4:\n newTH.classList.add('coll-sort');\n newTH.setAttribute('data-type', 'number');\n newTH.innerText = 'Rating';\n break;\n\n default:\n break;\n }\n\n tableBody.firstElementChild.appendChild(newTH);\n }\n\n for (let i = 0; i < Object.keys(data).length; i += 1) {\n const newTR = document.createElement('tr');\n newTR.classList.add('table__row-data');\n newTR.setAttribute('data-id', `${data[i].show.id}`);\n\n tableBody.appendChild(newTR);\n\n for (let j = 0; j < 5; j += 1) {\n const newTD = document.createElement('td');\n\n switch (j) {\n case 0:\n newTD.innerText = data[i].show.name;\n break;\n case 1:\n newTD.innerText = data[i].show.language;\n break;\n case 2:\n newTD.innerText = data[i].show.genres.length\n ? data[i].show.genres.join(', ') : '-';\n break;\n case 3:\n newTD.innerText = data[i].show.status;\n break;\n case 4:\n newTD.innerText = data[i].show.rating.average\n ? data[i].show.rating.average : 0;\n break;\n\n default:\n break;\n }\n newTR.appendChild(newTD);\n }\n }\n}", "title": "" }, { "docid": "7d4deeef1a7f8f606c65c73ba50d0a4a", "score": "0.56978565", "text": "function populateTable(data,val){\n if(val == 1){\n table.row.add(editArray); \n table.draw(); \n }else if(val == 2){\n table.row.add(selectedDataarray); \n table.draw();\n }else{\n alert('There was an error populating table, Please check material balance and material edit table codes');\n }\n}", "title": "" }, { "docid": "0c88fff7e5d7b2a7372cc13d1d486e55", "score": "0.5691295", "text": "function table1(data) {\n // clear data\n tbody.html(\" \");\n data.forEach(selectData => {\n console.table(selectData);\n let row = tbody.append(\"sD\");\n\n console.table(Object.values(selectData));\n Object.values(selectData).forEach((val) => {\n let cell = row.append(\"sD\");\n cell.text(val);\n });\n });\n}", "title": "" }, { "docid": "f53a7a97037192f52c04c975624084ba", "score": "0.5674034", "text": "function fillTable(x) {\n //Clear existing data\n d3.select(\"#metadata-table\").selectAll(\"tr\").remove(); \n //Put in new data \n x.forEach((demoDatum) => { \n let labelrow = metadata_thead.append(\"tr\");\n Object.entries(demoDatum).forEach(([title, ]) => {\n let cell = labelrow.append(\"td\");\n cell.text(title);\n }); \n let datarow = metadata_tbody.append(\"tr\");\n Object.entries(demoDatum).forEach(([, value]) => {\n let cell = datarow.append(\"td\");\n cell.text(value);\n });\n });\n }", "title": "" }, { "docid": "6907b31a42df8c8b933e62d9952ffc79", "score": "0.56690747", "text": "function createTable(inputData) {\n inputData.forEach(sighting =>\n {var row = tbody.append(\"tr\");\n row.append(\"td\").text(sighting.datetime);\n row.append(\"td\").text(titleCase(sighting.city));\n row.append(\"td\").text(sighting.state.toUpperCase());\n row.append(\"td\").text(sighting.country.toUpperCase());\n row.append(\"td\").text(sighting.shape);\n row.append(\"td\").text(sighting.durationMinutes);\n row.append(\"td\").text(sighting.comments);\n }\n );\n}", "title": "" }, { "docid": "6907b31a42df8c8b933e62d9952ffc79", "score": "0.56690747", "text": "function createTable(inputData) {\n inputData.forEach(sighting =>\n {var row = tbody.append(\"tr\");\n row.append(\"td\").text(sighting.datetime);\n row.append(\"td\").text(titleCase(sighting.city));\n row.append(\"td\").text(sighting.state.toUpperCase());\n row.append(\"td\").text(sighting.country.toUpperCase());\n row.append(\"td\").text(sighting.shape);\n row.append(\"td\").text(sighting.durationMinutes);\n row.append(\"td\").text(sighting.comments);\n }\n );\n}", "title": "" }, { "docid": "305473c9d8307f8a88215f71ebca8e61", "score": "0.5654013", "text": "function populateTable(data){\n\tvar i = 1,\n\t\tlen = data.length,\n\t\ttable = $(\"#data\"),\n\t\tdate = \"\";\n\n\t// run loop in reverse to put newest data first\n\tfor(i = len -1; i >= 0; i--){\n\t\tvar text = \"<tr>\";\n\t\tfor(j = 0; j < DATA_FIELD_LEN; j++) {\n\t\t\ttext += \"<td>\" + data[i][j] + \"</td>\";\n\t\t}\n\t\ttext += \"</tr>\";\n\t\t$(\"table\").append(text);\n\t}\n}", "title": "" }, { "docid": "e0849909238eeeb6d01a4c240822ee6e", "score": "0.56454283", "text": "function datatableInitializer(id) {\n $('#' + id).html('<table class=\"table table-striped table-bordered table-hover\" id=\"dt_' + id + '\" width=\"100%\"><tr><td align=\"center\"><img src=\"public/images/bn-loader.gif\"></td></tr></table>');\n\n}", "title": "" }, { "docid": "aa8044bc36a67bf78556d65c5630c449", "score": "0.56437016", "text": "function populateTable() {\n $tbody.innerHTML = '';\n for (var i = 0; i < filtereddatetime.length; i++) {\n // Get get the current datetime object and its fields\n var datetime = filtereddatetime[i];\n var fields = Object.keys(datetime);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the address object, create a new cell at set its inner text to be the current value at the current address's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = datetime[field];\n }\n }\n }", "title": "" }, { "docid": "4958c1400112d16dfa6fa1d16f64fde6", "score": "0.5642608", "text": "function mountTableById(id, dataSource) {\n // save table ID\n var table = document.getElementById(id); \n // if data inside the table doesn't exist \"show the No results\" message\n if (dataSource === undefined || dataSource === null || dataSource.length === 0) {\n table.appendChild(document.createTextNode(\"No results.\"));\n return\n } \n // set data variable to save the attributes of the data object\n let data = Object.keys(dataSource[0]);\n\n // calling the functions to generate table passing its ID\n // passing the object attributes to the function that will mount the table head\n generateTableHead(table, data);\n // passing the data to the function that will mount the table\n generateTable(table, dataSource);\n}", "title": "" }, { "docid": "9d72861774d776a9621be75ee8b31916", "score": "0.5635771", "text": "function buildTable(data){\n tBody.html(\"\") // to clear the data\n data.forEach((rowData) => {\n var row = tBody.append(\"tr\");\n Object.values(rowData).forEach((value) =>{\n var cellData = row.append(\"td\");\n cellData.text(value);\n });\n });\n}", "title": "" }, { "docid": "9d72861774d776a9621be75ee8b31916", "score": "0.5635771", "text": "function buildTable(data){\n tBody.html(\"\") // to clear the data\n data.forEach((rowData) => {\n var row = tBody.append(\"tr\");\n Object.values(rowData).forEach((value) =>{\n var cellData = row.append(\"td\");\n cellData.text(value);\n });\n });\n}", "title": "" }, { "docid": "5fc8a1ed075f4a6dfe119a49d491f3b6", "score": "0.56328654", "text": "function renderData() {\n tableBody.innerHTML = \"\";\n for (var i = 0; i < tableData.length; i++) {\n var data = tableData[i];\n var rows = Object.keys(data);\n var input = tableBody.insertRow(i);\n for (var j = 0; j < rows.length; j++) {\n var field = rows[j];\n var cell = input.insertCell(j);\n cell.innerText = data[field];\n }\n }\n}", "title": "" }, { "docid": "149d6dce9a71ed54f750cfa1aeac5678", "score": "0.5632054", "text": "function refreshTable(data) {\n var options = {\n columns: [\n //'acm_comment',\n 'acm_name',\n 'acm_state',\n //'now_out_comment',\n //'now_out_contact',\n 'now_out_date',\n //'now_out_key',\n 'now_out_name',\n //'now_out_version',\n 'now_out_computername',\n //'last_in_contact',\n 'last_in_date',\n 'last_in_file_name',\n 'last_in_name',\n ],\n\n headings: {\n acm_comment: 'acm_comment',\n acm_name: 'ACM Name',\n acm_state: 'Status',\n now_out_comment: 'now_out_comment',\n now_out_contact: 'now_out_contact',\n now_out_date: 'Checked Out Date',\n now_out_key: 'now_out_key',\n now_out_name: 'Checked Out By',\n now_out_version: 'now_out_version',\n now_out_computername: 'Computer Name',\n last_in_contact: 'last_in_contact',\n last_in_date: 'Last Checkin Date',\n last_in_file_name: 'Last Filename',\n last_in_name: 'Last Checkin Name',\n },\n\n\n tooltips: {\n last_in_file_name: 'The name of the current database .zip file. If the ACM is checked out, it will be ' +\n 'checked in with a number that\\'s 1 greater.',\n now_out_computername: 'The name of the computer where the ACM is checked out',\n },\n\n formatters: {\n acm_state: (row, ix) => {\n // For checked out ACMs, add an \"uncheckout\" button.\n var cell = `<p data-row-index=\"${ix}\">`;\n if (row.acm_state === 'CHECKED_OUT') {\n cell += `<button type=\"button\" class=\"undo-checkout btn btn-tiny btn-danger\" title=\"Force un-checkout\">\n <i class=\"glyphicon glyphicon-remove\"></i>\n </button>`;\n }\n cell += row.acm_state + '</p>';\n return cell;\n },\n now_out_date: (row, ix) => (row.now_out_date || '').split('.')[0], // split off the ms; don't need that!\n now_out_name: (row, ix) => row.now_out_name || '',\n last_in_date: (row, ix) => (row.last_in_date || '').split('.')[0],\n now_out_computername: (row, ix) => (row.now_out_computername || '')\n\n\n },\n datatable: {paging: false, searching: true, colReorder: true}\n };\n\n data = data || [];\n\n var search;\n if (latestTable) {\n search = latestTable.search();\n }\n\n latestTable = DataTable.create($('#checkout-page-container'), data, options);\n if (search) {\n latestTable.search(search).draw();\n }\n $('#checkout-page-container button.undo-checkout').tooltip().on('click', (ev) => {\n var row = data[$(ev.currentTarget).parent().data('row-index')];\n confirmUncheckout2(row);\n });\n\n Main.setParams(PAGE_ID, {uf: includeUserFeedback?'t':'f'});\n }", "title": "" }, { "docid": "0927bcfee9a6315d9fe43b13ea7f8f2b", "score": "0.5622693", "text": "function ufoTable(newData){\ntbody.html(\"\");\nnewData.forEach((info) => {\n var row = tbody.append(\"tr\");\n Object.entries(info).forEach(([key, value]) => {\n var cell = tbody.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "762ef22e230f04ec452766dac5906883", "score": "0.5620118", "text": "function buildTable(tableData) {\n tbody.html(\"\");\n tableData.forEach(function(ufoReport) {\n //console.log(ufoReport);\n var row = tbody.append(\"tr\");\n Object.entries(ufoReport).forEach(function([key, value]) {\n //console.log(key, value);\n // Append a cell to the row for each value\n // in the ufo report object\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "1b8195f4ee9ff25f6913dcf838648c29", "score": "0.561549", "text": "function handleData(element, bolInitalLoad, data, error) {\n var strTemplate;\n var divElement;\n var tableElement;\n var theadElement;\n var theadCellElements;\n var tbodyElement;\n var tbodyCellElements;\n var lastRecordElement;\n var recordElements;\n var recordElement;\n var currentCellLabelElement;\n var template;\n var i;\n var len;\n var arrHeaders = [];\n var arrHide;\n var intVisibleColumns;\n var strHeaderCells;\n var strRecordCells;\n var jsnTemplate;\n var strHTML;\n\n // clear any old error status\n element.classList.remove('error');\n element.setAttribute('title', '');\n\n // if there was no error\n if (!error) {\n element.error = false;\n\n if (element.tableTemplate) {// element.tableTemplateElement\n strTemplate = element.tableTemplate;// element.tableTemplateElement\n } else {\n // create an array of hidden column numbers\n arrHide = (element.getAttribute('hide') || '').split(/[\\s]*,[\\s]*/);\n\n var strTableID = element.getAttribute('id');\n if (! strTableID) {\n strTableID = GS.GUID();\n }\n\n // build up the header cells variable and the record cells variable\n strHeaderCells = '';\n strRecordCells = '';\n intVisibleColumns = 0;\n i = 0;\n len = data.arr_column.length;\n while (i < len) {\n // if this column is not hidden\n if (arrHide.indexOf((i + 1) + '') === -1 && arrHide.indexOf(data.arr_column[i]) === -1) {\n // append a new cell to each of the header cells and record cells variables\n strHeaderCells += '<th id=\"' + strTableID + '_' + data.arr_column[i] + '\" gs-dynamic>' + encodeHTML(data.arr_column[i]) + '</th> ';\n strRecordCells += '<td headers=\"' + strTableID + '_' + data.arr_column[i] + '\" gs-dynamic>{{! row[\\'' + data.arr_column[i] + '\\'] }}</td> ';\n intVisibleColumns += 1;\n }\n i += 1;\n }\n\n // put everything together\n strTemplate = '<table gs-dynamic>';\n\n if (intVisibleColumns > 1) { // data.arr_column.length (didn't take into account hidden columns)\n strTemplate += '<thead gs-dynamic>' +\n '<tr gs-dynamic>' +\n strHeaderCells +\n '</tr>' +\n '</thead>';\n }\n\n strTemplate += '<tbody gs-dynamic>' +\n '<tr data-record_no=\"{{! row.row_number }}\" value=\"{{! row[\\'' + data.arr_column[0] + '\\'] }}\" gs-dynamic>' +\n strRecordCells +\n '</tr>' +\n '</tbody>' +\n '</table>';\n }\n\n divElement = document.createElement('div');\n divElement.innerHTML = strTemplate;\n\n tableElement = xtag.queryChildren(divElement, 'table')[0];\n theadElement = xtag.queryChildren(tableElement, 'thead')[0];\n tbodyElement = xtag.queryChildren(tableElement, 'tbody')[0];\n\n // if there is a tbody\n if (tbodyElement) {\n recordElement = xtag.queryChildren(tbodyElement, 'tr')[0];\n\n // if there is a record: template\n if (recordElement) {\n\n // if there is a thead element: add reflow cell headers to the tds\n if (theadElement) {\n theadCellElements = xtag.query(theadElement, 'td, th');\n tbodyCellElements = xtag.query(tbodyElement, 'td, th');\n\n i = 0;\n len = theadCellElements.length;\n while (i < len) {\n currentCellLabelElement = document.createElement('b');\n currentCellLabelElement.classList.add('cell-label');\n currentCellLabelElement.setAttribute('data-text', (theadCellElements[i].textContent || '') + ':');\n\n if (tbodyCellElements[i].childNodes) {\n tbodyCellElements[i].insertBefore(currentCellLabelElement, tbodyCellElements[i].childNodes[0]);\n } else {\n tbodyCellElements[i].insertChild(currentCellLabelElement);\n }\n i += 1;\n }\n }\n\n // template\n jsnTemplate = GS.templateHideSubTemplates(tbodyElement.innerHTML, true);\n strHTML = GS.templateWithEnvelopeData(jsnTemplate.templateHTML, data);\n tbodyElement.innerHTML = GS.templateShowSubTemplates(strHTML, jsnTemplate);\n\n element.tableElement = tableElement;\n element.syncView();\n element.internalData.records = data;\n }\n }\n\n if (theadElement && tbodyElement && theadElement.children[0] && theadElement.children[0].children) {\n tbodyElement.insertBefore(theadElement.children[0].cloneNode(true), tbodyElement.children[0]);\n var cols_i = 0;\n var cols_len = theadElement.children[0].children.length;\n element.tbodyheader = xtag.query(tbodyElement, 'tr:not([data-record_no])')[0];\n element.tbodyElement = tbodyElement;\n element.theadElement = theadElement;\n while (cols_i < cols_len) {\n theadElement.children[0].children[cols_i].setAttribute(\n 'style',\n 'width: ' + element.tbodyheader.children[cols_i].clientWidth + 'px !important; padding-right: 0; padding-left: 0;'\n );\n cols_i++;\n }\n }\n\n if (bolInitalLoad && !element.getAttribute('value') && element.hasAttribute('select-first')) {\n selectRecord(element, xtag.query(element, 'tbody tr')[0].getAttribute('value'), false);\n element.scrollToSelectedRecord();\n }\n\n GS.triggerEvent(element, 'after_select');\n GS.triggerEvent(element, 'onafter_select');\n if (element.hasAttribute('onafter_select')) {\n new Function(element.getAttribute('onafter_select')).apply(element);\n }\n\n // else there was an error: add error class, title attribute\n } else {\n element.error = true;\n element.classList.add('error');\n element.setAttribute('title', 'This listbox has failed to load.');\n\n element.setAttribute('disabled', '');\n\n GS.ajaxErrorDialog(data);\n }\n }", "title": "" }, { "docid": "299fb1b15efa7c86e54fa10cbc4de38d", "score": "0.56153816", "text": "function DataToTable(headers,data,tableId) {\n\tconsole.log('Filling table ', tableId, 'with', headers.length, 'columns (',headers,') on', data.length, 'rows: ', data);\n var output = \"\";\n var headersHtml = \"<tr>\";\n $.each(headers, function(idx) { headersHtml += \"<th>\"+this+\"</th>\" });\n headersHtml += \"</tr>\";\n $(tableId + \" thead\").html(headersHtml);\n\n\tvar table = \"\"; \n\t$.each(data, function(idx) { \n\t\ttable += \"\\t<tr>\\n\"; \n\t\t$.each(this,function(col) { table += \"\\t\\t<td>\" + this + \"</td>\\n\" } ); \n\t\ttable += \"\\t</tr>\\n\"; \n\t} ); \n\t$(tableId + \" tbody\").html(table);\n}", "title": "" }, { "docid": "e4573f58b36b0de6c14bc054b6e12fc5", "score": "0.5608955", "text": "function fillData(data,id,stateData,fillObject,target,rowData){\n\tif(rowData){\n\t\tlookupData[data] = rowData;\n\t}\n\t$('#genericDilog,.modal-backdrop').remove();\n\t$(\"#lookUpDialogBox .modal\").modal(\"hide\")\n\tarrayJSON={};\n\tif(id){\n\t\tclearDependentFields(\"\",stateData,target);\n\t\ttarget.value = data;\n\t\tif(typeof fillObject != undefined){\n\t\t\tfillObject(rowData,target);\n\n\t\t}\n\n\n\t\tvar childData={};\n\t childData[Object.keys(stateData.data)[0]]=data;\n\t var index = stateData.index;\n\t\t\t if(stateData.AIS){\n \t\t\t\t\t stateData.callback(childData,index,'AIS');\n \t\t\t }else{\n\t\t\t if(stateData.type){\n\t\t\t \tstateData.callback(childData,index,\"\",\"\",stateData.type,stateData.callback);\n\t\t\t }else{\n\t\t\t \tstateData.callback(childData,index);\n\t\t\t }\n\t\t\t }\n\n\t moveScroll(target);\n\t}else{\n\t\tReactDOM.render(<DisplayCustomSchema data = {document.getElementById(\"schema_name\").value} recordId={data} admin={true} edit={\"edit\"}/>,document.getElementById('customSchema'));\n\t}\n}", "title": "" }, { "docid": "f2c99fd9d18093b608d83272dd9f7480", "score": "0.55904096", "text": "function createTable(data){\n\n const jdata=JSON.parse(data);\n const t=document.getElementById(\"main_table\");\n \n t.innerHTML = \"\"; // delete table before create new one\n \n var r=t.insertRow();\n var c;\n \n Object.keys(jdata[0]).forEach(key => {\n var th=document.createElement('th');\n r.appendChild(th);\n th.innerHTML=key;\n });\n \n jdata.forEach(row => {\n r=t.insertRow();\n Object.values(row).forEach(item =>{\n c=r.insertCell();\n if(typeof item == \"object\"){\n c.innerHTML=item.day+\"/\"+item.month+\"/\"+item.year+\" \"+item.hour+\":\"+item.minutes+\":\"+item.seconds;\n }\n else{\n c.innerHTML=item;\n }\n \n })\n })\n }", "title": "" }, { "docid": "488c75670b0f5dfa2486480aa68fd84e", "score": "0.5586747", "text": "refreshTable() {\n this.buildTable();\n }", "title": "" }, { "docid": "fc10861e5380de48f28a328b35ec58ce", "score": "0.55773973", "text": "function buildTable(data) {\n data.forEach(function(data) {\n let nextrow = tbody.append(\"tr\");\n nextrow.append(\"td\").text(data[\"datetime\"]).style(\"text-align\", \"center\");\n nextrow.append(\"td\").text(data[\"city\"]).style(\"text-align\", \"center\");\n nextrow.append(\"td\").text(data[\"state\"]).style(\"text-align\", \"center\");\n nextrow.append(\"td\").text(data[\"country\"]).style(\"text-align\", \"center\");\n nextrow.append(\"td\").text(data[\"shape\"]).style(\"text-align\", \"center\");\n nextrow.append(\"td\").text(data[\"durationMinutes\"]).style(\"text-align\", \"center\");\n nextrow.append(\"td\").text(data[\"comments\"]).style(\"text-align\", \"center\");\n})}", "title": "" }, { "docid": "ea7610569339420cef036e1b3de19011", "score": "0.55720013", "text": "function buildTable(data){ \n\n tbody.html(\"\");\n\n data.forEach((item) => {\n var newRow= tbody.append('tr');\n Object.values(item).forEach((val) => { \n newRow.append('td').text(val)\n });\n });\n}", "title": "" }, { "docid": "24abbc624113222e05f64568d5835ced", "score": "0.5569727", "text": "function addRow(data, tableID)\n{\n\tvar table = document.getElementById(tableID);\n\tnewRow = table.insertRow(table.length);\n\t\n\tnewRow.id = data.id;\n\tnewRow.insertCell(0).textContent = data.name;\n\tnewRow.insertCell(1).textContent = data.reps;\n\tnewRow.insertCell(2).textContent = data.weight;\n\tnewRow.insertCell(3).textContent = data.date;\n\tnewRow.insertCell(4).textContent = data.lbs;\n}", "title": "" }, { "docid": "db8329004f460c577e8ed2b1793388ee", "score": "0.55541307", "text": "function init(data1) {\n tbody.text(\"\")\n data.forEach(function(sightings){\n new_tr = tbody.append(\"tr\")\n Object.entries(sightings).forEach(function([key,value]){\n new_td = new_tr.append(\"td\").text(value)\n })\n\n })\n}", "title": "" }, { "docid": "83c5f9f1a7d0ff62d05613eaa1be6614", "score": "0.5551771", "text": "function buildTable(data) {\n// clear data first\ntbody.html(\"\");\n// use forEach like a for loop, forEach only works with arrays\n//then add rows to the table\n//using an arrow funtion cause its cleaner\n//an argument (dataRow) that will represent each row of the data \ndata.forEach((dataRow) => {\n// create a variable that will append a row to the table body\n// let is used becuase the variable is only for this block of code\n// code tells JavaScript to find the <tbody> tag within the HTML and add a table row (\"tr\").\n let row = tbody.append(\"tr\");\n// loop through each field in the dataRow argument\n// function to specify that each object goes on one row\n Object.values(dataRow).forEach((val) => {\n// add each value to a cell each value is wrapped in an html <td> tag\n let cell = row.append(\"td\");\n cell.text(val);\n}\n);\n});\n}", "title": "" }, { "docid": "66102108600e0428d6f5e59dfa1679e9", "score": "0.55513334", "text": "function buildTable(data) {\n tbody.html(\"\");\n data.forEach((dataRow) => {\n let row = tbody.append(\"tr\");\n Object.values(dataRow).forEach((val) => {\n let cell = row.append(\"td\");\n cell.text(val);\n\n });\n\n });\n\n}", "title": "" }, { "docid": "9efdd921276e7b95f477f57e8c4d6e2b", "score": "0.5550082", "text": "function buildTable(data) {\n //First, clear out any existing data\n tbody.html(\"\");\n\n // Next, loop through each object in the data\n // and append a row and cells for each value in the row\n data.forEach((dataRow) => {\n //Append a row to the table body\n let row = tbody.append(\"tr\");\n\n //Loop through each field in the dataRow and add\n //each value as a table cell(td)\n Object.values(dataRow).forEach((val) => {\n let cell = row.append(\"td\");\n cell.text(val);\n });\n });\n}", "title": "" }, { "docid": "d8a8cd745147bb3da921afd8e190567a", "score": "0.55487496", "text": "function createAndFillTable(data) {\n var result =\"<br><center><table class='BoroughInfoTable'><tr><th>Year</th><th>Income</th><th>Population</th></tr>\";\n for (var key = 0; key < data.results.bindings.length-1; key++) {\t//-1 to skip the last row (values of 2012)\n var year = data.results.bindings[key][\"y\"].value;\n var iVal = data.results.bindings[key][\"iVal\"].value;\n var pVal = data.results.bindings[key][\"pVal\"].value;\n result = result + \"<tr><td>\"+year+\"</td><td>\"+iVal+\"</td><td>\"+pVal+\"</td></tr>\";\n }\n result = result + \"</table></center>\";\n document.getElementById('TableContainer').innerHTML=result;\n}", "title": "" }, { "docid": "a89119fcf4b5a4f086797f1757d85794", "score": "0.55455565", "text": "function createTable(data){\n tbody.html(\"\");\n data.forEach((alien_sighting) => {\n var row = tbody.append(\"tr\");\n Object.entries(alien_sighting).forEach(([key, value]) => {\n var cell = tbody.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "96ecdca29578a79c91e00c623ee5b09e", "score": "0.55449533", "text": "function onRefreshData(data) {\n cleanTableBody(this);\n self = this;\n var rows = data.records.map(function(record, ind) {\n var recordData = record;\n var bodyHtml = '<tr id=\"row' + ind + '\">';\n for (i in self.dataSource.headers) {\n if (self.dataSource.headers[i] === \"id\") {\n bodyHtml += '<td contenteditable=\"false\" oninput=\"dataTable.saveChanges(this, ' + i.toString() + ', ' + record[self.dataSource.headers[0]] + ')\">' + record[self.dataSource.headers[i]] + '</td>';\n } else {\n bodyHtml += '<td id=\"text\" contenteditable=\"true\" oninput=\"dataTable.saveChanges(this, ' + i.toString() + ', ' + record[self.dataSource.headers[0]] + ')\">' + record[self.dataSource.headers[i]] + '</td>';\n }\n }\n bodyHtml += '</tr>';\n return bodyHtml;\n });\n\n var tbody = document.createElement('TBODY');\n tbody.innerHTML = rows.join('');\n this.table.appendChild(tbody);\n}", "title": "" }, { "docid": "3b4a66ffb7450da3173dc26567ccc69b", "score": "0.55413127", "text": "function update_details(data, $table) {\n $table.api().clear().draw();\n $table.api().rows.add(data);\n $table.api().columns.adjust().draw();\n}", "title": "" }, { "docid": "247b7aa8f3ac7677b70bcdc7ea2b29ec", "score": "0.5537182", "text": "function setData(data) {\n\n document.getElementById('data-backoffice').innerHTML = \"\"\n\n\n for (var i = 0; i < data.length; ++i) {\n if ((data[i].name_message).length > 18) {\n data[i].name_message = data[i].name_message.substr(0, 15) + '...';\n }\n document.getElementById('data-backoffice').innerHTML += '<tr id=\"' + data[i].id_message + '_row\"><td>' + data[i].id_message + '</td><td>' + (data[i].name_message) + '</td><td>' + data[i].username + '</td><td><a class=\"btn btn-info button-bo\" href=\"/message/' + data[i].id_message + '/edit\" role=\"button\"><i class=\"fas fa-cog\"></i></a> <a class=\"btn btn-danger button-bo\" onClick=\"delete_id(' + data[i].id_message + ')\" role=\"button\"><i class=\"fas fa-trash-alt\"></i></a></td></tr>';\n }\n var myTable = document.querySelector(\"table\");\n var dataTable = new DataTable(myTable);\n}", "title": "" }, { "docid": "8737f78a19f450abe0a7820cc2de90c8", "score": "0.55371356", "text": "function ftable(data) {\n tbody.html(\"\");\n //Use forEach func. to append all rows\n data.forEach((row) => {\n // Varible that will create a row\n const table_row = tbody.append(\"tr\");\n // Going to loop through the row and create the cells then fill in with the value\n Object.values(row).forEach((value) => {\n let cell = table_row.append(\"td\");\n cell.text(value);\n }\n );\n });\n\n}", "title": "" }, { "docid": "d51d5cd76f994557b8012cec79797b57", "score": "0.553438", "text": "function generateTableData() {\n console.log(fields);\n for (var i = 0; i < fields.length; i++) { // labelIDs, typeIDs, and requiredIDs arrays will always be same length\n fields[i].label.value = $(\"#label-\" + i).val();\n fields[i].type.value = $(\"#type-\" + i).val();\n fields[i].required.value = $(\"#required-\" + i).val();\n }\n for (var j = 0; j < fields.length; j++) {\n var html = \"<tr>\";\n html += \"<td>\" + fields[j].label.value + \"</td>\";\n html += \"<td>\" + fields[j].type.value + \"</td>\";\n html += \"<td>\" + fields[j].required.value + \"</td>\";\n html += \"</tr>\";\n $(\"tbody\").append(html);\n }\n $(\"#data-table\").show('slide');\n }", "title": "" }, { "docid": "f1044f20409c0ab45b1d7a665042bfda", "score": "0.5514925", "text": "function Fill_With_Data(json) {\n\t\tif (json) {\n\t\t\tvar array = [];\n\n\t\t\tif (_title === 'Feed & Care') {\n\t\t\t\tvar item1,\n\t\t\t\t quantity;\n\t\t\t\tvar query = 'DELETE FROM FeedAndCareDetails WHERE id = ?';\n\t\t\t\tdeleteTable(query);\n\n\t\t\t\tif (json.care_and_feed.feed_time) {\n\t\t\t\t\titem1 = json.care_and_feed.feed_time;\n\t\t\t\t} else {\n\t\t\t\t\titem1 = '12:00';\n\t\t\t\t}\n\n\t\t\t\tif (json.care_and_feed.unit) {\n\t\t\t\t\tquantity = json.care_and_feed.quantity + ' ' + json.care_and_feed.unit;\n\t\t\t\t} else {\n\t\t\t\t\tquantity = '';\n\t\t\t\t}\n\n\t\t\t\tarray.push(json.care_and_feed.id);\n\t\t\t\tarray.push(item1);\n\t\t\t\tarray.push(json.care_and_feed.horse.official_name);\n\t\t\t\tarray.push(json.care_and_feed.feed_act);\n\t\t\t\tarray.push(quantity);\n\t\t\t\tarray.push(json.care_and_feed.location);\n\t\t\t\titem3 = array[3] + '\\n' + quantity + '\\n' + array[5];\n\n\t\t\t\tvar query = 'INSERT INTO FeedAndCareDetails (id, time, horseName, feed_act, quantity, location) VALUES (?, ?, ?, ?, ?, ?)';\n\t\t\t\tinsertTable(query, array);\n\t\t\t} else if (_title === 'Training') {\n\t\t\t\tvar query = 'DELETE FROM TrainingDetails WHERE id = ?';\n\t\t\t\tdeleteTable(query);\n\t\t\t\tvar workload,\n\t\t\t\t performance;\n\t\t\t\tif (json.training_detail.work_load_atp) {\n\t\t\t\t\tworkload = json.training_detail.work_load;\n\t\t\t\t} else {\n\t\t\t\t\tworkload = json.training_detail.work_load_adj;\n\t\t\t\t}\n\n\t\t\t\tif (json.training_detail.target_p_atp) {\n\t\t\t\t\tperformance = json.training_detail.target_p;\n\t\t\t\t} else {\n\t\t\t\t\tperformance = json.training_detail.target_p_adj;\n\t\t\t\t}\n\n\t\t\t\tarray.push(json.training_detail.id);\n\t\t\t\tarray.push(json.training_detail.scheduled_time_str);\n\t\t\t\tarray.push(json.training_detail.training.horse.official_name);\n\t\t\t\tarray.push(json.training_detail.location);\n\t\t\t\tarray.push(json.training_detail.training.training_type);\n\t\t\t\tarray.push(json.training_detail.discipline);\n\t\t\t\tarray.push(workload);\n\t\t\t\tarray.push(json.training_detail.work_load_unit);\n\t\t\t\tarray.push(performance);\n\t\t\t\tarray.push(json.training_detail.target_p_unit);\n\t\t\t\tarray.push(json.training_detail.instruction);\n\t\t\t\titem3 = array[3] + '\\n' + 'Type : ' + array[4] + '\\n' + 'Discipline : ' + array[5] + '\\n' + 'Workload : ' + workload + ' ' + array[7] + '\\n' + 'Performance : ' + performance + ' ' + array[9] + '\\n' + 'Instructions :' + '\\n' + array[10];\n\n\t\t\t\tvar query = 'INSERT INTO TrainingDetails (id, time, horseName, location, training_type, discipline, workload, workload_unit, performance, performance_unit, instruction) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';\n\t\t\t\tinsertTable(query, array);\n\t\t\t} else if (_title === 'Health') {\n\t\t\t\tvar query = 'DELETE FROM HealthDetails WHERE id = ?';\n\t\t\t\tdeleteTable(query);\n\t\t\t\tvar schedule;\n\t\t\t\tif (json.health_and_care.schedule) {\n\t\t\t\t\tschedule = json.health_and_care.schedule;\n\t\t\t\t} else {\n\t\t\t\t\tschedule = '';\n\t\t\t\t}\n\n\t\t\t\tarray.push(json.health_and_care.id);\n\t\t\t\tarray.push(json.health_and_care.time);\n\t\t\t\tarray.push(json.health_and_care.horse.official_name);\n\t\t\t\tarray.push(json.health_and_care.location);\n\t\t\t\tarray.push(json.health_and_care.therapy_treatment);\n\t\t\t\tarray.push(schedule);\n\t\t\t\titem3 = array[3] + '\\n' + array[4] + '\\n' + schedule;\n\n\t\t\t\tvar query = 'INSERT INTO HealthDetails (id, time, horseName, location, therapy_treatment, schedule) VALUES (?, ?, ?, ?, ?, ?)';\n\t\t\t\tinsertTable(query, array);\n\t\t\t}\n\n\t\t\ttime.text = array[1];\n\t\t\thorseName.text = array[2];\n\t\t\tvalues.text = item3;\n\t\t\tactivityIndicator.hide();\n\t\t} else {\n\t\t\tvar db = Titanium.Database.open('Horsecount');\n\t\t\tvar Rows;\n\t\t\ttry {\n\t\t\t\tif (_title === 'Feed & Care') {\n\t\t\t\t\tRows = db.execute('SELECT * FROM FeedAndCareDetails WHERE id = ?', _id);\n\t\t\t\t\tif (Rows.isValidRow()) {\n\t\t\t\t\t\ttime.text = Rows.fieldByName('time');\n\t\t\t\t\t\thorseName.text = Rows.fieldByName('horseName');\n\t\t\t\t\t\tvar quantity = Rows.fieldByName('quantity');\n\t\t\t\t\t\tvalues.text = Rows.fieldByName('feed_act') + '\\n' + quantity + '\\n' + Rows.fieldByName('location');\n\t\t\t\t\t}\n\t\t\t\t} else if (_title === 'Training') {\n\t\t\t\t\tRows = db.execute('SELECT * FROM TrainingDetails WHERE id = ?', _id);\n\t\t\t\t\tif (Rows.isValidRow()) {\n\t\t\t\t\t\ttime.text = Rows.fieldByName('time');\n\t\t\t\t\t\thorseName.text = Rows.fieldByName('horseName');\n\t\t\t\t\t\tvalues.text = Rows.fieldByName('location') + '\\n' + 'Type : ' + Rows.fieldByName('training_type') + '\\n' + 'Discipline : ' + Rows.fieldByName('discipline') + '\\n' + 'Workload : ' + Rows.fieldByName('workload') + ' ' + Rows.fieldByName('workload_unit') + '\\n' + 'Performance : ' + Rows.fieldByName('performance') + ' ' + Rows.fieldByName('performance_unit') + '\\n' + 'Instructions :' + '\\n' + Rows.fieldByName('instruction');\n\t\t\t\t\t}\n\t\t\t\t} else if (_title === 'Health') {\n\t\t\t\t\tRows = db.execute('SELECT * FROM HealthDetails WHERE id = ?', _id);\n\t\t\t\t\tif (Rows.isValidRow()) {\n\t\t\t\t\t\ttime.text = Rows.fieldByName('time');\n\t\t\t\t\t\thorseName.text = Rows.fieldByName('horseName');\n\t\t\t\t\t\tvalues.text = Rows.fieldByName('location') + '\\n' + Rows.fieldByName('therapy_treatment') + '\\n' + Rows.fieldByName('schedule');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} catch(e) {\n\t\t\t\talert(e);\n\t\t\t} finally {\n\t\t\t\tRows.close();\n\t\t\t\tdb.close();\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "85296c78ad8a4f76546188a7f5a3536d", "score": "0.55144936", "text": "function createTable(data) {\n tbody.html(\"\");\n \n data.forEach((ufo) => {\n var row = tbody.append(\"tr\");\n Object.entries(ufo).forEach(function([key, value]) {\n console.log(key, value);\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n }", "title": "" }, { "docid": "5704ed8cfa9024eee10459de3e5194b7", "score": "0.5510272", "text": "function init(data) {\n tbody.html(\"\");\n\n data.forEach((ufoSightings) => {\n var row = tbody.append(\"tr\");\n Object.entries(ufoSightings).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "24638ccd6da83d82eb14b1417f3b2394", "score": "0.5505492", "text": "function createOverallDataTable(eleid, data) {\n //check is datatable or not\n if ($.fn.DataTable.isDataTable(eleid)) {\n $(eleid).DataTable().destroy();\n }\n $(eleid).DataTable({\n data: data,\n columns: [\n { data: 'area' },\n { data: 'total' },\n { data: 'appeals' },\n { data: 'complaints' }\n ],\n searching: false,\n info: false,\n paging: false\n });\n }", "title": "" }, { "docid": "98999dfd5b5e37fbd51bbb9227e5b5a0", "score": "0.55028164", "text": "function format_data(data, data_source) {\n var headings = []\n ,rows = []\n ,row\n , heading_indexes = []\n , headings = data.headings.filter(function(h,i) {\n if(h === 'lat' || h === 'lon' || h === 'Order') {\n return false;\n }\n else {\n heading_indexes.push(i);\n return true;\r\n }\n });\n //filter out and format only those rows we'll be displaying (not lat, lon, order or record id)\n data.rows.forEach(function(r,i) {\n var row = r.filter(function(d,j){ return heading_indexes.indexOf(j) !== -1; });\n row.forEach( function(d,i) {\n //format dates or numbers if the heading is in data_formats (see above)\n //pass the heading and use that to figure out what the query should be\n row[i] = data_formats[headings[i]]?data_formats[headings[i]](row[i], data_source):row[i]; \r\n });\n rows.push(row); \r\n });\n data.rows = rows;\n data.headings = headings;\n return data;\n }", "title": "" }, { "docid": "07d9933586ad65a29db914687164ebcb", "score": "0.54976296", "text": "function populateTable() {\n\n // Empty content string\n var tableContent = '';\n // jQuery AJAX call for JSON\n $.getJSON( \"/\"+baseURL, function( data ) {\n elementListData = data;\n \n $.each(data, function(index){\n tableContent += '<tr rel=\"' + this._id + '\">';\n for(var i=1;i<elementAtts.length;i++){\n var value=this[elementAtts[i]];\n if(!isNaN(Date.parse(value))){\n value=tryGetDate(value);\n this[elementAtts[i]]=value;\n value=(new Intl.DateTimeFormat()).format(value);\n }\n tableContent+=\"<td>\"+value+\"</td>\";\n }\n \n tableContent+=\"<td><button type='button' onclick='editElement(\"+index+\")'>edit</button><button type='button' onclick='deleteElement(\"+index+\")'>delete</button></td>\";\n tableContent+=\"</tr>\";\n \n });\n\n // Inject the whole content string into our existing HTML table\n $('#elementList table tbody').html(tableContent);\n });\n}", "title": "" }, { "docid": "0d780cfc3b3a6b83f482f5e7d807fd63", "score": "0.54952204", "text": "function buildTable(data) {\n data.forEach((UFOData) => {\n var row = tbody.append(\"tr\");\n Object.values(UFOData).forEach((value) => {\n row.append(\"td\").text(value);\n });\n });\n}", "title": "" }, { "docid": "3740992bc694b19838377c652daefa93", "score": "0.5492124", "text": "function createTable(dataUrl, selector, params) {\n var defaultParams = {\n \"columnFormatters\": {},\n \"defaultFormatter\": function (value) {\n return value;\n },\n \"done\": function() {\n // nothing\n }\n };\n\n if (arguments.length === 2) {\n params = defaultParams\n } else {\n params = $.extend(defaultParams, params);\n }\n\n if (params.hasOwnProperty(\"columnFormatters\")) {\n columnFormatters = params.columnFormatters;\n } else {\n columnFormatters = {};\n }\n\n d3.csv(dataUrl, function (data) {\n if (data && data.length > 0) {\n // Get the column names\n var columns = Object.keys(data[0])\n\n var table = d3.select(selector)\n .append(\"table\")\n .attr(\"class\", \"table table-striped table-condensed table-hover\");\n var thead = table.append(\"thead\");\n var tbody = table.append(\"tbody\");\n\n // Create the header.\n thead.append(\"tr\")\n .selectAll(\"th\")\n .data(columns)\n .enter()\n .append(\"th\")\n .text(function (col) { return col; });\n\n // Fill the rows.\n var rows = tbody.selectAll(\"tr\")\n .data(data)\n .enter()\n .append(\"tr\");\n var cells = rows.selectAll(\"td\")\n .data(function (row) {\n return columns.map(function (column) {\n var value;\n if (params.columnFormatters.hasOwnProperty(column)) {\n value = params.columnFormatters[column](row[column]);\n } else {\n value = params.defaultFormatter(row[column]);\n }\n return {column: column, value: value};\n });\n })\n .enter()\n .append(\"td\")\n .text(function (d) { return d.value; });\n }\n params.done();\n });\n }", "title": "" }, { "docid": "a5931be40781bb4e03ef440ffbd9e95c", "score": "0.54876703", "text": "function table(data) {\n tabBody.html(\"\");\n data.forEach((dataRow) => {\n let row = tabBody.append(\"tr\");\n Object.values(dataRow).forEach((val) => {\n let ufoInfo = row.append(\"td\");\n ufoInfo.text(val);\n }\n );\n});\n}", "title": "" }, { "docid": "5e0e241ec23daee53fcf87156dc53781", "score": "0.5482772", "text": "function init() {\n tableData.forEach((alienSighting) => {\n var row = tbody.append(\"tr\");\n Object.values(alienSighting).forEach(value => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "6139e780fbaaf63d12e3d8927b833891", "score": "0.5479276", "text": "function populateTable() {\n\n // Empty content string\n var tableContent = '';\n\n // jQuery AJAX call for JSON\n $.getJSON( '/data/list', function(data) {\n\n // For each item in our JSON, add a table row and cells to the content string\n $.each(data, function(){\n tableContent += '<tr>';\n tableContent += '<td>' + this.userId + '</td>';\n tableContent += '<td>' + this.type + '</td>';\n tableContent += '<td>' + this.data + '</td>';\n tableContent += '<td><a href=\"#\" class=\"linkdeletedata\" rel=\"' + this._id + '\">delete</a></td>';\n tableContent += '</tr>';\n });\n\n // Inject the whole content string into our existing HTML table\n $('#dataList table tbody').html(tableContent);\n });\n}", "title": "" }, { "docid": "371a41a3f8a9e07eb5eb0354a0e40fe2", "score": "0.5476769", "text": "function createTableDataFromFilm({ id, title, runTime, release }) {\n return `\n <tr>\n <td> <a href = \"#\" data-id=\"${id}\" class=\"deleteFilm\"> X </a> </td>\n <td>${title}</td>\n <td>${runTime}</td>\n <td>${release}</td>\n <td> <a href = \"#\" data-id=\"${id}\" class=\"editFilm\"> Edit </a> </td>\n </tr>`;\n}", "title": "" }, { "docid": "9f5049465bb3e9eeeb2f6c9fed3f345e", "score": "0.5473384", "text": "function buildTable(data) {\n // First, clear out any existing data\n tbody.html(\"\");\n \n // Next, loop through each object in the data\n // and append a row and cells for each value in the row\n data.forEach((dataRow) => {\n // Append a row to the table body\n let row = tbody.append(\"tr\");\n \n // Loop through each field in the dataRow and add\n // each value as a table cell (td)\n Object.values(dataRow).forEach((val) => {\n let cell = row.append(\"td\");\n cell.text(val);\n }\n );\n });\n}", "title": "" }, { "docid": "3ee9022ad65c19ea4f1b927ce8774b64", "score": "0.54714257", "text": "function createTable(ufoData){\n ufoData.forEach((ufoRecord) => {\n var row = tbody.append('tr');\n \n Object.entries(ufoRecord).forEach(([key, value]) => {\n var cell = row.append('td');\n cell.text(value);\n })\n })\n}", "title": "" }, { "docid": "eb47348e212d13edc7073e9d1df45d70", "score": "0.5470762", "text": "function populateTable(data) {\n // Iterate through the list of users\n for(var i = 0; i < data.length; i++) {\n $('#tblExecutives tbody').append(createRow(data[i]));\n }\n}", "title": "" }, { "docid": "4219687997ddd5d17dbc10ae3b6f4bf9", "score": "0.5464057", "text": "function buildTable(data) {\n tbody.html('');\n\n data.forEach(function(tableData) {\n console.log(tableData);\n var row = tbody.append('tr');\n Object.entries(tableData).forEach(function([key, value]) {\n console.log(key, value);\n var cell = row.append(\"td\");\n cell.text(value);\n\n });\n\n });\n}", "title": "" }, { "docid": "1f55386b7bd7af6fd226a7ffd84a6417", "score": "0.54634684", "text": "function tableName(data) {\n data.forEach(function(data) {\n console.log(data);\n var row = tbody.append(\"tr\")\n \n Object.values(data).forEach(val => row.append(\"td\").text(val))\n }); \n}", "title": "" }, { "docid": "4efbd90f3d88441d0158fdb3297d4ec2", "score": "0.54630804", "text": "function updateTable(data) {\n let tbody = document.getElementsByTagName(\"tbody\")[0];\n tbody.innerHTML = \"\";\n\n // For each element in the table, create a row and add it to the tbody\n for (index in data) {\n // Create row\n row = document.createElement(\"tr\");\n row.setAttribute(\"id\", index);\n\n // Title\n titleCell = document.createElement(\"td\");\n titleCell.setAttribute(\"class\", \"title\");\n titleCell.innerText = data[index].title;\n row.appendChild(titleCell);\n\n // Value\n valueCell = document.createElement(\"td\");\n valueCell.setAttribute(\"class\", \"value\");\n valueCell.addEventListener(\"click\", startModify);\n valueCell.innerText = data[index].value;\n row.appendChild(valueCell);\n\n // Append the row to the table\n tbody.appendChild(row);\n }\n}", "title": "" }, { "docid": "21949808b192a744278466d28f3fc20b", "score": "0.5461192", "text": "function populateTable() {\n populateGryffindorTable();\n populateHufflepuffTable();\n populateRavenclawTable();\n populateSlytherinTable();\n \n}", "title": "" }, { "docid": "1ae3469facb0324f10e268dff4d1bf3a", "score": "0.54603827", "text": "function loadTable() {\n const tableBody = document.querySelector(\"#table-body\");\n let dataHtml = '';\n\n switch (drawGameId) {\n case '8':\n case '12':\n case '15':\n // Populate Table For Games With Special Number\n gameData.forEach(function (game) {\n dataHtml += `<tr><td>${game.drawDate}</td><td>${game.drawNumber}</td><td>${game.winningNumbers}</td><td>${game.specialNumber}</td></tr>`;\n });\n\n tableBody.innerHTML = dataHtml.replace(/,/g, ' ');\n break;\n case '9':\n case '10':\n case '14':\n // Populate Table For Games With No Special Number\n gameData.forEach(function (game) {\n dataHtml += `<tr><td>${game.drawDate}</td><td>${game.drawNumber}</td><td>${game.winningNumbers}</td></tr>`;\n });\n\n tableBody.innerHTML = dataHtml.replace(/,/g, ' ');\n break;\n default:\n break;\n }\n }", "title": "" }, { "docid": "9d255e8ad97cdc0f88b7edab6017b4a1", "score": "0.54556906", "text": "function drawTable() {\n\n var id = 1;\n var documentsData = '';\n\n $(\"#document-table > tbody\").empty();\n\n $.getJSON(\"/Document\", function (data) {\n if (data != 0) {\n $.each(data, function (key, value) {\n documentsData += '<tr>';\n documentsData += '<td>' + id++ + '</td>';\n documentsData += '<td>' + changeFormatDate(value.time) + '</td>';\n documentsData += '<td>' + moveTypeArray[value.type] + '</td>';\n documentsData += '<td>' + value.name_Customer + '</td>';\n documentsData += '<td>' + value.name_WarehouseOne + '</td>';\n documentsData += '<td>' + value.name_WarehouseTwo + '</td>';\n documentsData += '<td>' + value.name_User + '</td>';\n documentsData += '<td>' + pdfTypeArray[value.type] + '/' + value.number + '</td>';\n documentsData += '<td> <a href=\"/pdf/' + pdfTypeArray[value.type] + '/' + value.number + '.pdf\"><img src=\"/Content/Img/pdf.png\" style=\"width:26px;\"></a> </td>';\n documentsData += '</tr>';\n });\n $(\"#document-table\").append(documentsData);\n displayTable();\n }\n else {\n removeTable();\n }\n\n });\n }", "title": "" }, { "docid": "7a3588409ebdbcb4e936140e186bf2b5", "score": "0.54531294", "text": "function prepareData (fileData) {\n var allData = fileData.allData;\n if (allData == undefined) {\n console.log(\"allData is nil for ID\", fileData.id);\n } else {\n // these columns must contain values\n var mustBeFilledIn = fileData.mustBeFilledIn != undefined ? fileData.mustBeFilledIn : [];\n\n var timeParseFormats = fileData.timeParseFormats; // syntax: {column:format, column:format}\n if (timeParseFormats == undefined) {\n timeParseFormats = {};\n }\n\n var columnCount = getObjectItemCount(allData[0]); // get the column count based on the first item.\n // todo I have to check this later: allData.columns.length\n\n for (var i = allData.length - 1; i > -1 ;i--) { // invert loop for slice (else it will skip items, because the array becomes shorter)\n\n var data = allData[i];\n\n if (data != undefined) {\n\n // define how many checks the item has to pass in order to be OK.\n var checks = columnCount;\n\n // check all properties\n for (var prop in data) {\n var value = data[prop];\n\n // please be lowercase, no need to think about it later.\n var newProp = prop.toLowerCase();\n\n // not sure if it is possible, but I do not want undefined or nulls converted to strings. Will result in \"undefined\"/\"null\" with the >String< function.\n if (value == undefined) {\n value = \"\";\n }\n\n // convert numbers to strings, for the string functions below. (afaik I once has numbers in stead of strings, probably because it were actualy numbers or booleans >0,1<\n value = String(value);\n\n // remove special characters\n newProp = removeAllSpecialCharacters(newProp);\n\n // trim arround\n newProp = newProp.trim();\n value = value.trim();\n\n // replace spaces\n newProp = replaceAll(newProp, \" \", \"_\");\n\n\n // remove new lines\n value = replaceAll(value, \"\\n\", \"\");\n\n\n // make it a number to check if it is a number\n var convertedToNumber = Number(value);\n\n if (newProp === \"datum\" || newProp === \"date\" || newProp === \"year\") { // maybe a date?\n\n // parse the date\n var timeParseFormat = timeParseFormats[newProp] != undefined ? timeParseFormats[newProp] : \"%d-%m-%Y\";\n var convertedToDate = d3.timeParse(timeParseFormat)(value);\n\n\n // no date found? Make a backup (for debug + fixing later purposes)\n if (value == undefined) {\n data[prop + \"_backup\"] = value;\n }\n\n value = convertedToDate;\n\n\n } else if (value.search(\":\") > 0 && value.search(\"-\") <= 0 && (newProp.search(\"tijd\") > 0 || newProp.search(\"time\") > 0 )) { // is it ONLY time?\n\n value = parseTimeHourMinute(value);\n if (value != undefined) {\n var hours = value.getHours();\n value = Math.round((value.getMinutes() / 60) + hours);\n }\n } else if (convertedToNumber && !isNaN(convertedToNumber)) { // Is it a number?\n value = convertedToNumber;\n }\n\n // remove old data, with old index.\n delete data[prop];\n\n if ((!mustBeFilledIn[newProp]) || (value != \"undefined\" && value != null && value !== \"\")) { // OK property is correct.\n\n // lets assign it to the new index.\n data[newProp] = value;\n\n // drop the check count till it is zero. Zero = OK\n checks--;\n\n } else { // Property NOT OK, break the property check loop\n break;\n }\n }\n\n // this will allow me to debug the item and see where it came from.\n data.debugIndex = i;\n\n // give it an id. Which is actually the same value as the debugIndex. But can be used for NON debug purposes, this is done for definition purposes.\n data.id = i;\n\n // item is invalid remove it.\n if (checks !== 0) {\n allData.splice(i, 1);\n }\n\n } else { // no item found? Shouldn't be happening, but just incase remove it.\n allData.splice(i, 1);\n }\n }\n\n // sort the date.\n allData = allData.sort(sortByDateAscending);\n\n return allData;\n }\n return false;\n}", "title": "" }, { "docid": "fc486f107a9c4a879f6198998027f9b8", "score": "0.54479355", "text": "function table(data) {\n tbody.html(\"\");\n data.forEach((dataRow) => {\n var row = tbody.append(\"tr\");\n Object.values(dataRow).forEach((val) => {\n var ufosightings = row.append(\"td\");\n ufosightings.text(val);\n }\n );\n });\n}", "title": "" }, { "docid": "f6c47e8b996bd152d31ee2ae16dce449", "score": "0.5444763", "text": "function generateTable(table, data) {\n let tbody = table.createTBody();\n tbody.className = \".styled-table\";\n for (let element of data) {\n let row = tbody.insertRow();\n for (key in element) {\n if (key == \"symbol\") {\n let cell = row.insertCell();\n let text = document.createTextNode(element[key]); \n cell.appendChild(text);\n cell.className = \".styled-table\";\n cell.id = \"symbol\";\n } else if (key == \"weight\") {\n let cell = row.insertCell();\n let text = document.createTextNode(element[key].toFixed(1) + \" %\"); \n cell.appendChild(text);\n cell.className = \".styled-table\";\n cell.id = \"weight\";\n } else if (key == \"sharePrice\") {\n let cell = row.insertCell();\n if (element[key] != ''){\n let text = document.createTextNode(\"$ \" + commaSeparators(element[key].toFixed(2)));\n cell.appendChild(text);\n } else {\n let text = document.createTextNode('');\n cell.appendChild(text);\n }\n cell.className = \".styled-table\";\n cell.id = \"sharePrice\";\n } else if (key == \"shares\") {\n let cell = row.insertCell();\n let text = document.createTextNode(element[key]); \n cell.appendChild(text);\n cell.className = \".styled-table\";\n cell.id = \"shares\";\n } else if (key == \"cost\") {\n let cell = row.insertCell();\n let text = document.createTextNode(element[key]); \n cell.appendChild(text);\n cell.className = \".styled-table\";\n cell.id = \"cost\";\n } else if (key == \"currentYield\") {\n let cell = row.insertCell();\n let text = document.createTextNode(element[key]); \n cell.appendChild(text);\n cell.className = \".styled-table\";\n cell.id = \"currentYield\";\n } else {\n let cell = row.insertCell();\n let text = document.createTextNode(element[key]); \n cell.appendChild(text);\n cell.className = \".styled-table\";\n cell.id = \"other\";\n }\n }\n }\n}", "title": "" }, { "docid": "955727849f7fd3ce97a1253567101867", "score": "0.54373235", "text": "function addTable(){\n alienData.forEach(aliens =>{\n\t\t// Creating the rows for each line\n var row = tbody.append(\"tr\");\n\t\t// Creating the cells and appending values \n columns.forEach(column => {\n\t\t\t// Formating the entries for City, State and Country to show them in upper case\n if(column ==\"city\" || column ==\"state\" ||column == \"country\"){\n row.append(\"td\").text(aliens[column].toUpperCase());\n }\n\t\t\t // Append the shape, duration and comment values\n else row.append(\"td\").text(aliens[column]); \n })\n })\n}", "title": "" }, { "docid": "357caec6bd861b753e2cdbf91e107c0e", "score": "0.5436766", "text": "function buildTable(data) {\n // First, clear out any existing data\n tbody.html(\"\");\n\n // Next, loop through each object in the data\n // and append a row and cells for each value in the row\n data.forEach((dataRow) => {\n // Append a row to the table body\n let row = tbody.append(\"tr\");\n\n // Loop through each field in the dataRow and add\n // each value as a table cell (td)\n Object.values(dataRow).forEach((val) => {\n let cell = row.append(\"td\");\n cell.text(val);\n });\n });\n}", "title": "" }, { "docid": "8f3052c7f8745053624648240cda7ad2", "score": "0.54359984", "text": "function fillTable(tableData) {\n for (let i = 0; i < tableData.length; ++i) {\n for (let j = 0; j < columnHeaders.length; ++j) {\n //if tableCell is declared at the top of the construct, there will be one massive td\n let tableCell = document.createElement('td');\n tableCell.appendChild(document.createTextNode(tableData[i][columnHeaders[j]] || ''));\n tableRow.appendChild(tableCell);\n }\n fullTable.appendChild(tableRow);\n }\n tableContainer.appendChild(fullTable);\n }", "title": "" }, { "docid": "03518b8e2737febbb0eedd9d4a077153", "score": "0.5430874", "text": "function PopulateTable() {\n $.getJSON(\"api/DevTest\")\n .done(function (data) {\n $.each(data, function (key, item) {\n $('#tableInfo').append(\n '<tr><td>' + item.Name +\n '</td><td>' + item.Price.toFixed(2) +\n '</td><td>' + item.CurrencyCode +\n '</td><td><a onclick=\"ViewProduct(' + item.ID + ');\">details</a>' +\n '</td></tr>');\n })\n $('#myTable').dataTable();\n })\n}", "title": "" }, { "docid": "950b836ccd849e5fb6cd4c5321677c9b", "score": "0.54282314", "text": "function UpdateFlightTable(id){\r\n\tconsole.log(Mission_List);\r\n\tdocument.getElementById(\"tbody-mission-list\").innerHTML = `\r\n\t<tr>\r\n\t <th>#</th>\r\n\t <th>Command</th>\r\n\t <th width=\"210px\">Lon</th>\r\n\t <th width=\"210px\">Lat</th>\r\n\t <th>Alt</th>\r\n\t <th width=\"210px\">Aksi</th>\r\n\t</tr>\r\n\t`;\r\n\tvar currentMission = Mission_List.get(id);\r\n\r\n\tif(currentMission){\r\n\t\tvar counter = 0;\r\n\t\tfor(var i=0; i<currentMission.length; i++){\r\n\t\t\tvar data = currentMission[i];\r\n\t\t\tif (data.TYPE == \"HOME\"){\r\n\t\t\t\t// addMissionRow(i+1, data.ID, data.COMMAND, HomePoint_List.get(Number(data.ID)), data.ALT, 0, 0);\r\n\t\t\t} else if (data.TYPE == \"POINT\") {\r\n\t\t\t\taddMissionRow(counter, data.ID, data.COMMAND, WayPoint_List.get(Number(data.ID)), data.ALT, 0, 0);\r\n\t\t\t}else{\r\n\t\t\t\taddMissionRow(counter, data.ID, data.COMMAND, data.COORDS, data.ALT, 0, 0);\r\n\t\t\t}\r\n\t\t\tcounter++;\r\n\t\t}\t\r\n\t}\r\n}", "title": "" }, { "docid": "5478a3a111735ccadf049c9e776400d1", "score": "0.54257727", "text": "formatData (data) {\n this.tableData = []\n let nowTime = Date.now()\n for (let i = 0, len = data.length; i < len; i++) {\n let dataObj = data[i]\n if (dataObj.status === 0) {\n this.getHistoryState(dataObj._id, dataObj.key, i)\n }\n if (dataObj.gId) {\n this.getGName(dataObj.gId, i)\n }\n if (dataObj.pubKey) {\n this.getAccountName(dataObj.pubKey, i)\n }\n this.tableData.push(dataObj)\n this.loading.history = false\n }\n }", "title": "" }, { "docid": "804affcb7429fbb81ef7768fca2a46ed", "score": "0.5424298", "text": "function updateTable(dataset) {\n dataset.forEach(function(sight) {\n \n var row = tbody.append('tr');\n Object.entries(sight).forEach(function([key,value]) {\n \n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "3d9a1f5407889dab78d85a3f16a0a47d", "score": "0.54226756", "text": "function buildTable(data) {\n // clear the data\n tbody.html (\"\");\n \n // chain a for loop to the data\n data.forEach((dataRow) => {\n // append a row to the table body\n let row = tbody.append(\"tr\");\n \n // loop through each field in dataRow argument\n Object.values(dataRow).forEach ((val) => {\n let cell = row.append(\"td\");\n cell.text(val);\n }\n );\n });\n}", "title": "" }, { "docid": "486456268704592bd781d476823b3486", "score": "0.54226685", "text": "function priencheTable(data, tDoc, workflow) {\n var DocProgramado = data;\n var tam = $(DocProgramado).find('sittingend_date').length;\n var local = $(DocProgramado).find('venueshort_name');\n var dataInicio = $(DocProgramado).find('sittingstart_date');\n var tipoDoc = $(DocProgramado).find(tDoc);\n x = parseInt($(DocProgramado).find('TotalDoc').text());\n\n $('#tableT').dataTable().fnClearTable();\n for (i = 0; i < tam; i++) {\n //insere dados na tabela\n dataT = dataInicio[i].textContent.split('T');\n dataC = [workflow[tipoDoc[i].textContent], local[i].textContent, alterFormatData(dataT[0])];\n $('#tableT').dataTable().fnAddData(dataC);\n }\n}", "title": "" }, { "docid": "92b2df84eee796bac90b583e2d473b20", "score": "0.541892", "text": "function writeTable(id, arr){\n\t\n\tvar rowCount = 0;\n\tvar colCount = 0;\n\t\n\t$(`table#${id} tr`).each(function() {\n\t\tvar tableData = $(this).find('td');\n\t\tif (tableData.length > 0) {\n\t\t\ttableData.each(function() {\n\t\t\t\t$(this).children().first().val(arr[rowCount][colCount]);\n\t\t\t\tcolCount++;\n\t\t\t});\n\t\t\tcolCount = 0;\n\t\t\trowCount++;\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3bd5548657261e32e6d98befebd3dfac", "score": "0.54045737", "text": "function updateTable() {\n var tableOpen = (tableID === 'table-open');\n var row = ''; //the new row <tr> of the table\n for (var i = 0; i < countOfRows; i++) { //for all rows of the table\n //Get the current row\n var rowOfTable = $(table).find('tr:eq( ' + i + ')');\n row = '<tr>';\n //if necessary record exist in the table\n if (tableValue[i + k * (pageNumber - 1)]) {\n //the loop by keys\n for (var key in keys) {\n //add column with data\n var templ = parseFloat(tableValue[i + k * (pageNumber - 1)][keys[key]]);\n if (templ) {\n if ((keys[key] !== 'Date') && (keys[key] !== 'Id'))\n row += '<td>' + templ.toFixed(8) + '</td>';\n else\n if (keys[key] === 'Date') {\n row += '<td>' + tableValue[i + k * (pageNumber - 1)][keys[key]] + '</td>';\n }\n } else {\n row += '<td>' + tableValue[i + k * (pageNumber - 1)][keys[key]] + '</td>';\n\n }\n }\n\n if (tableOpen) {\n row += '<td class=\"delete\" data-mooid=\"' + tableValue[i]['Id'] + '\"><img src=\"/images/cross.png\" style=\"width: 20px;\"></td>';\n }\n row += '</tr>';\n //if the current row in the table is not existing\n if (rowOfTable.length === 0) {\n //but we need more then rows are\n if (countOfRows > $(table).find('tr').length)\n //add row\n $(table).append(row);\n } else {\n //if just update\n if (countOfRows >= $(table).find('tr').length) {\n $(rowOfTable).replaceWith(row);\n } else {\n //if table is too small\n $(rowOfTable).remove();\n }\n }\n } else {\n if (rowOfTable.length > 0) {\n row = '<tr>';\n for (var key in keys) {\n row += '<td></td>';\n }\n ;\n row += '</tr>';\n $(rowOfTable).replaceWith(row);\n }\n }\n ;\n }\n ;\n }", "title": "" }, { "docid": "54f81e162d6e65cb367aeeea26efcb6d", "score": "0.53989124", "text": "function updateTable(update, id) {\n goal_config.updateOne(update, id, function (data) {\n console.log(`Updated ${id}: ${update}`)\n console.log(data)\n });\n\n\n\n}", "title": "" }, { "docid": "e03dd4e4789ae02f4d1e100618473585", "score": "0.53880864", "text": "function AppendData(table, rows, cells, numberOfFields)\n{\n var tbody = document.createElement('tbody');\n AppendCellsToRows(rows, cells, numberOfFields);\n AppendRowsToTable(table, tbody, rows);\n GiveRowsAnIdBasedOnCellsData(rows);\n}", "title": "" }, { "docid": "d56acb51360b4f52af3795d0aa96a855", "score": "0.53841084", "text": "function renderTableTo ( toId, data, hdrCfg, p_rowCfg ) {\n\tvar out = [];\n\n\tout.push ( '<table class=\"table ', hdrCfg.TableClass, '\">\\n' );\n\n\t// -------------------- header ------------------------------------------------------------------\n\tout.push ( ' <thead>\\n' );\n\tout.push ( ' <tr>\\n' );\n\tfor ( var ii = 0, mx = hdrCfg.ColNames.length; ii < mx; ii++ ) {\n\t\tout.push ( \" <th>\", hdrCfg.ColNames[ii].Name, \"</th>\\n\" );\n\t}\n\tout.push ( ' </tr>\\n' );\n\tout.push ( ' </thead>\\n' );\n\n\t// -------------------- body ------------------------------------------------------------------\n\tout.push ( ' <tbody>\\n' );\n\t// xyzzy -- TODO -- xyzzy\n\tfor ( var ii = 0, mx = data.length; ii < mx; ii++ ) {\n\t\tout.push ( ' <tr>\\n' );\n\t\tvar row = data[ii];\n\t\trow[\"_rowNum_\"] = ii;\n\t\tfor ( var jj = 0, my = p_rowCfg.cols.length; jj < my ; jj++ ) {\n\t\t\tvar rowCfg = p_rowCfg.cols[jj];\n\t\t\tvar colName = rowCfg.Name;\n\t\t\tvar fx1 = rowCfg.fx;\n\t\t\tvar colData = row[colName];\n\t\t\tif ( rowCfg.RawName ) {\n\t\t\t\trow[rowCfg.Name] = row[rowCfg.RawName];\n\t\t\t\tcolData = row[rowCfg.RawName];\n\t\t\t\t// console.log ( \"RawName\", rowCfg.RawName, \"name\", rowCfg.Name );\n\t\t\t}\n\t\t\tif ( ! colData ) {\n\t\t\t\tcolData = \"\";\n\t\t\t\tif ( rowCfg.defaltValue ) {\n\t\t\t\t\tcolData = rowCfg.defaltValue;\n\t\t\t\t}\n\t\t\t} else if ( rowCfg.defaultIfEmpty && colData == \"\" ) {\n\t\t\t\tcolData = rowCfg.defaltIfEmpty;\n\t\t\t}\n\t\t\t// add template - by Col Pos, by Row/Col pos override.\n\t\t\tif ( rowCfg.rowTmpl ) {\n\t\t\t\t// console.log ( \"Calling qt with\", rowCfg.rowTmpl, row);\n\t\t\t\tcolData = qt(rowCfg.rowTmpl, row);\n\t\t\t} \n\t\t\tif ( rowCfg.rowColTmpl && rowCfg.rowColTmpl[jj] ) {\n\t\t\t\t// xyzzy - this needs work.\n\t\t\t\tcolData = qt(rowCfg.rowColTmpl[jj], row);\n\t\t\t}\n\t\t\t// xyzzy - TODO add in col-position _1st, _last, _odd, _even\n\t\t\t// xyzzy - TODO - check for func, template etc...\n\t\t\tif ( typeof fx1 === \"function\" ) {\n\t\t\t\tout.push ( fx1 ( colData, row, data, ii, jj, colName ) );\n\t\t\t} else {\n\t\t\t\tout.push ( ' <td>', colData , '</td>\\n' );\n\t\t\t}\n\n\t\t} \n\t\tout.push ( ' </tr>\\n' );\n\t}\n\tout.push ( ' </tbody>\\n' );\n\n\tout.push ( '</table>\\n' );\n\n\tvar sOut = out.join(\"\");\n\t// console.log ( sOut );\n\n\t$(toId).html ( sOut );\n}", "title": "" }, { "docid": "bf50354689580d8b162beef8a0642b13", "score": "0.5374134", "text": "function addTable(id, name, content) {\n let table = ParseTable(name, content);\n\n // Record the table for later use.\n tables.set(table.name, table);\n\n // Send back a small version of the table, without too many rows\n // (Note that columns are also limited but must fully sent.)\n let rows = table.getSampleRows();\n worker.postMessage({type: 'result', id: id,\n result: [table.name, table.cols, rows, table.ncols, table.nrows]});\n}", "title": "" }, { "docid": "29b4b90c1d59f1d28742fab4113982c9", "score": "0.5372081", "text": "function buildTable(data) {\n\tdata.forEach((ufoReport) => {\n\t var row = tbody.append(\"tr\");\n\t Object.entries(ufoReport).forEach(([key, value]) => {\n\t var cell = tbody.append(\"td\");\n\t cell.text(value);\n\t });\n\t});\n}", "title": "" }, { "docid": "ca0939914734a5ab0ce62d3dc415f1fd", "score": "0.53646624", "text": "function buildTable(data) {\n // When the page loads, it needs to display the table\n // But if the table reloads then you may need to ensure the \n // previous output is cleared/overwritten from scratch \n\n // Think of the class activities for generating tables\n\n}", "title": "" } ]
33711812408f87dc11d8357b6088777c
1 cup of veg oil vol of unit ingredient[density]
[ { "docid": "293fbd95ca6f5177c935ff68ed9391b3", "score": "0.5183903", "text": "function convertToGrams(qty, units, ingredient){\r\n \r\n // load ingredient density info from DB\r\n var servingModifierLUT = loadServingModifierLUT();\r\n\r\n // load volume of units info from DB\r\n var unitsToVolume = loadUnitsToVolume();\r\n \r\n singular_igdt = singular(ingredient);\r\n \r\n try {\r\n if ( servingModifierLUT[singular_igdt] === undefined) {\r\n return qty * unitsToVolume[units] * 1.0; \r\n } else {\r\n return qty * unitsToVolume[units] * servingModifierLUT[singular_igdt]['density']; \r\n }\r\n \r\n } catch(err) {\r\n console.log(`**** WARNING: convertToGrams - DB lookup MISS: qty:${qty} units:${units} ingredient:${ingredient}(${singular_igdt}) vol:${unitsToVolume[units]}`);\r\n return 99999; // it's BIG to notice somethings wrong!\r\n }\r\n \r\n}", "title": "" } ]
[ { "docid": "52845ea365b6061c8ebddd9d694634c2", "score": "0.61360955", "text": "get density() {}", "title": "" }, { "docid": "1d4704ff1c7d4f2fe5476ca6d8b41a77", "score": "0.5910944", "text": "get actualDensity() {\n return this.i.g;\n }", "title": "" }, { "docid": "910d0fe2de663a367f5062cdaef9a115", "score": "0.5894213", "text": "getDensity(){\n // Get the density of the solute with ratio to its mass\n var total = this.solute.getVolume();\n\n // Get the density of all solvents with ratio to their masses\n let solvs = this.solvents;\n for(var i = 0; i < solvs.length; i++){\n total += solvs[i].getVolume();\n }\n\n // Determine the final density based on the relative masses of the solute and solvents\n return total / this.getMass();\n }", "title": "" }, { "docid": "26f7c81293f5d0555fb0531a5eb0b3e0", "score": "0.58508617", "text": "get density() {\n return this.i.d;\n }", "title": "" }, { "docid": "2c45a914f965dd6d4843f211696e6fb3", "score": "0.58304167", "text": "get density() {\n return this.i.h;\n }", "title": "" }, { "docid": "4b3623c25fba199a5b67c1f62561bb74", "score": "0.58224666", "text": "function calc_og() {\n var og = 0.0;\n var SG = 0;\n recipe.grain_bill.forEach(function(grain) {\n var pts = grain.ppg.slice(-2);\n var tmp = parseFloat(grain.amount) * parseInt(pts) * 0.75 / 5.5;\n SG += tmp;\n });\n if (og < 100) {\n og = \"1.0\" + Math.round(SG);\n } else {\n og = \"1.\" + Math.round(SG);\n } \n return og;\n}", "title": "" }, { "docid": "42d50f6e464c0d944b82f37ce7e26076", "score": "0.58021975", "text": "set density(value) {}", "title": "" }, { "docid": "1aeb2edcedb1e8608c754d4b96c934c6", "score": "0.5800903", "text": "get density() {\n return this.i.m;\n }", "title": "" }, { "docid": "457a77b4c9a77fea50e96fe9fb279681", "score": "0.57442707", "text": "function precioSandwich(tomate,papa,huevo) {\n let precioBase = 150;\n let precioFinal = precioBase;\n let ingredientes = [\"tomate\", \"papa\", \"huevo\"];\n\n for (let i = 0; i < ingredientes.length; i++) {\n const elemento = ingredientes[i];\n switch (elemento) {\n case \"tomate\":\n tomate ? precioFinal += 20 : precioFinal;\n break;\n case \"papa\":\n papa ? precioFinal += 50 : precioFinal;\n break;\n default:\n huevo ? precioFinal += 60 : precioFinal;\n } \n }\n\n return \"El precio final del sandwich es $\" + precioFinal;\n}", "title": "" }, { "docid": "ffdd42205b80fd0bbeec719762223edf", "score": "0.5735313", "text": "function calcNutrientX(ingredients) {\n\n ingredients.modified_vitamin_A = (ingredients.vitamin_A * ingredients.quantity);\n // truncating results to 2 decimal places\n ingredients.modified_vitamin_A = Math.round((ingredients.modified_vitamin_A + 0.00001) * 100) / 100;\n\n ingredients.modified_vitamin_B = (ingredients.vitamin_B * ingredients.quantity);\n // truncating results to 2 decimal places\n ingredients.modified_vitamin_B = Math.round((ingredients.modified_vitamin_B + 0.00001) * 100) / 100;\n\n messageDetailedPrint += printOut(ingredients, \"Modified Vitamin A\", ingredients.modified_vitamin_A, ingredients.vitamin_A, ingredients.quantity);\n messageDetailedPrint += printOut(ingredients, \"Modified Vitamin B\", ingredients.modified_vitamin_B, ingredients.vitamin_B, ingredients.quantity);\n\n resultsDiv2.innerHTML = messageDetailedPrint;\n // push the modified ingredient to the sampleMeal array.\n sampleMeal.push(ingredients);\n }", "title": "" }, { "docid": "b1e44673db29f8beb8d5c933dafc9dc6", "score": "0.5710588", "text": "function calculateMeta(ingredient) {\n var metadata = {\n cost: 0,\n weight: 0,\n costPerUnit: 0\n };\n ingredient.recipe.madeWith.forEach(function (item) {\n metadata.cost += item.ingredient.cost;\n metadata.weight += item.ingredient.weight;\n });\n metadata.cost = +metadata.cost.toFixed(2); // Set to 2 decimal places\n metadata.weight = +metadata.weight.toFixed(2);\n metadata.costPerUnit += +(metadata.cost / (metadata.weight / 1000)).toFixed(2); // Assume one unit to be 1 kg / 1000 g\n ingredient.cost = metadata.cost;\n ingredient.weight = metadata.weight;\n return metadata;\n}", "title": "" }, { "docid": "88753c6acf84ec88e764d7ec7a70254c", "score": "0.5679983", "text": "get actualDensity() {\n return this.i.l;\n }", "title": "" }, { "docid": "33461de67259d1926cf8974e727fe73c", "score": "0.5639445", "text": "function cholesterol_in_mg_per_dl(v) {\r\n if (v.valueQuantity.unit === \"mg/dL\"){\r\n return parseFloat(v.valueQuantity.value);\r\n }\r\n else if (v.valueQuantity.unit === \"mmol/L\"){\r\n return parseFloat(v.valueQuantity.value) / 0.026;\r\n }\r\n throw \"Unanticipated cholesterol units: \" + v.valueQuantity.unit;\r\n}", "title": "" }, { "docid": "9deb2a2af9f40d002fd5a21b874654ea", "score": "0.5619436", "text": "function aumentarVelocidad() {\n multiplicadorVelocidad *= 1.62;\n}", "title": "" }, { "docid": "c2be8633f8885ed4c283eadeb7a50e34", "score": "0.560982", "text": "function sumProduct(attributes, volumes, remove_str) {\n\tvar accumulator = 0;\n\t$.each(attributes, function(index){\n\t\tvar percent = parseFloat($(this).html().replace(remove_str, \"\"));\n\t\tvar vint_id\t= $(this).parent().attr(\"data-id\");\n\t\t$.each(volumes, function(index, value){\n\t\t\tif (value[\"id\"] == vint_id) {\n\t\t\t\taccumulator += percent * value[\"volume\"];\n\t\t\t\treturn false\n\t\t\t}\n\t\t});\n\t});\n\treturn accumulator\n}", "title": "" }, { "docid": "862a452e08dac2d1519ad72dca554d65", "score": "0.55443645", "text": "function bakePie(ingredient){\n\treturn \"Today's special ingredient pie is: \" + ingredient;\n}", "title": "" }, { "docid": "eea0134e8e2b4a341f5fd0e718dc3868", "score": "0.5517716", "text": "function getWeightUnit(ingredientType) {\n return ingredientType == 'malts' ? gon.userPref.weight_big : gon.userPref.weight_small;\n}", "title": "" }, { "docid": "08e8e759ddbf9ce8b9e80b67c73e4191", "score": "0.54747325", "text": "function normalizeDesirability() {\n //Adds up all of the desirability values\n var sum = 0;\n for(var i = 0; i < populationDensity; i++){\n sum = sum + desirability[i];\n }\n //Transforms each value into it's relevant percentage of the total desirability\n for(var i = 0; i < populationDensity; i++){\n desirability[i] = desirability[i] / sum;\n }\n}", "title": "" }, { "docid": "05441c29db4ec8b8f8af42f724eb7635", "score": "0.547446", "text": "Ceg(){\n return this.endgrain ? 0.67 : 1\n }", "title": "" }, { "docid": "43a563ac19e502d71c8e75d0c81d223f", "score": "0.5463455", "text": "function foodFor4People(originalFood){\n \n return originalFood/4\n}", "title": "" }, { "docid": "0d4785163fd3d83133433d314209ee6a", "score": "0.5450346", "text": "function calcFuel(mass) {\n return Math.floor(mass / 3) - 2;\n}", "title": "" }, { "docid": "839032fbe0b69f583b4e1527afc1a87f", "score": "0.54393756", "text": "function getQuest(quest) {\n var quantities;\n var newQuantity;\n var result = \"\";\n otherQuantity.ingredients.forEach(element => {\n var {quantity,iconUrl,name,unit} = element;\n quantities = quantity/oldGuest;\n newQuantity = quantities*quest;\n result += `\n <tr>\n <th><img src=\"${iconUrl}\" width=\"100\"></th>\n <th>${name}</th>\n <th>${newQuantity}</th>\n <th>${unit[0]}</th>\n </tr>\n `;\n });\n $(\"#ingredients\").html(result);\n}", "title": "" }, { "docid": "943b35fa807e65848f7bc68336f89452", "score": "0.54383194", "text": "function calculateDensity(mass, volume) {\n var density = mass / volume;\n return density;\n}", "title": "" }, { "docid": "a4f80ba2230286a5bd57c603a0e6057f", "score": "0.5416006", "text": "tsunami() {\n\t const toter=volcanoes.length;\n\t const tsu= volcanoes.filter((tsu) => {\n\t\treturn tsu.TSU =='TSU' ;\n\t\t\t\n\t\t});\n\t\tconst perc=(tsu.length/toter)* 100 \n\t\tconsole.log(perc);\n\t }", "title": "" }, { "docid": "ed29a20ac0725609f6bed921f92ef1bb", "score": "0.53992087", "text": "function calculateCalories(ingredients) {\n let sum = 0;\n for (let i = 0; i < ingredients.length; ++i) {\n sum += ingredients[i] * DATA[INGREDIENTS[i]].calories;\n }\n return sum;\n }", "title": "" }, { "docid": "7a5b92f9fbdd159337146299f2283091", "score": "0.53723323", "text": "function getVolume(){\n return (2 * Math.PI * this.radius * this.radius * this.height).toFixed(4)\n}", "title": "" }, { "docid": "21942b99cdd1e59a86f09400ec744144", "score": "0.53524727", "text": "function getServingWeight(qty, ingredient, modifier='medium'){\r\n \r\n var servingModifierLUT = loadServingModifierLUT(); // TODO implement DB table\r\n var qty = parseInt(qty);\r\n var size = 0;\r\n var validModifers = ['xs', 'small', 'medium', 'large', 'xl', 'mahoosive'];\r\n if ( !validModifers.includes(modifier) ){\r\n modifier='medium';\r\n };\r\n \r\n // quick dirty bounds check\r\n if (modifier === 'xs')\r\n { modifier = 'small'; };\r\n \r\n if ( (modifier === 'xl') || (modifier === 'mahoosive') )\r\n { modifier = 'large'; };\r\n \r\n singular_igdt = singular(ingredient);\r\n \r\n try { \r\n size = servingModifierLUT[singular_igdt][modifier];\r\n console.log(`*> servingModifierLUT: ${modifier} ${ingredient}(${singular_igdt}) = ${size} <`);\r\n \r\n } catch(err) { \r\n console.log(`**** WARNING: getServingWeight - DB lookup MISS: ${modifier} ${ingredient}(${singular_igdt})`);\r\n return 99999; // it's BIG to notice somethings wrong!\r\n }\r\n \r\n return qty * size; \r\n}", "title": "" }, { "docid": "33277c74dca67417ac974bfab073c5e9", "score": "0.5345438", "text": "Cfu(){\n\t\tif(this.flat){\n\t\t\tif(this.d<=3){\n\t\t\t\treturn (this.b <= 3) ? 1:1\n\t\t\t}\n\t\t\tif(this.d<=4){\n\t\t\t\treturn (this.b <= 3) ? 1.1:1\n\t\t\t}\n\t\t\tif(this.d<=5){\n\t\t\t\treturn (this.b <= 3) ? 1.1:1.05\n\t\t\t}\n\t\t\tif(this.d<=10){\n\t\t\t\treturn (this.b <= 3) ? 1.15:1.05\n\t\t\t}\n\t\t\tif(this.d>=10){\n\t\t\t\treturn (this.b <= 3) ? 1.2:1.1\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\treturn 1\n\t\t}\n\t}", "title": "" }, { "docid": "abe8512acbdca7580e18e157b1039eab", "score": "0.53329605", "text": "get GearWeight () {\n return this.returnWithDescripition(this.Inventory.reduce((i, j) => i + (j.WeightCounts ? j.Weight : 0), 0), '')\n }", "title": "" }, { "docid": "3e5dd74b184d0dbf272b1c2be5356f33", "score": "0.5331779", "text": "updateServings (type) {\n //Servings\n const newServings = type === 'dec' ? this.servings - 1 : this.servings + 1;\n this.ingredientAmounts.forEach(ing => {\n ing.count *= (newServings / this.servings);\n // console.log(this.servings)\n });\n //Ingredients\n this.servings = newServings;\n }", "title": "" }, { "docid": "c83233109611a14a7fd7bed0613b8673", "score": "0.53089046", "text": "function macro_nutrients(calories, weight) {\n let protein = weight;\n calories-=protein*4;\n\n let fats = 0.35*weight;\n calories -= fats*9;\n\n let carbs = calories/4;\n\n return {\n protein: Math.round(protein),\n carbs: Math.round(carbs),\n fats: Math.round(fats)\n };\n}", "title": "" }, { "docid": "8834786ae5e47d484a6eb16ee62e6d64", "score": "0.53078634", "text": "function cakes2(recipe, available) {\n return Object.keys(recipe).reduce(function(val, ingredient) {\n return Math.min(Math.floor(available[ingredient] / recipe[ingredient] || 0), val)\n }, Infinity) \n}", "title": "" }, { "docid": "6b7dd745d8a81688efc179d6d717b78f", "score": "0.53008705", "text": "function NutritionFacts(){\r\n\tthis.calories = null;\r\n\tthis.caloriesFat = null;\r\n\tthis.totalFat = null;\r\n\tthis.saturatedFat = null;\r\n\tthis.polyunsaturatedFat = null;\r\n\tthis.monounsaturatedFat = null;\r\n\tthis.transFat = null;\r\n\tthis.cholesterol = null;\r\n\tthis.sodium = null;\r\n\tthis.potassium = null;\r\n\tthis.totalCarbohydrate = null;\r\n\tthis.dietaryFiber = null;\r\n\tthis.sugars = null;\r\n\tthis.otherCarbohydrate = null;\r\n\tthis.protein = null;\r\n\r\n\t/**\r\n\t * @return float\r\n\t */\r\n\tthis.getPoints = function(){\r\n\t\t//var thePoints = this.oldPoints();\r\n\t\tvar thePoints = this.newPoints();\r\n\t\t\r\n\t\tif (thePoints <= 0){\r\n\t\t\treturn 0;\r\n\t\t} else if (thePoints < 1){\r\n\t\t\tthePoints = roundToNearestHalf(thePoints);\r\n\t\t} else {\r\n\t\t\tthePoints = Math.round(thePoints);\r\n\t\t}\r\n\t\t\r\n\t\treturn thePoints;\t\t\r\n\t}\t\t\r\n\t\r\n\t/**\r\n\t * @link http://www.ehow.com/how_2058466_calculate-weight-watchers-points.html\r\n\t * @return float\r\n\t */\t\r\n\tthis.oldPoints = function(){\r\n\t\tvar numGramsFiber = this.dietaryFiber;\r\n\t\tif (numGramsFiber > 4){\r\n\t\t\tnumGramsFiber = 4;\r\n\t\t}\r\n\t\t\r\n\t\treturn (this.calories / 50) + (this.totalFat / 12) - (numGramsFiber / 5);\t\t\r\n\t}\r\n\t\r\n\t/**\r\n\t * @link http://www.diet-blog.com/10/weight_watchers_points_plus.php\r\n\t * @return float\r\n\t */\r\n\tthis.newPoints = function(){\t\t\r\n\t\treturn (this.protein / 10.94) + (this.totalCarbohydrate / 9.17) + (this.totalFat / 3.89) - (this.dietaryFiber / 12.49);\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "f7fccb052725bbbb77b1b1716252c376", "score": "0.5288553", "text": "function jp7() {\n sfSum = skinfoldSum()\n bDensity = 1.112 - (0.00043499 * sfSum) + (0.00000055 * (sfSum * sfSum)) - (0.00028826 * age);\n bFatPercent = ((495 / bDensity) - 450);\n\n console.log('jp7 Calc Fn')\n console.log(sfSum);\n console.log(bDensity);\n console.log(bFatPercent);\n\n document.getElementById(\"result\").innerHTML = bFatPercent.toFixed(2);\n}", "title": "" }, { "docid": "422342149555548f1145e648f938ff1c", "score": "0.5280033", "text": "function calcVolume() {\n return V0 * (1 - piston / wallH);\n }", "title": "" }, { "docid": "f2be94fcb5584dd14a056864927f93c5", "score": "0.5270723", "text": "updateServings(type) {\n const newServings = type === 'dec' ? this.servings - 1 : this.servings + 1\n\n this.ingredients.forEach((el) => {\n el.amount.us.value *= newServings / this.servings\n })\n\n this.servings = newServings\n }", "title": "" }, { "docid": "acea977f2546cc14c1ad04047768dffd", "score": "0.52694976", "text": "sizeCost(){\n if(this.size == small){\n return 7.99;\n }\n if(this.size == medium){\n return 9.99;\n }\n if(this.size == large){\n return 12.99;\n }\n if(this.size == extra large){\n return 15.99;\n }\n }", "title": "" }, { "docid": "22d34d62cb0d6d922a85aefc4fa57aeb", "score": "0.5269406", "text": "unit () {\n return this.mag() > 0 ? this.div(this.mag()) : new Vect()\n }", "title": "" }, { "docid": "fa91c676ff9f5c06ef7052ce1c797def", "score": "0.52606595", "text": "function calculateDVRatio (dvQuantity, dvUnit, quantity, unit) {\n let multiplier = 1;\n if (dvUnit !== unit) {\n if (dvUnit === 'g') {\n if (unit === 'mg') {\n multiplier = 0.001;\n } else {\n return (null);\n }\n } else if (dvUnit === 'mg') {\n if (unit === 'g') {\n multiplier = 1000;\n } else {\n return (null);\n }\n } \n }\n return (quantity/dvQuantity * multiplier * 100).toFixed(0);\n}", "title": "" }, { "docid": "573fe825076ea12b9542beeff920fa37", "score": "0.5260275", "text": "getOccupiedVolume() {\n /* outerReducer: combine the sums of each inner array in the 2d array */\n const outerReducer = (totalVolume, row) => ( row.reduce(innerReducer,0) + totalVolume )\n /* innerReducer: add all the numbers in an array */\n const innerReducer = (totalVol, cell) => ( cell + totalVol )\n return this.heights.reduce(outerReducer,0);\n }", "title": "" }, { "docid": "b1daab5dcda3cefd2364df94fc2a8003", "score": "0.52476794", "text": "function calculateKittens(unit) { //unit taken from user entry\n\t\"use strict\";\n\treturn parseInt(getWeightFromUser() / getKittenWeight(unit, getWeightFromUser()), 10);\n\n}", "title": "" }, { "docid": "cc70da4739c910ee99b643dbebee80e7", "score": "0.5241108", "text": "sumFormations() {\n return this.sumIncidents((f) => { return f.Units.length; });\n }", "title": "" }, { "docid": "5ef500dbc5a5dfd7101d247babd14bf9", "score": "0.5233191", "text": "updateServings (type) {\r\n //servings\r\n const newServings = type === 'dec' ? this.servings - 1 : this.servings +1;\r\n\r\n //Update the ingredients \r\n this.ingredients.forEach(ing =>{\r\n ing.count *=(newServings/this.servings);\r\n });\r\n\r\n \r\n this.servings = newServings;\r\n\r\n\r\n }", "title": "" }, { "docid": "1f679d5d3dfdf7b44c32a671ef5d82d2", "score": "0.5226791", "text": "function servantAtk(atk) {\n // return Math.round(atk / 500) * 5;\n return Math.floor(atk / 100);\n}", "title": "" }, { "docid": "dae46da478b5ecad6d3c552df9aa4910", "score": "0.5222546", "text": "function getIngredientItem(recipePeopleNumber, ingredient, targetPeople = 0) {\n if (targetPeople && targetPeople != 0) {\n var calculatedQuantity =\n (ingredient.quantity * targetPeople) / recipePeopleNumber;\n return (\n calculatedQuantity.toFixed(2) +\n \" \" +\n ingredient.unit +\n \" \" +\n ingredient.name\n );\n }\n return ingredient.quantity + \" \" + ingredient.unit + \" \" + ingredient.name;\n}", "title": "" }, { "docid": "aa0cdcddd5f37bc22db75435a0eeeb82", "score": "0.52125734", "text": "get volume() {\n return (Math.PI * this.radius ** 2 * this.height).toFixed(4);\n }", "title": "" }, { "docid": "9505030c4a77e0064fd881b6589bb0a7", "score": "0.5206453", "text": "get nutrient() {\n\t\treturn this.__nutrient;\n\t}", "title": "" }, { "docid": "07d7f628ae5e8e2b5d2fad64caa57e2f", "score": "0.5200107", "text": "updatePurchaseState(updatedIngredient) {\n const ingredients = {\n ...updatedIngredient,\n };\n\n const sum = Object.keys(ingredients)\n .map((igKey) => {\n return ingredients[igKey]; //its return the value(cnt) salad :1 then it return 1 in place of salad\n })\n .reduce((sum, el) => {\n return sum + el;\n }, 0); //reduce method sums all got values(igKey) and gives direct sum\n\n this.setState({ purchasable: sum > 0 });\n }", "title": "" }, { "docid": "88ddb7c77a0a025770b6903046c1893e", "score": "0.5191736", "text": "function getPricePart2(result)\n{\n //price is per kg,but we use it for grams (1000 times more) <----kostul dlja kalkyljacii v js\n \n ing = JSON.parse(result); \n priceList[ing.Name] = ing.BarPrice*(ing.Unit==\"кг\" ? 1:1000); //set factorised price*1000\n\n $row=$(\".td-active\").closest(\"tr\");\n// TODO: add units ,use g for now \n \n emount = $row.find(\"td:nth-child(2)\").find(\"input\").val(); //get emount of ingredient\n \n $row.find(\"td:nth-child(3)\").contents().filter(function () {\n\t return this.nodeType === 3; \n }).remove();\n //$row.find(\"td:nth-child(3)\").find(\"input\").val(emount*60/100) // auto decrease outcome\n $row.find(\"td:nth-child(3)\").append((ing.Unit == \"кг\" ? \"г\" : ing.Unit));\n $row.find(\"td:nth-child(4)\").empty();\n $row.find(\"td:nth-child(4)\").append(emount*priceList[ing.Name]/1000+\" грн\"); //price per ingredient\n $(\".td-active\").removeClass(\"td-active\");\n\n//update total price\n price = udatePrice();\n\n\n}", "title": "" }, { "docid": "29e0ac224c8d2bcf9efa7497cc1c9828", "score": "0.51753527", "text": "function ingredientesCant() {\r\n this.form.elements['cantIng'].value = parseFloat(this.value);\r\n pedidoTotal(this.form);\r\n}", "title": "" }, { "docid": "24438fc05fb854ba6efa350022139b1c", "score": "0.5166866", "text": "function getdata(outPut) {\n var quantities;\n var newQuanlity;\n var result = \"\";\n getQuanlities.forEach(element => {\n var {quantity,iconUrl,name,unit} = element;\n quantities = quantity/oldGuest;\n newQuanlity = quantities*outPut;\n result += `\n <tr>\n <td><img src=\"${iconUrl}\" style=\"width:50px\"></td>\n <td id='quantity'>${newQuanlity}</td>\n <td>${unit[0].toLowerCase()}</td>\n <td>${name}</td>\n </tr>\n `;\n });\n $('#ingredient').html(result);\n}", "title": "" }, { "docid": "8bdaa4f012a5840664e7d9b31b06c3f8", "score": "0.51599175", "text": "function woodCalculator(chair, table, bed) {\n let totalVolumeOfWood = (chair * 1) + (table * 3) + (bed * 5);\n return totalVolumeOfWood;\n}", "title": "" }, { "docid": "315eaa8e29ed36f24d29d44e5957320d", "score": "0.51535714", "text": "function convertHeatCapacityTo(value, units) {\n if (units == 'J/mol*K') return value;\n else if (units == 'cal/mol*K') return value / 4.184;\n}", "title": "" }, { "docid": "4b80e2ec74f5c7671fd5afeb5e7cd47a", "score": "0.51503927", "text": "calculateDiet() { // calculates results with variables in this.state\n const POUNDS_PER_BEEF_SERVING = 6.61\n const POUNDS_PER_CHEESE_SERVING = 1.35\n\n return ((this.state.beefServings * POUNDS_PER_BEEF_SERVING * 52) +\n (this.state.dairyServings * POUNDS_PER_CHEESE_SERVING * 52))\n }", "title": "" }, { "docid": "737d435c5d02072a62ec73d0592503da", "score": "0.5136075", "text": "updateWeight() {\n let droppedFood = 0;\n let droppedGuns = 0;\n\n // how much can the caravan carry\n this.capacity = this.oxen * Caravan.constants.WEIGHT_PER_OX\n + this.crew * Caravan.constants.WEIGHT_PER_PERSON;\n\n // how much weight do we currently have\n this.weight = this.food * Caravan.constants.FOOD_WEIGHT\n + this.firepower * Caravan.constants.FIREPOWER_WEIGHT;\n\n // drop things behind if it's too much weight\n // assume guns get dropped before food\n while (this.firepower && this.capacity <= this.weight) {\n this.firepower -= 1;\n this.weight -= Caravan.constants.FIREPOWER_WEIGHT;\n droppedGuns += 1;\n }\n\n if (droppedGuns) {\n this.ui.notify(`Left ${droppedGuns} guns behind`, 'negative');\n }\n\n while (this.food && this.capacity <= this.weight) {\n this.food -= 1;\n this.weight -= Caravan.constants.FOOD_WEIGHT;\n droppedFood += 1;\n }\n\n if (droppedFood) {\n this.ui.notify(`Left ${droppedFood} food provisions behind`, 'negative');\n }\n }", "title": "" }, { "docid": "1de6fe29a710e2f91c86915df7f49071", "score": "0.5135763", "text": "addItemToVillage(item) {\n if (item.type === \"Food Vegetable\") {\n let t = this.vegetable + item.quantity;\n if (t < 0) t = 0; // cannot be a negative number\n this.vegetable = t;\n } else if (item.type === \"Food Protein\") {\n let t = this.protein + item.quantity;\n if (t < 0) t = 0;\n this.protein = t;\n }\n }", "title": "" }, { "docid": "135d6375d56193b70cb4638bda296521", "score": "0.51281804", "text": "function inhoud(breedte, hoogte, lengte){\n return breedte * hoogte * lengte;\n}", "title": "" }, { "docid": "3ad7f1ff3291c15eee36fcb7e8ca78a2", "score": "0.51245815", "text": "get volume() {\n return this._quantidade * this._valor;\n }", "title": "" }, { "docid": "c26a742e6838037d51854fe0aac7665a", "score": "0.5113092", "text": "baseAmount() {return tmp.n.dustProduct}", "title": "" }, { "docid": "6e4494157a07b55d2e91a278d3e4a63a", "score": "0.5112689", "text": "function charge(d) {\n return Math.pow(d.radius, 2.0) * 0.01\n }", "title": "" }, { "docid": "406f45ca4cf77a466db040cd972b2453", "score": "0.5107316", "text": "function total_vege_recipes(ndx) {\r\n var veg = ndx.groupAll(dc.pluck('Suitable_for_Vegetarians'));\r\n dc.numberDisplay(\"#veg-recipes\")\r\n .formatNumber(d3.format(\"d\"))\r\n .valueAccessor(function(d){return d; })\r\n .group(ndx.groupAll().reduceSum(function(d) {\r\n count = 0\r\n if (d.Suitable_for_Vegetarians ===\"Yes\") {\r\n count++\r\n return count\r\n } else {\r\n return 0;\r\n }\r\n }));\r\n}", "title": "" }, { "docid": "6986d1bbcb137971234657f5c3fddfcd", "score": "0.5092096", "text": "function totalEnergy(moon) {\n const potential = moon.position.map(Math.abs).reduce((p,c) => p + c, 0)\n const kinetic = moon.velocity.map(Math.abs).reduce((p,c) => p + c, 0)\n return potential * kinetic\n}", "title": "" }, { "docid": "9251af6b44c0253f539d41c0c278b35d", "score": "0.5088995", "text": "function skalowanie(Beata) {\n if (Beata < 20) {\n return 1 * (Beata / 2);\n }\n}", "title": "" }, { "docid": "b06312c1b4d6323e897cca0c567c0edd", "score": "0.5087462", "text": "function small_unit() {\n var maximum = 0;\n var temp = 0;\n //ie. find largest UF to remove / smallest denominator\n for (var counter = 0; counter < factors.length; counter++) {\n if (checkDen(counter)) {\n temp = factors[counter] / ((factors[counter] * inverse) % den);\n if (temp > maximum) {\n maximum = temp;\n }\n }\n }\n //remove UF\n //x-UF/y --> num = num * denOfUF - 1\n var removedNum = maximum;\n //den = den * denOfUF\n var removedDen = den;\n //actual denominator pushed = den/num\n var removed = removedDen / removedNum;\n return removed;\n }", "title": "" }, { "docid": "b4ea4e270a2ecf6f1eec686f7d7e1c0c", "score": "0.50733423", "text": "calculateEnergyProduction() {\n this.consumeResources();\n switch(this.energyType) {\n case 0: // phototrophic\n let energyFactor = (this.lightEfficiency * this.randFactor) + this.randFactor;\n return this.energyProduction * (this.resourcesNeeded[1] / this.resourcesNeeded[0]) * energyFactor; \n case 1: // chemotrophic\n return this.energyProduction * (this.resourcesNeeded[1] / this.resourcesNeeded[0]);\n }\n }", "title": "" }, { "docid": "55f2c8286c02a32931ec2b751a2c2da5", "score": "0.50730383", "text": "function wnCalc($) {\n var weight = parseInt($scope.weight);\n var indice = 38;\n // water you get eating food\n var aliments = (900 / 65) * weight;\n\n wnResult = (weight * indice) - aliments;\n return wnResult;\n }", "title": "" }, { "docid": "673201f523e1666ac6fd3ce37dc3685f", "score": "0.5053738", "text": "function calculateFuelForMass( mass ) {\n return Math.floor( mass / 3 ) - 2;\n}", "title": "" }, { "docid": "cbfd00f3f04eeadbe02fab3230756fed", "score": "0.50428027", "text": "get average() {\n if (this.diamonds.length === 0) return 0;\n\n let sum = 0;\n this.diamonds.forEach(diamond => {\n sum += parseInt(diamond.price, 10);\n });\n return sum / this.diamonds.length;\n }", "title": "" }, { "docid": "93da5ef1f2a065589d1eaee44452d95f", "score": "0.50426006", "text": "static promotionalDeal(pizza,percent){\n let d = 100-percent;\n d = d/100;\n return pizza.price()*d;\n }", "title": "" }, { "docid": "00b12a5fdb4053ec82f267ebd494e707", "score": "0.50350124", "text": "function calculateAvgTipPerMeal() {\n\n}", "title": "" }, { "docid": "1de6337902508982b280c5b328593157", "score": "0.5032923", "text": "function pizzaPSI (pizzaPrice, diameterIn) {\n let costPSI = pizzaPrice/(Math.pow(diameterIn/2, 2) * Math.PI)\n return \"$\" + costPSI.toFixed(2);\n}", "title": "" }, { "docid": "050a3be39bcf58fee5ff7e1950a5ba7c", "score": "0.5032679", "text": "function calculateSU(uni){\n var subnet = Math.floor(uni/16);\n var universe = uni - (subnet * 16)-1;\n return 'ArtNet subnet: <strong>' + subnet + '</strong><br>ArtNet universe: <strong>'+universe+'</strong>';\n}", "title": "" }, { "docid": "5f90ddb7b8f668f4f4cbf78d550d81dd", "score": "0.5011083", "text": "function productSubTotal(article) {\r\n return article.unitCost * article.count;\r\n}", "title": "" }, { "docid": "36c6c7c317e9a83bda722514a8ac1afc", "score": "0.50105894", "text": "function kineticEnergy(m, v){\n return Math.round(0.5 * m * (Math.pow(v, 2)));\n}", "title": "" }, { "docid": "55d00bd850f4a1b1ef1e774764c73b4b", "score": "0.50061655", "text": "calcMetric() {\n return this.numMetWants()[0] + this.numUnwanted();\n }", "title": "" }, { "docid": "960cb8adc8d9f5021b4f71071ae2e0cb", "score": "0.5006145", "text": "function addPopulationDensity (loc) {\n if (loc.population && loc.area && loc.area.landSquareMeters) {\n const pd = (loc.population / loc.area.landSquareMeters) * 1000000\n loc.populationDensity = Math.round(pd * 10000) / 10000\n }\n}", "title": "" }, { "docid": "8244d332bee08b5a7b95f84728dfc153", "score": "0.5000816", "text": "function woodCalculator(length, width, thickness){\r\n var boardFeetInch = length*width*thickness;//All of the dimensions in this formula are in inches\r\n var boardFeet = boardFeetInch/144;\r\n var totalCost = boardFeet * 18;// 1 boardfeet cost is $18\r\n return totalCost;\r\n}", "title": "" }, { "docid": "799d78ed45ac50f98f152791fb609da1", "score": "0.49983376", "text": "Asv(){\r\n return rebar(this.stirrupSize).A * this.noStirrupLegs\r\n }", "title": "" }, { "docid": "e84fedba03795f4c6c7cce13c61227a1", "score": "0.49975076", "text": "function charge(d) {\n return -Math.pow(d.radius, 2.0) / 6;\n }", "title": "" }, { "docid": "9dfb81bb13fca3850cf3aa454828935a", "score": "0.49943593", "text": "function mousson(){\n console.log(\"La conso de la residence est de: \"+residence.getConsumption()+\"L/min\");\n for(var i =0; i<residence.buildingList.length; i++){\n console.log(\"La conso de l'immeuble \"+ residence.buildingList[i].name +\" est de \"+ residence.buildingList[i].getConsumption() +\"L/min\");\n for(var j=0; j<residence.buildingList[i].floorList.length;j++){\n console.log(\"La conso de l'etage \"+ (j+1) + \" est de \"+ residence.buildingList[i].floorList[j].getConsumption() +\"L/min\");\n for(var k=0; k<residence.buildingList[i].floorList[j].appartList.length;k++){\n console.log(\"La conso de l'appart \"+ (k+1) + \" est de \"+ residence.buildingList[i].floorList[j].appartList[k].getConsumption() +\"L/min\");\n }\n }\n }\n}", "title": "" }, { "docid": "2a998f3a25ae9c5a37f44adb16e0767b", "score": "0.49935913", "text": "_getFatigueCost() {\n return this.fatigueCost\n }", "title": "" }, { "docid": "1a00e0cf9b9226fca4433543b62fbe97", "score": "0.49932912", "text": "function calcInPressure() {\n return statVert / stdStatVert;\n }", "title": "" }, { "docid": "b4bffa3fd2065f134c3802e4f1efc1c9", "score": "0.49928957", "text": "function cakes(recipe, available) {\r\n // TODO: insert code\r\n let cakes;\r\n\r\n for (let ingredients in recipe) {\r\n if (available[ingredients]) {\r\n const amountPerCake = recipe[ingredients];\r\n const amoutAvaiable = available[ingredients];\r\n const possibleNumCakes = Math.floor(amoutAvaiable / amountPerCake);\r\n if (!cakes) {\r\n cakes = possibleNumCakes;\r\n } else if (!cakes || possibleNumCakes < cakes) {\r\n cakes = possibleNumCakes;\r\n }\r\n if (cakes == 0) return 0;\r\n } else {\r\n return 0;\r\n }\r\n }\r\n\r\n return cakes;\r\n}", "title": "" }, { "docid": "32ea06cbc5e5ad56137b87722f8ba83d", "score": "0.49911278", "text": "function calcVolCilinder(r, h) {\n V = 3.141592654 * (r ** 2) * (h)\n return V\n}", "title": "" }, { "docid": "d9788afee7c142e8a490dc15018019b8", "score": "0.49861676", "text": "function Affichage_vie(fluctation)\n {\n vie=parseInt(vie,10)+fluctation;\n vie_poucentage=parseInt(vie,10)*100/vie_max;\n $('#vie').css('width', vie_poucentage+'%' );\n \n }", "title": "" }, { "docid": "a482b5cf5ca29cd5545eb4ae1face95c", "score": "0.49856824", "text": "function foodGenLoction() {\n // originally our canvas is not grid by grid\n // now we make every colum is divided by our scale\n var cols = floor(width / scl);\n var rows = floor(height / scl);\n // create a vector as our food in a random spot\n apple = createVector(floor(random(cols)), floor(random(rows)));\n apple.mult(scl);\n}", "title": "" }, { "docid": "ad8823ce1bdfcd3052ce0d5b5338ef77", "score": "0.49803957", "text": "function Vegetable(veggieName) {\n this.name = veggieName;\n this.containerPreference = 'I don\\'t know!';\n this.growingDiameter = 1.0;\n this.sunOrientation = \"I have no clue\";\n this.lovesCold = false;\n\n this.takeGrowthHormone = function(howMuch) {\n \tthis.growingDiameter = this.growingDiameter * howMuch;\n \tconsole.log(\"Yum! Diameter of \" + this.name \n \t\t+ \" is now \" + this.growingDiameter);\n }\n}", "title": "" }, { "docid": "750e762bf6923e7b1d982de95dc1a731", "score": "0.49776608", "text": "parseIngredientAmounts() {\n const unitsLong =['oz', 'dashes', 'portion', 'shots', 'shot', 'Slice', 'tsp', 'tblsp', 'jiggers', 'jigger', 'pinch', 'Fill', 'drop'];\n const unitsShort = ['oz', 'dash', 'portion', 'shots', 'shot', 'slice', 'tsp', 'tbsp', 'jiggers', 'jigger', 'pinch', 'fill', 'drop'];\n //const units = [...unitsShort, 'kg', 'g', 'cl'];\n\n\n const newIngredientAmounts = this.finalList.map(el => {\n //console.log(this.finalList)\n // 1 Uniformize all units\n let newIng = el.charAt(0).toUpperCase() + el.slice(1)\n unitsLong.forEach((unit, i) => {\n newIng = newIng.replace(unit, unitsShort[i]);\n });\n\n // 2 Remove commas\n newIng = newIng.replace(/\\,/g,' ');\n \n // console.log(newIng)\n\n\n // 3 Parse ingredients into count, unit and ingredientes\n const arrMeasures = newIng.split(' ');\n //console.log(arrMeasures)\n const unitIndex = arrMeasures.findIndex(el2 => unitsShort.includes(el2));\n \n let objMeasures;\n if (unitIndex > -1) {\n\n //There is a unit\n const arrCount = arrMeasures.slice(0, unitIndex);\n let count;\n if (arrCount.length === 1) {\n count = eval(arrMeasures[0].replace('-', '+'));\n \n } else {\n // Convert units to eval (4 - 1/2 = 4.5)\n count = eval(arrMeasures.slice(0, unitIndex).join('+'))\n }\n\n objMeasures = {\n count,\n unit: arrMeasures[unitIndex],\n ingredient: arrMeasures.slice(unitIndex + 1).join(' ')\n }\n } else if (parseInt(arrMeasures[0], 10)) {\n \n //There is NO unit, but 1st element is number\n objMeasures = {\n count: (parseInt(arrMeasures[0], 10)),\n unit: '',\n ingredient: arrMeasures.slice(1).join(' ')\n \n }\n } else if (unitIndex === -1) {\n // There is NO unit and NO number in 1st position\n objMeasures = {\n count: 1,\n unit: '',\n ingredient\n }\n } \n return objMeasures;\n });\n this.ingredientAmounts = newIngredientAmounts;\n //console.log(this.ingredientAmounts)\n }", "title": "" }, { "docid": "4802a4a00ebaa8f2c07889a63ea200e2", "score": "0.49725026", "text": "calcTreeDensity(){\n return (this.numberOfTrees / this.parkArea);\n }", "title": "" }, { "docid": "f1ab0ff359c3e2c7393e8d70f64610fd", "score": "0.49720797", "text": "updateImpetus(){\n this.impetus = 2 + (this.soulsOwned * 2);\n }", "title": "" }, { "docid": "1c0d45131d4c7583c6a97fd597635aee", "score": "0.49662364", "text": "parseIngredients (){\n const unitsLong = ['tablespoons', 'tablespoon', 'tbsps', 'ounces', 'ounce', 'ozs','teaspoons', 'teaspoon', 'tsps', 'cups', 'pounds'];\n const unitsShort = ['tbsp', 'tbsp', 'tbsp', 'oz', 'oz', 'oz', 'tsp', 'tsp', 'tsp', 'cup', 'pound']\n // Adding the possibilite of SI units. The destructuring will pass the elements from the array unitsShort as individual elements and we will add the SI elements\n const units = [...unitsShort, 'kg', 'g', 'l', 'ml']\n\n\n const newIngredients = this.ingredients.map(el => {\n // 1) Uniform units\n let ingredient = el.toLowerCase();\n unitsLong.forEach((unit, i)=>{\n ingredient = ingredient.replace(unit, unitsShort[i]);\n });\n\n // 2) Remove parentheses\n ingredient = ingredient.replace(/ *\\([^)]*\\) */g, ' '); \n\n // 3) Parse ingredients into [count, unit and ingredient]\n const arrIng = ingredient.split(' ');\n // This will loop trought the arrIng (.findIndex) and will text if the current element (el2) is present in the units array (.includes)\n const unitIndex = arrIng.findIndex(el2 => units.includes(el2))\n \n\n let objIngredient;\n\n if (unitIndex > -1){\n // There is a unit\n const arrCount = arrIng.slice(0, unitIndex);\n let count;\n if (arrCount.length === 1 ) {\n count = arrIng [0];\n count = count.replace('-','+') // Fix cases like this: 1-1/2 ---> 1+1/2\n count = eval (count); // Calculate the strin considering it aa mathematical equation an returns a number\n\n // this can be done in a single line count = eval(arrIng[0].replace('-','+'))\n }else {\n count = eval (arrIng.slice(0, unitIndex).join('+')); \n };\n\n\n objIngredient = {\n count, //this get the count and assign it to a key of same name ES6\n unit: arrIng[unitIndex],\n ingredient: arrIng.slice(unitIndex + 1).join(' ')\n } \n \n // array.slice (s , e)\n // s -> start element\n // e -> end element (not included)\n // array.slice (s) -> from that element to the end\n\n\n } else if (parseInt(arrIng[0], 10)){\n // There is no unit but the first element is a number\n objIngredient = {\n count: parseInt(arrIng[0], 10),\n unit: '',\n ingredient: arrIng.slice(1).join(' ')\n } \n } else if (unitIndex === -1) {\n // There is NO unit and NO number in 1st position\n objIngredient = {\n count: 1,\n unit: '',\n ingredient //this get the ingredient and assign it to a key of same name ES6\n }\n } \n return objIngredient;\n });\n this.ingredients = newIngredients;\n }", "title": "" }, { "docid": "97a4f8d1edcc4da031c91bb696e545e9", "score": "0.49555016", "text": "updatePurchaseState (ingredients) {\n /* Fancy code to simply sum up all the ingredients */\n const sum = Object.keys(ingredients)\n .map(igKey => {\n return ingredients[igKey]\n })\n .reduce((sum, el) => {\n return sum + el\n }, 0)\n // If we have more than one ingredient, the burger is purchaseable\n return sum > 0\n }", "title": "" }, { "docid": "f8d0389560f5b574641374624d7f2c78", "score": "0.49541113", "text": "Fcry(){\n\t\treturn (0.69*this.E)/Math.pow(this.BF_2TF(),2)\n\t}", "title": "" }, { "docid": "430f50dc462211eb8cbe5ad10d6bc2cc", "score": "0.4953604", "text": "function changeConstructorCounter(target, flag) {\r\n let block = document.getElementsByClassName(\"pizza-constructor__view\")[0];\r\n let elem = target.parentElement.previousSibling.nodeValue;\r\n let properties = document.getElementsByClassName(\"pizza-constructor__properties\")[0];\r\n\r\n let minPrice = 99.99;\r\n let price = +properties.children[2].lastElementChild.innerHTML;\r\n\r\n if(flag) {\r\n let image = document.createElement(\"img\");\r\n image.style.transform = \"rotate(\" + (Math.random() * 346 + 15) + \"deg)\";\r\n for (let i of ingredients)\r\n if (i.name === elem) {\r\n image.setAttribute(\"src\", i.img.substring(i.img.indexOf(\"img\"), i.img.length - 1));\r\n image.setAttribute(\"data-name\", i.name);\r\n price = getChangedPrice(price, i.name, flag);\r\n\r\n (i.name.indexOf(\"Соус\") !== -1) ? block.insertAdjacentElement(\"afterBegin\", image)\r\n : block.appendChild(image);\r\n break;\r\n }\r\n } else if (!flag)\r\n for(let i of [...block.children])\r\n if(i.getAttribute(\"data-name\") === elem) {\r\n block.removeChild(i);\r\n price = getChangedPrice(price, i.getAttribute(\"data-name\"), flag);\r\n break;\r\n }\r\n\r\n let ingredient = [];\r\n for(let i of [...block.children])\r\n ingredient.push(i.getAttribute(\"data-name\"));\r\n\r\n properties.children[1].lastElementChild.innerHTML = getCalories(ingredient);\r\n properties.children[2].lastElementChild.innerHTML = (price <= minPrice) ? minPrice.toFixed(2)\r\n : price.toFixed(2);\r\n}", "title": "" }, { "docid": "7c0bf40816b5be385fc963bca38a716c", "score": "0.49533334", "text": "function cakes(recipe, pantry) {\n var perItem = []\n var lowest;\n \n for( var x in recipe){\n if(pantry[x] === 0 || pantry[x] === undefined) return 0;\n if(lowest === undefined) lowest = Math.floor(pantry[x]/recipe[x]);\n if(pantry[x]/recipe[x] < lowest) lowest = Math.floor(pantry[x]/recipe[x]);\n perItem.push(Math.floor(pantry[x]/recipe[x]))\n }\n return lowest;\n}", "title": "" }, { "docid": "d54947d54bc7ee0efbcaef8bf241e044", "score": "0.49528444", "text": "function veganQuantity(shoppingCart) {\n var result = 0;\n var vegans = []\n vegans = shoppingCart.filter(function (element) {\n if (element.type === \"vegetable\" || element.type === \"fruit\") {\n return element;\n }\n });\n\n vegans.forEach(function (element) {\n result += element.quantity;\n });\n\n\n return result;\n }", "title": "" }, { "docid": "d572cc0fa5e2db66bbb1ad2b161b49d9", "score": "0.49501938", "text": "get totalDeItens() {\n let quantidade = 0;\n\n for (const item of this.itens) {\n quantidade += item.quantidade\n }\n\n return quantidade;\n }", "title": "" }, { "docid": "3b5b42a7b25bc91bfc82657854596f5c", "score": "0.49470004", "text": "function total_vegan_recipes(ndx) {\r\n var vegan = ndx.groupAll(dc.pluck('Suitable_for_Vegans'));\r\n dc.numberDisplay(\"#vegan-recipes\")\r\n .formatNumber(d3.format(\"d\"))\r\n .valueAccessor(function(d){return d; })\r\n .group(ndx.groupAll().reduceSum(function(d) {\r\n count = 0\r\n if (d.Suitable_for_Vegans ===\"Yes\") {\r\n count++\r\n return count\r\n } else {\r\n return 0;\r\n }\r\n }));\r\n}", "title": "" }, { "docid": "ec9b2961b9cbb46a5e53bdb5c172cd41", "score": "0.4946557", "text": "function cakes(recipe, available) {\n let limitingCount = Infinity;\n for(let ingredient in recipe){\n if(!recipe.hasOwnProperty(ingredient)) {continue;} // Skip if ingredient is an inherited property\n let availableIngred = available[ingredient] || 0;\n let currentRatio = availableIngred / recipe[ingredient];\n if(currentRatio < limitingCount){\n limitingCount = currentRatio;\n }\n }\n return Math.floor(limitingCount);\n}", "title": "" }, { "docid": "2b848c272af0c7ed3b3babbd24c89ddb", "score": "0.4939799", "text": "function ingredientImageFilePath(ingredient) {\nreturn \"images/recipe/20px-\" + ingredientImageBaseFileName(ingredient)\n}", "title": "" } ]
2a5fc5d6564145344ab83cb7cc1aac1f
Filter to avoid XSS attacks
[ { "docid": "dfe894cb545c1a3948a665262c46a62d", "score": "0.0", "text": "function urlEncodeIfNecessary(s) {\n\t\tvar regex = /[\\\\\\\"<>\\.;]/;\n\t\tvar hasBadChars = regex.exec(s) != null;\n\t\treturn hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;\n\t}", "title": "" } ]
[ { "docid": "f2f0cae4cd67e409eaac28d9415f6279", "score": "0.7578593", "text": "function sanitizeFilter(str) {\n return str.replace(rscripts, \"\").replace(ropen, function (a, b) {\n var match = a.toLowerCase().match(/<(\\w+)\\s/)\n if (match) {\n //处理a标签的href属性,img标签的src属性,form标签的action属性\n var reg = rsanitize[match[1]]\n if (reg) {\n a = a.replace(reg, function (s, name, value) {\n var quote = value.charAt(0)\n return name + \"=\" + quote + \"javascript:void(0)\" + quote // jshint ignore:line\n })\n }\n }\n return a.replace(ron, \" \").replace(/\\s+/g, \" \") //移除onXXX事件\n })\n }", "title": "" }, { "docid": "238537b232dcdcee42cc4dc532940914", "score": "0.69770074", "text": "function preventXSS(str) {\n return str.replace(/\\</g, '&lt').replace(/\\>/g, '&gt').replace(/\\&/, '&amp');\n}", "title": "" }, { "docid": "0808648c5c257f990c70b7f4463444cd", "score": "0.67833096", "text": "function sanitizeXSS(val) { \n if(val == null || typeof(val) != \"string\")\n return val; \n val = val.replace(/</g, \"&lt;\"); //replace < whose unicode is \\u003c \n val = val.replace(/>/g, \"&gt;\"); //replace > whose unicode is \\u003e \n return val;\n}", "title": "" }, { "docid": "9c5ca3c4ae77bdccf8558ee638012540", "score": "0.66737616", "text": "function sanitizeInput(input){\n input = input.replace(/>/g, \"&gt;\");\n input = input.replace(/</g, \"&lt;\");\n input = input.replace(/\"/g, \"&quot;\");\n input = input.replace(/'/g, \"&#x27;\");\n input = input.replace(/&/g, \"&amp;\");\n input = input.replace(/\\//g, \"&#x2F;\");\n return(input);\n}", "title": "" }, { "docid": "c89d066871f0ee6bb398170ce8f55177", "score": "0.660466", "text": "function filterData(data){\r\n\t//data = data.replace(/<?/body[^>]*>/g,'');\r\n\tdata = data.replace(/[r|n]+/g,'');\r\n\t//data = data.replace(/<--[Ss]*?-->/g,'');\r\n\t//data = data.replace(/<noscript[^>]*>[Ss]*?</noscript>/g,'');\r\n\t//data = data.replace(/<script[^>]*>[Ss]*?</script>/g,'');\r\n\t//data = data.replace(/<script.*/>/,'');\r\n\treturn data;\r\n}", "title": "" }, { "docid": "c5c7e14e9994600877298bd7b70ee91f", "score": "0.6526471", "text": "sanitize (str) {\n const replacements = {\n '\"': '&quot;', \n '&': '&amp;', \n \"'\": '&apos;',\n '<': '&lt;', \n '>': '&gt;',\n };\n return str.toString().replace(/[\\<\\>\\&\\\"\\']/g, c => replacements[c]); \n }", "title": "" }, { "docid": "e1d8f0cfc7e539308327025e0a3db0fd", "score": "0.65014344", "text": "function SafeHtmlPipe(sanitized) {\n this.sanitized = sanitized;\n }", "title": "" }, { "docid": "28e50114f8b106809b85bc531ce8b30c", "score": "0.649373", "text": "function sanitize_input(rawInput) {\n var placeholder = HtmlService.createHtmlOutput(\" \");\n placeholder.appendUntrusted(rawInput);\n return placeholder.getContent();\n }", "title": "" }, { "docid": "418cfe1348ee6404afc7ffe69021f10b", "score": "0.6481607", "text": "function sanitize(s) {\n return s.replace(/[&<>'\"_]/g, '-'); // used on all output token CSS classes\n }", "title": "" }, { "docid": "418cfe1348ee6404afc7ffe69021f10b", "score": "0.6481607", "text": "function sanitize(s) {\n return s.replace(/[&<>'\"_]/g, '-'); // used on all output token CSS classes\n }", "title": "" }, { "docid": "2811f3547eb9b58e3545b6417abbbedc", "score": "0.64382225", "text": "function sanitise(str) {\n return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;');\n}", "title": "" }, { "docid": "49d795bb38073007c89a30eaf5efa3ec", "score": "0.6436878", "text": "function sanitize(s) {\n return s.replace(/[&<>'\"_]/g, '-'); // used on all output token CSS classes\n}", "title": "" }, { "docid": "49d795bb38073007c89a30eaf5efa3ec", "score": "0.6436878", "text": "function sanitize(s) {\n return s.replace(/[&<>'\"_]/g, '-'); // used on all output token CSS classes\n}", "title": "" }, { "docid": "d67b4e86616cec3f476fb8f02769642a", "score": "0.6416774", "text": "function sanitize (string) {\n return string.replace(/\\&/g, '&amp;')\n .replace(/\\'/g, '&apos;')\n .replace(/\\\"/g, '&quot;')\n .replace(/\\</g, '&lt;')\n .replace(/\\>/g, '&gt;');\n }", "title": "" }, { "docid": "bf5987564e5d441c82b1c491fcff4f35", "score": "0.64078015", "text": "function sanitize_text_field($str) {\n $filtered = wp_check_invalid_utf8( $str );\n \n if ( strpos($filtered, '<') !== false ) {\n $filtered = wp_pre_kses_less_than( $filtered );\n // This will strip extra whitespace for us.\n $filtered = wp_strip_all_tags( $filtered, true );\n } else {\n $filtered = trim( preg_replace('/[\\r\\n\\t ]+/', ' ', $filtered) );\n }\n \n $found = false;\n while ( preg_match('/%[a-f0-9]{2}/i', $filtered, $match) ) {\n $filtered = str_replace($match[0], '', $filtered);\n $found = true;\n }\n \n if ( $found ) {\n // Strip out the whitespace that may now exist after removing the octets.\n $filtered = trim( preg_replace('/ +/', ' ', $filtered) );\n }\n \n return apply_filters('sanitize_text_field', $filtered, $str);\n }", "title": "" }, { "docid": "68fe5739d699641330365a45fca5faec", "score": "0.63738203", "text": "function sanitize(text) {\n return text.replace(/</g, '&lt;').replace(/>/g, '&gt;');\n}", "title": "" }, { "docid": "d52243b5b9d071d0c50bbc9c2bc2be94", "score": "0.63270754", "text": "static sanitize(input) {\r\n return input.replace(/[^A-Za-z0-9 '-]/g, '');\r\n }", "title": "" }, { "docid": "775d4ed37fed348269b833982e5bf82c", "score": "0.62894034", "text": "function tag_escape($tag_name) {\n $safe_tag = strtolower( preg_replace('/[^a-zA-Z0-9_:]/', '', $tag_name) );\n return apply_filters('tag_escape', $safe_tag, $tag_name);\n }", "title": "" }, { "docid": "44da13376e8a808d2d3827a83c6aaffc", "score": "0.6284141", "text": "function sanitize(content) {\n return content.replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\\[/g, '&#91;')\n .replace(/\\]/g, '&#93;')\n .replace(/\\(/g, '&#40;')\n .replace(/\\)/g, '&#41;');\n }", "title": "" }, { "docid": "68a6b3ad6ffe5b0765e5c8fbd41bcd52", "score": "0.6280644", "text": "static sanitize(string){\n return string.replace( /[^A-Za-z0-9 '-]/g, '' )\n }", "title": "" }, { "docid": "98bb5272c0ead87059ca3d4855f525c4", "score": "0.62635225", "text": "function textFilter(e){\n if(/([~!@#$\\^`\\*\\+\\/\\?\\,\\\\{}[\\]%\\d\"&\\-=(\\)_|;:'<>]+)/g.test(String.fromCharCode(e.charCode))){\n e.preventDefault();\n\t}\n}", "title": "" }, { "docid": "bf7063695e9223a01cbad0ee11e8d3aa", "score": "0.62506175", "text": "function StyleSanitizeFn(){}", "title": "" }, { "docid": "d07aaaf3990c39048c7006b39345bd75", "score": "0.62035", "text": "function sanitize (input) {\n\tvar input = input.replace(/>/g, '&gt;').replace(/</g,'&lt;').replace('\\n','<br/>');\n\treturn input;\n}", "title": "" }, { "docid": "94fbc9e76e19cb9e0761f54a8b7d6d9d", "score": "0.61859316", "text": "function sanitizeHTMLFromXSS(obj) {\n if (!obj) return obj;\n switch (typeof obj) {\n case 'string':\n return DOMPurify.sanitize(obj, { ADD_ATTR: ['target'] })\n .replace(/&amp;/g, '&')\n .replace(/&lt;/g, '<')\n .replace(/&gt;/g, '>')\n .replace(/&quot;/g, '\"');\n case 'object':\n return Object.entries(obj).reduce((acc, [key, value]) => {\n acc[key] = sanitizeHTMLFromXSS(value);\n return acc;\n }, obj);\n default:\n return obj;\n }\n}", "title": "" }, { "docid": "4e09404f909307d753baa0bb756b07e0", "score": "0.6108959", "text": "function sanitize(str) {\n // do sanitization\n // ...\n return untaint(str);\n}", "title": "" }, { "docid": "f666536cebb6a0064469021eec3ed970", "score": "0.6102307", "text": "function htmlsanitize(str) {\n if (typeof(str) == \"string\") {\n str = str.replace(/&/g, \"&amp;\"); /* must do &amp; first */\n\n str = str.replace(/</g, \"&lt;\");\n str = str.replace(/>/g, \"&gt;\");\n }\n return str;\n}", "title": "" }, { "docid": "c1d8cf7047b5af88c5ff886b7f0d871b", "score": "0.61019367", "text": "function urlFilter(e){\n if(/([#~!`$\\?\\,@%\\^&*\\+=\\\\{\\}(\\)[\\]\"|;'<>]+)/g.test(String.fromCharCode(e.charCode))){\n\t e.preventDefault();\n\t} \n}", "title": "" }, { "docid": "d2461fb80cab76f0dc65c7b59cdc9df3", "score": "0.60968614", "text": "function StyleSanitizeFn() {}", "title": "" }, { "docid": "d2461fb80cab76f0dc65c7b59cdc9df3", "score": "0.60968614", "text": "function StyleSanitizeFn() {}", "title": "" }, { "docid": "92b2106a6f35d939ba306825c23e854d", "score": "0.60954475", "text": "function StyleSanitizeFn() { }", "title": "" }, { "docid": "92b2106a6f35d939ba306825c23e854d", "score": "0.60954475", "text": "function StyleSanitizeFn() { }", "title": "" }, { "docid": "92b2106a6f35d939ba306825c23e854d", "score": "0.60954475", "text": "function StyleSanitizeFn() { }", "title": "" }, { "docid": "92b2106a6f35d939ba306825c23e854d", "score": "0.60954475", "text": "function StyleSanitizeFn() { }", "title": "" }, { "docid": "eb73ff4265c71451728640308f055a32", "score": "0.6092422", "text": "function do_filter_scustom(text){\r\n var buf=text;\r\n if(buf!=''){\r\n var re,sml,done = false;\r\n var tosingle = {\r\n '\\\\|{2,}' : '|'\r\n ,'(\\\\r\\\\n){2,}' : '\\r\\n{sctag:br}\\r\\n,'\r\n ,'(\\\\n){2,}' : '\\n{sctag:br}\\n'\r\n };\r\n // step -1 to strip\r\n buf = buf.replace(/[\\[\\]\\,]/g,\"\");\r\n //clog('step-to single');\r\n for(var torep in tosingle){\r\n if(!isString(tosingle[torep])) continue;\r\n re = new RegExp(torep, \"g\");\r\n buf = buf.replace(re, tosingle[torep])\r\n }\r\n //clog('before step-validate='+buf); \r\n // step -3 to validate per line\r\n buf=(document.all ? buf.split(\"\\r\\n\") : buf.split(\"\\n\")); // IE : FF/Chrome\r\n \r\n var sml,retbuf='', bL=buf.length;\r\n var sepr = ','; // must be used on extracting from storage\r\n for(var line=0; line<bL; line++){\r\n if(!isString(buf[line])) continue;\r\n buf[line] = trimStr ( buf[line] ); // trim perline\r\n //clog('line='+line+'; val='+buf[line]);\r\n //sml = /([^|]+)\\|(http(?:[s|*])*\\:\\/\\/.+$)/.exec( buf[line] );\r\n sml = /([^|]+)\\|([\\w\\W]+)/.exec( buf[line] );\r\n if(sml && isDefined(sml[1]) && isDefined(sml[2]) ){ // smiley thingie ?\r\n //clog('sml[0]='+sml[0]+'; sml[1]='+sml[1]+'; sml[2]='+sml[2]);\r\n retbuf+=sml[1]+'|' + ( /^https?\\:\\/\\/.+$/i.test(sml[2]) ? sml[2] : escape(sml[2]) ) + sepr; // new separator\r\n }else if(sml=validTag( buf[line], false, 'saving' ) ){ // valid tag ?\r\n //clog('saving-valid tag ?; ' + sml);\r\n retbuf+=sml+sepr;\r\n }\r\n done=true;\r\n } // end for \r\n }\r\n return retbuf;\r\n}", "title": "" }, { "docid": "b8cd49dcfbcb91baa9b38d186e77d802", "score": "0.60835207", "text": "function beforeRender(str) {\n\t\tvar replaces = iu.template.filters;\n\n\t\tfor (var i = 0, length = replaces.length; i < length; i++) {\n\t\t\tstr = str.replace(replaces[i][0], replaces[i][1]);\n\t\t}\n\n\t\treturn str;\n\t}", "title": "" }, { "docid": "daf879f67cfa3943cd26941f0c5c7f7f", "score": "0.6070254", "text": "sanitize(schema) {\n return JSON.stringify(schema, (_key, value) => typeof value === 'string'\n ? this.sanitizer.sanitize(SecurityContext.HTML, value)\n : value);\n }", "title": "" }, { "docid": "9b0c50c6e984a1f8091196e8ead9150e", "score": "0.60611165", "text": "static sanitize(string) {\n return string.replace( /[^A-Za-z0-9 '-]/g, '' )\n }", "title": "" }, { "docid": "050817ef59b8293f812cd33ce2b6ea7e", "score": "0.6056605", "text": "function _sanitize(val) {\n return sanitizeHTML(val, { ALLOWED_TAGS, ALLOWED_ATTRS });\n}", "title": "" }, { "docid": "86450626247266b40b48a8f9e59ac212", "score": "0.60557926", "text": "function sanitizeString(str){\n str = str.replace(/([/\\\\<>\"'])+/g,\"\");\n return str.trim();\n}", "title": "" }, { "docid": "2ad95682f59662b20fbcd12982ee0252", "score": "0.6043384", "text": "static sanitize(string) {\n return string.replace(/[^A-Za-z0-9-'\\s]+/g, '');\n }", "title": "" }, { "docid": "3fcdbb3528a43ec5c53d1e746b318189", "score": "0.60041827", "text": "escapeForScriptTag (str) {\n\t\tif (!str) {\n\t\t\treturn str;\n\t\t}\n\n\t\treturn str.replace(UNSAFE_CHARS, function (match) {\n\t\t\treturn REPLACEMENT_CHARS[match];\n\t\t});\n\t}", "title": "" }, { "docid": "e048d3a461d9a3bd13f4cab1f7d6322b", "score": "0.59545684", "text": "function NonXHTMLTagFilter() {\n /* filter out non-XHTML tags*/\n \n // A mapping from element name to whether it should be left out of the \n // document entirely. If you want an element to reappear in the resulting \n // document *including* it's contents, add it to the mapping with a 1 value.\n // If you want an element not to appear but want to leave it's contents in \n // tact, add it to the mapping with a 0 value. If you want an element and\n // it's contents to be removed from the document, don't add it.\n if (arguments.length) {\n // allow an optional filterdata argument\n this.filterdata = arguments[0];\n } else {\n // provide a default filterdata dict\n this.filterdata = {'html': 1,\n 'body': 1,\n 'head': 1,\n 'title': 1,\n \n 'a': 1,\n 'abbr': 1,\n 'acronym': 1,\n 'address': 1,\n 'b': 1,\n 'base': 1,\n 'blockquote': 1,\n 'br': 1,\n 'caption': 1,\n 'cite': 1,\n 'code': 1,\n 'col': 1,\n 'colgroup': 1,\n 'dd': 1,\n 'dfn': 1,\n 'div': 1,\n 'dl': 1,\n 'dt': 1,\n 'em': 1,\n 'h1': 1,\n 'h2': 1,\n 'h3': 1,\n 'h4': 1,\n 'h5': 1,\n 'h6': 1,\n 'h7': 1,\n 'i': 1,\n 'img': 1,\n 'kbd': 1,\n 'li': 1,\n 'link': 1,\n 'meta': 1,\n 'ol': 1,\n 'p': 1,\n 'pre': 1,\n 'q': 1,\n 'samp': 1,\n 'script': 1,\n 'span': 1,\n 'strong': 1,\n 'style': 1,\n 'sub': 1,\n 'sup': 1,\n 'table': 1,\n 'tbody': 1,\n 'td': 1,\n 'tfoot': 1,\n 'th': 1,\n 'thead': 1,\n 'tr': 1,\n 'ul': 1,\n 'u': 1,\n 'var': 1,\n\n // even though they're deprecated we should leave\n // font tags as they are, since Kupu sometimes\n // produces them itself.\n 'font': 1,\n 'center': 0\n };\n };\n \n this.initialize = function(editor) {\n /* init */\n this.editor = editor;\n };\n\n this.filter = function(ownerdoc, htmlnode) {\n return this._filterHelper(ownerdoc, htmlnode);\n };\n\n this._filterHelper = function(ownerdoc, node) {\n /* filter unwanted elements */\n if (node.nodeType == 3) {\n return ownerdoc.createTextNode(node.nodeValue);\n } else if (node.nodeType == 4) {\n return ownerdoc.createCDATASection(node.nodeValue);\n };\n // create a new node to place the result into\n // XXX this can be severely optimized by doing stuff inline rather \n // than on creating new elements all the time!\n var newnode = ownerdoc.createElement(node.nodeName);\n // copy the attributes\n for (var i=0; i < node.attributes.length; i++) {\n var attr = node.attributes[i];\n newnode.setAttribute(attr.nodeName, attr.nodeValue);\n };\n for (var i=0; i < node.childNodes.length; i++) {\n var child = node.childNodes[i];\n var nodeType = child.nodeType;\n var nodeName = child.nodeName.toLowerCase();\n if (nodeType == 3 || nodeType == 4) {\n newnode.appendChild(this._filterHelper(ownerdoc, child));\n };\n if (nodeName in this.filterdata && this.filterdata[nodeName]) {\n newnode.appendChild(this._filterHelper(ownerdoc, child));\n } else if (nodeName in this.filterdata) {\n for (var j=0; j < child.childNodes.length; j++) {\n newnode.appendChild(this._filterHelper(ownerdoc, \n child.childNodes[j]));\n };\n };\n };\n return newnode;\n };\n}", "title": "" }, { "docid": "add3d85635343ccab58549d7a1c1a67d", "score": "0.5930709", "text": "function sanitize(key) {\n // Allow lowercase alphanumerics, dashes, underscores, and periods:\n return typeof key == 'string' ? key.toLowerCase().replace(regexFunkyPunc, '') : '';\n }", "title": "" }, { "docid": "7a5b0d8ce3a74a1b2d1c878d14e4ad6b", "score": "0.59290135", "text": "function HighlightFilter($sce) {\n\t\treturn function(text, term) {\n\t\t\tif (term) {\n\t\t\t\ttext = text.replace(new RegExp('(' + term + ')', 'gi'), '<span class=\"highlight\">$1</span>');\n\t\t\t}\n\n\t\t\treturn $sce.trustAsHtml(text);\n\t\t};\n\t}", "title": "" }, { "docid": "21e08229bd29a6e79a9e890dedb19169", "score": "0.5928202", "text": "sanitize(html){ return $(\"<div/>\").text(html).html(); }", "title": "" }, { "docid": "10a97bbead1f1e15b3c8fd23c11f58b6", "score": "0.59247726", "text": "function scanUserInput(content) {\n\n if (content === undefined) return;\n\n\n var startBracketIndex = content.indexOf(\"<\");\n var endBracketIndex = content.indexOf(\">\");\n var startBracketCodeIndex = content.indexOf(\"%3C\");\n var endBracketCodeIndex = content.indexOf(\"%3E\");\n var contentLowerCase = content.toLowerCase();\n\n if ((startBracketCodeIndex !== -1 || startBracketIndex !== -1) &&\n (endBracketCodeIndex !== -1 || endBracketIndex !== -1) &&\n ((contentLowerCase.indexOf(\"script\") !== -1) ||\n (contentLowerCase.indexOf(\"src\") !== -1) ||\n (contentLowerCase.indexOf(\"rel\") !== -1) ||\n (contentLowerCase.indexOf(\".cookie\") !== -1))){\n\n //the content contains the word 'script' and has both '>' and '<' signs\n content = content.replace(/\\\\<|%3C/g, '(');\n content = content.replace(/\\\\>|%3E/g, ')');\n }\n\n content = decodeURIComponent(content);\n return content;\n}", "title": "" }, { "docid": "359f875b703fb22f05ad1e8e61d52a34", "score": "0.5820179", "text": "function sanitizeInput(input){\n var output=\"\";\n var search = \" \";\n output = input.replace(new RegExp(search, 'g'),\"%20\");\n return output;\n}", "title": "" }, { "docid": "297f9ab8ca74cc4248e26be4f41ef9f9", "score": "0.5812476", "text": "function process(value) {\n return encodeURIComponent(value.toLowerCase().replace(/[^a-z0-9 _-]+/gi, '-'));\n}", "title": "" }, { "docid": "82bb78a71ccc687314e568b361298f58", "score": "0.58110934", "text": "function sanitize_data(data) {\n var special_chars = {\n \"<\": \"&lt;\",\n \">\": \"&gt;\",\n \"&\": \"&amp;\",\n \"/\": '&#x2F;',\n '\"': '&quot;',\n \"'\": '&#39;'\n };\n var breaks_replaced = data.replace(/<\\/br>/g, \"$BREAK#\");\n breaks_replaced = data.replace(/<br\\/>/g, \"$BREAK#\");\n var sanitized_data = String(breaks_replaced).replace(/[<>&\"'\\/]/g, function (s) {\n return special_chars[s];\n });\n return sanitized_data.replace(/\\$BREAK#/g, \"<br/>\");\n}", "title": "" }, { "docid": "812df058236181cc88ddde5082358bab", "score": "0.5808895", "text": "function sanitize(inS) {\n return inS.replace(/\\W/g, '');\n}", "title": "" }, { "docid": "d6849a7a29afc7aecfab87f253092c9b", "score": "0.5793976", "text": "function safe(string) {\n return string.replace(/(?:^[\\.,:;<>\"']+|[\\0\\n<>]+|[\\.,:;<>\"']+$)/gm, \"\");\n }", "title": "" }, { "docid": "e60e6f9aca025dde19d722f25d2a5376", "score": "0.5775386", "text": "function _sanitize( req ){\n var regExRemove = /(\\.|,|;|'|\"|\\(|\\))/g;\n var regExSpace = /(-|–|\\/)/g;\n var cleanArr = req.params.data.name.replace( regExSpace, ' ' ).replace( regExRemove, '' ).toLowerCase().split( ' ' );\n //console.log( cleanArr );\n var dirtyWords = [ '', '.', '&', 'mr', 'mrs', 'dr', 'sr', 'jr', 'llc', 'inc', 'ltd', 'co', 'zoo', 'gmbh', 'sarl', 'sa', 'sas', 'fzc', 'fze', 'limited', 'corp', 'sro', 'pty', 'sp', 'de', 'ffc', 'the', 'of', 'for', 'el', 'al', 'bank', 'trust', 'company', 'and', 'import', 'export', 'trading', 'group', 'holding', 'international', 'intl', 'foundation' ];\n\n for( var i = 0; i < dirtyWords.length; i++ ){\n var word = dirtyWords[ i ];\n var idx = _.indexOf( cleanArr, word );\n\n if( idx !== -1 ){\n cleanArr.splice( idx, 1 );\n i--;\n }\n }\n\n return cleanArr;\n}", "title": "" }, { "docid": "cf508e25e7e7bdb5775f5535ab8d5be4", "score": "0.57500076", "text": "function sanitize(value) {\n if (!value) value = ''\n // TODO: HTML escape\n if (typeof(value) !== 'string') value.toString()\n\n return value\n}", "title": "" }, { "docid": "1a132711c4e9cc77736031b7fc20115c", "score": "0.57433486", "text": "function esc_html( $text ) {\n $safe_text = wp_check_invalid_utf8( $text );\n $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );\n return apply_filters( 'esc_html', $safe_text, $text );\n }", "title": "" }, { "docid": "9ddb6a382b369e32cc9ac5a043c83019", "score": "0.57315654", "text": "function r(e){return e.replace(/[.?*+^$[\\]\\\\(){}|-]/g,\"\\\\$&\")}", "title": "" }, { "docid": "5b6c02df138745edc4dac3816ffb802f", "score": "0.572922", "text": "function clearFromXSS(data) {\n // Removing all <script tags\n let pattern = /<script\\b[^<]*(?:(?!<\\/script>)<[^<]*)*<\\/script>/gi;\n\n if (typeof data == 'string') {\n return data.replace(pattern, '');\n }\n\n if (Array.isArray(data)) {\n return data.map(clearFromXSS);\n }\n\n if (typeof data == 'object') {\n for (let key in data) {\n data[key] = clearFromXSS(data[key]);\n }\n }\n\n return data;\n}", "title": "" }, { "docid": "0d5ec477c1ecbea07a9771b5571d5baa", "score": "0.5727579", "text": "function emailFilter(e){\n if(/([#~!`$%\\^&*\\-\\+=\\\\{\\}(\\)\\/\\?\\,[\\]\"|;:'<>]+)/g.test(String.fromCharCode(e.charCode))){\n\t e.preventDefault();\n\t} \n}", "title": "" }, { "docid": "8463a0d34c0c1095e600e7e947ceedbb", "score": "0.5719156", "text": "function _sanitize(val) {\n return sanitizeDOM(val, { ALLOWED_TAGS, ALLOWED_ATTRS });\n}", "title": "" }, { "docid": "0a94128e1275b6151a230e19d2fc5b2f", "score": "0.57153", "text": "filterForFrontend() {}", "title": "" }, { "docid": "cf0d7827d0d7d429c5ab5202ce3a1127", "score": "0.5713362", "text": "sanitize(schema) {\r\n return JSON.stringify(schema, (_key, value) => typeof value === 'string'\r\n ? this.sanitizer.sanitize(_angular_core__WEBPACK_IMPORTED_MODULE_0__[\"SecurityContext\"].HTML, value)\r\n : value);\r\n }", "title": "" }, { "docid": "3ef956e1d736b9c838b8603788cd16f0", "score": "0.5699777", "text": "function sanitize_user( $username, $strict = false ) {\n $raw_username = $username;\n $username = wp_strip_all_tags( $username );\n $username = remove_accents( $username );\n // Kill octets\n $username = preg_replace( '|%([a-fA-F0-9][a-fA-F0-9])|', '', $username );\n $username = preg_replace( '/&.+?;/', '', $username ); // Kill entities\n\n // If strict, reduce to ASCII for max portability.\n if ( $strict )\n $username = preg_replace( '|[^a-z0-9 _.\\-@]|i', '', $username );\n\n $username = trim( $username );\n // Consolidate contiguous whitespace\n $username = preg_replace( '|\\s+|', ' ', $username );\n\n return apply_filters( 'sanitize_user', $username, $raw_username, $strict );\n}", "title": "" }, { "docid": "06b53503a4d3b6c3533e4abb34f703f2", "score": "0.569638", "text": "function filter(html) {\n if (config.filter instanceof CKEDITOR.htmlParser.filter) {\n var fragment = CKEDITOR.htmlParser.fragment.fromHtml(html),\n writer = new CKEDITOR.htmlParser.basicWriter();\n config.filter.applyTo(fragment);\n fragment.writeHtml(writer);\n return writer.getHtml();\n }\n return html;\n }", "title": "" }, { "docid": "1586cc2b4942f6c0541a1a22159ef4b8", "score": "0.568095", "text": "sanitizeHtml(html) {\n html = html.replace(/</g, '&lt;');\n html = html.replace(/>/g, '&gt;');\n\n return html;\n }", "title": "" }, { "docid": "701e7bdcbca7155670ecb55ba48480ce", "score": "0.5670076", "text": "function EditorFilter(text) {\n // get rid of comment\n text = EditRemove(text, '<!--', '-->');\n \n // get rid of meta content\n text = EditRemove(text, '<meta content', '/>');\n \n // get rid of style\n text = EditRemove(text, '<style>', '</style>');\n \n // get rid of link\n text = EditRemove(text, '<link', '</link>');\n \n // bash class tags\n var pat = new RegExp(' class=\"[^\"]*\"', 'g');\n text = text.replace(pat, '');\n \n // bash the o:p tags\n text = text.replace(/<o:p>/g, '').replace(/<\\/o:p>/g, '');\n \n return text;\n}", "title": "" }, { "docid": "6eae939c9d3702543a7bef455b91aba0", "score": "0.5663652", "text": "function prepareFilters() {\n\tstr='{\"name\":\"white color\",\"source\":\"\\\\\\\\[white\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span style=\\\\\"color:white\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"yellow color\",\"source\":\"\\\\\\\\[yellow\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span style=\\\\\"color:gold\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"orange color\",\"source\":\"\\\\\\\\[orange\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span style=\\\\\"color:orange\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"pink color\",\"source\":\"\\\\\\\\[pink\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span style=\\\\\"color:#FFBBFF\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"red color\",\"source\":\"\\\\\\\\[red\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span style=\\\\\"color:red\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"limegreen color\",\"source\":\"\\\\\\\\[lime\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span style=\\\\\"color:limegreen\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"green color\",\"source\":\"\\\\\\\\[green\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span style=\\\\\"color:green\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"aqua color\",\"source\":\"\\\\\\\\[aqua\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span style=\\\\\"color:aqua\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"blue color\",\"source\":\"\\\\\\\\[blue\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span style=\\\\\"color:blue\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"violet color\",\"source\":\"\\\\\\\\[violet\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span style=\\\\\"color:#660099\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"brown color\",\"source\":\"\\\\\\\\[brown\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span style=\\\\\"color:#660000\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"silver color\",\"source\":\"\\\\\\\\[silver\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span style=\\\\\"color:silver\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"black color\",\"source\":\"\\\\\\\\[black\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span style=\\\\\"color:black\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"white color on black\",\"source\":\"\\\\\\\\[bw\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span style=\\\\\"color:white; background-color:black\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"bold text\",\"source\":\"\\\\\\\\[b\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span style=\\\\\"font-weight:bold\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"italic text\",\"source\":\"\\\\\\\\[i\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span style=\\\\\"font-style:italic\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"underlined text\",\"source\":\"\\\\\\\\[u\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span style=\\\\\"text-decoration:underline\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"striked text\",\"source\":\"\\\\\\\\[s\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span style=\\\\\"text-decoration:line-through\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"distinguished text\",\"source\":\"\\\\\\\\[d\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span class=\\\\\"dist\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"fire text\",\"source\":\"\\\\\\\\[f\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span style=\\\\\"color:#FFFFFF; font-family:impact, sans-serif; padding-top:20px; '\n\t + 'text-shadow:0px 0px 4px #000000, 0px -5px 4px #FFFF33, 2px -8px 6px #FFDD33, -2px -15px 10px #FF8800, '\n\t + '2px -20px 18px #FF2200; letter-spacing:2px\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"short spoiler\",\"source\":\"\\\\\\\\[sp\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"<span class=\\\\\"spoiler\\\\\">\",\"active\":true,\"filterlinks\":false},'\n\t + '{\"name\":\"closing font style\",\"source\":\"\\\\\\\\[\\\\\\\\/\\\\\\\\]\",\"flags\":\"g\",'\n\t + '\"replace\":\"</span>\",\"active\":true,\"filterlinks\":false}]';\n\n\tcallback = function(data) {\n\t\tsocket.listeners(\"chatFilters\").splice(\n\t\t\tsocket.listeners(\"chatFilters\").indexOf(callback)\n\t\t);\n\t\tjson=JSON.stringify(data);\n\t\tcomma = (json.length!=\"2\") ? ',' : '';\n\t\t$(\"#cs-chatfilters-exporttext\").val(json.substring(0, json.length-1)+comma+str);\n\t};\n\n\tsocket.on(\"chatFilters\", callback);\n\tsocket.emit(\"requestChatFilters\");\n\n\ttxt = 'This option does NOT affect your current filters, all of them will be saved.\\n'\n\t + 'Click \"Import filter list\" button if you\\'ll decide to install.';\n\talert(txt);\n}", "title": "" }, { "docid": "48a61ec59f7a0bfb3a0f97c5b7de7eb9", "score": "0.5653211", "text": "function sanitize(str) {\n\t\treturn str.slice(0, str.lastIndexOf(\".\")).toLowerCase().replace(\"-\", \"_\").replace(/\\W/g, \"\");\n\t}", "title": "" }, { "docid": "6285d746040abe025a2553e0f7dc822a", "score": "0.5646899", "text": "function sanitizeInput(val) {\n return true;\n }", "title": "" }, { "docid": "9d2188b5a79f8f223b672947a261b4da", "score": "0.5620792", "text": "function htmlspecialchars(s)\n\t{\n\t\ts = s.replace(/&/g, '&amp;'); //&\n\t\ts = s.replace(/</g, '&lt;'); //<\n\t\ts = s.replace(/>/g, '&gt;'); //>\n\t\ts = s.replace(/\"/g, '&quot;'); //\"\n\t\treturn s;\n\t}", "title": "" }, { "docid": "7d2960195b09c2305a5dd396ac983480", "score": "0.5607883", "text": "sanitise(node, text, pack) {\n let rep = node.unescape;\n if (rep) {\n let idx = 0;\n rep = `\\\\${rep}`;\n while ((idx = text.indexOf(rep, idx)) !== -1) {\n text = text.substr(0, idx) + text.substr(idx + 1);\n idx++;\n }\n }\n\n text = escapeSlashes(text);\n\n return pack ? cleanSpaces(text) : escapeReturn(text)\n }", "title": "" }, { "docid": "c7a805fb4caad5b1d9b6c1e2fbd28c76", "score": "0.5605089", "text": "function escapeHtml(unsafe) {\n return unsafe\n .replace(/&/g, \"\")\n .replace(/</g, \"\")\n .replace(/>/g, \"\")\n .replace(/\"/g, \"\")\n .replace(/'/g, \"\");\n }", "title": "" }, { "docid": "8a2476eb6559bf629cdc5b2dcd3cf65e", "score": "0.5603001", "text": "function Qc(a,b,c,d){c=b(c||Rc,d);if(sa(c))if(c instanceof zc){if(c.ya!==yc)throw Error(\"Sanitized content was not of kind HTML.\");b=c.toString();c=c.dc;d=new Wb(Ub,\"Soy SanitizedContent of kind HTML produces SafeHtml-contract-compliant value.\");Da(Xb(d),\"must provide justification\");A(!/^[\\s\\xa0]*$/.test(Xb(d)),\"must provide non-empty justification\");b=hc(b,c||null)}else Ca(\"Soy template output is unsafe for use as HTML: \"+c),b=ic(\"zSoyz\");else b=ic(String(c));a=A(a);if(mc())for(;a.lastChild;)a.removeChild(a.lastChild);\na.innerHTML=gc(b)}", "title": "" }, { "docid": "a3e19cb5b45e9a8314a85c64e66384f7", "score": "0.56030005", "text": "function sanitize(st, deep) {\n\t\t\n\t\tst = st.replace(/<(?!br\\s*\\/?)[^>]+>/g, '').replace(/(_|\\|)$/, '');\n\t\t\n\t\tif(!deep) {\n\n\t\t\tst = st.replace(/\\r?\\n|\\r/g, '±')\n\t\t\t\t .replace(/<br[^>]*>/gi, 'µ')\n\t\t\t\t .replace(/±µ|µ±/g, 'µ')\n\t\t\t\t .replace(/^±+|±+$/g, '')\n\t\t\t\t .replace(/^µ+|µ+$/g, '');\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\t\n\t\t\tst = st.replace(/\\r?\\n|\\r/g, ' ').replace(/<br[^>]*>/gi, '\\n');\n\t\t\t\n\t\t}\n\t\t\n\t\tdecoder.innerHTML = st;\n\t\treturn decoder.value;\n\t\t\n\t}", "title": "" }, { "docid": "6fb6cfdbe55cdb45f9f3e5b565d0c6c3", "score": "0.55952793", "text": "sanitise(node, text, pack) {\n let rep = node.unescape;\n if (rep) {\n let idx = 0;\n rep = `\\\\${rep}`;\n while ((idx = text.indexOf(rep, idx)) !== -1) {\n text = text.substr(0, idx) + text.substr(idx + 1);\n idx++;\n }\n }\n\n text = escapeSlashes(text);\n\n return pack ? cleanSpaces(text) : escapeReturn(text)\n }", "title": "" }, { "docid": "6fb6cfdbe55cdb45f9f3e5b565d0c6c3", "score": "0.55952793", "text": "sanitise(node, text, pack) {\n let rep = node.unescape;\n if (rep) {\n let idx = 0;\n rep = `\\\\${rep}`;\n while ((idx = text.indexOf(rep, idx)) !== -1) {\n text = text.substr(0, idx) + text.substr(idx + 1);\n idx++;\n }\n }\n\n text = escapeSlashes(text);\n\n return pack ? cleanSpaces(text) : escapeReturn(text)\n }", "title": "" }, { "docid": "b2d7a14b4670ea744812a956e180c9e9", "score": "0.5584968", "text": "function strip_tags (input, allowed) {\n // https://raw.github.com/kvz/phpjs/master/functions/strings/strip_tags.js\n allowed = (((allowed || \"\") + \"\").toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join('');\n var tags = /<\\/?([a-z][a-z0-9]*)\\b[^>]*>/gi, commentsAndPhpTags = /<!--[\\s\\S]*?-->|<\\?(?:php)?[\\s\\S]*?\\?>/gi;\n return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {\n return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';\n });\n}", "title": "" }, { "docid": "f41b90daa56ba4524cdff956556edb7e", "score": "0.5584957", "text": "function hdx(string) {\n\treturn htmlspecialchars_decode(string);\n }", "title": "" }, { "docid": "8cb03c7dc633e4d2cc434a953b12becc", "score": "0.5582188", "text": "function wp_htmledit_pre($output) {\n if ( !empty($output) )\n $output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) ); // convert only < > &\n \n return apply_filters('htmledit_pre', $output);\n }", "title": "" }, { "docid": "f936428361a0b8f3e49872c82636349b", "score": "0.55818295", "text": "function safeTagsRegex(str) {\n return str.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").\n replace(/>/g, \"&gt;\");\n}", "title": "" }, { "docid": "f936428361a0b8f3e49872c82636349b", "score": "0.55818295", "text": "function safeTagsRegex(str) {\n return str.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\").\n replace(/>/g, \"&gt;\");\n}", "title": "" }, { "docid": "11782b7d89d6281ad02092c0ac65ec3d", "score": "0.5569644", "text": "static get sanitize() {\n return {\n title: false,\n subtitle: false,\n text: false,\n action: false,\n }\n }", "title": "" }, { "docid": "64088e0d0e165e2f7b07288c6df0cb59", "score": "0.5566675", "text": "function sanitize() {\n local.ipcRenderer.send(apiName, {\n cmd: apiCmds.sanitize,\n windowName: window.name\n });\n }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.5559537", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.5559537", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.5559537", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.5559537", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.5559537", "text": "function SafeHtml() { }", "title": "" }, { "docid": "0c8c4b07ebe705d3381fb33577167158", "score": "0.5559537", "text": "function SafeHtml() { }", "title": "" }, { "docid": "ffc7cd04e32206a7ab84bb586b593574", "score": "0.5554165", "text": "function sanitize(msg) {\n return msg.replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\\//g, '&#47;').replace(/\\$/g, '&#36;');\n}", "title": "" }, { "docid": "7239dfad077a7b92aedf86949c31db0b", "score": "0.5550958", "text": "function SafeHtml(){}", "title": "" }, { "docid": "6d8748be8979d3d03ecb8d66fc10d559", "score": "0.5548857", "text": "function filterSpecChars(str) {\n return str.replace(/>/g, \"&gt;\").replace(/</g, \"&lt;\");\n}", "title": "" }, { "docid": "7d4d1ed186ea9c846b4ed78b74f24668", "score": "0.554373", "text": "function safe(arg) {\n return arg.replace(/[^0-9a-z_%\\-]/gi, \"\");\n}", "title": "" }, { "docid": "942243c9db994425178824f1dcc9f28f", "score": "0.55430853", "text": "function sanitiseString(stringToSanitise) {\n stringToSanitise = stringToSanitise.replace(/[^a-z]/gmi, \"\").replace(/\\s+/g, \"\");\n stringToSanitise = stringToSanitise.toLowerCase();\n return stringToSanitise;\n}", "title": "" }, { "docid": "f80e2e05a685cff6e17f1de6d0e85df8", "score": "0.55425537", "text": "function filterText(textToFilter) {\n var res = textToFilter.replace(/\"/g, \"'\");\n return res;\n}", "title": "" }, { "docid": "519dcbae5473fed245b217fb310f1885", "score": "0.5537232", "text": "function escapeReservedCharacters(str) {\n str = str.replace(\"#\", \"%23\");\n str = str.replace(\"/\", \"%2F\");\n str = str.replace(\"%\", \"%25\");\n str = str.replace(\"&\", \"%26\");\n str = str.replace(\"+\", \"%2B\");\n str = str.replace(\",\", \"%2C\");\n str = str.replace(\"!\", \"%21\");\n str = str.replace(\"(\", \"%28\");\n str = str.replace(\")\", \"%29\");\n str = str.replace(\"*\", \"%2A\");\n str = str.replace(\"'\", \"%27\");\n str = str.replace(\":\", \"%3A\");\n str = str.replace(\";\", \"%3B\");\n str = str.replace(\"<\", \"%3C\");\n str = str.replace(\"=\", \"%3D\");\n str = str.replace(\"<\", \"%3E\");\n str = str.replace(\"?\", \"%3F\");\n return str;\n}", "title": "" }, { "docid": "0e589b7ba3ddc03d8f4d19793d1d4d16", "score": "0.5524472", "text": "function safeFilter(filter, handler, msg) {\n\t var result = false;\n\t try {\n\t result = filter.filterMessage(handler, msg);\n\t }\n\t catch (err) {\n\t console.error(err);\n\t }\n\t return result;\n\t}", "title": "" }, { "docid": "0a39ddc658486099920f1f93d27b5115", "score": "0.552343", "text": "function restrictEntryToSafeHTML(e, field) {\n var c = whatKey(e);\n if (c.indexOf('~') != -1)\n return true;\n\n if (c == '<' || c == '>')\n return false;\n\n return true;\n}", "title": "" }, { "docid": "23967cb54fa924262e0b0991ad016c78", "score": "0.552341", "text": "function protect(txt) {\n\treturn (\"\"+txt).replace(/[\\\\\\/\\s<>]+/g,' ');\n}", "title": "" }, { "docid": "4e3c3076fd28c12c152a090c8f1c3e07", "score": "0.5517085", "text": "function vulnerables() { \n \n }", "title": "" }, { "docid": "1964ff05905b533d12095d3b6bc673de", "score": "0.55109656", "text": "function cleanFilterName(filterName) {\n\t return filterName.replace(/^\\s+|\\s+$/g, '').toLowerCase();\n\t }", "title": "" }, { "docid": "18b67f5a41930f3f8f18b1c60be9f935", "score": "0.5508259", "text": "static escapeHtml(unsafe) {\n if (!unsafe) {\n return unsafe;\n }\n return unsafe.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;').replace(/'/g, '&#039;');\n }", "title": "" }, { "docid": "0214c1974ff9719a7f5d34249d7164dd", "score": "0.5507471", "text": "function sanitize(str) {\n var s = str;\n if (s && typeof s === 'string') {\n s = str.replace(calProhibitedCharsRegex, '_');\n s = s.replace(calProhibitedNonAsciiChars, '_');\n if (s.length > 127) {\n s = s.substr(0, 127);\n }\n }\n return s;\n}", "title": "" } ]
9f068e3108c2441c2f90942c489f9c40
this should work without the while loop but when I tried it with /\s+/ it was only removing the firtst whitespace
[ { "docid": "5a082b97262573b4f789faa9724c9455", "score": "0.6475974", "text": "function trim_string(str) {\n var ret = str;\n while(ret.search(/[\\s\\0\\t]/) != -1)\n {\n ret = ret.replace(/[\\s\\0\\t]/,'');\n }\n\nreturn ret;\n}", "title": "" } ]
[ { "docid": "07aebb66a377995a91fddad4a090f00e", "score": "0.7269041", "text": "function triming(str){return str.replace(/(?:(?:^|\\n)\\s+|\\s+(?:$|\\n))/g,'').replace(/\\s+/g,' ');}", "title": "" }, { "docid": "f8cd1a4cebf3db636d1e05c15378cb71", "score": "0.72051287", "text": "function strips(str) { return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '').replace(/\\s+/, ' ');}", "title": "" }, { "docid": "004cdb2aaf18424b21849b1caf6db4b2", "score": "0.71206176", "text": "_removeWhitespace(txt) {\n return txt.replace(/\\r?\\n|\\r|\\v|\\t|\\n/g, ' ')\n .replace(/\\s{2,}/g, ' ')\n .replace(/\\s+(\\W)/g, \"$1\")\n .trim();\n }", "title": "" }, { "docid": "722aa9a95045ae6726e3eea552075afd", "score": "0.695297", "text": "function of_Trim(s) {//***\r\n s = s.replace(/(^\\s*)|(\\s*$)/gi,\"\");\r\n s = s.replace(/[ ]{2,}/gi,\" \");\r\n s = s.replace(/\\n /,\"\\n\");\r\n return s;\r\n}", "title": "" }, { "docid": "b5da657450b1a2497a0c747d118ce536", "score": "0.683334", "text": "function trimWhitespace(str) {\n return str.replace(/^\\s+/, \"\").replace(/\\s+$/, \"\");\n }", "title": "" }, { "docid": "b7a341010e092e9b434841ac630af1b8", "score": "0.6825944", "text": "removeAllSpaces(input) {\n return input.replace(/ /g, '');\n }", "title": "" }, { "docid": "e0479abc7ee6b3c6efb6ac4228821d39", "score": "0.68236285", "text": "function trim(s) {return s.replace(/(^\\s+)|(\\s+$)/g,\"\");}", "title": "" }, { "docid": "2444a69950bff2271a09de3b62f70bcf", "score": "0.67890227", "text": "function trimr(str) {\r\n return str.replace(/\\s+$/, '');\r\n}", "title": "" }, { "docid": "5b778510eb17a52ed6d6ae762c837d3a", "score": "0.6769052", "text": "function noWhiteSpace(str)\r\n{\r\n str = str.trim();\r\n str = str.replace(/\\s/g, \"\");\r\n return str; \r\n}", "title": "" }, { "docid": "e66cb3ca96f32d13533724810384a274", "score": "0.67065763", "text": "function trimSpace(text) {\n\tvar iStartIndex = 0;\n\tvar iEndIndex = text.length;\n\n\tfor (var i = 0; i < text.length; ) {\n\t\tif (text.charAt(i) == \" \") {\n\t\t\tiStartIndex = ++i;\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (iStartIndex < iEndIndex) {\n\t\tfor (var i = text.length; i >= 0; ) {\n\t\t\tif (text.charAt(--i) == \" \") {\n\t\t\t\tiEndIndex = i;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n//alert(iStartIndex + \", \" + iEndIndex);\n\treturn text.substring(iStartIndex, iEndIndex);\n}", "title": "" }, { "docid": "e145ba144f8f9e434591e55b856193ec", "score": "0.6685103", "text": "static RemoveWhiteSpace(str)\r\n {\r\n var startIndex;\r\n var endIndex;\r\n var filteredString;\r\n\r\n if(CommonWorkItems.IsNullOrWhiteSpace(str))\r\n {\r\n throw new ReferenceError(\"string is null or empty\");\r\n }\r\n\r\n filteredString = new String();\r\n startIndex = 0;\r\n endIndex = 0;\r\n\r\n for(startIndex = 0; str[startIndex] == \" \"; startIndex++) { }\r\n for(endIndex = str.length - 1; str[endIndex] == \" \"; endIndex--) { }\r\n while(startIndex <= endIndex)\r\n {\r\n filteredString += str[startIndex];\r\n startIndex++;\r\n }\r\n\r\n return filteredString;\r\n }", "title": "" }, { "docid": "01f461a0692499ad7f45ac863270b9a4", "score": "0.6657972", "text": "function removeBlankSpaces(str){\n\tvar strOut = \"\";\n\tfor (var i = 0; i < str.length; i++){\n\t\tif (str[i] != \" \" && str[i] != \"\\t\" && str[i] != \"\\r\" && str[i] != \"\\n\"){\n\t\t\t// add the character\n\t\t\tstrOut += str[i];\n\t\t}\n\n\t}\n\treturn strOut;\n}", "title": "" }, { "docid": "0367965f8fe5cd29ca39c38a3fedf615", "score": "0.66330534", "text": "function trimWhitespace(s) {\n\tvar result = \"\";\n\tvar n = 0;\n\tvar i = 0;\n\tvar len = s.length;\n\n\tfor (i = 0; i < len; i++) {\n\t\t// Ignore space and non-break space\n\t\tn = s.charCodeAt(i);\n\t\tif (n != 32 && n != 160) {\n\t\t\tresult += s.charAt(i);\n\t\t}\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "5ab67acf220a4c96740e29a92414c2f1", "score": "0.66237533", "text": "function trim() {\n while (assert(i < mhtml.length - 1, 'Unexpected EOF') && /\\s/.test(mhtml[i])) {\n if (mhtml[++i] == '\\n') {\n l++;\n }\n }\n }", "title": "" }, { "docid": "fc1b0591596dfb16ae0cdee1f9c38257", "score": "0.6615298", "text": "skipSpaces() {\n while (this.currentChar === \" \" || this.currentChar === '\\n') {\n this.consume();\n }\n }", "title": "" }, { "docid": "3ad8c3a1e0fca1acfe921c9f6b3eb66c", "score": "0.66070276", "text": "function eraseFirstSpace(s) {\n return s.replace(/^(\\r\\n|\\n|\\r)\\s?/g, '\\n');\n}", "title": "" }, { "docid": "f99dfd296ecb5c8a1b7b6919edc7abde", "score": "0.65856105", "text": "function removeExtraSpaces(s)\n\t{\n\t\treturn stringTrim(s.replace(/\\s+/g, \" \"));\n\t}", "title": "" }, { "docid": "a06ca2cf1351ed4c93f87ef2a654576c", "score": "0.65689087", "text": "function white() {\n while (ch && ch <= ' ') {\n next()\n }\n }", "title": "" }, { "docid": "33f6d5018f7e7f1e371b8e13bd992e70", "score": "0.65686697", "text": "function noSpace(x){\n return x.replace(/\\s/g,'')\n\n\n console.log( a.split(' ').join('') );\n \n \n }", "title": "" }, { "docid": "eebc83580c2b24f02ef33d6eb1963473", "score": "0.6551344", "text": "function trimLargeSpaces(arr){\n let temp = []\n let flag = false\n for(let i=0;i<arr.length;i++){\n if(arr[i]=='' || arr[i]=='\\r'){\n if(flag)\n continue\n else{\n flag = true\n temp.push(arr[i])\n }\n }\n else{\n temp.push(arr[i])\n flag = false\n }\n }\n return temp\n}", "title": "" }, { "docid": "11186cf41a900cc4fad6b930fef305f6", "score": "0.65502113", "text": "function trim() {\n while (assert(i < mhtml.length - 1, 'Unexpected EOF') && /\\s/.test(mhtml[i])) {\n if (mhtml[++i] == '\\n') { l++; }\n }\n }", "title": "" }, { "docid": "04c8a864c09b7e4783b0fea569119071", "score": "0.6547228", "text": "function fold_whitespace(s, trailing_space) {\n\ts = s.replace(/[\\n\\t]+/g, \" \");\n\ts = s.replace(/ +/g, \" \");\n\tif (trailing_space && s.startsWith(\" \")) return s.slice(1);\n\treturn s;\n}", "title": "" }, { "docid": "d3745c7a12d1c676701c948ea674b299", "score": "0.65432054", "text": "function strip_spaces(text) {\n\tvar prefix = null;\n\tvar lines = text.replace(/^\\s*\\n|\\n\\s*$/g,'').split('\\n');\n\tfor (i in lines) {\n\t\tif (lines[i].match(/^\\s*$/))\n\t\t\tcontinue;\n\t\tvar white = lines[i].replace(/\\S.*/, '')\n\t\tif (prefix === null || white.length < prefix.length)\n\t\t\tprefix = white;\n\t}\n\tfor (i in lines)\n\t\tlines[i] = lines[i].replace(prefix, '');\n\treturn lines.join('\\n');\n}", "title": "" }, { "docid": "806a07b5c771efc3c7d9ad9a86aba856", "score": "0.6541612", "text": "function remove_spaces(instr) {\r\n var i;\r\n var outstr = \"\";\r\n\r\n for (i = 0; i < instr.length; i++) {\r\n if (instr.charAt(i) != \" \") {\r\n // not a space, include it\r\n outstr += instr.charAt(i);\r\n }\r\n }\r\n\r\n return outstr;\r\n}", "title": "" }, { "docid": "f10cae00ed112dfb97438ca63d34fe5b", "score": "0.6541467", "text": "function trim(s) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\treturn s.replace( /^\\s*/, \"\" ).replace( /\\s*$/, \"\" );\r\n\t\t\t\t\t}", "title": "" }, { "docid": "0313c7635bbea09289cd491487fb9b57", "score": "0.6541228", "text": "function trim(s) { \n return s.replace(/(^\\s+)|(\\s+$)/g, \"\")\n}", "title": "" }, { "docid": "954423eb812df359f2207e2412c6d275", "score": "0.6528662", "text": "function stripWhitespace(str) {\n\t// TODO:\n}", "title": "" }, { "docid": "c62c390d2cb787c9551e4cbb1ebd08f5", "score": "0.65252507", "text": "function removeSpaces(string){\n var result = string.split('');\n for(var i = 0; i < result.length; i++){\n if (result[i] === ' '){\n result[i] = null // missing semicolon -AZ\n }\n }\n return result.join('')\n}", "title": "" }, { "docid": "ba8d58c9b4a6a9de2e7280fa8d397487", "score": "0.6519288", "text": "function trim(str) {\r\n var newStr = \"\";\r\n // for loop to go through initial string?\r\n for (var i = 0; i < str.length - 1; i++) {\r\n if (str[i] != \" \" || str[i - 1] != \" \" && str[i + 1] != \" \") {\r\n newStr += str[i];\r\n console.log(newStr)\r\n }\r\n }\r\n return newStr\r\n}", "title": "" }, { "docid": "e4cfdf44729839501777d49596907047", "score": "0.6518357", "text": "function removeSpaces (str) {\n //code di sini\n}", "title": "" }, { "docid": "d741563f21dd901c61b6be7c2ae1f75f", "score": "0.65175617", "text": "function trimWhitespace(str) {\r\n return str.replace(/^\\s+|\\s+$/g, \"\");\r\n}", "title": "" }, { "docid": "4d5a250a8ae8dc1ba198a71b2f957c09", "score": "0.65093935", "text": "function remove_spaces(instr) {\r\n var i;\r\n var outstr = \"\";\r\n\r\n for (i = 0; i < instr.length; i++)\r\n if (instr.charAt(i) != \" \")\r\n // not a space, include it\r\n outstr += instr.charAt(i);\r\n\r\n return outstr;\r\n}", "title": "" }, { "docid": "967ec9fdc5f60cb6a37a48225740a38f", "score": "0.6504225", "text": "function myTrim(x) {\r\n return x.replace(/^\\s+|\\s+$/gm,'');\r\n}", "title": "" }, { "docid": "4748a99ae9bea10462debfa344276257", "score": "0.64971805", "text": "function trim(s) {\n var whtSpEnds = new RegExp(\"^\\\\s*|\\\\s*$\", \"g\");\n return s.replace(whtSpEnds, \"\");\n }", "title": "" }, { "docid": "bc05363bbb0e6373800e9a2b52cca5f2", "score": "0.64932686", "text": "function removeWhitespace(value)\n{\n return value.replace(/ /g,'');\n}", "title": "" }, { "docid": "f3a8e9c40044037c6136b24f2c75261a", "score": "0.6490443", "text": "function trimAll(sString)\t{\r\r\n\t\twhile (sString.substring(0,1) == ' ')\t{\r\r\n\t\t\tsString = sString.substring(1, sString.length);\r\r\n\t\t}\r\r\n\t\twhile (sString.substring(sString.length-1, sString.length) == ' ')\t{\r\r\n\t\t\tsString = sString.substring(0,sString.length-1);\r\r\n\t\t}\r\r\n\t\treturn sString;\r\r\n\t}", "title": "" }, { "docid": "630b5ae5cda5145d860cc0e0ae3e70e8", "score": "0.64818186", "text": "function mproxy_trim(str){\r\n\t\tstr\t= str.replace(new RegExp(\"^[\\\\s\\\\n\\\\r]*\", \"g\"), \"\");\r\n\t\tstr\t= str.replace(new RegExp(\"[\\\\s\\\\n\\\\r]*$\", \"g\"), \"\");\r\n\t\t\r\n\t\treturn str;\r\n\t}", "title": "" }, { "docid": "12326a7f9ef4f3e79c97ea1ae9dc04db", "score": "0.6480962", "text": "function stripWhitespace(s)\r\n{\r\n\treturn stripCharsInBag(s,espacios);\r\n}", "title": "" }, { "docid": "bb2ed72333ccbde5d164d37bfbf77381", "score": "0.6473332", "text": "function noSpace(x){\n return x.replace(/\\s/g, '');\n}", "title": "" }, { "docid": "f361e227c38c683ff42be7b67a24a8ae", "score": "0.6471193", "text": "function skipWhitespace() {\n\t\tfor (; cursor < input.length; cursor++) {\n\t\t\twhile (input[cursor] == \"\\\\\" && (cursor < input.length-1 && whitespace(input[cursor+1])))\n\t\t\t\tcursor++;\n\t\t\tif (!whitespace(input[cursor]))\n\t\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "d139721afe3cb1da96cf4a093dee72ef", "score": "0.6470444", "text": "function normalizeWhitespace( text ) {\r\n\t\treturn trim(text).replace(RE_TIDY_CONSECUTIVE_WHITESPACE, SPACE_STRING);\r\n\t}", "title": "" }, { "docid": "d139721afe3cb1da96cf4a093dee72ef", "score": "0.6470444", "text": "function normalizeWhitespace( text ) {\r\n\t\treturn trim(text).replace(RE_TIDY_CONSECUTIVE_WHITESPACE, SPACE_STRING);\r\n\t}", "title": "" }, { "docid": "bc3e4ad4a01f283c9f55754f722fa189", "score": "0.6462837", "text": "function trimBetweenSpaces(objValue) {\nvar blankExists = false\nvar newValue = new String()\nvar ch\n \nfor (var i=0; i < objValue.length; i++) {\nch = objValue.charAt(i)\nif ( ch == \" \" ) {\nif ( blankExists == false ) {\nblankExists = true\nnewValue = newValue + ch\n}\n}\nelse {\nnewValue = newValue + ch\nblankExists = false\n}\n}\nif ( newValue == null )\nreturn objValue\nelse\nreturn newValue\n}", "title": "" }, { "docid": "df985fac07b0b91cac62bad19e840dd1", "score": "0.6462336", "text": "function removeSpaces( str ) {\n\t\t\treturn str.replace(/\\s+/g, '');\n\t\t}", "title": "" }, { "docid": "17929a9796338123f44465b541cf7301", "score": "0.6447501", "text": "function collapseWhitespace() {\n\twhile (defined(myCharA) && isWhitespace(myCharA) && defined(myCharB) && isWhitespace(myCharB)) {\n\t\tif (isEndspace(myCharA) || isEndspace(myCharB)) {\n\t\t\tmyCharA = '\\n';\n\t\t}\n\t\taction4(); // delete b\n\t}\n}", "title": "" }, { "docid": "bfb0b7224ee7dd0963411a1d38c8d745", "score": "0.6443109", "text": "function removeTrailingWhitespace(s) {\n while (s.length > 0 && /\\s|\\n|\\r/.test(s[s.length - 1]))\n s = s.substring(0, s.length - 1);\n return s;\n }", "title": "" }, { "docid": "92b89c6c459ab5defd8fb734b1f8058c", "score": "0.644253", "text": "function normalizeWhitespace( text ) {\n\t\treturn trim(text).replace(RE_TIDY_CONSECUTIVE_WHITESPACE, SPACE_STRING);\n\t}", "title": "" }, { "docid": "2c7fee4bb0535f72b33def616f303cd0", "score": "0.6434421", "text": "function myTrim(x) {\r\n\t return x.replace(/^\\s+|\\s+$/gm,'');\r\n\t}", "title": "" }, { "docid": "5d5bd154e813e711914c788f8ac2df07", "score": "0.64252543", "text": "function trim(str){\r\n\treturn str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\r\n\t//return str.replace(/^\\s+/g,'').replace(/\\s+$/g,'');\r\n\t//return str.replace(/^\\s*|\\s*$/g,\"\");\r\n\t\r\n//\tfor(i=0; i<str.length; )\r\n//\t{\r\n//\t\tif(str.charAt(i)==\" \")\r\n//\t\t\tstr=str.substring(i+1, str.length);\r\n//\t\telse\r\n//\t\t\tbreak;\r\n//\t}\r\n//\r\n//\tfor(i=str.length-1; i>=0; i=str.length-1)\r\n//\t{\r\n//\t\tif(str.charAt(i)==\" \")\r\n//\t\t\tstr=str.substring(0,i);\r\n//\t\telse\r\n//\t\t\tbreak;\r\n//\t}\r\n//\t\r\n//\treturn str;\r\n}", "title": "" }, { "docid": "5d5bd154e813e711914c788f8ac2df07", "score": "0.64252543", "text": "function trim(str){\r\n\treturn str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\r\n\t//return str.replace(/^\\s+/g,'').replace(/\\s+$/g,'');\r\n\t//return str.replace(/^\\s*|\\s*$/g,\"\");\r\n\t\r\n//\tfor(i=0; i<str.length; )\r\n//\t{\r\n//\t\tif(str.charAt(i)==\" \")\r\n//\t\t\tstr=str.substring(i+1, str.length);\r\n//\t\telse\r\n//\t\t\tbreak;\r\n//\t}\r\n//\r\n//\tfor(i=str.length-1; i>=0; i=str.length-1)\r\n//\t{\r\n//\t\tif(str.charAt(i)==\" \")\r\n//\t\t\tstr=str.substring(0,i);\r\n//\t\telse\r\n//\t\t\tbreak;\r\n//\t}\r\n//\t\r\n//\treturn str;\r\n}", "title": "" }, { "docid": "e8e047ea52a3a4905a6ace4767250dea", "score": "0.64227027", "text": "static trim (str) {\n str = str.replace(/^\\s+/, '')\n for (var i = str.length - 1; i >= 0; i--) {\n if (/\\S/.test(str.charAt(i))) {\n str = str.substring(0, i + 1)\n break\n }\n }\n return str\n }", "title": "" }, { "docid": "c3e87a1f92e02a3512aae2e98347c59a", "score": "0.6417742", "text": "function cleanUpInput(text) {\n\t// Replace unnecessary whitespaces\n\treturn text.replace(/( )+\\n/g, \"\\n\").replace(/(\\s)*$/, \"\");\n}", "title": "" }, { "docid": "08c9c8b64c51848c27a2143a46872c95", "score": "0.6412648", "text": "function stripInitialWhitespace(s)\r\n{\r\n\tvar i=0;\r\n\twhile((i<s.length)&&charInString(s.charAt(i),espacios)) i++;\r\n\treturn s.substring(i,s.length);\r\n}", "title": "" }, { "docid": "3cd9a4087e5b9388981e17612e29fa65", "score": "0.6410123", "text": "function myTrim(x) {\n return x.replace(/^\\s+|\\s+$/gm,'');\n}", "title": "" }, { "docid": "3cd9a4087e5b9388981e17612e29fa65", "score": "0.6410123", "text": "function myTrim(x) {\n return x.replace(/^\\s+|\\s+$/gm,'');\n}", "title": "" }, { "docid": "3cd9a4087e5b9388981e17612e29fa65", "score": "0.6410123", "text": "function myTrim(x) {\n return x.replace(/^\\s+|\\s+$/gm,'');\n}", "title": "" }, { "docid": "974e207804085dcf3841b08ad95c6499", "score": "0.6410023", "text": "function trim(txt) {\n txt = txt.replace(/^(\\s)+/, '');\n txt = txt.replace(/(\\s)+$/, '');\n \treturn txt;\n}", "title": "" }, { "docid": "aa9f93ed51b5c419168f1af1af719642", "score": "0.63837224", "text": "function remSpaceAround(s)\n{\t\n\tvar len = s.length;\n\tif(len<=0) return \"\";\n\tvar start=0,end=len\n\tvar c=s.substr(start,1);\n\twhile (c==' ' && start<len)\n\t{\n\t\tstart++\n\t\tc=s.substr(start,1);\t\t\n\t}\n\tif(start<len)\n\t{\n\t\tc=s.substr(end-1,1);\n\t\twhile (c==' ')\n\t\t{\n\t\t\tend--\n\t\t\tc=s.substr(end-1,1);\t\t\n\t\t}\n\t}\n\tvar sub = s.substring(start,end);\n//\talert(sub.length +\"-\"+sub)\n\treturn sub\t\n}", "title": "" }, { "docid": "3dbc2cfd72810ced19791bc1b562df77", "score": "0.63762534", "text": "function trimString(input){\n return input.replace(/^\\s+|\\s+$/gm,'');\n}", "title": "" }, { "docid": "227f2c8e7f3c2d228daba2a09abfa9c2", "score": "0.6367997", "text": "function normalizeWhitespace( text ) {\n return trim(text).replace(RE_TIDY_CONSECUTIVE_WHITESPACE, SPACE_STRING);\n }", "title": "" }, { "docid": "227f2c8e7f3c2d228daba2a09abfa9c2", "score": "0.6367997", "text": "function normalizeWhitespace( text ) {\n return trim(text).replace(RE_TIDY_CONSECUTIVE_WHITESPACE, SPACE_STRING);\n }", "title": "" }, { "docid": "88ad834175427a8595b9b0b6d1269687", "score": "0.6366232", "text": "function trimm(str) {\r\n return str.replace(/\\s+/g, ' ');\r\n}", "title": "" }, { "docid": "71f57b4aab970478e1c766a3e0ed987d", "score": "0.6366038", "text": "function trim(str) {\n str = str.replace(/^\\s+/, '');\n for (var i = str.length - 1; i >= 0; i--) {\n if (/\\S/.test(str.charAt(i))) {\n str = str.substring(0, i + 1);\n break;\n }\n }\n return str;\n }", "title": "" }, { "docid": "54cac0f4dddba567ce84984441bf6224", "score": "0.6366016", "text": "function normalizeWhitespace( text ) {\n return trim(text).replace(RE_TIDY_CONSECUTIVE_WHITESPACE, SPACE_STRING);\n }", "title": "" }, { "docid": "adcaa6a1457c108b166dd1fb8a09a2cf", "score": "0.6365814", "text": "function removeSpace (str) {\n let output = '';\n\n for (let i = 0; i < str.length; i++) {\n if (str[i] !== ' ') {\n output += str[i]\n }\n }\n\n return output;\n}", "title": "" }, { "docid": "7edbe2400b34b00940c3b60ed38ed2e2", "score": "0.6359114", "text": "function cleanWhitespace(string) {\n return string.replace(/\\s/g, '');\n}", "title": "" }, { "docid": "4a56899e57c058281bf8937c6412f6c5", "score": "0.6357196", "text": "function removeSpaces(string) { \n return string.split(' ').join('')\n}", "title": "" }, { "docid": "06315d009af9b855e64a96c1be110e78", "score": "0.6352287", "text": "function rm_whitespace(node){\n\tif (node == null) return false;\n\tvar nodes = node.childNodes;\n\tif (nodes.length == 0 || (nodes.length == 1 && nodes.item(0).nodeType == 3)) return;\n\n\tvar i = nodes.length - 1;\n\tvar prev_node;\n\tvar cur_node = nodes.item(i);\n\n\twhile(i > -1){\n\t\tcur_node = nodes.item(i);\n\t\tif (cur_node.nodeType == 3 && cur_node.nodeValue.search(/^\\s+$/) == 0){\n\t\t\tnode.removeChild(nodes.item(i));\n\n\t\t}\n\t\telse if(cur_node.nodeType == 1){\n\t\t\trm_whitespace(cur_node);\n\t\t}\n\t\ti--;\n\t}\n}", "title": "" }, { "docid": "c15d3dfc4bd139786b2bf88d2e781c79", "score": "0.63512385", "text": "function dwscripts_trim(theStr)\n{\n var retVal = \"\";\n\n if (typeof theStr == \"string\")\n {\n var firstNonWhite = theStr.search(/\\S/);\n\n if (firstNonWhite != -1)\n {\n //Count the spaces at the end\n for (var i=theStr.length-1; i >= 0; i--)\n {\n if (theStr.charAt(i).search(/\\S/) != -1)\n {\n theStr = theStr.substring(firstNonWhite, i+1);\n break;\n }\n }\n\n retVal = theStr;\n }\n }\n\n return retVal;\n}", "title": "" }, { "docid": "4447c20c4699fad345f69f2d7f3dbaef", "score": "0.6350147", "text": "function trim(s) {\n return s.replace( /^\\s*/, \"\" ).replace( /\\s*$/, \"\" );\n }", "title": "" }, { "docid": "d94357e335d843fedb614f8067271045", "score": "0.6319182", "text": "function quicktrim (str) {\n\tstr = str.replace(/^\\s+/, '');\n\tfor (var i = str.length - 1; i >= 0; i--) {\n\t\tif (/\\S/.test(str.charAt(i))) {\n\t\t\tstr = str.substring(0, i + 1);\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn str;\n\n}", "title": "" }, { "docid": "d890873ddb81b4a05d52ed2881903ecf", "score": "0.63106155", "text": "function deleteBlanks(entry)\n{\n\tvar len = entry.length ;\n\tvar foundBlank = 1;\n\twhile(foundBlank == 1 && len > 0) \n\t{\n\t\tvar indx = entry.indexOf(\" \");\n\t\tif(indx == -1) \n\t\t\tfoundBlank = 0 ;\n\t\telse\n\t\t\tentry = entry.substring(0,indx) + entry.substring(indx+1,len);\n\t\tlen = entry.length;\n\t}\n\treturn entry;\n}", "title": "" }, { "docid": "ef4efccf81b1b43750a993e767a713eb", "score": "0.6308434", "text": "function removeSpaces(str) {\n return str.replace(/ /g,'');\n }", "title": "" }, { "docid": "3e3216f09066f8204d0f88c64c4ebbe2", "score": "0.63030636", "text": "function trimAll (str) {\n return str.replace(/\\s/g, '')\n }", "title": "" }, { "docid": "63465656a2574cabf7219d0f987e5f22", "score": "0.62877125", "text": "static trim(input) {\n return input.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n //return input.replace(/^\\s+|\\s+$/g, '');\n }", "title": "" }, { "docid": "9a84f89d01007d606f09c0f44d9750a1", "score": "0.62808084", "text": "function RTrim(temp)\r\n{\r\n if (temp == '')\r\n return temp;\r\n return temp.replace(/\\s+$/, '');\r\n}", "title": "" }, { "docid": "be0304126ed937f12f07063d4170741d", "score": "0.6274196", "text": "function textTrim(txt) {\r\n return txt.replace(/(^\\s*)|(\\s*$)/g, '');\r\n}", "title": "" }, { "docid": "d33bcf3ec59b780f8e03ad0ce246f781", "score": "0.6272812", "text": "function isOnlyWhitespace(sourceStr) {\n // FILL THIS IN\n\treturn sourceStr.search (/\\S/) == -1;\n\n }", "title": "" }, { "docid": "d29fabae86b43b70edd8c79afe7ff3bd", "score": "0.6268227", "text": "function SuperTrim(str) {\n return str.replace(/^\\s*|\\s*$/g,'').replace(/\\s+/g,' ');\n}", "title": "" }, { "docid": "420143f758e74d26d09b3c4c93daa337", "score": "0.6268167", "text": "function stripWhitespace(str, replacement){// NOT USED IN FORM VALIDATION\r\r\n if (replacement == null) replacement = '';\r\r\n var result = str;\r\r\n var re = /\\s/g\r\r\n if(str.search(re) != -1){\r\r\n result = str.replace(re, replacement);\r\r\n }\r\r\n return result;\r\r\n}", "title": "" }, { "docid": "fb3f7c9a605b4fc47a78d23e208f73c9", "score": "0.62671536", "text": "function removeBreakingSpaces(str) {\n return str.toString().replace(new RegExp(\" \", \"g\"), \"&nbsp\");\n }", "title": "" }, { "docid": "6cdd0f0a30d27cf46aae7efbf7f40819", "score": "0.62629914", "text": "function strip(s) {\n return (s || \"\").replace(/^\\s+|\\s+$/g, \"\");\n}", "title": "" }, { "docid": "57ca680c4dacc47f54496ddc78c4b070", "score": "0.62578875", "text": "function trim(str) {\n\tstr = str.replace(/^\\s+/, '');\n\tfor (var i = str.length - 1; i >= 0; i--) {\n\t\tif (/\\S/.test(str.charAt(i))) {\n\t\t\tstr = str.substring(0, i + 1);\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn str;\n}", "title": "" }, { "docid": "b3be6e2e0eadf99e14976be125e29883", "score": "0.62560695", "text": "function removeSpace(queryString){\n let newQuery= queryString.replace(/\\s/g, '');\n console.log(newQuery);\n return newQuery;\n}", "title": "" }, { "docid": "29fe7018bd8403159db941cfdebd714e", "score": "0.62461776", "text": "equalizeWhitespace(string) {\r\n return string.replace(/\\s+/g, \" \");\r\n }", "title": "" }, { "docid": "0c42b75470a9b3503626be49dbbd1c4c", "score": "0.6245726", "text": "function Trim() {\n return this.replace(/\\s+$|^\\s+/g, \"\");\n}", "title": "" }, { "docid": "91cc0e49bbed085555c5d856636876b7", "score": "0.6244063", "text": "function spaceSupressor(string) {\n return string.replace(/\\s/g, \"\");\n}", "title": "" }, { "docid": "4b6fce6ad809331127b081efca27c2d6", "score": "0.6242754", "text": "function trimTrailingSpaces(s) {\n return s.replace(/[ ]+$/gm, '');\n }", "title": "" }, { "docid": "bf85af93edb00a422b2b51de8d884487", "score": "0.62371075", "text": "function removeWhiteSpacesFromInside(value) {\n return value.replace(/ /g, \"\")\n}", "title": "" }, { "docid": "e6e92703dd13c6b6299d032baab1abba", "score": "0.6232427", "text": "function removeBlank(str) {\n return str.replace(/\\s+/g, '')\n}", "title": "" }, { "docid": "cbe39e4bc6cb6199222c41202b43543b", "score": "0.6231773", "text": "function trim(str){\n return str.replace(/(^\\s*)|(\\s*$)/g,\"\");\n}", "title": "" }, { "docid": "2db706569f2ba121038f7b08acc084d2", "score": "0.62303823", "text": "function removeWhiteSpace(string) {\r\n if (string != null) {\r\n string = string.replace(/\\s\\s+/g, ' ');\r\n }\r\n return string;\r\n}", "title": "" }, { "docid": "380b8387fa7bc245ce6db772ca3b6fda", "score": "0.6223933", "text": "function catchupWhiteSpace(end, state) {\n catchup(end, state, _stripNonWhite);\n}", "title": "" }, { "docid": "e244846457cb75f53aef9c6f7239bd28", "score": "0.6222798", "text": "function catchupWhiteSpace(end, state) {\n catchup(end, state, stripNonWhite);\n}", "title": "" }, { "docid": "e244846457cb75f53aef9c6f7239bd28", "score": "0.6222798", "text": "function catchupWhiteSpace(end, state) {\n catchup(end, state, stripNonWhite);\n}", "title": "" }, { "docid": "e244846457cb75f53aef9c6f7239bd28", "score": "0.6222798", "text": "function catchupWhiteSpace(end, state) {\n catchup(end, state, stripNonWhite);\n}", "title": "" }, { "docid": "e244846457cb75f53aef9c6f7239bd28", "score": "0.6222798", "text": "function catchupWhiteSpace(end, state) {\n catchup(end, state, stripNonWhite);\n}", "title": "" }, { "docid": "e244846457cb75f53aef9c6f7239bd28", "score": "0.6222798", "text": "function catchupWhiteSpace(end, state) {\n catchup(end, state, stripNonWhite);\n}", "title": "" }, { "docid": "b51b1b3636a1d7ef12e63e7209679d7c", "score": "0.62202513", "text": "function trim(str){\r\nreturn str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\r\n}", "title": "" }, { "docid": "394f34913911869e1eab3e0f32633309", "score": "0.6212501", "text": "function trim(cadena){\n cadena = sanitize(cadena).trim();\n var str = '';\n var cont = 0;\n \n while(cont < cadena.length){\n\tif(cadena.charAt(cont) != ' ')\n\t\tstr += cadena.charAt(cont);\n\t\t\n\tcont++;\n }\n\n return str;\n}", "title": "" } ]
fe276d60deef34d8037e8c4c305e7c94
Returns an azure function context for testing
[ { "docid": "6559f7cacae8d2b287d2490241c96513", "score": "0.68068016", "text": "function getTestFunctionContext(fileName, contentType, blobPath) {\n // Returns an object that is the same as the azure function host context object but with the file data missing\n let context = JSON.parse(fs.readFileSync(path.join(fixtures, \"test-context.json\"), \"utf-8\"));\n\n // update filename\n context.bindingData.blobTrigger = sharedConfig.blobStorage.rawImagesContainer + \"/\" + fileName;\n context.bindingData.name = fileName;\n\n // update content-type and data\n if (blobPath) {\n let buffer = fs.readFileSync(path.join(fixtures, blobPath));\n if (contentType) context.bindingData.properties.contentType = contentType;\n context.bindings.inputBlob = buffer;\n }\n\n return context;\n}", "title": "" } ]
[ { "docid": "92b4dbdfffe4fa655dd470ffc98dc29d", "score": "0.5982825", "text": "stubContext (fn) {\n console.log(fn)\n this.__stubContext = fn\n return this\n }", "title": "" }, { "docid": "bc1681582714b101588415d3a54b0c39", "score": "0.5545897", "text": "getApplicationContext() {\n let context = \"\";\n // figure out the context we need to apply for where the editing creds\n // and API might come from\n // beaker is a unique scenario\n if (typeof DatArchive !== typeof undefined) {\n context = \"beaker\"; // implies usage of BeakerBrowser, an experimental browser for decentralization\n } else {\n switch (window.HAXCMSContext) {\n case \"published\": // implies this is to behave as if it is completely static\n case \"nodejs\": // implies nodejs based backend, tho no diff from\n case \"php\": // implies php backend\n case \"11ty\": // implies 11ty static site generator\n case \"demo\": // demo / local development\n case \"desktop\": // implies electron\n case \"local\": // implies ability to use local file system\n case \"userfs\": // implies hax.cloud stylee usage pattern\n context = window.HAXCMSContext;\n break;\n default:\n // we don't have one so assume it's php for now\n // @notice change this in the future\n context = \"php\";\n break;\n }\n }\n return context;\n }", "title": "" }, { "docid": "5dfe0622b3e12587749591e83cc37c10", "score": "0.5524954", "text": "function getContext(){\n \n if(!domain.active || !domain.active.context){\n if(this.mockContext) return this.mockContext\n \n logger.error(\"getContext called but no active domain\", domain.active);\n logger.error(\"Caller is \", arguments.callee && arguments.callee.caller && arguments.callee.caller.name, arguments.callee && arguments.callee.caller );\n throw \"Context not available. This may happen if the code was not originated by Angoose\"; \n } \n \n return domain.active.context;\n}", "title": "" }, { "docid": "e9da2643b1c30bfba7d23e39c1a16250", "score": "0.549869", "text": "function getContext(expressRequest) {\n return base_1.DemoApi_V1.getContext(expressRequest);\n}", "title": "" }, { "docid": "ee1339fce287a529a8aab7a1c81c9c57", "score": "0.5419889", "text": "function getFunctionContext( func , context ) {\n\t\t\n\t\tvar cut = func.split('.');\n\t \n\t\tif( cut.length == 1 ) { \n\t\t\t \n\t\t\tcontext[ cut[0] ]();\n\t\t\treturn;\n \n\t\t}\n\t\t\n\t\tvar arr = [cut.shift(), cut.join('.')];\n\t\t \n\t\tvar c = context[ arr[0] ];\n\n\t\tgetFunctionContext( arr[ 1 ] , c );\n\t\n\t}", "title": "" }, { "docid": "93113c4779ced1fe94b3331285dc4510", "score": "0.5411469", "text": "_ctx$getter() {\n return this.testRun.ctx;\n }", "title": "" }, { "docid": "a36bdf26e52eb927f2a31d96ac77f9b3", "score": "0.53817475", "text": "static getMockContext() {\n\n\t\tconst fnNames= [\n\t\t\t'moveTo', 'lineTo', 'clearRect', 'arc',\n\t\t];\n\n\t\tconst ctx= { calledFn: [] };\n\t\tconst fn= name => () => ctx.calledFn.push(name);\n\n\t\tfnNames.forEach( name => ctx[name] = fn(name) );\n\n\t\treturn ctx;\n\t}", "title": "" }, { "docid": "028e47fc46f7871a4a355e2106e81404", "score": "0.536435", "text": "function ContextAPI() {}", "title": "" }, { "docid": "63a8fb662a704bb43a6c7d8231302717", "score": "0.53551453", "text": "function myFunction(a) {\n // local context\n\n // function dibawah ini ada di local context-nya si myFunction\n // jika function dibawah ini di return, makanya nantinya ia akan ada\n // di global context\n let test = function (b) {\n // local context\n return a * b;\n };\n\n return test;\n}", "title": "" }, { "docid": "bd1710abbef8765f92fecb957a2f4ea7", "score": "0.5278191", "text": "function suiteletContext() {}", "title": "" }, { "docid": "b0af11e8b8371f4c2aaa5ebbbda850e5", "score": "0.518125", "text": "async function testFunctionPropertyError(context, message) {\n try {\n await azureFunction(context);\n } catch (ex) {\n console.log(ex.message, message);\n assert(ex.message.indexOf(message) !== -1);\n }\n}", "title": "" }, { "docid": "2aca9324c13d8a5382e6c657bdc09da6", "score": "0.51629096", "text": "function createContext() {\n var sandbox = {\n Buffer: Buffer,\n clearImmediate: clearImmediate,\n clearInterval: clearInterval,\n clearTimeout: clearTimeout,\n setImmediate: setImmediate,\n setInterval: setInterval,\n setTimeout: setTimeout,\n console: console,\n process: process\n };\n sandbox.global = sandbox;\n return sandbox;\n}", "title": "" }, { "docid": "be6fff5ecfec54dcf0a93807fa486fc0", "score": "0.5161653", "text": "function needsContextInParams (wrappedFunction) {\n\treturn function (params, callback) {\n\t\tlog.debug(\"Supplied context:\", params.context);\n\t\tif (!params.context) {\n\t\t\treturn callback(\"Can't work without context!\");\n\t\t}\n\n\t\tparams.context = JSON.parse(params.context);\n\t\twrappedFunction(params, callback);\n\t};\n}", "title": "" }, { "docid": "dbaf218af52bfc4fd2049225cf4b3f95", "score": "0.51352394", "text": "async function getContext() {\n const { visitor } = await client.get('visitor');\n return { visitor }\n}", "title": "" }, { "docid": "2705de803e1d3e519de02d2e471d7778", "score": "0.5132269", "text": "createContext() {\n let Context = this.Context;\n assert(typeof Context === 'function', `${Context} is not a valid Context function`);\n\n // create Context\n let ctx = Context.create.apply(null, arguments);\n\n ctx.adapter = this;\n\n return ctx;\n }", "title": "" }, { "docid": "cf206e1c2afe788a0c0209e7708e595b", "score": "0.51033986", "text": "getContext() {\n return this.context;\n }", "title": "" }, { "docid": "a77a2388df12361250e92aaafe6726e7", "score": "0.510233", "text": "getContext() {\n return this._context;\n }", "title": "" }, { "docid": "a77a2388df12361250e92aaafe6726e7", "score": "0.510233", "text": "getContext() {\n return this._context;\n }", "title": "" }, { "docid": "7c646e930a95c01f3d793aaf454fd153", "score": "0.5093713", "text": "function getContext(_, ctx) {\n return ctx;\n}", "title": "" }, { "docid": "7c646e930a95c01f3d793aaf454fd153", "score": "0.5093713", "text": "function getContext(_, ctx) {\n return ctx;\n}", "title": "" }, { "docid": "5a673fb5aab9006c92277888b67fe5b9", "score": "0.50819236", "text": "function getContext(_, ctx) {\n return ctx;\n }", "title": "" }, { "docid": "69010b88495dcedae73e574a3610e092", "score": "0.5050119", "text": "function getContext() {\n if (globalContext === dummyContext && _context_AudioContext__WEBPACK_IMPORTED_MODULE_1__.hasAudioContext) {\n setContext(new _context_Context__WEBPACK_IMPORTED_MODULE_2__.Context());\n }\n return globalContext;\n}", "title": "" }, { "docid": "69010b88495dcedae73e574a3610e092", "score": "0.5050119", "text": "function getContext() {\n if (globalContext === dummyContext && _context_AudioContext__WEBPACK_IMPORTED_MODULE_1__.hasAudioContext) {\n setContext(new _context_Context__WEBPACK_IMPORTED_MODULE_2__.Context());\n }\n return globalContext;\n}", "title": "" }, { "docid": "be023629450f286bd9b5396f57d1b0d0", "score": "0.5035033", "text": "function Context() {}", "title": "" }, { "docid": "7026c2e932a46f7396b7030b268752c4", "score": "0.5034679", "text": "function ContextAPI() {\n }", "title": "" }, { "docid": "5054bf1aa288fd3364a4ca6ae104ad6d", "score": "0.50078154", "text": "async function callAfunction() {\n let functionService = new FunctionService(process.env.MICRO_API_TOKEN);\n let rsp = await functionService.call({\n name: \"my-first-func\",\n request: {},\n });\n console.log(rsp);\n}", "title": "" }, { "docid": "76d2482f2251393388c1e0b83ae762fc", "score": "0.50016236", "text": "function context(df, transforms, functions, expr) {\n return new Context(df, transforms, functions, expr);\n }", "title": "" }, { "docid": "6a812863e589b6973f58e2cc6f119fdb", "score": "0.5000676", "text": "function createContext() {\n var context;\n context = vm.createContext();\n for (var g in global)\n context[g] = global[g];\n context.console = new Console(process.stdout);\n context.global = context;\n context.global.global = context;\n context.module = module;\n context.require = require;\n\n // Lazy load modules on use\n builtinLibs.forEach(function (name) {\n Object.defineProperty(context, name, {\n get: function () {\n var lib = require(name);\n context[name] = lib;\n return lib;\n },\n // Allow creation of globals of the same name\n set: function (val) {\n delete context[name];\n context[name] = val;\n },\n configurable: true\n });\n });\n\n return context;\n}", "title": "" }, { "docid": "d17c166b7bcda0f18a202ec5b5530e58", "score": "0.49956813", "text": "function setupMiddlewareFunc(/* your config */) {\n // startup configuration goes here\n return function createMiddlewareFunc(next) {\n return async function inner(context) {\n // do things like make objects to put on the context\n // then give following middlewares a chance\n // route handler runs last\n // awaiting is optional, depending on what you're doing\n const result = await next(context)\n // do things with result here; can replace it entirely!\n // and you're responsible for returning it\n return result\n }\n }\n}", "title": "" }, { "docid": "48c70ba6888afb9b8914471f8de6c73d", "score": "0.4982678", "text": "getContext () {\n return this._ctx\n }", "title": "" }, { "docid": "f9fcdbe3123d9a9fa700a3019e4c87ae", "score": "0.49672654", "text": "context({ req }) {\n return {\n db, pubSub, prisma, req\n };\n }", "title": "" }, { "docid": "c839d475f8abdd1886160d020efb7672", "score": "0.49564484", "text": "function Context(){}", "title": "" }, { "docid": "c839d475f8abdd1886160d020efb7672", "score": "0.49564484", "text": "function Context(){}", "title": "" }, { "docid": "c839d475f8abdd1886160d020efb7672", "score": "0.49564484", "text": "function Context(){}", "title": "" }, { "docid": "9560442a7b1f7df556906680751a501c", "score": "0.49050367", "text": "getContext() {\n return this.context;\n }", "title": "" }, { "docid": "9560442a7b1f7df556906680751a501c", "score": "0.49050367", "text": "getContext() {\n return this.context;\n }", "title": "" }, { "docid": "48757ac9de782f83e826788502830130", "score": "0.48964605", "text": "function testApplicationInsights(formContext) {\n\n try {\n //DEMO: trackTrace\n appInsights.trackTrace(\"Begin \" + \"testApplicationInsights\");\n //XRM Variables******************************************************\n appInsights.trackTrace(\"Begin \" + \"formContext variable\");\n var globalContext = Xrm.Utility.getGlobalContext();\n var formAttributes = formContext.getFormContext().data.entity.attributes;\n var organizationSettings = Xrm.Utility.getGlobalContext().organizationSettings;\n var userSettings = Xrm.Utility.getGlobalContext().userSettings;\n var clientContext = Xrm.Utility.getGlobalContext().client;\n\n var userName = userSettings.userName;\n var organizationId = organizationSettings.organizationId;\n\n dimensions = {\n [\"source\"]:\"WebResource\",\n [\"userName\"]: userName,\n [\"userId\"]: userSettings.userId,\n [\"organizationId\"]: organizationId,\n [\"client\"]: clientContext.getClient(),\n [\"uniqueName\"]: organizationSettings.uniqueName,\n [\"clientState\"]: clientContext.getClientState(),\n [\"formFactor\"]: clientContext.getFormFactor(),\n [\"isOffline\"]: clientContext.isOffline(),\n [\"clientUrl\"]: globalContext.getClientUrl(),\n [\"currentAppUrl\"]: globalContext.getCurrentAppUrl(),\n [\"version\"]: globalContext.getVersion(),\n [\"baseCurrencyId\"]: organizationSettings.baseCurrencyId,\n [\"defaultCountryCode\"]: organizationSettings.defaultCountryCode,\n [\"isAutoSaveEnabled\"]: organizationSettings.isAutoSaveEnabled,\n [\"languageId\"]: organizationSettings.languageId\n };\n\n globalContext.getCurrentAppName().then(successCallBackCustomEventPush, errorCallBackCustomEventPush);\n globalContext.getCurrentAppProperties().then(successCallBackAppPropertiesCustomEventPush, errorCallBackCustomEventPush);\n\n appInsights.trackTrace(\"End \" + \"formContext variable\");\n //XRM Variables******************************************************\n //END DEMO: trackTrace\n\n //DEMO: customEvent===================================================\n appInsights.trackTrace(\"Begin \" + \"DEMO: customEvent\");\n testTrackCustomEvent();\n appInsights.trackTrace(\"End \" + \"DEMO: customEvent\");\n //END DEMO: customEvent================================================\n\n //DEMO: pageViews===================================================\n appInsights.trackTrace(\"Begin DEMO: \" + \"pageViews\");\n //This will demo pageViews, which is set by default but not reliable. Instead we can use navigation timings.\n //Also we call startTrackPage and stopTrackPage\n //Key metrics\n var fetchStart = window.performance.timing.fetchStart;\n var loadEventEnd = window.performance.timing.loadEventEnd;\n\n var navigationStart = window.performance.timing.navigationStart;\n var firstByte = window.performance.timing.responseStart;\n var domReady = window.performance.timing.domContentLoadedEventEnd;\n var pageReady = window.performance.timing.loadEventEnd;\n\n var DomContentLoadTime = window.performance.timing.domComplete - window.performance.timing.domInteractive;\n var DomParsingTime = window.performance.timing.domInteractive - window.performance.timing.domLoading;\n var RequestResponseTime = window.performance.timing.responseEnd - window.performance.timing.requestStart;\n var PageRenderTime = window.performance.timing.domComplete - window.performance.timing.domLoading;\n var NetworkLatency = window.performance.timing.responseEnd - window.performance.timing.fetchStart;\n var RedirectTime = window.performance.timing.redirectEnd - window.performance.timing.redirectStart;\n var RedirectCount = window.performance.navigation.redirectCount;\n var navigationType = window.performance.navigation.type;\n var measurements = {\n [\"fetchStart\"]: fetchStart,\n [\"loadEventEnd\"]: loadEventEnd,\n [\"navigationStart\"]: navigationStart,\n [\"DomContentLoadTime\"]: DomContentLoadTime,\n [\"DomParsingTime\"]: DomParsingTime,\n [\"RequestResponseTime\"]: RequestResponseTime,\n [\"PageRenderTime\"]: PageRenderTime,\n [\"NetworkLatency\"]: NetworkLatency,\n [\"RedirectTime\"]: RedirectTime,\n [\"RedirectCount\"]: RedirectCount,\n [\"NavigationType\"]: navigationType\n };\n appInsights.trackPageView(name, window.location.href, dimensions, measurements, pageReady - navigationStart);\n \n appInsights.trackTrace(\"End DEMO: \" + \"pageViews\");\n //END DEMO: pageViews===============================================\n\n //DEMO: exceptions===================================================\n appInsights.trackTrace(\"Begin DEMO: \" + \"exceptions\");\n testTrackException();\n appInsights.trackTrace(\"End DEMO: \" + \"exceptions\");\n //END DEMO: exceptions===============================================\n\n //DEMO: customMetrics===================================================\n appInsights.trackTrace(\"Begin DEMO: \" + \"customMetrics\");\n testTrackCustomMetric();\n appInsights.trackTrace(\"End DEMO: \" + \"customMetrics\");\n //END DEMO: customMetrics===============================================\n\n\n\n } catch (e) {\n appInsights.trackException(e);\n }\n\n}", "title": "" }, { "docid": "d2932be1e6d0976b607cb65529410db1", "score": "0.48937842", "text": "prepare() {\n return tslib.__awaiter(this, void 0, void 0, function* () {\n // Attempts to load the tenant from the VSCode configuration file.\n const settingsTenant = getPropertyFromVSCode(\"azure.tenant\");\n if (settingsTenant) {\n this.tenantId = settingsTenant;\n }\n checkUnsupportedTenant(this.tenantId);\n });\n }", "title": "" }, { "docid": "d2932be1e6d0976b607cb65529410db1", "score": "0.48937842", "text": "prepare() {\n return tslib.__awaiter(this, void 0, void 0, function* () {\n // Attempts to load the tenant from the VSCode configuration file.\n const settingsTenant = getPropertyFromVSCode(\"azure.tenant\");\n if (settingsTenant) {\n this.tenantId = settingsTenant;\n }\n checkUnsupportedTenant(this.tenantId);\n });\n }", "title": "" }, { "docid": "199427d44ca0571cd373d7b477b18ae4", "score": "0.48782223", "text": "get context() {\n return this.ctx;\n }", "title": "" }, { "docid": "d24f80ed0c175c305740c9955553371a", "score": "0.4874296", "text": "createContext() {\n return new PharmanetContext();\n }", "title": "" }, { "docid": "f759b8b124d0abbab9fb60f1a83b592d", "score": "0.48437643", "text": "async onContextCreated(context, options) { }", "title": "" }, { "docid": "cd2ce2bfd43d8fad690ac6d2a3ee851b", "score": "0.48354745", "text": "async create(context) {\n context.result = {};\n return context;\n }", "title": "" }, { "docid": "815c3eda5303ee83a3b56b7fcfe36a1c", "score": "0.48183236", "text": "_createActionContext (name, params, metaData) {\n // Build basic action context\n const actionContext = this.$createActionContext(name, params, metaData)\n\n // Attach client caller\n actionContext.call = this.$callClient.bind(null, actionContext)\n\n // Return action context back\n return actionContext\n }", "title": "" }, { "docid": "484df69877e901811c777419a4f9ec88", "score": "0.48120743", "text": "function getContext() {\n // return context;\n return Packages.org.mozilla.javascript.Context.getCurrentContext();\n }", "title": "" }, { "docid": "87ae3d1613646ae22bbfd3ee33eb4c66", "score": "0.4809064", "text": "async function getNodeApi() {\n let authHandler = azdev.getPersonalAccessTokenHandler(azpPAT); \n let connection = new azdev.WebApi('https://dev.azure.com/mseng', authHandler); \n return await connection.getWorkItemTrackingApi();\n}", "title": "" }, { "docid": "85cd223fcd9027c4fd51179c85d46b84", "score": "0.48034778", "text": "function getContext() {\n\n var ctx = null;\n\n if(typeof GetGlobalContext !== \"undefined\") {\n ctx = GetGlobalContext(); // jshint ignore:line\n }\n else if(typeof Xrm !== \"undefined\") {\n ctx = Xrm.Page.context;\n }\n else {\n throw new Error( \"Context is not available.\");\n }\n\n return ctx;\n }", "title": "" }, { "docid": "e6bace76255a3dfe5614840e57013535", "score": "0.48009297", "text": "function setup() {\n const req = {\n body: {},\n path: '',\n url: '',\n };\n const res = {\n locals: {\n error: {},\n lambdaResponse: {},\n },\n statusCode: null,\n body: '',\n headers: {},\n };\n const next = jest.fn();\n Object.assign(res, {\n status: jest.fn(function status() {\n return this;\n }.bind(res)),\n json: jest.fn(function json() {\n return this;\n }.bind(res)),\n send: jest.fn(function send() {\n return this;\n }.bind(res)),\n });\n return { req, res, next };\n}", "title": "" }, { "docid": "d324a7319e797667b7cf55f2f15715b5", "score": "0.47923726", "text": "static get() {\n return currentContext\n }", "title": "" }, { "docid": "532de995469b9b22428658fc5f32d6e3", "score": "0.47920558", "text": "enterFunctionTypeParameters(ctx) {\n\t}", "title": "" }, { "docid": "049e44a07982d36bc73f06c3a53788dd", "score": "0.47918352", "text": "get context() {\n return this.getContext();\n }", "title": "" }, { "docid": "e7d7a6ccc95c6b5b4da54e6351c06d1d", "score": "0.47904202", "text": "function apartContext(context, script, callback) {\n var vm = require('vm');\n\n if (vm) {\n var ctx = vm.createContext({ ctx: context });\n callback(vm.runInContext(script, ctx));\n } else if (document && document.createElement) {\n var iframe = document.createElement('iframe');\n iframe.style.display = 'none';\n document.body.appendChild(iframe);\n\n var myCtxId = 'tmpCtx' + Math.random();\n\n window[myCtxId] = context;\n iframe.src = 'test-apart-ctx.html?' + myCtxId + '&' + encodeURIComponent(script);\n iframe.onload = function() {\n try {\n callback(iframe.contentWindow.results);\n } catch (e) {\n throw e;\n }\n };\n } else {\n console.log('WARNING: cannot create an apart context.');\n }\n}", "title": "" }, { "docid": "e7d7a6ccc95c6b5b4da54e6351c06d1d", "score": "0.47904202", "text": "function apartContext(context, script, callback) {\n var vm = require('vm');\n\n if (vm) {\n var ctx = vm.createContext({ ctx: context });\n callback(vm.runInContext(script, ctx));\n } else if (document && document.createElement) {\n var iframe = document.createElement('iframe');\n iframe.style.display = 'none';\n document.body.appendChild(iframe);\n\n var myCtxId = 'tmpCtx' + Math.random();\n\n window[myCtxId] = context;\n iframe.src = 'test-apart-ctx.html?' + myCtxId + '&' + encodeURIComponent(script);\n iframe.onload = function() {\n try {\n callback(iframe.contentWindow.results);\n } catch (e) {\n throw e;\n }\n };\n } else {\n console.log('WARNING: cannot create an apart context.');\n }\n}", "title": "" }, { "docid": "1549ffc0c17f9ce85fd7735268348a5b", "score": "0.47888264", "text": "function askApiInCloudFunction() {\n //This api provide random text as json only for test purpose\n request('https://jsonplaceholder.typicode.com/posts', function(error, response, body) {\n //Log are available in Firebase Cloud Function page for this app\n console.log('error: ', error);\n console.log('statusCode: ', response && response.statusCode);\n console.log('body: ', body);\n });\n}", "title": "" }, { "docid": "b257eae894dcc33593dd1e2c75394ba3", "score": "0.47865048", "text": "function getContext() {\n\n if (GLOBAL_CONTEXT === null) {\n\n if (typeof GetGlobalContext !== \"undefined\") {\n\n /*ignore jslint start*/\n GLOBAL_CONTEXT = GetGlobalContext();\n /*ignore jslint end*/\n }\n else {\n\n if (typeof Xrm !== \"undefined\") {\n GLOBAL_CONTEXT = Xrm.Page.context;\n }\n else {\n throw new Error(\"Context is not available.\");\n }\n }\n }\n\n return GLOBAL_CONTEXT;\n }", "title": "" }, { "docid": "074d34a357e4fad418056229dc2d6482", "score": "0.47725925", "text": "executionCreateContext(request) {\n return this.sendRequest(\"execution.createContext\", request);\n }", "title": "" }, { "docid": "83e50d3490299eb25faa5d5455ce3f31", "score": "0.47714192", "text": "get context() {\n if (!this._context) {\n if (Katrid.isString(this.config.context))\n this._context = JSON.parse(this.config.context);\n else if (this.config.context)\n this._context = this.config.context;\n else\n this._context = {};\n // get query string context\n // load default values on query string\n let searchParams = window.location.href.split('#', 2)[1];\n if (searchParams) {\n const urlParams = new URLSearchParams(searchParams);\n for (let [k, v] of urlParams)\n if (k.startsWith('default_'))\n this._context[k] = v;\n else if (k === 'filter')\n this._context[k] = v;\n }\n }\n return this._context;\n }", "title": "" }, { "docid": "945c4427611d0876f4a230d189e698e7", "score": "0.47712284", "text": "run() {\n this.prepareContext();\n const context = vm.createContext(this.context);\n vm.runInContext(this.script, context);\n return context.module.exports;\n }", "title": "" }, { "docid": "508caff6352d7f6d574af7e5503afcdb", "score": "0.4765163", "text": "enterFunctionType(ctx) {\n\t}", "title": "" }, { "docid": "7603f3038c1e217bfda7acd26ab9465d", "score": "0.47590178", "text": "initialize(config) {\n this.context = config.context\n }", "title": "" }, { "docid": "13a2bc176d623a5ed4846d9cccabc146", "score": "0.47566932", "text": "function runSample(demoCallback) {\n var resourceClient;\n var kvManagementClient;\n \n msRestAzure.loginWithServicePrincipalSecret(clientId, secret, tenantId)\n .then( (credentials) => {\n resourceClient = new ResourceManagementClient(credentials, subscriptionId);\n kvManagementClient = new KeyVaultManagementClient(credentials, subscriptionId);\n \n // Create sample resource group. \n console.log(\"Creating resource group: \" + groupName);\n return resourceClient.resourceGroups.createOrUpdate(groupName, { location: azureLocation });\n }).then( () => {\n const kvParams = {\n location: azureLocation,\n properties: {\n sku: { \n name: 'standard'\n },\n accessPolicies: [\n {\n tenantId: tenantId,\n objectId: objectId,\n permissions: {\n secrets: ['all'],\n }\n }\n ],\n enabledForDeployment: false,\n tenantId: tenantId\n },\n tags: {}\n };\n \n console.log(\"Creating key vault: \" + kvName);\n \n // Create the sample key vault using the KV management client.\n return kvManagementClient.vaults.createOrUpdate(groupName, kvName, kvParams);\n }).then( (result) => {\n console.log(\"Vault created with URI '\" + result.properties.vaultUri + \"'\");\n demoCallback(result.properties.vaultUri);\n })\n .catch( (err) => { \n console.log(err); \n });\n}", "title": "" }, { "docid": "09dc1338a9dd2f820ecad02b5c65e94d", "score": "0.4750309", "text": "function getRfc232TestContext() {\n // Support older versions of `ember-qunit` that don't have\n // `@ember/test-helpers` (and therefore cannot possibly be running an\n // rfc232/rfc268 test).\n if (_require2.default.has('@ember/test-helpers')) {\n let { getContext } = (0, _require2.default)('@ember/test-helpers');\n return getContext();\n }\n }", "title": "" }, { "docid": "fc498a8c34d27a83021202b35b578ab3", "score": "0.4736782", "text": "visitFuncdef(ctx) {\r\n console.log(\"visitFuncdef\");\r\n return {\r\n type: \"FunctionDef\",\r\n name: ctx.NAME().getText(),\r\n parameters: this.visit(ctx.parameters()),\r\n body: this.visit(ctx.suite()),\r\n };\r\n }", "title": "" }, { "docid": "6b92f5bb0242b13d664a57475a04d74c", "score": "0.47343782", "text": "function useStoryContext() {\n var _getHooksContextOrThr = getHooksContextOrThrow(),\n currentContext = _getHooksContextOrThr.currentContext;\n\n if (currentContext == null) {\n throw invalidHooksError();\n }\n\n return currentContext;\n}", "title": "" }, { "docid": "6b92f5bb0242b13d664a57475a04d74c", "score": "0.47343782", "text": "function useStoryContext() {\n var _getHooksContextOrThr = getHooksContextOrThrow(),\n currentContext = _getHooksContextOrThr.currentContext;\n\n if (currentContext == null) {\n throw invalidHooksError();\n }\n\n return currentContext;\n}", "title": "" }, { "docid": "6b92f5bb0242b13d664a57475a04d74c", "score": "0.47343782", "text": "function useStoryContext() {\n var _getHooksContextOrThr = getHooksContextOrThrow(),\n currentContext = _getHooksContextOrThr.currentContext;\n\n if (currentContext == null) {\n throw invalidHooksError();\n }\n\n return currentContext;\n}", "title": "" }, { "docid": "6b92f5bb0242b13d664a57475a04d74c", "score": "0.47343782", "text": "function useStoryContext() {\n var _getHooksContextOrThr = getHooksContextOrThrow(),\n currentContext = _getHooksContextOrThr.currentContext;\n\n if (currentContext == null) {\n throw invalidHooksError();\n }\n\n return currentContext;\n}", "title": "" }, { "docid": "6b92f5bb0242b13d664a57475a04d74c", "score": "0.47343782", "text": "function useStoryContext() {\n var _getHooksContextOrThr = getHooksContextOrThrow(),\n currentContext = _getHooksContextOrThr.currentContext;\n\n if (currentContext == null) {\n throw invalidHooksError();\n }\n\n return currentContext;\n}", "title": "" }, { "docid": "6b92f5bb0242b13d664a57475a04d74c", "score": "0.47343782", "text": "function useStoryContext() {\n var _getHooksContextOrThr = getHooksContextOrThrow(),\n currentContext = _getHooksContextOrThr.currentContext;\n\n if (currentContext == null) {\n throw invalidHooksError();\n }\n\n return currentContext;\n}", "title": "" }, { "docid": "66b76bd9febe79390a26208991c071c5", "score": "0.47035673", "text": "function getContext() {\n if (globalContext === dummyContext && _AudioContext.hasAudioContext) {\n setContext(new _Context.Context());\n }\n\n return globalContext;\n}", "title": "" }, { "docid": "41d6e1eff6a8839083977d7c963a74c7", "score": "0.46875533", "text": "function initFunctionData() {\n ctrl.functionData = {\n metadata: {\n name: '',\n namespace: '',\n labels: {},\n annotations: {}\n },\n spec: {\n description: '',\n disable: false,\n triggers: {},\n env: [],\n loggerSinks: [{\n level: 'debug',\n sink: ''\n }],\n handler: FunctionsService.getHandler(ctrl.selectedRuntime.id),\n runtime: ctrl.selectedRuntime.id,\n build: {\n functionSourceCode: ctrl.selectedRuntime.sourceCode\n },\n targetCPU: 75,\n minReplicas: 1,\n maxReplicas: 1\n }\n };\n\n if (ConfigService.isDemoMode()) {\n ctrl.functionData.spec.timeoutSeconds = 0;\n }\n }", "title": "" }, { "docid": "35f8975bceced29042a4b4cd15b51be5", "score": "0.4681789", "text": "function test_my_tasks_api() {}", "title": "" }, { "docid": "052c7b8da2f36540512bb2a48c054905", "score": "0.46670857", "text": "createContext() {\n return new BukuTanahContext();\n }", "title": "" }, { "docid": "889d813cb3c479f8130db4152a4ac421", "score": "0.46565774", "text": "function inContext(fn){\n /** there is a known issue with CLS that it does not work with MongoDB, \n * needs to bind the callback with the CLS context \n * https://github.com/othiym23/node-continuation-local-storage/issues/6\n * */\n if(domain.active) return domain.active.bind(fn);\n return fn;\n}", "title": "" }, { "docid": "5a9361948dd0da4400e4863ef4778a86", "score": "0.4652169", "text": "function getDSContext()\n{\n return ContextUtil.obtainContext(getObjectModel());\n}", "title": "" }, { "docid": "4341ded3b25dc9a8a916ee4dec091296", "score": "0.46497697", "text": "static create() {\n return createContextId();\n }", "title": "" }, { "docid": "b3463575f48a76f6c0fc95c09778a6e9", "score": "0.46471193", "text": "static function(payload) {\n return new Credentials(\"custom-function\", \"custom-function\", payload);\n }", "title": "" }, { "docid": "1802cb3133daff2a9f0f3b8d0d719436", "score": "0.46446827", "text": "function test_suspend_vm_service_details(context) {}", "title": "" }, { "docid": "d6a0a820842a53e1f8d9bce46459501b", "score": "0.46216178", "text": "function myAnalysis(context, scope) {\n // This will log \"Hello World\" at the TagoIO Analysis console\n context.log(\"Hello World\");\n\n // This will log the context to the TagoIO Analysis console\n context.log(\"Context:\", context);\n\n // This will log the scope to the TagoIO Analysis console\n context.log(\"my scope:\", scope);\n\n // Create connection to database\n const config = {\n authentication: {\n options: {\n userName: \"sqlsmartuser00\", // update me\n password: \"Matt00n!23\" // update me\n },\n type: \"default\"\n },\n server: \"sql-smart-products-01.database.windows.net\", // update me\n options: {\n database: \"sqldb-smart-products-01\", //update me\n encrypt: true\n }\n };\n\n const connection = new Connection(config);\n\n // Attempt to connect and execute queries if connection goes through\n connection.on(\"connect\", err => {\n if (err) {\n console.error(err.message);\n } else {\n queryDatabase(connection, context);\n }\n });\n}", "title": "" }, { "docid": "10c4f047e37c7c6a609680c76b96ab55", "score": "0.46119198", "text": "function createEnvironment(the_config) {\n\tvar environment = {\n\t\tjds: new JdsClientDummy(log, the_config),\n\t\tmetrics: log\n\t};\n\n\tspyOn(environment.jds, 'getJobStatus').andCallThrough();\n\n\treturn environment;\n}", "title": "" }, { "docid": "8b00a3ad4607932156134148a83ff222", "score": "0.46117508", "text": "function not_global_window(){\n return {\n name:'ngw function context',\n identity:function(){\n console.log(`I am not the global window I am ${this.name}`);\n }\n} \n}", "title": "" }, { "docid": "5361c742a7e614a98db7458903f891ae", "score": "0.46093774", "text": "createContext() {\r\n const self = this\r\n\r\n const hemera = Object.create(self)\r\n\r\n return hemera\r\n }", "title": "" }, { "docid": "4e2dbbf150400851d7a55f5157f85717", "score": "0.45785835", "text": "function testContexts() {\n var contexts = [];\n B.addTestContext = function (context) { contexts.push(context); };\n B.testContext.on(\"create\", B.addTestContext);\n return contexts;\n }", "title": "" }, { "docid": "cdcd057cc694b0deb76fedfb516c63e1", "score": "0.4569934", "text": "function getSiteContext(filepath){\n\tgrunt.log.debug(filepath);\n\ttry {\n\t\tsiteContext = grunt.file.readJSON(filepath);\n\t} catch(error){\n\t\treturn {};\n\t}\n}", "title": "" }, { "docid": "9ea2c87e980254708e7bdd751ada8f78", "score": "0.4569281", "text": "initialize(config) {\n this.context = config.context;\n }", "title": "" }, { "docid": "9ea2c87e980254708e7bdd751ada8f78", "score": "0.4569281", "text": "initialize(config) {\n this.context = config.context;\n }", "title": "" }, { "docid": "9ea2c87e980254708e7bdd751ada8f78", "score": "0.4569281", "text": "initialize(config) {\n this.context = config.context;\n }", "title": "" }, { "docid": "dcc8e2894be0de964eed5b932f48c417", "score": "0.45681006", "text": "function getFunc() {\r\n let value = \"test\";\r\n \r\n let func = new Function('console.log(value)');\r\n \r\n return func;\r\n }", "title": "" }, { "docid": "a95400c2df8cd86cd3510e9fb3354d6d", "score": "0.4567865", "text": "function routeMiddlewareFunc(/* your config */) {\n return (next) => {\n return (context) => {\n return next(context)\n }\n }\n}", "title": "" }, { "docid": "3635e41c5cea2584037493a94098fd4d", "score": "0.45509273", "text": "async function eventSubscriptionsGetForCustomTopicAzureFunctionDestination() {\n const subscriptionId =\n process.env[\"EVENTGRID_SUBSCRIPTION_ID\"] || \"00000000-0000-0000-0000-000000000000\";\n const scope =\n \"subscriptions/8f6b6269-84f2-4d09-9e31-1127efcd1e40/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2\";\n const eventSubscriptionName = \"examplesubscription1\";\n const credential = new DefaultAzureCredential();\n const client = new EventGridManagementClient(credential, subscriptionId);\n const result = await client.eventSubscriptions.get(scope, eventSubscriptionName);\n console.log(result);\n}", "title": "" }, { "docid": "d849d6a09655254c616caf597b96cdaa", "score": "0.45467585", "text": "function mockFunctions() {\n const original = require.requireActual('../actions');\n return {\n ...original, //Pass down all the exported objects\n fetchTodosForUserRequest: mockedThunk\n }\n }", "title": "" }, { "docid": "f4984f4ed1cfd5a2821a466755090b15", "score": "0.45404676", "text": "createContext() {\n\t\treturn new DistributorContext();\n\t}", "title": "" }, { "docid": "33899cdef232577db8e8f0d9b5b81124", "score": "0.45328438", "text": "async function createContext({ req, connection }) {\n // create context for Subscription\n if (connection) {\n return { models };\n }\n // create context for general graphql query & mutation\n if (req) {\n const user = await getUserByToken(req.headers);\n return {\n models,\n user,\n secret: process.env.APP_SECRET,\n loaders: allDataLoader(models)\n };\n }\n}", "title": "" }, { "docid": "26ab6cdc3d7bf6763f983a339e5a4a05", "score": "0.45289367", "text": "async function ListFunctions() {\n let functionService = new fx.FunctionService(process.env.MICRO_API_TOKEN);\n let rsp = await functionService.list({});\n console.log(rsp);\n}", "title": "" }, { "docid": "b8771555469cecbe50d3855febb4effb", "score": "0.45205173", "text": "createContext() {\n return new ProjectContext();\n }", "title": "" }, { "docid": "5430312d1bc9d1e69c9226ec5407f7f8", "score": "0.4509602", "text": "addContext(context) {\n this._context = () => context;\n }", "title": "" }, { "docid": "31da522755e798c5b5c7a811cf66d1f7", "score": "0.45090592", "text": "testFunction() {\n describe(this.functionToTest.name, () => {\n this.testTypeParams();\n this.testSuite();\n });\n }", "title": "" }, { "docid": "57cef593dd706db4889fdd25bedc8646", "score": "0.45089772", "text": "constructor(context: TONModuleContext) {\n this.context = context;\n }", "title": "" }, { "docid": "a01a69155212b83b0cabe0261ba862fc", "score": "0.45010948", "text": "getOptions(options, context) {\n return options;\n }", "title": "" }, { "docid": "4ff462504c734c9b78c6b85a2ff7bf4f", "score": "0.4494203", "text": "function executeUserFunctionV1(req) {\n var inputHandler = new FunctionInputHandler(req);\n try {\n 'use strict';\n var func = new Function('workflowContext', inputHandler.functionDefinition);\n var script = new vm.Script(\"(\" + func.toString() + \")(workflowContext);\");\n return script.runInNewContext(getSandboxContext(inputHandler), { timeout: inputHandler.executionTimeout });\n }\n catch (err) {\n if (err instanceof CustomError) {\n throw err;\n }\n\n // NOTE (hongzli): Error code isn't being set for timeouts, we need to rely on message\n if (err.message === \"Script execution timed out.\") {\n throw new CustomError(ErrorCode.ExecutionTimeout, err.message, err.stack);\n }\n\n throw new CustomError(ErrorCode.ScriptRuntimeFailure, err.message, err.stack);\n }\n }", "title": "" } ]
f088dc715ccf9c5e3ac659f5ac640c02
Get Current Env path
[ { "docid": "bea9cc0454bec443ebd15cf5fd3f0c96", "score": "0.7695075", "text": "getCurrentEnvPath() {\r\n let TestDataPath = \"\\\\Resources\\\\\" + env + \"_TestData\";\r\n let absolutePath = __basedir + TestDataPath;\r\n return absolutePath;\r\n }", "title": "" } ]
[ { "docid": "c1eb50e32bfb25b66ffbe913891027fc", "score": "0.73544514", "text": "function basePathEnv(){\n let pathObj = path.dev_scripts;\n pkg.env = '_dev';\n if ( env == 'release' ) {\n pathObj = path.scripts;\n pkg.env = '';\n }\n return pathObj;\n}", "title": "" }, { "docid": "5cd1c4d64c18b581d2a018231fb2f238", "score": "0.7168878", "text": "getCurrentEnvironment() {\r\n logger.Log().debug('____________' + env);\r\n return env\r\n }", "title": "" }, { "docid": "4710d5ce383af14c3f150523897d1519", "score": "0.66376466", "text": "function currentEnv() {\n return $('body').data('env');\n}", "title": "" }, { "docid": "3a61633d6d6130ec735eef10d5f1e018", "score": "0.66258603", "text": "getEnv() {\r\n const env = Object.assign({}, this._userEnv);\r\n if (!env.RUST_SRC_PATH) {\r\n const rustSourcePath = this._rustSource.getPath();\r\n if (rustSourcePath) {\r\n env.RUST_SRC_PATH = rustSourcePath;\r\n }\r\n }\r\n return env;\r\n }", "title": "" }, { "docid": "40f2d438a99e0cfd28c46bfa17db07a9", "score": "0.6601667", "text": "_getHomeDir(){\r\n\t\tlet isOldWindows = process.platform === 'win32';\r\n\t\treturn process.env[isOldWindows ? 'USERPROFILE' : 'HOME'];\r\n\t}", "title": "" }, { "docid": "87c1126ae60b751ff3cf9b72c92e69dc", "score": "0.65571666", "text": "function getNowPath() {\n if (process.platform === 'win32') {\n const { LOCALAPPDATA, USERPROFILE, HOMEPATH } = process.env;\n const home = homedir() || USERPROFILE || HOMEPATH;\n let path;\n if (LOCALAPPDATA) {\n path = join(LOCALAPPDATA, 'now-cli', 'now.exe');\n } else if (home) {\n path = join(home, 'AppData', 'Local', 'now-cli', 'now.exe');\n } else {\n path = '';\n }\n return fs.existsSync(path) ? path : null;\n }\n\n const pathEnv = (process.env.PATH || '').split(delimiter);\n\n const paths = [\n join(process.env.HOME || '/', 'bin'),\n '/usr/local/bin',\n '/usr/bin',\n ];\n\n for (const basePath of paths) {\n if (!pathEnv.includes(basePath)) {\n continue;\n }\n\n const nowPath = join(basePath, 'now');\n\n if (fs.existsSync(nowPath)) {\n return nowPath;\n }\n }\n\n return null;\n}", "title": "" }, { "docid": "57118f0872e27b9d5f4ccb7eda727c30", "score": "0.64591455", "text": "function getConfigPath(cwd) {\n return path__default[\"default\"].join(cwd, 'keystone');\n}", "title": "" }, { "docid": "64b08510e9aaa6104a99c38642bb7311", "score": "0.6447311", "text": "cwd () {\n return process.cwd();\n }", "title": "" }, { "docid": "51dbef1ce6083b908abf8eca1363c0aa", "score": "0.63965", "text": "function currentDir() {\n var s = WScript.scriptFullName\n s = s.substring(0, s.lastIndexOf(\"\\\\\") + 1)\n return s\n}", "title": "" }, { "docid": "d7d4c416f909659e9c3b6e39f584ac7c", "score": "0.63848346", "text": "function getCurrentPathName() {\n pathName = window.location.pathname;\n return pathName;\n }", "title": "" }, { "docid": "f9aaa72a0163ebbbe0d72ed6833b211b", "score": "0.63754237", "text": "function getPath() {\n\t\tvar basePath = '';\n\t\tvar httpProto = window.location.protocol;\n\t\tvar domains = determineHost();\n\t\tbasePath = httpProto + '//' + domains.secure + domains.environment + domains.topLevel;\n\t\treturn basePath;\n\t}", "title": "" }, { "docid": "10ef0b2bdd148d644ba6673beffb2a20", "score": "0.63752496", "text": "function getConfigPath(cwd) {\n return path__default.join(cwd, 'keystone');\n}", "title": "" }, { "docid": "8f3586652cb911636a4614c9feb8a9c2", "score": "0.63220644", "text": "function getBasePath() {\n var basePath = ''\n\n if (isProd && process.env.BASE_PATH){\n if (process.env.BASE_PATH.startsWith(\"/\") ){\n basePath = process.env.BASE_PATH;\n } else {\n basePath = \"/\" + process.env.BASE_PATH;\n }\n } \n\n console.log(\"getBasePath() : isProd = \" + isProd);\n console.log(\"getBasePath() : basePath = \" + basePath);\n\n return basePath\n}", "title": "" }, { "docid": "af22bb4a01544220879e714ee9613ddb", "score": "0.6318108", "text": "getAppPath()\n {\n return path.join(this.getRootPath(), 'app');\n }", "title": "" }, { "docid": "6f6d1bf0d816a0b68149fa34da6af0b3", "score": "0.6296", "text": "function getHomeFolder() {\n\treturn process.env[\n\t\tprocess.platform == 'win32' ?\n\t\t'USERPROFILE' :\n\t\t'HOME']\n}", "title": "" }, { "docid": "e292b88b645d2f37369b53c0b47ebf35", "score": "0.6264518", "text": "getRootPath()\n {\n return process.cwd();\n }", "title": "" }, { "docid": "5bf70f125487e79e05180952c32a65cd", "score": "0.6252369", "text": "gopath (options = {}) {\n let e = this.rawEnvironment(options)\n if (isFalsy(e.GOPATH) || e.GOPATH.trim() === '') {\n return false\n }\n\n return pathhelper.expand(e, e.GOPATH)\n }", "title": "" }, { "docid": "35ddc32b2b7544928d30343a5eacac6c", "score": "0.6251103", "text": "function getActiveDirectory() {\n var dir = path.dirname(getActiveFile());\n\n if(!dir || dir === '.') {\n dir = '~';\n }\n return dir + path.sep;\n }", "title": "" }, { "docid": "c70c57436aff04d39159d054970fbe38", "score": "0.623693", "text": "getElixirPath() {\n return this.quotePath(this.getElixirExecutableSetting());\n }", "title": "" }, { "docid": "dfc610cc999b7f34c18bb68f96ba133f", "score": "0.6224277", "text": "function getUserHomeDirPath() {\n var homedir = process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME'];\n if (homedir)\n return homedir;\n return \".\";\n}", "title": "" }, { "docid": "e9407d9af4ddf016276895abc63dde48", "score": "0.6208191", "text": "getEnv () {\n\t\treturn this.env;\n\t}", "title": "" }, { "docid": "2fd9dc1f25be6f47bdcb9be3c5749904", "score": "0.61999494", "text": "function getGoEnv(cwd) {\n return __awaiter(this, void 0, void 0, function* () {\n const goRuntime = getBinPath('go');\n const execFile = util.promisify(cp.execFile);\n const opts = { cwd, env: goEnv_1.toolExecutionEnvironment() };\n const { stdout, stderr } = yield execFile(goRuntime, ['env'], opts);\n if (stderr) {\n throw new Error(`failed to run 'go env': ${stderr}`);\n }\n return stdout;\n });\n}", "title": "" }, { "docid": "2c671f5293a35b858f66ee7a1a5b3950", "score": "0.6065905", "text": "function getUserHome() {\n\treturn process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME'];\n}", "title": "" }, { "docid": "660fdf34e6cbae63c0e82def7a58655e", "score": "0.605873", "text": "function scriptPath() {\n try {\n return app.activeScript;\n }\n catch (e) {\n return File(e.fileName);\n }\n}", "title": "" }, { "docid": "21d006f7999d470b95dfdab2a400c408", "score": "0.6045821", "text": "static _getSpaceRoot(){\n return process.cwd(); //path.dirname(module.parent.paths[0])\n }", "title": "" }, { "docid": "fe6e335d26eea26c2d07b9f9cf653e0d", "score": "0.6031618", "text": "function ___R$$priv$project$rome$$internal$core$common$constants_ts$getUserConfigDirectory() {\n\t\tconst XDG_CONFIG_HOME = ___R$$priv$project$rome$$internal$core$common$constants_ts$getEnvironmentDirectory(\n\t\t\t\"XDG_CONFIG_HOME\",\n\t\t\t\"rome\",\n\t\t);\n\t\tif (XDG_CONFIG_HOME !== undefined) {\n\t\t\treturn XDG_CONFIG_HOME;\n\t\t}\n\n\t\tif (process.platform === \"win32\") {\n\t\t\treturn ___R$$priv$project$rome$$internal$core$common$constants_ts$getLocalAppDataDir().append(\n\t\t\t\t\"Config\",\n\t\t\t);\n\t\t}\n\n\t\tif (process.platform === \"darwin\") {\n\t\t\treturn ___R$project$rome$$internal$path$constants_ts$HOME_PATH.append(\n\t\t\t\t\"Library\",\n\t\t\t\t\"Preferences\",\n\t\t\t\t\"Rome\",\n\t\t\t);\n\t\t}\n\n\t\treturn ___R$project$rome$$internal$path$constants_ts$HOME_PATH.append(\n\t\t\t\".config\",\n\t\t\t\"rome\",\n\t\t);\n\t}", "title": "" }, { "docid": "56324eb8125c5cff237d0df5c8bccab6", "score": "0.6031245", "text": "function getUserHome() {\n return process.env.HOME || process.env.USERPROFILE;\n}", "title": "" }, { "docid": "8768a3f5ce36e949f102c19b95e61013", "score": "0.6001978", "text": "function getUserHome() {\n return process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'];\n}", "title": "" }, { "docid": "8768a3f5ce36e949f102c19b95e61013", "score": "0.6001978", "text": "function getUserHome() {\n return process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'];\n}", "title": "" }, { "docid": "92caad2bfe8b053d9ca2bac39d383596", "score": "0.59987617", "text": "function envData() {\n\tvar envData;\n\ttry {\n\t\tenvData = require('../YumBarrio_local/env.json') \n\t}catch (e) {\n\t\tenvData = process.env }\n\treturn envData;\n}", "title": "" }, { "docid": "5b5c13b0abe6e52aa854576e6f3ea597", "score": "0.59955955", "text": "async _getToolPath () {\r\n const localPath = this.getLocalPath()\r\n if (localPath) {\r\n let local = false\r\n try {\r\n await fs.promises.access(localPath, fs.constants.X_OK)\r\n local = true\r\n } catch (e) { }\r\n if (local) {\r\n return localPath\r\n }\r\n }\r\n\r\n const global = await new ProcessSpawner('op').checkCommandExists()\r\n\r\n if (global) {\r\n return 'op'\r\n }\r\n\r\n return null\r\n }", "title": "" }, { "docid": "3daf05ef176e9524c46972616a2d772f", "score": "0.59821486", "text": "cwd () {\n return cwd;\n }", "title": "" }, { "docid": "98d44bad55f2b0e6cd8b471a13f9cf5c", "score": "0.597996", "text": "getCWD() {\n let cwd = this.state.cursor().get( 'cwd' )\n\n return cwd || null\n }", "title": "" }, { "docid": "60577295eac40aa061058b7716f863d9", "score": "0.5956669", "text": "function getEnv (name) {\n return String(java.lang.System.getProperty(name));\n}", "title": "" }, { "docid": "001d9c3e7d191ff6a722c116f70d8399", "score": "0.59320706", "text": "function getGlobalDir() {\n if (!globalDir) {\n this.initGlobalDir();\n }\n !globalDir ? 'development' !== 'production' ? invariant(false, 'Global direction not set.') : invariant(false) : void 0;\n return globalDir;\n}", "title": "" }, { "docid": "8dcf22f19cee6d65e85deb6402576332", "score": "0.5924578", "text": "function getDir() {\n if (process.pkg) {\n return path.resolve(process.execPath + \"/..\");\n } else {\n return path.join(require.main ? require.main.path : process.cwd());\n }\n}", "title": "" }, { "docid": "6342f7168f17ce0ae61d443ec78609bb", "score": "0.59100467", "text": "static getHomeDirectory() {\n const unresolvedUserFolder = process.env[(process.platform === 'win32') ? 'USERPROFILE' : 'HOME'];\n const homeFolder = path.resolve(unresolvedUserFolder);\n if (!fsx.existsSync(homeFolder)) {\n throw new Error('Unable to determine the current user\\'s home directory');\n }\n return homeFolder;\n }", "title": "" }, { "docid": "c8b889ae085292e566862ec15ebd38a4", "score": "0.5909376", "text": "function getAppEnv(){\n //If not initialized then do that.\n if (!appEnv){\n init();\n }\n console.log(\"application environment variable\");\n console.log(appEnv);\n return appEnv;\n}", "title": "" }, { "docid": "a23e374049aabba470c3202613db08fc", "score": "0.58789444", "text": "function getBuildPath() {\r\n return config.build.path;\r\n}", "title": "" }, { "docid": "14fe217928565051791d060eb2661781", "score": "0.58763975", "text": "function getWindowPath() {\n return Path.decode(\n window.location.pathname + window.location.search\n );\n}", "title": "" }, { "docid": "d133d7efd60df133602cac8b96c51225", "score": "0.58686894", "text": "function getGlobalDir() {\n if (!globalDir) {\n this.initGlobalDir();\n }\n !globalDir ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Global direction not set.') : invariant(false) : void 0;\n return globalDir;\n}", "title": "" }, { "docid": "d133d7efd60df133602cac8b96c51225", "score": "0.58686894", "text": "function getGlobalDir() {\n if (!globalDir) {\n this.initGlobalDir();\n }\n !globalDir ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Global direction not set.') : invariant(false) : void 0;\n return globalDir;\n}", "title": "" }, { "docid": "d133d7efd60df133602cac8b96c51225", "score": "0.58686894", "text": "function getGlobalDir() {\n if (!globalDir) {\n this.initGlobalDir();\n }\n !globalDir ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Global direction not set.') : invariant(false) : void 0;\n return globalDir;\n}", "title": "" }, { "docid": "d133d7efd60df133602cac8b96c51225", "score": "0.58686894", "text": "function getGlobalDir() {\n if (!globalDir) {\n this.initGlobalDir();\n }\n !globalDir ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Global direction not set.') : invariant(false) : void 0;\n return globalDir;\n}", "title": "" }, { "docid": "d133d7efd60df133602cac8b96c51225", "score": "0.58686894", "text": "function getGlobalDir() {\n if (!globalDir) {\n this.initGlobalDir();\n }\n !globalDir ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Global direction not set.') : invariant(false) : void 0;\n return globalDir;\n}", "title": "" }, { "docid": "d133d7efd60df133602cac8b96c51225", "score": "0.58686894", "text": "function getGlobalDir() {\n if (!globalDir) {\n this.initGlobalDir();\n }\n !globalDir ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Global direction not set.') : invariant(false) : void 0;\n return globalDir;\n}", "title": "" }, { "docid": "d133d7efd60df133602cac8b96c51225", "score": "0.58686894", "text": "function getGlobalDir() {\n if (!globalDir) {\n this.initGlobalDir();\n }\n !globalDir ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Global direction not set.') : invariant(false) : void 0;\n return globalDir;\n}", "title": "" }, { "docid": "a93dbf68d96616acb52acd7db60702d4", "score": "0.58535", "text": "function getcwd() {\n // debug('getcwd');\n var buf = new buffer_1.Buffer(264);\n var res = syscall(x86_64_linux_1.SYS.getcwd, buf, buf.length);\n if (res < 0) {\n if (res === -34 /* ERANGE */) {\n // > ERANGE error - The size argument is less than the length of the absolute\n // > pathname of the working directory, including the terminating\n // > null byte. You need to allocate a bigger array and try again.\n buf = new buffer_1.Buffer(4096);\n res = syscall(x86_64_linux_1.SYS.getcwd, buf, buf.length);\n if (res < 0)\n throw res;\n }\n else\n throw res;\n }\n // -1 to remove `\\0` terminating the string.\n return buf.slice(0, res - 1).toString();\n}", "title": "" }, { "docid": "fc808856419551f938e10518159db1a2", "score": "0.5851469", "text": "function getWorkspaceDir() {\n return shelljs_shell.env.GITHUB_WORKSPACE || '';\n}", "title": "" }, { "docid": "a26a7737d2bfd08e4365557b40b59b8e", "score": "0.58445555", "text": "getExecutablePath() {\r\n if (this._executableUserPath) {\r\n return this._executableUserPath;\r\n }\r\n if (this._rustup && this._rustup.isRlsInstalled()) {\r\n return 'rustup';\r\n }\r\n return undefined;\r\n }", "title": "" }, { "docid": "15abb787bcba3a8373ad19031052ea86", "score": "0.584363", "text": "async _getToolPath () {\r\n const localPath = this.getLocalPath()\r\n if (localPath) {\r\n let local = false\r\n try {\r\n await fs.promises.access(localPath, fs.constants.X_OK)\r\n local = true\r\n } catch (e) { }\r\n if (local) {\r\n return localPath\r\n }\r\n }\r\n\r\n const global = await new ProcessSpawner('bw').checkCommandExists()\r\n\r\n if (global) {\r\n return 'bw'\r\n }\r\n\r\n return null\r\n }", "title": "" }, { "docid": "78024f7dfb9c4fa5b94b12828e7543dc", "score": "0.58326894", "text": "get settingsPath() {\n const environment = this.services.get(environment_1.IEnvironmentService);\n return path.join(environment.userDataPath, \"coder.json\");\n }", "title": "" }, { "docid": "d91c4cf7d8cf2ba1fe648f280e701a66", "score": "0.5803107", "text": "function home(fp) {\n var res = (process.platform === 'win32')\n ? process.env.USERPROFILE\n : process.env.HOME;\n return path.join(res, fp);\n}", "title": "" }, { "docid": "d1a1cb7bb87f684a48c42c1ae776b6d6", "score": "0.5790889", "text": "function getenv(key) {\n return process.env[key];\n }", "title": "" }, { "docid": "c509d8965de9393e4a92ab4aa023bc15", "score": "0.5779605", "text": "function env() {\n var e;\n try {\n e = fs.readFileSync('.env', { encoding: 'utf-8' }).split('\\n');\n } catch (b) {\n return;\n }\n for (var i = 0; i < e.length; i++) {\n process.env[e[i].split('=')[0].trim()] = e[i].split('=')[1].trim();\n }\n}", "title": "" }, { "docid": "9edf701bfe56a65cac5a7a3002a13c1c", "score": "0.5768724", "text": "function ___R$$priv$project$rome$$internal$core$common$constants_ts$getRuntimeDirectory() {\n\t\tconst XDG_RUNTIME_DIR = ___R$$priv$project$rome$$internal$core$common$constants_ts$getEnvironmentDirectory(\n\t\t\t\"XDG_RUNTIME_DIR\",\n\t\t\t\"rome\",\n\t\t);\n\t\tif (XDG_RUNTIME_DIR !== undefined) {\n\t\t\treturn XDG_RUNTIME_DIR;\n\t\t}\n\n\t\treturn ___R$project$rome$$internal$path$constants_ts$TEMP_PATH.append(\n\t\t\t\"rome\",\n\t\t);\n\t}", "title": "" }, { "docid": "bc44e3455bb26ea429d771e4de120955", "score": "0.5766946", "text": "function ___R$$priv$project$rome$$internal$core$common$constants_ts$getEnvironmentDirectory(\n\t\tkey,\n\t\tappend,\n\t) {\n\t\tconst env = process.env[key];\n\t\tif (env === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\tlet dir = ___R$project$rome$$internal$path$factories_ts$createAbsoluteFilePath(\n\t\t\tenv,\n\t\t);\n\t\tif (append !== undefined) {\n\t\t\tdir = dir.append(append);\n\t\t}\n\t\treturn dir;\n\t}", "title": "" }, { "docid": "27f47ee97c785593992039d4c39fab34", "score": "0.5749314", "text": "function getWorkspaceParentDir() {\n return external_path_.dirname(getWorkspaceDir());\n}", "title": "" }, { "docid": "b449009222764dea13f03f0583cc792f", "score": "0.57448053", "text": "function getContextPath() {\n\treturn window.location.pathname.substring(0, window.location.pathname.indexOf(\"/\", 2));\n}", "title": "" }, { "docid": "1ea2a4cbf9cf43aa5266a1c6847374ca", "score": "0.5736809", "text": "getMixPath() {\n return this.quotePath(\n path.join(path.dirname(this.getElixirExecutableSetting()), \"mix\")\n );\n }", "title": "" }, { "docid": "429aefb7925c3a323121efb3ad5f0a73", "score": "0.57163715", "text": "function caBundlePathFromEnvironment() {\n if (process.env.aws_ca_bundle) {\n return process.env.aws_ca_bundle;\n }\n if (process.env.AWS_CA_BUNDLE) {\n return process.env.AWS_CA_BUNDLE;\n }\n return undefined;\n}", "title": "" }, { "docid": "631fa94b179c40befe243a96f48824c2", "score": "0.56987184", "text": "function getThisPackageDir() {\n const packagePath = path.dirname(require.resolve(\"../package.json\"));\n return packagePath;\n}", "title": "" }, { "docid": "7ef42e58dbf1f61f708cf525cf6bcc02", "score": "0.5695025", "text": "function getContextPath() {\n\treturn window.location.pathname.substring(0, window.location.pathname.indexOf(\"/\",2));\n}", "title": "" }, { "docid": "698272c23305ba39859aaea6dd52f87b", "score": "0.5690266", "text": "static get credFilePath () {\n return path.join(__dirname, '..', '.credentials')\n }", "title": "" }, { "docid": "3eed4c438dc698865e629b3dc0390556", "score": "0.56783897", "text": "GetCurrentRelativePath() {\n return decodeURI(window.location.pathname.substr(1));\n }", "title": "" }, { "docid": "45aa454a35860d0d249bd6b8690b37a0", "score": "0.5674561", "text": "function getPath() {\n\t\tvar path = window.location.href;\n\t\treturn path.substring(0, path.lastIndexOf(\"/\")) + \"/\";\n\t}", "title": "" }, { "docid": "496e54f6b3b850f0b310412ae1ccc1ec", "score": "0.5628807", "text": "function getApplicationSupportDirectory() {\n if (process.platform === \"win32\") {\n return 'c:/TEMP';\n } else if (process.platform === \"darwin\") {\n return '/Users/username/TEMP'; //:temp replace with your home folder path\n } else if (process.platform === \"linux\") {\n return '$/users/username/TEMP';\n }\n return null;\n }", "title": "" }, { "docid": "1651a0b37e113914221883b2b08520f7", "score": "0.5618949", "text": "executablePath() {\r\n return this.pptr.executablePath();\r\n }", "title": "" }, { "docid": "8b2c52436beab733a03ede7f461e2e1f", "score": "0.5612694", "text": "function getEnginePath()\n{\n var enginePath = air.EncryptedLocalStore.getItem(\"enginePath\");\n return enginePath;\n}", "title": "" }, { "docid": "1ba2246008b7994dece04dc3be1b8f39", "score": "0.5611795", "text": "function getSstCliRootPath() {\n const filePath = __dirname;\n const packageName = \"resources\";\n const packagePath = filePath.slice(0, filePath.lastIndexOf(packageName) + packageName.length);\n return path.join(packagePath, \"../cli\");\n}", "title": "" }, { "docid": "042ebed26b3b1fef2e550af868c9749b", "score": "0.559463", "text": "getCurrentDirectory(fileName, insertedPath) {\r\n var currentDir = path.parse(fileName).dir || '/';\r\n var workspacePath = vs.workspace.rootPath;\r\n // based on the project root\r\n if (insertedPath.startsWith('/') && workspacePath) {\r\n currentDir = vs.workspace.rootPath;\r\n }\r\n return path.resolve(currentDir);\r\n }", "title": "" }, { "docid": "2742161d17552f1cc16e31a78d1fa572", "score": "0.5585733", "text": "function getCmdPath() {\n var _a;\n return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;\n}", "title": "" }, { "docid": "2742161d17552f1cc16e31a78d1fa572", "score": "0.5585733", "text": "function getCmdPath() {\n var _a;\n return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;\n}", "title": "" }, { "docid": "2742161d17552f1cc16e31a78d1fa572", "score": "0.5585733", "text": "function getCmdPath() {\n var _a;\n return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;\n}", "title": "" }, { "docid": "2742161d17552f1cc16e31a78d1fa572", "score": "0.5585733", "text": "function getCmdPath() {\n var _a;\n return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;\n}", "title": "" }, { "docid": "18419e1c2f38cc648e500724461ce5d9", "score": "0.5584678", "text": "getDataPath() {\n const validApp = process.type === 'renderer' ? remote.app : app\n let configFolder = path.join(validApp.getPath('appData'), configFolderName)\n if (getOS() === 'linux') {\n configFolder = path.join(validApp.getPath('home'), '.CloakCoin')\n }\n return configFolder\n }", "title": "" }, { "docid": "1db6b54f298a79c93d1c47c54830ceb0", "score": "0.5577244", "text": "function getCwd(log) {\n let cwd;\n try {\n cwd = process.cwd();\n } catch (ex) {\n log.trace(ex, 'error getting cwd: fallback back to %s', lastCwd);\n return lastCwd;\n }\n lastCwd = cwd;\n return cwd;\n}", "title": "" }, { "docid": "fee2fe94970443be184e7237bed29ec8", "score": "0.55527574", "text": "function getRelevantDictFromLexicalEnvironment(env, path) {\n const [firstBinding] = path.split(\".\");\n if (has(env.env, firstBinding))\n return env.env;\n if (env.parentEnv != null)\n return getRelevantDictFromLexicalEnvironment(env.parentEnv, path);\n return undefined;\n}", "title": "" }, { "docid": "f93aeed23b2b493ef5c1308733a9666d", "score": "0.55437374", "text": "function replacement(name) {\n if (name == 'workspaceRoot' || name == 'workspaceFolder' || name == 'cwd') {\n if (vscode.workspace.rootPath !== undefined)\n return vscode.workspace.rootPath;\n if (vscode.window.activeTextEditor !== undefined)\n return path.dirname(vscode.window.activeTextEditor.document.uri.fsPath);\n return process.cwd();\n }\n const envPrefix = 'env:';\n if (name.startsWith(envPrefix))\n return process.env[name.substr(envPrefix.length)] || '';\n const configPrefix = 'config:';\n if (name.startsWith(configPrefix)) {\n const config = vscode.workspace.getConfiguration().get(name.substr(configPrefix.length));\n return (typeof config == 'string') ? config : null;\n }\n return null;\n}", "title": "" }, { "docid": "c74fe0ad5d569d80b8d610c4c34c46ad", "score": "0.5542325", "text": "get env() {\n return {\n ...this._env,\n };\n }", "title": "" }, { "docid": "fd111a397a3c7a709726d0f8883d1dfa", "score": "0.5536409", "text": "getNodeEnv(): string {\n debug('getNodeEnv: ', this.getConfiguration());\n return this.getConfiguration().env.NODE_ENV;\n }", "title": "" }, { "docid": "c21dc972ee9042b3bff0743edfcf45b8", "score": "0.5527172", "text": "function ___R$$priv$project$rome$$internal$core$common$constants_ts$getCacheDirectory() {\n\t\tconst XDG_CACHE_HOME = ___R$$priv$project$rome$$internal$core$common$constants_ts$getEnvironmentDirectory(\n\t\t\t\"XDG_CACHE_HOME\",\n\t\t\t\"rome\",\n\t\t);\n\t\tif (XDG_CACHE_HOME !== undefined) {\n\t\t\treturn XDG_CACHE_HOME;\n\t\t}\n\n\t\tif (process.platform === \"win32\") {\n\t\t\t// process.env.TEMP also exists, but most apps put caches here\n\t\t\treturn ___R$$priv$project$rome$$internal$core$common$constants_ts$getLocalAppDataDir().append(\n\t\t\t\t\"Cache\",\n\t\t\t);\n\t\t}\n\n\t\tif (process.platform === \"darwin\") {\n\t\t\treturn ___R$project$rome$$internal$path$constants_ts$HOME_PATH.append(\n\t\t\t\t\"Library\",\n\t\t\t\t\"Caches\",\n\t\t\t\t\"Rome\",\n\t\t\t);\n\t\t}\n\n\t\treturn ___R$project$rome$$internal$path$constants_ts$HOME_PATH.append(\n\t\t\t\".cache\",\n\t\t\t\"rome\",\n\t\t);\n\t}", "title": "" }, { "docid": "3718d4b9eb8aa78277c537fd42b788e0", "score": "0.55219954", "text": "function getEnv() {\n var env; // Only Node.JS has a process variable that is of [[Class]] process\n\n if (\n typeof process !== 'undefined' &&\n toString.call(process) === '[object process]'\n ) {\n // For node use HTTP adapter\n env = 'NODE';\n }\n\n if (typeof XMLHttpRequest !== 'undefined') {\n env = 'BROWSER';\n }\n\n return env;\n }", "title": "" }, { "docid": "8506c1d567e12a2488818057cc9d7225", "score": "0.5514176", "text": "function getEmbeddingPCEnv() {\r\n let result = null;\r\n\r\n if (window.location.hash && window.location.hash.indexOf('access_token') >= 0) {\r\n let oauthParams = extractParams(window.location.hash.substring(1));\r\n if (oauthParams && oauthParams.access_token && oauthParams.state) {\r\n // OAuth2 spec dictates this encoding\r\n // See: https://tools.ietf.org/html/rfc6749#appendix-B\r\n let stateSearch = unescape(oauthParams.state);\r\n result = extractParams(stateSearch).pcEnvironment;\r\n }\r\n }\r\n\r\n if (!result && window.location.search) {\r\n result = extractParams(window.location.search.substring(1)).pcEnvironment || null;\r\n }\r\n\r\n return result;\r\n }", "title": "" }, { "docid": "3ee82a00942a89249210cacabef80deb", "score": "0.55116314", "text": "getEnv(): any {\n return this.env;\n }", "title": "" }, { "docid": "33c7aaee304416c80c76ce9db7eecf3a", "score": "0.55077684", "text": "get env () {\n return reduceEnvsConfigs(this._chain)\n }", "title": "" }, { "docid": "9f45a102fd55e0dd9a7d4ff9b908c39c", "score": "0.5507272", "text": "function _getEnvironment(env){\n var environments = ['prod','dev','test'];\n var defaultEnv = 'dev';\n\n if(typeof env === 'undefined' || !env){\n env = defaultEnv;\n }\n\n var currentEnv = process.env.NODE_ENV || env;\n\n //try to recognize what we have at the moment\n var possibleEnv = _.find(environments, function(env){\n return currentEnv.indexOf(env) != -1;\n });\n\n return possibleEnv || defaultEnv;\n}", "title": "" }, { "docid": "4a2979f6c5d86dfe32db3d9e800a2b9a", "score": "0.5497384", "text": "function getCachePath() {\n return path_1.join(electron_1.app.getPath('userData'), 'sentry');\n}", "title": "" }, { "docid": "4b83bf8fd0cec613cfb7982c7325b741", "score": "0.5475925", "text": "function getWindowPath() {\n return window.location.pathname + window.location.search;\n}", "title": "" }, { "docid": "e4a858f54bcaa200e0c20b0ffb366462", "score": "0.547205", "text": "function getGlobalDir(){if(!globalDir){this.initGlobalDir();}!globalDir?true?invariant(false,'Global direction not set.'):invariant(false):void 0;return globalDir;}", "title": "" }, { "docid": "9fe3ed8551360d339f7f497dd5294c07", "score": "0.54713786", "text": "function currentTarget(repo){\n return path.resolve(homepath,repo).replace('C:','').replace('D:','').split('\\\\').join('/')\n}", "title": "" }, { "docid": "9c2215e6a926aeef198378d8aa01fd21", "score": "0.5460808", "text": "function rubyPath(rubyVersion) {\n return `${process.env.HOME}/.rubies/ruby-${rubyVersion}`\n}", "title": "" }, { "docid": "9c2215e6a926aeef198378d8aa01fd21", "score": "0.5460808", "text": "function rubyPath(rubyVersion) {\n return `${process.env.HOME}/.rubies/ruby-${rubyVersion}`\n}", "title": "" }, { "docid": "6adbcff13156805c833ae730b7e58283", "score": "0.5454966", "text": "getBasePath() {\n const currentJob = this.currentJob;\n var basePath = (currentJob.payload.private) ? `https://${process.env.GITHUB_BOT_USERNAME}:${process.env.GITHUB_BOT_PASSWORD}@github.com`:\"https://github.com\";\n return basePath;\n }", "title": "" }, { "docid": "59e33e9af48e265ca356893251002018", "score": "0.5445914", "text": "function clearGoRuntimeBaseFromPATH() {\n if (exports.terminalCreationListener) {\n const l = exports.terminalCreationListener;\n exports.terminalCreationListener = undefined;\n l.dispose();\n }\n const pathEnvVar = pathEnvVarName();\n if (!pathEnvVar) {\n goLogging_1.logVerbose(`couldn't find PATH property in process.env`);\n return;\n }\n environmentVariableCollection === null || environmentVariableCollection === void 0 ? void 0 : environmentVariableCollection.delete(pathEnvVar);\n}", "title": "" }, { "docid": "4d770895451a07d92c41198119749e2b", "score": "0.5432595", "text": "function getDir() {\n return path.resolve(__dirname)\n}", "title": "" }, { "docid": "999b2dddca90e9e9b8aba1c35575be28", "score": "0.54281676", "text": "_setPathLocation() {\n // TODO need better way to differentiate between macOS and Windows FILES_PATHs\n let dlabsLocation = shell.which('dlabs-cli')?.stdout?.trim();\n\n /* istanbul ignore if */\n if (dlabsLocation[0] === '/') {\n dlabsLocation = dlabsLocation.replace(/(\\/\\w+){1}$/, '');\n return `${dlabsLocation}/lib/node_modules/dlabs-cli`;\n } else if (dlabsLocation.includes('C:')) {\n dlabsLocation = dlabsLocation.replace(/\\\\DLABS-CLI.CMD/, '').replace(/\\\\\\\\/g, '\\\\');\n return `${dlabsLocation.toLowerCase()}\\\\node_modules\\\\dlabs-cli`;\n } else {\n this._consoleOutput('error', this.LOG_MESSAGES.noPathDetected);\n }\n }", "title": "" }, { "docid": "cfa012dd93b26827945c799adfba1323", "score": "0.54257476", "text": "function getBinPathFromEnvVar(toolName, envVarValue, appendBinToPath) {\n toolName = correctBinname(toolName);\n if (envVarValue) {\n const paths = envVarValue.split(path.delimiter);\n for (const p of paths) {\n const binpath = path.join(p, appendBinToPath ? 'bin' : '', toolName);\n if (executableFileExists(binpath)) {\n return binpath;\n }\n }\n }\n return null;\n}", "title": "" }, { "docid": "cfa012dd93b26827945c799adfba1323", "score": "0.54257476", "text": "function getBinPathFromEnvVar(toolName, envVarValue, appendBinToPath) {\n toolName = correctBinname(toolName);\n if (envVarValue) {\n const paths = envVarValue.split(path.delimiter);\n for (const p of paths) {\n const binpath = path.join(p, appendBinToPath ? 'bin' : '', toolName);\n if (executableFileExists(binpath)) {\n return binpath;\n }\n }\n }\n return null;\n}", "title": "" }, { "docid": "93a9a1173156573e3d9d286dd376ca92", "score": "0.541854", "text": "getEnvironment(projectName) {\n const project = this.getProject(projectName);\n return project.getEnvironment(projectName);\n }", "title": "" } ]
04dc828d44978c5e201952230b69bff3
bound to scroll event
[ { "docid": "7fc8d306deb9dbcd7c832468ece84688", "score": "0.0", "text": "scroll() {\n this.target = window.scrollY || window.pageYOffset;\n this.startAnimation();\n }", "title": "" } ]
[ { "docid": "e7ea4631e04603d84e05f2005df8ca6a", "score": "0.80795044", "text": "onScroll(event){\n\t\tthis.scrollProcessDelegate( event );\n\t}", "title": "" }, { "docid": "cafec4d60624f388dffa81592f4ae346", "score": "0.80595756", "text": "onScroll() {\n this.verifyScrollPosision();\n }", "title": "" }, { "docid": "1d1eba9efac33a99027502a40cf3889e", "score": "0.7936619", "text": "function qodefOnWindowScroll() {\n\n }", "title": "" }, { "docid": "b946a47423cf1e4d5e2471e5eafe616a", "score": "0.7842329", "text": "function qodeOnWindowScroll() {\n }", "title": "" }, { "docid": "b946a47423cf1e4d5e2471e5eafe616a", "score": "0.7842329", "text": "function qodeOnWindowScroll() {\n }", "title": "" }, { "docid": "21e450db061caea8a1bdf7f9167e569b", "score": "0.77973694", "text": "function qodeOnWindowScroll() {\n\n }", "title": "" }, { "docid": "7f841f0be126c16aca8e356e69a9ea83", "score": "0.77591586", "text": "scrolled() {\n this._super();\n this.saveScrollPosition();\n }", "title": "" }, { "docid": "90e2b766e4219daf352149744ce0bec1", "score": "0.7714319", "text": "function mkdOnWindowScroll() {\n\n\t}", "title": "" }, { "docid": "90e2b766e4219daf352149744ce0bec1", "score": "0.7714319", "text": "function mkdOnWindowScroll() {\n\n\t}", "title": "" }, { "docid": "9e9f84caf861aeece1b33b7396c0d8da", "score": "0.7691709", "text": "function eltdOnWindowScroll() {\n }", "title": "" }, { "docid": "bfc872825aa790e3c9e6754e7e08d0fb", "score": "0.7660536", "text": "onInternalScrollChange (scrollPosition) {}", "title": "" }, { "docid": "c63406f145b53f6f7e47d327eedac579", "score": "0.7649214", "text": "_onScroll(adj) {\n }", "title": "" }, { "docid": "15da2951528764f553e35c39b8f2b51d", "score": "0.7624499", "text": "function eltdOnWindowScroll() {\n\n }", "title": "" }, { "docid": "15da2951528764f553e35c39b8f2b51d", "score": "0.7624499", "text": "function eltdOnWindowScroll() {\n\n }", "title": "" }, { "docid": "2a9176eafed38a27d76f5d2b59994448", "score": "0.76032925", "text": "function eltdfOnWindowScroll() {\n \n }", "title": "" }, { "docid": "b7ed21e0f1f7a6a3c9f5612f93691af7", "score": "0.7578389", "text": "function eltdfOnWindowScroll() {\n }", "title": "" }, { "docid": "db79ae5d0594fd24fd3db062dfef4cf0", "score": "0.75717163", "text": "function addScrollEvent () {\n $(\".mobile-content\").scroll(function () {\n setProgressBar();\n });\t\n}", "title": "" }, { "docid": "0170f9cbb3704ed42fd39c1dcf61388d", "score": "0.7510309", "text": "function bindScroll(){\n\t\t\t\t\t$(window).scroll(function(e){\n\t\t\t\t\t\tsetScrollTimer();\n\t\t\t\t\t\tdoStatusChecks();\n\t\t\t\t\t});\t\t\t\t\t\n\t\t\t\t}", "title": "" }, { "docid": "dea095ee7533916c0f4416240e1cba74", "score": "0.74670684", "text": "function onScroll(evt) {\n console.log(\"watchForScroll\");\n doScrollToFragment = false;\n }", "title": "" }, { "docid": "3dcf1d978f2896b7e6f3838450756295", "score": "0.74126345", "text": "handleScroll_() {\n if (this.ignoreNextScroll_) {\n this.ignoreNextScroll_ = false;\n return;\n }\n\n this.scrolling_ = true;\n this.updateCurrent_();\n this.notifyScrollStart();\n this.debouncedResetScrollReferencePoint_();\n }", "title": "" }, { "docid": "a41127f930eb6cc6ae181c7216f283d8", "score": "0.74078774", "text": "handleScroll() {\n if (this.isScrolling === false)\n this.saveHeights();\n this.setScrollingStatus();\n }", "title": "" }, { "docid": "af9ef5f8e7bb6334a854b0a4873f7e89", "score": "0.7406321", "text": "onScroll() {\n ScrollTrigger.update()\n }", "title": "" }, { "docid": "a81769c10694ed5d4c573c5cf25a85d1", "score": "0.73627293", "text": "function bindScrollEvent(){\n var hPos = 0,\n hPosTmp = hPos;\n\n $(window).on('scroll touchmove', function() {\n hPosTmp = window.pageYOffset;\n\n if(hPosTmp >= hPos) {\n hPos = hPosTmp;\n } else {\n showInterstitial();\n }\n });\n }", "title": "" }, { "docid": "2ceb55958b0a28b55f3e42f849c7c8b4", "score": "0.7359129", "text": "addListener() {\n window.addEventListener('scroll', this.handleScroll)\n }", "title": "" }, { "docid": "9779c3dd8592cb21f790db57030c2f51", "score": "0.73438674", "text": "function _bindScrollListener() {\n\t Utils.addEvent($(window), Constants.SCROLL, Utils.debounce(__rerenderScroll, 200, false));\n\t}", "title": "" }, { "docid": "3b86fbea389aeed0644012714c634d1e", "score": "0.7324723", "text": "handleScroll(e) {\n this.animateTimeline();\n }", "title": "" }, { "docid": "bcd955188e3c4354fb8493f3f301c850", "score": "0.7322471", "text": "function scrollHandler() {\n var scrollTop = this.scrollTop || this.scrollY;\n if (options.performantScroll) refreshDomElm(scrollTop);\n if (scope.infiniteScroll) infiniteScroll(scrollTop);\n }", "title": "" }, { "docid": "10417adb197b5d8741cd3e61c109e2a7", "score": "0.73216313", "text": "function page_scroll_events(){\n\n $(window).scroll(function() {\n page_header_change();\n update_progress_scroll_bar();\n });\n}", "title": "" }, { "docid": "b34b6125528296c867065c18f06be173", "score": "0.727793", "text": "onscrolled(y, firstLine, height, lastLine) {\n }", "title": "" }, { "docid": "b174b398b2d0eb48569a61e59d40e9d2", "score": "0.72623914", "text": "_onPageScroll() {\n this.pageScrolled = true;\n }", "title": "" }, { "docid": "bf4c191989be18661560f11ca98f2a9e", "score": "0.72590643", "text": "function onScrollFunc(){\n $(document).on(\"scroll\", onScroll);\n }", "title": "" }, { "docid": "c67b1da1c2b86fc5cdc4cd85e5aaa143", "score": "0.7255232", "text": "_onScroll () {\n const scrollY = this._scrollSource.scrollTop;\n const isUp = scrollY < this._lastY;\n const isZero = this._lastY === 0;\n\n this._lastY = scrollY;\n\n if (!this._tickScroll) {\n this._tickScroll = true;\n window.requestAnimationFrame(() => {\n this._updateScroll(isZero, isUp);\n this._tickScroll = false;\n });\n }\n }", "title": "" }, { "docid": "2680fc2b2bd10de863cdfda61d0bcab0", "score": "0.72521853", "text": "function onScroll() {\n\tlogTrace('invoking onScroll()');\n\n\t// prevent scroll event during page load\n\tif (pageLoads === true) {\n\n\t\tlogWarn('Invocation of onScroll() canceled, page load is in progress.');\n\t\treturn;\n\t}\n\n\t// directory adds items on scroll down, thus we need to run the filter again\n\tconst remainingItems = filterDirectory();\n\n\t// attach hide buttons to the remaining items\n\tattachHideButtons(remainingItems);\n}", "title": "" }, { "docid": "cceee2300c7adde23c7b99ce033d344c", "score": "0.7246369", "text": "handleScrollStart() {\n // console.log('scrollView started scrolling from momentum');\n }", "title": "" }, { "docid": "aca6748f319be830a6fe26ebc28b0334", "score": "0.7237941", "text": "function qodefOnWindowScroll() {\n\t qodefInitPortfolioPagination().scroll();\n }", "title": "" }, { "docid": "53d68e2a2c6947704bd0e71bafa57b32", "score": "0.7228603", "text": "function listenForScrollEvent(el){\n\tel.on(\"scroll\", function(){\n\t\tel.trigger(\"custom-scroll\");\n\t});\n}", "title": "" }, { "docid": "18e4ec8ffc7b962b070e59cd956a76a8", "score": "0.7218172", "text": "function onScroll(event){\n var scrollPos = jQuery(document).scrollTop();\n}", "title": "" }, { "docid": "0d621469d89ba3c14299728882de8058", "score": "0.719551", "text": "scroll() {\n this.updateScrollValues(window.pageXOffset, window.pageYOffset)\n }", "title": "" }, { "docid": "81f64f09ddd1a663dfc4bb5b08b518fc", "score": "0.7136344", "text": "function onScroll() {\n var currentScroll = new Date();\n\n if(currentScroll - previousScroll > 1000)\n {\n previousScroll = currentScroll;\n handleScroll();\n }\n}", "title": "" }, { "docid": "50a59969a0741b56b47a3dd6fa2d8f04", "score": "0.71327025", "text": "scrollEnd() {}", "title": "" }, { "docid": "896d1890db97c0f216bc5e21d43615ea", "score": "0.7102474", "text": "function onScroll() {\n\t\t// unique tick id\n\t\t++ticks;\n\n\t\t// viewport rectangle\n\t\tvar top = jWindow.scrollTop(),\n\t\t\tleft = jWindow.scrollLeft(),\n\t\t\tright = left + jWindow.width(),\n\t\t\tbottom = top + jWindow.height();\n\n\t\t// determine which elements are in view\n// + 60 accounts for fixed nav\n\t\tvar intersections = findElements(top+offset.top + 200, right+offset.right, bottom+offset.bottom, left+offset.left);\n\t\t$.each(intersections, function(i, element) {\n\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick != 'number') {\n\t\t\t\t// entered into view\n\t\t\t\telement.triggerHandler('scrollSpy:enter');\n\t\t\t}\n\n\t\t\t// update tick id\n\t\t\telement.data('scrollSpy:ticks', ticks);\n\t\t});\n\n\t\t// determine which elements are no longer in view\n\t\t$.each(elementsInView, function(i, element) {\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick == 'number' && lastTick !== ticks) {\n\t\t\t\t// exited from view\n\t\t\t\telement.triggerHandler('scrollSpy:exit');\n\t\t\t\telement.data('scrollSpy:ticks', null);\n\t\t\t}\n\t\t});\n\n\t\t// remember elements in view for next tick\n\t\telementsInView = intersections;\n\t}", "title": "" }, { "docid": "896d1890db97c0f216bc5e21d43615ea", "score": "0.7102474", "text": "function onScroll() {\n\t\t// unique tick id\n\t\t++ticks;\n\n\t\t// viewport rectangle\n\t\tvar top = jWindow.scrollTop(),\n\t\t\tleft = jWindow.scrollLeft(),\n\t\t\tright = left + jWindow.width(),\n\t\t\tbottom = top + jWindow.height();\n\n\t\t// determine which elements are in view\n// + 60 accounts for fixed nav\n\t\tvar intersections = findElements(top+offset.top + 200, right+offset.right, bottom+offset.bottom, left+offset.left);\n\t\t$.each(intersections, function(i, element) {\n\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick != 'number') {\n\t\t\t\t// entered into view\n\t\t\t\telement.triggerHandler('scrollSpy:enter');\n\t\t\t}\n\n\t\t\t// update tick id\n\t\t\telement.data('scrollSpy:ticks', ticks);\n\t\t});\n\n\t\t// determine which elements are no longer in view\n\t\t$.each(elementsInView, function(i, element) {\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick == 'number' && lastTick !== ticks) {\n\t\t\t\t// exited from view\n\t\t\t\telement.triggerHandler('scrollSpy:exit');\n\t\t\t\telement.data('scrollSpy:ticks', null);\n\t\t\t}\n\t\t});\n\n\t\t// remember elements in view for next tick\n\t\telementsInView = intersections;\n\t}", "title": "" }, { "docid": "896d1890db97c0f216bc5e21d43615ea", "score": "0.7102474", "text": "function onScroll() {\n\t\t// unique tick id\n\t\t++ticks;\n\n\t\t// viewport rectangle\n\t\tvar top = jWindow.scrollTop(),\n\t\t\tleft = jWindow.scrollLeft(),\n\t\t\tright = left + jWindow.width(),\n\t\t\tbottom = top + jWindow.height();\n\n\t\t// determine which elements are in view\n// + 60 accounts for fixed nav\n\t\tvar intersections = findElements(top+offset.top + 200, right+offset.right, bottom+offset.bottom, left+offset.left);\n\t\t$.each(intersections, function(i, element) {\n\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick != 'number') {\n\t\t\t\t// entered into view\n\t\t\t\telement.triggerHandler('scrollSpy:enter');\n\t\t\t}\n\n\t\t\t// update tick id\n\t\t\telement.data('scrollSpy:ticks', ticks);\n\t\t});\n\n\t\t// determine which elements are no longer in view\n\t\t$.each(elementsInView, function(i, element) {\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick == 'number' && lastTick !== ticks) {\n\t\t\t\t// exited from view\n\t\t\t\telement.triggerHandler('scrollSpy:exit');\n\t\t\t\telement.data('scrollSpy:ticks', null);\n\t\t\t}\n\t\t});\n\n\t\t// remember elements in view for next tick\n\t\telementsInView = intersections;\n\t}", "title": "" }, { "docid": "2953db6c01e2d78eaa8fa866aaf85e1f", "score": "0.7101407", "text": "scroll () {\n window.addEventListener('scroll', (e) => {\n if (!this.didScroll) {\n this.didScroll = true\n setTimeout(this.scrollPage(), this.delay)\n }\n }, false)\n }", "title": "" }, { "docid": "6b74de9a0144ff9efbbeb22a1e230e8d", "score": "0.710018", "text": "function onScroll(e) {\n var old = scrollTop;\n \n scrollTop = $win.scrollTop();\n \n if (old !== scrollTop) {\n if (old < scrollTop) {\n scrollDirection = 'forward';\n } else {\n scrollDirection = 'reverse';\n }\n me.events.publish('update:scroll', get());\n //$.publish('browser:update:scroll', get());\n }\n }", "title": "" }, { "docid": "509e55ed29194a0b3aec5ccc2379c736", "score": "0.7065229", "text": "OnScroll(callback) {\r\n // Add callback to list\r\n this.scrollCallbacks.push(callback);\r\n }", "title": "" }, { "docid": "8c1a71f219434392321d3f329fc8791d", "score": "0.70633906", "text": "onScroll_() {\n const scrollTop = this.viewport_.getScrollTop();\n if (scrollTop > 1) {\n // Check greater than 1 because AMP set scrollTop to 1 in iOS.\n this.display_();\n }\n }", "title": "" }, { "docid": "0a0e6ae28a00e3e19971600fd07d6a27", "score": "0.7056055", "text": "onScroll(scrollEvent) {\n return this._addEvent(scrollEvent, this.scrollEvents);\n }", "title": "" }, { "docid": "fd207eca3592fac5fca4a429792e3af6", "score": "0.70382434", "text": "function whileScrolling() {\n $rootScope.$broadcast('scrollable-container_on-scrolling');\n }", "title": "" }, { "docid": "cd9c40c31f813a5087a4ee332af9fbd3", "score": "0.700759", "text": "_scroll(event) {\n let { isTouching, preventDefault, listenElement } = this;\n\n if (isTouching === false) {\n /* Put mouse as a reference in the event. */\n event.mouse = this;\n\n /* Skip the default behaviours upon this event. */\n if (preventDefault === true) {\n event.preventDefault();\n }\n\n /* Update the mouse relative position. */\n let offsetPosition = getOffsetPosition(listenElement);\n\n this._updatePosition({\n x: event.clientX - offsetPosition.x,\n y: event.clientY - offsetPosition.y\n });\n\n this.scrollDelta = max(-1, min(1, event.wheelDelta || -event.detail));\n\n /* Perform action for scroll event. */\n this._fireEvents(this.scrollEvents, event);\n }\n }", "title": "" }, { "docid": "db817579d3a16319711693ab6c515be2", "score": "0.70059514", "text": "function scrollListener() {\n infinitedivs.viewDoctor();\n}", "title": "" }, { "docid": "ee0e44beb2cd9c260a2e2b1cd6e566de", "score": "0.7000352", "text": "function _onScrolled() {\n\t\t if(_this.contentsReady) {\n\t\t\t\t\t_this.signals.appScrolled.dispatch();\n\t\t\t\t}\n\t\t }", "title": "" }, { "docid": "25487c1d586f8068f036e8fc33c7caa9", "score": "0.6984636", "text": "function onScroll() {\n if (!scope.albumsLoading && !lastPage) {\n var elementBottom = element[0].getBoundingClientRect().bottom,\n windowHeight = document.documentElement.clientHeight;\n\n if (elementBottom < windowHeight) {\n onGetAlbums();\n }\n }\n }", "title": "" }, { "docid": "25487c1d586f8068f036e8fc33c7caa9", "score": "0.6984636", "text": "function onScroll() {\n if (!scope.albumsLoading && !lastPage) {\n var elementBottom = element[0].getBoundingClientRect().bottom,\n windowHeight = document.documentElement.clientHeight;\n\n if (elementBottom < windowHeight) {\n onGetAlbums();\n }\n }\n }", "title": "" }, { "docid": "c167257bebcff1b9ac22804dfbd728f4", "score": "0.69720554", "text": "function scopedScroll(e) {\n fn.scroll.apply(fn, [e]);\n }", "title": "" }, { "docid": "fd5f0e6ab5944bab793c5bf5517d3e7c", "score": "0.69714624", "text": "listenToScrollEvents() {\n this.containerScrollListener = this.renderer.listen(this.htmlElement, 'scroll', () => {\n this.htmlElement.scrollTo(0, 0);\n });\n }", "title": "" }, { "docid": "dd8e1834544d2e11e0816b5b2e99cca9", "score": "0.6968941", "text": "function _scrollUpdate(event) {\n\t var offset = Array.isArray(event.delta) ? event.delta[this._direction] : event.delta;\n\t if (this.options.scrollCallback) {\n\t offset = this.options.scrollCallback(offset, 0);\n\t }\n\t this.scroll(offset);\n\t }", "title": "" }, { "docid": "eab133977286a4bead8239fd1e8fad19", "score": "0.6923624", "text": "function handleScrollEvent() {\n if (!menuClicked) {\n for(let i = 0; i < hashItems.length; i++) {\n let item = $(hashItems[i]);\n if (isInViewPort(item)) {\n if (!item.hasClass(\"active\")) {\n // Scale at first time\n initSection(hashItems[i], 0);\n activateMenu($('.menu a[href=\"' + hashItems[i] + '\"]'));\n }\n break;\n } \n }\n } else {\n initSection(targetScroll, 0);\n menuClicked = false;\n }\n }", "title": "" }, { "docid": "d8cccc78671ae3fb4811ad4bc9bee13b", "score": "0.6919529", "text": "function onScroll(delta, callback) {\n // scroll to active item\n if (!isBusy) {\n scrollToItem(getActiveItem(delta), callback);\n }\n }", "title": "" }, { "docid": "a580d6840ea719778f94b76685edde42", "score": "0.6906174", "text": "function windowScrollHandler() {\n\n if (isScrolling) return;\n\n // act on next animation frame\n requestAnimationFrame(function() {\n\n var wY = window.pageYOffset, i, activate;\n for (i = 0; i < element.length; i++) {\n if (element[i].section.offsetParent && wY >= element[i].section.offsetTop) activate = i;\n }\n\n activeItem(activate);\n\n });\n\n }", "title": "" }, { "docid": "65ca199cd1fea44f681e136057b398ab", "score": "0.68846214", "text": "notifyScrollPositionChanged_() {\n this.element_.dispatchEvent(\n createCustomEvent(this.win_, CarouselEvents.SCROLL_POSITION_CHANGED, null)\n );\n }", "title": "" }, { "docid": "350200a184b1f95013e3c9a45aa50b66", "score": "0.6863286", "text": "function handleMenuScroll(e) {\n doScroll(e);\n }", "title": "" }, { "docid": "c06935416370dbcd28a6a94832458424", "score": "0.6861474", "text": "function scrollListener() {\n document.addEventListener(\"scroll\", function () {\n getActiveSection();\n });\n}", "title": "" }, { "docid": "3d225c1029f47288df8d517d9f8ef2a1", "score": "0.68588525", "text": "function onScroll(e) {\n debug(\"event: scrolling\");\n // Figure out which item is at the top\n var $body = $('body');\n var x = $body.width() / 2;\n var el = document.elementFromPoint(x, 0);\n var $item = $(el).closest(S_post);\n\n if ($item.length) {\n console.log(\"Item id=\" + $item.attr('id'));\n }\n}", "title": "" }, { "docid": "b11751e6f21a3e3b5dc6ed727eee32fb", "score": "0.6848928", "text": "function elmScroll (e) {\n\t\tslides.removeClass('initial');\n\t\t// Scroll up\n\t\tif (ready && (e.originalEvent.detail < 0 || e.originalEvent.wheelDelta > 0)) {\n\t\t\tdelta--;\n\t\t\tif ( Math.abs(delta) >= scrollThreshold) {\n\t\t\tprevSlide();\n\t\t\t}\n\t\t}\n\t\t// Scroll down\n\t\telse if (ready) {\n\t\t\tdelta++;\n\t\t\tif (delta >= scrollThreshold) {\n\t\t\t\tnextSlide();\n\t\t\t}\n\t\t}\n\t\t// evita che la pagina scrolli\n\t\treturn false;\n\t}", "title": "" }, { "docid": "f03ede39c6eb1456cacdd73fc9c21c1e", "score": "0.6813734", "text": "function goscroll(e){\n coef = this.children[0].id*1;\n scrolling(coef);\n autoscrollrestart();\n }", "title": "" }, { "docid": "b52a961af54d1c37e375b3852c2e8869", "score": "0.68112904", "text": "function scrollEvent() {\n /*jshint validthis:true */\n _waiting = false;\n for (var i = 0; i < this.elements.length; i++) {\n // Update each element\n this.elements[i].update.apply(this.elements[i]);\n }\n }", "title": "" }, { "docid": "b88cc9af194cfc3b95fe0e24fef26953", "score": "0.68095154", "text": "function scroll() {\n\t\t\tif (that.scrolling) { return; }\n\t\t\t\n\t\t\tthat.scrolling = true;\n\t\t\tbtk.defer(doScroll, [], that);\n\t\t}", "title": "" }, { "docid": "58ef5bfe7eb3aa74330dd097327018cd", "score": "0.68003947", "text": "function scroll() {\r\n\t\t\tslotScroller.scrollTop(top);\r\n\t\t}", "title": "" }, { "docid": "58ef5bfe7eb3aa74330dd097327018cd", "score": "0.68003947", "text": "function scroll() {\r\n\t\t\tslotScroller.scrollTop(top);\r\n\t\t}", "title": "" }, { "docid": "202c8e1c3a73715d8282bddb03650a93", "score": "0.67997456", "text": "function viamouseScroll() {\n\n\t}", "title": "" }, { "docid": "b8ab29d62f5aaa28daad0210674444ea", "score": "0.6795762", "text": "function onScroll(scrollOffset) {\n\t\t// unique tick id\n\t\t++ticks;\n\n\t\t// viewport rectangle\n\t\tvar top = jWindow.scrollTop(),\n\t\t\tleft = jWindow.scrollLeft(),\n\t\t\tright = left + jWindow.width(),\n\t\t\tbottom = top + jWindow.height();\n\n\t\t// determine which elements are in view\n\t\tvar intersections = findElements(top+offset.top + scrollOffset || 200, right+offset.right, bottom+offset.bottom, left+offset.left);\n\t\t$.each(intersections, function(i, element) {\n\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick != 'number') {\n\t\t\t\t// entered into view\n\t\t\t\telement.triggerHandler('scrollSpy:enter');\n\t\t\t}\n\n\t\t\t// update tick id\n\t\t\telement.data('scrollSpy:ticks', ticks);\n\t\t});\n\n\t\t// determine which elements are no longer in view\n\t\t$.each(elementsInView, function(i, element) {\n\t\t\tvar lastTick = element.data('scrollSpy:ticks');\n\t\t\tif (typeof lastTick == 'number' && lastTick !== ticks) {\n\t\t\t\t// exited from view\n\t\t\t\telement.triggerHandler('scrollSpy:exit');\n\t\t\t\telement.data('scrollSpy:ticks', null);\n\t\t\t}\n\t\t});\n\n\t\t// remember elements in view for next tick\n\t\telementsInView = intersections;\n\t}", "title": "" }, { "docid": "8a85d873eaf9720289fe25306e8d7195", "score": "0.67834234", "text": "function _handleScroll() {\n // Save current scroll\n // Supports IE 9 and up.\n var nx = hasScrollContainer ? viewEl.scrollLeft : window.pageXOffset;\n var ny = hasScrollContainer ? viewEl.scrollTop : window.pageYOffset;\n scroll.setScroll(nx, ny); // Only called if the last animation request has been\n // completed and there are parallax elements to update\n\n if (!ticking && elements.length > 0) {\n ticking = true;\n window.requestAnimationFrame(_updateAllElements);\n }\n }", "title": "" }, { "docid": "8a85d873eaf9720289fe25306e8d7195", "score": "0.67834234", "text": "function _handleScroll() {\n // Save current scroll\n // Supports IE 9 and up.\n var nx = hasScrollContainer ? viewEl.scrollLeft : window.pageXOffset;\n var ny = hasScrollContainer ? viewEl.scrollTop : window.pageYOffset;\n scroll.setScroll(nx, ny); // Only called if the last animation request has been\n // completed and there are parallax elements to update\n\n if (!ticking && elements.length > 0) {\n ticking = true;\n window.requestAnimationFrame(_updateAllElements);\n }\n }", "title": "" }, { "docid": "7a61e7272f0be678f3a154b8ab14ad3e", "score": "0.67735773", "text": "function setScrollListener(){\n var win = $(window);\n\t// Each time the user scrolls\n\twin.scroll(function() {\n windowEffect();\n\t\tif ($(document).height() - win.height() <= win.scrollTop() && !downloadingContent && INDEX_ELEM != N_TOTAL_ELEM) {\n\t\t //here the code for call web service\n\t\t\tdownloadingContent = true;\n\t\t getStands(function(data){\n addChunk(data.list);\n downloadingContent = false;\n\t\t }, function(error){\n alert(\"ERROR LOADING STANDS\"); // FIXME mmanage it\n downloadingContent = false;\n\t\t }, elements.length);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "03892285ff0a7914681ed3d922a48a1e", "score": "0.67687273", "text": "function scroll() {\n slotScroller.scrollTop(top);\n }", "title": "" }, { "docid": "0784c17d5ee4c462be37b6702863b654", "score": "0.67664725", "text": "didScroll() {\n var _a, _b, _c, _d, _e;\n if (__classPrivateFieldGet(this, __orientation) === Orientation.Vertical) {\n (_a = __classPrivateFieldGet(this, _scrollbar)) === null || _a === void 0 ? void 0 : _a.track.yAxis.update(__classPrivateFieldGet(this, _lastKnownScrollValue), this.height, (_b = __classPrivateFieldGet(this, _adapter)) === null || _b === void 0 ? void 0 : _b.getContentSize());\n }\n else {\n (_c = __classPrivateFieldGet(this, _scrollbar)) === null || _c === void 0 ? void 0 : _c.track.xAxis.update(__classPrivateFieldGet(this, _lastKnownScrollValue), this.width, (_d = __classPrivateFieldGet(this, _adapter)) === null || _d === void 0 ? void 0 : _d.getContentSize());\n }\n (_e = __classPrivateFieldGet(this, _adapter)) === null || _e === void 0 ? void 0 : _e.onScroll(__classPrivateFieldGet(this, _lastKnownScrollValue), __classPrivateFieldGet(this, _isScrollingToPast) === undefined ? false : __classPrivateFieldGet(this, _isScrollingToPast));\n }", "title": "" }, { "docid": "3dd6dfcdf5b298564d6e6c19e858ff90", "score": "0.67638", "text": "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "title": "" }, { "docid": "3dd6dfcdf5b298564d6e6c19e858ff90", "score": "0.67638", "text": "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "title": "" }, { "docid": "3dd6dfcdf5b298564d6e6c19e858ff90", "score": "0.67638", "text": "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "title": "" }, { "docid": "3dd6dfcdf5b298564d6e6c19e858ff90", "score": "0.67638", "text": "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "title": "" }, { "docid": "3dd6dfcdf5b298564d6e6c19e858ff90", "score": "0.67638", "text": "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "title": "" }, { "docid": "3dd6dfcdf5b298564d6e6c19e858ff90", "score": "0.67638", "text": "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "title": "" }, { "docid": "3dd6dfcdf5b298564d6e6c19e858ff90", "score": "0.67638", "text": "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "title": "" }, { "docid": "e3174865a105912670d491f75c87ecbf", "score": "0.6763037", "text": "function handleScroll() {\n if (elementInViewport($('#welcome')))\n {\n handleAnimation(0);\n return;\n }\n\n if (elementInViewport($('#projects')))\n {\n handleAnimation(1);\n return;\n }\n\n if (elementInViewport($('#about')))\n {\n handleAnimation(2);\n return;\n }\n}", "title": "" }, { "docid": "ed412cb662fe99ed02429b1339348878", "score": "0.67595637", "text": "handleScroll() {\n if ((window.innerHeight + window.pageYOffset) >= document.body.offsetHeight) {\n const UniTableCurrent = this.UniTable.current;\n UniTableCurrent.loadMoreFunction();\n }\n }", "title": "" }, { "docid": "dd324e1c5226e8361e063510726af485", "score": "0.6747872", "text": "handleScroll() {\n let scrollY = window.scrollY || window.pageYOffset || document.documentElement.scrollTop;\n if (window.innerHeight + scrollY >= document.body.offsetHeight - 50) {\n console.log('handleScroll');\n this.loadMoreNews();\n }\n }", "title": "" }, { "docid": "3eb513ef2f5a6d53612a3d22a7941411", "score": "0.67423", "text": "function handleScroll() {\n if (window.innerHeight + document.documentElement.scrollTop !== document.documentElement.offsetHeight) return;\n setIsFetching(true);\n }", "title": "" }, { "docid": "b54fe6bb90e6844e76d20c6fc8fd6f4f", "score": "0.67395645", "text": "function ViewportScrollPosition() { }", "title": "" }, { "docid": "f81918eca903c6219ca3ae573f8977ed", "score": "0.67374504", "text": "handleScroll(e) {\n let scrollTriggerHeight = (this.aboutPictureRef.current.getBoundingClientRect().top);\n if(e >= scrollTriggerHeight && this.state.isOnScrollTiles === false) {\n this.animateOnScroll(e);\n }\n this.handleLight(e);\n }", "title": "" }, { "docid": "7ddf433e7d13511192a65d04c41c8b74", "score": "0.6736282", "text": "function handleScroll() {\n if (\n window.innerHeight + document.documentElement.scrollTop !==\n document.documentElement.offsetHeight\n )\n return;\n setIsFetching(true);\n }", "title": "" }, { "docid": "9aec3efb67d12a9e96b492b9e8e1db82", "score": "0.6730638", "text": "function onScroll(scrollOffset) {\n // unique tick id\n ++ticks;\n\n // viewport rectangle\n var top = jWindow.scrollTop(),\n left = jWindow.scrollLeft(),\n right = left + jWindow.width(),\n bottom = top + jWindow.height();\n\n // determine which elements are in view\n var intersections = findElements(top + offset.top + scrollOffset || 200, right + offset.right, bottom + offset.bottom, left + offset.left);\n $.each(intersections, function (i, element) {\n\n var lastTick = element.data('scrollSpy:ticks');\n if (typeof lastTick != 'number') {\n // entered into view\n element.triggerHandler('scrollSpy:enter');\n }\n\n // update tick id\n element.data('scrollSpy:ticks', ticks);\n });\n\n // determine which elements are no longer in view\n $.each(elementsInView, function (i, element) {\n var lastTick = element.data('scrollSpy:ticks');\n if (typeof lastTick == 'number' && lastTick !== ticks) {\n // exited from view\n element.triggerHandler('scrollSpy:exit');\n element.data('scrollSpy:ticks', null);\n }\n });\n\n // remember elements in view for next tick\n elementsInView = intersections;\n }", "title": "" }, { "docid": "54e6cfce9ed934619cefaa49bd46d04a", "score": "0.6729558", "text": "function scrollEvents(event) {\n\n\t/*== Show scroll to top button ==*/\n\tshowScrollToTop(event);\n\t/*== Adds active state to main navigation on scroll position ==*/\n\tmenuActiveScroll(event);\n}", "title": "" }, { "docid": "1f384d680aec2795bdcf47fd442b65f2", "score": "0.6726309", "text": "function onScroll(e) {\r\n document.body.style.setProperty(\"--scroll\", window.pageYOffset / (document.body.offsetHeight));\r\n }", "title": "" }, { "docid": "49b97d638ac4558433015f074ccab8e2", "score": "0.67260796", "text": "function handleScroll() {\n monitorScrollToTop();\n if (isApi) {\n highlightTypeMenuItem();\n }\n }", "title": "" }, { "docid": "5ceb15a7b904a47f2b95e1feb5bd13b4", "score": "0.67198175", "text": "function handleScroll() {\n // Set window pageYOffset to state\n setPageYOffset(window.pageYOffset)\n }", "title": "" }, { "docid": "08435900c898f38628caefe649549b42", "score": "0.66976875", "text": "function scrollListener (e) {\n let prevYOffset = window.pageYOffset;\n\n window.removeEventListener(\"wheel\", scrollListener);\n setTimeout(() => {\n scrollAnimate({\n duration: 1000,\n timing(timeFraction) {\n return timeFraction;\n },\n draw(progress) {\n if(e.deltaY > 0) {\n window.scrollBy(0, progress*(prevYOffset + 1024 - window.pageYOffset));\n }\n else {\n window.scrollBy(0, progress*(prevYOffset - 1024 - window.pageYOffset));\n }\n }\n });\n },200)\n setTimeout(() => {\n let currentPaginationItem = document.querySelector(\".navigation__pagination-item--current\");\n currentPaginationItem.classList.remove(\"navigation__pagination-item--current\");\n //change current pagination-item\n if(e.deltaY > 0) {\n [...paginationItems][Math.ceil(pageYOffset/1024)].classList.add(\"navigation__pagination-item--current\");\n }\n else {\n [...paginationItems][Math.floor(pageYOffset/1024)].classList.add(\"navigation__pagination-item--current\");\n }\n window.addEventListener(\"wheel\", scrollListener);\n }, 400)\n }", "title": "" }, { "docid": "4585fa01bb373964611ef2c2cd2e45b5", "score": "0.66955984", "text": "function handleScroll(evt, isScrollDown){\n\t\t\tvar currentStartIndex = Math.floor((settings.$fixedHeightContainerElem[0].scrollTop)/settings.rowHeight);\n\t\t\tvar start = currentStartIndex - settings.extraVisibleRowCount/2;\n\t\t\tvar end = currentStartIndex + settings.visibleRowsCount + settings.extraVisibleRowCount/2;\n\t\t\trenderPageData(start, end, isScrollDown, true);\n\t\t}", "title": "" }, { "docid": "016626521c004a877b5cb24cd0cb0ed4", "score": "0.66835624", "text": "function handleScrollEvent() {\n const activeSection = getSectionNearViewPort();\n if(activeSection) {\n activateSectionsAndNavLinks(activeSection);\n }\n pageJustLoaded = false;\n if(scrollEventOccurred){\n return;\n }\n scrollEventOccurred = true;\n displayNavigationMenu(true);\n setTimeout(() => scrollEventOccurred = false, 500);\n setTimeout(hideNavigationMenuIfPossible, 3000);\n\n}", "title": "" }, { "docid": "e03accace64a8253b0be24428e21ddbf", "score": "0.6671277", "text": "function collectScroll(player, scroll) {\n\t\t\t// Plays scroll sound effect\n \tthis.scrollSound = this.add.audio('pickUpScroll');\n \tthis.scrollSound.play();\t\t\t\n\t\t\tscroll.kill(); // kills scroll\n\t\t\tdash += 60; // adds to the dash meter\n\t\t}", "title": "" }, { "docid": "df08a47d58d4defe1196204655762c59", "score": "0.66617733", "text": "function ScrollPosition() { }", "title": "" } ]
fc80ca194db4cb9c787c37ef445cb4c3
evalInSandbox(fun[, globalArg, thisArg, argsArray]) Evaluates the given function in a sandbox.
[ { "docid": "97867ef8e3b7981097b30d759e565507", "score": "0.8684863", "text": "function evalInSandbox(fun, globalArg, thisArg, argsArray) {\n if(!(fun instanceof Function)) error(\"No Function Object\", (new Error()).fileName, (new Error()).lineNumber);\n\n var secureFun = preDecompile(fun, globalArg);\n return secureFun.apply(thisArg, argsArray);\n }", "title": "" } ]
[ { "docid": "4111b149c99476545b55baa71fab9a1b", "score": "0.822012", "text": "function bindInSandbox(fun, globalArg, thisArg, argsArray) {\n if(!(fun instanceof Function)) error(\"No Function Object\", (new Error()).fileName, (new Error()).lineNumber);\n\n var string = \"(\" + fun.toString() + \")\"; \n var sandbox = globalArg;\n var secureFun = eval(\"(function() { with(sandbox) { return \" + string + \" }})();\");\n\n return secureFun.bind(thisArg);\n }", "title": "" }, { "docid": "f5b2c1cbe55dca3e65e680958357bd64", "score": "0.73750657", "text": "function evalNewInSandbox(fun, globalArg, thisArg, argsArray) {\n if(!(fun instanceof Function)) error(\"No Function Object\", (new Error()).fileName, (new Error()).lineNumber);\n\n var secureFun = preDecompile(fun, globalArg);\n var newObj = Object.create(secureFun.prototype);\n var val = secureFun.apply(newObj, argsArray);\n\n return (val instanceof Object) ? val : newObj;\n }", "title": "" }, { "docid": "4c8d5c85e67831dcff5b86161e9e1318", "score": "0.7370826", "text": "function evalFunction(fun, globalArg, thisArg, argsArray) {\n globalArg = (globalArg!=undefined) ? globalArg : new Object();\n thisArg = (thisArg!=undefined) ? thisArg : globalArg;\n argsArray = (argsArray!=undefined) ? argsArray : new Array();\n\n if(!_.Config.decompile) {\n with(globalArg) { return fun.apply(thisArg, argsArray); }\n } else if(!_.Config.membrane) {\n return evalInSandbox(fun, globalArg, thisArg, argsArray);\n } else {\n var sandboxGlobalArg = wrap(globalArg, globalArg);\n var sandboxThisArg = wrap(thisArg, {});\n var sandboxArgsArray = wrap(argsArray, {});\n\n return evalInSandbox(fun, sandboxGlobalArg, sandboxThisArg, sandboxArgsArray);\n }\n }", "title": "" }, { "docid": "397455883231bd33e506612818573746", "score": "0.6431695", "text": "function bindFunction(fun, globalArg, thisArg, argsArray) {\n globalArg = (globalArg!=undefined) ? globalArg : new Object();\n thisArg = (thisArg!=undefined) ? thisArg : globalArg;\n argsArray = (argsArray!=undefined) ? argsArray : new Array();\n\n if(!_.Config.decompile) {\n return fun; \n } else if(!_.Config.membrane) {\n return bindInSandbox(fun, globalArg, thisArg, argsArray);\n } else {\n var sandboxGlobalArg = wrap(globalArg, globalArg);\n var sandboxThisArg = wrap(thisArg, {});\n var sandboxArgsArray = wrap(argsArray, {});\n\n return bindInSandbox(fun, sandboxGlobalArg, sandboxThisArg, sandboxArgsArray);\n }\n }", "title": "" }, { "docid": "8c8ea5d5bd43da851362de21cb13f358", "score": "0.6424452", "text": "function evalNew(fun, globalArg, thisArg, argsArray) {\n globalArg = (globalArg!=undefined) ? globalArg : new Object();\n thisArg = (thisArg!=undefined) ? thisArg : globalArg;\n argsArray = (argsArray!=undefined) ? argsArray : new Array();\n\n if(!_.Config.decompile) {\n with(globalArg) { return fun.apply(thisArg, argsArray); }\n } else if(!_.Config.membrane) {\n return evalNewInSandbox(fun, globalArg, thisArg, argsArray);\n } else {\n var sandboxGlobalArg = wrap(globalArg, globalArg);\n var sandboxThisArg = wrap(thisArg, {});\n var sandboxArgsArray = wrap(argsArray, {});\n\n return evalNewInSandbox(fun, sandboxGlobalArg, sandboxThisArg, sandboxArgsArray);\n }\n }", "title": "" }, { "docid": "4f01616a486672ecd59e455012319a10", "score": "0.6324065", "text": "function sandboxRun(fn) {\n \n 'use strict';\n \n var keys = {};\n \n for (var k in global) {\n keys[k] = k;\n }\n \n var result = fn();\n \n for (var k in global) {\n if (!(k in keys)) {\n delete global[k];\n }\n }\n \n return result;\n }", "title": "" }, { "docid": "ffdd02a60115fd13196e2166bb3401dc", "score": "0.5779296", "text": "function decompile(fun, globalArg) {\n var string = \"(\" + fun.toString() + \")\"; \n var sandbox = globalArg;\n var secureFun = eval(\"(function() { with(sandbox) { return \" + string + \" }})();\");\n return secureFun;\n }", "title": "" }, { "docid": "de30b080457cf284110456dab90c7811", "score": "0.57745206", "text": "function b(z) {\n switch (z) {\n default:\n primarySandbox = newGlobal()\n }\n return function(f, code) {\n try {\n evalcx(code, primarySandbox)\n } catch (e) {}\n }\n}", "title": "" }, { "docid": "14a5d5ad8eb2a9f2de3231df0dc38eaa", "score": "0.5617167", "text": "function sandbox(code) {\n code = \"with (sandbox) {\" + code + \"}\";\n const fn = new Function(\"sandbox\", code);\n \n return function (sandbox) {\n const sandboxProxy = new Proxy(sandbox, {\n has(target, key) {\n return true;\n },\n get(target, key) {\n if (key === Symbol.unscopables) return undefined;\n return target[key];\n },\n });\n return fn(sandboxProxy);\n };\n }", "title": "" }, { "docid": "cb3275e4c63f73463ccba136643fb2b0", "score": "0.54423296", "text": "function evil(sandbox, code) {\n let context = vm.createContext(sandbox);\n let script = new vm.Script(code);\n return script.runInContext(context);\n}", "title": "" }, { "docid": "ead6b9624f3cb339d2d979f30f31f0e6", "score": "0.53593004", "text": "function globalEval(x){eval.call(null,x)}", "title": "" }, { "docid": "dfa70f12b54ab26a76358a75c4c2488a", "score": "0.53240716", "text": "function runFunction(func, args){\n func(args)\n}", "title": "" }, { "docid": "3f2d3b81e324d17a603d2decb15195a4", "score": "0.53196186", "text": "function globalEval(script, args) {\n var names = [];\n var values = [];\n if (args) {\n for (var i = 0; i < args.length; i++) {\n names.push(args[i][0]);\n values.push(args[i][1]);\n }\n }\n if (isIdentifier(script)) {\n return window[script].apply(this, values);\n } else {\n var outerfunc = window[\"eval\"].call(\n window,\n '(function (' + names.join(\", \") + ') {' + script + '})'\n );\n return outerfunc.apply(this, values);\n }\n }", "title": "" }, { "docid": "dc17fc567e39ca7192f0bbe67c109fc3", "score": "0.52600974", "text": "function runInThisContext(src/*, filename*/, options) {\n \n var code = src;\n \n \n // De-Compiling to string defeating purpose ?-\n // if (typeof src == 'function') {\n // code = src.toString();\n // code = code.substring(code.indexOf('{') + 1, code.lastIndexOf('}') - 1);\n // }\n\n return sandboxRun(function () {\n // if('function' === typeof code){\n\t // \t return code();\n\t // }\t\n if('function' === typeof code){\n code = code.toString();\n code = code.substring(code.indexOf('{') + 1, code.lastIndexOf('}') - 1);\n\t }\t \n return eval(code);\n });\n }", "title": "" }, { "docid": "d976162f091051a25aa2239613778883", "score": "0.52567863", "text": "function evil(sandbox, code) {\n let context = vm.createContext(sandbox);\n let script = new vm.Script(code);\n try {\n return script.runInContext(context);\n }\n catch(e) {\n return null;\n }\n}", "title": "" }, { "docid": "da701c2d4a6c6ea0fdbe32e04e1a381a", "score": "0.5237395", "text": "function run(fun) {\n fun()\n}", "title": "" }, { "docid": "da701c2d4a6c6ea0fdbe32e04e1a381a", "score": "0.5237395", "text": "function run(fun) {\n fun()\n}", "title": "" }, { "docid": "da701c2d4a6c6ea0fdbe32e04e1a381a", "score": "0.5237395", "text": "function run(fun) {\n fun()\n}", "title": "" }, { "docid": "da701c2d4a6c6ea0fdbe32e04e1a381a", "score": "0.5237395", "text": "function run(fun) {\n fun()\n}", "title": "" }, { "docid": "da701c2d4a6c6ea0fdbe32e04e1a381a", "score": "0.5237395", "text": "function run(fun) {\n fun()\n}", "title": "" }, { "docid": "86e4a0194169cd1ada7e47fd9bc05360", "score": "0.5216425", "text": "function run(fun){\n fun()\n}", "title": "" }, { "docid": "86e4a0194169cd1ada7e47fd9bc05360", "score": "0.5216425", "text": "function run(fun){\n fun()\n}", "title": "" }, { "docid": "86e4a0194169cd1ada7e47fd9bc05360", "score": "0.5216425", "text": "function run(fun){\n fun()\n}", "title": "" }, { "docid": "86e4a0194169cd1ada7e47fd9bc05360", "score": "0.5216425", "text": "function run(fun){\n fun()\n}", "title": "" }, { "docid": "86e4a0194169cd1ada7e47fd9bc05360", "score": "0.5216425", "text": "function run(fun){\n fun()\n}", "title": "" }, { "docid": "6b51bc6e90ab29a9b6fd88b88ba20d5e", "score": "0.5189303", "text": "function withSandbox (config, fn) {\n return () => {\n const S = {\n mocks: {},\n verify () {\n return this.sandbox.verify();\n },\n };\n beforeEach(function beforeEach () {\n S.sandbox = sinon.createSandbox();\n S.mocks[SANDBOX] = S.sandbox;\n for (let [key, value] of _.toPairs(config.mocks)) {\n S.mocks[key] = S.sandbox.mock(value);\n }\n });\n afterEach(function afterEach () {\n S.sandbox.restore();\n for (let k of _.keys(S.mocks)) {\n delete S.mocks[k];\n }\n delete S.mocks[SANDBOX];\n });\n fn(S);\n };\n}", "title": "" }, { "docid": "1147556701d76c2424e0b3b2fe716b3e", "score": "0.51777077", "text": "function globalEval() {\n return eval(arguments[0]);\n}", "title": "" }, { "docid": "aa760ef1038d852d251635150761b73a", "score": "0.51547647", "text": "function withSandbox (config, fn) {\n return () => {\n let S = {\n mocks: {},\n verify: function() {\n return this.sandbox.verify();\n }\n };\n beforeEach(() => {\n S.sandbox = sinon.sandbox.create();\n S.mocks[SANDBOX] = S.sandbox;\n for (let [key, value] of _.pairs(config.mocks)) {\n S.mocks[key] = S.sandbox.mock(value);\n }\n });\n afterEach(() => {\n S.sandbox.restore();\n for (let k of _.keys(S.mocks)) {\n delete S.mocks[k];\n }\n delete S.mocks[SANDBOX];\n });\n fn(S);\n };\n}", "title": "" }, { "docid": "e373fec01cc3d7a9f4a27d2a6a74aeb7", "score": "0.51262426", "text": "function getSandboxedFunction(myMixId, mix, func) {\n\t\tvar result = function () {\n\t\t\tvar mixInstances = nonenum(this, '__multiparentInstances__', []);\n\t\t\tvar mixInstance = mixInstances[myMixId];\n\t\t\tif (mixInstance == null) {\n\t\t\t\tif (typeof mix === 'function') {\n\t\t\t\t\tmixInstance = new mix();\n\t\t\t\t} else {\n\t\t\t\t\tmixInstance = create(mix);\n\t\t\t\t}\n\t\t\t\t// could add a nonenum pointer to __this__ or something if we wanted to\n\t\t\t\t// allow escape from the sandbox.\n\t\t\t\tmixInstances[myMixId] = mixInstance;\n\t\t\t}\n\t\t\treturn func.apply(mixInstance, arguments);\n\t\t};\n\t\tnonenum(result, '__original__', func);\n\t\tnonenum(result, '__source__', mix);\n\t\treturn result;\n\t}", "title": "" }, { "docid": "91615a806a0140370f7f2b0c076330d3", "score": "0.5042588", "text": "function run (fun) {\n fun()\n}", "title": "" }, { "docid": "dd0a7f1d778ab24f91f47f924b866f51", "score": "0.49974406", "text": "function isolateEval(functionString, functionCache, object) {\n if (!functionCache) return new Function(functionString); // Check for cache hit, eval if missing and return cached function\n\n if (functionCache[functionString] == null) {\n functionCache[functionString] = new Function(functionString);\n } // Set the object\n\n\n return functionCache[functionString].bind(object);\n} // Copyright (c) 2008, Fair Oaks Labs, Inc.", "title": "" }, { "docid": "d8581ca7793376ea65acfe31d091243e", "score": "0.49933723", "text": "run(){\n let sandbox = this;\n return new Promise(function (resolve, reject) {\n sandbox.prepare(function () {\n sandbox.execute(resolve);\n })\n })\n }", "title": "" }, { "docid": "95a7adec0fe75e0c4ac6ec7d8338c325", "score": "0.49410892", "text": "function run(func) {\n func()\n}", "title": "" }, { "docid": "fdf8235a675b2b6f00959890c045ccc7", "score": "0.49137148", "text": "function isolateEval(functionString, functionCache, object) {\n if (!functionCache)\n return new Function(functionString);\n // Check for cache hit, eval if missing and return cached function\n if (functionCache[functionString] == null) {\n functionCache[functionString] = new Function(functionString);\n }\n // Set the object\n return functionCache[functionString].bind(object);\n}", "title": "" }, { "docid": "7685494cdce9449b392923c3e3c6e5d4", "score": "0.49049944", "text": "function isolateEval(functionString, functionCache, object) {\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n if (!functionCache)\n return new Function(functionString);\n // Check for cache hit, eval if missing and return cached function\n if (functionCache[functionString] == null) {\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n functionCache[functionString] = new Function(functionString);\n }\n // Set the object\n return functionCache[functionString].bind(object);\n}", "title": "" }, { "docid": "ba4d9be19005c10f40f6bed64e068f6d", "score": "0.48845404", "text": "function createSandbox(appName) {\n var context = {\n module: {\n exports: {}\n },\n console: createConsoleModule(appName),\n setInterval: setInterval,\n setTimeout: setTimeout,\n util: util,\n process: {\n stdin: process.stdin,\n stdout: process.stdout,\n stderr: process.stderr\n },\n require: wrappedRequire,\n __filename: appName.endsWith('.js') ? appName : appName + '.js',\n __dirname: path.resolve(path.dirname(appName))\n };\n context.global = context;\n context.exports = context.module.exports;\n return vm.createContext(context);\n}", "title": "" }, { "docid": "242a4e465ad4d11d9268e2642bb699ee", "score": "0.4879627", "text": "function running(fun) {\n fun();\n}", "title": "" }, { "docid": "782008e3011f2ec9f6404e71be6f3bc9", "score": "0.48720565", "text": "function run(func) {\n func();\n}", "title": "" }, { "docid": "387c1348b2ac4936e6e369ffc717f7b0", "score": "0.48717976", "text": "function evalInContext(js, ctx) {\n return function() { return eval(js); }.call(ctx);\n}", "title": "" }, { "docid": "2bdb10c5716c4a175a57b4d7db4e3a1b", "score": "0.48284608", "text": "function exec(func, arg){\n func(arg);\n}", "title": "" }, { "docid": "73992bd448fc624efa5bb37b56f7b79a", "score": "0.47414884", "text": "function callFunction(fun)\n{\n\tfun();\n}", "title": "" }, { "docid": "87fca9a449311051b2578b1f813d1622", "score": "0.4734631", "text": "function example(fun){\n\n fun();\n\n}", "title": "" }, { "docid": "768ea6caf7c6dd6ea53eb9b0a2ac5bc0", "score": "0.47167596", "text": "function runInNewContext(src, context/*, filename*/, options) {\n\n context = context || {};\n \n // Object.create shim to shadow out the main global\n function F(){};\n F.prototype = (typeof Window !== 'undefined' && Window.prototype) || global;\n context.global = new F;\n \n // This statement resets vm references in the new sandbox:\n // + fixes browser reference if vm is not passed in (so we don't provide it)\n // + fixes node.js reference if vm is passed in (make it available to new global)\n context.global.vm = context.vm = context.vm;\n \n return runInContext.apply(context.global, [src, context/*, filename*/]);\n }", "title": "" }, { "docid": "7d45fd951792b405c23df146a1f24559", "score": "0.46981874", "text": "function evalmyfunctions(name, args, modifs) {\n var tt = myfunctions[name];\n if (tt === undefined) {\n return nada;\n }\n\n var set = [],\n i;\n\n for (i = 0; i < tt.arglist.length; i++) {\n set[i] = evaluate(args[i]);\n }\n for (i = 0; i < tt.arglist.length; i++) {\n namespace.newvar(tt.arglist[i].name);\n namespace.setvar(tt.arglist[i].name, set[i]);\n }\n namespace.pushVstack(\"*\");\n var erg = evaluate(tt.body);\n namespace.cleanVstack();\n for (i = 0; i < tt.arglist.length; i++) {\n namespace.removevar(tt.arglist[i].name);\n }\n return erg;\n // return tt(args,modifs);\n}", "title": "" }, { "docid": "27413e13e63a4023231154457cb0d25a", "score": "0.4684933", "text": "function runInContext(src, context/*, filename*/, options) {\n \n var code = \"'use strict';\", key;\n \n // before - set local scope vars from each context property\n for ( key in context) {\n if (context.hasOwnProperty(key)) {\n code += 'var ' + key + ' = context[\\'' + key + '\\'];\\n';\n }\n }\n \n typeof src === 'string' || (src = '(' + src.toString() + '())');\n \n code += src + ';\\n';\n \n // after - scoop changes back into context\n for ( key in context) {\n if (context.hasOwnProperty(key)) {\n code += 'context[\\'' + key + '\\'] = ' + key + ';\\n';\n }\n }\n \n return sandboxRun(function () {\n Function('context', code).call(null, context);\n return context;\n });\n }", "title": "" }, { "docid": "d871270dfb82d415efb8a8bfcfae50cc", "score": "0.46767688", "text": "function callFunction(fun){\n fun();\n}", "title": "" }, { "docid": "32d94374b6078449396f281291fb2f0e", "score": "0.46739128", "text": "function Sandbox(){\n\tvar args = Array.prototype.slice.call(arguments),\n\t\tcallback = args.pop(),\n\t\tmodules = (args[0] && typeof args[0] === \"string\") ? args : args[0],\n\t\ti;\n\n\t// garantindo sempre uma instancia\n\tif(!this instanceof Sandbox){\n\t\treturn new Sandbox(modules, callback);\n\t}\n\n\t// se for vazio ou '*' carrega todos\n\tif(!modules || modules === \"*\"){\n\t\tmodules = [];\n\t\tfor(m in Sandbox.modules){\n\t\t\tif(Sandbox.modules.hasOwnProperty(m)){\n\t\t\t\tmodules.push(m);\n\t\t\t}\n\t\t}\n\t}\n\n\t// executa os módulos\n\tfor(i = 0; i < modules.length; i++){\n\t\ttry{\n\t\t\tif(Sandbox.modules[modules[i]]){\n\t\t\t\tSandbox.modules[modules[i]](this);\n\t\t\t}else{\n\t\t\t\tthrow {\n\t\t\t\t\tname: \"Erro Módulo\",\n\t\t\t\t\tmessage: \"O módulo \" + modules[i] + \" não exsite.\"\n\t\t\t\t}\n\t\t\t}\n\t\t}catch(err){\n\t\t\tconsole.log(err);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "76b0366c20994621770f3ece7df2040f", "score": "0.4672317", "text": "function evalJavaScript(__scope, __code) {\n\t\t// make sure globals aren't available in the eval call\n\t\tlet Kernel = undefined;\n\t\tlet kernel = undefined;\n\t\tlet kernelOptions = undefined;\n\t\tlet evalJavaScript = undefined;\n\t\t// sandbox script\n\t\treturn (function(){\n\t\t\treturn eval(__code);\n\t\t}).bind({})();\n\t}", "title": "" }, { "docid": "0be721296e7e73a6bb9f131b43a63f9d", "score": "0.46661866", "text": "function execute_on_document(document, func, passed_param_dict) {\n var t=document.querySelector(\"body\")||document.querySelector(\"html\")||document.documentElement;\n if(!t)throw new Error(\"Failed to execute script because there seems to be no body, html or document at all\");\n var o=document.createElement(\"script\");\n passed_param_dict = passed_param_dict || {};\n o.innerText=\"(\"+func.toString()+\")(JSON.parse('\" + JSON.stringify(passed_param_dict) + \"'));\";\n t.appendChild(o);\n}", "title": "" }, { "docid": "913033782d118a4e561f9c47c08b181d", "score": "0.4614706", "text": "function main(fn) {\n fn();\n}", "title": "" }, { "docid": "212bda0ec365c3594f9ca8ef1541b0f0", "score": "0.46107978", "text": "static _canUseSandbox (sandbox) {\n try {\n sandbox.off();\n }\n catch (e) {\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "e17740e5eaab31834944d1e4225ce8a9", "score": "0.46009803", "text": "function evalInvoc(ast, env) {\r\n // output string\r\n var s = \"\";\r\n\r\n // no invocation to evaluate\r\n if(!ast) return s;\r\n\r\n // evaluate function's name\r\n var functName = evalWML(ast.itext, env);\r\n\r\n // evaluate function's arguments\r\n var currNode = ast.targs;\r\n var args = []\r\n var arg;\r\n while(currNode) {\r\n // we must handle nested definitions, but only want to evaluate the necessary body in if/ifeq functions\r\n // the following switch takes care of this:\r\n // it stores the body for further evaluation or evaluates it immediatly depending on the function type\r\n switch(functName) {\r\n case \"#if\":\r\n case \"#ifeq\":\r\n args.push(currNode)\r\n break;\r\n case \"#expr\":\r\n default:\r\n args.push(evalWML(currNode, env))\r\n }\r\n currNode = currNode.next\r\n }\r\n\r\n // will contain the function to be called\r\n var funct;\r\n\r\n // check for #special cases\r\n switch(functName) {\r\n case \"#expr\":\r\n return eval(args[0]);\r\n case \"#if\":\r\n var condition = evalWML(args[0], env);\r\n // make sure evaluation of expression didn't return a non-bound parameter\r\n // ex: {:iftest2|x|{{#if|{{{x}}}|A|B}}:}{{iftest2|}} --> because no argumet bound to x it returns {{{x}}}\r\n return s += (condition && !condition.match(/{{{/)) ? evalWML(args[1], env) : evalWML(args[2], env);\r\n case \"#ifeq\":\r\n return s+= (evalWML(args[0], env) == evalWML(args[1], env)) ? evalWML(args[2], env) : evalWML(args[3], env);\r\n default:\r\n // test for anonymous function\r\n funct = (functName.match(/{\\\"/)) ? unstringify(functName) : lookup(functName, env);\r\n }\r\n \r\n // undefined function\r\n if (!funct) {\r\n var argument = (args.length > 0) ? \"|\"+args.join(\"|\") : \"\";\r\n return s += \"{{\"+functName+argument+\"}}\";\r\n }\r\n\r\n // create new env (static)\r\n var newEnv = createEnv(funct.env);\r\n // if we wanted dynamic scoping, we would take current called env\r\n //var newEnv = createEnv(env);\r\n\r\n // bind arguments to parameters\r\n for(var i = 0; i < funct.params.length; i++) {\r\n tmpParam = funct.params[i];\r\n newEnv.bindings[tmpParam] = args[i];\r\n }\r\n\r\n s += evalWML(funct.body, newEnv);\r\n\r\n return s;\r\n}", "title": "" }, { "docid": "5863693790ee11e2dea7f1e0fd3be0d1", "score": "0.45732632", "text": "function execOtherFunction(f){\n testFunction();\n \n}", "title": "" }, { "docid": "b49626e6214f13c2576e81b1c86097b0", "score": "0.45634356", "text": "function newTrustedFunctionForDev(...args) {\n if (typeof ngDevMode === 'undefined') {\n throw new Error('newTrustedFunctionForDev should never be called in production');\n }\n if (!_global.trustedTypes) {\n // In environments that don't support Trusted Types, fall back to the most\n // straightforward implementation:\n return new Function(...args);\n }\n // Chrome currently does not support passing TrustedScript to the Function\n // constructor. The following implements the workaround proposed on the page\n // below, where the Chromium bug is also referenced:\n // https://github.com/w3c/webappsec-trusted-types/wiki/Trusted-Types-for-function-constructor\n const fnArgs = args.slice(0, -1).join(',');\n const fnBody = args.pop().toString();\n const body = `(function anonymous(${fnArgs}\n) { ${fnBody}\n})`;\n // Using eval directly confuses the compiler and prevents this module from\n // being stripped out of JS binaries even if not used. The global['eval']\n // indirection fixes that.\n const fn = _global['eval'](trustedScriptFromString(body));\n // To completely mimic the behavior of calling \"new Function\", two more\n // things need to happen:\n // 1. Stringifying the resulting function should return its source code\n fn.toString = () => body;\n // 2. When calling the resulting function, `this` should refer to `global`\n return fn.bind(_global);\n // When Trusted Types support in Function constructors is widely available,\n // the implementation of this function can be simplified to:\n // return new Function(...args.map(a => trustedScriptFromString(a)));\n}", "title": "" }, { "docid": "99120c12e531a9aab20240a7a9ee4a8e", "score": "0.4555212", "text": "function callFunction(fun){\n\tfun();\n}", "title": "" }, { "docid": "819d106b5aaee6902f6942e4194216d5", "score": "0.4552937", "text": "function anotherFunction () {\n\ttestContext();\n}", "title": "" }, { "docid": "fb7324a8dbb5484a1de48a6a0453f6d4", "score": "0.45464775", "text": "function sc_jsCall(o, fun) {\n var args = new Array();\n for (var i = 2; i < arguments.length; i++)\n\targs[i-2] = arguments[i];\n return fun.apply(o, args);\n}", "title": "" }, { "docid": "c409ae5d5e95e7a5f762cfa2bf5dbf86", "score": "0.45347553", "text": "function runInContext(code, filename, context) {\n const script = new vm_1.Script(code, { filename });\n if (context === undefined || context === global) {\n return script.runInThisContext();\n }\n else {\n return script.runInContext(context);\n }\n}", "title": "" }, { "docid": "fdbe084ebd1f2d883083be247806ff2c", "score": "0.45284212", "text": "function sandboxMain() {\n\n var req = \"test\";\n var path = \"path\";\n \n var result = searchKinoprofi(req, \"memento\");\n console.debug(result);\n }", "title": "" }, { "docid": "3f8495b7cdd4d442d09c39f63a947cf8", "score": "0.45280004", "text": "function run(argOne, argTwo) {\n runFunction(argOne, argTwo);\n}", "title": "" }, { "docid": "79deffda6c312a35599e1dfe7d064dc5", "score": "0.45121312", "text": "function setFunctionArgs(fun, arg){\n\treturn function(){fun(arg);}\n}", "title": "" }, { "docid": "bbafa736814680b6e9a3474a366a9366", "score": "0.4509835", "text": "function invoke(inst, list, argv, event, fin) {\n // All invocations cost some amount just for running\n if (!ok(inst, inst.options.invokeTransaction)) return exit(inst, list, fin);\n var name = _getFnName(list);\n var args = _getFnArgs(list);\n var library = inst.library;\n var lookup;\n\n // Prepare the arguments and context\n _unquoteArgs(args);\n _valuefyArgs(args, library);\n var ctx = {\n id: inst.counter,\n seed: inst.seednum,\n store: inst.storage,\n name: name,\n list: list,\n args: args,\n argv: argv,\n event: event,\n cb: fin\n };\n\n // Function (or global fallback)\n lookup = library.lookupFunction(name);\n if (!_isPresent(lookup)) {\n var missing = inst.options.functionMissingName;\n var fallback = library.lookupFunction(missing);\n if (fallback) {\n lookup = fallback;\n name = missing;\n }\n }\n if (lookup) {\n // The library may define function prices\n var price = library.lookupPrice(name);\n if (_isPresent(price)) {\n if (!ok(inst, -price)) {\n return exit(inst, list, fin);\n }\n }\n // Type checking\n if (inst.options.doRuntimeTypeCheck) {\n var typeError = Types.runtimeCheck(inst, name, library, args);\n if (typeError) return fin(_wrapError(typeError, inst, list), null);\n }\n if (library.isImpureFunction(name)) {\n if (!inst.options.doAllowImpureFunctions) {\n return fin(_wrapError(_impurityError(inst), inst, list), null);\n }\n if (inst.options.doWarnOnImpureFunctions) {\n Console.printWarning(inst, 'Function `' + name + '` is labeled impure');\n }\n }\n var invokeArgs = args.concat(passthrough(fin));\n return lookup.apply(ctx, invokeArgs);\n }\n\n // Type conversion\n lookup = library.lookupTypeCaster(name);\n if (lookup) {\n return fin(null, lookup.apply(ctx, args));\n }\n\n // Constant\n lookup = library.lookupConstant(name);\n if (_isPresent(lookup)) {\n if (args.length < 1) return fin(null, lookup);\n list[RUNIQ_INDEX_OF_FUNCTION_NAME] = lookup;\n return fin(null, list);\n }\n\n // Without any args present, return the string\n if (args.length < 1) return fin(null, name);\n\n // If no other option, just return the entire list\n return fin(null, list);\n}", "title": "" }, { "docid": "0d8dd784b2fc0926683891fe3f5cb9b0", "score": "0.4473825", "text": "function SomeRunner(afunction){ console.log(2+2); afunction();}", "title": "" }, { "docid": "cd3ab5a56276f63552c7879753baaa62", "score": "0.4466535", "text": "function newGeckoSandbox(n)\n{\n var t = (typeof n == \"number\") ? n : 1;\n var s = Components.utils.Sandbox(\"http://x\" + t + \".example.com/\");\n\n // Allow the sandbox to do a few things\n s.newGeckoSandbox = newGeckoSandbox;\n s.evalInSandbox = function(str, sbx) {\n return Components.utils.evalInSandbox(str, sbx);\n };\n s.print = function(str) { print(str); };\n\n return s;\n}", "title": "" }, { "docid": "cd3ab5a56276f63552c7879753baaa62", "score": "0.4466535", "text": "function newGeckoSandbox(n)\n{\n var t = (typeof n == \"number\") ? n : 1;\n var s = Components.utils.Sandbox(\"http://x\" + t + \".example.com/\");\n\n // Allow the sandbox to do a few things\n s.newGeckoSandbox = newGeckoSandbox;\n s.evalInSandbox = function(str, sbx) {\n return Components.utils.evalInSandbox(str, sbx);\n };\n s.print = function(str) { print(str); };\n\n return s;\n}", "title": "" }, { "docid": "539bf093b77397e97e648b843a7c24a3", "score": "0.4464138", "text": "callGlobalFunction(name, ...args) {\n this.call(name, ...args)\n }", "title": "" }, { "docid": "ea319cf862df342e594e7731430cd319", "score": "0.44618994", "text": "static createSandbox(state) {\n return new Sandbox(state);\n }", "title": "" }, { "docid": "67b0f6fc25559822d688775ed1f87b8e", "score": "0.4444344", "text": "function fun() {\n print(\"foo\");\n}", "title": "" }, { "docid": "4434216803de214589f7e9308fe59d90", "score": "0.44242162", "text": "function executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (isObject(result)) return result;\n return self;\n}", "title": "" }, { "docid": "4434216803de214589f7e9308fe59d90", "score": "0.44242162", "text": "function executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (isObject(result)) return result;\n return self;\n}", "title": "" }, { "docid": "4434216803de214589f7e9308fe59d90", "score": "0.44242162", "text": "function executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (isObject(result)) return result;\n return self;\n}", "title": "" }, { "docid": "4434216803de214589f7e9308fe59d90", "score": "0.44242162", "text": "function executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (isObject(result)) return result;\n return self;\n}", "title": "" }, { "docid": "4434216803de214589f7e9308fe59d90", "score": "0.44242162", "text": "function executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (isObject(result)) return result;\n return self;\n}", "title": "" }, { "docid": "4434216803de214589f7e9308fe59d90", "score": "0.44242162", "text": "function executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (isObject(result)) return result;\n return self;\n}", "title": "" }, { "docid": "4434216803de214589f7e9308fe59d90", "score": "0.44242162", "text": "function executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (isObject(result)) return result;\n return self;\n}", "title": "" }, { "docid": "4434216803de214589f7e9308fe59d90", "score": "0.44242162", "text": "function executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (isObject(result)) return result;\n return self;\n}", "title": "" }, { "docid": "4434216803de214589f7e9308fe59d90", "score": "0.44242162", "text": "function executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (isObject(result)) return result;\n return self;\n}", "title": "" }, { "docid": "a00053f698c39148ed650a3a33c59125", "score": "0.44199488", "text": "function run_func(f, sandbox, action, others, resolve, reject, session, service) {\n if (action === \"kernel\") {\n try {\n f(others.IN, _.merge({}, session.config, service.config));\n } catch(e) {\n log.warn(\"kernel exception\", e, session);\n sandbox.sendERR(e);\n reject(e);\n }\n resolve(\"kernel\");\n return;\n }\n\n else if (action === \"after_resume\") {\n try {\n f(_.merge({}, session.config, service.config));\n } catch(e) {\n log.warn(\"after_resume exception\", e, session);\n sandbox.sendERR(e);\n reject(e);\n }\n resolve(\"after_resume\");\n return;\n }\n\n else {\n try {\n session.is_status_stable = false;\n f(_.merge({}, session.config, service.config));\n } catch(e) {\n log.warn(action + \" exception\", e, session);\n sandbox.fail(e);\n }\n return;\n } \n}", "title": "" }, { "docid": "1b3f666042f8bb54850849d40601702c", "score": "0.4410262", "text": "function evalCall(clos, actuals, loc, env) {\n if (clos.type === 'closure' || clos.type === 'builtin') {\n try {\n // the current evaluate instance is \"this\"\n return Value.functionFromValue(clos).call(this, actuals, env);\n } catch (e) {\n if (e instanceof Value.ControlFlowException) {\n throw errorInfo(e.message, e.loc);\n }\n throw errorInfo(e.message || e.toString(), loc);\n }\n }\n throw errorInfo('trying to call non-function ' + clos.toString(), loc);\n }", "title": "" }, { "docid": "f2c3bcf982c21fe91f701e39f01e2943", "score": "0.44095603", "text": "function $eval(src, _globals, _locals){\n\n var current_frame = $B.frames_stack[$B.frames_stack.length-1]\n if(current_frame===undefined){alert('current frame undef pour '+src.substr(0,30))}\n var current_locals_id = current_frame[0].replace(/\\./,'_'),\n current_globals_id = current_frame[2].replace(/\\./,'_')\n\n var is_exec = arguments[3]=='exec',leave = false\n\n if(src.__class__===$B.$CodeObjectDict){\n src = src.source\n }\n \n // code will be run in a specific block\n var globals_id = '$exec_'+$B.UUID(),\n locals_id,\n parent_block_id\n if(_locals===_globals || _locals===undefined){\n locals_id = globals_id\n }else{\n locals_id = '$exec_'+$B.UUID()\n }\n // Initialise the object for block namespaces\n eval('var $locals_'+globals_id+' = {}')\n eval('var $locals_'+locals_id+' = {}')\n \n // Initialise block globals\n if(_globals===undefined){\n for(var attr in current_frame[3]){\n eval('$locals_'+globals_id+'[\"'+attr+\n '\"] = current_frame[3][\"'+attr+'\"]')\n }\n parent_block_id = current_globals_id\n eval('var $locals_'+current_globals_id+'=current_frame[3]')\n }else{\n var items = _b_.dict.$dict.items(_globals), item\n while(1){\n try{\n var item = next(items)\n eval('$locals_'+globals_id+'[\"'+item[0]+'\"] = item[1]')\n }catch(err){\n break\n }\n }\n parent_block_id = '__builtins__'\n }\n\n // Initialise block locals\n if(_locals===undefined){\n if(_globals!==undefined){\n eval('var $locals_'+locals_id+' = $locals_'+globals_id) \n }else{\n for(var attr in current_frame[1]){\n eval('$locals_'+locals_id+'[\"'+attr+\n '\"] = current_frame[1][\"'+attr+'\"]')\n }\n }\n }else{\n var items = _b_.dict.$dict.items(_locals), item\n while(1){\n try{\n var item = next(items)\n eval('$locals_'+locals_id+'[\"'+item[0]+'\"] = item[1]')\n }catch(err){\n break\n }\n }\n }\n \n var root = $B.py2js(src, globals_id, locals_id, parent_block_id)\n\n try{\n // If the Python function is eval(), not exec(), check that the source\n // is an expression\n if(!is_exec){\n // last instruction is 'leave frame' ; we must remove it, \n // otherwise eval() would return None\n root.children.pop()\n leave = true\n var instr = root.children[root.children.length-1]\n var type = instr.context.tree[0].type\n if (!('expr' == type || 'list_or_tuple' == type)) {\n //console.log('not expression '+instr.context.tree[0])\n //$B.line_info=\"1,\"+module_name\n throw _b_.SyntaxError(\"eval() argument must be an expression\")\n }\n }\n\n var js = root.to_js()\n \n if ($B.async_enabled) js=$B.execution_object.source_conversion(js) \n //js=js.replace(\"@@\", \"\\'\", 'g')\n \n //console.log(module_id, local_id, $B.imported[module_id])\n var res = eval(js)\n var gns = eval('$locals_'+globals_id)\n\n // Update _locals with the namespace after execution\n if(_locals!==undefined){\n var lns = eval('$locals_'+locals_id)\n var setitem = getattr(_locals,'__setitem__')\n for(var attr in lns){setitem(attr, lns[attr])}\n }else{\n for(var attr in lns){current_frame[1][attr] = lns[attr]}\n }\n \n if(_globals!==undefined){\n // Update _globals with the namespace after execution\n var setitem = getattr(_globals,'__setitem__')\n for(var attr in gns){\n setitem(attr, gns[attr])\n }\n }else{\n for(var attr in gns){\n current_frame[3][attr] = gns[attr]\n }\n }\n \n // fixme: some extra variables are bleeding into locals...\n /* This also causes issues for unittests */\n if(res===undefined) return _b_.None\n return res\n }catch(err){\n //console.log('eval error\\n', err)\n //console.log(js)\n //console.log('globals ns', eval('$locals_'+globals_id),'local',\n // eval('$locals_'+locals_id))\n if(err.$py_error===undefined){throw $B.exception(err)}\n throw err\n }finally{\n if(leave){$B.leave_frame()}\n }\n}", "title": "" }, { "docid": "dc0c991e28ff6178dcc32cf1e8474077", "score": "0.44027406", "text": "function runFunction(source, argumentArray) {\n if (!_.isString(source))\n throw new Error('runFunction expected source ' +\n 'to be of type string, but was ' + source)\n\n if (!_.isArray(argumentArray))\n throw new Error('runFunction expected argumentArray ' +\n 'to be an array, but was ' + argumentArray)\n\n return parseFunction(source).apply(null, argumentArray)\n}", "title": "" }, { "docid": "6bebed6f3ac2ebccf23c1a4afbbd632c", "score": "0.43828988", "text": "function executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (isObject(result)) return result;\n return self;\n }", "title": "" }, { "docid": "6bebed6f3ac2ebccf23c1a4afbbd632c", "score": "0.43828988", "text": "function executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (isObject(result)) return result;\n return self;\n }", "title": "" }, { "docid": "6bebed6f3ac2ebccf23c1a4afbbd632c", "score": "0.43828988", "text": "function executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (isObject(result)) return result;\n return self;\n }", "title": "" }, { "docid": "6bebed6f3ac2ebccf23c1a4afbbd632c", "score": "0.43828988", "text": "function executeBound(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (isObject(result)) return result;\n return self;\n }", "title": "" }, { "docid": "8409a9b47c7c43fe02ff5ed42e9db0a8", "score": "0.43735397", "text": "function isolateEval(functionString) {\n // Contains the value we are going to set\n let value = null;\n // Eval the function\n eval('value = ' + functionString);\n return value;\n}", "title": "" }, { "docid": "61f4cee8d1461b023cbf914c80ccfa03", "score": "0.43734893", "text": "function runFunction(value, state) {\n return _runFunction(value, state);\n}", "title": "" }, { "docid": "10ed7cab59bbf1f248a259ae48e3b035", "score": "0.43606213", "text": "function funScope() {\n var x = \"hello\"; // even though I declared x with var (global), I declared it WITHIN a function\n // so therefore it's restricted to the functional scope.\n console.log(x);\n}", "title": "" }, { "docid": "1ce05c404a29dc9bd80d47ed62f6abbe", "score": "0.43426186", "text": "function newTrustedFunctionForDev() {\n if (typeof ngDevMode === 'undefined') {\n throw new Error('newTrustedFunctionForDev should never be called in production');\n }\n\n for (var _len26 = arguments.length, args = new Array(_len26), _key29 = 0; _key29 < _len26; _key29++) {\n args[_key29] = arguments[_key29];\n }\n\n if (!_global.trustedTypes) {\n // In environments that don't support Trusted Types, fall back to the most\n // straightforward implementation:\n return _construct(Function, args);\n } // Chrome currently does not support passing TrustedScript to the Function\n // constructor. The following implements the workaround proposed on the page\n // below, where the Chromium bug is also referenced:\n // https://github.com/w3c/webappsec-trusted-types/wiki/Trusted-Types-for-function-constructor\n\n\n var fnArgs = args.slice(0, -1).join(',');\n var fnBody = args.pop().toString();\n var body = \"(function anonymous(\".concat(fnArgs, \"\\n) { \").concat(fnBody, \"\\n})\"); // Using eval directly confuses the compiler and prevents this module from\n // being stripped out of JS binaries even if not used. The global['eval']\n // indirection fixes that.\n\n var fn = _global['eval'](trustedScriptFromString(body)); // To completely mimic the behavior of calling \"new Function\", two more\n // things need to happen:\n // 1. Stringifying the resulting function should return its source code\n\n\n fn.toString = function () {\n return body;\n }; // 2. When calling the resulting function, `this` should refer to `global`\n\n\n return fn.bind(_global); // When Trusted Types support in Function constructors is widely available,\n // the implementation of this function can be simplified to:\n // return new Function(...args.map(a => trustedScriptFromString(a)));\n }", "title": "" }, { "docid": "97d00ad522fe89a2c1734f6124d0be12", "score": "0.43324882", "text": "function runFunction () {\n\t\t\tvar args = _.toArray(arguments);\n\n\t\t\t// If only arg is a parley callback object,\n\t\t\t// convert into classic (err,data) notation\n\t\t\targs = expandParleyActionObject(args);\n\n\t\t\t// Add callback as argument\n\t\t\targs.push(cb);\n\n\t\t\t// Add reference to discard stack as final argument\n\t\t\targs.push(parley.dStack);\n\t\t\n\n\t\t\t// Defer until the event loop finishes to avoid triggering before all functions have been added\n\t\t\t_.defer(function () {\n\t\t\t\t// Run function in proper context w/ proper arguments\n\t\t\t\t// (if ctx is null, the fn will run in the global execution context)\n\t\t\t\tfn.apply(ctx, args);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "af341f405bbe4dfe3ffb4fc46b199298", "score": "0.43183953", "text": "function a_function(arg) {\n\tconsole.log(\"a_function\");\n\tconsole.log(arg);\n}", "title": "" }, { "docid": "1a2d5dc28a1c6597b7649a1c1f8dacbc", "score": "0.4315632", "text": "function fancy(arg1, arg2) {\n\t function run() {\n console.log('Will I run?');\n\t}\n\t if(run) {\n\t console.log('I can run');\n\t }\n\t else {\n\t console.log('I can\\'t run');\n\t }\n}", "title": "" }, { "docid": "f64610e6cd248fabc551cbbdf76e699e", "score": "0.4313135", "text": "executeFunction(fn, args) { return fn(...args); }", "title": "" }, { "docid": "f64610e6cd248fabc551cbbdf76e699e", "score": "0.4313135", "text": "executeFunction(fn, args) { return fn(...args); }", "title": "" }, { "docid": "d8c971daf5a236a8ef5bdc120ec9ba28", "score": "0.4297025", "text": "function Scope(obj, code) {\n switch (obj) {\n case undefined:\n case null: return Function(code, 'anonymous'); // dynamic function running in global\n default:\n with (obj) return function() {\n return eval(Block(code));\n }; // direct eval running in scope\n // start vm???\n }\n}", "title": "" }, { "docid": "640b48b6fe3ab5e1d09b5219a702c7d5", "score": "0.429674", "text": "function evalInContext(element, strJS) {\r\n var execFunc = function () {\r\n return eval(strJS);\r\n };\r\n\r\n execFunc.call(element);\r\n }", "title": "" }, { "docid": "640b48b6fe3ab5e1d09b5219a702c7d5", "score": "0.429674", "text": "function evalInContext(element, strJS) {\r\n var execFunc = function () {\r\n return eval(strJS);\r\n };\r\n\r\n execFunc.call(element);\r\n }", "title": "" }, { "docid": "5ecc0c1d94db9b02cf403f9c5a1abf08", "score": "0.4294748", "text": "function fancy(arg1, arg2) {\n\tvar run = false;\n\tfunction run () {\n console.log('Will I run?');\n }\n if(run) {\n console.log('I can run');\n }\n else {\n console.log('I can\\'t run');\n }\n}", "title": "" }, { "docid": "db1e8e41006a2c8bdf7e8eabb813f9fc", "score": "0.4289277", "text": "function main() {\n fn1()\n}", "title": "" }, { "docid": "f8549104ee8814febfc303398b4e085d", "score": "0.42850995", "text": "function wrappedOrigCall(orgFunc, newFunc) {\n return function() {\n var args = [].slice.call(arguments);\n try { orgFunc.apply(WinConsole, args); } catch (e) {}\n try { newFunc.apply(console, args); } catch (e) {}\n };\n}", "title": "" } ]
136233fd1a9f075730fef275a116b124
Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that should would receive a `mouseEnter` or `mouseLeave` event. Does not invoke the callback on the nearest common ancestor because nothing "entered" or "left" that element.
[ { "docid": "dad395f471d1040dee6d0b65a7061d52", "score": "0.47343388", "text": "function traverseEnterLeave(from,to,fn,argFrom,argTo){var common=from&&to?getLowestCommonAncestor(from,to):null;var pathFrom=[];while(true){if(!from){break;}if(from===common){break;}var alternate=from.alternate;if(alternate!==null&&alternate===common){break;}pathFrom.push(from);from=getParent(from);}var pathTo=[];while(true){if(!to){break;}if(to===common){break;}var _alternate=to.alternate;if(_alternate!==null&&_alternate===common){break;}pathTo.push(to);to=getParent(to);}for(var i=0;i<pathFrom.length;i++){fn(pathFrom[i],'bubbled',argFrom);}for(var _i=pathTo.length;_i-->0;){fn(pathTo[_i],'captured',argTo);}}", "title": "" } ]
[ { "docid": "fd3c8fae7351ee19c4e2ef015e2d1dda", "score": "0.5272212", "text": "function mouseEnterLayer(id){\r\n callDelegate(\"mouseEnter\", [id]);\r\n }", "title": "" }, { "docid": "665a697895a38723b8db310c663ea5b1", "score": "0.5093334", "text": "_handleMouseEnter() {\n this._hovered.next(this);\n }", "title": "" }, { "docid": "665a697895a38723b8db310c663ea5b1", "score": "0.5093334", "text": "_handleMouseEnter() {\n this._hovered.next(this);\n }", "title": "" }, { "docid": "416ba2e9278e789b7a26504095110014", "score": "0.50312406", "text": "handleMouseEnter() {\n this.hovered.next(this);\n }", "title": "" }, { "docid": "ef658efde4197dcb5c21db7f66bc2e5f", "score": "0.500826", "text": "_handleMouseEnter() {\n this._hovered.next(this);\n }", "title": "" }, { "docid": "5e3864395b3f2a1e95ac789ef1bb5da1", "score": "0.49188143", "text": "onMouseEnterState(stateId) {\n\t\tif (this.props.onMouseEnterState) {\n\t\t\tthis.props.onMouseEnterState(stateId);\n\t\t}\n\t}", "title": "" }, { "docid": "61a1fbb20a01690daf9e5dfb82815c74", "score": "0.48785484", "text": "onMouseOver(callback) {\n if (callback && typeof callback === 'function') {\n this.mouseOverCallbacks.push(callback);\n }\n }", "title": "" }, { "docid": "b40d028131f3392f43b23bff6c5c45af", "score": "0.4869117", "text": "function traverseEnterLeave(from,to,fn,argFrom,argTo){var common=from&&to?getLowestCommonAncestor(from,to):null;var pathFrom=[];while(from&&from!==common){pathFrom.push(from);from=from._hostParent;}var pathTo=[];while(to&&to!==common){pathTo.push(to);to=to._hostParent;}var i;for(i=0;i<pathFrom.length;i++){fn(pathFrom[i],'bubbled',argFrom);}for(i=pathTo.length;i-->0;){fn(pathTo[i],'captured',argTo);}}", "title": "" }, { "docid": "327f61b7bdc7523ac6efdef334e917b8", "score": "0.48601303", "text": "function traverseEnterLeave(from,to,fn,argFrom,argTo){var common=from&&to?getLowestCommonAncestor(from,to):null;var pathFrom=[];while(from&&from!==common){pathFrom.push(from);from=getParent(from);}var pathTo=[];while(to&&to!==common){pathTo.push(to);to=getParent(to);}var i;for(i=0;i<pathFrom.length;i++){fn(pathFrom[i],'bubbled',argFrom);}for(i=pathTo.length;i-->0;){fn(pathTo[i],'captured',argTo);}}", "title": "" }, { "docid": "a3ec67d5e37ccc6b6f73188e1dcd9e4c", "score": "0.48120868", "text": "handleClick(event, cb) {\n\n // normalize xy\n this.mouse.x = (event.clientX / this.renderer.domElement.clientWidth) * 2 - 1;\n this.mouse.y = -(event.clientY / this.renderer.domElement.clientHeight) * 2 + 1;\n this.raycaster.setFromCamera(this.mouse, this.camera);\n\n if (this.clickableObjects.length === 0)\n return;\n\n // build array of intersection candidates\n let o;\n let intersectionObjects = [];\n for (o in this.objects) {\n if (this.objects.hasOwnProperty(o)) {\n intersectionObjects.push(this.objects[o]);\n }\n }\n\n // collect intersections\n let intersects = this.raycaster.intersectObjects(intersectionObjects, true);\n if (intersects.length > 0) {\n\n console.log('hit something');\n\n // trigger event and call the callbacks\n for (o in this.objects) {\n if (this.objects.hasOwnProperty(o)) {\n if (this.objects[o].children.includes(intersects[0].object) &&\n typeof cb === 'function') {\n cb(o);\n }\n }\n }\n }\n }", "title": "" }, { "docid": "f5b114920c507aa171e8abfab44df2c6", "score": "0.48029646", "text": "function handler(evt){\n\t\t// Poor man's event propagation. Don't propagate event to ancestors of evt.relatedTarget,\n\t\t// to avoid processing mouseout events moving from a widget's domNode to a descendant node;\n\t\t// such events shouldn't be interpreted as a mouseleave on the widget.\n\t\tif(!dom.isDescendant(evt.relatedTarget, evt.target)){\n\t\t\tfor(var node = evt.target; node && node != evt.relatedTarget; node = node.parentNode){\n\t\t\t\t// Process any nodes with _cssState property. They are generally widget root nodes,\n\t\t\t\t// but could also be sub-nodes within a widget\n\t\t\t\tif(node._cssState){\n\t\t\t\t\tvar widget = registry.getEnclosingWidget(node);\n\t\t\t\t\tif(widget){\n\t\t\t\t\t\tif(node == widget.domNode){\n\t\t\t\t\t\t\t// event on the widget's root node\n\t\t\t\t\t\t\twidget._cssMouseEvent(evt);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t// event on widget's sub-node\n\t\t\t\t\t\t\twidget._subnodeCssMouseEvent(node, node._cssState, evt);\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": "da3e22b78f8ed8af3aecb3b2905b8cd0", "score": "0.47846943", "text": "function on_node_mouseenter(n) {\n // ignore these events while dragging\n if (dragging) return;\n\n // highlight the node the mouse is over\n highlight_node(n);\n }", "title": "" }, { "docid": "56d5cd0c850d393bed10e028ebebffb4", "score": "0.47490364", "text": "hoverDraggableId(id) {\n if (this.draggableDragEntered && id !== this.draggableId) {\n this.emitDraggableDragLeave();\n }\n }", "title": "" }, { "docid": "2d123e3c107d904dcad5fbdaa4e87bff", "score": "0.47067052", "text": "function tickMouseEnterListen(evt) {\n var idStr = evt.target.getAttribute('id');\n var tickNum = NB_vid.methods.tickNumFromIdStr(idStr);\n NB_vid.methods.tickHover(tickNum);\n }", "title": "" }, { "docid": "db4e1bbc5f21be000fe134fd8f713515", "score": "0.46829233", "text": "handleMouseEnter(event) {\n const { elementId } = this.props;\n\n // padding of elemental editor + width of font-icon\n const plusButtonWidth = 50;\n\n const addBlockAreaContainer = window.document.getElementById(`AddBlockArea_${elementId}`);\n const clientWidth = addBlockAreaContainer.clientWidth;\n const offsetLeft = addBlockAreaContainer.getBoundingClientRect().left;\n const mousePos = event.pageX - offsetLeft;\n const delayArea = clientWidth - plusButtonWidth;\n\n // mouse entered within 'delay' hover area\n if (mousePos < delayArea) {\n const timeoutRef = setTimeout(() => {\n this.setState({\n delayAreaActive: true,\n });\n }, 200);\n\n this.setState({\n timeoutRef,\n });\n } else {\n // mouse entered within 'instantaneous' hover area\n this.setState({\n instAreaActive: true,\n });\n }\n }", "title": "" }, { "docid": "c525a296297f4ea47713b71be7c2d7d2", "score": "0.46546936", "text": "function handleHover(e) {\n\t\t\t// Check if mouse(over|out) are still within the same parent element\n\t\t\tvar p = e.relatedTarget;\n\t\n\t\t\t// Traverse up the tree\n\t\t\twhile ( p && p != this ) try { p = p.parentNode; } catch(e) { p = this; };\n\t\t\t\n\t\t\t// If we actually just moused on to a sub-element, ignore it\n\t\t\tif ( p == this ) return false;\n\t\t\t\n\t\t\t// Execute the right function\n\t\t\treturn (e.type == \"mouseover\" ? f : g).apply(this, [e]);\n\t\t}", "title": "" }, { "docid": "009c0d75ac0c250204b674de1ab40154", "score": "0.46444857", "text": "function treeItemHighlight(event) {\n\tvar div = getSourceElement(event);\n\tif (div.tagName != \"DIV\") {\n\t\tdiv = findParent(div, \"DIV\", 1);\n\t}\n\tswitch (event.type) {\n\tcase \"focus\":\n\tcase \"mouseover\":\n\t\tdiv.className = div.className.replace(\"acMenuDIV\", \"acMenuhoverDIV\");\n\t\tdojo.forEach(dojo.query(\"span\", div), function(element) {\n\t\t\tdojo.attr(element, {\n\t\t\t\t\"origclass\" : element.className\n\t\t\t});\n\t\t\tdojo.attr(element, {\n\t\t\t\t\"class\" : \"acMenuHoverText\"\n\t\t\t});\n\t\t\tdojo.connect(element, \"mouseover\", element, function(event) {\n\t\t\t\tcancelEvent(event);\n\t\t\t}, true);\n\t\t\tdojo.style(element, {\n\t\t\t\t\"pointerEvents\" : \"none\"\n\t\t\t});\n\t\t});\n\t\tbreak;\n\tcase \"mouseout\":\n\tcase \"blur\":\n\t\tdiv.className = div.className.replace(\"acMenuhoverDIV\", \"acMenuDIV\");\n\t\tdojo.forEach(dojo.query(\"span\", div), function(element) {\n\t\t\tdojo.attr(element, {\n\t\t\t\t\"class\" : dojo.attr(element, \"origclass\")\n\t\t\t});\n\t\t});\n\t\tbreak;\n\t}\n}", "title": "" }, { "docid": "c05ac8620a94d81ad4111d400dbda0c3", "score": "0.46359485", "text": "function handleMouseEnter(e) {\n // Next sibling should be the bun\n e.target.nextSibling.style.backgroundColor = 'rgba(0,0,0,.4)';\n }", "title": "" }, { "docid": "619f1fb9e0333500eec02896f27b48ea", "score": "0.46148583", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], 'bubbled', argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], 'captured', argTo);\n }\n }", "title": "" }, { "docid": "c1aa0b1a95714cf8f8632f160790aa76", "score": "0.4602095", "text": "function on_node_mouseexit(n) {\n // ignore these events while dragging\n if (dragging) return;\n\n // go back to highlighting the selected (clicked-on) node, if there is one\n highlight_node(selected_node);\n }", "title": "" }, { "docid": "137f90ae10d8dd8230ede593c437922b", "score": "0.45975295", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t\t var pathFrom = [];\n\t\t while (from && from !== common) {\n\t\t pathFrom.push(from);\n\t\t from = from._hostParent;\n\t\t }\n\t\t var pathTo = [];\n\t\t while (to && to !== common) {\n\t\t pathTo.push(to);\n\t\t to = to._hostParent;\n\t\t }\n\t\t var i;\n\t\t for (i = 0; i < pathFrom.length; i++) {\n\t\t fn(pathFrom[i], 'bubbled', argFrom);\n\t\t }\n\t\t for (i = pathTo.length; i-- > 0;) {\n\t\t fn(pathTo[i], 'captured', argTo);\n\t\t }\n\t\t}", "title": "" }, { "docid": "42fcc67940a2b1a8e4d5e29f50d5c026", "score": "0.4589095", "text": "function eventCallback1(e, element) {\n e.stopPropagation();\n $j(element).children().addClass('navhover');\n if ($j(element).hasClass('haschildren')) {\n if ($j(element).hasClass('menuOpen')) {\n $j(element).removeClass('menuOpen');\n $j(element).css('background-color', '');\n $j(element).children('a,span').css('color', '');\n } else {\n $j(element).children('ul').show();\n e.preventDefault();\n $j(element).addClass('menuOpen');\n //$j(element).css('background-color','#b6bf00');\n // $j(element).children('a,span').css('color','#fbd127');\n }\n }\n $j(element).siblings('li').children('ul').hide();\n $j(element).siblings('li').removeClass('menuOpen');\n $j(element).siblings('li').children().removeClass('navhover');\n $j(element).siblings('li').css('background-color', '');\n $j(element).siblings('li').children('a,span').css('color', '');\n }", "title": "" }, { "docid": "ba3c1e3c59065b82fe8204a3506dd7ad", "score": "0.45874792", "text": "function buildCallbacks() {\n //for each region (continent)\n\n let list = d3.select(\"#selector\").append(\"ul\").attr(\"class\", \"region-list\");\n\n $('#selector').on('click',function(){\n if($(this).attr('data-click-state') == 1) {\n $(this).animate({right: '-500px'});\n $(this).attr('data-click-state', 0);\n } else {\n $(this).attr('data-click-state', 1);\n $(this).animate({right: '-50px'});\n }\n });\n\n $('#close-graph').click(function () {\n $(\"#graph-container\").css({display: \"none\"});\n $(\"#graph-show\").css({left: \"-40px\", filter: \"brightness(0.5)\"})\n });\n\n window.onmousemove = function (e) {\n var x = e.clientX,\n y = e.clientY;\n tooltip.style(\"top\", (y + 20) + 'px');\n tooltip.style(\"left\", (x + 20) + 'px');\n };\n\n $(\"#graph-show\").on(\"click\", function() {\n $(\"#graph-container\").css({display: \"block\"});\n $(\"#graph-show\").css({left: \"-20px\", filter: \"brightness(1)\"})\n });\n\n Object.entries(hierarchy).forEach(([continent,states]) => {\n let regionList = list.append(\"li\")\n .attr(\"class\", \"continent\")\n .html(d3.select(\"#\"+continent).attr(\"name\")).append(\"ul\");\n\n //for each state\n Object.entries(states).forEach(([state,eezs]) => {\n // either GEEZ-State: [list of states] or EEZ-State: null\n if (state.length < 4) return; //TODO why does this happen...\n\n if (isEezLeaf(eezs)) {\n let name = eezs.name;\n let stateLi = regionList.append(\"li\").html(name);\n\n if (eezs.parent_state != null) {\n onNodeClick(eezs.parent_state, [eezs.parent_state, eezs.node], eezs.state);\n stateLi.attr('class', 'pointer state');\n onNodeClick(stateLi, [eezs.parent_state, eezs.node], eezs.state);\n } else {\n stateLi.attr('class', 'pointer state');\n onNodeClick(stateLi, [eezs.node], name);\n }\n eezs.descriptor = name;\n doLabelDataNode(eezs.node, eezs, \"\", \"currentdata\");\n\n onNodeClick(eezs.node, [eezs.node], name);\n } else {\n let [firstChild] = Object.keys(eezs);\n let stateName = eezs[firstChild].state;\n let stateLi = regionList.append(\"li\").html(stateName);\n let eezList = stateLi.append(\"ul\");\n\n let childlist = [];\n\n var stateNode = d3.select(\"#\" + state.substring(5));\n\n for (let eezKey in eezs) {\n let eez = eezs[eezKey].node;\n let eez_parent = eezs[eezKey].parent_state;\n childlist.push(eez);\n let eezLi = eezList.append(\"li\").html(eezs[eezKey].name);\n let eezName = stateName + \": \" + eezs[eezKey].name;\n eezs[eezKey].descriptor = eezName;\n\n doLabelDataNode(eez, eezs[eezKey], \"\", \"currentdata\");\n onNodeClick(eez, [eez], eezName);\n\n eezLi.attr('class', 'pointer eez');\n onNodeClick(eezLi, [eez], eezName);\n }\n if (!stateNode.empty()) {\n childlist.push(stateNode);\n onNodeClick(stateNode, childlist, stateName);\n }\n stateLi.attr('class', 'pointer state');\n onNodeClick(stateLi, childlist, stateName);\n }\n });\n });\n}", "title": "" }, { "docid": "0ddf31e90ca7f4e7b698e69a3cbcfbff", "score": "0.45874733", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._nativeParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._nativeParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], true, argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], false, argTo);\n\t }\n\t}", "title": "" }, { "docid": "0ddf31e90ca7f4e7b698e69a3cbcfbff", "score": "0.45874733", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._nativeParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._nativeParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], true, argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], false, argTo);\n\t }\n\t}", "title": "" }, { "docid": "0ddf31e90ca7f4e7b698e69a3cbcfbff", "score": "0.45874733", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._nativeParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._nativeParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], true, argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], false, argTo);\n\t }\n\t}", "title": "" }, { "docid": "0ddf31e90ca7f4e7b698e69a3cbcfbff", "score": "0.45874733", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._nativeParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._nativeParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], true, argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], false, argTo);\n\t }\n\t}", "title": "" }, { "docid": "dc676a81aa560c0fb186d93c296776fa", "score": "0.45783764", "text": "function tickMouseLeaveListen(evt) {\n var idStr = evt.target.getAttribute('id');\n NB_vid.methods.removeTickHover();\n var currentSelectStr = 'tickmark' + NB_vid.currentID;\n if (idStr === currentSelectStr) {\n NB_vid.methods.highlightTick(NB_vid.selectedTick, 'green');\n }\n }", "title": "" }, { "docid": "b002b147f07e169b56699aad9815aa2b", "score": "0.45729023", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], true, argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], false, argTo);\n\t }\n\t}", "title": "" }, { "docid": "b002b147f07e169b56699aad9815aa2b", "score": "0.45729023", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], true, argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], false, argTo);\n\t }\n\t}", "title": "" }, { "docid": "b002b147f07e169b56699aad9815aa2b", "score": "0.45729023", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], true, argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], false, argTo);\n\t }\n\t}", "title": "" }, { "docid": "b002b147f07e169b56699aad9815aa2b", "score": "0.45729023", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], true, argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], false, argTo);\n\t }\n\t}", "title": "" }, { "docid": "b002b147f07e169b56699aad9815aa2b", "score": "0.45729023", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], true, argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], false, argTo);\n\t }\n\t}", "title": "" }, { "docid": "b002b147f07e169b56699aad9815aa2b", "score": "0.45729023", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], true, argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], false, argTo);\n\t }\n\t}", "title": "" }, { "docid": "b002b147f07e169b56699aad9815aa2b", "score": "0.45729023", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], true, argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], false, argTo);\n\t }\n\t}", "title": "" }, { "docid": "b002b147f07e169b56699aad9815aa2b", "score": "0.45729023", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], true, argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], false, argTo);\n\t }\n\t}", "title": "" }, { "docid": "b002b147f07e169b56699aad9815aa2b", "score": "0.45729023", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], true, argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], false, argTo);\n\t }\n\t}", "title": "" }, { "docid": "b002b147f07e169b56699aad9815aa2b", "score": "0.45729023", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], true, argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], false, argTo);\n\t }\n\t}", "title": "" }, { "docid": "b002b147f07e169b56699aad9815aa2b", "score": "0.45729023", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], true, argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], false, argTo);\n\t }\n\t}", "title": "" }, { "docid": "b002b147f07e169b56699aad9815aa2b", "score": "0.45729023", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], true, argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], false, argTo);\n\t }\n\t}", "title": "" }, { "docid": "b002b147f07e169b56699aad9815aa2b", "score": "0.45729023", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], true, argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], false, argTo);\n\t }\n\t}", "title": "" }, { "docid": "b002b147f07e169b56699aad9815aa2b", "score": "0.45729023", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], true, argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], false, argTo);\n\t }\n\t}", "title": "" }, { "docid": "021c5a85b56de04ffe8d26b9697fe718", "score": "0.45397735", "text": "function mouse_enter() { }", "title": "" }, { "docid": "7a172da4b470e3f80b76533d31710163", "score": "0.45314166", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\r\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\r\n var pathFrom = [];\r\n while (from && from !== common) {\r\n pathFrom.push(from);\r\n from = from._hostParent;\r\n }\r\n var pathTo = [];\r\n while (to && to !== common) {\r\n pathTo.push(to);\r\n to = to._hostParent;\r\n }\r\n var i;\r\n for (i = 0; i < pathFrom.length; i++) {\r\n fn(pathFrom[i], 'bubbled', argFrom);\r\n }\r\n for (i = pathTo.length; i-- > 0;) {\r\n fn(pathTo[i], 'captured', argTo);\r\n }\r\n}", "title": "" }, { "docid": "d60f5aff5fe59186e6454c8fd27a85cd", "score": "0.45303833", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], 'bubbled', argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], 'captured', argTo);\n\t }\n\t}", "title": "" }, { "docid": "d60f5aff5fe59186e6454c8fd27a85cd", "score": "0.45303833", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], 'bubbled', argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], 'captured', argTo);\n\t }\n\t}", "title": "" }, { "docid": "d60f5aff5fe59186e6454c8fd27a85cd", "score": "0.45303833", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], 'bubbled', argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], 'captured', argTo);\n\t }\n\t}", "title": "" }, { "docid": "d60f5aff5fe59186e6454c8fd27a85cd", "score": "0.45303833", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], 'bubbled', argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], 'captured', argTo);\n\t }\n\t}", "title": "" }, { "docid": "d60f5aff5fe59186e6454c8fd27a85cd", "score": "0.45303833", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], 'bubbled', argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], 'captured', argTo);\n\t }\n\t}", "title": "" }, { "docid": "d60f5aff5fe59186e6454c8fd27a85cd", "score": "0.45303833", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], 'bubbled', argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], 'captured', argTo);\n\t }\n\t}", "title": "" }, { "docid": "d60f5aff5fe59186e6454c8fd27a85cd", "score": "0.45303833", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], 'bubbled', argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], 'captured', argTo);\n\t }\n\t}", "title": "" }, { "docid": "d60f5aff5fe59186e6454c8fd27a85cd", "score": "0.45303833", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], 'bubbled', argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], 'captured', argTo);\n\t }\n\t}", "title": "" }, { "docid": "d60f5aff5fe59186e6454c8fd27a85cd", "score": "0.45303833", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], 'bubbled', argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], 'captured', argTo);\n\t }\n\t}", "title": "" }, { "docid": "d60f5aff5fe59186e6454c8fd27a85cd", "score": "0.45303833", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], 'bubbled', argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], 'captured', argTo);\n\t }\n\t}", "title": "" }, { "docid": "d60f5aff5fe59186e6454c8fd27a85cd", "score": "0.45303833", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], 'bubbled', argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], 'captured', argTo);\n\t }\n\t}", "title": "" }, { "docid": "d60f5aff5fe59186e6454c8fd27a85cd", "score": "0.45303833", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], 'bubbled', argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], 'captured', argTo);\n\t }\n\t}", "title": "" }, { "docid": "d60f5aff5fe59186e6454c8fd27a85cd", "score": "0.45303833", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], 'bubbled', argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], 'captured', argTo);\n\t }\n\t}", "title": "" }, { "docid": "d60f5aff5fe59186e6454c8fd27a85cd", "score": "0.45303833", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], 'bubbled', argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], 'captured', argTo);\n\t }\n\t}", "title": "" }, { "docid": "d60f5aff5fe59186e6454c8fd27a85cd", "score": "0.45303833", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], 'bubbled', argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], 'captured', argTo);\n\t }\n\t}", "title": "" }, { "docid": "d60f5aff5fe59186e6454c8fd27a85cd", "score": "0.45303833", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n\t var common = from && to ? getLowestCommonAncestor(from, to) : null;\n\t var pathFrom = [];\n\t while (from && from !== common) {\n\t pathFrom.push(from);\n\t from = from._hostParent;\n\t }\n\t var pathTo = [];\n\t while (to && to !== common) {\n\t pathTo.push(to);\n\t to = to._hostParent;\n\t }\n\t var i;\n\t for (i = 0; i < pathFrom.length; i++) {\n\t fn(pathFrom[i], 'bubbled', argFrom);\n\t }\n\t for (i = pathTo.length; i-- > 0;) {\n\t fn(pathTo[i], 'captured', argTo);\n\t }\n\t}", "title": "" }, { "docid": "fa74a27b6c8cb078bf0af1f831cdeb10", "score": "0.45275936", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._nativeParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._nativeParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], true, argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], false, argTo);\n }\n}", "title": "" }, { "docid": "fa74a27b6c8cb078bf0af1f831cdeb10", "score": "0.45275936", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._nativeParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._nativeParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], true, argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], false, argTo);\n }\n}", "title": "" }, { "docid": "0968865717ff9d60443a2e2f6f50904f", "score": "0.45248052", "text": "function on_mouseover(id) {\n svg.selectAll(\"circle.group\" + id)\n .transition()\n .duration(500)\n .style(\"fill\", \"steelblue\");\n svg.selectAll(\"path.group\" + id)\n .raise()\n .transition()\n .duration(500)\n .style(\"stroke\", \"steelblue\");\n svg.selectAll(\"text.group\" + id)\n .transition()\n .duration(500)\n .style(\"fill\", \"steelblue\");\n }", "title": "" }, { "docid": "88cdda9b8ebe89ecdac0571d8a5e90e7", "score": "0.45246384", "text": "function helperHandler(event)\n{\n var id = $(this).data(\"id\");\n var parent_id = $(this).parent().attr(\"id\");\n console.log(\"from: \" + parent_id + \"->\" + id);\n\n var stack = get_stack(parent_id);\n\n var select_str = \"\";\n var comma = \"\";\n var found = -1;\n for (i in stack.cards) {\n var card = stack.cards[i];\n if (card.id == id) {\n found = i;\n }\n if (found > -1) {\n select_str += comma + \"#card_\" + card.id;\n comma = \", \";\n }\n }\n console.log(\"select str: \" + select_str);\n selected = $(select_str);\n var container = $('<div/>').attr('id', 'drag_container');\n if (found > 0) {\n container.css(\"margin-top\", \"-75px\");\n }\n container.append(selected.clone());\n return container;\n}", "title": "" }, { "docid": "f0780042d82db80722be5d4c9fb6ee13", "score": "0.4522581", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], true, argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], false, argTo);\n }\n}", "title": "" }, { "docid": "f0780042d82db80722be5d4c9fb6ee13", "score": "0.4522581", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], true, argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], false, argTo);\n }\n}", "title": "" }, { "docid": "f0780042d82db80722be5d4c9fb6ee13", "score": "0.4522581", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], true, argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], false, argTo);\n }\n}", "title": "" }, { "docid": "f0780042d82db80722be5d4c9fb6ee13", "score": "0.4522581", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], true, argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], false, argTo);\n }\n}", "title": "" }, { "docid": "f0780042d82db80722be5d4c9fb6ee13", "score": "0.4522581", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], true, argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], false, argTo);\n }\n}", "title": "" }, { "docid": "f0780042d82db80722be5d4c9fb6ee13", "score": "0.4522581", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], true, argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], false, argTo);\n }\n}", "title": "" }, { "docid": "f0780042d82db80722be5d4c9fb6ee13", "score": "0.4522581", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], true, argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], false, argTo);\n }\n}", "title": "" }, { "docid": "f0780042d82db80722be5d4c9fb6ee13", "score": "0.4522581", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], true, argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], false, argTo);\n }\n}", "title": "" }, { "docid": "f0780042d82db80722be5d4c9fb6ee13", "score": "0.4522581", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], true, argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], false, argTo);\n }\n}", "title": "" }, { "docid": "f0780042d82db80722be5d4c9fb6ee13", "score": "0.4522581", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], true, argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], false, argTo);\n }\n}", "title": "" }, { "docid": "d9715ce20430dc2ccdf6a89ff3ee4dde", "score": "0.45118576", "text": "function closestCallback(element, callback) {\n while (element) {\n if (callback(element)) {\n return element;\n }\n\n element = element.parentElement;\n }\n}", "title": "" }, { "docid": "82e3c051c71a3c4844f8dcce50cae954", "score": "0.45060226", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], 'bubbled', argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], 'captured', argTo);\n }\n}", "title": "" }, { "docid": "82e3c051c71a3c4844f8dcce50cae954", "score": "0.45060226", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], 'bubbled', argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], 'captured', argTo);\n }\n}", "title": "" }, { "docid": "82e3c051c71a3c4844f8dcce50cae954", "score": "0.45060226", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], 'bubbled', argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], 'captured', argTo);\n }\n}", "title": "" }, { "docid": "82e3c051c71a3c4844f8dcce50cae954", "score": "0.45060226", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], 'bubbled', argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], 'captured', argTo);\n }\n}", "title": "" }, { "docid": "82e3c051c71a3c4844f8dcce50cae954", "score": "0.45060226", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], 'bubbled', argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], 'captured', argTo);\n }\n}", "title": "" }, { "docid": "82e3c051c71a3c4844f8dcce50cae954", "score": "0.45060226", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], 'bubbled', argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], 'captured', argTo);\n }\n}", "title": "" }, { "docid": "82e3c051c71a3c4844f8dcce50cae954", "score": "0.45060226", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], 'bubbled', argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], 'captured', argTo);\n }\n}", "title": "" }, { "docid": "82e3c051c71a3c4844f8dcce50cae954", "score": "0.45060226", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], 'bubbled', argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], 'captured', argTo);\n }\n}", "title": "" }, { "docid": "82e3c051c71a3c4844f8dcce50cae954", "score": "0.45060226", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], 'bubbled', argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], 'captured', argTo);\n }\n}", "title": "" }, { "docid": "82e3c051c71a3c4844f8dcce50cae954", "score": "0.45060226", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], 'bubbled', argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], 'captured', argTo);\n }\n}", "title": "" }, { "docid": "82e3c051c71a3c4844f8dcce50cae954", "score": "0.45060226", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], 'bubbled', argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], 'captured', argTo);\n }\n}", "title": "" }, { "docid": "82e3c051c71a3c4844f8dcce50cae954", "score": "0.45060226", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], 'bubbled', argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], 'captured', argTo);\n }\n}", "title": "" }, { "docid": "82e3c051c71a3c4844f8dcce50cae954", "score": "0.45060226", "text": "function traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n while (from && from !== common) {\n pathFrom.push(from);\n from = from._hostParent;\n }\n var pathTo = [];\n while (to && to !== common) {\n pathTo.push(to);\n to = to._hostParent;\n }\n var i;\n for (i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], 'bubbled', argFrom);\n }\n for (i = pathTo.length; i-- > 0;) {\n fn(pathTo[i], 'captured', argTo);\n }\n}", "title": "" } ]
2a4430e8c87b92624ebbc83848c87dde
passed to stack.forEach to turn list items up the stack into paras
[ { "docid": "d502552b299c0ceb3874bd397d9c122a", "score": "0.5432188", "text": "function paragraphify(s, i, stack) {\n var list = s.list;\n var last_li = list[list.length-1];\n\n if ( last_li[1] instanceof Array && last_li[1][0] == \"para\" ) {\n return;\n }\n if ( i + 1 == stack.length ) {\n // Last stack frame\n // Keep the same array, but replace the contents\n last_li.push( [\"para\"].concat( last_li.splice(1, last_li.length - 1) ) );\n }\n else {\n var sublist = last_li.pop();\n last_li.push( [\"para\"].concat( last_li.splice(1, last_li.length - 1) ), sublist );\n }\n }", "title": "" } ]
[ { "docid": "a182fabfb69f305dc35e2d64b6f30e9c", "score": "0.5880998", "text": "printStack() {\n return this.items.map(element => {\n return element;\n });\n }", "title": "" }, { "docid": "849d247254b096266a332b03770f715d", "score": "0.577631", "text": "function tasks_stack() {\r\n let stackdata = new Stack(1);\r\n stackdata.push(4);\r\n stackdata.push(8);\r\n stackdata.push(9);\r\n stackdata.push(10);\r\n stackdata.push(11);\r\n\r\n stackdata.parse_llist();\r\n let out = stackdata.pop();\r\n let out1 = stackdata.pop();\r\n let out2 = stackdata.pop();\r\n let out3 = stackdata.pop();\r\n // let out4 = stackdata.pop();\r\n // let out5 = stackdata.pop();\r\n // let out6 = stackdata.pop();\r\n // let out7 = stackdata.pop();\r\n console.log(\r\n \" gotten out \",\r\n out.value,\r\n out1.value,\r\n out2.value,\r\n out3.value\r\n // out4.value,\r\n // out5.value,\r\n // out6.value,\r\n // out7.value\r\n );\r\n stackdata.push(100);\r\n stackdata.pop();\r\n // stackdata.pop();\r\n // stackdata.pop();\r\n // stackdata.pop();\r\n // stackdata.pop();\r\n // stackdata.pop();\r\n\r\n console.log(\r\n \"peeking out \",\r\n // stackdata.peek(),\r\n stackdata.is_empty(),\r\n stackdata\r\n );\r\n stackdata.parse_llist();\r\n }", "title": "" }, { "docid": "b69c410ce183694e9efea41c98f0796d", "score": "0.55495983", "text": "function multstack(vet){\r\n pari = new Stack();\r\n dispari = new Stack();\r\n vetR = [];\r\n\r\n for(var i = 0; i < vet.length; i++){\r\n if ((i%2)== 0){\r\n pari.push(vet[i]);\r\n }\r\n else{\r\n dispari.push(vet[i]);\r\n }\r\n }\r\n\r\n for(var j = 0; j < pari.myarray.length ; j++){\r\n var par = pari.pop();\r\n var dis = dispari.pop();\r\n vetR[j] = par*dis;\r\n }\r\n\r\n return vetR;\r\n\r\n}", "title": "" }, { "docid": "7cf6b6e80c9ce0c3a4f059cc50385b42", "score": "0.55136395", "text": "traverseList() {}", "title": "" }, { "docid": "ecba5a339dc6bf825db0c48b84306bec", "score": "0.54939765", "text": "enQueue(item) {\n // move all items from stack1 to stack2, which reverses order\n this.alternateStacks(this.stack1, this.stack2)\n\n // new item will be at the bottom of stack1 so it will be the last out / last in line\n this.stack1.push(item);\n\n // move items back to stack1, from stack2\n this.alternateStacks(this.stack2, this.stack1)\n }", "title": "" }, { "docid": "47f5c78cf374cafc79a762e82f9fb857", "score": "0.5456602", "text": "function paragraphify(s, i, stack) {\n var list = s.list;\n var last_li = list[list.length-1];\n\n if (last_li[1] instanceof Array && last_li[1][0] == \"para\") {\n return;\n }\n if (i+1 == stack.length) {\n // Last stack frame\n // Keep the same array, but replace the contents\n last_li.push( [\"para\"].concat( last_li.splice(1) ) );\n }\n else {\n var sublist = last_li.pop();\n last_li.push( [\"para\"].concat( last_li.splice(1) ), sublist );\n }\n }", "title": "" }, { "docid": "0fb6b9e983317cc3869625bbe752bafe", "score": "0.5453637", "text": "function paragraphify(s, i, stack) {\n\t var list = s.list;\n\t var last_li = list[list.length-1];\n\t\n\t if ( last_li[1] instanceof Array && last_li[1][0] == \"para\" ) {\n\t return;\n\t }\n\t if ( i + 1 == stack.length ) {\n\t // Last stack frame\n\t // Keep the same array, but replace the contents\n\t last_li.push( [\"para\"].concat( last_li.splice(1, last_li.length - 1) ) );\n\t }\n\t else {\n\t var sublist = last_li.pop();\n\t last_li.push( [\"para\"].concat( last_li.splice(1, last_li.length - 1) ), sublist );\n\t }\n\t }", "title": "" }, { "docid": "c65ac9a72bfc4f24f5e359cdff22c0a0", "score": "0.54523766", "text": "function paragraphify(s, i, stack) {\n var list = s.list;\n var last_li = list[list.length-1];\n\n if (last_li[1] instanceof Array && last_li[1][0] == \"para\") {\n return;\n }\n if (i+1 == stack.length) {\n // Last stack frame\n // Keep the same array, but replace the contents\n last_li.push( [\"para\"].concat( last_li.splice(1) ) );\n }\n else {\n var sublist = last_li.pop();\n last_li.push( [\"para\"].concat( last_li.splice(1) ), sublist );\n }\n }", "title": "" }, { "docid": "630f637e6f7d9855e6081aa6b860afff", "score": "0.54350823", "text": "function paragraphify(s, i, stack) {\n var list = s.list;\n var last_li = list[list.length-1];\n\n if (last_li[1] instanceof Array && last_li[1][0] == \"para\") {\n return;\n }\n if (i+1 == stack.length) {\n // Last stack frame\n // Keep the same array, but replace the contents\n last_li.push( [\"para\"].concat( last_li.splice(1) ) );\n }\n else {\n var sublist = last_li.pop();\n last_li.push( [\"para\"].concat( last_li.splice(1) ), sublist );\n }\n }", "title": "" }, { "docid": "630f637e6f7d9855e6081aa6b860afff", "score": "0.54350823", "text": "function paragraphify(s, i, stack) {\n var list = s.list;\n var last_li = list[list.length-1];\n\n if (last_li[1] instanceof Array && last_li[1][0] == \"para\") {\n return;\n }\n if (i+1 == stack.length) {\n // Last stack frame\n // Keep the same array, but replace the contents\n last_li.push( [\"para\"].concat( last_li.splice(1) ) );\n }\n else {\n var sublist = last_li.pop();\n last_li.push( [\"para\"].concat( last_li.splice(1) ), sublist );\n }\n }", "title": "" }, { "docid": "630f637e6f7d9855e6081aa6b860afff", "score": "0.54350823", "text": "function paragraphify(s, i, stack) {\n var list = s.list;\n var last_li = list[list.length-1];\n\n if (last_li[1] instanceof Array && last_li[1][0] == \"para\") {\n return;\n }\n if (i+1 == stack.length) {\n // Last stack frame\n // Keep the same array, but replace the contents\n last_li.push( [\"para\"].concat( last_li.splice(1) ) );\n }\n else {\n var sublist = last_li.pop();\n last_li.push( [\"para\"].concat( last_li.splice(1) ), sublist );\n }\n }", "title": "" }, { "docid": "630f637e6f7d9855e6081aa6b860afff", "score": "0.54350823", "text": "function paragraphify(s, i, stack) {\n var list = s.list;\n var last_li = list[list.length-1];\n\n if (last_li[1] instanceof Array && last_li[1][0] == \"para\") {\n return;\n }\n if (i+1 == stack.length) {\n // Last stack frame\n // Keep the same array, but replace the contents\n last_li.push( [\"para\"].concat( last_li.splice(1) ) );\n }\n else {\n var sublist = last_li.pop();\n last_li.push( [\"para\"].concat( last_li.splice(1) ), sublist );\n }\n }", "title": "" }, { "docid": "a2cc52723b846244615f5873ceacc1fb", "score": "0.539211", "text": "function stack_item(stack, list) {\n if (stack.length == 0) {\n return; // Empty stack or we've reached the end of the stack.\n };\n display_item(stack[0], list); // Uh, display the item at this position.\n stack_item(stack[1], list); // Recurse on the rest of the stack.\n}", "title": "" }, { "docid": "7a7835f52578d0d39f4ccbf72aeb8416", "score": "0.5390097", "text": "function paragraphify(s, i, stack) {\n\t var list = s.list;\n\t var last_li = list[list.length - 1];\n\n\t if (last_li[1] instanceof Array && last_li[1][0] == \"para\") {\n\t return;\n\t }\n\t if (i + 1 == stack.length) {\n\t // Last stack frame\n\t // Keep the same array, but replace the contents\n\t last_li.push([\"para\"].concat(last_li.splice(1, last_li.length - 1)));\n\t } else {\n\t var sublist = last_li.pop();\n\t last_li.push([\"para\"].concat(last_li.splice(1, last_li.length - 1)), sublist);\n\t }\n\t }", "title": "" }, { "docid": "5c530a1e920df86aeaa0bf800a9e1aaf", "score": "0.5364378", "text": "function paragraphify(s, i, stack) {\n var list = s.list;\n var last_li = list[list.length - 1];\n\n if (last_li[1] instanceof Array && last_li[1][0] == \"para\") {\n return;\n }\n if (i + 1 == stack.length) {\n // Last stack frame\n // Keep the same array, but replace the contents\n last_li.push([\"para\"].concat(last_li.splice(1)));\n } else {\n var sublist = last_li.pop();\n last_li.push([\"para\"].concat(last_li.splice(1)), sublist);\n }\n }", "title": "" }, { "docid": "9b49ceb5aaeb6c1d8b9ff22499c9ed50", "score": "0.53461426", "text": "compress(upto) {\n let remap = new BranchRemapping\n let items = [], events = 0\n for (let i = this.items.length - 1; i >= 0; i--) {\n let item = this.items[i]\n if (i >= upto) {\n items.push(item)\n } else if (item.step) {\n let step = item.step.map(remap.remap), map = step && step.posMap()\n remap.movePastStep(item, map)\n if (step) {\n let selection = item.selection && item.selection.type.mapToken(item.selection, remap.remap)\n items.push(new StepItem(map.invert(), item.id, step, selection))\n if (selection) events++\n }\n } else if (item.map) {\n remap.add(item)\n } else {\n items.push(item)\n }\n }\n this.items = items.reverse()\n this.events = events\n }", "title": "" }, { "docid": "61b57550ca087e8cb5c0427f1f6bf903", "score": "0.5328935", "text": "constructor(...items) {\n this.stack = items \n }", "title": "" }, { "docid": "2974e7bd0f010e0c8e9cf7eaee276125", "score": "0.51859266", "text": "print() {\n \n let current = this.head;\n let stack = []\n while (current) {\n stack.push(current.value)\n current = current.next;\n \n }\n return this;\n \n }", "title": "" }, { "docid": "17bc1af475b75cff534d700d0e860281", "score": "0.51839375", "text": "function Stack(items = []) {\n this.items = items\n}", "title": "" }, { "docid": "fc39e6208d7bba783201196c73f1d233", "score": "0.51606244", "text": "function get_each_context$9(ctx, list, i) {\n \tconst child_ctx = ctx.slice();\n \tchild_ctx[3] = list[i];\n \tchild_ctx[4] = list;\n \tchild_ctx[5] = i;\n \treturn child_ctx;\n }", "title": "" }, { "docid": "f54599ba74be4b90f7cf0f560ebc57fa", "score": "0.5156544", "text": "function push_into_stack()\n\t\t{\n\n\t\t\tfor(var i=0;i<=impvar;i++)\n\t\t\t{\n\t\t\t\txc = stack1[i].x;\n\t\t\t\tyc = stack1[i].y;\n\t\t\t\tstack3.push(new Point(xc,yc));\n\t\t\t\t//console.log(\"the elements for stack3:: \" +stack3[i].x +\" \" +stack3[i].y);\n\t\t\t}\n\t\t\tfor(var i=0;i<=impvar;i++)\n\t\t\t{\n\t\t\t\txc = stack2[i].x;\n\t\t\t\tyc = stack2[i].y;\n\t\t\t\tstack4.push(new Point(xc,yc));\n\t\t\t\t//console.log(\"the elements for stack4:: \" +stack4[i].x +\" \" +stack4[i].y);\n\t\t\t}\t\t\t\t\t\t\t\n\t\t}", "title": "" }, { "docid": "fadab1b04b976742cfdfab7ae858ada9", "score": "0.51248014", "text": "function queueStacks() {\n this.inStack = [];\n this.outStack = [];\n}", "title": "" }, { "docid": "de88c8de36fc12936a97550719a9f277", "score": "0.5103665", "text": "function get_each_context(ctx, list, i) {\n\tconst child_ctx = ctx.slice();\n\tchild_ctx[27] = list[i];\n\tchild_ctx[28] = list;\n\tchild_ctx[29] = i;\n\treturn child_ctx;\n}", "title": "" }, { "docid": "5f24eca05aa88ff5e5b8a8f1946dd76d", "score": "0.5096276", "text": "__groupNodesByPosition(rawNodes) {\n const nodes = [];\n let tmpStack = [];\n _.each(rawNodes, (rawNode, index) => {\n // Check current and next node position\n const $rawNode = $(rawNode);\n const currentNodePosition = this.__getBottomPosition($rawNode);\n let nextNodePosition = -9999;\n if (rawNodes[index + 1]) {\n nextNodePosition = this.__getBottomPosition(rawNodes[index + 1]);\n }\n\n const isListItem = this.__isListItem($rawNode);\n let gapThreshold = 20;\n if (isListItem) {\n gapThreshold = 15;\n }\n\n // Too far appart, we need to add them\n if (currentNodePosition - nextNodePosition > gapThreshold) {\n let content = $rawNode.html();\n\n // We have something in the stack, we need to add it\n if (tmpStack.length > 0) {\n tmpStack.push($rawNode);\n content = _.map(tmpStack, tmpNode => tmpNode.html()).join('\\n');\n tmpStack = [];\n }\n\n nodes.push({ type: this.getNodeType($rawNode), content });\n return;\n }\n\n // Too close, we keep in the stack\n tmpStack.push($rawNode);\n });\n return nodes;\n }", "title": "" }, { "docid": "76ee4e0cae2dc94ea94477bcf4cd6fbc", "score": "0.50912654", "text": "forEach(fn) {\n let current = this.head;\n let i = 0;\n while (current) {\n fn(current.data, i);\n i++;\n current = current.next;\n }\n }", "title": "" }, { "docid": "67b7c9ac860dcab79610bca2e457a09f", "score": "0.5073944", "text": "function sf_list_up(){\n\t\n\tjQuery( 'body' ).find( '.studio-container .menu-item' ).each( function( ind ){\n\t\tjQuery( this ).get( 0 ).style.setProperty( '--animation-order', ind.toString() ); // studio container (big list)\n\t});\n\t\n\tjQuery( 'body' ).find( '.list-entry' ).each( function( ind ){\n\t\tjQuery( this ).get( 0 ).style.setProperty( '--animation-order', ind.toString() ); // list entries (normal list)\n\t});\t\n\t\n}", "title": "" }, { "docid": "fbda4353f4e093ffb489be371c5668e1", "score": "0.50509584", "text": "function get_each_context(ctx, list, i) {\n \tconst child_ctx = ctx.slice();\n \tchild_ctx[22] = list[i];\n \tchild_ctx[24] = i;\n \treturn child_ctx;\n }", "title": "" }, { "docid": "c2aab20e63d057521261e9e940bf92d3", "score": "0.5043193", "text": "forEach(t) {\n this.data.inorderTraversal((e, n) => (t(e), !1));\n }", "title": "" }, { "docid": "cefd99e1afe2823bd974c826c686aa51", "score": "0.50216377", "text": "function get_each_context(ctx, list, i) {\n\tconst child_ctx = ctx.slice();\n\tchild_ctx[4] = list[i].label;\n\tchild_ctx[5] = list[i].value;\n\treturn child_ctx;\n}", "title": "" }, { "docid": "35b71660baca751f4410a28b8d438dea", "score": "0.5007711", "text": "function Stack(){\n let items = []; //estrutura de dados array vazia \n\n //EMPILHANDO ELEMENTOS NA PILHA\n\n this.push = function(element) {\n //add um novo item \n items.push(element);\n };\n\n //DESEMPILHANDO ELEMENTOS DA PILHA\n\n this.pop = function() {\n //remove item do topo da pilha\n return items.pop();\n };\n\n //DEVOLVENDO ITEM NO TOPO DA PILHA\n\n this.peek = function() {\n //devolve elemento que está no topo da pilha\n return items[items.length - 1];\n };\n\n //VERIFICANDO SE A PILHA ESTÁ VAZIA\n\n this.isEmpty = function() {\n //devolve true se a pilha não contiver elemento e false se for > que 0\n return items.length == 0;\n };\n\n //TAMANHO DA PILHA\n\n this.size = function() {\n // devolve o numero de elementos contidos na pilha\n return items.length;\n };\n\n //LIMPANDO O ARRAY\n\n this.clear = function() {\n //remove todos elementos da pilha\n items = [];\n };\n\n //EXIBINDO ITEMS DA PILHA\n\n this.print = function() {\n //mostrar itens da pilha\n console.log(items.toString());\n \n };\n}", "title": "" }, { "docid": "9e8b6a3099d2e0c78bedd2619eb6d4c1", "score": "0.50008976", "text": "function ws_stack_vertical(d,a,b){var e=jQuery;var g=e(this);var c=e(\"li\",b);var f=e(\"<div>\").addClass(\"ws_effect ws_stack_vertical\").css({position:\"absolute\",top:0,left:0,width:\"100%\",height:\"100%\",overflow:\"hidden\"}).appendTo(b);this.go=function(q,j,i){var k=(d.revers?1:-1)*b.height();c.each(function(s){if(i&&s!=j){this.style.zIndex=(Math.max(0,this.style.zIndex-1))}});var p=e(\".ws_list\",b);var h=e(\"<div>\").css({position:\"absolute\",left:0,top:0,width:\"100%\",height:\"100%\",overflow:\"hidden\",zIndex:4}).append(e(a.get(i?q:j)).clone()),r=e(\"<div>\").css({position:\"absolute\",left:0,top:0,width:\"100%\",height:\"100%\",overflow:\"hidden\",zIndex:4}).append(e(a.get(i?j:q)).clone());if(d.responsive<3){h.find(\"img\").css(\"width\",\"100%\");r.find(\"img\").css(\"width\",\"100%\")}if(i){r.appendTo(f);h.appendTo(f)}else{h.insertAfter(p);r.insertAfter(p)}if(!i){p.stop(true,true).hide().css({left:-q+\"00%\"});if(d.fadeOut){p.fadeIn(d.duration)}else{p.show()}}else{if(d.fadeOut){p.fadeOut(d.duration)}}var o={top:i?k:0};var m={top:i?0:-k*0.5};var n={top:i?0:k};var l={top:(i?1:0)*b.height()*0.5};if(d.support.transform){o={translate:[0,o.top,0]};m={translate:[0,m.top,0]};n={translate:[0,n.top,0]};l={translate:[0,l.top,0]}}wowAnimate(h,o,n,d.duration,d.duration*(i?0:0.1),\"easeInOutExpo\",function(){g.trigger(\"effectEnd\");h.remove();r.remove()});wowAnimate(r,m,l,d.duration,d.duration*(i?0.1:0),\"easeInOutExpo\")}}", "title": "" }, { "docid": "e3bc29abf0476709096518211ad80b5e", "score": "0.49956566", "text": "forEach(callback) {\n let i = this[_cursor];\n let node = this[_front];\n let elements = node[_elements];\n while (i !== elements.length || node[_next] !== undefined) {\n if (i === elements.length) {\n // assert(node[_next] !== undefined);\n // assert(i === QUEUE_MAX_ARRAY_SIZE);\n node = node[_next];\n elements = node[_elements];\n i = 0;\n if (elements.length === 0) {\n break;\n }\n }\n callback(elements[i]);\n ++i;\n }\n }", "title": "" }, { "docid": "f7328a69cc00358bf594684b90442034", "score": "0.49739793", "text": "function get_each_context$3(ctx, list, i) {\n \tconst child_ctx = ctx.slice();\n \tchild_ctx[4] = list[i];\n \tchild_ctx[6] = i;\n \treturn child_ctx;\n }", "title": "" }, { "docid": "f14401f2fdb9e411fee9f3206312d9a9", "score": "0.49577782", "text": "function get_each_context(ctx, list, i) {\n\tconst child_ctx = ctx.slice();\n\tchild_ctx[18] = list[i];\n\treturn child_ctx;\n}", "title": "" }, { "docid": "9168d549626323c181f1a4fde3ef09c8", "score": "0.49542883", "text": "function ItemTilesInLevel() {\n stageMaster[currentPlayerLevel].forEach((item) => {\n if (item.type === \"Item\") {\n item.piece.forEach(piece => {++currentLevelItemNumber })\n }\n })\n\n\n}", "title": "" }, { "docid": "1f49cc8dcb6e9a53b505ddd2e4014cbe", "score": "0.49417987", "text": "function transferItem(tmpList, body) {\n item.resetOutput();\n let output = item.getOutput();\n for (let item of tmpList.data[0].Inventory.items) {\n // From item\n if (item._id === body.item) {\n let stackItem = 1;\n if (typeof item.upd !== \"undefined\")\n stackItem = item.upd.StackObjectsCount;\n // fixed undefined stackobjectscount\n if (stackItem === 1)\n Object.assign(item, {\"upd\": {\"StackObjectsCount\": 1}});\n if (stackItem > body.count)\n item.upd.StackObjectsCount = stackItem - body.count;\n else\n item.splice(item, 1);\n }\n // To item\n if (item._id === body.with) {\n let stackItemWith = 1;\n if (typeof item.upd !== \"undefined\")\n stackItemWith = item.upd.StackObjectsCount;\n if (stackItemWith === 1)\n Object.assign(item, {\"upd\": {\"StackObjectsCount\": 1}});\n item.upd.StackObjectsCount = stackItemWith + body.count;\n }\n }\n profile.setCharacterData(tmpList);\n return output;\n}", "title": "" }, { "docid": "acaa5cf27213fed5420b7ae7492c1cca", "score": "0.493305", "text": "function sweep(av, arr, incr, interpret) {\n var j = 0;\n var numElem = Math.ceil(arr.size() / incr);\n av.umsg(interpret(\"av_code4\") + incr);\n av.step();\n var highlightFunction = function(index) { return index % incr === j; };\n for (j = 0; j < incr; j++) { // Sort each sublist\n // Highlight the sublist\n arr.highlight(highlightFunction);\n if (j + (incr * (numElem - 1)) >= arr.size()) {\n numElem = numElem - 1;\n }\n if ((j + incr) === arr.size()) { // Only one element, don't process\n arr.unhighlight(highlightFunction);\n av.umsg(interpret(\"av_code5\"));\n av.step();\n return;\n }\n av.umsg(interpret(\"av_code6\") + numElem + interpret(\"av_code7\"));\n av.step();\n inssort(av, arr, j, incr, interpret);\n arr.removeClass(true, \"processing\");\n arr.unhighlight(highlightFunction);\n }\n}", "title": "" }, { "docid": "8370eef5964f76a158d0f604acb6cd9b", "score": "0.49313226", "text": "print() { \n let str = \"\"; \n for (var i = 0; i < this.size(); i++) \n str += this.stack[i] + \" \"; \n console.log(str); \n }", "title": "" }, { "docid": "590f81083775bc2066baee2107dd86e3", "score": "0.4922827", "text": "getChained() {\r\n let chained = [];\r\n\r\n this.forEach((block, x, y) => {\r\n if (this.isChained(x, y)) {\r\n chained.push({x: x, y: y});\r\n }\r\n });\r\n\r\n return chained;\r\n }", "title": "" }, { "docid": "bdd20b95f55fb269ca2d9733bd32f335", "score": "0.49096364", "text": "constructor() {\n this.stack = [];\n this.stackTop = null; // start from null. lastest added item's index would be the new top\n }", "title": "" }, { "docid": "5d7433a281825c8940e14c16f48e5381", "score": "0.48870498", "text": "function renderCollection(pre, post, xs, each) {\n pushLiteral(pre);\n indent += space;\n let atLeastOne = false;\n for (const [comma, item] of sepIter(xs)) {\n if (comma) {\n pushLiteral(',');\n }\n pushLineBreak();\n each(item);\n atLeastOne = true;\n }\n indent -= space;\n if (atLeastOne) {\n pushLineBreak();\n }\n pushLiteral(post);\n }", "title": "" }, { "docid": "97df232a00c5b7832cbde3fb66337706", "score": "0.48779273", "text": "push(item) {\n this.stack.push(item);\n if(this.maxesStack.peek()===null || this.maxesStack.peek()<item){\n this.maxesStack.push(item);\n }\n}", "title": "" }, { "docid": "882a8f4b6af1ba7f22d6932f01d0ed44", "score": "0.4875819", "text": "heapify() {\n if (this.size() < 2) return;\n for (let i = 1; i < this.size(); i++) {\n this.bubbleUp(i);\n }\n }", "title": "" }, { "docid": "9a594fa6bccb8e7310fd5664ed6d4a01", "score": "0.4857291", "text": "printStack() {\n\n\t\tvar str = \"\";\n\t\tfor (var i = 0; i < this.items.length; i++)\n\t\t\tstr += this.items[i] + \" \";\n\t\treturn str;\n\n\t}", "title": "" }, { "docid": "e732ff7ff5d2ad02d3b51d9cbe8dd3e7", "score": "0.48523358", "text": "forEach(callback) {\n\t\t let i = this._cursor;\n\t\t let node = this._front;\n\t\t let elements = node._elements;\n\t\t while (i !== elements.length || node._next !== undefined) {\n\t\t if (i === elements.length) {\n\t\t node = node._next;\n\t\t elements = node._elements;\n\t\t i = 0;\n\t\t if (elements.length === 0) {\n\t\t break;\n\t\t }\n\t\t }\n\t\t callback(elements[i]);\n\t\t ++i;\n\t\t }\n\t\t }", "title": "" }, { "docid": "d46b1b64a8764f21e904ca6444fa5b11", "score": "0.48518068", "text": "dealIntoNewStack()\n {\n this._cards = this._cards.reduce((newDeck, card) => {\n newDeck.unshift(card);\n return newDeck;\n }, []);\n }", "title": "" }, { "docid": "e1aef8f81d1e1a8d6465e6bc012e2633", "score": "0.48426825", "text": "function printListItems(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n list, config, indentation, depth, refs, printer) {\n let result = \"\";\n if (list.length) {\n result += config.spacingOuter;\n const indentationNext = indentation + config.indent;\n for (let i = 0; i < list.length; i++) {\n result +=\n indentationNext +\n printer(list[i], config, indentationNext, depth, refs);\n if (i < list.length - 1) {\n result += \",\" + config.spacingInner;\n }\n else if (!config.min) {\n result += \",\";\n }\n }\n result += config.spacingOuter + indentation;\n }\n return result;\n }", "title": "" }, { "docid": "6496bd14f86e2ed4b8e4910ab5ec00d7", "score": "0.48336267", "text": "function performItemOrProjectileMoves (list) {\n for (var i = list.length - 1; i >= 0; i--) {\n list[i].moveToNextPosition();\n if (list[i].outOfBounds()) {\n list[i].removeElement();\n list.splice(i, 1);\n } else {\n list[i].display();\n }\n }\n}", "title": "" }, { "docid": "a38f789d41e95b3cd280d31be56f6bdb", "score": "0.482677", "text": "*[Symbol.iterator]() {\n const nodesStack = [...this.children];\n let currentNode;\n yield this;\n while (nodesStack.length > 0) {\n currentNode = nodesStack.pop();\n yield currentNode;\n nodesStack.push(...currentNode.children);\n }\n }", "title": "" }, { "docid": "0b379f92d69e595169e42de6eee7d53c", "score": "0.48197168", "text": "function doMove(newList) {\n var mergedList = _.concat(getList(newList), activeStack.selectedtmp);\n setList(newList, mergedList);\n}", "title": "" }, { "docid": "016f1f8961429a48a4a0fa7f71b48595", "score": "0.48150566", "text": "_setOrder() {\n this.currentItem.node.style.order = '1';\n this.currentItem.node.style.zIndex = '1';\n let item = this.currentItem.node;\n let i,\n j,\n ref;\n for (\n i = j = 2, ref = this.carouselItemsArray.length; (\n 2 <= ref\n ? j <= ref\n : j >= ref); i = 2 <= ref\n ? ++j\n : --j) {\n item = this._next(item);\n item.style.order = '' + i % this.carouselItemsArray.length;\n item.style.zIndex = '0';\n }\n }", "title": "" }, { "docid": "93490a7d7e3b52ab9a3a1e41f7c990e4", "score": "0.4813767", "text": "unstack(stack) {\n\n const next = stack.pop()\n if(!next) return Promise.resolve()\n\n return next()\n .then(() => this.unstack(stack))\n }", "title": "" }, { "docid": "56fde5b5aa282111dfd35ab9c2cc5105", "score": "0.4813061", "text": "moveStack(height, fromStack, toStack, withStack){\n if (height >= 1) {\n this.moveStack(height - 1, fromStack, withStack, toStack)\n let counter = JSON.parse(JSON.stringify(this.counter))\n this.all_moves.push([fromStack, toStack, this.counter])\n this.counter += 1\n this.moveStack(height - 1, withStack, toStack, fromStack)\n }\n }", "title": "" }, { "docid": "8aa54e74dfe5dc4d2d2e2570f86f7b2f", "score": "0.47970456", "text": "bubbleUp() {\n let index = this.list.length - 1\n\t\tlet parent = Math.floor((index-1)/2)\n\t\twhile (parent >= 0 && this.list[parent] > this.list[index]) {\n\t\t\tlet temp = this.list[parent]\n\t\t\tthis.list[parent] = this.list[index]\n\t\t\tthis.list[index] = temp\n\t\t\tindex = parent\n\t\t\tparent = Math.floor((index-1)/2)\n\t\t}\n }", "title": "" }, { "docid": "e39dc2cdc3258678ad009c586c33f030", "score": "0.47912017", "text": "function get_each_context_1$1(ctx, list, i) {\n \tconst child_ctx = ctx.slice();\n \tchild_ctx[23] = list[i];\n \tchild_ctx[25] = i;\n \treturn child_ctx;\n }", "title": "" }, { "docid": "5c46b7259374a457aef7b8556f215b13", "score": "0.4783488", "text": "function list2stack(head) {\n const stack = [];\n do {\n stack.push(head);\n head = head.next;\n } while (head);\n return stack;\n}", "title": "" }, { "docid": "16109c24932c33a82764643459cf267f", "score": "0.47830123", "text": "visitSubpartition_by_list(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "ea146d008bdff0536a1d57a59c1a41b1", "score": "0.47792527", "text": "push(dataItem){\n this.stack.push(dataItem)\n this.topIndex += 1\n }", "title": "" }, { "docid": "a794f46681cac600ba74a18772d1b410", "score": "0.4769534", "text": "push(element) {\r\n //this.stack.push(element);\r\n this.stack.unshift(element);\r\n }", "title": "" }, { "docid": "96f6cb11ae0fcf58431809aa37acee59", "score": "0.47662416", "text": "forEach(fn) {\r\n let node = this.head;\r\n while (node) {\r\n fn(node.value);\r\n node = node.next;\r\n }\r\n }", "title": "" }, { "docid": "571fb80484430c901cbe186d6e3c721b", "score": "0.4746681", "text": "forEach(t){this.data.inorderTraversal((e,n)=>(t(e),!1));}", "title": "" }, { "docid": "f46ec15c94317f2cbb604ebb0ecfa4d8", "score": "0.47433075", "text": "traversePreorder(node, list) {\n list.push(node.value);\n if (node.left) this.traversePreorder(node.left, list);\n if (node.right) this.traversePreorder(node.right, list);\n\n return list;\n }", "title": "" }, { "docid": "1bd4ec6c2f8e68b1d3e1525f8235910f", "score": "0.47357824", "text": "function isStacked() {\n return opts.transform === \"stack\";\n }", "title": "" }, { "docid": "9bd97a2ca59cecad85ab86c2b8552f05", "score": "0.4728789", "text": "function compressBoxesTwice(boxes) {\r\n boxes.forEach(function(boxes) {\r\n console.log(boxes);\r\n });\r\n\r\n boxes.forEach(function(boxes) {\r\n console.log(boxes);\r\n });\r\n}", "title": "" }, { "docid": "acca8b2dc7b92e01d6210c63156a0acc", "score": "0.47217378", "text": "pushTokens(tokens: Token[]) {\n this.stack.push(...tokens);\n }", "title": "" }, { "docid": "4c1f5317a682c6a5f05a4e6cd4fb935c", "score": "0.4721425", "text": "function swapNodes(list) {\n\treturn list;\n}", "title": "" }, { "docid": "4fb879e928cbfbfd14eb75af98529e20", "score": "0.47211882", "text": "function SWAP(state) {\n\t var stack = state.stack;\n\n\t var a = stack.pop();\n\t var b = stack.pop();\n\n\t if (exports.DEBUG) { console.log(state.step, 'SWAP[]'); }\n\n\t stack.push(a);\n\t stack.push(b);\n\t}", "title": "" }, { "docid": "8e3e778b1a7e82d089858b90c9f8c9bd", "score": "0.4716968", "text": "function step3() {\n console.log('step3');\n pts = swap;\n\n c = pts;\n\n if (offset + block * 2 < nmemb) {\n c_max = c + block * 2;\n\n d = c_max;\n d_max = offset + block * 4 <= nmemb ? d + block * 2 : pts + nmemb - offset;\n\n if (cmp(tmp[c_max - 1], tmp[d_max - 1]) <= 0) {\n while (c < c_max) {\n while (cmp(tmp[c], tmp[d]) > 0) {\n\t\t\t\t\t\t\t list[pta++] = tmp[d++];\n }\n\t\t\t\t\t\t list[pta++] = tmp[c++];\n }\n while (d < d_max) {\n list[pta++] = tmp[d++];\n }\n }\n else if (cmp(tmp[c], tmp[d_max - 1]) > 0) {\n while (d < d_max) {\n list[pta++] = tmp[d++];\n }\n while (c < c_max) {\n list[pta++] = tmp[c++];\n }\n }\n else {\n while (d < d_max) {\n while (cmp(tmp[d], tmp[c]) > 0) {\n\t\t\t\t\t\t\t list[pta++] = list[c++];\n }\n\t\t\t\t\t\t list[pta++] = tmp[d++];\n }\n while (c < c_max) {\n list[pta++] = tmp[c++];\n }\n }\n }\n else {\n d_max = pts + nmemb - offset;\n\n while (c < d_max) {\n list[pta++] = tmp[c++];\n }\n }\n offset += block * 4;\n }", "title": "" }, { "docid": "e06f900cd78f13596e3b0c5a634ddb7b", "score": "0.47155246", "text": "getUnderlyingList() {\n\n let head = new ListNode(this.items[0]);\n let currentItem = head;\n\n for (let i = 1; i < this.items.length; i++) {\n let newNode = new ListNode(this.items[i]);\n currentItem.next = newNode;\n currentItem = newNode;\n }\n \n return head;\n \n }", "title": "" }, { "docid": "3c971085ffb227b737353e3da6a4811f", "score": "0.47104645", "text": "function splitItem(tmpList, body) { // -> Spliting item / Create new item with splited amount and removing that amount from older one\n item.resetOutput();\n let output = item.getOutput();\n let location = body.container.location;\n if (typeof body.container.location === \"undefined\" && body.container.container === \"cartridges\") {\n let tmp_counter = 0;\n for (let item_ammo in tmpList.data[0].Inventory.items) {\n if (tmpList.data[0].Inventory.items[item_ammo].parentId === body.container.id)\n tmp_counter++;\n }\n location = tmp_counter;//wrong location for first cartrige\n }\n for (let item of tmpList.data[0].Inventory.items) {\n if (item._id && item._id === body.item) {\n item.upd.StackObjectsCount -= body.count;\n let newItem = utility.generateNewItemId();\n output.data.items.new.push({\n \"_id\": newItem,\n \"_tpl\": item._tpl,\n \"parentId\": body.container.id,\n \"slotId\": body.container.container,\n \"location\": location,\n \"upd\": {\"StackObjectsCount\": body.count}\n });\n tmpList.data[0].Inventory.items.push({\n \"_id\": newItem,\n \"_tpl\": item._tpl,\n \"parentId\": body.container.id,\n \"slotId\": body.container.container,\n \"location\": location,\n \"upd\": {\"StackObjectsCount\": body.count}\n });\n profile.setCharacterData(tmpList);\n return output;\n }\n }\n\n return \"\";\n}", "title": "" }, { "docid": "a049c0788ac2fffc72fb3ab7f2b78c3b", "score": "0.4710141", "text": "forEach(fn) {\n let node = this.head;\n let counter = 0;\n while (node) {\n fn(node, counter);\n node = node.next;\n counter++;\n }\n }", "title": "" }, { "docid": "13dcacaf38665c81447a627a577cbe87", "score": "0.46989316", "text": "generateEach (list, depth) {\n for (let node of list) {\n generate(this, node, depth);\n }\n return this;\n }", "title": "" }, { "docid": "052c108ada2f4d7db6f66fb2110a8e67", "score": "0.46924862", "text": "topologicalSort() { \n const stack = new Stack(); \n\n // Mark all the vertices as not visited \n const visited = {}; \n for(let v in this.adjacencyList){\n visited[v] = false;\n }\n\n // Call the recursive helper function to store \n // Topological Sort starting from all vertices \n // one by one \n for(let v in this.adjacencyList){ \n if (visited[v] == false){\n this.topologicalSortUtil(v, visited, stack); \n }\n }\n // Print contents of stack \n while (stack.isEmpty()===false) {\n console.log(stack.pop() + \" \"); \n }\n \n }", "title": "" }, { "docid": "c15708068fc49d480ae04f737052c0a4", "score": "0.4686421", "text": "function loopPreOrder(thisArg, onItem) { // onItem(nodeid, node, parentid, parent) if function returns true loop exits\n\t\tvar stack = [], nodeid,\n\t\t\tkey,\n\t\t\tindex,\n\t\t\tprevParent,\n\t\t\tchildren;\n\n\t\tif (onItem != null) {\n\n\t\t\tfor (key in _rootChildren) {\n\t\t\t\tif (_rootChildren.hasOwnProperty(key)) {\n\t\t\t\t\tstack = stack.concat(_rootChildren[key]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twhile (stack.length > 0) {\n\t\t\t\tnodeid = stack[stack.length - 1];\n\t\t\t\tif (nodeid != prevParent) {\n\t\t\t\t\tif (onItem.call(thisArg, nodeid, _nodes[nodeid], prevParent, _nodes[prevParent])) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (nodeid != prevParent && (children = _children[nodeid]) != null) {\n\t\t\t\t\tfor (index = children.length - 1; index >= 0; index -= 1) {\n\t\t\t\t\t\tstack.push(children[index]);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tstack.pop();\n\t\t\t\t\tprevParent = _parents[nodeid];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "5f930291b46fc5eea39f008c9b742943", "score": "0.46861264", "text": "assignColors(resultList) {\n let colorindex = 0;\n var assigned = [];\n\n for (let index = resultList.length - 1; index >= 0; index--) {\n let item = resultList[index];\n if (item.depth == 1) {\n item.color = Constants.COLORS[colorindex];\n colorindex = (colorindex + 1) % Constants.COLORS.length;\n\n assigned.push(item);\n }\n }\n\n return assigned;\n }", "title": "" }, { "docid": "114b7c519e6246c7a389ac1ca906d97a", "score": "0.46829247", "text": "bubbleUp() {\n let index = this.size - 1;\n const parent = (i) => Math.ceil(i / 2 - 1);\n while (parent(index) >= 0 && this.comparator(parent(index), index) > 0) {\n this.swap(parent(index), index);\n index = parent(index);\n }\n }", "title": "" }, { "docid": "114b7c519e6246c7a389ac1ca906d97a", "score": "0.46829247", "text": "bubbleUp() {\n let index = this.size - 1;\n const parent = (i) => Math.ceil(i / 2 - 1);\n while (parent(index) >= 0 && this.comparator(parent(index), index) > 0) {\n this.swap(parent(index), index);\n index = parent(index);\n }\n }", "title": "" }, { "docid": "5062d23a91b6afff8a27979bb6ae0a7f", "score": "0.4682359", "text": "constructor(){\n this.stack = []\n this.topIndex = -1\n }", "title": "" }, { "docid": "8409223370001003309c5867d55e640b", "score": "0.46817526", "text": "function processGroup(item) {\n ar.push(item)\n //ar.push({text:item.text,type:'group'})\n item.item.forEach(function(child){\n if (child.type == 'group') {\n processGroup(child)\n } else {\n ar.push(child)\n }\n })\n\n\n\n }", "title": "" }, { "docid": "02001b4589a470ec03bbde8c05c3675e", "score": "0.4673928", "text": "function get_each_context$1(ctx, list, i) {\n\tconst child_ctx = ctx.slice();\n\tchild_ctx[18] = list[i];\n\treturn child_ctx;\n}", "title": "" }, { "docid": "ec65de004a648fa285c4a05ee83399ac", "score": "0.46656796", "text": "push(item) {\n console.log(`Item inserted at position: ${this.items.push(item)} in stack`);\n }", "title": "" }, { "docid": "356f3ff53098c403df7803ce8eb3dc17", "score": "0.46632323", "text": "updateStack() {}", "title": "" }, { "docid": "9406a50722112e4d32f65048e11e2ed4", "score": "0.46559483", "text": "printList() \n { \n var curr = this.head; \n var str = \"\"; \n while (curr) { \n str += curr.element + \" \"; \n curr = curr.next; \n } \n console.log(str); \n }", "title": "" }, { "docid": "4cf83063f0307c269d955193e14ff101", "score": "0.46555245", "text": "forEach(callback, container = this) {\n let i = 0;\n let node = this._head();\n while (node !== this._sentinel) {\n callback(node.element, i, container);\n i += 1;\n node = node.next;\n }\n }", "title": "" }, { "docid": "b012ad2d418a2701378f3795c9bc5b2a", "score": "0.4653062", "text": "function printListItems(list, config, indentation, depth, refs, printer) {\n var result = '';\n\n if (list.length) {\n result += config.spacingOuter;\n var indentationNext = indentation + config.indent;\n\n for (var i = 0; i < list.length; i++) {\n result += indentationNext + printer(list[i], config, indentationNext, depth, refs);\n\n if (i < list.length - 1) {\n result += ',' + config.spacingInner;\n } else if (!config.min) {\n result += ',';\n }\n }\n\n result += config.spacingOuter + indentation;\n }\n\n return result;\n}", "title": "" }, { "docid": "b012ad2d418a2701378f3795c9bc5b2a", "score": "0.4653062", "text": "function printListItems(list, config, indentation, depth, refs, printer) {\n var result = '';\n\n if (list.length) {\n result += config.spacingOuter;\n var indentationNext = indentation + config.indent;\n\n for (var i = 0; i < list.length; i++) {\n result += indentationNext + printer(list[i], config, indentationNext, depth, refs);\n\n if (i < list.length - 1) {\n result += ',' + config.spacingInner;\n } else if (!config.min) {\n result += ',';\n }\n }\n\n result += config.spacingOuter + indentation;\n }\n\n return result;\n}", "title": "" }, { "docid": "052fb95ce4ad780af02d50dd976a28bf", "score": "0.4641346", "text": "forEach(fn){\n let node = this.head;\n let counter = 0;\n\n while(node){\n fn(node, counter);\n node = node.next;\n counter++;\n }\n }", "title": "" }, { "docid": "172b6cc11c24f066b7712e91b4f78fb4", "score": "0.46361503", "text": "function loopLevels(thisArg, parentAligned, onItem) { // onItem(itemid, item, levelIndex)\n\t\tvar topoSorted = [],\n\t\t\ttopoSortedPositions = {},\n\t\t\tprocessed = {},\n\t\t\tmargin = [],\n\t\t\t/* result items distribution by levels */\n\t\t\tlevels = {}, levelIndex,\n\t\t\tgroups = {}, hasGroups, newGroups, groupIndex, group,\n\t\t\titemsAtLevel, itemid,\n\t\t\tminimumLevel = null,\n\t\t\tloopFunc = parentAligned ? loopTopo : loopTopoReversed,\n\t\t\tindex, len,\n\t\t\tmIndex, mLen, mItem, mLevel,\n\t\t\ttopoSortedItem,\n\t\t\tbestPosition, bestItem, bestLevel, bestIsParent,\n\t\t\tnewMargin, hasNeighbours;\n\n\t\tfunction Group() {\n\t\t\tthis.items = {};\n\t\t\tthis.minimumLevel = null;\n\t\t}\n\n\t\tGroup.prototype.addItemToLevel = function (itemid, level) {\n\t\t\tvar items = this.items[level];\n\t\t\tif (!items) {\n\t\t\t\titems = [itemid];\n\t\t\t\tthis.items[level] = items;\n\t\t\t} else {\n\t\t\t\titems.push(itemid);\n\t\t\t}\n\t\t\tthis.minimumLevel = this.minimumLevel == null ? level : Math.min(this.minimumLevel, level);\n\t\t};\n\n\t\tfunction addItemToLevel(itemid, index, level) {\n\t\t\tvar group = groups[index];\n\t\t\tif (!group) {\n\t\t\t\tgroup = new Group();\n\t\t\t\tgroups[index] = group;\n\t\t\t}\n\n\t\t\tgroup.addItemToLevel(itemid, level);\n\n\t\t\tminimumLevel = minimumLevel == null ? level : Math.min(minimumLevel, level);\n\n\t\t\tlevels[itemid] = level;\n\t\t\tprocessed[itemid] = true;\n\t\t}\n\n\n\t\tif (onItem != null) {\n\t\t\t/* sort items topologically */\n\t\t\tloopFunc(this, function (itemid, item, position) {\n\t\t\t\ttopoSorted.push(itemid);\n\t\t\t\ttopoSortedPositions[itemid] = position;\n\t\t\t});\n\n\t\t\t/* search for the first available non processed item in topological order */\n\t\t\tfor (index = 0, len = topoSorted.length; index < len; index += 1) {\n\t\t\t\ttopoSortedItem = topoSorted[index];\n\t\t\t\tif (processed[topoSortedItem] == null) {\n\t\t\t\t\tmargin.push(topoSortedItem);\n\n\t\t\t\t\taddItemToLevel(topoSortedItem, index, 0);\n\n\t\t\t\t\t/* use regular graph breadth first search */\n\t\t\t\t\twhile (margin.length > 0) {\n\t\t\t\t\t\tbestPosition = null;\n\t\t\t\t\t\tbestItem = null;\n\t\t\t\t\t\tbestLevel = null;\n\t\t\t\t\t\tbestIsParent = !parentAligned;\n\t\t\t\t\t\tnewMargin = [];\n\t\t\t\t\t\tfor (mIndex = 0, mLen = margin.length; mIndex < mLen; mIndex += 1) {\n\t\t\t\t\t\t\tmItem = margin[mIndex];\n\t\t\t\t\t\t\tmLevel = levels[mItem];\n\t\t\t\t\t\t\thasNeighbours = false;\n\n\t\t\t\t\t\t\tif (parentAligned) {\n\t\t\t\t\t\t\t\t_loop(this, _parents, mItem, function (parentid) {\n\t\t\t\t\t\t\t\t\tvar topoSortedPosition;\n\t\t\t\t\t\t\t\t\tif (!processed[parentid]) {\n\t\t\t\t\t\t\t\t\t\thasNeighbours = true;\n\t\t\t\t\t\t\t\t\t\ttopoSortedPosition = topoSortedPositions[parentid];\n\t\t\t\t\t\t\t\t\t\tif (bestPosition == null || !bestIsParent || bestPosition < topoSortedPosition || (bestPosition == topoSortedPosition && bestLevel > mLevel - 1)) {\n\t\t\t\t\t\t\t\t\t\t\tbestPosition = topoSortedPosition;\n\t\t\t\t\t\t\t\t\t\t\tbestItem = parentid;\n\t\t\t\t\t\t\t\t\t\t\tbestLevel = mLevel - 1;\n\t\t\t\t\t\t\t\t\t\t\tbestIsParent = true;\n\t\t\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}); //ignore jslint\n\t\t\t\t\t\t\t\t_loop(this, _children, mItem, function (childid) {\n\t\t\t\t\t\t\t\t\tvar topoSortedPosition;\n\t\t\t\t\t\t\t\t\tif (!processed[childid]) {\n\t\t\t\t\t\t\t\t\t\thasNeighbours = true;\n\t\t\t\t\t\t\t\t\t\ttopoSortedPosition = topoSortedPositions[childid];\n\t\t\t\t\t\t\t\t\t\tif (bestPosition == null || (!bestIsParent && (bestPosition > topoSortedPosition || (bestPosition == topoSortedPosition && bestLevel < mLevel + 1)))) {\n\t\t\t\t\t\t\t\t\t\t\tbestPosition = topoSortedPosition;\n\t\t\t\t\t\t\t\t\t\t\tbestItem = childid;\n\t\t\t\t\t\t\t\t\t\t\tbestLevel = mLevel + 1;\n\t\t\t\t\t\t\t\t\t\t\tbestIsParent = false;\n\t\t\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}); //ignore jslint\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t_loop(this, _children, mItem, function (childid) {\n\t\t\t\t\t\t\t\t\tvar topoSortedPosition;\n\t\t\t\t\t\t\t\t\tif (!processed[childid]) {\n\t\t\t\t\t\t\t\t\t\thasNeighbours = true;\n\t\t\t\t\t\t\t\t\t\ttopoSortedPosition = topoSortedPositions[childid];\n\t\t\t\t\t\t\t\t\t\tif (bestPosition == null || bestIsParent || bestPosition < topoSortedPosition || (bestPosition == topoSortedPosition && bestLevel < mLevel + 1)) {\n\t\t\t\t\t\t\t\t\t\t\tbestPosition = topoSortedPosition;\n\t\t\t\t\t\t\t\t\t\t\tbestItem = childid;\n\t\t\t\t\t\t\t\t\t\t\tbestLevel = mLevel + 1;\n\t\t\t\t\t\t\t\t\t\t\tbestIsParent = false;\n\t\t\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}); //ignore jslint\n\t\t\t\t\t\t\t\t_loop(this, _parents, mItem, function (parentid) {\n\t\t\t\t\t\t\t\t\tvar topoSortedPosition;\n\t\t\t\t\t\t\t\t\tif (!processed[parentid]) {\n\t\t\t\t\t\t\t\t\t\thasNeighbours = true;\n\t\t\t\t\t\t\t\t\t\ttopoSortedPosition = topoSortedPositions[parentid];\n\t\t\t\t\t\t\t\t\t\tif (bestPosition == null || (bestIsParent && (bestPosition > topoSortedPosition || (bestPosition == topoSortedPosition && bestLevel > mLevel - 1)))) {\n\t\t\t\t\t\t\t\t\t\t\tbestPosition = topoSortedPosition;\n\t\t\t\t\t\t\t\t\t\t\tbestItem = parentid;\n\t\t\t\t\t\t\t\t\t\t\tbestLevel = mLevel - 1;\n\t\t\t\t\t\t\t\t\t\t\tbestIsParent = true;\n\t\t\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}); //ignore jslint\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (hasNeighbours) {\n\t\t\t\t\t\t\t\tnewMargin.push(mItem);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (bestItem != null) {\n\t\t\t\t\t\t\tnewMargin.push(bestItem);\n\n\t\t\t\t\t\t\taddItemToLevel(bestItem, index, bestLevel);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmargin = newMargin;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\thasGroups = true;\n\t\t\tlevelIndex = minimumLevel;\n\t\t\twhile (hasGroups) {\n\t\t\t\tnewGroups = {};\n\t\t\t\thasGroups = false;\n\t\t\t\tfor (groupIndex in groups) {\n\t\t\t\t\tif (groups.hasOwnProperty(groupIndex)) {\n\t\t\t\t\t\tgroup = groups[groupIndex];\n\t\t\t\t\t\titemsAtLevel = group.items[(group.minimumLevel - minimumLevel) + levelIndex];\n\t\t\t\t\t\tif (itemsAtLevel != null) {\n\t\t\t\t\t\t\tnewGroups[groupIndex] = group;\n\t\t\t\t\t\t\thasGroups = true;\n\n\t\t\t\t\t\t\tfor (index = 0, len = itemsAtLevel.length; index < len; index += 1) {\n\t\t\t\t\t\t\t\titemid = itemsAtLevel[index];\n\t\t\t\t\t\t\t\tif (onItem.call(thisArg, itemid, _nodes[itemid], levelIndex - minimumLevel)) {\n\t\t\t\t\t\t\t\t\thasGroups = false;\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tgroups = newGroups;\n\t\t\t\tlevelIndex += 1;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "fac354b653f222d9e14556acb5c3e320", "score": "0.46302783", "text": "[printShoppingItems]($parent, list) {\n for (let a of list.shoppingItems) {\n this[printShoppingItem]($parent, a);\n }\n }", "title": "" }, { "docid": "4d01ef2487d454f84f4c389962c0572a", "score": "0.4629677", "text": "push(el){\n //create a new node with the el\n let newNode = new Node(el)\n //if there are no nodes in the stack, set the first and last element to be the newly created node\n if(!this.first){\n this.first = newNode; \n this.last = newNode\n } else {\n // create a var that stores the current first element on the stack\n let temp = this.first; \n //reset the first el to be the newly created node\n this.first = newNode; \n //set the next el on the node to be the previously created variable\n this.first.next = temp\n }\n // increment the size of the stack by 1\n return ++this.top\n }", "title": "" } ]
55c11b2d934c1885753e0706727b8824
end of draw face hammer time: resize and reposition canvas by customer
[ { "docid": "b55ba25a3a6d45c5b16d0d5b734b54b2", "score": "0.0", "text": "function hammerInit(posX, posY, rotation) {\n\t\t\t// create backing canvas\n\t\t\t \n\t\t\t var savedData = document.getElementById('savedata');\n\t\t\t \n\t\t\t setTimeout(function(){\n\t\t\t savedData.src = backcanvas.toDataURL(\"image/png\");\n\t\t\t $('#savedata').hide();\n\t\t\t },500);\n\t\t\t \n\t\t\t var hammertime = Hammer(document.getElementById(\"face-wrapper\"), {\n\t\t\t transform_always_block: true,\n\t\t\t drag_block_horizontal: true,\n\t\t\t drag_block_vertical: true,\n\t\t\t drag_min_distance: 10\n\t\t\t });\n\t\t\t var posX=posX, posY=posY,last_posX=posX,last_posY=posY, startX = posX, startY = posY,\n\t\t\t scale=1, last_scale=1,\n\t\t\t rotation= rotation, last_rotation=rotation\n\t\t\t _width = backcanvas.width, _height = backcanvas.height;\n\t\t\t var touchEd = false;\t\t\t \n\t\t\t \n\t\t\t \n\t\t\t hammertime.get('pinch').set({ enable: true });\n\t\t hammertime.get('rotate').set({ enable: true });\n\t\t\t hammertime.on(\"tap pan rotate pinch\", function(ev) {\n\n\t\t\t \t\n\t\t\t \t//console.log(ev);\n\t\t\t switch(ev.type) {\n\t\t\t case 'tap':\n\t\t\t \tconsole.log($('#backcanvas'));\n\t\t\t last_scale = scale;\n\t\t\t last_rotation = rotation;\n\t\t\t last_posX = posX;\n\t\t\t last_posY = posY;\n\t\t\t //$(\"#backcanvas\").hide();\n\t\t\t touchEd = true;\n\t\t\t break;\n\t\t\t case 'pan':\n\t\t\t \t\n\t\t\t posX = Math.abs(ev.deltaX) > 10 ? ev.deltaX+last_posX : last_posX;\n\t\t\t posY = Math.abs(ev.deltaY) > 10 ? ev.deltaY+last_posY : last_posY;\n\t\t\t //posX = Math.min( 80, Math.max(posX, _width - 30 - ((1-last_scale)*_width/2) ) );\n\t\t\t \t//posY = Math.min(100 + startY, Math.max(posY, -125 + startY) );\n\t\t\t \t//console.log(posX)\n\t\t\t backcvsTrans(posX,posY,last_scale,last_rotation);\n\t\t\t break;\n\t\t\t \n\t\t\t case 'rotate':\n\t\t\t \t//console.log(posX);\n\t\t\t rotation = Math.abs(ev.rotation)<120 ? ev.rotation + last_rotation : last_rotation;\n\t\t\t //console.log(rotation);\n\t\t\t backcvsTrans(posX,posY,last_scale,rotation);\t\t\t \n\t\t\t break;\n\t\t\t \n\t\t\t case 'pinch':\n\t\t\t \t//console.log(ev.rotation);\n\t\t\t \tscale = Math.max(0.6, Math.min(last_scale * ev.scale, 2));\n\t\t\t \t\n\t\t\t \tbackcvsTrans(posX,posY,scale,rotation);\n\t\t\t \tbreak;\n\t\t\t }\n\t\t\t \n\n\t\t\t hammertime.on('panend pinchend rotateend', function(){\n\t\t\t \tlast_scale = scale;\n\t\t\t last_rotation = rotation;\n\t\t\t last_posX = posX;\n\t\t\t last_posY = posY;\n\t\t\t //$(\"#backcanvas\").hide();\n\t\t\t touchEd = true;\n\t\t\t })\n\t\t\t \n\n\t\t\t });\n\n\t\t\t}", "title": "" } ]
[ { "docid": "348b8737d69a96912e1d4ad28d404e65", "score": "0.68353", "text": "function windowResized() {\r\n centerCanvas();\r\n}", "title": "" }, { "docid": "549d61a1beb5e230bd58d64312c4846f", "score": "0.6766109", "text": "function windowResized() {\n centerCanvas();\n}", "title": "" }, { "docid": "df4db0ba418320213ccdea42b8429889", "score": "0.67649484", "text": "function windowResized() {\n // Re-position canvas in middle of screen\n c.position(windowWidth/2-width/2, windowHeight/2-height/2);\n}", "title": "" }, { "docid": "c8c9a1ad46f72f78002a0bf35078ea1c", "score": "0.67525226", "text": "updateCanvas() {\n this.shootAreaCtx.putImageData(this.shootAreaData, 0, 0);\n }", "title": "" }, { "docid": "7a5c3cb3d2bbebb53f80e4ab0b330c82", "score": "0.66836596", "text": "function windowResized(){//\n resizeCanvas(windowWidth, windowHeight);//ReDefine the canvas size\n}", "title": "" }, { "docid": "2d92596acc034b7d060cb4ca75717f25", "score": "0.6677387", "text": "function windowResized() {\n\tcenterCanvas();\n}", "title": "" }, { "docid": "37602efc376b1157daf3de3e2b3dc7ea", "score": "0.665225", "text": "afterDraw(){}", "title": "" }, { "docid": "e99445e8e3a695b49f59af32fe4861ca", "score": "0.6651039", "text": "resetCanvas() {\n this.positions = this.calcSizeAndPosition();\n }", "title": "" }, { "docid": "1f2128c260ac50d607237a08389f6ec5", "score": "0.66452825", "text": "_refreshCanvasSize() {\n this._width = this._canvas.scrollWidth;\n this._height = this._canvas.scrollHeight;\n }", "title": "" }, { "docid": "b4d5f59c8c330f6fa2199c4185477e20", "score": "0.6635523", "text": "function resize(event)\n{\n canvas.width = 1.4*canvas.clientWidth; // set canvas logical size equal to its physical size\n canvas.height = 0.86*canvas.clientWidth; // (ditto)\n dx = canvas.width / nx; // pixel size of a single game block\n dy = canvas.height / ny; // (ditto)\n invalidate();\n invalidateNext();\n}", "title": "" }, { "docid": "4c481afe8ef4166886b5b0dfdeeed6d5", "score": "0.6616611", "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": "4c481afe8ef4166886b5b0dfdeeed6d5", "score": "0.6616611", "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": "3d6e49389f23f3a18c8851b8f03a4f74", "score": "0.6613537", "text": "_refreshCanvas() {\n this._refreshCanvasSize();\n this.renderCanvas();\n }", "title": "" }, { "docid": "b74e2b93fbc04ae5e9eb1297b09d208b", "score": "0.66004086", "text": "function onResize(win) {\n if (State.vrDisplay && State.vrDisplay.isPresenting) {\n var canvas = win.getContext().getGL().canvas;\n var leftEye = State.vrDisplay.getEyeParameters(\"left\");\n var rightEye = State.vrDisplay.getEyeParameters(\"right\");\n canvas.width = Math.max(leftEye.renderWidth, rightEye.renderWidth) * 2 * win.getPixelRatio();\n canvas.height = Math.max(leftEye.renderHeight, rightEye.renderHeight) * win.getPixelRatio();\n\n //prevent iOS Safari bars from showing after rotation\n canvas.style.position = 'relative';\n canvas.parentNode.style.position = 'relative';\n }\n}", "title": "" }, { "docid": "f78f171e6a1745b77d19fd113ff37c67", "score": "0.65986824", "text": "function onResize() {\n canvas.width = $canvas.width();\n canvas.height = $canvas.height();\n}", "title": "" }, { "docid": "54b9d7c1ba3d7e1b8fbefc73ca518d2e", "score": "0.6595371", "text": "function windowResized() {\n centerCanvas();\n //resizeCanvas(windowWidth, windowHeight);\n setup();\n}", "title": "" }, { "docid": "d0e362efc9414fdcb5bcc06328fc779a", "score": "0.65569466", "text": "function doneResizing() {\n that.width = that.container.clientWidth;\n that.height = that.container.clientHeight;\n\n canv.setAttribute('width', that.width);\n canv.setAttribute('height', that.height);\n\n that.drawScale();\n }", "title": "" }, { "docid": "36e4becb578ca438fe213e2b2609cdd8", "score": "0.65196574", "text": "function windowResized(){\n canvas_width = windowWidth;\n canvas_height = windowHeight;\n canvas_reference=createCanvas(canvas_width, canvas_height, WEBGL); //Temporary Necessary Evil\n centerCanvas();\n}", "title": "" }, { "docid": "0fee2486d136cbea2ee4ced11a408504", "score": "0.65112954", "text": "function sketchpad_resize() {\n //set canvas sizes - fixes scale bug with mouse events\n canvas.width = canvas.clientWidth;\n canvas.height = canvas.clientHeight;\n\n //redraw the painting on new canvas sizes\n reDraw();\n }", "title": "" }, { "docid": "a85b4fa040d47622722d19c065aaab72", "score": "0.65031874", "text": "function canvasResize(){\n\t\t\t\t\t\tscreenWidth = window.innerWidth;\n\t\t\t\t\t\tscreenHeight = window.innerHeight;\n\n\t\t\t\t\t\tcanvasPosition = canvas.getBoundingClientRect(); // Gets the canvas position\n\t\t\t\t\t\tcanvas.width = screenWidth;\n\t\t\t\t\t\tcanvas.height = screenHeight;\n\t\t\t\t\t}", "title": "" }, { "docid": "fae86e0dee67ce6553041518fa37d4a3", "score": "0.6502623", "text": "function windowResized() {\r\n // While setting the canvas width/height, the drawing is cleared\r\n canvas.width = canvas.offsetWidth;\r\n canvas.height = canvas.offsetHeight;\r\n\r\n // We manually trigger a hue change because the fill/stroke color is cleared too\r\n colorChanged();\r\n }", "title": "" }, { "docid": "cc72e52476809d5b9136ab1bca6eaabd", "score": "0.6502418", "text": "function updateCanvasSize(){\n\n canvas.width = params.width;\n canvas.height = params.height;\n\n zoomCanvas();\n\n params.width = canvas.width;\n params.height = canvas.height;\n gl.viewport( 0, 0, canvas.width, canvas.height );\n createRenderTargets();\n params.step = 0;\n params.doConfig = 1;\n }", "title": "" }, { "docid": "cb7a6d04272ce208243b8aab3143b9ec", "score": "0.65018713", "text": "function windowResized() {\nresizeCanvas(windowWidth, windowHeight);\n}", "title": "" }, { "docid": "917bbe09df4fb7080698bff23b2de39f", "score": "0.6498103", "text": "function onresize(w,h)\n{\n\tbang(); // draw and refresh display\n}", "title": "" }, { "docid": "b9d37fea73cf9b30eb9b8bfbdeb5df3b", "score": "0.6478888", "text": "function doRedraw (){\n encoder.addFrame(canvas.getContext(\"2d\"));\n }", "title": "" }, { "docid": "33995f7f85ace72f1347f14f593223b5", "score": "0.64762366", "text": "function resizeCanvas() {\n canvas.height= window.innerHeight;\n canvas.width= window.innerWidth;\n dl.redraw();\n }", "title": "" }, { "docid": "ac8edc4eca8a59a976ceaabd7a5251dc", "score": "0.6463769", "text": "function updateSize() {\n canvas.width = w();\n canvas.height = h();\n }", "title": "" }, { "docid": "b0228e22fc8455f934a313091689548e", "score": "0.6461574", "text": "function updateCanvasDimensions() {\n\tcanvas.attr({\n\t\t//height : 500,\n\t\t//width : 1000\n\t\theight : 200,\n\t\twidth : 600\n\t});\n\tcanvasWidth = canvas.width();\n\tcanvasHeight = canvas.height();\n\tdraw();\n}", "title": "" }, { "docid": "c74079573618a36eca9eeb3c52b8b406", "score": "0.6457773", "text": "function windowResized()\n{\n\tcreateCanvas(windowWidth, windowHeight);\n}", "title": "" }, { "docid": "710a16920b7984b8e6164fc8c70b58a3", "score": "0.6457704", "text": "function onResize() {\n console.log('onResize')\n canvas_style = window.getComputedStyle(canvas)\n canvas.width = canvas_style.width.split('.')[0].replace('px', '')\n canvas.height = canvas_style.height.split('.')[0].replace('px', '')\n //console.log(canvas.width, canvas.height);\n //canvas.width = window.innerWidth;\n //canvas.height = window.innerHeight;\n let canvas_box = canvas.getBoundingClientRect();\n\n var w = canvas.width;\n var h = canvas.height;\n for (var i = 0; i < draw_queue.length; i++) {\n drawLine(\n draw_queue[i].x0 * w + canvas_box.x,\n draw_queue[i].y0 * h + canvas_box.y,\n draw_queue[i].x1 * w + canvas_box.x,\n draw_queue[i].y1 * h + canvas_box.y,\n draw_queue[i].color,\n false,\n true\n );\n }\n }", "title": "" }, { "docid": "fabfb1028e5b4047f457697acf263ef0", "score": "0.64543235", "text": "function resize_canvas() {\n\t\t\tcanvas_elem.width = window.innerWidth;\n\t\t\tcanvas_elem.height = window.innerWidth;\n\n\t\t\tupdate_needed = true;\n\t\t}", "title": "" }, { "docid": "cbe59f9ec0e82fdec4082f7bebed1812", "score": "0.6454301", "text": "function resizeCanvas() {\n // When zoomed out to less than 100%, for some very strange reason,\n // some browsers report devicePixelRatio as less than 1\n // and only part of the canvas is cleared then.\n var ratio = Math.max(window.devicePixelRatio || 1, 1);\n\n // This part causes the canvas to be cleared\n $cbody=$('.signature-pad--body')\n canvas.height=$cbody.height();\n canvas.width=$cbody.width();\n\n // This library does not listen for canvas changes, so after the canvas is automatically\n // cleared by the browser, SignaturePad#isEmpty might still return false, even though the\n // canvas looks empty, because the internal data of this library wasn't cleared. To make sure\n // that the state of this library is consistent with visual state of the canvas, you\n // have to clear it manually.\n $scope.signaturePad.clear();\n\n }", "title": "" }, { "docid": "b04ed7f62af96bad2a86c52c23ee75d7", "score": "0.6447053", "text": "_refresh() {\n this._context.clearRect(0, 0, this._canvas.height, this._canvas.width);\n this._canvas.height = this._container.clientHeight;\n this._canvas.width = this._container.clientWidth;\n }", "title": "" }, { "docid": "b868d610ca92d5ec3e7717003dc8eee3", "score": "0.64312047", "text": "function afterResize () {\n width = canvas.offsetWidth;\n height = canvas.offsetHeight;\n if (window.devicePixelRatio > 1) {\n canvas.width = canvas.clientWidth * 2;\n canvas.height = canvas.clientHeight * 2;\n ctx.scale(2, 2);\n } else {\n canvas.width = width;\n canvas.height = height;\n }\n GLOBE_RADIUS = width * 0.7;\n GLOBE_CENTER_Z = -GLOBE_RADIUS;\n PROJECTION_CENTER_X = width / 2;\n PROJECTION_CENTER_Y = height / 2;\n FIELD_OF_VIEW = width * 0.8;\n \n createDots(); // Reset all dots\n}", "title": "" }, { "docid": "1d25b43021a64c39e771869e57b85f97", "score": "0.6416895", "text": "function resizeCanvas() {\n\t c.width = c.clientWidth;\n\t c.height = c.clientHeight;\n\t c.aspect = c.width/c.height;\n\t gl.viewport(0,0,c.width,c.height);\n\t feedback.allocate2(c.width,c.height);\n\t\theightflow.allocate(c.width,c.height);\n\t}", "title": "" }, { "docid": "a0a55465c331622f9ce09aefcc9984b0", "score": "0.6413862", "text": "function windowResized(){\n resizeCanvas(windowWidth, windowHeight);\n}", "title": "" }, { "docid": "91140add7a808d605beb216923be0738", "score": "0.639962", "text": "function updateSize() {\n\t\tfontSize = parseInt($scope.gimme(\"FontSize\"));\n\t\tif(fontSize < 5) {\n\t\t\tfontSize = 5;\n\t\t}\n\n\t\tvar rw = $scope.gimme(\"DrawingArea:width\");\n\t\tif(typeof rw === 'string') {\n\t\t\trw = parseFloat(rw);\n\t\t}\n\t\tif(rw < 1) {\n\t\t\trw = 1;\n\t\t}\n\n\t\tvar rh = $scope.gimme(\"DrawingArea:height\");\n\t\tif(typeof rh === 'string') {\n\t\t\trh = parseFloat(rh);\n\t\t}\n\t\tif(rh < 1) {\n\t\t\trh = 1;\n\t\t}\n\n\t\tif(myCanvas === null) {\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tmyCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tmyCanvas.width = rw;\n\t\tmyCanvas.height = rh;\n\n\t\tif(dropCanvas === null) {\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theDropCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tdropCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to draw on!\");\n\t\t\t}\n\t\t}\n\t\tif(dropCanvas) {\n\t\t\tdropCanvas.width = rw;\n\t\t\tdropCanvas.height = rh;\n\t\t}\n\n\t\tif(selectionCanvas === null) {\n\t\t\tvar selectionCanvasElement = $scope.theView.parent().find('#theSelectionCanvas');\n\t\t\tif(selectionCanvasElement.length > 0) {\n\t\t\t\tselectionCanvas = selectionCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no selectionCanvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tselectionCanvas.width = rw;\n\t\tselectionCanvas.height = rh;\n\t\tselectionCanvas.style.left = 0;\n\t\tselectionCanvas.style.top = 0;\n\n\t\tif(selectionHolderElement === null) {\n\t\t\tselectionHolderElement = $scope.theView.parent().find('#selectionHolder');\n\t\t}\n\t\tselectionHolderElement.width = rw;\n\t\tselectionHolderElement.height = rh;\n\t\tselectionHolderElement.top = 0;\n\t\tselectionHolderElement.left = 0;\n\n\t\tvar selectionRectElement = $scope.theView.parent().find('#selectionRectangle');\n\t\tselectionRectElement.width = rw;\n\t\tselectionRectElement.height = rh;\n\t\tselectionRectElement.top = 0;\n\t\tselectionRectElement.left = 0;\n\t\tif(selectionRectElement.length > 0) {\n\t\t\tselectionRect = selectionRectElement[0];\n\t\t\tselectionRect.width = rw;\n\t\t\tselectionRect.height = rh;\n\t\t\tselectionRect.top = 0;\n\t\t\tselectionRect.left = 0;\n\t\t}\n\t}", "title": "" }, { "docid": "119399ae6b4d251e148bdf54456a36d8", "score": "0.63872564", "text": "function fixSize(faceData) {\n var faceCenterX = faceData.faceX + faceData.faceWidth / 2;\n var faceCenterY = faceData.faceY + faceData.faceWidth / 2;\n\n var faceWidthBefore = faceData.faceWidth;\n var faceHeightBefore = faceData.faceHeight;\n\n for(var i = 0; i < positionKeys.length; i++) {\n if(positionKeys[i] == \"face\") continue;\n if(faceData[positionKeys[i] + \"X\"] == \"NA\") continue; \n\n var oldX = faceData[positionKeys[i] + \"X\"];\n var oldY = faceData[positionKeys[i] + \"Y\"];\n\n var xDiff = oldX - faceCenterX;\n var yDiff = oldY - faceCenterY;\n\n var stretchX;\n if(xDiff > 0) { // point right of face's center\n stretchX = xDiff * (canvas.width / faceWidthBefore);\n } else { // point left of face's center\n stretchX = xDiff * (canvas.width / faceWidthBefore);\n }\n faceData[positionKeys[i] + \"X\"] = faceCenterX + stretchX;\n\n var stretchY;\n if(yDiff > 0) { // point below face's center\n stretchY = yDiff * (canvas.height / faceHeightBefore);\n } else { // point above face's center\n stretchY = yDiff * (canvas.height / faceHeightBefore);\n }\n faceData[positionKeys[i] + \"Y\"] = faceCenterY + stretchY;\n }\n faceData.faceWidth = canvas.width;\n faceData.faceHeight = canvas.height;\n faceData.faceX = 0;\n faceData.faceY = 0;\n}", "title": "" }, { "docid": "18afe029eff458b41d9b967f56da9a6e", "score": "0.6367895", "text": "function resizeEnd() {\n graph._canvas.background.resize();\n\n graph._calculateGraphSize();\n\n graph._plot();\n\n timeOutResize = undefined;\n self._resizing = false;\n } //Clear graph, hightlight and spinner features on resize start.", "title": "" }, { "docid": "671771308de7795fc33a10a407925c0b", "score": "0.6352811", "text": "function updateCanvasDimensions()\n{\n\t//note that changing the canvas dimensions clears the canvas.\n\tcanvasWrapper.attr(\"height\", $(window).height(true));\n\tcanvasWrapper.attr(\"width\", $(window).width(true));\n\t\n\t//save the canvas offset\n\tcanvasOffset = canvasWrapper.offset();\t\n\t\n\t//if we have an overlay canvas\n\tif(canvasOverlayWrapper)\n\t{\n\t\t//resize it\n\t\tcanvasOverlayWrapper.attr(\"height\", $(window).height(true));\n\t\tcanvasOverlayWrapper.attr(\"width\", $(window).width(true));\n\t\tcanvasOverlayOffset = canvasOverlayWrapper.offset();\n\t}\t\n}", "title": "" }, { "docid": "1725f9b34c0ca27f78fda55889066560", "score": "0.6344626", "text": "function windowResized() {\n\taction = true;\n\tresizeCanvas(windowWidth, windowHeight);\n\tW = windowWidth;\n\tH = windowHeight;\n\tcameras[camera].S = (22*sqrt(width*height/1000));\n\tresizeCanvas(windowWidth, windowHeight);\n}", "title": "" }, { "docid": "5ac73950b62f059a6fe6593a22100e2a", "score": "0.63332784", "text": "reDraw() {\n const canvas = this.canvas;\n\n this.getContext().clearRect(0, 0, canvas.width, canvas.height);\n this.draw();\n }", "title": "" }, { "docid": "3c7d5fd8c3b58ce55f03a4b08a0c0bd0", "score": "0.63294625", "text": "function updateSize() {\n\t\t// $log.log(preDebugMsg + \"updateSize\");\n\t\tfontSize = parseInt($scope.gimme(\"FontSize\"));\n\t\tif(fontSize < 5) {\n\t\t\tfontSize = 5;\n\t\t}\n\n\t\tvar rw = $scope.gimme(\"DrawingArea:width\");\n\t\tif(typeof rw === 'string') {\n\t\t\trw = parseFloat(rw);\n\t\t}\n\t\tif(rw < 1) {\n\t\t\trw = 1;\n\t\t}\n\n\t\tvar rh = $scope.gimme(\"DrawingArea:height\");\n\t\tif(typeof rh === 'string') {\n\t\t\trh = parseFloat(rh);\n\t\t}\n\t\tif(rh < 1) {\n\t\t\trh = 1;\n\t\t}\n\n\t\tvar bgDirty = false;\n\t\tif(bgCanvas === null) {\n\t\t\tbgDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theBgCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tbgCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(bgCanvas.width != rw) {\n\t\t\tbgDirty = true;\n\t\t\tbgCanvas.width = rw;\n\t\t}\n\t\tif(bgCanvas.height != rh) {\n\t\t\tbgDirty = true;\n\t\t\tbgCanvas.height = rh;\n\t\t}\n\n\t\tvar lineDirty = false;\n\t\tif(lineCanvas === null) {\n\t\t\tlineDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theLineCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tlineCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(lineCanvas.width != rw) {\n\t\t\tlineDirty = true;\n\t\t\tlineCanvas.width = rw;\n\t\t}\n\t\tif(lineCanvas.height != rh) {\n\t\t\tlineDirty = true;\n\t\t\tlineCanvas.height = rh;\n\t\t}\n\n\t\tvar axesDirty = false;\n\t\tif(axesCanvas === null) {\n\t\t\taxesDirty = true;\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theAxesCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\taxesCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif(axesCanvas.width != rw) {\n\t\t\taxesDirty = true;\n\t\t\taxesCanvas.width = rw;\n\t\t}\n\t\tif(axesCanvas.height != rh) {\n\t\t\taxesDirty = true;\n\t\t\taxesCanvas.height = rh;\n\t\t}\n\n\t\tif(selectionCanvas === null) {\n\t\t\tvar selectionCanvasElement = $scope.theView.parent().find('#theSelectionCanvas');\n\t\t\tif(selectionCanvasElement.length > 0) {\n\t\t\t\tselectionCanvas = selectionCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no selectionCanvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tselectionCanvas.width = rw;\n\t\tselectionCanvas.height = rh;\n\t\tselectionCanvas.style.left = 0;\n\t\tselectionCanvas.style.top = 0;\n\n\t\tif(selectionHolderElement === null) {\n\t\t\tselectionHolderElement = $scope.theView.parent().find('#selectionHolder');\n\t\t}\n\t\tselectionHolderElement.width = rw;\n\t\tselectionHolderElement.height = rh;\n\t\tselectionHolderElement.top = 0;\n\t\tselectionHolderElement.left = 0;\n\n\t\tvar selectionRectElement = $scope.theView.parent().find('#selectionRectangle');\n\t\tselectionRectElement.width = rw;\n\t\tselectionRectElement.height = rh;\n\t\tselectionRectElement.top = 0;\n\t\tselectionRectElement.left = 0;\n\t\tif(selectionRectElement.length > 0) {\n\t\t\tselectionRect = selectionRectElement[0];\n\t\t\tselectionRect.width = rw;\n\t\t\tselectionRect.height = rh;\n\t\t\tselectionRect.top = 0;\n\t\t\tselectionRect.left = 0;\n\t\t}\n\n\t\tvar W = selectionCanvas.width;\n\t\tvar H = selectionCanvas.height;\n\t\tdrawW = W - leftMarg - rightMarg;\n\t\tdrawH = H - topMarg - bottomMarg * 2 - fontSize;\n\n\t\t// $log.log(preDebugMsg + \"updateSize found selections: \" + JSON.stringify(selections));\n\t\tupdateSelectionsWhenZoomingOrResizing();\n\t\t// $log.log(preDebugMsg + \"updateSize updated selections to: \" + JSON.stringify(selections));\n\t}", "title": "" }, { "docid": "6562157d7606b086e8a0a205736996ba", "score": "0.6313562", "text": "resize() {\r\n this.canvas.width = parent.innerWidth;\r\n this.canvas.height = parent.innerHeight;\r\n }", "title": "" }, { "docid": "0ba9b3e953796ce0888b1bd31b6fa28b", "score": "0.6307902", "text": "function ResizeCanvas() {\n canvas.width = pbg.offsetWidth;\n canvas.height = pb.offsetHeight;\n }", "title": "" }, { "docid": "7b652f702557a34fd6026a6786c304e8", "score": "0.6296617", "text": "function windowResized(){\n resizeCanvas(windowWidth,windowHeight);\n}", "title": "" }, { "docid": "7b652f702557a34fd6026a6786c304e8", "score": "0.6296617", "text": "function windowResized(){\n resizeCanvas(windowWidth,windowHeight);\n}", "title": "" }, { "docid": "bbdad6309622ed3420c6c08bb1439b13", "score": "0.62858677", "text": "updateCanvas(){\n this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n \n // Draws treasuremap image\n this.ctx.drawImage(this.treasuremap, 0, 0);\n \n // Draws treasure chest cross when found\n if (this.treasureChest.isShown == true){\n this.ctx.beginPath();\n this.ctx.moveTo(this.treasureChest.x - 32, this.treasureChest.y - 32);\n this.ctx.lineTo(this.treasureChest.x + 32, this.treasureChest.y + 32);\n this.ctx.moveTo(this.treasureChest.x + 32, this.treasureChest.y - 32);\n this.ctx.lineTo(this.treasureChest.x - 32, this.treasureChest.y + 32);\n this.ctx.strokeStyle = '#ff0000';\n this.ctx.lineWidth = 4;\n this.ctx.stroke();\n }\n }", "title": "" }, { "docid": "35ab0859ffc39d577345072eb6e0e1b7", "score": "0.6283929", "text": "function windowResized(){\n resizeCanvas(windowWidth, windowHeight);\n}", "title": "" }, { "docid": "35ab0859ffc39d577345072eb6e0e1b7", "score": "0.6283929", "text": "function windowResized(){\n resizeCanvas(windowWidth, windowHeight);\n}", "title": "" }, { "docid": "8b77b1733bc2d6e436ba7f89fbd16cc5", "score": "0.6262826", "text": "handleWindowResize() {\n console.log('window resized');\n this.ctx.canvas.width = this.ctx.canvas.parentElement.offsetWidth;\n this.ctx.canvas.height = this.ctx.canvas.parentElement.offsetHeight;\n this.draw();\n }", "title": "" }, { "docid": "08ebdee6dda2e58ace8b88593f92c3d2", "score": "0.6254686", "text": "function canvasResize() {\n var w = window.outerWidth;\n var h = window.outerHeight;\n //var topRuler = document.getElementById('kmds-top-ruler');\n //var leftRuler = document.getElementById('kmds-left-ruler');\n /*var active_page_object = canvas.getActivePageObj();\n if(active_page_object){\n var zoomLevel = canvas.getZoom();\n var page_height = (active_page_object.height * zoomLevel) + active_page_object.top;\n if(h < (page_height + 100)){\n h = h*zoomLevel;\n }\n if(page_height > 1366) {\n leftRuler.setHeight(h);\n }\n var page_width = (active_page_object.width * zoomLevel) + active_page_object.left;\n if(w < page_width){\n w = w*zoomLevel;\n }\n if(page_width > 1366) {\n topRuler.setWidth(w);\n }\n }*/\n canvas.setWidth(w);\n canvas.setHeight(h);\n}", "title": "" }, { "docid": "ae7925ec50a3dd30d041ea14b699919a", "score": "0.62508637", "text": "setCanvasSize () {\n let elementBounds = this.element.getBoundingClientRect()\n this.canvas.width = elementBounds.width\n this.canvas.height = elementBounds.height\n this.draw()\n }", "title": "" }, { "docid": "fb4fa1e7b916f08dae79293a5f62cfa0", "score": "0.62483233", "text": "function windowResized(){\n resizeCanvas(windowWidth, windowHeight);\n}", "title": "" }, { "docid": "da06adfb7336de272cb16f79e604ceca", "score": "0.6246477", "text": "function modifyCanvas(){\n $('#daikin-option').removeClass('is-active');\n canvas.discardActiveObject().renderAll();\n $(\".deleteBtn\").remove(); \n // daikin_Nexura.checkQuantity();\n // daikin_Temp.checkQuantity();\n daikin_Us7.checkQuantity();\n daikin_OutDoor.checkQuantity();\n if(state.length - 1 - mods >= 0){\n if(state[state.length - 1 - mods].backgroundImage !== undefined &&\n state[state.length - 1 - mods].backgroundImage.scaleX !== undefined &&\n state[state.length - 1 - mods].backgroundImage.scaleY !== undefined){\n let state_wid = state[state.length - 1 - mods].backgroundImage.width * state[state.length - 1 - mods].backgroundImage.scaleX;\n let state_hei = state[state.length - 1 - mods].backgroundImage.height * state[state.length - 1 - mods].backgroundImage.scaleY;\n canvas.setDimensions({width: state_wid, height: state_hei});\n }\n }\n}", "title": "" }, { "docid": "98cc75a367d0acba7542ced930836110", "score": "0.62328213", "text": "function resizeCanvas(){\n \tif(canvasContainer!=undefined){\n\t\tcanvasContainer.scaleX=canvasContainer.scaleY=scalePercent;\n\t}\n}", "title": "" }, { "docid": "c33249a9bde7fc0b97a112a642f3039d", "score": "0.6224121", "text": "function windowResize(){\n createCanvas()\n}", "title": "" }, { "docid": "200d05a2c712caaa16c69b12877d513b", "score": "0.6222186", "text": "function windowResized(){\n// resizeCanvas(windowWidth/2, windowHeight);\n if(windowWidth < windowHeight){\n resizeCanvas(windowWidth, windowHeight);\n } else{\n resizeCanvas(windowWidth/2, windowHeight);\n }\n}", "title": "" }, { "docid": "f1e7eca969f6c29e636d3cad58376dcc", "score": "0.62218666", "text": "function windowResized() {\n resizeCanvas(windowWidth,windowHeight);\n}", "title": "" }, { "docid": "58168c67d315716ecfd360f317c7ed3c", "score": "0.62187004", "text": "function myOnresizebeforedraw (obj)\n {\n var gutterLeft = obj.get('gutterLeft');\n var gutterRight = obj.get('gutterRight');\n \n obj.set('hmargin', (obj.canvas.width - gutterLeft - gutterRight) / (obj.original_data[0].length * 2));\n }", "title": "" }, { "docid": "f9e9fa303a1743d027a034170aacedba", "score": "0.62117785", "text": "function updateCanvasSize(){\n\tcanvasWidth = $('#content').width()*2;\n\tcanvasHeight = $('#content').height()*2;\n\t$('#canvasMain').attr('width',canvasWidth\t);\n\t$('#canvasMain').attr('height',canvasHeight);\n\tcanvasWidth2 = $('#content').width();\n\tcanvasHeight2 = $('#content').height();\n\t$('#canvasMain').width(canvasWidth2);\n\t$('#canvasMain').height(canvasHeight2);\n\t$('#canvasOverlay').width(canvasWidth2);\n\t$('#canvasOverlay').height(canvasHeight2);\n\t$('#canvasOverlay').attr('width',canvasWidth2);\n\t$('#canvasOverlay').attr('height',canvasHeight2);\n\tcanvas = document.getElementById(\"canvasMain\");\n\trect = canvas.getBoundingClientRect();\n\tif(gl){render(0);}\n\tconsole.log(canvasWidth2);\n}", "title": "" }, { "docid": "5cadfb2c4963b1f03e0b62c3c84b7d1b", "score": "0.62105983", "text": "resizeCanvas() {\n\n var winWidth = window.innerWidth;\n var canvas = this.refs.canvas;\n\n canvas.width = winWidth * 0.65;\n\n this.updateCanvase(this.state.drawings);\n }", "title": "" }, { "docid": "45e4d115279eb1c82aa9dc2e57557ca2", "score": "0.6207613", "text": "function windowResized() {\n resizeCanvas(windowWidth,windowHeight*2);\n}", "title": "" }, { "docid": "4121a0aa43986e55437d1b511bfb8759", "score": "0.6206688", "text": "function resize() {\n canvas.setSize(window.innerHeight, window.innerWidth);\n canvas.drawStack();\n popup.position(popup.current);\n}", "title": "" }, { "docid": "b8fa44e925ebd81c50a21b91b25469b3", "score": "0.62050277", "text": "function resized() {\n\tconst size = {x:CANVAS.clientWidth, y:CANVAS.clientHeight};\n\tCANVAS.width = size.x;\n\tCANVAS.height = size.y;\n\tqueueUpdate();\n}", "title": "" }, { "docid": "d0fecde8367b228c97824337f51ca72c", "score": "0.6203276", "text": "_refresh() {\n const HEIGHT = this._parentElement.clientHeight;\n const WIDTH = this._parentElement.clientWidth;\n\n this._canvas.height = HEIGHT;\n this._canvas.width = WIDTH;\n }", "title": "" }, { "docid": "b390c4b16920ec82bb5cb6ece5b57a3b", "score": "0.6201248", "text": "function refresh() {\n\t//only draw if an image was added\n\tif (img != null) {\n\t\tprepareDrawing();\n\t\tresizeCanvas();\n\t\t//update the seeker window on the preview img\n\t\tupdateSeekerWindowVariables();\n\t\tupdateSeekerWindow();\n\t\tdraw();\t\t\n\t}\n}", "title": "" }, { "docid": "530813995f5fa6390cdb179c9d9c1ae6", "score": "0.61965275", "text": "function windowResized() { \n resizeCanvas(windowWidth, windowHeight);\n}", "title": "" }, { "docid": "80f174da822f229eca4da05df1019fa2", "score": "0.6195698", "text": "resizeHandler() {\n this.width = this.canvas.width = this.ui.canvasP.clientWidth;\n this.height = this.canvas.height = this.ui.canvasP.clientHeight;\n \n const boundingClientRect = this.canvas.getBoundingClientRect();\n this.mouseOffsetX = boundingClientRect.left;\n this.mouseOffsetY = boundingClientRect.top;\n\n this.requestRender();\n }", "title": "" }, { "docid": "50942846071a5fb9de8c75a6798a2950", "score": "0.61941123", "text": "function windowResized() {\n resizeCanvas(windowWidth, windowHeight, false);\n initCircle();\n}", "title": "" }, { "docid": "ce1e4bc6d8f0e35bd78ac35fe186471d", "score": "0.6187808", "text": "function windowResized() {\n resizeCanvas(canW, canH)\n canW = container.offsetWidth\n canH = container.offsetHeight\n}", "title": "" }, { "docid": "9a39630a4300f91744525e249bd0b8d9", "score": "0.6183045", "text": "function resizeCanvas() {\n canvas = document.getElementById('canvas');\n canvas_context = canvas.getContext(\"2d\");\n canvas.width = window.innerWidth*0.4 - 5;\n canvas.height = window.innerHeight*0.5 - 5;\n redraw();\n }", "title": "" }, { "docid": "26ed9ff0f2c2fc066b38f018ec2256d4", "score": "0.61692214", "text": "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n draw();\n}", "title": "" }, { "docid": "963d796d4d18beca759ceb7e8c831a21", "score": "0.6167393", "text": "function resizeCanvas()\n{\n if(windowSizeHeight!=$(window).height() || windowSizeWidth!=$(window).width())\n {\n windowSizeWidth=$(window).width();\n windowSizeHeight=$(window).height();\n $(\"#grid_canvas\").attr('width',$(window).width()-2);\n $(\"#grid_canvas\").attr('height',$(window).height()-70);\n $(\"#grid_canvas\").css(\"margin-top\",\"60px\");\n $(\"#grid_canvas\").css(\"margin-left\",\"-30px\");\n\n draw();\n\n }\n\n //we adjust the canvas to the screen\n\n setTimeout(function(){resizeCanvas()}, 1000);\n}", "title": "" }, { "docid": "821461eff52a211b28a3444443ae6c68", "score": "0.6151691", "text": "updateDrawing() {\n P5.image(this.graphicsBuffer, 0, 0);\n }", "title": "" }, { "docid": "7920fd0e607ba6ca31eacc6a5d114846", "score": "0.61475843", "text": "on_resize_complete() {\n this.render()\n }", "title": "" }, { "docid": "e6f019bd24f90a24752f2cab354ce8bd", "score": "0.6145047", "text": "function windowResized() {\r\n resizeCanvas(windowWidth, windowHeight, false);\r\n}", "title": "" }, { "docid": "6d4e79cf4942ec80e1422d54ee52bcaf", "score": "0.61434704", "text": "function initialDraw(e)\r\n{\r\n\tvar surfaceContext = surface.getContext('2d');\r\n\tsurfaceContext.drawImage(wheel, 0, 0);\r\n}", "title": "" }, { "docid": "25ec56f7c44d16fe901438040e8741f6", "score": "0.61426014", "text": "_resize() {\n\n let width = this.width,\n height = this.height;\n\n // change canvas sizes\n this.canvas.width = width;\n this.canvas.height = height;\n \n // update the renderer's sizes\n this.renderer.setSize(width, height);\n this.camera.fov = this._getFOV();\n this.camera.aspect = width / height;\n this.camera.updateProjectionMatrix();\n\n // events\n this.lbt('resize');\n\n }", "title": "" }, { "docid": "49d12ddefef953319cdcc103586c4ee1", "score": "0.61410934", "text": "function onresize(w,h)\n{\n\taspect=calcAspect();\n\tif (aspect < 1.) {\n\t\tforcesize(w,h);\n\t\taspect=1.;\n\t}\n\tinitPoints();\n\tbang();\n}", "title": "" }, { "docid": "e0fcd1b33d6bf990549b84d4e66bef42", "score": "0.61392814", "text": "updateCanvasSize() {\n let width = this.canvasWrapper.offsetWidth\n let height = this.canvasWrapper.offsetHeight\n\n this.canvas.width = width * 2\n this.canvas.height = height * 2\n this.canvas.style.width = width + 'px'\n this.canvas.style.height = height + 'px';\n }", "title": "" }, { "docid": "378ac55f56d1bc66476001b0cdacb58c", "score": "0.61346245", "text": "function onResize() {\n render();\n}", "title": "" }, { "docid": "049a85a5ce2971b79c4fdcb1453f3833", "score": "0.6130279", "text": "fitToScreen() {\n var rect = this.getRectofPoints(this.points);\n var rateX = 0, rateY = 0;\n this.wx = 0;\n this.wy = 0;\n rateX = (this.canvas.width-20)/(rect.xMax-rect.xMin);\n rateY = (this.canvas.height-20)/(rect.yMax-rect.yMin);\n if(rateX > rateY) {\n this.scale = 1 * rateY;\n }\n else {\n this.scale = 1 * rateX;\n }\n this.wx = (this.zoomedX(rect.xMin)-(this.canvas.width-this.zoomedX(rect.xMax)+this.zoomedX(rect.xMin))/2)/this.scale; // world zoom origin\n this.wy = (this.zoomedY(rect.yMin)-(this.canvas.height-this.zoomedY(rect.yMax)+this.zoomedY(rect.yMin))/2)/this.scale;\n this.drawLine();\n }", "title": "" }, { "docid": "c4c97b91c59d508f3841b86bc0667f6e", "score": "0.61297226", "text": "function resizeCanvas() {\n\tconst pWidth = ctx.parentElement.clientWidth;\n\tconst pHeight = ctx.parentElement.clientHeight;\n\tctx.canvas.style.width = `${pWidth}px`;\n\tctx.canvas.style.height = `${pHeight}px`;\n\tctx.parentWidth = pWidth;\n\tctx.parentHeight = pHeight;\n\tctx.render();\n}", "title": "" }, { "docid": "cf35b342cff0b8963913203011a02acc", "score": "0.61284524", "text": "paint() {\n\n this.erase();\n\n // begin animation\n this.rAF = requestAnimationFrame((timestamp) => {\n this._paint(timestamp);\n });\n\n // fire onStart callback\n if (this.options.onStart !== null) {\n this.options.onStart();\n }\n }", "title": "" }, { "docid": "811d801c22e98b975a33a476464c7058", "score": "0.61216986", "text": "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "title": "" }, { "docid": "811d801c22e98b975a33a476464c7058", "score": "0.61216986", "text": "function windowResized() {\n resizeCanvas(windowWidth, windowHeight);\n}", "title": "" }, { "docid": "dcbb2d49e2b20d59a3fdb55dc4a48ee3", "score": "0.6116676", "text": "function doRedraw() {\n\n doClearScreen(false);\n\n var lowerFrameStart = visibleWidth * canvasCharacterHeight; // redrawX + visibleXStart\n \n if (canvases==1) {\n\t\t\n var sx = visibleXStart * canvasCharacterWidth; // The x coordinate of the upper left corner of the rectangle from which the ImageData will be extracted.\n var sy = (visibleHeight + visibleYStart + 1) * canvasCharacterHeight; // The y coordinate of the upper left corner of the rectangle from which the ImageData will be extracted.\n var sw = (visibleWidth) * canvasCharacterWidth; // The width of the rectangle from which the ImageData will be extracted.\n var sh = (visibleHeight - 1) * canvasCharacterHeight; // The height of the rectangle from which the ImageData will be extracted. \n //console.log(\"sx: \"+sx+\" sy: \"+sy+\" sw: \"+sw+\" sh: \"+sh);\n var imgData = ctx.getImageData(sx, sy, sw, sh);\n ctx.putImageData(imgData, 0, 0);\n \n } else {\n var sx = visibleXStart * canvasCharacterWidth; // The x coordinate of the upper left corner of the rectangle from which the ImageData will be extracted.\n var sy = ( visibleYStart ) * canvasCharacterHeight; // The y coordinate of the upper left corner of the rectangle from which the ImageData will be extracted.\n var sw = (visibleWidth) * canvasCharacterWidth; // The width of the rectangle from which the ImageData will be extracted.\n var sh = (visibleHeight - 1) * canvasCharacterHeight; // The height of the rectangle from which the ImageData will be extracted. \n //console.log(\"sx: \"+sx+\" sy: \"+sy+\" sw: \"+sw+\" sh: \"+sh);\n var imgData = ctx2.getImageData(sx, sy, sw, sh);\n ctx.putImageData(imgData, 0, 0);\n \n }\n\n updateScrollbarX(true, 0); // draw the scrollbar at the bottom, x position = 0 \n updateScrollbarY(true, 0); // Show a part of the scrollbar again\n //\talert(sx+\"==\"+sy+\"==\"+sw+\"==\"+sh)\n}", "title": "" }, { "docid": "89afcf2c1c5f75172d472ece29bc625f", "score": "0.61153734", "text": "function resizeDisplay() {\n\tcanvas.width = $('.canvas-wrap').width();\n\tcanvas.height = $('.canvas-wrap').height();\n\n\t//These seem to reset when the canvas dimensions are adjusted\n\t//Need to look into why later\n\tctx.mozImageSmoothingEnabled = false;\n\tctx.webkitImageSmoothingEnabled = false;\n\tctx.msImageSmoothingEnabled = false;\n\tctx.imageSmoothingEnabled = false;\n}", "title": "" }, { "docid": "728ba02b902235e9dd1b67ec2d558fe8", "score": "0.6115015", "text": "function windowResized() {\r\n resizeCanvas(windowWidth, windowHeight)\r\n }", "title": "" }, { "docid": "7d9a0759d1b6dba0b635437988a419e5", "score": "0.61024773", "text": "function windowResized() {\n resizeCanvas(window.innerWidth,window.innerHeight);\n resetCamera();\n}", "title": "" }, { "docid": "3def8f9ba2ac95ee14a8e0d7430322a3", "score": "0.6094073", "text": "function onResize() {\n\t\n\t\tcanvas.width = window.innerWidth;\n\t\tcanvas.height = window.innerHeight;\n\t\t\n\t\tdots = [], dirtyRegions = [];\n\t\n\t}", "title": "" }, { "docid": "b86271963c6d4d2e3c2605155dde8a49", "score": "0.6093315", "text": "function resize()\n{\n drawGrid();\n sketchListen();\n}", "title": "" }, { "docid": "b90199f2cbae77ba274d165cd856ea93", "score": "0.6092172", "text": "resize () {\n this.canvas.width = this.parent.clientWidth\n this.canvas.height = this.parent.clientHeight\n const xLblHeight = 30\n const yGuess = 40 // y label width guess. Will be adjusted when drawn.\n const plotExtents = new Extents(yGuess, this.canvas.width, 10, this.canvas.height - xLblHeight)\n const xLblExtents = new Extents(yGuess, this.canvas.width, this.canvas.height - xLblHeight, this.canvas.height)\n const yLblExtents = new Extents(0, yGuess, 10, this.canvas.height - xLblHeight)\n this.plotRegion = new Region(this.ctx, plotExtents)\n this.xRegion = new Region(this.ctx, xLblExtents)\n this.yRegion = new Region(this.ctx, yLblExtents)\n // The button region extents are set during drawing.\n this.zoomInBttn = new Region(this.ctx, new Extents(0, 0, 0, 0))\n this.zoomOutBttn = new Region(this.ctx, new Extents(0, 0, 0, 0))\n this.rect = this.canvas.getBoundingClientRect()\n if (this.book) this.draw()\n }", "title": "" }, { "docid": "509d512dce5abca64ee12163d737ef8f", "score": "0.6091183", "text": "function windowResized() {\n resizeCanvas(innerWidth * 0.7, innerHeight);\n background(0);\n}", "title": "" }, { "docid": "5832c3dbd28f68aa72fb48001356d571", "score": "0.6086843", "text": "function windowResized() {\n resizeCanvas(windowWidth/1.43, windowHeight/1.43);\n}", "title": "" }, { "docid": "eea1eec3f1ebaeece6a0eeb9902723c8", "score": "0.60862625", "text": "_updateCanvasSize() {\n if (this._checkForCanvasSizeChange()) {\n const {width, height} = this;\n this.viewManager.setProps({width, height});\n this.props.onResize({width: this.width, height: this.height});\n }\n }", "title": "" }, { "docid": "be8eefa2177537816bf75d414e49a8a5", "score": "0.606665", "text": "function windowResized() {\n resizeCanvas(windowWidth, windowHeight, false);\n}", "title": "" }, { "docid": "4bc7b9277d17eb76cb8128be9090c846", "score": "0.6065566", "text": "function handle_resize () {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n}", "title": "" }, { "docid": "37f4e51ee9e17df6a30d69026dd7d44e", "score": "0.60624105", "text": "function OnResize() {\n canvasWidth = window.innerWidth * 0.5;\n canvasHeight = window.innerHeight * 0.5;\n canvasHalfWidth = canvasWidth * 0.5;\n canvasHalfHeight = canvasHeight * 0.5;\n canvas.setAttribute(\"width\", canvasWidth.toString());\n canvas.setAttribute(\"height\", canvasHeight.toString());\n //have the objects been created yet?\n if (helloLabel) {\n helloLabel.x = canvasHalfWidth;\n helloLabel.y = canvasHalfHeight;\n goodbyeLabel.x = canvasHalfWidth;\n goodbyeLabel.y = canvasHalfHeight;\n clickMeButton.x = canvasHalfWidth;\n clickMeButton.y = canvasHalfHeight + 75;\n }\n }", "title": "" }, { "docid": "d324447106ee5fee560083873b2f8049", "score": "0.60570866", "text": "function updateCanvasSize(){\n \n // update canvas size\n var maxW = document.getElementById('gameInfoHeader').scrollWidth;\n var maxH = Math.floor( document.documentElement.clientHeight*0.9-202 );\n \n // set new canvas size using maximum width\n var w = maxW;\n var h = maxW*0.75;\n \n // if height is too high, resize canvas using maximum height\n if(maxW*0.75 > maxH){\n \th = maxH;\n \tw = Math.floor( maxH*(1/0.75) );\n }\n \n canvas.width = w;\n canvas.height = h;\n \n}", "title": "" } ]